aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/Kconfig16
-rw-r--r--arch/alpha/include/asm/cacheflush.h1
-rw-r--r--arch/alpha/include/asm/socket.h2
-rw-r--r--arch/alpha/include/asm/thread_info.h27
-rw-r--r--arch/alpha/include/asm/unistd.h3
-rw-r--r--arch/alpha/kernel/core_marvel.c2
-rw-r--r--arch/alpha/kernel/core_titan.c2
-rw-r--r--arch/alpha/kernel/irq.c2
-rw-r--r--arch/alpha/kernel/irq_alpha.c2
-rw-r--r--arch/alpha/kernel/irq_i8259.c2
-rw-r--r--arch/alpha/kernel/irq_pyxis.c2
-rw-r--r--arch/alpha/kernel/irq_srm.c2
-rw-r--r--arch/alpha/kernel/sys_alcor.c2
-rw-r--r--arch/alpha/kernel/sys_cabriolet.c2
-rw-r--r--arch/alpha/kernel/sys_dp264.c4
-rw-r--r--arch/alpha/kernel/sys_eb64p.c2
-rw-r--r--arch/alpha/kernel/sys_eiger.c2
-rw-r--r--arch/alpha/kernel/sys_jensen.c2
-rw-r--r--arch/alpha/kernel/sys_marvel.c6
-rw-r--r--arch/alpha/kernel/sys_mikasa.c2
-rw-r--r--arch/alpha/kernel/sys_noritake.c2
-rw-r--r--arch/alpha/kernel/sys_rawhide.c2
-rw-r--r--arch/alpha/kernel/sys_ruffian.c2
-rw-r--r--arch/alpha/kernel/sys_rx164.c2
-rw-r--r--arch/alpha/kernel/sys_sable.c2
-rw-r--r--arch/alpha/kernel/sys_takara.c2
-rw-r--r--arch/alpha/kernel/sys_titan.c2
-rw-r--r--arch/alpha/kernel/sys_wildfire.c2
-rw-r--r--arch/alpha/kernel/systbls.S1
-rw-r--r--arch/arm/Kconfig37
-rw-r--r--arch/arm/Kconfig.debug8
-rw-r--r--arch/arm/Makefile9
-rw-r--r--arch/arm/boot/compressed/head.S6
-rw-r--r--arch/arm/common/dmabounce.c21
-rw-r--r--arch/arm/configs/am3517_evm_defconfig (renamed from arch/arm/configs/da830_omapl137_defconfig)867
-rw-r--r--arch/arm/configs/at91rm9200dk_defconfig1
-rw-r--r--arch/arm/configs/cm_t35_defconfig1733
-rw-r--r--arch/arm/configs/cm_x300_defconfig351
-rw-r--r--arch/arm/configs/da8xx_omapl_defconfig (renamed from arch/arm/configs/da850_omapl138_defconfig)257
-rw-r--r--arch/arm/configs/davinci_all_defconfig126
-rw-r--r--arch/arm/configs/dove_defconfig1620
-rw-r--r--arch/arm/configs/ezx_defconfig947
-rw-r--r--arch/arm/configs/h3600_defconfig976
-rw-r--r--arch/arm/configs/htcherald_defconfig1142
-rw-r--r--arch/arm/configs/igep0020_defconfig1554
-rw-r--r--arch/arm/configs/mx3_defconfig101
-rw-r--r--arch/arm/configs/nuc910_defconfig (renamed from arch/arm/configs/w90p910_defconfig)0
-rw-r--r--arch/arm/configs/nuc950_defconfig922
-rw-r--r--arch/arm/configs/nuc960_defconfig922
-rw-r--r--arch/arm/configs/omap3_beagle_defconfig4
-rw-r--r--arch/arm/configs/omap3_defconfig2119
-rw-r--r--arch/arm/configs/omap3_evm_defconfig22
-rw-r--r--arch/arm/configs/omap3_pandora_defconfig5
-rw-r--r--arch/arm/configs/omap_3430sdp_defconfig998
-rw-r--r--arch/arm/configs/omap_3630sdp_defconfig1611
-rw-r--r--arch/arm/configs/omap_4430sdp_defconfig4
-rw-r--r--arch/arm/configs/omap_ldp_defconfig4
-rw-r--r--arch/arm/configs/omap_zoom2_defconfig7
-rw-r--r--arch/arm/configs/omap_zoom3_defconfig1610
-rw-r--r--arch/arm/configs/overo_defconfig4
-rw-r--r--arch/arm/configs/rx51_defconfig2
-rw-r--r--arch/arm/configs/u8500_defconfig680
-rw-r--r--arch/arm/include/asm/cacheflush.h23
-rw-r--r--arch/arm/include/asm/dma-mapping.h26
-rw-r--r--arch/arm/include/asm/hardware/cache-tauros2.h11
-rw-r--r--arch/arm/include/asm/hardware/coresight.h165
-rw-r--r--arch/arm/include/asm/hardware/iop3xx.h18
-rw-r--r--arch/arm/include/asm/kmap_types.h6
-rw-r--r--arch/arm/include/asm/memory.h16
-rw-r--r--arch/arm/include/asm/pgtable.h14
-rw-r--r--arch/arm/include/asm/socket.h2
-rw-r--r--arch/arm/include/asm/swab.h19
-rw-r--r--arch/arm/include/asm/system.h19
-rw-r--r--arch/arm/kernel/Makefile2
-rw-r--r--arch/arm/kernel/calls.S1
-rw-r--r--arch/arm/kernel/etm.c641
-rw-r--r--arch/arm/kernel/head-nommu.S2
-rw-r--r--arch/arm/kernel/head.S2
-rw-r--r--arch/arm/kernel/isa.c17
-rw-r--r--arch/arm/kernel/signal.c8
-rw-r--r--arch/arm/kernel/vmlinux.lds.S85
-rw-r--r--arch/arm/mach-at91/Kconfig96
-rw-r--r--arch/arm/mach-at91/Makefile2
-rw-r--r--arch/arm/mach-at91/at91sam9g45_devices.c56
-rw-r--r--arch/arm/mach-at91/board-eco920.c158
-rw-r--r--arch/arm/mach-at91/board-sam9m10g45ek.c1
-rw-r--r--arch/arm/mach-at91/cpuidle.c94
-rw-r--r--arch/arm/mach-at91/include/mach/board.h1
-rw-r--r--arch/arm/mach-at91/pm.c62
-rw-r--r--arch/arm/mach-at91/pm.h67
-rw-r--r--arch/arm/mach-bcmring/arch.c8
-rw-r--r--arch/arm/mach-bcmring/include/mach/io.h35
-rw-r--r--arch/arm/mach-davinci/Kconfig59
-rw-r--r--arch/arm/mach-davinci/Makefile5
-rw-r--r--arch/arm/mach-davinci/board-da830-evm.c466
-rw-r--r--arch/arm/mach-davinci/board-da850-evm.c437
-rw-r--r--arch/arm/mach-davinci/board-dm355-evm.c16
-rw-r--r--arch/arm/mach-davinci/board-dm355-leopard.c13
-rw-r--r--arch/arm/mach-davinci/board-dm365-evm.c57
-rw-r--r--arch/arm/mach-davinci/board-dm644x-evm.c15
-rw-r--r--arch/arm/mach-davinci/board-dm646x-evm.c86
-rw-r--r--arch/arm/mach-davinci/board-neuros-osd2.c323
-rw-r--r--arch/arm/mach-davinci/board-sffsdr.c20
-rw-r--r--arch/arm/mach-davinci/clock.c231
-rw-r--r--arch/arm/mach-davinci/clock.h17
-rw-r--r--arch/arm/mach-davinci/common.c4
-rw-r--r--arch/arm/mach-davinci/cp_intc.c3
-rw-r--r--arch/arm/mach-davinci/cpufreq.c226
-rw-r--r--arch/arm/mach-davinci/cpuidle.c197
-rw-r--r--arch/arm/mach-davinci/da830.c75
-rw-r--r--arch/arm/mach-davinci/da850.c298
-rw-r--r--arch/arm/mach-davinci/devices-da8xx.c106
-rw-r--r--arch/arm/mach-davinci/devices.c6
-rw-r--r--arch/arm/mach-davinci/dm355.c2
-rw-r--r--arch/arm/mach-davinci/dm365.c107
-rw-r--r--arch/arm/mach-davinci/dm644x.c7
-rw-r--r--arch/arm/mach-davinci/dm646x.c11
-rw-r--r--arch/arm/mach-davinci/dma.c105
-rw-r--r--arch/arm/mach-davinci/gpio.c9
-rw-r--r--arch/arm/mach-davinci/include/mach/asp.h11
-rw-r--r--arch/arm/mach-davinci/include/mach/common.h6
-rw-r--r--arch/arm/mach-davinci/include/mach/cpufreq.h26
-rw-r--r--arch/arm/mach-davinci/include/mach/cpuidle.h17
-rw-r--r--arch/arm/mach-davinci/include/mach/da8xx.h26
-rw-r--r--arch/arm/mach-davinci/include/mach/dm365.h10
-rw-r--r--arch/arm/mach-davinci/include/mach/dm644x.h1
-rw-r--r--arch/arm/mach-davinci/include/mach/irqs.h1
-rw-r--r--arch/arm/mach-davinci/include/mach/mux.h20
-rw-r--r--arch/arm/mach-davinci/include/mach/system.h3
-rw-r--r--arch/arm/mach-davinci/include/mach/usb.h59
-rw-r--r--arch/arm/mach-davinci/mux.c1
-rw-r--r--arch/arm/mach-davinci/psc.c3
-rw-r--r--arch/arm/mach-davinci/serial.c6
-rw-r--r--arch/arm/mach-davinci/sram.c3
-rw-r--r--arch/arm/mach-davinci/time.c6
-rw-r--r--arch/arm/mach-davinci/usb.c84
-rw-r--r--arch/arm/mach-dove/Kconfig14
-rw-r--r--arch/arm/mach-dove/Makefile3
-rw-r--r--arch/arm/mach-dove/Makefile.boot3
-rw-r--r--arch/arm/mach-dove/addr-map.c149
-rw-r--r--arch/arm/mach-dove/common.c781
-rw-r--r--arch/arm/mach-dove/common.h40
-rw-r--r--arch/arm/mach-dove/dove-db-setup.c102
-rw-r--r--arch/arm/mach-dove/include/mach/bridge-regs.h58
-rw-r--r--arch/arm/mach-dove/include/mach/debug-macro.S20
-rw-r--r--arch/arm/mach-dove/include/mach/dove.h180
-rw-r--r--arch/arm/mach-dove/include/mach/entry-macro.S39
-rw-r--r--arch/arm/mach-dove/include/mach/gpio.h49
-rw-r--r--arch/arm/mach-dove/include/mach/hardware.h26
-rw-r--r--arch/arm/mach-dove/include/mach/io.h20
-rw-r--r--arch/arm/mach-dove/include/mach/irqs.h101
-rw-r--r--arch/arm/mach-dove/include/mach/memory.h10
-rw-r--r--arch/arm/mach-dove/include/mach/pm.h54
-rw-r--r--arch/arm/mach-dove/include/mach/system.h36
-rw-r--r--arch/arm/mach-dove/include/mach/timex.h9
-rw-r--r--arch/arm/mach-dove/include/mach/uncompress.h37
-rw-r--r--arch/arm/mach-dove/include/mach/vmalloc.h5
-rw-r--r--arch/arm/mach-dove/irq.c133
-rw-r--r--arch/arm/mach-dove/pcie.c238
-rw-r--r--arch/arm/mach-ep93xx/core.c77
-rw-r--r--arch/arm/mach-ep93xx/include/mach/clkdev.h4
-rw-r--r--arch/arm/mach-ep93xx/include/mach/dma.h4
-rw-r--r--arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h1
-rw-r--r--arch/arm/mach-ep93xx/include/mach/hardware.h1
-rw-r--r--arch/arm/mach-ep93xx/include/mach/io.h1
-rw-r--r--arch/arm/mach-ep93xx/include/mach/platform.h4
-rw-r--r--arch/arm/mach-iop13xx/include/mach/memory.h2
-rw-r--r--arch/arm/mach-iop13xx/include/mach/time.h18
-rw-r--r--arch/arm/mach-iop13xx/iq81340mc.c1
-rw-r--r--arch/arm/mach-iop13xx/iq81340sc.c1
-rw-r--r--arch/arm/mach-iop32x/em7210.c1
-rw-r--r--arch/arm/mach-iop32x/glantank.c1
-rw-r--r--arch/arm/mach-iop32x/iq31244.c1
-rw-r--r--arch/arm/mach-iop32x/iq80321.c1
-rw-r--r--arch/arm/mach-iop32x/n2100.c1
-rw-r--r--arch/arm/mach-iop33x/iq80331.c1
-rw-r--r--arch/arm/mach-iop33x/iq80332.c1
-rw-r--r--arch/arm/mach-kirkwood/Kconfig12
-rw-r--r--arch/arm/mach-kirkwood/Makefile3
-rw-r--r--arch/arm/mach-kirkwood/ts219-setup.c108
-rw-r--r--arch/arm/mach-kirkwood/ts41x-setup.c154
-rw-r--r--arch/arm/mach-kirkwood/tsx1x-common.c113
-rw-r--r--arch/arm/mach-kirkwood/tsx1x-common.h7
-rw-r--r--arch/arm/mach-ks8695/include/mach/memory.h7
-rw-r--r--arch/arm/mach-mmp/aspenite.c39
-rw-r--r--arch/arm/mach-mmp/clock.c15
-rw-r--r--arch/arm/mach-mmp/clock.h1
-rw-r--r--arch/arm/mach-mmp/include/mach/irqs.h4
-rw-r--r--arch/arm/mach-mmp/include/mach/pxa168.h7
-rw-r--r--arch/arm/mach-mmp/include/mach/pxa910.h7
-rw-r--r--arch/arm/mach-mmp/pxa168.c5
-rw-r--r--arch/arm/mach-mmp/pxa910.c4
-rw-r--r--arch/arm/mach-mmp/ttc_dkb.c87
-rw-r--r--arch/arm/mach-mx2/Kconfig9
-rw-r--r--arch/arm/mach-mx2/Makefile1
-rw-r--r--arch/arm/mach-mx2/clock_imx21.c2
-rw-r--r--arch/arm/mach-mx2/clock_imx27.c6
-rw-r--r--arch/arm/mach-mx2/devices.c78
-rw-r--r--arch/arm/mach-mx2/devices.h3
-rw-r--r--arch/arm/mach-mx2/mxt_td60.c319
-rw-r--r--arch/arm/mach-mx2/pca100.c2
-rw-r--r--arch/arm/mach-mx3/Kconfig11
-rw-r--r--arch/arm/mach-mx3/Makefile5
-rw-r--r--arch/arm/mach-mx3/armadillo5x0.c60
-rw-r--r--arch/arm/mach-mx3/clock-imx35.c46
-rw-r--r--arch/arm/mach-mx3/clock.c6
-rw-r--r--arch/arm/mach-mx3/cpu.c57
-rw-r--r--arch/arm/mach-mx3/devices.c44
-rw-r--r--arch/arm/mach-mx3/devices.h2
-rw-r--r--arch/arm/mach-mx3/kzmarm11.c268
-rw-r--r--arch/arm/mach-mx3/mx31lilly-db.c10
-rw-r--r--arch/arm/mach-mx3/mx31lilly.c57
-rw-r--r--arch/arm/mach-mx3/mx31lite-db.c198
-rw-r--r--arch/arm/mach-mx3/mx31lite.c175
-rw-r--r--arch/arm/mach-mx3/mx31moboard-devboard.c86
-rw-r--r--arch/arm/mach-mx3/mx31moboard-marxbot.c192
-rw-r--r--arch/arm/mach-mx3/mx31moboard.c249
-rw-r--r--arch/arm/mach-mx3/mx35pdk.c12
-rw-r--r--arch/arm/mach-mx3/pcm043.c7
-rw-r--r--arch/arm/mach-nomadik/Kconfig2
-rw-r--r--arch/arm/mach-nomadik/Makefile2
-rw-r--r--arch/arm/mach-nomadik/board-nhk8815.c27
-rw-r--r--arch/arm/mach-nomadik/include/mach/setup.h2
-rw-r--r--arch/arm/mach-omap1/Kconfig7
-rw-r--r--arch/arm/mach-omap1/Makefile1
-rw-r--r--arch/arm/mach-omap1/board-ams-delta.c12
-rw-r--r--arch/arm/mach-omap1/board-fsample.c32
-rw-r--r--arch/arm/mach-omap1/board-generic.c8
-rw-r--r--arch/arm/mach-omap1/board-h2-mmc.c2
-rw-r--r--arch/arm/mach-omap1/board-h2.c16
-rw-r--r--arch/arm/mach-omap1/board-h3-mmc.c2
-rw-r--r--arch/arm/mach-omap1/board-h3.c14
-rw-r--r--arch/arm/mach-omap1/board-htcherald.c247
-rw-r--r--arch/arm/mach-omap1/board-innovator.c14
-rw-r--r--arch/arm/mach-omap1/board-nokia770.c22
-rw-r--r--arch/arm/mach-omap1/board-osk.c10
-rw-r--r--arch/arm/mach-omap1/board-palmte.c16
-rw-r--r--arch/arm/mach-omap1/board-palmtt.c18
-rw-r--r--arch/arm/mach-omap1/board-palmz71.c18
-rw-r--r--arch/arm/mach-omap1/board-perseus2.c32
-rw-r--r--arch/arm/mach-omap1/board-sx1-mmc.c4
-rw-r--r--arch/arm/mach-omap1/board-sx1.c18
-rw-r--r--arch/arm/mach-omap1/board-voiceblue.c8
-rw-r--r--arch/arm/mach-omap1/clock.c38
-rw-r--r--arch/arm/mach-omap1/clock.h22
-rw-r--r--arch/arm/mach-omap1/devices.c23
-rw-r--r--arch/arm/mach-omap1/fpga.c2
-rw-r--r--arch/arm/mach-omap1/id.c2
-rw-r--r--arch/arm/mach-omap1/include/mach/clkdev.h5
-rw-r--r--arch/arm/mach-omap1/include/mach/debug-macro.S45
-rw-r--r--arch/arm/mach-omap1/include/mach/entry-macro.S58
-rw-r--r--arch/arm/mach-omap1/include/mach/gpio.h5
-rw-r--r--arch/arm/mach-omap1/include/mach/hardware.h5
-rw-r--r--arch/arm/mach-omap1/include/mach/io.h5
-rw-r--r--arch/arm/mach-omap1/include/mach/irqs.h5
-rw-r--r--arch/arm/mach-omap1/include/mach/memory.h5
-rw-r--r--arch/arm/mach-omap1/include/mach/mtd-xip.h (renamed from arch/arm/plat-omap/include/mach/mtd-xip.h)0
-rw-r--r--arch/arm/mach-omap1/include/mach/smp.h5
-rw-r--r--arch/arm/mach-omap1/include/mach/system.h5
-rw-r--r--arch/arm/mach-omap1/include/mach/timex.h5
-rw-r--r--arch/arm/mach-omap1/include/mach/uncompress.h5
-rw-r--r--arch/arm/mach-omap1/include/mach/vmalloc.h20
-rw-r--r--arch/arm/mach-omap1/io.c49
-rw-r--r--arch/arm/mach-omap1/irq.c34
-rw-r--r--arch/arm/mach-omap1/leds-h2p2-debug.c2
-rw-r--r--arch/arm/mach-omap1/leds.c2
-rw-r--r--arch/arm/mach-omap1/mailbox.c2
-rw-r--r--arch/arm/mach-omap1/mcbsp.c42
-rw-r--r--arch/arm/mach-omap1/mux.c77
-rw-r--r--arch/arm/mach-omap1/pm.c114
-rw-r--r--arch/arm/mach-omap1/pm.h53
-rw-r--r--arch/arm/mach-omap1/serial.c32
-rw-r--r--arch/arm/mach-omap1/sleep.S22
-rw-r--r--arch/arm/mach-omap1/timer32k.c2
-rw-r--r--arch/arm/mach-omap2/Kconfig28
-rw-r--r--arch/arm/mach-omap2/Makefile24
-rw-r--r--arch/arm/mach-omap2/board-2430sdp.c14
-rw-r--r--arch/arm/mach-omap2/board-3430sdp.c43
-rwxr-xr-xarch/arm/mach-omap2/board-3630sdp.c101
-rw-r--r--arch/arm/mach-omap2/board-4430sdp.c23
-rw-r--r--arch/arm/mach-omap2/board-am3517evm.c86
-rw-r--r--arch/arm/mach-omap2/board-apollon.c16
-rw-r--r--arch/arm/mach-omap2/board-cm-t35.c507
-rw-r--r--arch/arm/mach-omap2/board-generic.c10
-rw-r--r--arch/arm/mach-omap2/board-h4.c20
-rw-r--r--arch/arm/mach-omap2/board-igep0020.c251
-rw-r--r--arch/arm/mach-omap2/board-ldp.c14
-rw-r--r--arch/arm/mach-omap2/board-n8x0.c16
-rw-r--r--arch/arm/mach-omap2/board-omap3beagle.c39
-rw-r--r--arch/arm/mach-omap2/board-omap3evm.c189
-rw-r--r--arch/arm/mach-omap2/board-omap3pandora.c35
-rw-r--r--arch/arm/mach-omap2/board-overo.c47
-rw-r--r--arch/arm/mach-omap2/board-rx51-peripherals.c179
-rw-r--r--arch/arm/mach-omap2/board-rx51-sdram.c221
-rw-r--r--arch/arm/mach-omap2/board-rx51.c23
-rw-r--r--arch/arm/mach-omap2/board-zoom-debugboard.c72
-rwxr-xr-xarch/arm/mach-omap2/board-zoom-peripherals.c267
-rw-r--r--arch/arm/mach-omap2/board-zoom2.c240
-rw-r--r--arch/arm/mach-omap2/board-zoom3.c59
-rw-r--r--arch/arm/mach-omap2/clock.c10
-rw-r--r--arch/arm/mach-omap2/clock.h2
-rw-r--r--arch/arm/mach-omap2/clock24xx.c8
-rw-r--r--arch/arm/mach-omap2/clock34xx.c16
-rw-r--r--arch/arm/mach-omap2/clock34xx.h2
-rw-r--r--arch/arm/mach-omap2/clockdomain.c6
-rw-r--r--arch/arm/mach-omap2/clockdomains.h2
-rw-r--r--arch/arm/mach-omap2/cm.h6
-rw-r--r--arch/arm/mach-omap2/control.c385
-rw-r--r--arch/arm/mach-omap2/cpuidle34xx.c318
-rw-r--r--arch/arm/mach-omap2/devices.c56
-rw-r--r--arch/arm/mach-omap2/emu.c66
-rw-r--r--arch/arm/mach-omap2/gpmc-onenand.c6
-rw-r--r--arch/arm/mach-omap2/gpmc-smc91x.c6
-rw-r--r--arch/arm/mach-omap2/gpmc.c102
-rw-r--r--arch/arm/mach-omap2/id.c165
-rw-r--r--arch/arm/mach-omap2/include/mach/board-zoom.h5
-rw-r--r--arch/arm/mach-omap2/include/mach/clkdev.h5
-rw-r--r--arch/arm/mach-omap2/include/mach/debug-macro.S (renamed from arch/arm/plat-omap/include/mach/debug-macro.S)19
-rw-r--r--arch/arm/mach-omap2/include/mach/entry-macro.S (renamed from arch/arm/plat-omap/include/mach/entry-macro.S)62
-rw-r--r--arch/arm/mach-omap2/include/mach/gpio.h5
-rw-r--r--arch/arm/mach-omap2/include/mach/hardware.h5
-rw-r--r--arch/arm/mach-omap2/include/mach/io.h5
-rw-r--r--arch/arm/mach-omap2/include/mach/irqs.h5
-rw-r--r--arch/arm/mach-omap2/include/mach/memory.h5
-rw-r--r--arch/arm/mach-omap2/include/mach/smp.h5
-rw-r--r--arch/arm/mach-omap2/include/mach/system.h5
-rw-r--r--arch/arm/mach-omap2/include/mach/timex.h5
-rw-r--r--arch/arm/mach-omap2/include/mach/uncompress.h5
-rw-r--r--arch/arm/mach-omap2/include/mach/vmalloc.h (renamed from arch/arm/plat-omap/include/mach/vmalloc.h)3
-rw-r--r--arch/arm/mach-omap2/io.c38
-rw-r--r--arch/arm/mach-omap2/iommu2.c2
-rw-r--r--arch/arm/mach-omap2/irq.c78
-rw-r--r--arch/arm/mach-omap2/mailbox.c142
-rw-r--r--arch/arm/mach-omap2/mcbsp.c8
-rw-r--r--arch/arm/mach-omap2/mmc-twl4030.c23
-rw-r--r--arch/arm/mach-omap2/mux.c19
-rw-r--r--arch/arm/mach-omap2/omap-smp.c29
-rw-r--r--arch/arm/mach-omap2/omap3-iommu.c64
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c28
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_2420.h6
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_2430.h6
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_34xx.h6
-rw-r--r--arch/arm/mach-omap2/pm-debug.c40
-rw-r--r--arch/arm/mach-omap2/pm.h16
-rw-r--r--arch/arm/mach-omap2/pm24xx.c16
-rw-r--r--arch/arm/mach-omap2/pm34xx.c419
-rw-r--r--arch/arm/mach-omap2/powerdomain.c6
-rw-r--r--arch/arm/mach-omap2/powerdomains.h2
-rw-r--r--arch/arm/mach-omap2/powerdomains24xx.h2
-rw-r--r--arch/arm/mach-omap2/powerdomains34xx.h10
-rw-r--r--arch/arm/mach-omap2/prcm.c411
-rw-r--r--arch/arm/mach-omap2/prm-regbits-34xx.h2
-rw-r--r--arch/arm/mach-omap2/prm.h6
-rw-r--r--arch/arm/mach-omap2/sdram-hynix-h8mbx00u0mer-0em.h51
-rw-r--r--arch/arm/mach-omap2/sdram-micron-mt46h32m32lf-6.h2
-rw-r--r--arch/arm/mach-omap2/sdram-qimonda-hyb18m512160af-6.h2
-rw-r--r--arch/arm/mach-omap2/sdrc.c35
-rw-r--r--arch/arm/mach-omap2/sdrc.h11
-rw-r--r--arch/arm/mach-omap2/sdrc2xxx.c8
-rw-r--r--arch/arm/mach-omap2/serial.c30
-rw-r--r--arch/arm/mach-omap2/sleep24xx.S2
-rw-r--r--arch/arm/mach-omap2/sleep34xx.S220
-rw-r--r--arch/arm/mach-omap2/sram242x.S4
-rw-r--r--arch/arm/mach-omap2/sram243x.S4
-rw-r--r--arch/arm/mach-omap2/timer-gp.c7
-rw-r--r--arch/arm/mach-omap2/usb-ehci.c192
-rw-r--r--arch/arm/mach-omap2/usb-musb.c4
-rw-r--r--arch/arm/mach-omap2/usb-tusb6010.c4
-rw-r--r--arch/arm/mach-pxa/Kconfig638
-rw-r--r--arch/arm/mach-pxa/Makefile90
-rw-r--r--arch/arm/mach-pxa/balloon3.c4
-rw-r--r--arch/arm/mach-pxa/cm-x2xx.c4
-rw-r--r--arch/arm/mach-pxa/cm-x300.c260
-rw-r--r--arch/arm/mach-pxa/colibri-pxa270.c3
-rw-r--r--arch/arm/mach-pxa/colibri-pxa300.c4
-rw-r--r--arch/arm/mach-pxa/colibri-pxa320.c4
-rw-r--r--arch/arm/mach-pxa/colibri-pxa3xx.c2
-rw-r--r--arch/arm/mach-pxa/corgi.c4
-rw-r--r--arch/arm/mach-pxa/corgi_pm.c4
-rw-r--r--arch/arm/mach-pxa/cpufreq-pxa2xx.c1
-rw-r--r--arch/arm/mach-pxa/cpufreq-pxa3xx.c2
-rw-r--r--arch/arm/mach-pxa/csb726.c3
-rw-r--r--arch/arm/mach-pxa/devices.c30
-rw-r--r--arch/arm/mach-pxa/e330.c3
-rw-r--r--arch/arm/mach-pxa/e350.c3
-rw-r--r--arch/arm/mach-pxa/e400.c3
-rw-r--r--arch/arm/mach-pxa/e740.c3
-rw-r--r--arch/arm/mach-pxa/e750.c3
-rw-r--r--arch/arm/mach-pxa/e800.c3
-rw-r--r--arch/arm/mach-pxa/em-x270.c13
-rw-r--r--arch/arm/mach-pxa/ezx.c251
-rw-r--r--arch/arm/mach-pxa/generic.h5
-rw-r--r--arch/arm/mach-pxa/gumstix.c5
-rw-r--r--arch/arm/mach-pxa/h5000.c3
-rw-r--r--arch/arm/mach-pxa/himalaya.c3
-rw-r--r--arch/arm/mach-pxa/hx4700.c5
-rw-r--r--arch/arm/mach-pxa/idp.c3
-rw-r--r--arch/arm/mach-pxa/imote2.c6
-rw-r--r--arch/arm/mach-pxa/include/mach/hardware.h7
-rw-r--r--arch/arm/mach-pxa/include/mach/palmtreo.h67
-rw-r--r--arch/arm/mach-pxa/include/mach/pxafb.h3
-rw-r--r--arch/arm/mach-pxa/include/mach/regs-u2d.h199
-rw-r--r--arch/arm/mach-pxa/include/mach/treo680.h49
-rw-r--r--arch/arm/mach-pxa/littleton.c8
-rw-r--r--arch/arm/mach-pxa/lpd270.c4
-rw-r--r--arch/arm/mach-pxa/lubbock.c4
-rw-r--r--arch/arm/mach-pxa/magician.c4
-rw-r--r--arch/arm/mach-pxa/mainstone.c4
-rw-r--r--arch/arm/mach-pxa/mioa701.c3
-rw-r--r--arch/arm/mach-pxa/mp900.c3
-rw-r--r--arch/arm/mach-pxa/palmld.c4
-rw-r--r--arch/arm/mach-pxa/palmt5.c4
-rw-r--r--arch/arm/mach-pxa/palmtc.c5
-rw-r--r--arch/arm/mach-pxa/palmte2.c4
-rw-r--r--arch/arm/mach-pxa/palmtreo.c (renamed from arch/arm/mach-pxa/treo680.c)365
-rw-r--r--arch/arm/mach-pxa/palmtx.c4
-rw-r--r--arch/arm/mach-pxa/palmz72.c4
-rw-r--r--arch/arm/mach-pxa/pcm027.c4
-rw-r--r--arch/arm/mach-pxa/pcm990-baseboard.c8
-rw-r--r--arch/arm/mach-pxa/poodle.c4
-rw-r--r--arch/arm/mach-pxa/pxa25x.c7
-rw-r--r--arch/arm/mach-pxa/pxa27x.c3
-rw-r--r--arch/arm/mach-pxa/pxa3xx.c47
-rw-r--r--arch/arm/mach-pxa/saar.c105
-rw-r--r--arch/arm/mach-pxa/sharpsl.h4
-rw-r--r--arch/arm/mach-pxa/sharpsl_pm.c112
-rw-r--r--arch/arm/mach-pxa/spitz.c6
-rw-r--r--arch/arm/mach-pxa/spitz_pm.c14
-rw-r--r--arch/arm/mach-pxa/ssp.c73
-rw-r--r--arch/arm/mach-pxa/stargate2.c4
-rw-r--r--arch/arm/mach-pxa/tavorevb.c4
-rw-r--r--arch/arm/mach-pxa/tosa.c5
-rw-r--r--arch/arm/mach-pxa/trizeps4.c4
-rw-r--r--arch/arm/mach-pxa/viper.c15
-rw-r--r--arch/arm/mach-pxa/xcep.c5
-rw-r--r--arch/arm/mach-pxa/zylonite.c6
-rw-r--r--arch/arm/mach-s3c2400/include/mach/map.h2
-rw-r--r--arch/arm/mach-s3c2410/Kconfig8
-rw-r--r--arch/arm/mach-s3c2410/Makefile3
-rw-r--r--arch/arm/mach-s3c2410/bast-irq.c4
-rw-r--r--arch/arm/mach-s3c2410/cpu-freq.c2
-rw-r--r--arch/arm/mach-s3c2410/h1940-bluetooth.c88
-rw-r--r--arch/arm/mach-s3c2410/include/mach/bast-cpld.h2
-rw-r--r--arch/arm/mach-s3c2410/include/mach/bast-irq.h2
-rw-r--r--arch/arm/mach-s3c2410/include/mach/bast-map.h2
-rw-r--r--arch/arm/mach-s3c2410/include/mach/bast-pmu.h2
-rw-r--r--arch/arm/mach-s3c2410/include/mach/dma.h2
-rw-r--r--arch/arm/mach-s3c2410/include/mach/gpio-fns.h2
-rw-r--r--arch/arm/mach-s3c2410/include/mach/osiris-map.h2
-rw-r--r--arch/arm/mach-s3c2410/include/mach/regs-clock.h4
-rw-r--r--arch/arm/mach-s3c2410/include/mach/regs-gpio.h4
-rw-r--r--arch/arm/mach-s3c2410/include/mach/regs-power.h4
-rw-r--r--arch/arm/mach-s3c2410/include/mach/uncompress.h3
-rw-r--r--arch/arm/mach-s3c2410/include/mach/vr1000-irq.h2
-rw-r--r--arch/arm/mach-s3c2410/mach-bast.c19
-rw-r--r--arch/arm/mach-s3c2410/mach-h1940.c105
-rw-r--r--arch/arm/mach-s3c2410/mach-n30.c4
-rw-r--r--arch/arm/mach-s3c2410/mach-qt2410.c8
-rw-r--r--arch/arm/mach-s3c2410/mach-vr1000.c4
-rw-r--r--arch/arm/mach-s3c2410/pll.c2
-rw-r--r--arch/arm/mach-s3c2410/usb-simtec.c4
-rw-r--r--arch/arm/mach-s3c2412/mach-jive.c11
-rw-r--r--arch/arm/mach-s3c2412/mach-vstms.c10
-rw-r--r--arch/arm/mach-s3c2440/Kconfig13
-rw-r--r--arch/arm/mach-s3c2440/Makefile4
-rw-r--r--arch/arm/mach-s3c2440/irq.c2
-rw-r--r--arch/arm/mach-s3c2440/mach-anubis.c29
-rw-r--r--arch/arm/mach-s3c2440/mach-at2440evb.c9
-rw-r--r--arch/arm/mach-s3c2440/mach-mini2440.c4
-rw-r--r--arch/arm/mach-s3c2440/mach-osiris-dvs.c194
-rw-r--r--arch/arm/mach-s3c2440/mach-osiris.c47
-rw-r--r--arch/arm/mach-s3c2440/mach-rx3715.c11
-rw-r--r--arch/arm/mach-s3c2440/mach-smdk2440.c2
-rw-r--r--arch/arm/mach-s3c2442/mach-gta02.c6
-rw-r--r--arch/arm/mach-s3c24a0/include/mach/map.h2
-rw-r--r--arch/arm/mach-s3c24a0/include/mach/regs-clock.h4
-rw-r--r--arch/arm/mach-s3c6400/include/mach/map.h6
-rw-r--r--arch/arm/mach-s3c6400/include/mach/regs-fb.h236
-rw-r--r--arch/arm/mach-s3c6400/s3c6400.c1
-rw-r--r--arch/arm/mach-s3c6410/cpu.c1
-rw-r--r--arch/arm/mach-s3c6410/mach-hmt.c2
-rw-r--r--arch/arm/mach-s3c6410/mach-smdk6410.c52
-rw-r--r--arch/arm/mach-s5pc100/Kconfig14
-rw-r--r--arch/arm/mach-s5pc100/Makefile4
-rw-r--r--arch/arm/mach-s5pc100/cpu.c29
-rw-r--r--arch/arm/mach-s5pc100/include/mach/gpio.h230
-rw-r--r--arch/arm/mach-s5pc100/include/mach/irqs.h5
-rw-r--r--arch/arm/mach-s5pc100/include/mach/map.h87
-rw-r--r--arch/arm/mach-s5pc100/include/mach/regs-fb.h139
-rw-r--r--arch/arm/mach-s5pc100/include/mach/system.h13
-rw-r--r--arch/arm/mach-s5pc100/mach-smdkc100.c89
-rw-r--r--arch/arm/mach-s5pc100/setup-sdhci.c65
-rw-r--r--arch/arm/mach-sa1100/Kconfig4
-rw-r--r--arch/arm/mach-sa1100/Makefile4
-rw-r--r--arch/arm/mach-sa1100/assabet.c8
-rw-r--r--arch/arm/mach-sa1100/badge4.c2
-rw-r--r--arch/arm/mach-sa1100/cerf.c4
-rw-r--r--arch/arm/mach-sa1100/collie.c85
-rw-r--r--arch/arm/mach-sa1100/generic.c31
-rw-r--r--arch/arm/mach-sa1100/generic.h11
-rw-r--r--arch/arm/mach-sa1100/h3100.c95
-rw-r--r--arch/arm/mach-sa1100/h3600.c454
-rw-r--r--arch/arm/mach-sa1100/h3xxx.c313
-rw-r--r--arch/arm/mach-sa1100/hackkit.c2
-rw-r--r--arch/arm/mach-sa1100/include/mach/collie.h77
-rw-r--r--arch/arm/mach-sa1100/include/mach/gpio.h19
-rw-r--r--arch/arm/mach-sa1100/include/mach/h3600.h100
-rw-r--r--arch/arm/mach-sa1100/include/mach/h3600_gpio.h77
-rw-r--r--arch/arm/mach-sa1100/include/mach/h3xxx.h94
-rw-r--r--arch/arm/mach-sa1100/include/mach/mcp.h1
-rw-r--r--arch/arm/mach-sa1100/jornada720.c2
-rw-r--r--arch/arm/mach-sa1100/lart.c2
-rw-r--r--arch/arm/mach-sa1100/pleb.c2
-rw-r--r--arch/arm/mach-sa1100/shannon.c4
-rw-r--r--arch/arm/mach-sa1100/simpad.c4
-rw-r--r--arch/arm/mach-u300/Makefile1
-rw-r--r--arch/arm/mach-u300/i2c.c249
-rw-r--r--arch/arm/mach-u300/mmc.c64
-rw-r--r--arch/arm/mach-u300/regulator.c88
-rw-r--r--arch/arm/mach-ux500/Kconfig15
-rw-r--r--arch/arm/mach-ux500/Makefile8
-rw-r--r--arch/arm/mach-ux500/Makefile.boot4
-rw-r--r--arch/arm/mach-ux500/board-mop500.c158
-rw-r--r--arch/arm/mach-ux500/clock.c95
-rw-r--r--arch/arm/mach-ux500/cpu-u8500.c64
-rw-r--r--arch/arm/mach-ux500/headsmp.S38
-rw-r--r--arch/arm/mach-ux500/include/mach/clkdev.h7
-rw-r--r--arch/arm/mach-ux500/include/mach/debug-macro.S19
-rw-r--r--arch/arm/mach-ux500/include/mach/entry-macro.S89
-rw-r--r--arch/arm/mach-ux500/include/mach/hardware.h131
-rw-r--r--arch/arm/mach-ux500/include/mach/io.h22
-rw-r--r--arch/arm/mach-ux500/include/mach/irqs.h71
-rw-r--r--arch/arm/mach-ux500/include/mach/memory.h18
-rw-r--r--arch/arm/mach-ux500/include/mach/setup.h23
-rw-r--r--arch/arm/mach-ux500/include/mach/smp.h32
-rw-r--r--arch/arm/mach-ux500/include/mach/system.h25
-rw-r--r--arch/arm/mach-ux500/include/mach/timex.h6
-rw-r--r--arch/arm/mach-ux500/include/mach/uncompress.h58
-rw-r--r--arch/arm/mach-ux500/include/mach/vmalloc.h18
-rw-r--r--arch/arm/mach-ux500/localtimer.c28
-rw-r--r--arch/arm/mach-ux500/platsmp.c177
-rw-r--r--arch/arm/mach-w90x900/dev.c16
-rw-r--r--arch/arm/mm/Kconfig13
-rw-r--r--arch/arm/mm/Makefile4
-rw-r--r--arch/arm/mm/cache-l2x0.c25
-rw-r--r--arch/arm/mm/cache-tauros2.c263
-rw-r--r--arch/arm/mm/copypage-v6.c8
-rw-r--r--arch/arm/mm/dma-mapping.c497
-rw-r--r--arch/arm/mm/fault-armv.c9
-rw-r--r--arch/arm/mm/flush.c49
-rw-r--r--arch/arm/mm/mm.h2
-rw-r--r--arch/arm/mm/mmu.c4
-rw-r--r--arch/arm/mm/proc-v6.S33
-rw-r--r--arch/arm/mm/proc-xsc3.S2
-rw-r--r--arch/arm/mm/vmregion.c131
-rw-r--r--arch/arm/mm/vmregion.h29
-rw-r--r--arch/arm/plat-iop/time.c176
-rw-r--r--arch/arm/plat-mxc/Kconfig10
-rw-r--r--arch/arm/plat-mxc/Makefile3
-rw-r--r--arch/arm/plat-mxc/audmux-v1.c58
-rw-r--r--arch/arm/plat-mxc/audmux-v2.c74
-rw-r--r--arch/arm/plat-mxc/dma-mx1-mx2.c3
-rw-r--r--arch/arm/plat-mxc/gpio.c2
-rw-r--r--arch/arm/plat-mxc/include/mach/audmux.h52
-rw-r--r--arch/arm/plat-mxc/include/mach/board-kzmarm11.h39
-rw-r--r--arch/arm/plat-mxc/include/mach/board-mx31lite.h39
-rw-r--r--arch/arm/plat-mxc/include/mach/dma-mx1-mx2.h8
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux-mx3.h34
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux-v3.h17
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux.h1
-rw-r--r--arch/arm/plat-mxc/include/mach/mx21.h207
-rw-r--r--arch/arm/plat-mxc/include/mach/mx25.h10
-rw-r--r--arch/arm/plat-mxc/include/mach/mx27.h315
-rw-r--r--arch/arm/plat-mxc/include/mach/mx2x.h341
-rw-r--r--arch/arm/plat-mxc/include/mach/mx31.h237
-rw-r--r--arch/arm/plat-mxc/include/mach/mx35.h201
-rw-r--r--arch/arm/plat-mxc/include/mach/mx3x.h418
-rw-r--r--arch/arm/plat-mxc/include/mach/ulpi.h7
-rw-r--r--arch/arm/plat-mxc/include/mach/uncompress.h3
-rw-r--r--arch/arm/plat-mxc/iomux-v3.c36
-rw-r--r--arch/arm/plat-mxc/ulpi.c113
-rw-r--r--arch/arm/plat-nomadik/Kconfig22
-rw-r--r--arch/arm/plat-nomadik/Makefile5
-rw-r--r--arch/arm/plat-nomadik/include/plat/mtu.h (renamed from arch/arm/mach-nomadik/include/mach/mtu.h)9
-rw-r--r--arch/arm/plat-nomadik/timer.c (renamed from arch/arm/mach-nomadik/timer.c)35
-rw-r--r--arch/arm/plat-omap/Kconfig5
-rw-r--r--arch/arm/plat-omap/clock.c2
-rw-r--r--arch/arm/plat-omap/common.c59
-rw-r--r--arch/arm/plat-omap/cpu-omap.c2
-rw-r--r--arch/arm/plat-omap/debug-devices.c2
-rw-r--r--arch/arm/plat-omap/debug-leds.c2
-rw-r--r--arch/arm/plat-omap/devices.c38
-rw-r--r--arch/arm/plat-omap/dma.c86
-rw-r--r--arch/arm/plat-omap/dmtimer.c18
-rw-r--r--arch/arm/plat-omap/fb.c6
-rw-r--r--arch/arm/plat-omap/gpio.c549
-rw-r--r--arch/arm/plat-omap/i2c.c2
-rw-r--r--arch/arm/plat-omap/include/plat/blizzard.h (renamed from arch/arm/plat-omap/include/mach/blizzard.h)0
-rw-r--r--arch/arm/plat-omap/include/plat/board-ams-delta.h (renamed from arch/arm/plat-omap/include/mach/board-ams-delta.h)0
-rw-r--r--arch/arm/plat-omap/include/plat/board-sx1.h (renamed from arch/arm/plat-omap/include/mach/board-sx1.h)0
-rw-r--r--arch/arm/plat-omap/include/plat/board-voiceblue.h (renamed from arch/arm/plat-omap/include/mach/board-voiceblue.h)0
-rw-r--r--arch/arm/plat-omap/include/plat/board.h (renamed from arch/arm/plat-omap/include/mach/board.h)20
-rw-r--r--arch/arm/plat-omap/include/plat/clkdev.h (renamed from arch/arm/plat-omap/include/mach/clkdev.h)0
-rw-r--r--arch/arm/plat-omap/include/plat/clock.h (renamed from arch/arm/plat-omap/include/mach/clock.h)0
-rw-r--r--arch/arm/plat-omap/include/plat/clockdomain.h (renamed from arch/arm/plat-omap/include/mach/clockdomain.h)6
-rw-r--r--arch/arm/plat-omap/include/plat/common.h (renamed from arch/arm/plat-omap/include/mach/common.h)3
-rw-r--r--arch/arm/plat-omap/include/plat/control.h (renamed from arch/arm/plat-omap/include/mach/control.h)114
-rw-r--r--arch/arm/plat-omap/include/plat/cpu.h (renamed from arch/arm/plat-omap/include/mach/cpu.h)91
-rw-r--r--arch/arm/plat-omap/include/plat/dma.h (renamed from arch/arm/plat-omap/include/mach/dma.h)5
-rw-r--r--arch/arm/plat-omap/include/plat/dmtimer.h (renamed from arch/arm/plat-omap/include/mach/dmtimer.h)0
-rw-r--r--arch/arm/plat-omap/include/plat/dsp_common.h (renamed from arch/arm/plat-omap/include/mach/dsp_common.h)0
-rw-r--r--arch/arm/plat-omap/include/plat/fpga.h (renamed from arch/arm/plat-omap/include/mach/fpga.h)0
-rw-r--r--arch/arm/plat-omap/include/plat/gpio-switch.h (renamed from arch/arm/plat-omap/include/mach/gpio-switch.h)0
-rw-r--r--arch/arm/plat-omap/include/plat/gpio.h (renamed from arch/arm/plat-omap/include/mach/gpio.h)3
-rw-r--r--arch/arm/plat-omap/include/plat/gpmc-smc91x.h (renamed from arch/arm/plat-omap/include/mach/gpmc-smc91x.h)0
-rw-r--r--arch/arm/plat-omap/include/plat/gpmc.h (renamed from arch/arm/plat-omap/include/mach/gpmc.h)3
-rw-r--r--arch/arm/plat-omap/include/plat/hardware.h (renamed from arch/arm/plat-omap/include/mach/hardware.h)16
-rw-r--r--arch/arm/plat-omap/include/plat/hwa742.h (renamed from arch/arm/plat-omap/include/mach/hwa742.h)0
-rw-r--r--arch/arm/plat-omap/include/plat/io.h (renamed from arch/arm/plat-omap/include/mach/io.h)124
-rw-r--r--arch/arm/plat-omap/include/plat/iommu.h (renamed from arch/arm/plat-omap/include/mach/iommu.h)2
-rw-r--r--arch/arm/plat-omap/include/plat/iommu2.h (renamed from arch/arm/plat-omap/include/mach/iommu2.h)0
-rw-r--r--arch/arm/plat-omap/include/plat/iovmm.h (renamed from arch/arm/plat-omap/include/mach/iovmm.h)0
-rw-r--r--arch/arm/plat-omap/include/plat/irda.h (renamed from arch/arm/plat-omap/include/mach/irda.h)0
-rw-r--r--arch/arm/plat-omap/include/plat/irqs.h (renamed from arch/arm/plat-omap/include/mach/irqs.h)234
-rw-r--r--arch/arm/plat-omap/include/plat/keypad.h (renamed from arch/arm/plat-omap/include/mach/keypad.h)0
-rw-r--r--arch/arm/plat-omap/include/plat/lcd_mipid.h (renamed from arch/arm/plat-omap/include/mach/lcd_mipid.h)0
-rw-r--r--arch/arm/plat-omap/include/plat/led.h (renamed from arch/arm/plat-omap/include/mach/led.h)0
-rw-r--r--arch/arm/plat-omap/include/plat/mailbox.h (renamed from arch/arm/plat-omap/include/mach/mailbox.h)23
-rw-r--r--arch/arm/plat-omap/include/plat/mcbsp.h (renamed from arch/arm/plat-omap/include/mach/mcbsp.h)8
-rw-r--r--arch/arm/plat-omap/include/plat/mcspi.h (renamed from arch/arm/plat-omap/include/mach/mcspi.h)0
-rw-r--r--arch/arm/plat-omap/include/plat/memory.h (renamed from arch/arm/plat-omap/include/mach/memory.h)7
-rw-r--r--arch/arm/plat-omap/include/plat/menelaus.h (renamed from arch/arm/plat-omap/include/mach/menelaus.h)0
-rw-r--r--arch/arm/plat-omap/include/plat/mmc.h (renamed from arch/arm/plat-omap/include/mach/mmc.h)2
-rw-r--r--arch/arm/plat-omap/include/plat/mux.h (renamed from arch/arm/plat-omap/include/mach/mux.h)114
-rw-r--r--arch/arm/plat-omap/include/plat/nand.h (renamed from arch/arm/plat-omap/include/mach/nand.h)0
-rw-r--r--arch/arm/plat-omap/include/plat/omap-alsa.h (renamed from arch/arm/plat-omap/include/mach/omap-alsa.h)4
-rw-r--r--arch/arm/plat-omap/include/plat/omap-pm.h (renamed from arch/arm/plat-omap/include/mach/omap-pm.h)0
-rw-r--r--arch/arm/plat-omap/include/plat/omap1510.h (renamed from arch/arm/plat-omap/include/mach/omap1510.h)0
-rw-r--r--arch/arm/plat-omap/include/plat/omap16xx.h (renamed from arch/arm/plat-omap/include/mach/omap16xx.h)0
-rw-r--r--arch/arm/plat-omap/include/plat/omap24xx.h (renamed from arch/arm/plat-omap/include/mach/omap24xx.h)0
-rw-r--r--arch/arm/plat-omap/include/plat/omap34xx.h (renamed from arch/arm/plat-omap/include/mach/omap34xx.h)11
-rw-r--r--arch/arm/plat-omap/include/plat/omap44xx.h (renamed from arch/arm/plat-omap/include/mach/omap44xx.h)10
-rw-r--r--arch/arm/plat-omap/include/plat/omap730.h (renamed from arch/arm/plat-omap/include/mach/omap730.h)0
-rw-r--r--arch/arm/plat-omap/include/plat/omap7xx.h104
-rw-r--r--arch/arm/plat-omap/include/plat/omap850.h (renamed from arch/arm/plat-omap/include/mach/omap850.h)0
-rw-r--r--arch/arm/plat-omap/include/plat/omap_device.h (renamed from arch/arm/plat-omap/include/mach/omap_device.h)2
-rw-r--r--arch/arm/plat-omap/include/plat/omap_hwmod.h (renamed from arch/arm/plat-omap/include/mach/omap_hwmod.h)2
-rw-r--r--arch/arm/plat-omap/include/plat/omapfb.h (renamed from arch/arm/plat-omap/include/mach/omapfb.h)2
-rw-r--r--arch/arm/plat-omap/include/plat/onenand.h (renamed from arch/arm/plat-omap/include/mach/onenand.h)0
-rw-r--r--arch/arm/plat-omap/include/plat/param.h (renamed from arch/arm/plat-omap/include/mach/param.h)0
-rw-r--r--arch/arm/plat-omap/include/plat/powerdomain.h (renamed from arch/arm/plat-omap/include/mach/powerdomain.h)2
-rw-r--r--arch/arm/plat-omap/include/plat/prcm.h (renamed from arch/arm/plat-omap/include/mach/prcm.h)6
-rw-r--r--arch/arm/plat-omap/include/plat/sdrc.h (renamed from arch/arm/plat-omap/include/mach/sdrc.h)14
-rw-r--r--arch/arm/plat-omap/include/plat/serial.h (renamed from arch/arm/plat-omap/include/mach/serial.h)4
-rw-r--r--arch/arm/plat-omap/include/plat/smp.h (renamed from arch/arm/plat-omap/include/mach/smp.h)0
-rw-r--r--arch/arm/plat-omap/include/plat/sram.h (renamed from arch/arm/plat-omap/include/mach/sram.h)7
-rw-r--r--arch/arm/plat-omap/include/plat/system.h (renamed from arch/arm/plat-omap/include/mach/system.h)2
-rw-r--r--arch/arm/plat-omap/include/plat/tc.h (renamed from arch/arm/plat-omap/include/mach/tc.h)0
-rw-r--r--arch/arm/plat-omap/include/plat/timer-gp.h (renamed from arch/arm/plat-omap/include/mach/timer-gp.h)0
-rw-r--r--arch/arm/plat-omap/include/plat/timex.h (renamed from arch/arm/plat-omap/include/mach/timex.h)0
-rw-r--r--arch/arm/plat-omap/include/plat/uncompress.h (renamed from arch/arm/plat-omap/include/mach/uncompress.h)11
-rw-r--r--arch/arm/plat-omap/include/plat/usb.h (renamed from arch/arm/plat-omap/include/mach/usb.h)19
-rw-r--r--arch/arm/plat-omap/io.c44
-rw-r--r--arch/arm/plat-omap/iommu-debug.c4
-rw-r--r--arch/arm/plat-omap/iommu.c2
-rw-r--r--arch/arm/plat-omap/iovmm.c19
-rw-r--r--arch/arm/plat-omap/mailbox.c284
-rw-r--r--arch/arm/plat-omap/mcbsp.c10
-rw-r--r--arch/arm/plat-omap/mux.c2
-rw-r--r--arch/arm/plat-omap/omap-pm-noop.c4
-rw-r--r--arch/arm/plat-omap/omap_device.c54
-rw-r--r--arch/arm/plat-omap/sram.c40
-rw-r--r--arch/arm/plat-omap/usb.c38
-rw-r--r--arch/arm/plat-pxa/include/plat/pxa3xx_nand.h (renamed from arch/arm/mach-pxa/include/mach/pxa3xx_nand.h)0
-rw-r--r--arch/arm/plat-s3c/Kconfig11
-rw-r--r--arch/arm/plat-s3c/Makefile1
-rw-r--r--arch/arm/plat-s3c/clock.c4
-rw-r--r--arch/arm/plat-s3c/dev-hsmmc2.c69
-rw-r--r--arch/arm/plat-s3c/dev-i2c0.c2
-rw-r--r--arch/arm/plat-s3c/dev-i2c1.c2
-rw-r--r--arch/arm/plat-s3c/dev-nand.c97
-rw-r--r--arch/arm/plat-s3c/dma.c2
-rw-r--r--arch/arm/plat-s3c/include/plat/audio-simtec.h2
-rw-r--r--arch/arm/plat-s3c/include/plat/audio.h48
-rw-r--r--arch/arm/plat-s3c/include/plat/cpu-freq.h2
-rw-r--r--arch/arm/plat-s3c/include/plat/cpu.h6
-rw-r--r--arch/arm/plat-s3c/include/plat/devs.h3
-rw-r--r--arch/arm/plat-s3c/include/plat/dma.h2
-rw-r--r--arch/arm/plat-s3c/include/plat/fb.h7
-rw-r--r--arch/arm/plat-s3c/include/plat/iic.h2
-rw-r--r--arch/arm/plat-s3c/include/plat/nand.h8
-rw-r--r--arch/arm/plat-s3c/include/plat/regs-fb-v4.h235
-rw-r--r--arch/arm/plat-s3c/include/plat/regs-nand.h4
-rw-r--r--arch/arm/plat-s3c/include/plat/regs-s3c2412-iis.h2
-rw-r--r--arch/arm/plat-s3c/include/plat/regs-serial.h2
-rw-r--r--arch/arm/plat-s3c/include/plat/sdhci.h78
-rw-r--r--arch/arm/plat-s3c/pm-check.c2
-rw-r--r--arch/arm/plat-s3c/pm.c2
-rw-r--r--arch/arm/plat-s3c24xx/Kconfig7
-rw-r--r--arch/arm/plat-s3c24xx/Makefile1
-rw-r--r--arch/arm/plat-s3c24xx/clock-dclk.c2
-rw-r--r--arch/arm/plat-s3c24xx/common-smdk.c2
-rw-r--r--arch/arm/plat-s3c24xx/cpu-freq.c2
-rw-r--r--arch/arm/plat-s3c24xx/dma.c4
-rw-r--r--arch/arm/plat-s3c24xx/include/plat/cpu-freq-core.h2
-rw-r--r--arch/arm/plat-s3c24xx/include/plat/mci.h25
-rw-r--r--arch/arm/plat-s3c24xx/include/plat/regs-dma.h2
-rw-r--r--arch/arm/plat-s3c24xx/irq-pm.c2
-rw-r--r--arch/arm/plat-s3c24xx/irq.c2
-rw-r--r--arch/arm/plat-s3c24xx/pm-simtec.c4
-rw-r--r--arch/arm/plat-s3c24xx/pm.c2
-rw-r--r--arch/arm/plat-s3c24xx/s3c2410-iotiming.c2
-rw-r--r--arch/arm/plat-s3c24xx/s3c2412-iotiming.c2
-rw-r--r--arch/arm/plat-s3c24xx/s3c2440-cpufreq.c2
-rw-r--r--arch/arm/plat-s3c24xx/s3c2440-pll-12000000.c2
-rw-r--r--arch/arm/plat-s3c24xx/s3c244x-clock.c2
-rw-r--r--arch/arm/plat-s3c24xx/s3c244x-irq.c2
-rw-r--r--arch/arm/plat-s3c24xx/simtec-audio.c77
-rw-r--r--arch/arm/plat-s3c64xx/cpu.c5
-rw-r--r--arch/arm/plat-s3c64xx/cpufreq.c40
-rw-r--r--arch/arm/plat-s3c64xx/dev-audio.c101
-rw-r--r--arch/arm/plat-s3c64xx/gpiolib.c12
-rw-r--r--arch/arm/plat-s3c64xx/include/plat/gpio-bank-c.h6
-rw-r--r--arch/arm/plat-s3c64xx/irq-eint.c19
-rw-r--r--arch/arm/plat-s3c64xx/setup-sdhci-gpio.c20
-rw-r--r--arch/arm/plat-s5pc1xx/Kconfig18
-rw-r--r--arch/arm/plat-s5pc1xx/Makefile11
-rw-r--r--arch/arm/plat-s5pc1xx/clock.c728
-rw-r--r--arch/arm/plat-s5pc1xx/cpu.c10
-rw-r--r--arch/arm/plat-s5pc1xx/gpio-config.c62
-rw-r--r--arch/arm/plat-s5pc1xx/gpiolib.c503
-rw-r--r--arch/arm/plat-s5pc1xx/include/plat/gpio-cfg-s5pc1xx.h32
-rw-r--r--arch/arm/plat-s5pc1xx/include/plat/gpio-ext.h44
-rw-r--r--arch/arm/plat-s5pc1xx/include/plat/irqs.h15
-rw-r--r--arch/arm/plat-s5pc1xx/include/plat/regs-clock.h212
-rw-r--r--arch/arm/plat-s5pc1xx/include/plat/regs-gpio.h70
-rw-r--r--arch/arm/plat-s5pc1xx/include/plat/regs-power.h84
-rw-r--r--arch/arm/plat-s5pc1xx/include/plat/s5pc100.h5
-rw-r--r--arch/arm/plat-s5pc1xx/irq-eint.c281
-rw-r--r--arch/arm/plat-s5pc1xx/irq-gpio.c266
-rw-r--r--arch/arm/plat-s5pc1xx/irq.c2
-rw-r--r--arch/arm/plat-s5pc1xx/s5pc100-clock.c1555
-rw-r--r--arch/arm/plat-s5pc1xx/setup-fb-24bpp.c49
-rw-r--r--arch/arm/plat-s5pc1xx/setup-i2c0.c7
-rw-r--r--arch/arm/plat-s5pc1xx/setup-i2c1.c7
-rw-r--r--arch/arm/plat-s5pc1xx/setup-sdhci-gpio.c86
-rw-r--r--arch/arm/plat-samsung/Kconfig17
-rw-r--r--arch/arm/plat-samsung/Makefile11
-rw-r--r--arch/arm/tools/mach-types119
-rw-r--r--arch/avr32/Kconfig1
-rw-r--r--arch/avr32/include/asm/bug.h2
-rw-r--r--arch/avr32/include/asm/cacheflush.h1
-rw-r--r--arch/avr32/include/asm/socket.h2
-rw-r--r--arch/avr32/kernel/syscall_table.S1
-rw-r--r--arch/blackfin/include/asm/cacheflush.h2
-rw-r--r--arch/blackfin/kernel/bfin_dma_5xx.c9
-rw-r--r--arch/blackfin/kernel/cplb-mpu/cplbinit.c2
-rw-r--r--arch/blackfin/kernel/process.c8
-rw-r--r--arch/blackfin/kernel/ptrace.c2
-rw-r--r--arch/blackfin/mach-bf518/include/mach/anomaly.h18
-rw-r--r--arch/blackfin/mach-bf527/include/mach/anomaly.h20
-rw-r--r--arch/blackfin/mach-bf533/include/mach/anomaly.h18
-rw-r--r--arch/blackfin/mach-bf537/include/mach/anomaly.h18
-rw-r--r--arch/blackfin/mach-bf538/include/mach/anomaly.h18
-rw-r--r--arch/blackfin/mach-bf548/include/mach/anomaly.h23
-rw-r--r--arch/blackfin/mach-bf561/atomic.S14
-rw-r--r--arch/blackfin/mach-bf561/include/mach/anomaly.h25
-rw-r--r--arch/blackfin/mach-common/arch_checks.c5
-rw-r--r--arch/blackfin/mach-common/entry.S1
-rw-r--r--arch/blackfin/mach-common/smp.c6
-rw-r--r--arch/cris/include/asm/cacheflush.h1
-rw-r--r--arch/cris/include/asm/socket.h2
-rw-r--r--arch/frv/include/asm/cacheflush.h1
-rw-r--r--arch/frv/include/asm/socket.h2
-rw-r--r--arch/frv/kernel/pm.c114
-rw-r--r--arch/frv/kernel/process.c5
-rw-r--r--arch/frv/kernel/sysctl.c7
-rw-r--r--arch/h8300/include/asm/cacheflush.h1
-rw-r--r--arch/h8300/include/asm/socket.h2
-rw-r--r--arch/h8300/kernel/process.c5
-rw-r--r--arch/ia64/ia32/ia32_entry.S2
-rw-r--r--arch/ia64/ia32/sys_ia32.c55
-rw-r--r--arch/ia64/include/asm/cacheflush.h1
-rw-r--r--arch/ia64/include/asm/kvm.h1
-rw-r--r--arch/ia64/include/asm/kvm_host.h1
-rw-r--r--arch/ia64/include/asm/socket.h2
-rw-r--r--arch/ia64/include/asm/swiotlb.h2
-rw-r--r--arch/ia64/include/asm/unistd.h3
-rw-r--r--arch/ia64/kernel/crash.c11
-rw-r--r--arch/ia64/kernel/entry.S1
-rw-r--r--arch/ia64/kernel/pci-swiotlb.c4
-rw-r--r--arch/ia64/kernel/perfmon.c14
-rw-r--r--arch/ia64/kernel/time.c4
-rw-r--r--arch/ia64/kvm/Makefile2
-rw-r--r--arch/ia64/kvm/kvm-ia64.c19
-rw-r--r--arch/m32r/include/asm/cacheflush.h3
-rw-r--r--arch/m32r/include/asm/socket.h2
-rw-r--r--arch/m68k/include/asm/cacheflush_mm.h1
-rw-r--r--arch/m68k/include/asm/cacheflush_no.h1
-rw-r--r--arch/m68k/include/asm/ptrace.h17
-rw-r--r--arch/m68k/include/asm/socket.h2
-rw-r--r--arch/m68k/include/asm/thread_info_mm.h5
-rw-r--r--arch/m68k/kernel/entry.S6
-rw-r--r--arch/m68k/kernel/process.c5
-rw-r--r--arch/m68k/kernel/ptrace.c112
-rw-r--r--arch/m68k/kernel/vmlinux-std.lds61
-rw-r--r--arch/m68k/kernel/vmlinux-sun3.lds54
-rw-r--r--arch/m68knommu/kernel/process.c5
-rw-r--r--arch/m68knommu/kernel/ptrace.c18
-rw-r--r--arch/microblaze/include/asm/cacheflush.h1
-rw-r--r--arch/microblaze/include/asm/prom.h135
-rw-r--r--arch/microblaze/kernel/head.S2
-rw-r--r--arch/microblaze/kernel/prom.c23
-rw-r--r--arch/microblaze/kernel/syscall_table.S1
-rw-r--r--arch/mips/Kconfig21
-rw-r--r--arch/mips/include/asm/bug.h4
-rw-r--r--arch/mips/include/asm/cacheflush.h1
-rw-r--r--arch/mips/include/asm/mman.h1
-rw-r--r--arch/mips/include/asm/socket.h2
-rw-r--r--arch/mips/include/asm/system.h15
-rw-r--r--arch/mips/include/asm/time.h14
-rw-r--r--arch/mips/include/asm/unistd.h15
-rw-r--r--arch/mips/kernel/linux32.c61
-rw-r--r--arch/mips/kernel/scall32-o32.S1
-rw-r--r--arch/mips/kernel/scall64-64.S1
-rw-r--r--arch/mips/kernel/scall64-n32.S3
-rw-r--r--arch/mips/kernel/scall64-o32.S3
-rw-r--r--arch/mips/kernel/syscall.c4
-rw-r--r--arch/mips/kernel/time.c33
-rw-r--r--arch/mips/lasat/sysctl.c121
-rw-r--r--arch/mips/rb532/devices.c3
-rw-r--r--arch/mn10300/include/asm/cacheflush.h1
-rw-r--r--arch/mn10300/include/asm/socket.h2
-rw-r--r--arch/mn10300/kernel/process.c12
-rw-r--r--arch/parisc/include/asm/cacheflush.h1
-rw-r--r--arch/parisc/include/asm/socket.h2
-rw-r--r--arch/parisc/kernel/sys_parisc32.c71
-rw-r--r--arch/parisc/kernel/syscall_table.S2
-rw-r--r--arch/parisc/kernel/unwind.c2
-rw-r--r--arch/parisc/kernel/vmlinux.lds.S6
-rw-r--r--arch/powerpc/Kconfig.debug2
-rw-r--r--arch/powerpc/configs/pseries_defconfig2
-rw-r--r--arch/powerpc/include/asm/cacheflush.h1
-rw-r--r--arch/powerpc/include/asm/emulated_ops.h19
-rw-r--r--arch/powerpc/include/asm/hvcall.h2
-rw-r--r--arch/powerpc/include/asm/kmap_types.h11
-rw-r--r--arch/powerpc/include/asm/pmac_low_i2c.h6
-rw-r--r--arch/powerpc/include/asm/prom.h147
-rw-r--r--arch/powerpc/include/asm/reg.h2
-rw-r--r--arch/powerpc/include/asm/socket.h2
-rw-r--r--arch/powerpc/include/asm/trace.h133
-rw-r--r--arch/powerpc/kernel/align.c12
-rw-r--r--arch/powerpc/kernel/entry_64.S4
-rw-r--r--arch/powerpc/kernel/exceptions-64s.S3
-rw-r--r--arch/powerpc/kernel/idle.c4
-rw-r--r--arch/powerpc/kernel/irq.c6
-rw-r--r--arch/powerpc/kernel/perf_event.c2
-rw-r--r--arch/powerpc/kernel/power5+-pmu.c4
-rw-r--r--arch/powerpc/kernel/power5-pmu.c6
-rw-r--r--arch/powerpc/kernel/power6-pmu.c2
-rw-r--r--arch/powerpc/kernel/power7-pmu.c6
-rw-r--r--arch/powerpc/kernel/ppc970-pmu.c4
-rw-r--r--arch/powerpc/kernel/prom.c23
-rw-r--r--arch/powerpc/kernel/setup-common.c1
-rw-r--r--arch/powerpc/kernel/setup_32.c2
-rw-r--r--arch/powerpc/kernel/setup_64.c2
-rw-r--r--arch/powerpc/kernel/sys_ppc32.c52
-rw-r--r--arch/powerpc/kernel/time.c13
-rw-r--r--arch/powerpc/kernel/traps.c18
-rw-r--r--arch/powerpc/kvm/powerpc.c5
-rw-r--r--arch/powerpc/kvm/timing.h2
-rw-r--r--arch/powerpc/lib/copypage_64.S4
-rw-r--r--arch/powerpc/platforms/powermac/low_i2c.c25
-rw-r--r--arch/powerpc/platforms/pseries/hvCall.S132
-rw-r--r--arch/powerpc/platforms/pseries/hvCall_inst.c38
-rw-r--r--arch/powerpc/platforms/pseries/lpar.c33
-rw-r--r--arch/s390/Kconfig43
-rw-r--r--arch/s390/appldata/appldata_base.c4
-rw-r--r--arch/s390/appldata/appldata_net_sum.c8
-rw-r--r--arch/s390/crypto/prng.c2
-rw-r--r--arch/s390/defconfig1
-rw-r--r--arch/s390/include/asm/atomic.h8
-rw-r--r--arch/s390/include/asm/bug.h2
-rw-r--r--arch/s390/include/asm/cacheflush.h1
-rw-r--r--arch/s390/include/asm/ccwdev.h4
-rw-r--r--arch/s390/include/asm/cputime.h8
-rw-r--r--arch/s390/include/asm/kvm.h3
-rw-r--r--arch/s390/include/asm/mmu_context.h4
-rw-r--r--arch/s390/include/asm/pgalloc.h3
-rw-r--r--arch/s390/include/asm/pgtable.h4
-rw-r--r--arch/s390/include/asm/setup.h17
-rw-r--r--arch/s390/include/asm/smp.h54
-rw-r--r--arch/s390/include/asm/socket.h2
-rw-r--r--arch/s390/include/asm/sockios.h21
-rw-r--r--arch/s390/include/asm/spinlock.h29
-rw-r--r--arch/s390/include/asm/termbits.h206
-rw-r--r--arch/s390/include/asm/todclk.h23
-rw-r--r--arch/s390/include/asm/uaccess.h2
-rw-r--r--arch/s390/kernel/Makefile1
-rw-r--r--arch/s390/kernel/compat_linux.c59
-rw-r--r--arch/s390/kernel/compat_linux.h6
-rw-r--r--arch/s390/kernel/compat_wrapper.S6
-rw-r--r--arch/s390/kernel/debug.c13
-rw-r--r--arch/s390/kernel/ftrace.c67
-rw-r--r--arch/s390/kernel/head64.S3
-rw-r--r--arch/s390/kernel/s390_ext.c2
-rw-r--r--arch/s390/kernel/setup.c36
-rw-r--r--arch/s390/kernel/time.c7
-rw-r--r--arch/s390/kernel/vdso.c9
-rw-r--r--arch/s390/kernel/vtime.c2
-rw-r--r--arch/s390/kvm/Kconfig1
-rw-r--r--arch/s390/kvm/kvm-s390.c30
-rw-r--r--arch/s390/kvm/sigp.c6
-rw-r--r--arch/s390/lib/uaccess_mvcos.c4
-rw-r--r--arch/s390/lib/uaccess_pt.c147
-rw-r--r--arch/s390/mm/cmm.c72
-rw-r--r--arch/s390/mm/fault.c378
-rw-r--r--arch/s390/mm/pgtable.c2
-rw-r--r--arch/s390/mm/vmem.c11
-rw-r--r--arch/score/include/asm/cacheflush.h1
-rw-r--r--arch/sh/boards/mach-hp6xx/setup.c55
-rw-r--r--arch/sh/boards/mach-se/7724/setup.c3
-rw-r--r--arch/sh/include/asm/cacheflush.h1
-rw-r--r--arch/sh/include/asm/sh_eth.h1
-rw-r--r--arch/sh/include/mach-common/mach/hp6xx.h4
-rw-r--r--arch/sh/kernel/syscalls_64.S1
-rw-r--r--arch/sh/kernel/traps_64.c13
-rw-r--r--arch/sparc/Kconfig7
-rw-r--r--arch/sparc/Makefile2
-rw-r--r--arch/sparc/include/asm/btext.h6
-rw-r--r--arch/sparc/include/asm/cacheflush_32.h1
-rw-r--r--arch/sparc/include/asm/cacheflush_64.h1
-rw-r--r--arch/sparc/include/asm/leon.h45
-rw-r--r--arch/sparc/include/asm/prom.h55
-rw-r--r--arch/sparc/include/asm/rwsem.h4
-rw-r--r--arch/sparc/include/asm/smp_32.h9
-rw-r--r--arch/sparc/include/asm/socket.h2
-rw-r--r--arch/sparc/include/asm/unistd.h3
-rw-r--r--arch/sparc/kernel/Makefile3
-rw-r--r--arch/sparc/kernel/apc.c37
-rw-r--r--arch/sparc/kernel/auxio_32.c1
-rw-r--r--arch/sparc/kernel/btext.c673
-rw-r--r--arch/sparc/kernel/cpu.c11
-rw-r--r--arch/sparc/kernel/entry.S33
-rw-r--r--arch/sparc/kernel/head_32.S22
-rw-r--r--arch/sparc/kernel/ioport.c5
-rw-r--r--arch/sparc/kernel/irq_64.c8
-rw-r--r--arch/sparc/kernel/leon_kernel.c84
-rw-r--r--arch/sparc/kernel/leon_smp.c468
-rw-r--r--arch/sparc/kernel/pci_msi.c2
-rw-r--r--arch/sparc/kernel/setup_64.c6
-rw-r--r--arch/sparc/kernel/smp_32.c10
-rw-r--r--arch/sparc/kernel/sys_sparc32.c62
-rw-r--r--arch/sparc/kernel/systbls_32.S2
-rw-r--r--arch/sparc/kernel/systbls_64.S6
-rw-r--r--arch/sparc/kernel/time_32.c3
-rw-r--r--arch/sparc/kernel/time_64.c2
-rw-r--r--arch/sparc/kernel/trampoline_32.S69
-rw-r--r--arch/sparc/mm/init_64.h2
-rw-r--r--arch/sparc/mm/srmmu.c9
-rw-r--r--arch/um/drivers/mmapper_kern.c11
-rw-r--r--arch/um/drivers/random.c3
-rw-r--r--arch/x86/Kconfig11
-rw-r--r--arch/x86/Kconfig.cpu16
-rw-r--r--arch/x86/Kconfig.debug23
-rw-r--r--arch/x86/Makefile3
-rw-r--r--arch/x86/Makefile_32.cpu9
-rw-r--r--arch/x86/boot/compressed/head_64.S3
-rw-r--r--arch/x86/boot/compressed/vmlinux.lds.S3
-rw-r--r--arch/x86/boot/video.c6
-rw-r--r--arch/x86/crypto/Makefile3
-rw-r--r--arch/x86/crypto/aesni-intel_asm.S517
-rw-r--r--arch/x86/crypto/ghash-clmulni-intel_asm.S157
-rw-r--r--arch/x86/crypto/ghash-clmulni-intel_glue.c333
-rw-r--r--arch/x86/ia32/ia32entry.S3
-rw-r--r--arch/x86/ia32/sys_ia32.c56
-rw-r--r--arch/x86/include/asm/Kbuild1
-rw-r--r--arch/x86/include/asm/a.out-core.h10
-rw-r--r--arch/x86/include/asm/acpi.h3
-rw-r--r--arch/x86/include/asm/alternative-asm.h10
-rw-r--r--arch/x86/include/asm/alternative.h1
-rw-r--r--arch/x86/include/asm/amd_iommu.h16
-rw-r--r--arch/x86/include/asm/amd_iommu_proto.h38
-rw-r--r--arch/x86/include/asm/amd_iommu_types.h54
-rw-r--r--arch/x86/include/asm/apic.h21
-rw-r--r--arch/x86/include/asm/apicdef.h6
-rw-r--r--arch/x86/include/asm/apicnum.h12
-rw-r--r--arch/x86/include/asm/bug.h4
-rw-r--r--arch/x86/include/asm/cache.h7
-rw-r--r--arch/x86/include/asm/cacheflush.h2
-rw-r--r--arch/x86/include/asm/calgary.h2
-rw-r--r--arch/x86/include/asm/cmpxchg_32.h218
-rw-r--r--arch/x86/include/asm/cmpxchg_64.h234
-rw-r--r--arch/x86/include/asm/cpufeature.h1
-rw-r--r--arch/x86/include/asm/debugreg.h33
-rw-r--r--arch/x86/include/asm/device.h2
-rw-r--r--arch/x86/include/asm/dma-mapping.h5
-rw-r--r--arch/x86/include/asm/e820.h23
-rw-r--r--arch/x86/include/asm/elf.h20
-rw-r--r--arch/x86/include/asm/entry_arch.h2
-rw-r--r--arch/x86/include/asm/gart.h9
-rw-r--r--arch/x86/include/asm/hardirq.h8
-rw-r--r--arch/x86/include/asm/hpet.h7
-rw-r--r--arch/x86/include/asm/hw_breakpoint.h73
-rw-r--r--arch/x86/include/asm/hw_irq.h34
-rw-r--r--arch/x86/include/asm/i387.h7
-rw-r--r--arch/x86/include/asm/inat.h220
-rw-r--r--arch/x86/include/asm/inat_types.h29
-rw-r--r--arch/x86/include/asm/insn.h184
-rw-r--r--arch/x86/include/asm/inst.h150
-rw-r--r--arch/x86/include/asm/iommu.h2
-rw-r--r--arch/x86/include/asm/irq.h3
-rw-r--r--arch/x86/include/asm/irq_vectors.h2
-rw-r--r--arch/x86/include/asm/k8.h5
-rw-r--r--arch/x86/include/asm/kvm.h30
-rw-r--r--arch/x86/include/asm/kvm_emulate.h2
-rw-r--r--arch/x86/include/asm/kvm_host.h34
-rw-r--r--arch/x86/include/asm/mce.h14
-rw-r--r--arch/x86/include/asm/microcode.h2
-rw-r--r--arch/x86/include/asm/mpspec.h27
-rw-r--r--arch/x86/include/asm/msr.h8
-rw-r--r--arch/x86/include/asm/page_types.h3
-rw-r--r--arch/x86/include/asm/perf_event.h13
-rw-r--r--arch/x86/include/asm/pgtable.h6
-rw-r--r--arch/x86/include/asm/processor.h14
-rw-r--r--arch/x86/include/asm/proto.h17
-rw-r--r--arch/x86/include/asm/ptrace.h62
-rw-r--r--arch/x86/include/asm/sections.h6
-rw-r--r--arch/x86/include/asm/string_32.h9
-rw-r--r--arch/x86/include/asm/svm.h3
-rw-r--r--arch/x86/include/asm/swiotlb.h9
-rw-r--r--arch/x86/include/asm/sys_ia32.h5
-rw-r--r--arch/x86/include/asm/system.h31
-rw-r--r--arch/x86/include/asm/thread_info.h7
-rw-r--r--arch/x86/include/asm/uaccess.h1
-rw-r--r--arch/x86/include/asm/uaccess_32.h27
-rw-r--r--arch/x86/include/asm/uaccess_64.h36
-rw-r--r--arch/x86/include/asm/unistd_32.h3
-rw-r--r--arch/x86/include/asm/unistd_64.h2
-rw-r--r--arch/x86/include/asm/uv/uv_irq.h14
-rw-r--r--arch/x86/include/asm/vmx.h4
-rw-r--r--arch/x86/include/asm/x86_init.h14
-rw-r--r--arch/x86/kernel/Makefile2
-rw-r--r--arch/x86/kernel/acpi/boot.c1
-rw-r--r--arch/x86/kernel/acpi/processor.c3
-rw-r--r--arch/x86/kernel/acpi/sleep.c24
-rw-r--r--arch/x86/kernel/amd_iommu.c1247
-rw-r--r--arch/x86/kernel/amd_iommu_init.c94
-rw-r--r--arch/x86/kernel/aperture_64.c4
-rw-r--r--arch/x86/kernel/apic/Makefile2
-rw-r--r--arch/x86/kernel/apic/apic.c36
-rw-r--r--arch/x86/kernel/apic/apic_noop.c200
-rw-r--r--arch/x86/kernel/apic/bigsmp_32.c13
-rw-r--r--arch/x86/kernel/apic/es7000_32.c16
-rw-r--r--arch/x86/kernel/apic/io_apic.c413
-rw-r--r--arch/x86/kernel/apic/nmi.c11
-rw-r--r--arch/x86/kernel/apic/numaq_32.c18
-rw-r--r--arch/x86/kernel/apic/probe_32.c2
-rw-r--r--arch/x86/kernel/apic/summit_32.c10
-rw-r--r--arch/x86/kernel/apic/x2apic_uv_x.c27
-rw-r--r--arch/x86/kernel/apm_32.c14
-rw-r--r--arch/x86/kernel/cpu/Makefile1
-rw-r--r--arch/x86/kernel/cpu/amd.c2
-rw-r--r--arch/x86/kernel/cpu/centaur.c2
-rw-r--r--arch/x86/kernel/cpu/common.c36
-rw-r--r--arch/x86/kernel/cpu/cpu.h2
-rw-r--r--arch/x86/kernel/cpu/cyrix.c2
-rw-r--r--arch/x86/kernel/cpu/intel.c6
-rw-r--r--arch/x86/kernel/cpu/intel_cacheinfo.c21
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce.c109
-rw-r--r--arch/x86/kernel/cpu/mcheck/therm_throt.c29
-rw-r--r--arch/x86/kernel/cpu/mtrr/cleanup.c51
-rw-r--r--arch/x86/kernel/cpu/perf_event.c205
-rw-r--r--arch/x86/kernel/cpu/perfctr-watchdog.c2
-rw-r--r--arch/x86/kernel/cpu/transmeta.c2
-rw-r--r--arch/x86/kernel/cpuid.c17
-rw-r--r--arch/x86/kernel/crash.c5
-rw-r--r--arch/x86/kernel/dumpstack.c7
-rw-r--r--arch/x86/kernel/dumpstack_32.c9
-rw-r--r--arch/x86/kernel/dumpstack_64.c46
-rw-r--r--arch/x86/kernel/entry_32.S31
-rw-r--r--arch/x86/kernel/entry_64.S29
-rw-r--r--arch/x86/kernel/ftrace.c101
-rw-r--r--arch/x86/kernel/head_32.S18
-rw-r--r--arch/x86/kernel/head_64.S7
-rw-r--r--arch/x86/kernel/hpet.c77
-rw-r--r--arch/x86/kernel/hw_breakpoint.c555
-rw-r--r--arch/x86/kernel/irq.c122
-rw-r--r--arch/x86/kernel/irq_32.c45
-rw-r--r--arch/x86/kernel/irq_64.c58
-rw-r--r--arch/x86/kernel/irqinit.c4
-rw-r--r--arch/x86/kernel/kgdb.c9
-rw-r--r--arch/x86/kernel/kprobes.c257
-rw-r--r--arch/x86/kernel/machine_kexec_32.c8
-rw-r--r--arch/x86/kernel/machine_kexec_64.c2
-rw-r--r--arch/x86/kernel/microcode_amd.c87
-rw-r--r--arch/x86/kernel/microcode_core.c10
-rw-r--r--arch/x86/kernel/mpparse.c44
-rw-r--r--arch/x86/kernel/msr.c16
-rw-r--r--arch/x86/kernel/pci-calgary_64.c94
-rw-r--r--arch/x86/kernel/pci-dma.c39
-rw-r--r--arch/x86/kernel/pci-gart_64.c156
-rw-r--r--arch/x86/kernel/pci-nommu.c11
-rw-r--r--arch/x86/kernel/pci-swiotlb.c18
-rw-r--r--arch/x86/kernel/process.c23
-rw-r--r--arch/x86/kernel/process_32.c10
-rw-r--r--arch/x86/kernel/process_64.c42
-rw-r--r--arch/x86/kernel/ptrace.c415
-rw-r--r--arch/x86/kernel/quirks.c9
-rw-r--r--arch/x86/kernel/reboot.c4
-rw-r--r--arch/x86/kernel/reboot_fixups_32.c1
-rw-r--r--arch/x86/kernel/setup.c113
-rw-r--r--arch/x86/kernel/signal.c12
-rw-r--r--arch/x86/kernel/smpboot.c9
-rw-r--r--arch/x86/kernel/syscall_table_32.S1
-rw-r--r--arch/x86/kernel/tlb_uv.c4
-rw-r--r--arch/x86/kernel/traps.c73
-rw-r--r--arch/x86/kernel/tsc_sync.c13
-rw-r--r--arch/x86/kernel/uv_irq.c239
-rw-r--r--arch/x86/kernel/uv_time.c80
-rw-r--r--arch/x86/kernel/visws_quirks.c10
-rw-r--r--arch/x86/kernel/vmiclock_32.c2
-rw-r--r--arch/x86/kernel/vmlinux.lds.S38
-rw-r--r--arch/x86/kernel/vsyscall_64.c7
-rw-r--r--arch/x86/kernel/x8664_ksyms_64.c5
-rw-r--r--arch/x86/kernel/x86_init.c10
-rw-r--r--arch/x86/kvm/Kconfig1
-rw-r--r--arch/x86/kvm/Makefile3
-rw-r--r--arch/x86/kvm/emulate.c159
-rw-r--r--arch/x86/kvm/i8254.c2
-rw-r--r--arch/x86/kvm/i8259.c44
-rw-r--r--arch/x86/kvm/irq.h7
-rw-r--r--arch/x86/kvm/lapic.c8
-rw-r--r--arch/x86/kvm/mmu.c3
-rw-r--r--arch/x86/kvm/paging_tmpl.h1
-rw-r--r--arch/x86/kvm/svm.c331
-rw-r--r--arch/x86/kvm/trace.h165
-rw-r--r--arch/x86/kvm/vmx.c448
-rw-r--r--arch/x86/kvm/x86.c568
-rw-r--r--arch/x86/lib/.gitignore1
-rw-r--r--arch/x86/lib/Makefile13
-rw-r--r--arch/x86/lib/copy_user_64.S14
-rw-r--r--arch/x86/lib/inat.c90
-rw-r--r--arch/x86/lib/insn.c516
-rw-r--r--arch/x86/lib/msr.c46
-rw-r--r--arch/x86/lib/usercopy_32.c10
-rw-r--r--arch/x86/lib/x86-opcode-map.txt893
-rw-r--r--arch/x86/mm/extable.c31
-rw-r--r--arch/x86/mm/fault.c13
-rw-r--r--arch/x86/mm/init.c4
-rw-r--r--arch/x86/mm/init_32.c10
-rw-r--r--arch/x86/mm/init_64.c35
-rw-r--r--arch/x86/mm/ioremap.c26
-rw-r--r--arch/x86/mm/k8topology_64.c101
-rw-r--r--arch/x86/mm/kmmio.c8
-rw-r--r--arch/x86/mm/numa_32.c4
-rw-r--r--arch/x86/mm/numa_64.c252
-rw-r--r--arch/x86/mm/pageattr.c22
-rw-r--r--arch/x86/mm/pat.c20
-rw-r--r--arch/x86/mm/setup_nx.c59
-rw-r--r--arch/x86/mm/srat_64.c33
-rw-r--r--arch/x86/mm/testmmiotrace.c29
-rw-r--r--arch/x86/mm/tlb.c3
-rw-r--r--arch/x86/power/cpu.c26
-rw-r--r--arch/x86/tools/Makefile31
-rw-r--r--arch/x86/tools/chkobjdump.awk23
-rw-r--r--arch/x86/tools/distill.awk47
-rw-r--r--arch/x86/tools/gen-insn-attr-x86.awk380
-rw-r--r--arch/x86/tools/test_get_len.c173
-rw-r--r--arch/x86/vdso/vdso32-setup.c1
-rw-r--r--arch/x86/xen/enlighten.c4
-rw-r--r--arch/x86/xen/smp.c2
-rw-r--r--arch/xtensa/include/asm/cacheflush.h1
-rw-r--r--arch/xtensa/include/asm/socket.h2
-rw-r--r--arch/xtensa/include/asm/unistd.h4
1175 files changed, 56753 insertions, 14937 deletions
diff --git a/arch/Kconfig b/arch/Kconfig
index 7f418bbc261a..d82875820a15 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -83,6 +83,13 @@ config KRETPROBES
83 def_bool y 83 def_bool y
84 depends on KPROBES && HAVE_KRETPROBES 84 depends on KPROBES && HAVE_KRETPROBES
85 85
86config USER_RETURN_NOTIFIER
87 bool
88 depends on HAVE_USER_RETURN_NOTIFIER
89 help
90 Provide a kernel-internal notification when a cpu is about to
91 switch to user mode.
92
86config HAVE_IOREMAP_PROT 93config HAVE_IOREMAP_PROT
87 bool 94 bool
88 95
@@ -126,4 +133,13 @@ config HAVE_DMA_API_DEBUG
126config HAVE_DEFAULT_NO_SPIN_MUTEXES 133config HAVE_DEFAULT_NO_SPIN_MUTEXES
127 bool 134 bool
128 135
136config HAVE_HW_BREAKPOINT
137 bool
138 depends on HAVE_PERF_EVENTS
139 select ANON_INODES
140 select PERF_EVENTS
141
142config HAVE_USER_RETURN_NOTIFIER
143 bool
144
129source "kernel/gcov/Kconfig" 145source "kernel/gcov/Kconfig"
diff --git a/arch/alpha/include/asm/cacheflush.h b/arch/alpha/include/asm/cacheflush.h
index b686cc7fc44e..01d71e1c8a9e 100644
--- a/arch/alpha/include/asm/cacheflush.h
+++ b/arch/alpha/include/asm/cacheflush.h
@@ -9,6 +9,7 @@
9#define flush_cache_dup_mm(mm) do { } while (0) 9#define flush_cache_dup_mm(mm) do { } while (0)
10#define flush_cache_range(vma, start, end) do { } while (0) 10#define flush_cache_range(vma, start, end) do { } while (0)
11#define flush_cache_page(vma, vmaddr, pfn) do { } while (0) 11#define flush_cache_page(vma, vmaddr, pfn) do { } while (0)
12#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 0
12#define flush_dcache_page(page) do { } while (0) 13#define flush_dcache_page(page) do { } while (0)
13#define flush_dcache_mmap_lock(mapping) do { } while (0) 14#define flush_dcache_mmap_lock(mapping) do { } while (0)
14#define flush_dcache_mmap_unlock(mapping) do { } while (0) 15#define flush_dcache_mmap_unlock(mapping) do { } while (0)
diff --git a/arch/alpha/include/asm/socket.h b/arch/alpha/include/asm/socket.h
index 26773e3246e2..06edfefc3373 100644
--- a/arch/alpha/include/asm/socket.h
+++ b/arch/alpha/include/asm/socket.h
@@ -67,6 +67,8 @@
67#define SO_TIMESTAMPING 37 67#define SO_TIMESTAMPING 37
68#define SCM_TIMESTAMPING SO_TIMESTAMPING 68#define SCM_TIMESTAMPING SO_TIMESTAMPING
69 69
70#define SO_RXQ_OVFL 40
71
70/* O_NONBLOCK clashes with the bits used for socket types. Therefore we 72/* O_NONBLOCK clashes with the bits used for socket types. Therefore we
71 * have to define SOCK_NONBLOCK to a different value here. 73 * have to define SOCK_NONBLOCK to a different value here.
72 */ 74 */
diff --git a/arch/alpha/include/asm/thread_info.h b/arch/alpha/include/asm/thread_info.h
index 815680b585ed..b3e888638bb7 100644
--- a/arch/alpha/include/asm/thread_info.h
+++ b/arch/alpha/include/asm/thread_info.h
@@ -61,21 +61,24 @@ register struct thread_info *__current_thread_info __asm__("$8");
61/* 61/*
62 * Thread information flags: 62 * Thread information flags:
63 * - these are process state flags and used from assembly 63 * - these are process state flags and used from assembly
64 * - pending work-to-be-done flags come first to fit in and immediate operand. 64 * - pending work-to-be-done flags come first and must be assigned to be
65 * within bits 0 to 7 to fit in and immediate operand.
66 * - ALPHA_UAC_SHIFT below must be kept consistent with the unaligned
67 * control flags.
65 * 68 *
66 * TIF_SYSCALL_TRACE is known to be 0 via blbs. 69 * TIF_SYSCALL_TRACE is known to be 0 via blbs.
67 */ 70 */
68#define TIF_SYSCALL_TRACE 0 /* syscall trace active */ 71#define TIF_SYSCALL_TRACE 0 /* syscall trace active */
69#define TIF_SIGPENDING 1 /* signal pending */ 72#define TIF_NOTIFY_RESUME 1 /* callback before returning to user */
70#define TIF_NEED_RESCHED 2 /* rescheduling necessary */ 73#define TIF_SIGPENDING 2 /* signal pending */
71#define TIF_POLLING_NRFLAG 3 /* poll_idle is polling NEED_RESCHED */ 74#define TIF_NEED_RESCHED 3 /* rescheduling necessary */
72#define TIF_DIE_IF_KERNEL 4 /* dik recursion lock */ 75#define TIF_POLLING_NRFLAG 8 /* poll_idle is polling NEED_RESCHED */
73#define TIF_UAC_NOPRINT 5 /* see sysinfo.h */ 76#define TIF_DIE_IF_KERNEL 9 /* dik recursion lock */
74#define TIF_UAC_NOFIX 6 77#define TIF_UAC_NOPRINT 10 /* see sysinfo.h */
75#define TIF_UAC_SIGBUS 7 78#define TIF_UAC_NOFIX 11
76#define TIF_MEMDIE 8 79#define TIF_UAC_SIGBUS 12
77#define TIF_RESTORE_SIGMASK 9 /* restore signal mask in do_signal */ 80#define TIF_MEMDIE 13
78#define TIF_NOTIFY_RESUME 10 /* callback before returning to user */ 81#define TIF_RESTORE_SIGMASK 14 /* restore signal mask in do_signal */
79#define TIF_FREEZE 16 /* is freezing for suspend */ 82#define TIF_FREEZE 16 /* is freezing for suspend */
80 83
81#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) 84#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
@@ -94,7 +97,7 @@ register struct thread_info *__current_thread_info __asm__("$8");
94#define _TIF_ALLWORK_MASK (_TIF_WORK_MASK \ 97#define _TIF_ALLWORK_MASK (_TIF_WORK_MASK \
95 | _TIF_SYSCALL_TRACE) 98 | _TIF_SYSCALL_TRACE)
96 99
97#define ALPHA_UAC_SHIFT 6 100#define ALPHA_UAC_SHIFT 10
98#define ALPHA_UAC_MASK (1 << TIF_UAC_NOPRINT | 1 << TIF_UAC_NOFIX | \ 101#define ALPHA_UAC_MASK (1 << TIF_UAC_NOPRINT | 1 << TIF_UAC_NOFIX | \
99 1 << TIF_UAC_SIGBUS) 102 1 << TIF_UAC_SIGBUS)
100 103
diff --git a/arch/alpha/include/asm/unistd.h b/arch/alpha/include/asm/unistd.h
index 5b5c17485942..7f23665122df 100644
--- a/arch/alpha/include/asm/unistd.h
+++ b/arch/alpha/include/asm/unistd.h
@@ -433,10 +433,11 @@
433#define __NR_signalfd 476 433#define __NR_signalfd 476
434#define __NR_timerfd 477 434#define __NR_timerfd 477
435#define __NR_eventfd 478 435#define __NR_eventfd 478
436#define __NR_recvmmsg 479
436 437
437#ifdef __KERNEL__ 438#ifdef __KERNEL__
438 439
439#define NR_SYSCALLS 479 440#define NR_SYSCALLS 480
440 441
441#define __ARCH_WANT_IPC_PARSE_VERSION 442#define __ARCH_WANT_IPC_PARSE_VERSION
442#define __ARCH_WANT_OLD_READDIR 443#define __ARCH_WANT_OLD_READDIR
diff --git a/arch/alpha/kernel/core_marvel.c b/arch/alpha/kernel/core_marvel.c
index 8e059e58b0ac..53dd2f1a53aa 100644
--- a/arch/alpha/kernel/core_marvel.c
+++ b/arch/alpha/kernel/core_marvel.c
@@ -1103,6 +1103,8 @@ marvel_agp_info(void)
1103 * Allocate the info structure. 1103 * Allocate the info structure.
1104 */ 1104 */
1105 agp = kmalloc(sizeof(*agp), GFP_KERNEL); 1105 agp = kmalloc(sizeof(*agp), GFP_KERNEL);
1106 if (!agp)
1107 return NULL;
1106 1108
1107 /* 1109 /*
1108 * Fill it in. 1110 * Fill it in.
diff --git a/arch/alpha/kernel/core_titan.c b/arch/alpha/kernel/core_titan.c
index 76686497b1e2..219bf271c0ba 100644
--- a/arch/alpha/kernel/core_titan.c
+++ b/arch/alpha/kernel/core_titan.c
@@ -757,6 +757,8 @@ titan_agp_info(void)
757 * Allocate the info structure. 757 * Allocate the info structure.
758 */ 758 */
759 agp = kmalloc(sizeof(*agp), GFP_KERNEL); 759 agp = kmalloc(sizeof(*agp), GFP_KERNEL);
760 if (!agp)
761 return NULL;
760 762
761 /* 763 /*
762 * Fill it in. 764 * Fill it in.
diff --git a/arch/alpha/kernel/irq.c b/arch/alpha/kernel/irq.c
index cc7834661427..c0de072b8305 100644
--- a/arch/alpha/kernel/irq.c
+++ b/arch/alpha/kernel/irq.c
@@ -92,7 +92,7 @@ show_interrupts(struct seq_file *p, void *v)
92 for_each_online_cpu(j) 92 for_each_online_cpu(j)
93 seq_printf(p, "%10u ", kstat_irqs_cpu(irq, j)); 93 seq_printf(p, "%10u ", kstat_irqs_cpu(irq, j));
94#endif 94#endif
95 seq_printf(p, " %14s", irq_desc[irq].chip->typename); 95 seq_printf(p, " %14s", irq_desc[irq].chip->name);
96 seq_printf(p, " %c%s", 96 seq_printf(p, " %c%s",
97 (action->flags & IRQF_DISABLED)?'+':' ', 97 (action->flags & IRQF_DISABLED)?'+':' ',
98 action->name); 98 action->name);
diff --git a/arch/alpha/kernel/irq_alpha.c b/arch/alpha/kernel/irq_alpha.c
index 38c805dfc544..cfde865b78e0 100644
--- a/arch/alpha/kernel/irq_alpha.c
+++ b/arch/alpha/kernel/irq_alpha.c
@@ -228,7 +228,7 @@ struct irqaction timer_irqaction = {
228}; 228};
229 229
230static struct irq_chip rtc_irq_type = { 230static struct irq_chip rtc_irq_type = {
231 .typename = "RTC", 231 .name = "RTC",
232 .startup = rtc_startup, 232 .startup = rtc_startup,
233 .shutdown = rtc_enable_disable, 233 .shutdown = rtc_enable_disable,
234 .enable = rtc_enable_disable, 234 .enable = rtc_enable_disable,
diff --git a/arch/alpha/kernel/irq_i8259.c b/arch/alpha/kernel/irq_i8259.c
index 50bfec9b588f..83a9ac280890 100644
--- a/arch/alpha/kernel/irq_i8259.c
+++ b/arch/alpha/kernel/irq_i8259.c
@@ -84,7 +84,7 @@ i8259a_end_irq(unsigned int irq)
84} 84}
85 85
86struct irq_chip i8259a_irq_type = { 86struct irq_chip i8259a_irq_type = {
87 .typename = "XT-PIC", 87 .name = "XT-PIC",
88 .startup = i8259a_startup_irq, 88 .startup = i8259a_startup_irq,
89 .shutdown = i8259a_disable_irq, 89 .shutdown = i8259a_disable_irq,
90 .enable = i8259a_enable_irq, 90 .enable = i8259a_enable_irq,
diff --git a/arch/alpha/kernel/irq_pyxis.c b/arch/alpha/kernel/irq_pyxis.c
index 69199a76ec4a..989ce46a0cf3 100644
--- a/arch/alpha/kernel/irq_pyxis.c
+++ b/arch/alpha/kernel/irq_pyxis.c
@@ -71,7 +71,7 @@ pyxis_mask_and_ack_irq(unsigned int irq)
71} 71}
72 72
73static struct irq_chip pyxis_irq_type = { 73static struct irq_chip pyxis_irq_type = {
74 .typename = "PYXIS", 74 .name = "PYXIS",
75 .startup = pyxis_startup_irq, 75 .startup = pyxis_startup_irq,
76 .shutdown = pyxis_disable_irq, 76 .shutdown = pyxis_disable_irq,
77 .enable = pyxis_enable_irq, 77 .enable = pyxis_enable_irq,
diff --git a/arch/alpha/kernel/irq_srm.c b/arch/alpha/kernel/irq_srm.c
index 85229369a1f8..d63e93e1e8bf 100644
--- a/arch/alpha/kernel/irq_srm.c
+++ b/arch/alpha/kernel/irq_srm.c
@@ -49,7 +49,7 @@ srm_end_irq(unsigned int irq)
49 49
50/* Handle interrupts from the SRM, assuming no additional weirdness. */ 50/* Handle interrupts from the SRM, assuming no additional weirdness. */
51static struct irq_chip srm_irq_type = { 51static struct irq_chip srm_irq_type = {
52 .typename = "SRM", 52 .name = "SRM",
53 .startup = srm_startup_irq, 53 .startup = srm_startup_irq,
54 .shutdown = srm_disable_irq, 54 .shutdown = srm_disable_irq,
55 .enable = srm_enable_irq, 55 .enable = srm_enable_irq,
diff --git a/arch/alpha/kernel/sys_alcor.c b/arch/alpha/kernel/sys_alcor.c
index 382035ef7394..20a30b8b9655 100644
--- a/arch/alpha/kernel/sys_alcor.c
+++ b/arch/alpha/kernel/sys_alcor.c
@@ -90,7 +90,7 @@ alcor_end_irq(unsigned int irq)
90} 90}
91 91
92static struct irq_chip alcor_irq_type = { 92static struct irq_chip alcor_irq_type = {
93 .typename = "ALCOR", 93 .name = "ALCOR",
94 .startup = alcor_startup_irq, 94 .startup = alcor_startup_irq,
95 .shutdown = alcor_disable_irq, 95 .shutdown = alcor_disable_irq,
96 .enable = alcor_enable_irq, 96 .enable = alcor_enable_irq,
diff --git a/arch/alpha/kernel/sys_cabriolet.c b/arch/alpha/kernel/sys_cabriolet.c
index ed349436732b..affd0f3f25df 100644
--- a/arch/alpha/kernel/sys_cabriolet.c
+++ b/arch/alpha/kernel/sys_cabriolet.c
@@ -72,7 +72,7 @@ cabriolet_end_irq(unsigned int irq)
72} 72}
73 73
74static struct irq_chip cabriolet_irq_type = { 74static struct irq_chip cabriolet_irq_type = {
75 .typename = "CABRIOLET", 75 .name = "CABRIOLET",
76 .startup = cabriolet_startup_irq, 76 .startup = cabriolet_startup_irq,
77 .shutdown = cabriolet_disable_irq, 77 .shutdown = cabriolet_disable_irq,
78 .enable = cabriolet_enable_irq, 78 .enable = cabriolet_enable_irq,
diff --git a/arch/alpha/kernel/sys_dp264.c b/arch/alpha/kernel/sys_dp264.c
index 46e70ece5176..d64e1e497e76 100644
--- a/arch/alpha/kernel/sys_dp264.c
+++ b/arch/alpha/kernel/sys_dp264.c
@@ -199,7 +199,7 @@ clipper_set_affinity(unsigned int irq, const struct cpumask *affinity)
199} 199}
200 200
201static struct irq_chip dp264_irq_type = { 201static struct irq_chip dp264_irq_type = {
202 .typename = "DP264", 202 .name = "DP264",
203 .startup = dp264_startup_irq, 203 .startup = dp264_startup_irq,
204 .shutdown = dp264_disable_irq, 204 .shutdown = dp264_disable_irq,
205 .enable = dp264_enable_irq, 205 .enable = dp264_enable_irq,
@@ -210,7 +210,7 @@ static struct irq_chip dp264_irq_type = {
210}; 210};
211 211
212static struct irq_chip clipper_irq_type = { 212static struct irq_chip clipper_irq_type = {
213 .typename = "CLIPPER", 213 .name = "CLIPPER",
214 .startup = clipper_startup_irq, 214 .startup = clipper_startup_irq,
215 .shutdown = clipper_disable_irq, 215 .shutdown = clipper_disable_irq,
216 .enable = clipper_enable_irq, 216 .enable = clipper_enable_irq,
diff --git a/arch/alpha/kernel/sys_eb64p.c b/arch/alpha/kernel/sys_eb64p.c
index 660c23ef661f..df2090ce5e7f 100644
--- a/arch/alpha/kernel/sys_eb64p.c
+++ b/arch/alpha/kernel/sys_eb64p.c
@@ -70,7 +70,7 @@ eb64p_end_irq(unsigned int irq)
70} 70}
71 71
72static struct irq_chip eb64p_irq_type = { 72static struct irq_chip eb64p_irq_type = {
73 .typename = "EB64P", 73 .name = "EB64P",
74 .startup = eb64p_startup_irq, 74 .startup = eb64p_startup_irq,
75 .shutdown = eb64p_disable_irq, 75 .shutdown = eb64p_disable_irq,
76 .enable = eb64p_enable_irq, 76 .enable = eb64p_enable_irq,
diff --git a/arch/alpha/kernel/sys_eiger.c b/arch/alpha/kernel/sys_eiger.c
index b99ea488d844..3ca1dbcf4044 100644
--- a/arch/alpha/kernel/sys_eiger.c
+++ b/arch/alpha/kernel/sys_eiger.c
@@ -81,7 +81,7 @@ eiger_end_irq(unsigned int irq)
81} 81}
82 82
83static struct irq_chip eiger_irq_type = { 83static struct irq_chip eiger_irq_type = {
84 .typename = "EIGER", 84 .name = "EIGER",
85 .startup = eiger_startup_irq, 85 .startup = eiger_startup_irq,
86 .shutdown = eiger_disable_irq, 86 .shutdown = eiger_disable_irq,
87 .enable = eiger_enable_irq, 87 .enable = eiger_enable_irq,
diff --git a/arch/alpha/kernel/sys_jensen.c b/arch/alpha/kernel/sys_jensen.c
index ef0b83a070ac..7a7ae36fff91 100644
--- a/arch/alpha/kernel/sys_jensen.c
+++ b/arch/alpha/kernel/sys_jensen.c
@@ -119,7 +119,7 @@ jensen_local_end(unsigned int irq)
119} 119}
120 120
121static struct irq_chip jensen_local_irq_type = { 121static struct irq_chip jensen_local_irq_type = {
122 .typename = "LOCAL", 122 .name = "LOCAL",
123 .startup = jensen_local_startup, 123 .startup = jensen_local_startup,
124 .shutdown = jensen_local_shutdown, 124 .shutdown = jensen_local_shutdown,
125 .enable = jensen_local_enable, 125 .enable = jensen_local_enable,
diff --git a/arch/alpha/kernel/sys_marvel.c b/arch/alpha/kernel/sys_marvel.c
index bbfc4f20ca72..0bb3b5c4f693 100644
--- a/arch/alpha/kernel/sys_marvel.c
+++ b/arch/alpha/kernel/sys_marvel.c
@@ -170,7 +170,7 @@ marvel_irq_noop_return(unsigned int irq)
170} 170}
171 171
172static struct irq_chip marvel_legacy_irq_type = { 172static struct irq_chip marvel_legacy_irq_type = {
173 .typename = "LEGACY", 173 .name = "LEGACY",
174 .startup = marvel_irq_noop_return, 174 .startup = marvel_irq_noop_return,
175 .shutdown = marvel_irq_noop, 175 .shutdown = marvel_irq_noop,
176 .enable = marvel_irq_noop, 176 .enable = marvel_irq_noop,
@@ -180,7 +180,7 @@ static struct irq_chip marvel_legacy_irq_type = {
180}; 180};
181 181
182static struct irq_chip io7_lsi_irq_type = { 182static struct irq_chip io7_lsi_irq_type = {
183 .typename = "LSI", 183 .name = "LSI",
184 .startup = io7_startup_irq, 184 .startup = io7_startup_irq,
185 .shutdown = io7_disable_irq, 185 .shutdown = io7_disable_irq,
186 .enable = io7_enable_irq, 186 .enable = io7_enable_irq,
@@ -190,7 +190,7 @@ static struct irq_chip io7_lsi_irq_type = {
190}; 190};
191 191
192static struct irq_chip io7_msi_irq_type = { 192static struct irq_chip io7_msi_irq_type = {
193 .typename = "MSI", 193 .name = "MSI",
194 .startup = io7_startup_irq, 194 .startup = io7_startup_irq,
195 .shutdown = io7_disable_irq, 195 .shutdown = io7_disable_irq,
196 .enable = io7_enable_irq, 196 .enable = io7_enable_irq,
diff --git a/arch/alpha/kernel/sys_mikasa.c b/arch/alpha/kernel/sys_mikasa.c
index 4e366641a08e..ee8865169811 100644
--- a/arch/alpha/kernel/sys_mikasa.c
+++ b/arch/alpha/kernel/sys_mikasa.c
@@ -69,7 +69,7 @@ mikasa_end_irq(unsigned int irq)
69} 69}
70 70
71static struct irq_chip mikasa_irq_type = { 71static struct irq_chip mikasa_irq_type = {
72 .typename = "MIKASA", 72 .name = "MIKASA",
73 .startup = mikasa_startup_irq, 73 .startup = mikasa_startup_irq,
74 .shutdown = mikasa_disable_irq, 74 .shutdown = mikasa_disable_irq,
75 .enable = mikasa_enable_irq, 75 .enable = mikasa_enable_irq,
diff --git a/arch/alpha/kernel/sys_noritake.c b/arch/alpha/kernel/sys_noritake.c
index 35753a173bac..86503fe73a88 100644
--- a/arch/alpha/kernel/sys_noritake.c
+++ b/arch/alpha/kernel/sys_noritake.c
@@ -74,7 +74,7 @@ noritake_end_irq(unsigned int irq)
74} 74}
75 75
76static struct irq_chip noritake_irq_type = { 76static struct irq_chip noritake_irq_type = {
77 .typename = "NORITAKE", 77 .name = "NORITAKE",
78 .startup = noritake_startup_irq, 78 .startup = noritake_startup_irq,
79 .shutdown = noritake_disable_irq, 79 .shutdown = noritake_disable_irq,
80 .enable = noritake_enable_irq, 80 .enable = noritake_enable_irq,
diff --git a/arch/alpha/kernel/sys_rawhide.c b/arch/alpha/kernel/sys_rawhide.c
index f3aec7e085c8..26c322bf89ee 100644
--- a/arch/alpha/kernel/sys_rawhide.c
+++ b/arch/alpha/kernel/sys_rawhide.c
@@ -136,7 +136,7 @@ rawhide_end_irq(unsigned int irq)
136} 136}
137 137
138static struct irq_chip rawhide_irq_type = { 138static struct irq_chip rawhide_irq_type = {
139 .typename = "RAWHIDE", 139 .name = "RAWHIDE",
140 .startup = rawhide_startup_irq, 140 .startup = rawhide_startup_irq,
141 .shutdown = rawhide_disable_irq, 141 .shutdown = rawhide_disable_irq,
142 .enable = rawhide_enable_irq, 142 .enable = rawhide_enable_irq,
diff --git a/arch/alpha/kernel/sys_ruffian.c b/arch/alpha/kernel/sys_ruffian.c
index d9f9cfeb9931..8de1046fe91e 100644
--- a/arch/alpha/kernel/sys_ruffian.c
+++ b/arch/alpha/kernel/sys_ruffian.c
@@ -66,7 +66,7 @@ ruffian_init_irq(void)
66 common_init_isa_dma(); 66 common_init_isa_dma();
67} 67}
68 68
69#define RUFFIAN_LATCH ((PIT_TICK_RATE + HZ / 2) / HZ) 69#define RUFFIAN_LATCH DIV_ROUND_CLOSEST(PIT_TICK_RATE, HZ)
70 70
71static void __init 71static void __init
72ruffian_init_rtc(void) 72ruffian_init_rtc(void)
diff --git a/arch/alpha/kernel/sys_rx164.c b/arch/alpha/kernel/sys_rx164.c
index fc9246373452..be161129eab9 100644
--- a/arch/alpha/kernel/sys_rx164.c
+++ b/arch/alpha/kernel/sys_rx164.c
@@ -73,7 +73,7 @@ rx164_end_irq(unsigned int irq)
73} 73}
74 74
75static struct irq_chip rx164_irq_type = { 75static struct irq_chip rx164_irq_type = {
76 .typename = "RX164", 76 .name = "RX164",
77 .startup = rx164_startup_irq, 77 .startup = rx164_startup_irq,
78 .shutdown = rx164_disable_irq, 78 .shutdown = rx164_disable_irq,
79 .enable = rx164_enable_irq, 79 .enable = rx164_enable_irq,
diff --git a/arch/alpha/kernel/sys_sable.c b/arch/alpha/kernel/sys_sable.c
index 426eb6906d01..b2abe27a23cf 100644
--- a/arch/alpha/kernel/sys_sable.c
+++ b/arch/alpha/kernel/sys_sable.c
@@ -502,7 +502,7 @@ sable_lynx_mask_and_ack_irq(unsigned int irq)
502} 502}
503 503
504static struct irq_chip sable_lynx_irq_type = { 504static struct irq_chip sable_lynx_irq_type = {
505 .typename = "SABLE/LYNX", 505 .name = "SABLE/LYNX",
506 .startup = sable_lynx_startup_irq, 506 .startup = sable_lynx_startup_irq,
507 .shutdown = sable_lynx_disable_irq, 507 .shutdown = sable_lynx_disable_irq,
508 .enable = sable_lynx_enable_irq, 508 .enable = sable_lynx_enable_irq,
diff --git a/arch/alpha/kernel/sys_takara.c b/arch/alpha/kernel/sys_takara.c
index 830318c21661..230464885b5c 100644
--- a/arch/alpha/kernel/sys_takara.c
+++ b/arch/alpha/kernel/sys_takara.c
@@ -75,7 +75,7 @@ takara_end_irq(unsigned int irq)
75} 75}
76 76
77static struct irq_chip takara_irq_type = { 77static struct irq_chip takara_irq_type = {
78 .typename = "TAKARA", 78 .name = "TAKARA",
79 .startup = takara_startup_irq, 79 .startup = takara_startup_irq,
80 .shutdown = takara_disable_irq, 80 .shutdown = takara_disable_irq,
81 .enable = takara_enable_irq, 81 .enable = takara_enable_irq,
diff --git a/arch/alpha/kernel/sys_titan.c b/arch/alpha/kernel/sys_titan.c
index 88978fc60f83..288053342c83 100644
--- a/arch/alpha/kernel/sys_titan.c
+++ b/arch/alpha/kernel/sys_titan.c
@@ -195,7 +195,7 @@ init_titan_irqs(struct irq_chip * ops, int imin, int imax)
195} 195}
196 196
197static struct irq_chip titan_irq_type = { 197static struct irq_chip titan_irq_type = {
198 .typename = "TITAN", 198 .name = "TITAN",
199 .startup = titan_startup_irq, 199 .startup = titan_startup_irq,
200 .shutdown = titan_disable_irq, 200 .shutdown = titan_disable_irq,
201 .enable = titan_enable_irq, 201 .enable = titan_enable_irq,
diff --git a/arch/alpha/kernel/sys_wildfire.c b/arch/alpha/kernel/sys_wildfire.c
index e91b4c3838a8..62fd972e18ef 100644
--- a/arch/alpha/kernel/sys_wildfire.c
+++ b/arch/alpha/kernel/sys_wildfire.c
@@ -158,7 +158,7 @@ wildfire_end_irq(unsigned int irq)
158} 158}
159 159
160static struct irq_chip wildfire_irq_type = { 160static struct irq_chip wildfire_irq_type = {
161 .typename = "WILDFIRE", 161 .name = "WILDFIRE",
162 .startup = wildfire_startup_irq, 162 .startup = wildfire_startup_irq,
163 .shutdown = wildfire_disable_irq, 163 .shutdown = wildfire_disable_irq,
164 .enable = wildfire_enable_irq, 164 .enable = wildfire_enable_irq,
diff --git a/arch/alpha/kernel/systbls.S b/arch/alpha/kernel/systbls.S
index 95c9aef1c106..cda6b8b3d573 100644
--- a/arch/alpha/kernel/systbls.S
+++ b/arch/alpha/kernel/systbls.S
@@ -497,6 +497,7 @@ sys_call_table:
497 .quad sys_signalfd 497 .quad sys_signalfd
498 .quad sys_ni_syscall 498 .quad sys_ni_syscall
499 .quad sys_eventfd 499 .quad sys_eventfd
500 .quad sys_recvmmsg
500 501
501 .size sys_call_table, . - sys_call_table 502 .size sys_call_table, . - sys_call_table
502 .type sys_call_table, @object 503 .type sys_call_table, @object
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 1c4119c60040..cf8a99f19dc4 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -433,6 +433,17 @@ config ARCH_L7200
433 If you have any questions or comments about the Linux kernel port 433 If you have any questions or comments about the Linux kernel port
434 to this board, send e-mail to <sjhill@cotw.com>. 434 to this board, send e-mail to <sjhill@cotw.com>.
435 435
436config ARCH_DOVE
437 bool "Marvell Dove"
438 select PCI
439 select GENERIC_GPIO
440 select ARCH_REQUIRE_GPIOLIB
441 select GENERIC_TIME
442 select GENERIC_CLOCKEVENTS
443 select PLAT_ORION
444 help
445 Support for the Marvell Dove SoC 88AP510
446
436config ARCH_KIRKWOOD 447config ARCH_KIRKWOOD
437 bool "Marvell Kirkwood" 448 bool "Marvell Kirkwood"
438 select CPU_FEROCEON 449 select CPU_FEROCEON
@@ -702,6 +713,16 @@ config ARCH_BCMRING
702 help 713 help
703 Support for Broadcom's BCMRing platform. 714 Support for Broadcom's BCMRing platform.
704 715
716config ARCH_U8500
717 bool "ST-Ericsson U8500 Series"
718 select CPU_V7
719 select ARM_AMBA
720 select GENERIC_TIME
721 select GENERIC_CLOCKEVENTS
722 select COMMON_CLKDEV
723 help
724 Support for ST-Ericsson's Ux500 architecture
725
705endchoice 726endchoice
706 727
707source "arch/arm/mach-clps711x/Kconfig" 728source "arch/arm/mach-clps711x/Kconfig"
@@ -747,6 +768,9 @@ source "arch/arm/mach-orion5x/Kconfig"
747 768
748source "arch/arm/mach-kirkwood/Kconfig" 769source "arch/arm/mach-kirkwood/Kconfig"
749 770
771source "arch/arm/mach-dove/Kconfig"
772
773source "arch/arm/plat-samsung/Kconfig"
750source "arch/arm/plat-s3c24xx/Kconfig" 774source "arch/arm/plat-s3c24xx/Kconfig"
751source "arch/arm/plat-s3c64xx/Kconfig" 775source "arch/arm/plat-s3c64xx/Kconfig"
752source "arch/arm/plat-s3c/Kconfig" 776source "arch/arm/plat-s3c/Kconfig"
@@ -787,6 +811,7 @@ source "arch/arm/mach-at91/Kconfig"
787source "arch/arm/plat-mxc/Kconfig" 811source "arch/arm/plat-mxc/Kconfig"
788 812
789source "arch/arm/mach-nomadik/Kconfig" 813source "arch/arm/mach-nomadik/Kconfig"
814source "arch/arm/plat-nomadik/Kconfig"
790 815
791source "arch/arm/mach-netx/Kconfig" 816source "arch/arm/mach-netx/Kconfig"
792 817
@@ -804,12 +829,16 @@ source "arch/arm/mach-w90x900/Kconfig"
804 829
805source "arch/arm/mach-bcmring/Kconfig" 830source "arch/arm/mach-bcmring/Kconfig"
806 831
832source "arch/arm/mach-ux500/Kconfig"
833
807# Definitions to make life easier 834# Definitions to make life easier
808config ARCH_ACORN 835config ARCH_ACORN
809 bool 836 bool
810 837
811config PLAT_IOP 838config PLAT_IOP
812 bool 839 bool
840 select GENERIC_CLOCKEVENTS
841 select GENERIC_TIME
813 842
814config PLAT_ORION 843config PLAT_ORION
815 bool 844 bool
@@ -955,10 +984,10 @@ source "kernel/time/Kconfig"
955config SMP 984config SMP
956 bool "Symmetric Multi-Processing (EXPERIMENTAL)" 985 bool "Symmetric Multi-Processing (EXPERIMENTAL)"
957 depends on EXPERIMENTAL && (REALVIEW_EB_ARM11MP || REALVIEW_EB_A9MP ||\ 986 depends on EXPERIMENTAL && (REALVIEW_EB_ARM11MP || REALVIEW_EB_A9MP ||\
958 MACH_REALVIEW_PB11MP || MACH_REALVIEW_PBX || ARCH_OMAP4) 987 MACH_REALVIEW_PB11MP || MACH_REALVIEW_PBX || ARCH_OMAP4 || ARCH_U8500)
959 depends on GENERIC_CLOCKEVENTS 988 depends on GENERIC_CLOCKEVENTS
960 select USE_GENERIC_SMP_HELPERS 989 select USE_GENERIC_SMP_HELPERS
961 select HAVE_ARM_SCU if (ARCH_REALVIEW || ARCH_OMAP4) 990 select HAVE_ARM_SCU if (ARCH_REALVIEW || ARCH_OMAP4 || ARCH_U8500)
962 help 991 help
963 This enables support for systems with more than one CPU. If you have 992 This enables support for systems with more than one CPU. If you have
964 a system with only one CPU, like most personal computers, say N. If 993 a system with only one CPU, like most personal computers, say N. If
@@ -1027,9 +1056,9 @@ config HOTPLUG_CPU
1027config LOCAL_TIMERS 1056config LOCAL_TIMERS
1028 bool "Use local timer interrupts" 1057 bool "Use local timer interrupts"
1029 depends on SMP && (REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP || \ 1058 depends on SMP && (REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP || \
1030 REALVIEW_EB_A9MP || MACH_REALVIEW_PBX || ARCH_OMAP4) 1059 REALVIEW_EB_A9MP || MACH_REALVIEW_PBX || ARCH_OMAP4 || ARCH_U8500)
1031 default y 1060 default y
1032 select HAVE_ARM_TWD if (ARCH_REALVIEW || ARCH_OMAP4) 1061 select HAVE_ARM_TWD if (ARCH_REALVIEW || ARCH_OMAP4 || ARCH_U8500)
1033 help 1062 help
1034 Enable support for local timers on SMP platforms, rather then the 1063 Enable support for local timers on SMP platforms, rather then the
1035 legacy IPI broadcast method. Local timers allows the system 1064 legacy IPI broadcast method. Local timers allows the system
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index 1a6f70e52921..ff54c23d085e 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -83,6 +83,14 @@ config DEBUG_ICEDCC
83 It does include a timeout to ensure that the system does not 83 It does include a timeout to ensure that the system does not
84 totally freeze when there is nothing connected to read. 84 totally freeze when there is nothing connected to read.
85 85
86config OC_ETM
87 bool "On-chip ETM and ETB"
88 select ARM_AMBA
89 help
90 Enables the on-chip embedded trace macrocell and embedded trace
91 buffer driver that will allow you to collect traces of the
92 kernel code.
93
86config DEBUG_DC21285_PORT 94config DEBUG_DC21285_PORT
87 bool "Kernel low-level debugging messages via footbridge serial port" 95 bool "Kernel low-level debugging messages via footbridge serial port"
88 depends on DEBUG_LL && FOOTBRIDGE 96 depends on DEBUG_LL && FOOTBRIDGE
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index a73caaf66763..fa0cdab2e1d3 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -122,6 +122,7 @@ machine-$(CONFIG_ARCH_AT91) := at91
122machine-$(CONFIG_ARCH_BCMRING) := bcmring 122machine-$(CONFIG_ARCH_BCMRING) := bcmring
123machine-$(CONFIG_ARCH_CLPS711X) := clps711x 123machine-$(CONFIG_ARCH_CLPS711X) := clps711x
124machine-$(CONFIG_ARCH_DAVINCI) := davinci 124machine-$(CONFIG_ARCH_DAVINCI) := davinci
125machine-$(CONFIG_ARCH_DOVE) := dove
125machine-$(CONFIG_ARCH_EBSA110) := ebsa110 126machine-$(CONFIG_ARCH_EBSA110) := ebsa110
126machine-$(CONFIG_ARCH_EP93XX) := ep93xx 127machine-$(CONFIG_ARCH_EP93XX) := ep93xx
127machine-$(CONFIG_ARCH_GEMINI) := gemini 128machine-$(CONFIG_ARCH_GEMINI) := gemini
@@ -166,6 +167,7 @@ machine-$(CONFIG_ARCH_SHARK) := shark
166machine-$(CONFIG_ARCH_STMP378X) := stmp378x 167machine-$(CONFIG_ARCH_STMP378X) := stmp378x
167machine-$(CONFIG_ARCH_STMP37XX) := stmp37xx 168machine-$(CONFIG_ARCH_STMP37XX) := stmp37xx
168machine-$(CONFIG_ARCH_U300) := u300 169machine-$(CONFIG_ARCH_U300) := u300
170machine-$(CONFIG_ARCH_U8500) := ux500
169machine-$(CONFIG_ARCH_VERSATILE) := versatile 171machine-$(CONFIG_ARCH_VERSATILE) := versatile
170machine-$(CONFIG_ARCH_W90X900) := w90x900 172machine-$(CONFIG_ARCH_W90X900) := w90x900
171machine-$(CONFIG_FOOTBRIDGE) := footbridge 173machine-$(CONFIG_FOOTBRIDGE) := footbridge
@@ -176,11 +178,12 @@ machine-$(CONFIG_ARCH_MXC91231) := mxc91231
176plat-$(CONFIG_ARCH_MXC) := mxc 178plat-$(CONFIG_ARCH_MXC) := mxc
177plat-$(CONFIG_ARCH_OMAP) := omap 179plat-$(CONFIG_ARCH_OMAP) := omap
178plat-$(CONFIG_PLAT_IOP) := iop 180plat-$(CONFIG_PLAT_IOP) := iop
181plat-$(CONFIG_PLAT_NOMADIK) := nomadik
179plat-$(CONFIG_PLAT_ORION) := orion 182plat-$(CONFIG_PLAT_ORION) := orion
180plat-$(CONFIG_PLAT_PXA) := pxa 183plat-$(CONFIG_PLAT_PXA) := pxa
181plat-$(CONFIG_PLAT_S3C24XX) := s3c24xx s3c 184plat-$(CONFIG_PLAT_S3C24XX) := s3c24xx s3c samsung
182plat-$(CONFIG_PLAT_S3C64XX) := s3c64xx s3c 185plat-$(CONFIG_PLAT_S3C64XX) := s3c64xx s3c samsung
183plat-$(CONFIG_PLAT_S5PC1XX) := s5pc1xx s3c 186plat-$(CONFIG_PLAT_S5PC1XX) := s5pc1xx s3c samsung
184plat-$(CONFIG_ARCH_STMP3XXX) := stmp3xxx 187plat-$(CONFIG_ARCH_STMP3XXX) := stmp3xxx
185 188
186ifeq ($(CONFIG_ARCH_EBSA110),y) 189ifeq ($(CONFIG_ARCH_EBSA110),y)
diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S
index fa6fbf45cf3b..d356af7cef82 100644
--- a/arch/arm/boot/compressed/head.S
+++ b/arch/arm/boot/compressed/head.S
@@ -743,6 +743,12 @@ proc_types:
743 W(b) __armv4_mmu_cache_off 743 W(b) __armv4_mmu_cache_off
744 W(b) __armv6_mmu_cache_flush 744 W(b) __armv6_mmu_cache_flush
745 745
746 .word 0x560f5810 @ Marvell PJ4 ARMv6
747 .word 0xff0ffff0
748 W(b) __armv4_mmu_cache_on
749 W(b) __armv4_mmu_cache_off
750 W(b) __armv6_mmu_cache_flush
751
746 .word 0x000f0000 @ new CPU Id 752 .word 0x000f0000 @ new CPU Id
747 .word 0x000f0000 753 .word 0x000f0000
748 W(b) __armv7_mmu_cache_on 754 W(b) __armv7_mmu_cache_on
diff --git a/arch/arm/common/dmabounce.c b/arch/arm/common/dmabounce.c
index 734ac9135998..5a375e5fef21 100644
--- a/arch/arm/common/dmabounce.c
+++ b/arch/arm/common/dmabounce.c
@@ -342,6 +342,22 @@ dma_addr_t dma_map_single(struct device *dev, void *ptr, size_t size,
342} 342}
343EXPORT_SYMBOL(dma_map_single); 343EXPORT_SYMBOL(dma_map_single);
344 344
345/*
346 * see if a mapped address was really a "safe" buffer and if so, copy
347 * the data from the safe buffer back to the unsafe buffer and free up
348 * the safe buffer. (basically return things back to the way they
349 * should be)
350 */
351void dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
352 enum dma_data_direction dir)
353{
354 dev_dbg(dev, "%s(ptr=%p,size=%d,dir=%x)\n",
355 __func__, (void *) dma_addr, size, dir);
356
357 unmap_single(dev, dma_addr, size, dir);
358}
359EXPORT_SYMBOL(dma_unmap_single);
360
345dma_addr_t dma_map_page(struct device *dev, struct page *page, 361dma_addr_t dma_map_page(struct device *dev, struct page *page,
346 unsigned long offset, size_t size, enum dma_data_direction dir) 362 unsigned long offset, size_t size, enum dma_data_direction dir)
347{ 363{
@@ -366,8 +382,7 @@ EXPORT_SYMBOL(dma_map_page);
366 * the safe buffer. (basically return things back to the way they 382 * the safe buffer. (basically return things back to the way they
367 * should be) 383 * should be)
368 */ 384 */
369 385void dma_unmap_page(struct device *dev, dma_addr_t dma_addr, size_t size,
370void dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
371 enum dma_data_direction dir) 386 enum dma_data_direction dir)
372{ 387{
373 dev_dbg(dev, "%s(ptr=%p,size=%d,dir=%x)\n", 388 dev_dbg(dev, "%s(ptr=%p,size=%d,dir=%x)\n",
@@ -375,7 +390,7 @@ void dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
375 390
376 unmap_single(dev, dma_addr, size, dir); 391 unmap_single(dev, dma_addr, size, dir);
377} 392}
378EXPORT_SYMBOL(dma_unmap_single); 393EXPORT_SYMBOL(dma_unmap_page);
379 394
380int dmabounce_sync_for_cpu(struct device *dev, dma_addr_t addr, 395int dmabounce_sync_for_cpu(struct device *dev, dma_addr_t addr,
381 unsigned long off, size_t sz, enum dma_data_direction dir) 396 unsigned long off, size_t sz, enum dma_data_direction dir)
diff --git a/arch/arm/configs/da830_omapl137_defconfig b/arch/arm/configs/am3517_evm_defconfig
index 7c8e38f5c5ab..ad54e92dd436 100644
--- a/arch/arm/configs/da830_omapl137_defconfig
+++ b/arch/arm/configs/am3517_evm_defconfig
@@ -1,15 +1,13 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc2-davinci1 3# Linux kernel version: 2.6.32-rc5
4# Wed May 13 15:33:29 2009 4# Wed Oct 28 15:47:47 2009
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y 7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y 8CONFIG_GENERIC_GPIO=y
9CONFIG_GENERIC_TIME=y 9CONFIG_GENERIC_TIME=y
10CONFIG_GENERIC_CLOCKEVENTS=y 10CONFIG_GENERIC_CLOCKEVENTS=y
11CONFIG_MMU=y
12# CONFIG_NO_IOPORT is not set
13CONFIG_GENERIC_HARDIRQS=y 11CONFIG_GENERIC_HARDIRQS=y
14CONFIG_STACKTRACE_SUPPORT=y 12CONFIG_STACKTRACE_SUPPORT=y
15CONFIG_HAVE_LATENCYTOP_SUPPORT=y 13CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -18,43 +16,41 @@ CONFIG_TRACE_IRQFLAGS_SUPPORT=y
18CONFIG_HARDIRQS_SW_RESEND=y 16CONFIG_HARDIRQS_SW_RESEND=y
19CONFIG_GENERIC_IRQ_PROBE=y 17CONFIG_GENERIC_IRQ_PROBE=y
20CONFIG_RWSEM_GENERIC_SPINLOCK=y 18CONFIG_RWSEM_GENERIC_SPINLOCK=y
21# CONFIG_ARCH_HAS_ILOG2_U32 is not set 19CONFIG_ARCH_HAS_CPUFREQ=y
22# CONFIG_ARCH_HAS_ILOG2_U64 is not set
23CONFIG_GENERIC_HWEIGHT=y 20CONFIG_GENERIC_HWEIGHT=y
24CONFIG_GENERIC_CALIBRATE_DELAY=y 21CONFIG_GENERIC_CALIBRATE_DELAY=y
25CONFIG_ZONE_DMA=y
26CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 22CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
27CONFIG_VECTORS_BASE=0xffff0000 23CONFIG_VECTORS_BASE=0xffff0000
28CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 24CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
25CONFIG_CONSTRUCTORS=y
29 26
30# 27#
31# General setup 28# General setup
32# 29#
33CONFIG_EXPERIMENTAL=y 30CONFIG_EXPERIMENTAL=y
34CONFIG_BROKEN_ON_SMP=y 31CONFIG_BROKEN_ON_SMP=y
35CONFIG_LOCK_KERNEL=y
36CONFIG_INIT_ENV_ARG_LIMIT=32 32CONFIG_INIT_ENV_ARG_LIMIT=32
37CONFIG_LOCALVERSION="" 33CONFIG_LOCALVERSION=""
38CONFIG_LOCALVERSION_AUTO=y 34CONFIG_LOCALVERSION_AUTO=y
39# CONFIG_SWAP is not set 35CONFIG_SWAP=y
40CONFIG_SYSVIPC=y 36CONFIG_SYSVIPC=y
41CONFIG_SYSVIPC_SYSCTL=y 37CONFIG_SYSVIPC_SYSCTL=y
42CONFIG_POSIX_MQUEUE=y 38# CONFIG_POSIX_MQUEUE is not set
43CONFIG_POSIX_MQUEUE_SYSCTL=y 39CONFIG_BSD_PROCESS_ACCT=y
44# CONFIG_BSD_PROCESS_ACCT is not set 40# CONFIG_BSD_PROCESS_ACCT_V3 is not set
45# CONFIG_TASKSTATS is not set 41# CONFIG_TASKSTATS is not set
46# CONFIG_AUDIT is not set 42# CONFIG_AUDIT is not set
47 43
48# 44#
49# RCU Subsystem 45# RCU Subsystem
50# 46#
51CONFIG_CLASSIC_RCU=y 47CONFIG_TREE_RCU=y
52# CONFIG_TREE_RCU is not set 48# CONFIG_TREE_PREEMPT_RCU is not set
53# CONFIG_PREEMPT_RCU is not set 49# CONFIG_RCU_TRACE is not set
50CONFIG_RCU_FANOUT=32
51# CONFIG_RCU_FANOUT_EXACT is not set
54# CONFIG_TREE_RCU_TRACE is not set 52# CONFIG_TREE_RCU_TRACE is not set
55# CONFIG_PREEMPT_RCU_TRACE is not set 53# CONFIG_IKCONFIG is not set
56CONFIG_IKCONFIG=y
57CONFIG_IKCONFIG_PROC=y
58CONFIG_LOG_BUF_SHIFT=14 54CONFIG_LOG_BUF_SHIFT=14
59CONFIG_GROUP_SCHED=y 55CONFIG_GROUP_SCHED=y
60CONFIG_FAIR_GROUP_SCHED=y 56CONFIG_FAIR_GROUP_SCHED=y
@@ -76,11 +72,10 @@ CONFIG_SYSCTL=y
76CONFIG_ANON_INODES=y 72CONFIG_ANON_INODES=y
77CONFIG_EMBEDDED=y 73CONFIG_EMBEDDED=y
78CONFIG_UID16=y 74CONFIG_UID16=y
79CONFIG_SYSCTL_SYSCALL=y 75# CONFIG_SYSCTL_SYSCALL is not set
80CONFIG_KALLSYMS=y 76CONFIG_KALLSYMS=y
81# CONFIG_KALLSYMS_ALL is not set 77# CONFIG_KALLSYMS_ALL is not set
82# CONFIG_KALLSYMS_EXTRA_PASS is not set 78CONFIG_KALLSYMS_EXTRA_PASS=y
83# CONFIG_STRIP_ASM_SYMS is not set
84CONFIG_HOTPLUG=y 79CONFIG_HOTPLUG=y
85CONFIG_PRINTK=y 80CONFIG_PRINTK=y
86CONFIG_BUG=y 81CONFIG_BUG=y
@@ -93,19 +88,25 @@ CONFIG_TIMERFD=y
93CONFIG_EVENTFD=y 88CONFIG_EVENTFD=y
94CONFIG_SHMEM=y 89CONFIG_SHMEM=y
95CONFIG_AIO=y 90CONFIG_AIO=y
91
92#
93# Kernel Performance Events And Counters
94#
96CONFIG_VM_EVENT_COUNTERS=y 95CONFIG_VM_EVENT_COUNTERS=y
97CONFIG_SLUB_DEBUG=y
98CONFIG_COMPAT_BRK=y 96CONFIG_COMPAT_BRK=y
99# CONFIG_SLAB is not set 97CONFIG_SLAB=y
100CONFIG_SLUB=y 98# CONFIG_SLUB is not set
101# CONFIG_SLOB is not set 99# CONFIG_SLOB is not set
102# CONFIG_PROFILING is not set 100# CONFIG_PROFILING is not set
103# CONFIG_MARKERS is not set
104CONFIG_HAVE_OPROFILE=y 101CONFIG_HAVE_OPROFILE=y
105# CONFIG_KPROBES is not set 102# CONFIG_KPROBES is not set
106CONFIG_HAVE_KPROBES=y 103CONFIG_HAVE_KPROBES=y
107CONFIG_HAVE_KRETPROBES=y 104CONFIG_HAVE_KRETPROBES=y
108CONFIG_HAVE_CLK=y 105CONFIG_HAVE_CLK=y
106
107#
108# GCOV-based kernel profiling
109#
109# CONFIG_SLOW_WORK is not set 110# CONFIG_SLOW_WORK is not set
110CONFIG_HAVE_GENERIC_DMA_COHERENT=y 111CONFIG_HAVE_GENERIC_DMA_COHERENT=y
111CONFIG_SLABINFO=y 112CONFIG_SLABINFO=y
@@ -114,11 +115,11 @@ CONFIG_BASE_SMALL=0
114CONFIG_MODULES=y 115CONFIG_MODULES=y
115# CONFIG_MODULE_FORCE_LOAD is not set 116# CONFIG_MODULE_FORCE_LOAD is not set
116CONFIG_MODULE_UNLOAD=y 117CONFIG_MODULE_UNLOAD=y
117CONFIG_MODULE_FORCE_UNLOAD=y 118# CONFIG_MODULE_FORCE_UNLOAD is not set
118CONFIG_MODVERSIONS=y 119CONFIG_MODVERSIONS=y
119# CONFIG_MODULE_SRCVERSION_ALL is not set 120CONFIG_MODULE_SRCVERSION_ALL=y
120CONFIG_BLOCK=y 121CONFIG_BLOCK=y
121# CONFIG_LBD is not set 122CONFIG_LBDAF=y
122# CONFIG_BLK_DEV_BSG is not set 123# CONFIG_BLK_DEV_BSG is not set
123# CONFIG_BLK_DEV_INTEGRITY is not set 124# CONFIG_BLK_DEV_INTEGRITY is not set
124 125
@@ -127,8 +128,8 @@ CONFIG_BLOCK=y
127# 128#
128CONFIG_IOSCHED_NOOP=y 129CONFIG_IOSCHED_NOOP=y
129CONFIG_IOSCHED_AS=y 130CONFIG_IOSCHED_AS=y
130# CONFIG_IOSCHED_DEADLINE is not set 131CONFIG_IOSCHED_DEADLINE=y
131# CONFIG_IOSCHED_CFQ is not set 132CONFIG_IOSCHED_CFQ=y
132CONFIG_DEFAULT_AS=y 133CONFIG_DEFAULT_AS=y
133# CONFIG_DEFAULT_DEADLINE is not set 134# CONFIG_DEFAULT_DEADLINE is not set
134# CONFIG_DEFAULT_CFQ is not set 135# CONFIG_DEFAULT_CFQ is not set
@@ -139,19 +140,22 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
139# 140#
140# System Type 141# System Type
141# 142#
143CONFIG_MMU=y
142# CONFIG_ARCH_AAEC2000 is not set 144# CONFIG_ARCH_AAEC2000 is not set
143# CONFIG_ARCH_INTEGRATOR is not set 145# CONFIG_ARCH_INTEGRATOR is not set
144# CONFIG_ARCH_REALVIEW is not set 146# CONFIG_ARCH_REALVIEW is not set
145# CONFIG_ARCH_VERSATILE is not set 147# CONFIG_ARCH_VERSATILE is not set
146# CONFIG_ARCH_AT91 is not set 148# CONFIG_ARCH_AT91 is not set
147# CONFIG_ARCH_CLPS711X is not set 149# CONFIG_ARCH_CLPS711X is not set
150# CONFIG_ARCH_GEMINI is not set
148# CONFIG_ARCH_EBSA110 is not set 151# CONFIG_ARCH_EBSA110 is not set
149# CONFIG_ARCH_EP93XX is not set 152# CONFIG_ARCH_EP93XX is not set
150# CONFIG_ARCH_GEMINI is not set
151# CONFIG_ARCH_FOOTBRIDGE is not set 153# CONFIG_ARCH_FOOTBRIDGE is not set
154# CONFIG_ARCH_MXC is not set
155# CONFIG_ARCH_STMP3XXX is not set
152# CONFIG_ARCH_NETX is not set 156# CONFIG_ARCH_NETX is not set
153# CONFIG_ARCH_H720X is not set 157# CONFIG_ARCH_H720X is not set
154# CONFIG_ARCH_IMX is not set 158# CONFIG_ARCH_NOMADIK is not set
155# CONFIG_ARCH_IOP13XX is not set 159# CONFIG_ARCH_IOP13XX is not set
156# CONFIG_ARCH_IOP32X is not set 160# CONFIG_ARCH_IOP32X is not set
157# CONFIG_ARCH_IOP33X is not set 161# CONFIG_ARCH_IOP33X is not set
@@ -160,59 +164,86 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
160# CONFIG_ARCH_IXP4XX is not set 164# CONFIG_ARCH_IXP4XX is not set
161# CONFIG_ARCH_L7200 is not set 165# CONFIG_ARCH_L7200 is not set
162# CONFIG_ARCH_KIRKWOOD is not set 166# CONFIG_ARCH_KIRKWOOD is not set
163# CONFIG_ARCH_KS8695 is not set
164# CONFIG_ARCH_NS9XXX is not set
165# CONFIG_ARCH_LOKI is not set 167# CONFIG_ARCH_LOKI is not set
166# CONFIG_ARCH_MV78XX0 is not set 168# CONFIG_ARCH_MV78XX0 is not set
167# CONFIG_ARCH_MXC is not set
168# CONFIG_ARCH_ORION5X is not set 169# CONFIG_ARCH_ORION5X is not set
170# CONFIG_ARCH_MMP is not set
171# CONFIG_ARCH_KS8695 is not set
172# CONFIG_ARCH_NS9XXX is not set
173# CONFIG_ARCH_W90X900 is not set
169# CONFIG_ARCH_PNX4008 is not set 174# CONFIG_ARCH_PNX4008 is not set
170# CONFIG_ARCH_PXA is not set 175# CONFIG_ARCH_PXA is not set
171# CONFIG_ARCH_MMP is not set 176# CONFIG_ARCH_MSM is not set
172# CONFIG_ARCH_RPC is not set 177# CONFIG_ARCH_RPC is not set
173# CONFIG_ARCH_SA1100 is not set 178# CONFIG_ARCH_SA1100 is not set
174# CONFIG_ARCH_S3C2410 is not set 179# CONFIG_ARCH_S3C2410 is not set
175# CONFIG_ARCH_S3C64XX is not set 180# CONFIG_ARCH_S3C64XX is not set
181# CONFIG_ARCH_S5PC1XX is not set
176# CONFIG_ARCH_SHARK is not set 182# CONFIG_ARCH_SHARK is not set
177# CONFIG_ARCH_LH7A40X is not set 183# CONFIG_ARCH_LH7A40X is not set
178CONFIG_ARCH_DAVINCI=y 184# CONFIG_ARCH_U300 is not set
179# CONFIG_ARCH_OMAP is not set 185# CONFIG_ARCH_DAVINCI is not set
180# CONFIG_ARCH_MSM is not set 186CONFIG_ARCH_OMAP=y
181# CONFIG_ARCH_W90X900 is not set 187# CONFIG_ARCH_BCMRING is not set
182CONFIG_CP_INTC=y 188
183 189#
184# 190# TI OMAP Implementations
185# TI DaVinci Implementations 191#
186# 192CONFIG_ARCH_OMAP_OTG=y
187 193# CONFIG_ARCH_OMAP1 is not set
188# 194# CONFIG_ARCH_OMAP2 is not set
189# DaVinci Core Type 195CONFIG_ARCH_OMAP3=y
190# 196# CONFIG_ARCH_OMAP4 is not set
191# CONFIG_ARCH_DAVINCI_DM644x is not set 197
192# CONFIG_ARCH_DAVINCI_DM646x is not set 198#
193# CONFIG_ARCH_DAVINCI_DM355 is not set 199# OMAP Feature Selections
194CONFIG_ARCH_DAVINCI_DA830=y 200#
195 201# CONFIG_OMAP_DEBUG_POWERDOMAIN is not set
196# 202# CONFIG_OMAP_DEBUG_CLOCKDOMAIN is not set
197# DaVinci Board Type 203CONFIG_OMAP_RESET_CLOCKS=y
198# 204# CONFIG_OMAP_MUX is not set
199CONFIG_MACH_DAVINCI_DA830_EVM=y 205# CONFIG_OMAP_MCBSP is not set
200CONFIG_DAVINCI_MUX=y 206# CONFIG_OMAP_MBOX_FWK is not set
201# CONFIG_DAVINCI_MUX_DEBUG is not set 207# CONFIG_OMAP_MPU_TIMER is not set
202# CONFIG_DAVINCI_MUX_WARNINGS is not set 208CONFIG_OMAP_32K_TIMER=y
203CONFIG_DAVINCI_RESET_CLOCKS=y 209CONFIG_OMAP_32K_TIMER_HZ=128
210CONFIG_OMAP_DM_TIMER=y
211# CONFIG_OMAP_LL_DEBUG_UART1 is not set
212# CONFIG_OMAP_LL_DEBUG_UART2 is not set
213CONFIG_OMAP_LL_DEBUG_UART3=y
214# CONFIG_OMAP_PM_NONE is not set
215CONFIG_OMAP_PM_NOOP=y
216CONFIG_ARCH_OMAP34XX=y
217CONFIG_ARCH_OMAP3430=y
218
219#
220# OMAP Board Type
221#
222# CONFIG_MACH_OMAP3_BEAGLE is not set
223# CONFIG_MACH_OMAP_LDP is not set
224# CONFIG_MACH_OVERO is not set
225# CONFIG_MACH_OMAP3EVM is not set
226CONFIG_MACH_OMAP3517EVM=y
227# CONFIG_MACH_OMAP3_PANDORA is not set
228# CONFIG_MACH_OMAP_3430SDP is not set
229# CONFIG_MACH_NOKIA_RX51 is not set
230# CONFIG_MACH_OMAP_ZOOM2 is not set
231# CONFIG_MACH_CM_T35 is not set
204 232
205# 233#
206# Processor Type 234# Processor Type
207# 235#
208CONFIG_CPU_32=y 236CONFIG_CPU_32=y
209CONFIG_CPU_ARM926T=y 237CONFIG_CPU_32v6K=y
210CONFIG_CPU_32v5=y 238CONFIG_CPU_V7=y
211CONFIG_CPU_ABRT_EV5TJ=y 239CONFIG_CPU_32v7=y
212CONFIG_CPU_PABRT_NOIFAR=y 240CONFIG_CPU_ABRT_EV7=y
213CONFIG_CPU_CACHE_VIVT=y 241CONFIG_CPU_PABRT_V7=y
214CONFIG_CPU_COPY_V4WB=y 242CONFIG_CPU_CACHE_V7=y
215CONFIG_CPU_TLB_V4WBI=y 243CONFIG_CPU_CACHE_VIPT=y
244CONFIG_CPU_COPY_V6=y
245CONFIG_CPU_TLB_V7=y
246CONFIG_CPU_HAS_ASID=y
216CONFIG_CPU_CP15=y 247CONFIG_CPU_CP15=y
217CONFIG_CPU_CP15_MMU=y 248CONFIG_CPU_CP15_MMU=y
218 249
@@ -220,11 +251,15 @@ CONFIG_CPU_CP15_MMU=y
220# Processor Features 251# Processor Features
221# 252#
222CONFIG_ARM_THUMB=y 253CONFIG_ARM_THUMB=y
254# CONFIG_ARM_THUMBEE is not set
223# CONFIG_CPU_ICACHE_DISABLE is not set 255# CONFIG_CPU_ICACHE_DISABLE is not set
224# CONFIG_CPU_DCACHE_DISABLE is not set 256# CONFIG_CPU_DCACHE_DISABLE is not set
225CONFIG_CPU_DCACHE_WRITETHROUGH=y 257# CONFIG_CPU_BPREDICT_DISABLE is not set
226# CONFIG_CPU_CACHE_ROUND_ROBIN is not set 258CONFIG_HAS_TLS_REG=y
227# CONFIG_OUTER_CACHE is not set 259CONFIG_ARM_L1_CACHE_SHIFT=6
260# CONFIG_ARM_ERRATA_430973 is not set
261# CONFIG_ARM_ERRATA_458693 is not set
262# CONFIG_ARM_ERRATA_460075 is not set
228CONFIG_COMMON_CLKDEV=y 263CONFIG_COMMON_CLKDEV=y
229 264
230# 265#
@@ -245,11 +280,13 @@ CONFIG_VMSPLIT_3G=y
245# CONFIG_VMSPLIT_2G is not set 280# CONFIG_VMSPLIT_2G is not set
246# CONFIG_VMSPLIT_1G is not set 281# CONFIG_VMSPLIT_1G is not set
247CONFIG_PAGE_OFFSET=0xC0000000 282CONFIG_PAGE_OFFSET=0xC0000000
248CONFIG_PREEMPT=y 283CONFIG_PREEMPT_NONE=y
249CONFIG_HZ=100 284# CONFIG_PREEMPT_VOLUNTARY is not set
285# CONFIG_PREEMPT is not set
286CONFIG_HZ=128
287# CONFIG_THUMB2_KERNEL is not set
250CONFIG_AEABI=y 288CONFIG_AEABI=y
251# CONFIG_OABI_COMPAT is not set 289CONFIG_OABI_COMPAT=y
252CONFIG_ARCH_FLATMEM_HAS_HOLES=y
253# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set 290# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
254# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set 291# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
255# CONFIG_HIGHMEM is not set 292# CONFIG_HIGHMEM is not set
@@ -260,30 +297,31 @@ CONFIG_FLATMEM_MANUAL=y
260CONFIG_FLATMEM=y 297CONFIG_FLATMEM=y
261CONFIG_FLAT_NODE_MEM_MAP=y 298CONFIG_FLAT_NODE_MEM_MAP=y
262CONFIG_PAGEFLAGS_EXTENDED=y 299CONFIG_PAGEFLAGS_EXTENDED=y
263CONFIG_SPLIT_PTLOCK_CPUS=4096 300CONFIG_SPLIT_PTLOCK_CPUS=4
264# CONFIG_PHYS_ADDR_T_64BIT is not set 301# CONFIG_PHYS_ADDR_T_64BIT is not set
265CONFIG_ZONE_DMA_FLAG=1 302CONFIG_ZONE_DMA_FLAG=0
266CONFIG_BOUNCE=y
267CONFIG_VIRT_TO_BUS=y 303CONFIG_VIRT_TO_BUS=y
268CONFIG_UNEVICTABLE_LRU=y
269CONFIG_HAVE_MLOCK=y 304CONFIG_HAVE_MLOCK=y
270CONFIG_HAVE_MLOCKED_PAGE_BIT=y 305CONFIG_HAVE_MLOCKED_PAGE_BIT=y
271CONFIG_LEDS=y 306# CONFIG_KSM is not set
272# CONFIG_LEDS_CPU is not set 307CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
308# CONFIG_LEDS is not set
273CONFIG_ALIGNMENT_TRAP=y 309CONFIG_ALIGNMENT_TRAP=y
310# CONFIG_UACCESS_WITH_MEMCPY is not set
274 311
275# 312#
276# Boot options 313# Boot options
277# 314#
278CONFIG_ZBOOT_ROM_TEXT=0x0 315CONFIG_ZBOOT_ROM_TEXT=0x0
279CONFIG_ZBOOT_ROM_BSS=0x0 316CONFIG_ZBOOT_ROM_BSS=0x0
280CONFIG_CMDLINE="" 317CONFIG_CMDLINE="root=/dev/nfs nfsroot=192.168.0.1:/home/user/buildroot ip=192.168.0.2:192.168.0.1:192.168.0.1:255.255.255.0:tgt:eth0:off rw console=ttyS2,115200n8"
281# CONFIG_XIP_KERNEL is not set 318# CONFIG_XIP_KERNEL is not set
282# CONFIG_KEXEC is not set 319# CONFIG_KEXEC is not set
283 320
284# 321#
285# CPU Power Management 322# CPU Power Management
286# 323#
324# CONFIG_CPU_FREQ is not set
287# CONFIG_CPU_IDLE is not set 325# CONFIG_CPU_IDLE is not set
288 326
289# 327#
@@ -293,7 +331,12 @@ CONFIG_CMDLINE=""
293# 331#
294# At least one emulation must be selected 332# At least one emulation must be selected
295# 333#
296# CONFIG_VFP is not set 334CONFIG_FPE_NWFPE=y
335# CONFIG_FPE_NWFPE_XP is not set
336# CONFIG_FPE_FASTFPE is not set
337CONFIG_VFP=y
338CONFIG_VFPv3=y
339CONFIG_NEON=y
297 340
298# 341#
299# Userspace binary formats 342# Userspace binary formats
@@ -302,7 +345,7 @@ CONFIG_BINFMT_ELF=y
302# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set 345# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
303CONFIG_HAVE_AOUT=y 346CONFIG_HAVE_AOUT=y
304# CONFIG_BINFMT_AOUT is not set 347# CONFIG_BINFMT_AOUT is not set
305# CONFIG_BINFMT_MISC is not set 348CONFIG_BINFMT_MISC=y
306 349
307# 350#
308# Power management options 351# Power management options
@@ -322,15 +365,16 @@ CONFIG_XFRM=y
322# CONFIG_XFRM_SUB_POLICY is not set 365# CONFIG_XFRM_SUB_POLICY is not set
323# CONFIG_XFRM_MIGRATE is not set 366# CONFIG_XFRM_MIGRATE is not set
324# CONFIG_XFRM_STATISTICS is not set 367# CONFIG_XFRM_STATISTICS is not set
325# CONFIG_NET_KEY is not set 368CONFIG_NET_KEY=y
369# CONFIG_NET_KEY_MIGRATE is not set
326CONFIG_INET=y 370CONFIG_INET=y
327# CONFIG_IP_MULTICAST is not set 371# CONFIG_IP_MULTICAST is not set
328# CONFIG_IP_ADVANCED_ROUTER is not set 372# CONFIG_IP_ADVANCED_ROUTER is not set
329CONFIG_IP_FIB_HASH=y 373CONFIG_IP_FIB_HASH=y
330CONFIG_IP_PNP=y 374CONFIG_IP_PNP=y
331CONFIG_IP_PNP_DHCP=y 375CONFIG_IP_PNP_DHCP=y
332# CONFIG_IP_PNP_BOOTP is not set 376CONFIG_IP_PNP_BOOTP=y
333# CONFIG_IP_PNP_RARP is not set 377CONFIG_IP_PNP_RARP=y
334# CONFIG_NET_IPIP is not set 378# CONFIG_NET_IPIP is not set
335# CONFIG_NET_IPGRE is not set 379# CONFIG_NET_IPGRE is not set
336# CONFIG_ARPD is not set 380# CONFIG_ARPD is not set
@@ -339,7 +383,7 @@ CONFIG_IP_PNP_DHCP=y
339# CONFIG_INET_ESP is not set 383# CONFIG_INET_ESP is not set
340# CONFIG_INET_IPCOMP is not set 384# CONFIG_INET_IPCOMP is not set
341# CONFIG_INET_XFRM_TUNNEL is not set 385# CONFIG_INET_XFRM_TUNNEL is not set
342CONFIG_INET_TUNNEL=m 386# CONFIG_INET_TUNNEL is not set
343CONFIG_INET_XFRM_MODE_TRANSPORT=y 387CONFIG_INET_XFRM_MODE_TRANSPORT=y
344CONFIG_INET_XFRM_MODE_TUNNEL=y 388CONFIG_INET_XFRM_MODE_TUNNEL=y
345CONFIG_INET_XFRM_MODE_BEET=y 389CONFIG_INET_XFRM_MODE_BEET=y
@@ -350,54 +394,12 @@ CONFIG_INET_TCP_DIAG=y
350CONFIG_TCP_CONG_CUBIC=y 394CONFIG_TCP_CONG_CUBIC=y
351CONFIG_DEFAULT_TCP_CONG="cubic" 395CONFIG_DEFAULT_TCP_CONG="cubic"
352# CONFIG_TCP_MD5SIG is not set 396# CONFIG_TCP_MD5SIG is not set
353CONFIG_IPV6=m 397# CONFIG_IPV6 is not set
354# CONFIG_IPV6_PRIVACY is not set
355# CONFIG_IPV6_ROUTER_PREF is not set
356# CONFIG_IPV6_OPTIMISTIC_DAD is not set
357# CONFIG_INET6_AH is not set
358# CONFIG_INET6_ESP is not set
359# CONFIG_INET6_IPCOMP is not set
360# CONFIG_IPV6_MIP6 is not set
361# CONFIG_INET6_XFRM_TUNNEL is not set
362# CONFIG_INET6_TUNNEL is not set
363CONFIG_INET6_XFRM_MODE_TRANSPORT=m
364CONFIG_INET6_XFRM_MODE_TUNNEL=m
365CONFIG_INET6_XFRM_MODE_BEET=m
366# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
367CONFIG_IPV6_SIT=m
368CONFIG_IPV6_NDISC_NODETYPE=y
369# CONFIG_IPV6_TUNNEL is not set
370# CONFIG_IPV6_MULTIPLE_TABLES is not set
371# CONFIG_IPV6_MROUTE is not set
372# CONFIG_NETWORK_SECMARK is not set 398# CONFIG_NETWORK_SECMARK is not set
373CONFIG_NETFILTER=y 399# CONFIG_NETFILTER is not set
374# CONFIG_NETFILTER_DEBUG is not set
375CONFIG_NETFILTER_ADVANCED=y
376
377#
378# Core Netfilter Configuration
379#
380# CONFIG_NETFILTER_NETLINK_QUEUE is not set
381# CONFIG_NETFILTER_NETLINK_LOG is not set
382# CONFIG_NF_CONNTRACK is not set
383# CONFIG_NETFILTER_XTABLES is not set
384# CONFIG_IP_VS is not set
385
386#
387# IP: Netfilter Configuration
388#
389# CONFIG_NF_DEFRAG_IPV4 is not set
390# CONFIG_IP_NF_QUEUE is not set
391# CONFIG_IP_NF_IPTABLES is not set
392# CONFIG_IP_NF_ARPTABLES is not set
393
394#
395# IPv6: Netfilter Configuration
396#
397# CONFIG_IP6_NF_QUEUE is not set
398# CONFIG_IP6_NF_IPTABLES is not set
399# CONFIG_IP_DCCP is not set 400# CONFIG_IP_DCCP is not set
400# CONFIG_IP_SCTP is not set 401# CONFIG_IP_SCTP is not set
402# CONFIG_RDS is not set
401# CONFIG_TIPC is not set 403# CONFIG_TIPC is not set
402# CONFIG_ATM is not set 404# CONFIG_ATM is not set
403# CONFIG_BRIDGE is not set 405# CONFIG_BRIDGE is not set
@@ -412,6 +414,7 @@ CONFIG_NETFILTER_ADVANCED=y
412# CONFIG_ECONET is not set 414# CONFIG_ECONET is not set
413# CONFIG_WAN_ROUTER is not set 415# CONFIG_WAN_ROUTER is not set
414# CONFIG_PHONET is not set 416# CONFIG_PHONET is not set
417# CONFIG_IEEE802154 is not set
415# CONFIG_NET_SCHED is not set 418# CONFIG_NET_SCHED is not set
416# CONFIG_DCB is not set 419# CONFIG_DCB is not set
417 420
@@ -424,7 +427,16 @@ CONFIG_NETFILTER_ADVANCED=y
424# CONFIG_IRDA is not set 427# CONFIG_IRDA is not set
425# CONFIG_BT is not set 428# CONFIG_BT is not set
426# CONFIG_AF_RXRPC is not set 429# CONFIG_AF_RXRPC is not set
427# CONFIG_WIRELESS is not set 430CONFIG_WIRELESS=y
431# CONFIG_CFG80211 is not set
432CONFIG_CFG80211_DEFAULT_PS_VALUE=0
433# CONFIG_WIRELESS_OLD_REGULATORY is not set
434# CONFIG_WIRELESS_EXT is not set
435# CONFIG_LIB80211 is not set
436
437#
438# CFG80211 needs to be enabled for MAC80211
439#
428# CONFIG_WIMAX is not set 440# CONFIG_WIMAX is not set
429# CONFIG_RFKILL is not set 441# CONFIG_RFKILL is not set
430# CONFIG_NET_9P is not set 442# CONFIG_NET_9P is not set
@@ -437,6 +449,7 @@ CONFIG_NETFILTER_ADVANCED=y
437# Generic Driver Options 449# Generic Driver Options
438# 450#
439CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 451CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
452# CONFIG_DEVTMPFS is not set
440CONFIG_STANDALONE=y 453CONFIG_STANDALONE=y
441CONFIG_PREVENT_FIRMWARE_BUILD=y 454CONFIG_PREVENT_FIRMWARE_BUILD=y
442# CONFIG_FW_LOADER is not set 455# CONFIG_FW_LOADER is not set
@@ -448,27 +461,18 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
448# CONFIG_PARPORT is not set 461# CONFIG_PARPORT is not set
449CONFIG_BLK_DEV=y 462CONFIG_BLK_DEV=y
450# CONFIG_BLK_DEV_COW_COMMON is not set 463# CONFIG_BLK_DEV_COW_COMMON is not set
451CONFIG_BLK_DEV_LOOP=m 464CONFIG_BLK_DEV_LOOP=y
452# CONFIG_BLK_DEV_CRYPTOLOOP is not set 465# CONFIG_BLK_DEV_CRYPTOLOOP is not set
453# CONFIG_BLK_DEV_NBD is not set 466# CONFIG_BLK_DEV_NBD is not set
467# CONFIG_BLK_DEV_UB is not set
454CONFIG_BLK_DEV_RAM=y 468CONFIG_BLK_DEV_RAM=y
455CONFIG_BLK_DEV_RAM_COUNT=1 469CONFIG_BLK_DEV_RAM_COUNT=16
456CONFIG_BLK_DEV_RAM_SIZE=32768 470CONFIG_BLK_DEV_RAM_SIZE=16384
457# CONFIG_BLK_DEV_XIP is not set 471# CONFIG_BLK_DEV_XIP is not set
458# CONFIG_CDROM_PKTCDVD is not set 472# CONFIG_CDROM_PKTCDVD is not set
459# CONFIG_ATA_OVER_ETH is not set 473# CONFIG_ATA_OVER_ETH is not set
460CONFIG_MISC_DEVICES=y 474# CONFIG_MG_DISK is not set
461# CONFIG_ICS932S401 is not set 475# CONFIG_MISC_DEVICES is not set
462# CONFIG_ENCLOSURE_SERVICES is not set
463# CONFIG_ISL29003 is not set
464# CONFIG_C2PORT is not set
465
466#
467# EEPROM support
468#
469CONFIG_EEPROM_AT24=y
470# CONFIG_EEPROM_LEGACY is not set
471# CONFIG_EEPROM_93CX6 is not set
472CONFIG_HAVE_IDE=y 476CONFIG_HAVE_IDE=y
473# CONFIG_IDE is not set 477# CONFIG_IDE is not set
474 478
@@ -476,7 +480,7 @@ CONFIG_HAVE_IDE=y
476# SCSI device support 480# SCSI device support
477# 481#
478# CONFIG_RAID_ATTRS is not set 482# CONFIG_RAID_ATTRS is not set
479CONFIG_SCSI=m 483CONFIG_SCSI=y
480CONFIG_SCSI_DMA=y 484CONFIG_SCSI_DMA=y
481# CONFIG_SCSI_TGT is not set 485# CONFIG_SCSI_TGT is not set
482# CONFIG_SCSI_NETLINK is not set 486# CONFIG_SCSI_NETLINK is not set
@@ -485,16 +489,12 @@ CONFIG_SCSI_PROC_FS=y
485# 489#
486# SCSI support type (disk, tape, CD-ROM) 490# SCSI support type (disk, tape, CD-ROM)
487# 491#
488CONFIG_BLK_DEV_SD=m 492CONFIG_BLK_DEV_SD=y
489# CONFIG_CHR_DEV_ST is not set 493# CONFIG_CHR_DEV_ST is not set
490# CONFIG_CHR_DEV_OSST is not set 494# CONFIG_CHR_DEV_OSST is not set
491# CONFIG_BLK_DEV_SR is not set 495# CONFIG_BLK_DEV_SR is not set
492# CONFIG_CHR_DEV_SG is not set 496# CONFIG_CHR_DEV_SG is not set
493# CONFIG_CHR_DEV_SCH is not set 497# CONFIG_CHR_DEV_SCH is not set
494
495#
496# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
497#
498# CONFIG_SCSI_MULTI_LUN is not set 498# CONFIG_SCSI_MULTI_LUN is not set
499# CONFIG_SCSI_CONSTANTS is not set 499# CONFIG_SCSI_CONSTANTS is not set
500# CONFIG_SCSI_LOGGING is not set 500# CONFIG_SCSI_LOGGING is not set
@@ -518,73 +518,9 @@ CONFIG_SCSI_LOWLEVEL=y
518# CONFIG_SCSI_OSD_INITIATOR is not set 518# CONFIG_SCSI_OSD_INITIATOR is not set
519# CONFIG_ATA is not set 519# CONFIG_ATA is not set
520# CONFIG_MD is not set 520# CONFIG_MD is not set
521CONFIG_NETDEVICES=y 521# CONFIG_NETDEVICES is not set
522CONFIG_COMPAT_NET_DEV_OPS=y
523# CONFIG_DUMMY is not set
524# CONFIG_BONDING is not set
525# CONFIG_MACVLAN is not set
526# CONFIG_EQUALIZER is not set
527CONFIG_TUN=m
528# CONFIG_VETH is not set
529CONFIG_PHYLIB=y
530
531#
532# MII PHY device drivers
533#
534# CONFIG_MARVELL_PHY is not set
535# CONFIG_DAVICOM_PHY is not set
536# CONFIG_QSEMI_PHY is not set
537CONFIG_LXT_PHY=y
538# CONFIG_CICADA_PHY is not set
539# CONFIG_VITESSE_PHY is not set
540# CONFIG_SMSC_PHY is not set
541# CONFIG_BROADCOM_PHY is not set
542# CONFIG_ICPLUS_PHY is not set
543# CONFIG_REALTEK_PHY is not set
544# CONFIG_NATIONAL_PHY is not set
545# CONFIG_STE10XP is not set
546CONFIG_LSI_ET1011C_PHY=y
547# CONFIG_FIXED_PHY is not set
548# CONFIG_MDIO_BITBANG is not set
549CONFIG_NET_ETHERNET=y
550CONFIG_MII=y
551# CONFIG_AX88796 is not set
552# CONFIG_SMC91X is not set
553CONFIG_TI_DAVINCI_EMAC=y
554# CONFIG_DM9000 is not set
555# CONFIG_ETHOC is not set
556# CONFIG_SMC911X is not set
557# CONFIG_SMSC911X is not set
558# CONFIG_DNET is not set
559# CONFIG_IBM_NEW_EMAC_ZMII is not set
560# CONFIG_IBM_NEW_EMAC_RGMII is not set
561# CONFIG_IBM_NEW_EMAC_TAH is not set
562# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
563# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
564# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
565# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
566# CONFIG_B44 is not set
567# CONFIG_NETDEV_1000 is not set
568# CONFIG_NETDEV_10000 is not set
569
570#
571# Wireless LAN
572#
573# CONFIG_WLAN_PRE80211 is not set
574# CONFIG_WLAN_80211 is not set
575
576#
577# Enable WiMAX (Networking options) to see the WiMAX drivers
578#
579# CONFIG_WAN is not set
580# CONFIG_PPP is not set
581# CONFIG_SLIP is not set
582CONFIG_NETCONSOLE=y
583# CONFIG_NETCONSOLE_DYNAMIC is not set
584CONFIG_NETPOLL=y
585CONFIG_NETPOLL_TRAP=y
586CONFIG_NET_POLL_CONTROLLER=y
587# CONFIG_ISDN is not set 522# CONFIG_ISDN is not set
523# CONFIG_PHONE is not set
588 524
589# 525#
590# Input device support 526# Input device support
@@ -596,52 +532,25 @@ CONFIG_INPUT=y
596# 532#
597# Userland interfaces 533# Userland interfaces
598# 534#
599CONFIG_INPUT_MOUSEDEV=m 535# CONFIG_INPUT_MOUSEDEV is not set
600CONFIG_INPUT_MOUSEDEV_PSAUX=y
601CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
602CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
603# CONFIG_INPUT_JOYDEV is not set 536# CONFIG_INPUT_JOYDEV is not set
604CONFIG_INPUT_EVDEV=m 537CONFIG_INPUT_EVDEV=y
605CONFIG_INPUT_EVBUG=m 538# CONFIG_INPUT_EVBUG is not set
606 539
607# 540#
608# Input Device Drivers 541# Input Device Drivers
609# 542#
610CONFIG_INPUT_KEYBOARD=y 543# CONFIG_INPUT_KEYBOARD is not set
611CONFIG_KEYBOARD_ATKBD=m
612# CONFIG_KEYBOARD_SUNKBD is not set
613# CONFIG_KEYBOARD_LKKBD is not set
614CONFIG_KEYBOARD_XTKBD=m
615# CONFIG_KEYBOARD_NEWTON is not set
616# CONFIG_KEYBOARD_STOWAWAY is not set
617CONFIG_KEYBOARD_GPIO=y
618# CONFIG_INPUT_MOUSE is not set 544# CONFIG_INPUT_MOUSE is not set
619# CONFIG_INPUT_JOYSTICK is not set 545# CONFIG_INPUT_JOYSTICK is not set
620# CONFIG_INPUT_TABLET is not set 546# CONFIG_INPUT_TABLET is not set
621CONFIG_INPUT_TOUCHSCREEN=y 547# CONFIG_INPUT_TOUCHSCREEN is not set
622# CONFIG_TOUCHSCREEN_AD7879_I2C is not set
623# CONFIG_TOUCHSCREEN_AD7879 is not set
624# CONFIG_TOUCHSCREEN_FUJITSU is not set
625# CONFIG_TOUCHSCREEN_GUNZE is not set
626# CONFIG_TOUCHSCREEN_ELO is not set
627# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
628# CONFIG_TOUCHSCREEN_MTOUCH is not set
629# CONFIG_TOUCHSCREEN_INEXIO is not set
630# CONFIG_TOUCHSCREEN_MK712 is not set
631# CONFIG_TOUCHSCREEN_PENMOUNT is not set
632# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
633# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
634# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
635# CONFIG_TOUCHSCREEN_TSC2007 is not set
636# CONFIG_INPUT_MISC is not set 548# CONFIG_INPUT_MISC is not set
637 549
638# 550#
639# Hardware I/O ports 551# Hardware I/O ports
640# 552#
641CONFIG_SERIO=y 553# CONFIG_SERIO is not set
642CONFIG_SERIO_SERPORT=y
643CONFIG_SERIO_LIBPS2=y
644# CONFIG_SERIO_RAW is not set
645# CONFIG_GAMEPORT is not set 554# CONFIG_GAMEPORT is not set
646 555
647# 556#
@@ -649,7 +558,7 @@ CONFIG_SERIO_LIBPS2=y
649# 558#
650CONFIG_VT=y 559CONFIG_VT=y
651CONFIG_CONSOLE_TRANSLATIONS=y 560CONFIG_CONSOLE_TRANSLATIONS=y
652# CONFIG_VT_CONSOLE is not set 561CONFIG_VT_CONSOLE=y
653CONFIG_HW_CONSOLE=y 562CONFIG_HW_CONSOLE=y
654# CONFIG_VT_HW_CONSOLE_BINDING is not set 563# CONFIG_VT_HW_CONSOLE_BINDING is not set
655CONFIG_DEVKMEM=y 564CONFIG_DEVKMEM=y
@@ -660,9 +569,13 @@ CONFIG_DEVKMEM=y
660# 569#
661CONFIG_SERIAL_8250=y 570CONFIG_SERIAL_8250=y
662CONFIG_SERIAL_8250_CONSOLE=y 571CONFIG_SERIAL_8250_CONSOLE=y
663CONFIG_SERIAL_8250_NR_UARTS=3 572CONFIG_SERIAL_8250_NR_UARTS=32
664CONFIG_SERIAL_8250_RUNTIME_UARTS=3 573CONFIG_SERIAL_8250_RUNTIME_UARTS=4
665# CONFIG_SERIAL_8250_EXTENDED is not set 574CONFIG_SERIAL_8250_EXTENDED=y
575CONFIG_SERIAL_8250_MANY_PORTS=y
576CONFIG_SERIAL_8250_SHARE_IRQ=y
577CONFIG_SERIAL_8250_DETECT_IRQ=y
578CONFIG_SERIAL_8250_RSA=y
666 579
667# 580#
668# Non-8250 serial port support 581# Non-8250 serial port support
@@ -671,55 +584,20 @@ CONFIG_SERIAL_CORE=y
671CONFIG_SERIAL_CORE_CONSOLE=y 584CONFIG_SERIAL_CORE_CONSOLE=y
672CONFIG_UNIX98_PTYS=y 585CONFIG_UNIX98_PTYS=y
673# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set 586# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
674CONFIG_LEGACY_PTYS=y 587# CONFIG_LEGACY_PTYS is not set
675CONFIG_LEGACY_PTY_COUNT=256
676# CONFIG_IPMI_HANDLER is not set 588# CONFIG_IPMI_HANDLER is not set
677CONFIG_HW_RANDOM=m 589CONFIG_HW_RANDOM=y
678# CONFIG_HW_RANDOM_TIMERIOMEM is not set 590# CONFIG_HW_RANDOM_TIMERIOMEM is not set
679# CONFIG_R3964 is not set 591# CONFIG_R3964 is not set
680# CONFIG_RAW_DRIVER is not set 592# CONFIG_RAW_DRIVER is not set
681# CONFIG_TCG_TPM is not set 593# CONFIG_TCG_TPM is not set
682CONFIG_I2C=y 594# CONFIG_I2C is not set
683CONFIG_I2C_BOARDINFO=y 595# CONFIG_SPI is not set
684CONFIG_I2C_CHARDEV=y
685CONFIG_I2C_HELPER_AUTO=y
686
687#
688# I2C Hardware Bus support
689#
690
691#
692# I2C system bus drivers (mostly embedded / system-on-chip)
693#
694CONFIG_I2C_DAVINCI=y
695# CONFIG_I2C_GPIO is not set
696# CONFIG_I2C_OCORES is not set
697# CONFIG_I2C_SIMTEC is not set
698
699#
700# External I2C/SMBus adapter drivers
701#
702# CONFIG_I2C_PARPORT_LIGHT is not set
703# CONFIG_I2C_TAOS_EVM is not set
704
705#
706# Other I2C/SMBus bus drivers
707#
708# CONFIG_I2C_PCA_PLATFORM is not set
709# CONFIG_I2C_STUB is not set
710 596
711# 597#
712# Miscellaneous I2C Chip support 598# PPS support
713# 599#
714# CONFIG_DS1682 is not set 600# CONFIG_PPS is not set
715# CONFIG_SENSORS_PCA9539 is not set
716# CONFIG_SENSORS_MAX6875 is not set
717# CONFIG_SENSORS_TSL2550 is not set
718# CONFIG_I2C_DEBUG_CORE is not set
719# CONFIG_I2C_DEBUG_ALGO is not set
720# CONFIG_I2C_DEBUG_BUS is not set
721# CONFIG_I2C_DEBUG_CHIP is not set
722# CONFIG_SPI is not set
723CONFIG_ARCH_REQUIRE_GPIOLIB=y 601CONFIG_ARCH_REQUIRE_GPIOLIB=y
724CONFIG_GPIOLIB=y 602CONFIG_GPIOLIB=y
725# CONFIG_DEBUG_GPIO is not set 603# CONFIG_DEBUG_GPIO is not set
@@ -732,9 +610,6 @@ CONFIG_GPIOLIB=y
732# 610#
733# I2C GPIO expanders: 611# I2C GPIO expanders:
734# 612#
735# CONFIG_GPIO_MAX732X is not set
736# CONFIG_GPIO_PCA953X is not set
737CONFIG_GPIO_PCF857X=m
738 613
739# 614#
740# PCI GPIO expanders: 615# PCI GPIO expanders:
@@ -743,19 +618,15 @@ CONFIG_GPIO_PCF857X=m
743# 618#
744# SPI GPIO expanders: 619# SPI GPIO expanders:
745# 620#
621
622#
623# AC97 GPIO expanders:
624#
746# CONFIG_W1 is not set 625# CONFIG_W1 is not set
747# CONFIG_POWER_SUPPLY is not set 626# CONFIG_POWER_SUPPLY is not set
748# CONFIG_HWMON is not set 627# CONFIG_HWMON is not set
749# CONFIG_THERMAL is not set 628# CONFIG_THERMAL is not set
750# CONFIG_THERMAL_HWMON is not set 629# CONFIG_WATCHDOG is not set
751CONFIG_WATCHDOG=y
752# CONFIG_WATCHDOG_NOWAYOUT is not set
753
754#
755# Watchdog Device Drivers
756#
757# CONFIG_SOFT_WATCHDOG is not set
758# CONFIG_DAVINCI_WATCHDOG is not set
759CONFIG_SSB_POSSIBLE=y 630CONFIG_SSB_POSSIBLE=y
760 631
761# 632#
@@ -771,32 +642,12 @@ CONFIG_SSB_POSSIBLE=y
771# CONFIG_MFD_ASIC3 is not set 642# CONFIG_MFD_ASIC3 is not set
772# CONFIG_HTC_EGPIO is not set 643# CONFIG_HTC_EGPIO is not set
773# CONFIG_HTC_PASIC3 is not set 644# CONFIG_HTC_PASIC3 is not set
774# CONFIG_TPS65010 is not set
775# CONFIG_TWL4030_CORE is not set
776# CONFIG_MFD_TMIO is not set 645# CONFIG_MFD_TMIO is not set
777# CONFIG_MFD_T7L66XB is not set 646# CONFIG_MFD_T7L66XB is not set
778# CONFIG_MFD_TC6387XB is not set 647# CONFIG_MFD_TC6387XB is not set
779# CONFIG_MFD_TC6393XB is not set 648# CONFIG_MFD_TC6393XB is not set
780# CONFIG_PMIC_DA903X is not set 649# CONFIG_REGULATOR is not set
781# CONFIG_MFD_WM8400 is not set 650# CONFIG_MEDIA_SUPPORT is not set
782# CONFIG_MFD_WM8350_I2C is not set
783# CONFIG_MFD_PCF50633 is not set
784
785#
786# Multimedia devices
787#
788
789#
790# Multimedia core support
791#
792# CONFIG_VIDEO_DEV is not set
793# CONFIG_DVB_CORE is not set
794# CONFIG_VIDEO_MEDIA is not set
795
796#
797# Multimedia drivers
798#
799# CONFIG_DAB is not set
800 651
801# 652#
802# Graphics support 653# Graphics support
@@ -816,72 +667,170 @@ CONFIG_SSB_POSSIBLE=y
816# 667#
817# CONFIG_VGA_CONSOLE is not set 668# CONFIG_VGA_CONSOLE is not set
818CONFIG_DUMMY_CONSOLE=y 669CONFIG_DUMMY_CONSOLE=y
819CONFIG_SOUND=m 670# CONFIG_SOUND is not set
820# CONFIG_SOUND_OSS_CORE is not set 671CONFIG_HID_SUPPORT=y
821CONFIG_SND=m 672CONFIG_HID=y
822CONFIG_SND_TIMER=m 673# CONFIG_HIDRAW is not set
823CONFIG_SND_PCM=m 674
824CONFIG_SND_JACK=y 675#
825# CONFIG_SND_SEQUENCER is not set 676# USB Input Devices
826# CONFIG_SND_MIXER_OSS is not set 677#
827# CONFIG_SND_PCM_OSS is not set 678CONFIG_USB_HID=y
828# CONFIG_SND_HRTIMER is not set 679# CONFIG_HID_PID is not set
829# CONFIG_SND_DYNAMIC_MINORS is not set 680# CONFIG_USB_HIDDEV is not set
830CONFIG_SND_SUPPORT_OLD_API=y 681
831CONFIG_SND_VERBOSE_PROCFS=y 682#
832# CONFIG_SND_VERBOSE_PRINTK is not set 683# Special HID drivers
833# CONFIG_SND_DEBUG is not set 684#
834CONFIG_SND_DRIVERS=y 685# CONFIG_HID_A4TECH is not set
835# CONFIG_SND_DUMMY is not set 686# CONFIG_HID_APPLE is not set
836# CONFIG_SND_MTPAV is not set 687# CONFIG_HID_BELKIN is not set
837# CONFIG_SND_SERIAL_U16550 is not set 688# CONFIG_HID_CHERRY is not set
838# CONFIG_SND_MPU401 is not set 689# CONFIG_HID_CHICONY is not set
839CONFIG_SND_ARM=y 690# CONFIG_HID_CYPRESS is not set
840CONFIG_SND_SOC=m 691# CONFIG_HID_DRAGONRISE is not set
841CONFIG_SND_DAVINCI_SOC=m 692# CONFIG_HID_EZKEY is not set
842CONFIG_SND_SOC_I2C_AND_SPI=m 693# CONFIG_HID_KYE is not set
843# CONFIG_SND_SOC_ALL_CODECS is not set 694# CONFIG_HID_GYRATION is not set
844# CONFIG_SOUND_PRIME is not set 695# CONFIG_HID_TWINHAN is not set
845# CONFIG_HID_SUPPORT is not set 696# CONFIG_HID_KENSINGTON is not set
846# CONFIG_USB_SUPPORT is not set 697# CONFIG_HID_LOGITECH is not set
847# CONFIG_USB_MUSB_HOST is not set 698# CONFIG_HID_MICROSOFT is not set
848# CONFIG_USB_MUSB_PERIPHERAL is not set 699# CONFIG_HID_MONTEREY is not set
849# CONFIG_USB_MUSB_OTG is not set 700# CONFIG_HID_NTRIG is not set
850# CONFIG_USB_GADGET_MUSB_HDRC is not set 701# CONFIG_HID_PANTHERLORD is not set
851# CONFIG_USB_GADGET_AT91 is not set 702# CONFIG_HID_PETALYNX is not set
852# CONFIG_USB_GADGET_ATMEL_USBA is not set 703# CONFIG_HID_SAMSUNG is not set
853# CONFIG_USB_GADGET_FSL_USB2 is not set 704# CONFIG_HID_SONY is not set
854# CONFIG_USB_GADGET_LH7A40X is not set 705# CONFIG_HID_SUNPLUS is not set
855# CONFIG_USB_GADGET_OMAP is not set 706# CONFIG_HID_GREENASIA is not set
856# CONFIG_USB_GADGET_PXA25X is not set 707# CONFIG_HID_SMARTJOYPLUS is not set
857# CONFIG_USB_GADGET_PXA27X is not set 708# CONFIG_HID_TOPSEED is not set
858# CONFIG_USB_GADGET_S3C2410 is not set 709# CONFIG_HID_THRUSTMASTER is not set
859# CONFIG_USB_GADGET_IMX is not set 710# CONFIG_HID_ZEROPLUS is not set
860# CONFIG_USB_GADGET_M66592 is not set 711CONFIG_USB_SUPPORT=y
861# CONFIG_USB_GADGET_AMD5536UDC is not set 712CONFIG_USB_ARCH_HAS_HCD=y
862# CONFIG_USB_GADGET_FSL_QE is not set 713CONFIG_USB_ARCH_HAS_OHCI=y
863# CONFIG_USB_GADGET_CI13XXX is not set 714CONFIG_USB_ARCH_HAS_EHCI=y
864# CONFIG_USB_GADGET_NET2280 is not set 715CONFIG_USB=y
865# CONFIG_USB_GADGET_GOKU is not set 716# CONFIG_USB_DEBUG is not set
866# CONFIG_USB_GADGET_DUMMY_HCD is not set 717CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
867# CONFIG_USB_ZERO is not set 718
868# CONFIG_USB_ETH is not set 719#
869# CONFIG_USB_GADGETFS is not set 720# Miscellaneous USB options
870# CONFIG_USB_FILE_STORAGE is not set 721#
871# CONFIG_USB_G_SERIAL is not set 722# CONFIG_USB_DEVICEFS is not set
872# CONFIG_USB_MIDI_GADGET is not set 723# CONFIG_USB_DEVICE_CLASS is not set
873# CONFIG_USB_G_PRINTER is not set 724# CONFIG_USB_DYNAMIC_MINORS is not set
874# CONFIG_USB_CDC_COMPOSITE is not set 725# CONFIG_USB_OTG is not set
726# CONFIG_USB_OTG_WHITELIST is not set
727# CONFIG_USB_OTG_BLACKLIST_HUB is not set
728# CONFIG_USB_MON is not set
729# CONFIG_USB_WUSB is not set
730# CONFIG_USB_WUSB_CBAF is not set
731
732#
733# USB Host Controller Drivers
734#
735# CONFIG_USB_C67X00_HCD is not set
736CONFIG_USB_EHCI_HCD=y
737# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
738# CONFIG_USB_EHCI_TT_NEWSCHED is not set
739# CONFIG_USB_OXU210HP_HCD is not set
740# CONFIG_USB_ISP116X_HCD is not set
741# CONFIG_USB_ISP1760_HCD is not set
742# CONFIG_USB_ISP1362_HCD is not set
743# CONFIG_USB_OHCI_HCD is not set
744# CONFIG_USB_SL811_HCD is not set
745# CONFIG_USB_R8A66597_HCD is not set
746# CONFIG_USB_HWA_HCD is not set
747# CONFIG_USB_MUSB_HDRC is not set
748
749#
750# USB Device Class drivers
751#
752# CONFIG_USB_ACM is not set
753# CONFIG_USB_PRINTER is not set
754# CONFIG_USB_WDM is not set
755# CONFIG_USB_TMC is not set
756
757#
758# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
759#
760
761#
762# also be needed; see USB_STORAGE Help for more info
763#
764CONFIG_USB_STORAGE=y
765# CONFIG_USB_STORAGE_DEBUG is not set
766# CONFIG_USB_STORAGE_DATAFAB is not set
767# CONFIG_USB_STORAGE_FREECOM is not set
768# CONFIG_USB_STORAGE_ISD200 is not set
769# CONFIG_USB_STORAGE_USBAT is not set
770# CONFIG_USB_STORAGE_SDDR09 is not set
771# CONFIG_USB_STORAGE_SDDR55 is not set
772# CONFIG_USB_STORAGE_JUMPSHOT is not set
773# CONFIG_USB_STORAGE_ALAUDA is not set
774# CONFIG_USB_STORAGE_ONETOUCH is not set
775# CONFIG_USB_STORAGE_KARMA is not set
776# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
777# CONFIG_USB_LIBUSUAL is not set
778
779#
780# USB Imaging devices
781#
782# CONFIG_USB_MDC800 is not set
783# CONFIG_USB_MICROTEK is not set
784
785#
786# USB port drivers
787#
788# CONFIG_USB_SERIAL is not set
789
790#
791# USB Miscellaneous drivers
792#
793# CONFIG_USB_EMI62 is not set
794# CONFIG_USB_EMI26 is not set
795# CONFIG_USB_ADUTUX is not set
796# CONFIG_USB_SEVSEG is not set
797# CONFIG_USB_RIO500 is not set
798# CONFIG_USB_LEGOTOWER is not set
799# CONFIG_USB_LCD is not set
800# CONFIG_USB_BERRY_CHARGE is not set
801# CONFIG_USB_LED is not set
802# CONFIG_USB_CYPRESS_CY7C63 is not set
803# CONFIG_USB_CYTHERM is not set
804# CONFIG_USB_IDMOUSE is not set
805# CONFIG_USB_FTDI_ELAN is not set
806# CONFIG_USB_APPLEDISPLAY is not set
807# CONFIG_USB_SISUSBVGA is not set
808# CONFIG_USB_LD is not set
809# CONFIG_USB_TRANCEVIBRATOR is not set
810# CONFIG_USB_IOWARRIOR is not set
811# CONFIG_USB_TEST is not set
812# CONFIG_USB_ISIGHTFW is not set
813# CONFIG_USB_VST is not set
814# CONFIG_USB_GADGET is not set
815
816#
817# OTG and related infrastructure
818#
819# CONFIG_USB_GPIO_VBUS is not set
820# CONFIG_NOP_USB_XCEIV is not set
875# CONFIG_MMC is not set 821# CONFIG_MMC is not set
876# CONFIG_MEMSTICK is not set 822# CONFIG_MEMSTICK is not set
877# CONFIG_ACCESSIBILITY is not set
878# CONFIG_NEW_LEDS is not set 823# CONFIG_NEW_LEDS is not set
824# CONFIG_ACCESSIBILITY is not set
879CONFIG_RTC_LIB=y 825CONFIG_RTC_LIB=y
880# CONFIG_RTC_CLASS is not set 826# CONFIG_RTC_CLASS is not set
881# CONFIG_DMADEVICES is not set 827# CONFIG_DMADEVICES is not set
882# CONFIG_AUXDISPLAY is not set 828# CONFIG_AUXDISPLAY is not set
883# CONFIG_REGULATOR is not set
884# CONFIG_UIO is not set 829# CONFIG_UIO is not set
830
831#
832# TI VLYNQ
833#
885# CONFIG_STAGING is not set 834# CONFIG_STAGING is not set
886 835
887# 836#
@@ -892,30 +841,31 @@ CONFIG_EXT2_FS=y
892# CONFIG_EXT2_FS_XIP is not set 841# CONFIG_EXT2_FS_XIP is not set
893CONFIG_EXT3_FS=y 842CONFIG_EXT3_FS=y
894# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set 843# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
895CONFIG_EXT3_FS_XATTR=y 844# CONFIG_EXT3_FS_XATTR is not set
896# CONFIG_EXT3_FS_POSIX_ACL is not set
897# CONFIG_EXT3_FS_SECURITY is not set
898# CONFIG_EXT4_FS is not set 845# CONFIG_EXT4_FS is not set
899CONFIG_JBD=y 846CONFIG_JBD=y
900# CONFIG_JBD_DEBUG is not set
901CONFIG_FS_MBCACHE=y
902# CONFIG_REISERFS_FS is not set 847# CONFIG_REISERFS_FS is not set
903# CONFIG_JFS_FS is not set 848# CONFIG_JFS_FS is not set
904# CONFIG_FS_POSIX_ACL is not set 849# CONFIG_FS_POSIX_ACL is not set
905CONFIG_FILE_LOCKING=y 850# CONFIG_XFS_FS is not set
906CONFIG_XFS_FS=m 851# CONFIG_GFS2_FS is not set
907# CONFIG_XFS_QUOTA is not set
908# CONFIG_XFS_POSIX_ACL is not set
909# CONFIG_XFS_RT is not set
910# CONFIG_XFS_DEBUG is not set
911# CONFIG_OCFS2_FS is not set 852# CONFIG_OCFS2_FS is not set
912# CONFIG_BTRFS_FS is not set 853# CONFIG_BTRFS_FS is not set
854# CONFIG_NILFS2_FS is not set
855CONFIG_FILE_LOCKING=y
856CONFIG_FSNOTIFY=y
913CONFIG_DNOTIFY=y 857CONFIG_DNOTIFY=y
914CONFIG_INOTIFY=y 858CONFIG_INOTIFY=y
915CONFIG_INOTIFY_USER=y 859CONFIG_INOTIFY_USER=y
916# CONFIG_QUOTA is not set 860CONFIG_QUOTA=y
861# CONFIG_QUOTA_NETLINK_INTERFACE is not set
862CONFIG_PRINT_QUOTA_WARNING=y
863CONFIG_QUOTA_TREE=y
864# CONFIG_QFMT_V1 is not set
865CONFIG_QFMT_V2=y
866CONFIG_QUOTACTL=y
917# CONFIG_AUTOFS_FS is not set 867# CONFIG_AUTOFS_FS is not set
918CONFIG_AUTOFS4_FS=m 868# CONFIG_AUTOFS4_FS is not set
919# CONFIG_FUSE_FS is not set 869# CONFIG_FUSE_FS is not set
920 870
921# 871#
@@ -958,36 +908,32 @@ CONFIG_MISC_FILESYSTEMS=y
958# CONFIG_BEFS_FS is not set 908# CONFIG_BEFS_FS is not set
959# CONFIG_BFS_FS is not set 909# CONFIG_BFS_FS is not set
960# CONFIG_EFS_FS is not set 910# CONFIG_EFS_FS is not set
961CONFIG_CRAMFS=y 911# CONFIG_CRAMFS is not set
962# CONFIG_SQUASHFS is not set 912# CONFIG_SQUASHFS is not set
963# CONFIG_VXFS_FS is not set 913# CONFIG_VXFS_FS is not set
964CONFIG_MINIX_FS=m 914# CONFIG_MINIX_FS is not set
965# CONFIG_OMFS_FS is not set 915# CONFIG_OMFS_FS is not set
966# CONFIG_HPFS_FS is not set 916# CONFIG_HPFS_FS is not set
967# CONFIG_QNX4FS_FS is not set 917# CONFIG_QNX4FS_FS is not set
968# CONFIG_ROMFS_FS is not set 918# CONFIG_ROMFS_FS is not set
969# CONFIG_SYSV_FS is not set 919# CONFIG_SYSV_FS is not set
970# CONFIG_UFS_FS is not set 920# CONFIG_UFS_FS is not set
971# CONFIG_NILFS2_FS is not set
972CONFIG_NETWORK_FILESYSTEMS=y 921CONFIG_NETWORK_FILESYSTEMS=y
973CONFIG_NFS_FS=y 922CONFIG_NFS_FS=y
974CONFIG_NFS_V3=y 923CONFIG_NFS_V3=y
975# CONFIG_NFS_V3_ACL is not set 924# CONFIG_NFS_V3_ACL is not set
976# CONFIG_NFS_V4 is not set 925CONFIG_NFS_V4=y
926# CONFIG_NFS_V4_1 is not set
977CONFIG_ROOT_NFS=y 927CONFIG_ROOT_NFS=y
978CONFIG_NFSD=m 928# CONFIG_NFSD is not set
979CONFIG_NFSD_V3=y
980# CONFIG_NFSD_V3_ACL is not set
981# CONFIG_NFSD_V4 is not set
982CONFIG_LOCKD=y 929CONFIG_LOCKD=y
983CONFIG_LOCKD_V4=y 930CONFIG_LOCKD_V4=y
984CONFIG_EXPORTFS=m
985CONFIG_NFS_COMMON=y 931CONFIG_NFS_COMMON=y
986CONFIG_SUNRPC=y 932CONFIG_SUNRPC=y
987# CONFIG_RPCSEC_GSS_KRB5 is not set 933CONFIG_SUNRPC_GSS=y
934CONFIG_RPCSEC_GSS_KRB5=y
988# CONFIG_RPCSEC_GSS_SPKM3 is not set 935# CONFIG_RPCSEC_GSS_SPKM3 is not set
989CONFIG_SMB_FS=m 936# CONFIG_SMB_FS is not set
990# CONFIG_SMB_NLS_DEFAULT is not set
991# CONFIG_CIFS is not set 937# CONFIG_CIFS is not set
992# CONFIG_NCP_FS is not set 938# CONFIG_NCP_FS is not set
993# CONFIG_CODA_FS is not set 939# CONFIG_CODA_FS is not set
@@ -1039,7 +985,7 @@ CONFIG_NLS_CODEPAGE_437=y
1039# CONFIG_NLS_ISO8859_8 is not set 985# CONFIG_NLS_ISO8859_8 is not set
1040# CONFIG_NLS_CODEPAGE_1250 is not set 986# CONFIG_NLS_CODEPAGE_1250 is not set
1041# CONFIG_NLS_CODEPAGE_1251 is not set 987# CONFIG_NLS_CODEPAGE_1251 is not set
1042CONFIG_NLS_ASCII=m 988# CONFIG_NLS_ASCII is not set
1043CONFIG_NLS_ISO8859_1=y 989CONFIG_NLS_ISO8859_1=y
1044# CONFIG_NLS_ISO8859_2 is not set 990# CONFIG_NLS_ISO8859_2 is not set
1045# CONFIG_NLS_ISO8859_3 is not set 991# CONFIG_NLS_ISO8859_3 is not set
@@ -1053,7 +999,7 @@ CONFIG_NLS_ISO8859_1=y
1053# CONFIG_NLS_ISO8859_15 is not set 999# CONFIG_NLS_ISO8859_15 is not set
1054# CONFIG_NLS_KOI8_R is not set 1000# CONFIG_NLS_KOI8_R is not set
1055# CONFIG_NLS_KOI8_U is not set 1001# CONFIG_NLS_KOI8_U is not set
1056CONFIG_NLS_UTF8=m 1002# CONFIG_NLS_UTF8 is not set
1057# CONFIG_DLM is not set 1003# CONFIG_DLM is not set
1058 1004
1059# 1005#
@@ -1063,9 +1009,10 @@ CONFIG_NLS_UTF8=m
1063CONFIG_ENABLE_WARN_DEPRECATED=y 1009CONFIG_ENABLE_WARN_DEPRECATED=y
1064CONFIG_ENABLE_MUST_CHECK=y 1010CONFIG_ENABLE_MUST_CHECK=y
1065CONFIG_FRAME_WARN=1024 1011CONFIG_FRAME_WARN=1024
1066# CONFIG_MAGIC_SYSRQ is not set 1012CONFIG_MAGIC_SYSRQ=y
1013# CONFIG_STRIP_ASM_SYMS is not set
1067# CONFIG_UNUSED_SYMBOLS is not set 1014# CONFIG_UNUSED_SYMBOLS is not set
1068CONFIG_DEBUG_FS=y 1015# CONFIG_DEBUG_FS is not set
1069# CONFIG_HEADERS_CHECK is not set 1016# CONFIG_HEADERS_CHECK is not set
1070CONFIG_DEBUG_KERNEL=y 1017CONFIG_DEBUG_KERNEL=y
1071# CONFIG_DEBUG_SHIRQ is not set 1018# CONFIG_DEBUG_SHIRQ is not set
@@ -1075,15 +1022,13 @@ CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
1075CONFIG_DETECT_HUNG_TASK=y 1022CONFIG_DETECT_HUNG_TASK=y
1076# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set 1023# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
1077CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0 1024CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
1078CONFIG_SCHED_DEBUG=y 1025# CONFIG_SCHED_DEBUG is not set
1079# CONFIG_SCHEDSTATS is not set 1026# CONFIG_SCHEDSTATS is not set
1080CONFIG_TIMER_STATS=y 1027# CONFIG_TIMER_STATS is not set
1081# CONFIG_DEBUG_OBJECTS is not set 1028# CONFIG_DEBUG_OBJECTS is not set
1082# CONFIG_SLUB_DEBUG_ON is not set 1029# CONFIG_DEBUG_SLAB is not set
1083# CONFIG_SLUB_STATS is not set 1030# CONFIG_DEBUG_KMEMLEAK is not set
1084CONFIG_DEBUG_PREEMPT=y 1031# CONFIG_DEBUG_RT_MUTEXES is not set
1085CONFIG_DEBUG_RT_MUTEXES=y
1086CONFIG_DEBUG_PI_LIST=y
1087# CONFIG_RT_MUTEX_TESTER is not set 1032# CONFIG_RT_MUTEX_TESTER is not set
1088# CONFIG_DEBUG_SPINLOCK is not set 1033# CONFIG_DEBUG_SPINLOCK is not set
1089CONFIG_DEBUG_MUTEXES=y 1034CONFIG_DEBUG_MUTEXES=y
@@ -1093,50 +1038,48 @@ CONFIG_DEBUG_MUTEXES=y
1093# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1038# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1094# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1039# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1095# CONFIG_DEBUG_KOBJECT is not set 1040# CONFIG_DEBUG_KOBJECT is not set
1096CONFIG_DEBUG_BUGVERBOSE=y 1041# CONFIG_DEBUG_BUGVERBOSE is not set
1097# CONFIG_DEBUG_INFO is not set 1042CONFIG_DEBUG_INFO=y
1098# CONFIG_DEBUG_VM is not set 1043# CONFIG_DEBUG_VM is not set
1099# CONFIG_DEBUG_WRITECOUNT is not set 1044# CONFIG_DEBUG_WRITECOUNT is not set
1100# CONFIG_DEBUG_MEMORY_INIT is not set 1045# CONFIG_DEBUG_MEMORY_INIT is not set
1101# CONFIG_DEBUG_LIST is not set 1046# CONFIG_DEBUG_LIST is not set
1102# CONFIG_DEBUG_SG is not set 1047# CONFIG_DEBUG_SG is not set
1103# CONFIG_DEBUG_NOTIFIERS is not set 1048# CONFIG_DEBUG_NOTIFIERS is not set
1049# CONFIG_DEBUG_CREDENTIALS is not set
1104# CONFIG_BOOT_PRINTK_DELAY is not set 1050# CONFIG_BOOT_PRINTK_DELAY is not set
1105# CONFIG_RCU_TORTURE_TEST is not set 1051# CONFIG_RCU_TORTURE_TEST is not set
1106# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1052# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1107# CONFIG_BACKTRACE_SELF_TEST is not set 1053# CONFIG_BACKTRACE_SELF_TEST is not set
1108# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 1054# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1055# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
1109# CONFIG_FAULT_INJECTION is not set 1056# CONFIG_FAULT_INJECTION is not set
1110# CONFIG_LATENCYTOP is not set 1057# CONFIG_LATENCYTOP is not set
1111# CONFIG_SYSCTL_SYSCALL_CHECK is not set
1112# CONFIG_PAGE_POISONING is not set 1058# CONFIG_PAGE_POISONING is not set
1113CONFIG_HAVE_FUNCTION_TRACER=y 1059CONFIG_HAVE_FUNCTION_TRACER=y
1114CONFIG_TRACING_SUPPORT=y 1060CONFIG_TRACING_SUPPORT=y
1115 1061CONFIG_FTRACE=y
1116#
1117# Tracers
1118#
1119# CONFIG_FUNCTION_TRACER is not set 1062# CONFIG_FUNCTION_TRACER is not set
1120# CONFIG_IRQSOFF_TRACER is not set 1063# CONFIG_IRQSOFF_TRACER is not set
1121# CONFIG_PREEMPT_TRACER is not set
1122# CONFIG_SCHED_TRACER is not set 1064# CONFIG_SCHED_TRACER is not set
1123# CONFIG_CONTEXT_SWITCH_TRACER is not set 1065# CONFIG_ENABLE_DEFAULT_TRACERS is not set
1124# CONFIG_EVENT_TRACER is not set
1125# CONFIG_BOOT_TRACER is not set 1066# CONFIG_BOOT_TRACER is not set
1126# CONFIG_TRACE_BRANCH_PROFILING is not set 1067CONFIG_BRANCH_PROFILE_NONE=y
1068# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1069# CONFIG_PROFILE_ALL_BRANCHES is not set
1127# CONFIG_STACK_TRACER is not set 1070# CONFIG_STACK_TRACER is not set
1128# CONFIG_KMEMTRACE is not set 1071# CONFIG_KMEMTRACE is not set
1129# CONFIG_WORKQUEUE_TRACER is not set 1072# CONFIG_WORKQUEUE_TRACER is not set
1130# CONFIG_BLK_DEV_IO_TRACE is not set 1073# CONFIG_BLK_DEV_IO_TRACE is not set
1131# CONFIG_DYNAMIC_DEBUG is not set
1132# CONFIG_SAMPLES is not set 1074# CONFIG_SAMPLES is not set
1133CONFIG_HAVE_ARCH_KGDB=y 1075CONFIG_HAVE_ARCH_KGDB=y
1134# CONFIG_KGDB is not set 1076# CONFIG_KGDB is not set
1135CONFIG_ARM_UNWIND=y 1077CONFIG_ARM_UNWIND=y
1136CONFIG_DEBUG_USER=y 1078# CONFIG_DEBUG_USER is not set
1137CONFIG_DEBUG_ERRORS=y 1079# CONFIG_DEBUG_ERRORS is not set
1138# CONFIG_DEBUG_STACK_USAGE is not set 1080# CONFIG_DEBUG_STACK_USAGE is not set
1139# CONFIG_DEBUG_LL is not set 1081CONFIG_DEBUG_LL=y
1082# CONFIG_DEBUG_ICEDCC is not set
1140 1083
1141# 1084#
1142# Security options 1085# Security options
@@ -1150,11 +1093,20 @@ CONFIG_CRYPTO=y
1150# 1093#
1151# Crypto core or helper 1094# Crypto core or helper
1152# 1095#
1153# CONFIG_CRYPTO_FIPS is not set 1096CONFIG_CRYPTO_ALGAPI=y
1154# CONFIG_CRYPTO_MANAGER is not set 1097CONFIG_CRYPTO_ALGAPI2=y
1155# CONFIG_CRYPTO_MANAGER2 is not set 1098CONFIG_CRYPTO_AEAD2=y
1099CONFIG_CRYPTO_BLKCIPHER=y
1100CONFIG_CRYPTO_BLKCIPHER2=y
1101CONFIG_CRYPTO_HASH=y
1102CONFIG_CRYPTO_HASH2=y
1103CONFIG_CRYPTO_RNG2=y
1104CONFIG_CRYPTO_PCOMP=y
1105CONFIG_CRYPTO_MANAGER=y
1106CONFIG_CRYPTO_MANAGER2=y
1156# CONFIG_CRYPTO_GF128MUL is not set 1107# CONFIG_CRYPTO_GF128MUL is not set
1157# CONFIG_CRYPTO_NULL is not set 1108# CONFIG_CRYPTO_NULL is not set
1109CONFIG_CRYPTO_WORKQUEUE=y
1158# CONFIG_CRYPTO_CRYPTD is not set 1110# CONFIG_CRYPTO_CRYPTD is not set
1159# CONFIG_CRYPTO_AUTHENC is not set 1111# CONFIG_CRYPTO_AUTHENC is not set
1160# CONFIG_CRYPTO_TEST is not set 1112# CONFIG_CRYPTO_TEST is not set
@@ -1169,12 +1121,12 @@ CONFIG_CRYPTO=y
1169# 1121#
1170# Block modes 1122# Block modes
1171# 1123#
1172# CONFIG_CRYPTO_CBC is not set 1124CONFIG_CRYPTO_CBC=y
1173# CONFIG_CRYPTO_CTR is not set 1125# CONFIG_CRYPTO_CTR is not set
1174# CONFIG_CRYPTO_CTS is not set 1126# CONFIG_CRYPTO_CTS is not set
1175# CONFIG_CRYPTO_ECB is not set 1127CONFIG_CRYPTO_ECB=m
1176# CONFIG_CRYPTO_LRW is not set 1128# CONFIG_CRYPTO_LRW is not set
1177# CONFIG_CRYPTO_PCBC is not set 1129CONFIG_CRYPTO_PCBC=m
1178# CONFIG_CRYPTO_XTS is not set 1130# CONFIG_CRYPTO_XTS is not set
1179 1131
1180# 1132#
@@ -1182,13 +1134,15 @@ CONFIG_CRYPTO=y
1182# 1134#
1183# CONFIG_CRYPTO_HMAC is not set 1135# CONFIG_CRYPTO_HMAC is not set
1184# CONFIG_CRYPTO_XCBC is not set 1136# CONFIG_CRYPTO_XCBC is not set
1137# CONFIG_CRYPTO_VMAC is not set
1185 1138
1186# 1139#
1187# Digest 1140# Digest
1188# 1141#
1189# CONFIG_CRYPTO_CRC32C is not set 1142CONFIG_CRYPTO_CRC32C=y
1143# CONFIG_CRYPTO_GHASH is not set
1190# CONFIG_CRYPTO_MD4 is not set 1144# CONFIG_CRYPTO_MD4 is not set
1191# CONFIG_CRYPTO_MD5 is not set 1145CONFIG_CRYPTO_MD5=y
1192# CONFIG_CRYPTO_MICHAEL_MIC is not set 1146# CONFIG_CRYPTO_MICHAEL_MIC is not set
1193# CONFIG_CRYPTO_RMD128 is not set 1147# CONFIG_CRYPTO_RMD128 is not set
1194# CONFIG_CRYPTO_RMD160 is not set 1148# CONFIG_CRYPTO_RMD160 is not set
@@ -1210,7 +1164,7 @@ CONFIG_CRYPTO=y
1210# CONFIG_CRYPTO_CAMELLIA is not set 1164# CONFIG_CRYPTO_CAMELLIA is not set
1211# CONFIG_CRYPTO_CAST5 is not set 1165# CONFIG_CRYPTO_CAST5 is not set
1212# CONFIG_CRYPTO_CAST6 is not set 1166# CONFIG_CRYPTO_CAST6 is not set
1213# CONFIG_CRYPTO_DES is not set 1167CONFIG_CRYPTO_DES=y
1214# CONFIG_CRYPTO_FCRYPT is not set 1168# CONFIG_CRYPTO_FCRYPT is not set
1215# CONFIG_CRYPTO_KHAZAD is not set 1169# CONFIG_CRYPTO_KHAZAD is not set
1216# CONFIG_CRYPTO_SALSA20 is not set 1170# CONFIG_CRYPTO_SALSA20 is not set
@@ -1230,7 +1184,7 @@ CONFIG_CRYPTO=y
1230# Random Number Generation 1184# Random Number Generation
1231# 1185#
1232# CONFIG_CRYPTO_ANSI_CPRNG is not set 1186# CONFIG_CRYPTO_ANSI_CPRNG is not set
1233# CONFIG_CRYPTO_HW is not set 1187CONFIG_CRYPTO_HW=y
1234# CONFIG_BINARY_PRINTF is not set 1188# CONFIG_BINARY_PRINTF is not set
1235 1189
1236# 1190#
@@ -1238,16 +1192,15 @@ CONFIG_CRYPTO=y
1238# 1192#
1239CONFIG_BITREVERSE=y 1193CONFIG_BITREVERSE=y
1240CONFIG_GENERIC_FIND_LAST_BIT=y 1194CONFIG_GENERIC_FIND_LAST_BIT=y
1241CONFIG_CRC_CCITT=m 1195CONFIG_CRC_CCITT=y
1242# CONFIG_CRC16 is not set 1196# CONFIG_CRC16 is not set
1243CONFIG_CRC_T10DIF=m 1197# CONFIG_CRC_T10DIF is not set
1244# CONFIG_CRC_ITU_T is not set 1198# CONFIG_CRC_ITU_T is not set
1245CONFIG_CRC32=y 1199CONFIG_CRC32=y
1246# CONFIG_CRC7 is not set 1200# CONFIG_CRC7 is not set
1247# CONFIG_LIBCRC32C is not set 1201CONFIG_LIBCRC32C=y
1248CONFIG_ZLIB_INFLATE=y 1202CONFIG_ZLIB_INFLATE=y
1249CONFIG_DECOMPRESS_GZIP=y 1203CONFIG_DECOMPRESS_GZIP=y
1250CONFIG_GENERIC_ALLOCATOR=y
1251CONFIG_HAS_IOMEM=y 1204CONFIG_HAS_IOMEM=y
1252CONFIG_HAS_IOPORT=y 1205CONFIG_HAS_IOPORT=y
1253CONFIG_HAS_DMA=y 1206CONFIG_HAS_DMA=y
diff --git a/arch/arm/configs/at91rm9200dk_defconfig b/arch/arm/configs/at91rm9200dk_defconfig
index 238b218394e3..c97e1022ada1 100644
--- a/arch/arm/configs/at91rm9200dk_defconfig
+++ b/arch/arm/configs/at91rm9200dk_defconfig
@@ -120,6 +120,7 @@ CONFIG_ARCH_AT91RM9200DK=y
120# CONFIG_MACH_CARMEVA is not set 120# CONFIG_MACH_CARMEVA is not set
121# CONFIG_MACH_KB9200 is not set 121# CONFIG_MACH_KB9200 is not set
122# CONFIG_MACH_ATEB9200 is not set 122# CONFIG_MACH_ATEB9200 is not set
123CONFIG_MACH_ECO920=y
123 124
124# 125#
125# AT91RM9200 Feature Selections 126# AT91RM9200 Feature Selections
diff --git a/arch/arm/configs/cm_t35_defconfig b/arch/arm/configs/cm_t35_defconfig
new file mode 100644
index 000000000000..e42c5c873eb2
--- /dev/null
+++ b/arch/arm/configs/cm_t35_defconfig
@@ -0,0 +1,1733 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.32-rc4
4# Tue Oct 13 17:10:40 2009
5#
6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y
9CONFIG_GENERIC_TIME=y
10CONFIG_GENERIC_CLOCKEVENTS=y
11CONFIG_GENERIC_HARDIRQS=y
12CONFIG_STACKTRACE_SUPPORT=y
13CONFIG_HAVE_LATENCYTOP_SUPPORT=y
14CONFIG_LOCKDEP_SUPPORT=y
15CONFIG_TRACE_IRQFLAGS_SUPPORT=y
16CONFIG_HARDIRQS_SW_RESEND=y
17CONFIG_GENERIC_IRQ_PROBE=y
18CONFIG_RWSEM_GENERIC_SPINLOCK=y
19CONFIG_ARCH_HAS_CPUFREQ=y
20CONFIG_GENERIC_HWEIGHT=y
21CONFIG_GENERIC_CALIBRATE_DELAY=y
22CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
23CONFIG_VECTORS_BASE=0xffff0000
24CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
25CONFIG_CONSTRUCTORS=y
26
27#
28# General setup
29#
30CONFIG_EXPERIMENTAL=y
31CONFIG_BROKEN_ON_SMP=y
32CONFIG_INIT_ENV_ARG_LIMIT=32
33CONFIG_LOCALVERSION=""
34CONFIG_LOCALVERSION_AUTO=y
35CONFIG_SWAP=y
36CONFIG_SYSVIPC=y
37CONFIG_SYSVIPC_SYSCTL=y
38# CONFIG_POSIX_MQUEUE is not set
39CONFIG_BSD_PROCESS_ACCT=y
40# CONFIG_BSD_PROCESS_ACCT_V3 is not set
41# CONFIG_TASKSTATS is not set
42# CONFIG_AUDIT is not set
43
44#
45# RCU Subsystem
46#
47CONFIG_TREE_RCU=y
48# CONFIG_TREE_PREEMPT_RCU is not set
49# CONFIG_RCU_TRACE is not set
50CONFIG_RCU_FANOUT=32
51# CONFIG_RCU_FANOUT_EXACT is not set
52# CONFIG_TREE_RCU_TRACE is not set
53CONFIG_IKCONFIG=y
54CONFIG_IKCONFIG_PROC=y
55CONFIG_LOG_BUF_SHIFT=17
56CONFIG_GROUP_SCHED=y
57CONFIG_FAIR_GROUP_SCHED=y
58# CONFIG_RT_GROUP_SCHED is not set
59CONFIG_USER_SCHED=y
60# CONFIG_CGROUP_SCHED is not set
61# CONFIG_CGROUPS is not set
62CONFIG_SYSFS_DEPRECATED=y
63CONFIG_SYSFS_DEPRECATED_V2=y
64# CONFIG_RELAY is not set
65# CONFIG_NAMESPACES is not set
66CONFIG_BLK_DEV_INITRD=y
67CONFIG_INITRAMFS_SOURCE=""
68CONFIG_RD_GZIP=y
69# CONFIG_RD_BZIP2 is not set
70# CONFIG_RD_LZMA is not set
71CONFIG_CC_OPTIMIZE_FOR_SIZE=y
72CONFIG_SYSCTL=y
73CONFIG_ANON_INODES=y
74CONFIG_EMBEDDED=y
75CONFIG_UID16=y
76# CONFIG_SYSCTL_SYSCALL is not set
77CONFIG_KALLSYMS=y
78# CONFIG_KALLSYMS_ALL is not set
79CONFIG_KALLSYMS_EXTRA_PASS=y
80CONFIG_HOTPLUG=y
81CONFIG_PRINTK=y
82CONFIG_BUG=y
83CONFIG_ELF_CORE=y
84CONFIG_BASE_FULL=y
85CONFIG_FUTEX=y
86CONFIG_EPOLL=y
87CONFIG_SIGNALFD=y
88CONFIG_TIMERFD=y
89CONFIG_EVENTFD=y
90CONFIG_SHMEM=y
91CONFIG_AIO=y
92
93#
94# Kernel Performance Events And Counters
95#
96CONFIG_VM_EVENT_COUNTERS=y
97CONFIG_COMPAT_BRK=y
98CONFIG_SLAB=y
99# CONFIG_SLUB is not set
100# CONFIG_SLOB is not set
101# CONFIG_PROFILING is not set
102CONFIG_HAVE_OPROFILE=y
103# CONFIG_KPROBES is not set
104CONFIG_HAVE_KPROBES=y
105CONFIG_HAVE_KRETPROBES=y
106CONFIG_HAVE_CLK=y
107
108#
109# GCOV-based kernel profiling
110#
111# CONFIG_GCOV_KERNEL is not set
112# CONFIG_SLOW_WORK is not set
113CONFIG_HAVE_GENERIC_DMA_COHERENT=y
114CONFIG_SLABINFO=y
115CONFIG_RT_MUTEXES=y
116CONFIG_BASE_SMALL=0
117CONFIG_MODULES=y
118# CONFIG_MODULE_FORCE_LOAD is not set
119CONFIG_MODULE_UNLOAD=y
120# CONFIG_MODULE_FORCE_UNLOAD is not set
121CONFIG_MODVERSIONS=y
122# CONFIG_MODULE_SRCVERSION_ALL is not set
123CONFIG_BLOCK=y
124CONFIG_LBDAF=y
125# CONFIG_BLK_DEV_BSG is not set
126# CONFIG_BLK_DEV_INTEGRITY is not set
127
128#
129# IO Schedulers
130#
131CONFIG_IOSCHED_NOOP=y
132CONFIG_IOSCHED_AS=y
133CONFIG_IOSCHED_DEADLINE=y
134CONFIG_IOSCHED_CFQ=y
135CONFIG_DEFAULT_AS=y
136# CONFIG_DEFAULT_DEADLINE is not set
137# CONFIG_DEFAULT_CFQ is not set
138# CONFIG_DEFAULT_NOOP is not set
139CONFIG_DEFAULT_IOSCHED="anticipatory"
140CONFIG_FREEZER=y
141
142#
143# System Type
144#
145CONFIG_MMU=y
146# CONFIG_ARCH_AAEC2000 is not set
147# CONFIG_ARCH_INTEGRATOR is not set
148# CONFIG_ARCH_REALVIEW is not set
149# CONFIG_ARCH_VERSATILE is not set
150# CONFIG_ARCH_AT91 is not set
151# CONFIG_ARCH_CLPS711X is not set
152# CONFIG_ARCH_GEMINI is not set
153# CONFIG_ARCH_EBSA110 is not set
154# CONFIG_ARCH_EP93XX is not set
155# CONFIG_ARCH_FOOTBRIDGE is not set
156# CONFIG_ARCH_MXC is not set
157# CONFIG_ARCH_STMP3XXX is not set
158# CONFIG_ARCH_NETX is not set
159# CONFIG_ARCH_H720X is not set
160# CONFIG_ARCH_NOMADIK is not set
161# CONFIG_ARCH_IOP13XX is not set
162# CONFIG_ARCH_IOP32X is not set
163# CONFIG_ARCH_IOP33X is not set
164# CONFIG_ARCH_IXP23XX is not set
165# CONFIG_ARCH_IXP2000 is not set
166# CONFIG_ARCH_IXP4XX is not set
167# CONFIG_ARCH_L7200 is not set
168# CONFIG_ARCH_KIRKWOOD is not set
169# CONFIG_ARCH_LOKI is not set
170# CONFIG_ARCH_MV78XX0 is not set
171# CONFIG_ARCH_ORION5X is not set
172# CONFIG_ARCH_MMP is not set
173# CONFIG_ARCH_KS8695 is not set
174# CONFIG_ARCH_NS9XXX is not set
175# CONFIG_ARCH_W90X900 is not set
176# CONFIG_ARCH_PNX4008 is not set
177# CONFIG_ARCH_PXA is not set
178# CONFIG_ARCH_MSM is not set
179# CONFIG_ARCH_RPC is not set
180# CONFIG_ARCH_SA1100 is not set
181# CONFIG_ARCH_S3C2410 is not set
182# CONFIG_ARCH_S3C64XX is not set
183# CONFIG_ARCH_S5PC1XX is not set
184# CONFIG_ARCH_SHARK is not set
185# CONFIG_ARCH_LH7A40X is not set
186# CONFIG_ARCH_U300 is not set
187# CONFIG_ARCH_DAVINCI is not set
188CONFIG_ARCH_OMAP=y
189# CONFIG_ARCH_BCMRING is not set
190
191#
192# TI OMAP Implementations
193#
194CONFIG_ARCH_OMAP_OTG=y
195# CONFIG_ARCH_OMAP1 is not set
196# CONFIG_ARCH_OMAP2 is not set
197CONFIG_ARCH_OMAP3=y
198# CONFIG_ARCH_OMAP4 is not set
199
200#
201# OMAP Feature Selections
202#
203# CONFIG_OMAP_DEBUG_POWERDOMAIN is not set
204# CONFIG_OMAP_DEBUG_CLOCKDOMAIN is not set
205CONFIG_OMAP_RESET_CLOCKS=y
206CONFIG_OMAP_MUX=y
207# CONFIG_OMAP_MUX_DEBUG is not set
208CONFIG_OMAP_MUX_WARNINGS=y
209CONFIG_OMAP_MCBSP=y
210# CONFIG_OMAP_MBOX_FWK is not set
211# CONFIG_OMAP_MPU_TIMER is not set
212CONFIG_OMAP_32K_TIMER=y
213CONFIG_OMAP_32K_TIMER_HZ=128
214CONFIG_OMAP_DM_TIMER=y
215# CONFIG_OMAP_LL_DEBUG_UART1 is not set
216# CONFIG_OMAP_LL_DEBUG_UART2 is not set
217CONFIG_OMAP_LL_DEBUG_UART3=y
218# CONFIG_OMAP_PM_NONE is not set
219CONFIG_OMAP_PM_NOOP=y
220CONFIG_ARCH_OMAP34XX=y
221CONFIG_ARCH_OMAP3430=y
222
223#
224# OMAP Board Type
225#
226# CONFIG_MACH_OMAP3_BEAGLE is not set
227# CONFIG_MACH_OMAP_LDP is not set
228# CONFIG_MACH_OVERO is not set
229# CONFIG_MACH_OMAP3EVM is not set
230# CONFIG_MACH_OMAP3_PANDORA is not set
231# CONFIG_MACH_OMAP_3430SDP is not set
232# CONFIG_MACH_NOKIA_RX51 is not set
233# CONFIG_MACH_OMAP_ZOOM2 is not set
234CONFIG_MACH_CM_T35=y
235
236#
237# Processor Type
238#
239CONFIG_CPU_32=y
240CONFIG_CPU_32v6K=y
241CONFIG_CPU_V7=y
242CONFIG_CPU_32v7=y
243CONFIG_CPU_ABRT_EV7=y
244CONFIG_CPU_PABRT_V7=y
245CONFIG_CPU_CACHE_V7=y
246CONFIG_CPU_CACHE_VIPT=y
247CONFIG_CPU_COPY_V6=y
248CONFIG_CPU_TLB_V7=y
249CONFIG_CPU_HAS_ASID=y
250CONFIG_CPU_CP15=y
251CONFIG_CPU_CP15_MMU=y
252
253#
254# Processor Features
255#
256CONFIG_ARM_THUMB=y
257# CONFIG_ARM_THUMBEE is not set
258# CONFIG_CPU_ICACHE_DISABLE is not set
259# CONFIG_CPU_DCACHE_DISABLE is not set
260# CONFIG_CPU_BPREDICT_DISABLE is not set
261CONFIG_HAS_TLS_REG=y
262CONFIG_ARM_L1_CACHE_SHIFT=6
263# CONFIG_ARM_ERRATA_430973 is not set
264# CONFIG_ARM_ERRATA_458693 is not set
265# CONFIG_ARM_ERRATA_460075 is not set
266CONFIG_COMMON_CLKDEV=y
267
268#
269# Bus support
270#
271# CONFIG_PCI_SYSCALL is not set
272# CONFIG_ARCH_SUPPORTS_MSI is not set
273# CONFIG_PCCARD is not set
274
275#
276# Kernel Features
277#
278CONFIG_TICK_ONESHOT=y
279CONFIG_NO_HZ=y
280CONFIG_HIGH_RES_TIMERS=y
281CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
282CONFIG_VMSPLIT_3G=y
283# CONFIG_VMSPLIT_2G is not set
284# CONFIG_VMSPLIT_1G is not set
285CONFIG_PAGE_OFFSET=0xC0000000
286CONFIG_PREEMPT_NONE=y
287# CONFIG_PREEMPT_VOLUNTARY is not set
288# CONFIG_PREEMPT is not set
289CONFIG_HZ=128
290# CONFIG_THUMB2_KERNEL is not set
291CONFIG_AEABI=y
292CONFIG_OABI_COMPAT=y
293# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
294# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
295# CONFIG_HIGHMEM is not set
296CONFIG_SELECT_MEMORY_MODEL=y
297CONFIG_FLATMEM_MANUAL=y
298# CONFIG_DISCONTIGMEM_MANUAL is not set
299# CONFIG_SPARSEMEM_MANUAL is not set
300CONFIG_FLATMEM=y
301CONFIG_FLAT_NODE_MEM_MAP=y
302CONFIG_PAGEFLAGS_EXTENDED=y
303CONFIG_SPLIT_PTLOCK_CPUS=4
304# CONFIG_PHYS_ADDR_T_64BIT is not set
305CONFIG_ZONE_DMA_FLAG=0
306CONFIG_VIRT_TO_BUS=y
307CONFIG_HAVE_MLOCK=y
308CONFIG_HAVE_MLOCKED_PAGE_BIT=y
309# CONFIG_KSM is not set
310CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
311# CONFIG_LEDS is not set
312CONFIG_ALIGNMENT_TRAP=y
313# CONFIG_UACCESS_WITH_MEMCPY is not set
314
315#
316# Boot options
317#
318CONFIG_ZBOOT_ROM_TEXT=0x0
319CONFIG_ZBOOT_ROM_BSS=0x0
320CONFIG_CMDLINE=""
321# CONFIG_XIP_KERNEL is not set
322# CONFIG_KEXEC is not set
323
324#
325# CPU Power Management
326#
327# CONFIG_CPU_FREQ is not set
328# CONFIG_CPU_IDLE is not set
329
330#
331# Floating point emulation
332#
333
334#
335# At least one emulation must be selected
336#
337CONFIG_FPE_NWFPE=y
338# CONFIG_FPE_NWFPE_XP is not set
339# CONFIG_FPE_FASTFPE is not set
340CONFIG_VFP=y
341CONFIG_VFPv3=y
342CONFIG_NEON=y
343
344#
345# Userspace binary formats
346#
347CONFIG_BINFMT_ELF=y
348# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
349CONFIG_HAVE_AOUT=y
350# CONFIG_BINFMT_AOUT is not set
351CONFIG_BINFMT_MISC=y
352
353#
354# Power management options
355#
356CONFIG_PM=y
357# CONFIG_PM_DEBUG is not set
358CONFIG_PM_SLEEP=y
359CONFIG_SUSPEND=y
360CONFIG_SUSPEND_FREEZER=y
361# CONFIG_APM_EMULATION is not set
362# CONFIG_PM_RUNTIME is not set
363CONFIG_ARCH_SUSPEND_POSSIBLE=y
364CONFIG_NET=y
365
366#
367# Networking options
368#
369CONFIG_PACKET=y
370# CONFIG_PACKET_MMAP is not set
371CONFIG_UNIX=y
372CONFIG_XFRM=y
373# CONFIG_XFRM_USER is not set
374# CONFIG_XFRM_SUB_POLICY is not set
375# CONFIG_XFRM_MIGRATE is not set
376# CONFIG_XFRM_STATISTICS is not set
377CONFIG_NET_KEY=y
378# CONFIG_NET_KEY_MIGRATE is not set
379CONFIG_INET=y
380# CONFIG_IP_MULTICAST is not set
381# CONFIG_IP_ADVANCED_ROUTER is not set
382CONFIG_IP_FIB_HASH=y
383CONFIG_IP_PNP=y
384CONFIG_IP_PNP_DHCP=y
385CONFIG_IP_PNP_BOOTP=y
386CONFIG_IP_PNP_RARP=y
387# CONFIG_NET_IPIP is not set
388# CONFIG_NET_IPGRE is not set
389# CONFIG_ARPD is not set
390# CONFIG_SYN_COOKIES is not set
391# CONFIG_INET_AH is not set
392# CONFIG_INET_ESP is not set
393# CONFIG_INET_IPCOMP is not set
394# CONFIG_INET_XFRM_TUNNEL is not set
395# CONFIG_INET_TUNNEL is not set
396CONFIG_INET_XFRM_MODE_TRANSPORT=y
397CONFIG_INET_XFRM_MODE_TUNNEL=y
398CONFIG_INET_XFRM_MODE_BEET=y
399# CONFIG_INET_LRO is not set
400CONFIG_INET_DIAG=y
401CONFIG_INET_TCP_DIAG=y
402# CONFIG_TCP_CONG_ADVANCED is not set
403CONFIG_TCP_CONG_CUBIC=y
404CONFIG_DEFAULT_TCP_CONG="cubic"
405# CONFIG_TCP_MD5SIG is not set
406# CONFIG_IPV6 is not set
407# CONFIG_NETWORK_SECMARK is not set
408# CONFIG_NETFILTER is not set
409# CONFIG_IP_DCCP is not set
410# CONFIG_IP_SCTP is not set
411# CONFIG_RDS is not set
412# CONFIG_TIPC is not set
413# CONFIG_ATM is not set
414# CONFIG_BRIDGE is not set
415# CONFIG_NET_DSA is not set
416# CONFIG_VLAN_8021Q is not set
417# CONFIG_DECNET is not set
418# CONFIG_LLC2 is not set
419# CONFIG_IPX is not set
420# CONFIG_ATALK is not set
421# CONFIG_X25 is not set
422# CONFIG_LAPB is not set
423# CONFIG_ECONET is not set
424# CONFIG_WAN_ROUTER is not set
425# CONFIG_PHONET is not set
426# CONFIG_IEEE802154 is not set
427# CONFIG_NET_SCHED is not set
428# CONFIG_DCB is not set
429
430#
431# Network testing
432#
433# CONFIG_NET_PKTGEN is not set
434# CONFIG_HAMRADIO is not set
435# CONFIG_CAN is not set
436# CONFIG_IRDA is not set
437# CONFIG_BT is not set
438# CONFIG_AF_RXRPC is not set
439CONFIG_WIRELESS=y
440# CONFIG_CFG80211 is not set
441CONFIG_CFG80211_DEFAULT_PS_VALUE=0
442# CONFIG_WIRELESS_OLD_REGULATORY is not set
443CONFIG_WIRELESS_EXT=y
444CONFIG_WIRELESS_EXT_SYSFS=y
445CONFIG_LIB80211=m
446# CONFIG_LIB80211_DEBUG is not set
447
448#
449# CFG80211 needs to be enabled for MAC80211
450#
451# CONFIG_WIMAX is not set
452# CONFIG_RFKILL is not set
453# CONFIG_NET_9P is not set
454
455#
456# Device Drivers
457#
458
459#
460# Generic Driver Options
461#
462CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
463# CONFIG_DEVTMPFS is not set
464CONFIG_STANDALONE=y
465CONFIG_PREVENT_FIRMWARE_BUILD=y
466CONFIG_FW_LOADER=m
467CONFIG_FIRMWARE_IN_KERNEL=y
468CONFIG_EXTRA_FIRMWARE=""
469# CONFIG_DEBUG_DRIVER is not set
470# CONFIG_DEBUG_DEVRES is not set
471# CONFIG_SYS_HYPERVISOR is not set
472# CONFIG_CONNECTOR is not set
473CONFIG_MTD=y
474# CONFIG_MTD_DEBUG is not set
475# CONFIG_MTD_TESTS is not set
476CONFIG_MTD_CONCAT=y
477CONFIG_MTD_PARTITIONS=y
478# CONFIG_MTD_REDBOOT_PARTS is not set
479CONFIG_MTD_CMDLINE_PARTS=y
480# CONFIG_MTD_AFS_PARTS is not set
481# CONFIG_MTD_AR7_PARTS is not set
482
483#
484# User Modules And Translation Layers
485#
486CONFIG_MTD_CHAR=y
487CONFIG_MTD_BLKDEVS=y
488CONFIG_MTD_BLOCK=y
489# CONFIG_FTL is not set
490# CONFIG_NFTL is not set
491# CONFIG_INFTL is not set
492# CONFIG_RFD_FTL is not set
493# CONFIG_SSFDC is not set
494# CONFIG_MTD_OOPS is not set
495
496#
497# RAM/ROM/Flash chip drivers
498#
499CONFIG_MTD_CFI=y
500# CONFIG_MTD_JEDECPROBE is not set
501CONFIG_MTD_GEN_PROBE=y
502# CONFIG_MTD_CFI_ADV_OPTIONS is not set
503CONFIG_MTD_MAP_BANK_WIDTH_1=y
504CONFIG_MTD_MAP_BANK_WIDTH_2=y
505CONFIG_MTD_MAP_BANK_WIDTH_4=y
506# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
507# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
508# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
509CONFIG_MTD_CFI_I1=y
510CONFIG_MTD_CFI_I2=y
511# CONFIG_MTD_CFI_I4 is not set
512# CONFIG_MTD_CFI_I8 is not set
513CONFIG_MTD_CFI_INTELEXT=y
514# CONFIG_MTD_CFI_AMDSTD is not set
515# CONFIG_MTD_CFI_STAA is not set
516CONFIG_MTD_CFI_UTIL=y
517# CONFIG_MTD_RAM is not set
518# CONFIG_MTD_ROM is not set
519# CONFIG_MTD_ABSENT is not set
520
521#
522# Mapping drivers for chip access
523#
524# CONFIG_MTD_COMPLEX_MAPPINGS is not set
525# CONFIG_MTD_PHYSMAP is not set
526# CONFIG_MTD_ARM_INTEGRATOR is not set
527# CONFIG_MTD_OMAP_NOR is not set
528# CONFIG_MTD_PLATRAM is not set
529
530#
531# Self-contained MTD device drivers
532#
533# CONFIG_MTD_DATAFLASH is not set
534# CONFIG_MTD_M25P80 is not set
535# CONFIG_MTD_SST25L is not set
536# CONFIG_MTD_SLRAM is not set
537# CONFIG_MTD_PHRAM is not set
538# CONFIG_MTD_MTDRAM is not set
539# CONFIG_MTD_BLOCK2MTD is not set
540
541#
542# Disk-On-Chip Device Drivers
543#
544# CONFIG_MTD_DOC2000 is not set
545# CONFIG_MTD_DOC2001 is not set
546# CONFIG_MTD_DOC2001PLUS is not set
547CONFIG_MTD_NAND=y
548# CONFIG_MTD_NAND_VERIFY_WRITE is not set
549# CONFIG_MTD_NAND_ECC_SMC is not set
550# CONFIG_MTD_NAND_MUSEUM_IDS is not set
551# CONFIG_MTD_NAND_GPIO is not set
552CONFIG_MTD_NAND_OMAP2=y
553CONFIG_MTD_NAND_OMAP_PREFETCH=y
554# CONFIG_MTD_NAND_OMAP_PREFETCH_DMA is not set
555CONFIG_MTD_NAND_IDS=y
556# CONFIG_MTD_NAND_DISKONCHIP is not set
557# CONFIG_MTD_NAND_NANDSIM is not set
558# CONFIG_MTD_NAND_PLATFORM is not set
559# CONFIG_MTD_ALAUDA is not set
560# CONFIG_MTD_ONENAND is not set
561
562#
563# LPDDR flash memory drivers
564#
565# CONFIG_MTD_LPDDR is not set
566
567#
568# UBI - Unsorted block images
569#
570# CONFIG_MTD_UBI is not set
571# CONFIG_PARPORT is not set
572CONFIG_BLK_DEV=y
573# CONFIG_BLK_DEV_COW_COMMON is not set
574CONFIG_BLK_DEV_LOOP=y
575# CONFIG_BLK_DEV_CRYPTOLOOP is not set
576# CONFIG_BLK_DEV_NBD is not set
577# CONFIG_BLK_DEV_UB is not set
578CONFIG_BLK_DEV_RAM=y
579CONFIG_BLK_DEV_RAM_COUNT=16
580CONFIG_BLK_DEV_RAM_SIZE=16384
581# CONFIG_BLK_DEV_XIP is not set
582# CONFIG_CDROM_PKTCDVD is not set
583# CONFIG_ATA_OVER_ETH is not set
584# CONFIG_MG_DISK is not set
585CONFIG_MISC_DEVICES=y
586# CONFIG_ICS932S401 is not set
587# CONFIG_ENCLOSURE_SERVICES is not set
588# CONFIG_ISL29003 is not set
589# CONFIG_C2PORT is not set
590
591#
592# EEPROM support
593#
594# CONFIG_EEPROM_AT24 is not set
595# CONFIG_EEPROM_AT25 is not set
596# CONFIG_EEPROM_LEGACY is not set
597# CONFIG_EEPROM_MAX6875 is not set
598# CONFIG_EEPROM_93CX6 is not set
599CONFIG_HAVE_IDE=y
600# CONFIG_IDE is not set
601
602#
603# SCSI device support
604#
605# CONFIG_RAID_ATTRS is not set
606CONFIG_SCSI=y
607CONFIG_SCSI_DMA=y
608# CONFIG_SCSI_TGT is not set
609# CONFIG_SCSI_NETLINK is not set
610CONFIG_SCSI_PROC_FS=y
611
612#
613# SCSI support type (disk, tape, CD-ROM)
614#
615CONFIG_BLK_DEV_SD=y
616# CONFIG_CHR_DEV_ST is not set
617# CONFIG_CHR_DEV_OSST is not set
618# CONFIG_BLK_DEV_SR is not set
619# CONFIG_CHR_DEV_SG is not set
620# CONFIG_CHR_DEV_SCH is not set
621# CONFIG_SCSI_MULTI_LUN is not set
622# CONFIG_SCSI_CONSTANTS is not set
623# CONFIG_SCSI_LOGGING is not set
624# CONFIG_SCSI_SCAN_ASYNC is not set
625CONFIG_SCSI_WAIT_SCAN=m
626
627#
628# SCSI Transports
629#
630# CONFIG_SCSI_SPI_ATTRS is not set
631# CONFIG_SCSI_FC_ATTRS is not set
632# CONFIG_SCSI_ISCSI_ATTRS is not set
633# CONFIG_SCSI_SAS_LIBSAS is not set
634# CONFIG_SCSI_SRP_ATTRS is not set
635CONFIG_SCSI_LOWLEVEL=y
636# CONFIG_ISCSI_TCP is not set
637# CONFIG_LIBFC is not set
638# CONFIG_LIBFCOE is not set
639# CONFIG_SCSI_DEBUG is not set
640# CONFIG_SCSI_DH is not set
641# CONFIG_SCSI_OSD_INITIATOR is not set
642# CONFIG_ATA is not set
643# CONFIG_MD is not set
644CONFIG_NETDEVICES=y
645# CONFIG_DUMMY is not set
646# CONFIG_BONDING is not set
647# CONFIG_MACVLAN is not set
648# CONFIG_EQUALIZER is not set
649# CONFIG_TUN is not set
650# CONFIG_VETH is not set
651CONFIG_PHYLIB=y
652
653#
654# MII PHY device drivers
655#
656# CONFIG_MARVELL_PHY is not set
657# CONFIG_DAVICOM_PHY is not set
658# CONFIG_QSEMI_PHY is not set
659# CONFIG_LXT_PHY is not set
660# CONFIG_CICADA_PHY is not set
661# CONFIG_VITESSE_PHY is not set
662# CONFIG_SMSC_PHY is not set
663# CONFIG_BROADCOM_PHY is not set
664# CONFIG_ICPLUS_PHY is not set
665# CONFIG_REALTEK_PHY is not set
666# CONFIG_NATIONAL_PHY is not set
667# CONFIG_STE10XP is not set
668# CONFIG_LSI_ET1011C_PHY is not set
669# CONFIG_FIXED_PHY is not set
670# CONFIG_MDIO_BITBANG is not set
671CONFIG_NET_ETHERNET=y
672CONFIG_MII=y
673# CONFIG_AX88796 is not set
674# CONFIG_SMC91X is not set
675# CONFIG_DM9000 is not set
676# CONFIG_ENC28J60 is not set
677# CONFIG_ETHOC is not set
678# CONFIG_SMC911X is not set
679CONFIG_SMSC911X=y
680# CONFIG_DNET is not set
681# CONFIG_IBM_NEW_EMAC_ZMII is not set
682# CONFIG_IBM_NEW_EMAC_RGMII is not set
683# CONFIG_IBM_NEW_EMAC_TAH is not set
684# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
685# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
686# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
687# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
688# CONFIG_B44 is not set
689# CONFIG_KS8842 is not set
690# CONFIG_KS8851 is not set
691# CONFIG_KS8851_MLL is not set
692# CONFIG_NETDEV_1000 is not set
693# CONFIG_NETDEV_10000 is not set
694CONFIG_WLAN=y
695# CONFIG_WLAN_PRE80211 is not set
696CONFIG_WLAN_80211=y
697CONFIG_LIBERTAS=m
698# CONFIG_LIBERTAS_USB is not set
699CONFIG_LIBERTAS_SDIO=m
700# CONFIG_LIBERTAS_SPI is not set
701# CONFIG_LIBERTAS_DEBUG is not set
702# CONFIG_USB_ZD1201 is not set
703# CONFIG_HOSTAP is not set
704
705#
706# Enable WiMAX (Networking options) to see the WiMAX drivers
707#
708
709#
710# USB Network Adapters
711#
712# CONFIG_USB_CATC is not set
713# CONFIG_USB_KAWETH is not set
714# CONFIG_USB_PEGASUS is not set
715# CONFIG_USB_RTL8150 is not set
716# CONFIG_USB_USBNET is not set
717# CONFIG_WAN is not set
718# CONFIG_PPP is not set
719# CONFIG_SLIP is not set
720# CONFIG_NETCONSOLE is not set
721# CONFIG_NETPOLL is not set
722# CONFIG_NET_POLL_CONTROLLER is not set
723# CONFIG_ISDN is not set
724# CONFIG_PHONE is not set
725
726#
727# Input device support
728#
729CONFIG_INPUT=y
730# CONFIG_INPUT_FF_MEMLESS is not set
731# CONFIG_INPUT_POLLDEV is not set
732
733#
734# Userland interfaces
735#
736CONFIG_INPUT_MOUSEDEV=y
737CONFIG_INPUT_MOUSEDEV_PSAUX=y
738CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
739CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
740# CONFIG_INPUT_JOYDEV is not set
741CONFIG_INPUT_EVDEV=y
742# CONFIG_INPUT_EVBUG is not set
743
744#
745# Input Device Drivers
746#
747CONFIG_INPUT_KEYBOARD=y
748# CONFIG_KEYBOARD_ADP5588 is not set
749CONFIG_KEYBOARD_ATKBD=y
750# CONFIG_QT2160 is not set
751# CONFIG_KEYBOARD_LKKBD is not set
752# CONFIG_KEYBOARD_GPIO is not set
753# CONFIG_KEYBOARD_MATRIX is not set
754# CONFIG_KEYBOARD_LM8323 is not set
755# CONFIG_KEYBOARD_MAX7359 is not set
756# CONFIG_KEYBOARD_NEWTON is not set
757# CONFIG_KEYBOARD_OPENCORES is not set
758# CONFIG_KEYBOARD_STOWAWAY is not set
759# CONFIG_KEYBOARD_SUNKBD is not set
760CONFIG_KEYBOARD_TWL4030=m
761# CONFIG_KEYBOARD_XTKBD is not set
762# CONFIG_INPUT_MOUSE is not set
763# CONFIG_INPUT_JOYSTICK is not set
764# CONFIG_INPUT_TABLET is not set
765CONFIG_INPUT_TOUCHSCREEN=y
766CONFIG_TOUCHSCREEN_ADS7846=m
767# CONFIG_TOUCHSCREEN_AD7877 is not set
768# CONFIG_TOUCHSCREEN_AD7879_I2C is not set
769# CONFIG_TOUCHSCREEN_AD7879_SPI is not set
770# CONFIG_TOUCHSCREEN_AD7879 is not set
771# CONFIG_TOUCHSCREEN_EETI is not set
772# CONFIG_TOUCHSCREEN_FUJITSU is not set
773# CONFIG_TOUCHSCREEN_GUNZE is not set
774# CONFIG_TOUCHSCREEN_ELO is not set
775# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
776# CONFIG_TOUCHSCREEN_MCS5000 is not set
777# CONFIG_TOUCHSCREEN_MTOUCH is not set
778# CONFIG_TOUCHSCREEN_INEXIO is not set
779# CONFIG_TOUCHSCREEN_MK712 is not set
780# CONFIG_TOUCHSCREEN_PENMOUNT is not set
781# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
782# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
783# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
784# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
785# CONFIG_TOUCHSCREEN_TSC2007 is not set
786# CONFIG_TOUCHSCREEN_W90X900 is not set
787# CONFIG_INPUT_MISC is not set
788
789#
790# Hardware I/O ports
791#
792CONFIG_SERIO=y
793CONFIG_SERIO_SERPORT=y
794CONFIG_SERIO_LIBPS2=y
795# CONFIG_SERIO_RAW is not set
796# CONFIG_GAMEPORT is not set
797
798#
799# Character devices
800#
801CONFIG_VT=y
802CONFIG_CONSOLE_TRANSLATIONS=y
803CONFIG_VT_CONSOLE=y
804CONFIG_HW_CONSOLE=y
805# CONFIG_VT_HW_CONSOLE_BINDING is not set
806CONFIG_DEVKMEM=y
807# CONFIG_SERIAL_NONSTANDARD is not set
808
809#
810# Serial drivers
811#
812CONFIG_SERIAL_8250=y
813CONFIG_SERIAL_8250_CONSOLE=y
814CONFIG_SERIAL_8250_NR_UARTS=32
815CONFIG_SERIAL_8250_RUNTIME_UARTS=4
816CONFIG_SERIAL_8250_EXTENDED=y
817CONFIG_SERIAL_8250_MANY_PORTS=y
818CONFIG_SERIAL_8250_SHARE_IRQ=y
819CONFIG_SERIAL_8250_DETECT_IRQ=y
820CONFIG_SERIAL_8250_RSA=y
821
822#
823# Non-8250 serial port support
824#
825# CONFIG_SERIAL_MAX3100 is not set
826CONFIG_SERIAL_CORE=y
827CONFIG_SERIAL_CORE_CONSOLE=y
828CONFIG_UNIX98_PTYS=y
829# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
830# CONFIG_LEGACY_PTYS is not set
831# CONFIG_IPMI_HANDLER is not set
832CONFIG_HW_RANDOM=y
833# CONFIG_HW_RANDOM_TIMERIOMEM is not set
834# CONFIG_R3964 is not set
835# CONFIG_RAW_DRIVER is not set
836# CONFIG_TCG_TPM is not set
837CONFIG_I2C=y
838CONFIG_I2C_BOARDINFO=y
839CONFIG_I2C_COMPAT=y
840CONFIG_I2C_CHARDEV=y
841CONFIG_I2C_HELPER_AUTO=y
842
843#
844# I2C Hardware Bus support
845#
846
847#
848# I2C system bus drivers (mostly embedded / system-on-chip)
849#
850# CONFIG_I2C_DESIGNWARE is not set
851# CONFIG_I2C_GPIO is not set
852# CONFIG_I2C_OCORES is not set
853CONFIG_I2C_OMAP=y
854# CONFIG_I2C_SIMTEC is not set
855
856#
857# External I2C/SMBus adapter drivers
858#
859# CONFIG_I2C_PARPORT_LIGHT is not set
860# CONFIG_I2C_TAOS_EVM is not set
861# CONFIG_I2C_TINY_USB is not set
862
863#
864# Other I2C/SMBus bus drivers
865#
866# CONFIG_I2C_PCA_PLATFORM is not set
867# CONFIG_I2C_STUB is not set
868
869#
870# Miscellaneous I2C Chip support
871#
872# CONFIG_DS1682 is not set
873# CONFIG_SENSORS_TSL2550 is not set
874# CONFIG_I2C_DEBUG_CORE is not set
875# CONFIG_I2C_DEBUG_ALGO is not set
876# CONFIG_I2C_DEBUG_BUS is not set
877# CONFIG_I2C_DEBUG_CHIP is not set
878CONFIG_SPI=y
879# CONFIG_SPI_DEBUG is not set
880CONFIG_SPI_MASTER=y
881
882#
883# SPI Master Controller Drivers
884#
885# CONFIG_SPI_BITBANG is not set
886# CONFIG_SPI_GPIO is not set
887CONFIG_SPI_OMAP24XX=y
888
889#
890# SPI Protocol Masters
891#
892# CONFIG_SPI_SPIDEV is not set
893# CONFIG_SPI_TLE62X0 is not set
894
895#
896# PPS support
897#
898# CONFIG_PPS is not set
899CONFIG_ARCH_REQUIRE_GPIOLIB=y
900CONFIG_GPIOLIB=y
901# CONFIG_DEBUG_GPIO is not set
902CONFIG_GPIO_SYSFS=y
903
904#
905# Memory mapped GPIO expanders:
906#
907
908#
909# I2C GPIO expanders:
910#
911# CONFIG_GPIO_MAX732X is not set
912# CONFIG_GPIO_PCA953X is not set
913# CONFIG_GPIO_PCF857X is not set
914CONFIG_GPIO_TWL4030=y
915
916#
917# PCI GPIO expanders:
918#
919
920#
921# SPI GPIO expanders:
922#
923# CONFIG_GPIO_MAX7301 is not set
924# CONFIG_GPIO_MCP23S08 is not set
925# CONFIG_GPIO_MC33880 is not set
926
927#
928# AC97 GPIO expanders:
929#
930# CONFIG_W1 is not set
931# CONFIG_POWER_SUPPLY is not set
932# CONFIG_HWMON is not set
933# CONFIG_THERMAL is not set
934CONFIG_WATCHDOG=y
935CONFIG_WATCHDOG_NOWAYOUT=y
936
937#
938# Watchdog Device Drivers
939#
940# CONFIG_SOFT_WATCHDOG is not set
941CONFIG_OMAP_WATCHDOG=y
942# CONFIG_TWL4030_WATCHDOG is not set
943
944#
945# USB-based Watchdog Cards
946#
947# CONFIG_USBPCWATCHDOG is not set
948CONFIG_SSB_POSSIBLE=y
949
950#
951# Sonics Silicon Backplane
952#
953# CONFIG_SSB is not set
954
955#
956# Multifunction device drivers
957#
958# CONFIG_MFD_CORE is not set
959# CONFIG_MFD_SM501 is not set
960# CONFIG_MFD_ASIC3 is not set
961# CONFIG_HTC_EGPIO is not set
962# CONFIG_HTC_PASIC3 is not set
963# CONFIG_TPS65010 is not set
964CONFIG_TWL4030_CORE=y
965# CONFIG_TWL4030_POWER is not set
966# CONFIG_MFD_TMIO is not set
967# CONFIG_MFD_T7L66XB is not set
968# CONFIG_MFD_TC6387XB is not set
969# CONFIG_MFD_TC6393XB is not set
970# CONFIG_PMIC_DA903X is not set
971# CONFIG_MFD_WM8400 is not set
972# CONFIG_MFD_WM831X is not set
973# CONFIG_MFD_WM8350_I2C is not set
974# CONFIG_MFD_PCF50633 is not set
975# CONFIG_MFD_MC13783 is not set
976# CONFIG_AB3100_CORE is not set
977# CONFIG_EZX_PCAP is not set
978CONFIG_REGULATOR=y
979# CONFIG_REGULATOR_DEBUG is not set
980# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
981# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
982# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set
983# CONFIG_REGULATOR_BQ24022 is not set
984# CONFIG_REGULATOR_MAX1586 is not set
985CONFIG_REGULATOR_TWL4030=y
986# CONFIG_REGULATOR_LP3971 is not set
987# CONFIG_REGULATOR_TPS65023 is not set
988# CONFIG_REGULATOR_TPS6507X is not set
989# CONFIG_MEDIA_SUPPORT is not set
990
991#
992# Graphics support
993#
994# CONFIG_VGASTATE is not set
995# CONFIG_VIDEO_OUTPUT_CONTROL is not set
996# CONFIG_FB is not set
997# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
998
999#
1000# Display device support
1001#
1002# CONFIG_DISPLAY_SUPPORT is not set
1003
1004#
1005# Console display driver support
1006#
1007# CONFIG_VGA_CONSOLE is not set
1008CONFIG_DUMMY_CONSOLE=y
1009# CONFIG_SOUND is not set
1010CONFIG_HID_SUPPORT=y
1011CONFIG_HID=y
1012# CONFIG_HIDRAW is not set
1013
1014#
1015# USB Input Devices
1016#
1017CONFIG_USB_HID=y
1018# CONFIG_HID_PID is not set
1019# CONFIG_USB_HIDDEV is not set
1020
1021#
1022# Special HID drivers
1023#
1024# CONFIG_HID_A4TECH is not set
1025# CONFIG_HID_APPLE is not set
1026# CONFIG_HID_BELKIN is not set
1027# CONFIG_HID_CHERRY is not set
1028# CONFIG_HID_CHICONY is not set
1029# CONFIG_HID_CYPRESS is not set
1030# CONFIG_HID_DRAGONRISE is not set
1031# CONFIG_HID_EZKEY is not set
1032# CONFIG_HID_KYE is not set
1033# CONFIG_HID_GYRATION is not set
1034# CONFIG_HID_TWINHAN is not set
1035# CONFIG_HID_KENSINGTON is not set
1036# CONFIG_HID_LOGITECH is not set
1037# CONFIG_HID_MICROSOFT is not set
1038# CONFIG_HID_MONTEREY is not set
1039# CONFIG_HID_NTRIG is not set
1040# CONFIG_HID_PANTHERLORD is not set
1041# CONFIG_HID_PETALYNX is not set
1042# CONFIG_HID_SAMSUNG is not set
1043# CONFIG_HID_SONY is not set
1044# CONFIG_HID_SUNPLUS is not set
1045# CONFIG_HID_GREENASIA is not set
1046# CONFIG_HID_SMARTJOYPLUS is not set
1047# CONFIG_HID_TOPSEED is not set
1048# CONFIG_HID_THRUSTMASTER is not set
1049# CONFIG_HID_ZEROPLUS is not set
1050CONFIG_USB_SUPPORT=y
1051CONFIG_USB_ARCH_HAS_HCD=y
1052CONFIG_USB_ARCH_HAS_OHCI=y
1053CONFIG_USB_ARCH_HAS_EHCI=y
1054CONFIG_USB=y
1055# CONFIG_USB_DEBUG is not set
1056CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
1057
1058#
1059# Miscellaneous USB options
1060#
1061CONFIG_USB_DEVICEFS=y
1062# CONFIG_USB_DEVICE_CLASS is not set
1063# CONFIG_USB_DYNAMIC_MINORS is not set
1064CONFIG_USB_SUSPEND=y
1065CONFIG_USB_OTG=y
1066# CONFIG_USB_OTG_WHITELIST is not set
1067# CONFIG_USB_OTG_BLACKLIST_HUB is not set
1068CONFIG_USB_MON=y
1069# CONFIG_USB_WUSB is not set
1070# CONFIG_USB_WUSB_CBAF is not set
1071
1072#
1073# USB Host Controller Drivers
1074#
1075# CONFIG_USB_C67X00_HCD is not set
1076CONFIG_USB_EHCI_HCD=y
1077# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
1078# CONFIG_USB_EHCI_TT_NEWSCHED is not set
1079# CONFIG_USB_OXU210HP_HCD is not set
1080# CONFIG_USB_ISP116X_HCD is not set
1081# CONFIG_USB_ISP1760_HCD is not set
1082# CONFIG_USB_ISP1362_HCD is not set
1083# CONFIG_USB_OHCI_HCD is not set
1084# CONFIG_USB_SL811_HCD is not set
1085# CONFIG_USB_R8A66597_HCD is not set
1086# CONFIG_USB_HWA_HCD is not set
1087CONFIG_USB_MUSB_HDRC=y
1088CONFIG_USB_MUSB_SOC=y
1089
1090#
1091# OMAP 343x high speed USB support
1092#
1093# CONFIG_USB_MUSB_HOST is not set
1094# CONFIG_USB_MUSB_PERIPHERAL is not set
1095CONFIG_USB_MUSB_OTG=y
1096CONFIG_USB_GADGET_MUSB_HDRC=y
1097CONFIG_USB_MUSB_HDRC_HCD=y
1098# CONFIG_MUSB_PIO_ONLY is not set
1099CONFIG_USB_INVENTRA_DMA=y
1100# CONFIG_USB_TI_CPPI_DMA is not set
1101# CONFIG_USB_MUSB_DEBUG is not set
1102
1103#
1104# USB Device Class drivers
1105#
1106# CONFIG_USB_ACM is not set
1107# CONFIG_USB_PRINTER is not set
1108# CONFIG_USB_WDM is not set
1109# CONFIG_USB_TMC is not set
1110
1111#
1112# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
1113#
1114
1115#
1116# also be needed; see USB_STORAGE Help for more info
1117#
1118CONFIG_USB_STORAGE=y
1119# CONFIG_USB_STORAGE_DEBUG is not set
1120# CONFIG_USB_STORAGE_DATAFAB is not set
1121# CONFIG_USB_STORAGE_FREECOM is not set
1122# CONFIG_USB_STORAGE_ISD200 is not set
1123# CONFIG_USB_STORAGE_USBAT is not set
1124# CONFIG_USB_STORAGE_SDDR09 is not set
1125# CONFIG_USB_STORAGE_SDDR55 is not set
1126# CONFIG_USB_STORAGE_JUMPSHOT is not set
1127# CONFIG_USB_STORAGE_ALAUDA is not set
1128# CONFIG_USB_STORAGE_ONETOUCH is not set
1129# CONFIG_USB_STORAGE_KARMA is not set
1130# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
1131# CONFIG_USB_LIBUSUAL is not set
1132
1133#
1134# USB Imaging devices
1135#
1136# CONFIG_USB_MDC800 is not set
1137# CONFIG_USB_MICROTEK is not set
1138
1139#
1140# USB port drivers
1141#
1142# CONFIG_USB_SERIAL is not set
1143
1144#
1145# USB Miscellaneous drivers
1146#
1147# CONFIG_USB_EMI62 is not set
1148# CONFIG_USB_EMI26 is not set
1149# CONFIG_USB_ADUTUX is not set
1150# CONFIG_USB_SEVSEG is not set
1151# CONFIG_USB_RIO500 is not set
1152# CONFIG_USB_LEGOTOWER is not set
1153# CONFIG_USB_LCD is not set
1154# CONFIG_USB_BERRY_CHARGE is not set
1155# CONFIG_USB_LED is not set
1156# CONFIG_USB_CYPRESS_CY7C63 is not set
1157# CONFIG_USB_CYTHERM is not set
1158# CONFIG_USB_IDMOUSE is not set
1159# CONFIG_USB_FTDI_ELAN is not set
1160# CONFIG_USB_APPLEDISPLAY is not set
1161# CONFIG_USB_SISUSBVGA is not set
1162# CONFIG_USB_LD is not set
1163# CONFIG_USB_TRANCEVIBRATOR is not set
1164# CONFIG_USB_IOWARRIOR is not set
1165CONFIG_USB_TEST=y
1166# CONFIG_USB_ISIGHTFW is not set
1167# CONFIG_USB_VST is not set
1168CONFIG_USB_GADGET=y
1169# CONFIG_USB_GADGET_DEBUG is not set
1170# CONFIG_USB_GADGET_DEBUG_FILES is not set
1171# CONFIG_USB_GADGET_DEBUG_FS is not set
1172CONFIG_USB_GADGET_VBUS_DRAW=2
1173CONFIG_USB_GADGET_SELECTED=y
1174# CONFIG_USB_GADGET_AT91 is not set
1175# CONFIG_USB_GADGET_ATMEL_USBA is not set
1176# CONFIG_USB_GADGET_FSL_USB2 is not set
1177# CONFIG_USB_GADGET_LH7A40X is not set
1178# CONFIG_USB_GADGET_OMAP is not set
1179# CONFIG_USB_GADGET_PXA25X is not set
1180# CONFIG_USB_GADGET_R8A66597 is not set
1181# CONFIG_USB_GADGET_PXA27X is not set
1182# CONFIG_USB_GADGET_S3C_HSOTG is not set
1183# CONFIG_USB_GADGET_IMX is not set
1184# CONFIG_USB_GADGET_S3C2410 is not set
1185# CONFIG_USB_GADGET_M66592 is not set
1186# CONFIG_USB_GADGET_AMD5536UDC is not set
1187# CONFIG_USB_GADGET_FSL_QE is not set
1188# CONFIG_USB_GADGET_CI13XXX is not set
1189# CONFIG_USB_GADGET_NET2280 is not set
1190# CONFIG_USB_GADGET_GOKU is not set
1191# CONFIG_USB_GADGET_LANGWELL is not set
1192# CONFIG_USB_GADGET_DUMMY_HCD is not set
1193CONFIG_USB_GADGET_DUALSPEED=y
1194# CONFIG_USB_ZERO is not set
1195# CONFIG_USB_AUDIO is not set
1196CONFIG_USB_ETH=y
1197CONFIG_USB_ETH_RNDIS=y
1198# CONFIG_USB_ETH_EEM is not set
1199# CONFIG_USB_GADGETFS is not set
1200# CONFIG_USB_FILE_STORAGE is not set
1201# CONFIG_USB_G_SERIAL is not set
1202# CONFIG_USB_MIDI_GADGET is not set
1203# CONFIG_USB_G_PRINTER is not set
1204# CONFIG_USB_CDC_COMPOSITE is not set
1205
1206#
1207# OTG and related infrastructure
1208#
1209CONFIG_USB_OTG_UTILS=y
1210# CONFIG_USB_GPIO_VBUS is not set
1211# CONFIG_ISP1301_OMAP is not set
1212CONFIG_TWL4030_USB=y
1213# CONFIG_NOP_USB_XCEIV is not set
1214CONFIG_MMC=y
1215# CONFIG_MMC_DEBUG is not set
1216# CONFIG_MMC_UNSAFE_RESUME is not set
1217
1218#
1219# MMC/SD/SDIO Card Drivers
1220#
1221CONFIG_MMC_BLOCK=y
1222CONFIG_MMC_BLOCK_BOUNCE=y
1223# CONFIG_SDIO_UART is not set
1224# CONFIG_MMC_TEST is not set
1225
1226#
1227# MMC/SD/SDIO Host Controller Drivers
1228#
1229# CONFIG_MMC_SDHCI is not set
1230# CONFIG_MMC_OMAP is not set
1231CONFIG_MMC_OMAP_HS=y
1232# CONFIG_MMC_AT91 is not set
1233# CONFIG_MMC_ATMELMCI is not set
1234# CONFIG_MMC_SPI is not set
1235# CONFIG_MEMSTICK is not set
1236CONFIG_NEW_LEDS=y
1237CONFIG_LEDS_CLASS=y
1238
1239#
1240# LED drivers
1241#
1242# CONFIG_LEDS_PCA9532 is not set
1243CONFIG_LEDS_GPIO=y
1244CONFIG_LEDS_GPIO_PLATFORM=y
1245# CONFIG_LEDS_LP3944 is not set
1246# CONFIG_LEDS_PCA955X is not set
1247# CONFIG_LEDS_DAC124S085 is not set
1248# CONFIG_LEDS_BD2802 is not set
1249
1250#
1251# LED Triggers
1252#
1253CONFIG_LEDS_TRIGGERS=y
1254# CONFIG_LEDS_TRIGGER_TIMER is not set
1255CONFIG_LEDS_TRIGGER_HEARTBEAT=y
1256# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
1257# CONFIG_LEDS_TRIGGER_GPIO is not set
1258# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set
1259
1260#
1261# iptables trigger is under Netfilter config (LED target)
1262#
1263# CONFIG_ACCESSIBILITY is not set
1264CONFIG_RTC_LIB=y
1265CONFIG_RTC_CLASS=y
1266CONFIG_RTC_HCTOSYS=y
1267CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
1268# CONFIG_RTC_DEBUG is not set
1269
1270#
1271# RTC interfaces
1272#
1273CONFIG_RTC_INTF_SYSFS=y
1274CONFIG_RTC_INTF_PROC=y
1275CONFIG_RTC_INTF_DEV=y
1276# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
1277# CONFIG_RTC_DRV_TEST is not set
1278
1279#
1280# I2C RTC drivers
1281#
1282# CONFIG_RTC_DRV_DS1307 is not set
1283# CONFIG_RTC_DRV_DS1374 is not set
1284# CONFIG_RTC_DRV_DS1672 is not set
1285# CONFIG_RTC_DRV_MAX6900 is not set
1286# CONFIG_RTC_DRV_RS5C372 is not set
1287# CONFIG_RTC_DRV_ISL1208 is not set
1288# CONFIG_RTC_DRV_X1205 is not set
1289# CONFIG_RTC_DRV_PCF8563 is not set
1290# CONFIG_RTC_DRV_PCF8583 is not set
1291# CONFIG_RTC_DRV_M41T80 is not set
1292CONFIG_RTC_DRV_TWL4030=y
1293# CONFIG_RTC_DRV_S35390A is not set
1294# CONFIG_RTC_DRV_FM3130 is not set
1295# CONFIG_RTC_DRV_RX8581 is not set
1296# CONFIG_RTC_DRV_RX8025 is not set
1297
1298#
1299# SPI RTC drivers
1300#
1301# CONFIG_RTC_DRV_M41T94 is not set
1302# CONFIG_RTC_DRV_DS1305 is not set
1303# CONFIG_RTC_DRV_DS1390 is not set
1304# CONFIG_RTC_DRV_MAX6902 is not set
1305# CONFIG_RTC_DRV_R9701 is not set
1306# CONFIG_RTC_DRV_RS5C348 is not set
1307# CONFIG_RTC_DRV_DS3234 is not set
1308# CONFIG_RTC_DRV_PCF2123 is not set
1309
1310#
1311# Platform RTC drivers
1312#
1313# CONFIG_RTC_DRV_CMOS is not set
1314# CONFIG_RTC_DRV_DS1286 is not set
1315# CONFIG_RTC_DRV_DS1511 is not set
1316# CONFIG_RTC_DRV_DS1553 is not set
1317# CONFIG_RTC_DRV_DS1742 is not set
1318# CONFIG_RTC_DRV_STK17TA8 is not set
1319# CONFIG_RTC_DRV_M48T86 is not set
1320# CONFIG_RTC_DRV_M48T35 is not set
1321# CONFIG_RTC_DRV_M48T59 is not set
1322# CONFIG_RTC_DRV_BQ4802 is not set
1323# CONFIG_RTC_DRV_V3020 is not set
1324
1325#
1326# on-CPU RTC drivers
1327#
1328# CONFIG_DMADEVICES is not set
1329# CONFIG_AUXDISPLAY is not set
1330# CONFIG_UIO is not set
1331
1332#
1333# TI VLYNQ
1334#
1335# CONFIG_STAGING is not set
1336
1337#
1338# CBUS support
1339#
1340# CONFIG_CBUS is not set
1341
1342#
1343# File systems
1344#
1345CONFIG_EXT2_FS=y
1346# CONFIG_EXT2_FS_XATTR is not set
1347# CONFIG_EXT2_FS_XIP is not set
1348CONFIG_EXT3_FS=y
1349# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
1350# CONFIG_EXT3_FS_XATTR is not set
1351# CONFIG_EXT4_FS is not set
1352CONFIG_JBD=y
1353# CONFIG_JBD_DEBUG is not set
1354# CONFIG_REISERFS_FS is not set
1355# CONFIG_JFS_FS is not set
1356# CONFIG_FS_POSIX_ACL is not set
1357# CONFIG_XFS_FS is not set
1358# CONFIG_GFS2_FS is not set
1359# CONFIG_OCFS2_FS is not set
1360# CONFIG_BTRFS_FS is not set
1361# CONFIG_NILFS2_FS is not set
1362CONFIG_FILE_LOCKING=y
1363CONFIG_FSNOTIFY=y
1364CONFIG_DNOTIFY=y
1365CONFIG_INOTIFY=y
1366CONFIG_INOTIFY_USER=y
1367CONFIG_QUOTA=y
1368# CONFIG_QUOTA_NETLINK_INTERFACE is not set
1369CONFIG_PRINT_QUOTA_WARNING=y
1370CONFIG_QUOTA_TREE=y
1371# CONFIG_QFMT_V1 is not set
1372CONFIG_QFMT_V2=y
1373CONFIG_QUOTACTL=y
1374# CONFIG_AUTOFS_FS is not set
1375# CONFIG_AUTOFS4_FS is not set
1376# CONFIG_FUSE_FS is not set
1377
1378#
1379# Caches
1380#
1381# CONFIG_FSCACHE is not set
1382
1383#
1384# CD-ROM/DVD Filesystems
1385#
1386# CONFIG_ISO9660_FS is not set
1387# CONFIG_UDF_FS is not set
1388
1389#
1390# DOS/FAT/NT Filesystems
1391#
1392CONFIG_FAT_FS=y
1393CONFIG_MSDOS_FS=y
1394CONFIG_VFAT_FS=y
1395CONFIG_FAT_DEFAULT_CODEPAGE=437
1396CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1397CONFIG_NTFS_FS=m
1398# CONFIG_NTFS_DEBUG is not set
1399# CONFIG_NTFS_RW is not set
1400
1401#
1402# Pseudo filesystems
1403#
1404CONFIG_PROC_FS=y
1405CONFIG_PROC_SYSCTL=y
1406CONFIG_PROC_PAGE_MONITOR=y
1407CONFIG_SYSFS=y
1408CONFIG_TMPFS=y
1409# CONFIG_TMPFS_POSIX_ACL is not set
1410# CONFIG_HUGETLB_PAGE is not set
1411# CONFIG_CONFIGFS_FS is not set
1412CONFIG_MISC_FILESYSTEMS=y
1413# CONFIG_ADFS_FS is not set
1414# CONFIG_AFFS_FS is not set
1415# CONFIG_HFS_FS is not set
1416# CONFIG_HFSPLUS_FS is not set
1417# CONFIG_BEFS_FS is not set
1418# CONFIG_BFS_FS is not set
1419# CONFIG_EFS_FS is not set
1420CONFIG_JFFS2_FS=y
1421CONFIG_JFFS2_FS_DEBUG=0
1422CONFIG_JFFS2_FS_WRITEBUFFER=y
1423# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
1424CONFIG_JFFS2_SUMMARY=y
1425# CONFIG_JFFS2_FS_XATTR is not set
1426CONFIG_JFFS2_COMPRESSION_OPTIONS=y
1427CONFIG_JFFS2_ZLIB=y
1428# CONFIG_JFFS2_LZO is not set
1429CONFIG_JFFS2_RTIME=y
1430# CONFIG_JFFS2_RUBIN is not set
1431# CONFIG_JFFS2_CMODE_NONE is not set
1432CONFIG_JFFS2_CMODE_PRIORITY=y
1433# CONFIG_JFFS2_CMODE_SIZE is not set
1434# CONFIG_JFFS2_CMODE_FAVOURLZO is not set
1435# CONFIG_CRAMFS is not set
1436# CONFIG_SQUASHFS is not set
1437# CONFIG_VXFS_FS is not set
1438# CONFIG_MINIX_FS is not set
1439# CONFIG_OMFS_FS is not set
1440# CONFIG_HPFS_FS is not set
1441# CONFIG_QNX4FS_FS is not set
1442# CONFIG_ROMFS_FS is not set
1443# CONFIG_SYSV_FS is not set
1444# CONFIG_UFS_FS is not set
1445CONFIG_NETWORK_FILESYSTEMS=y
1446CONFIG_NFS_FS=y
1447CONFIG_NFS_V3=y
1448# CONFIG_NFS_V3_ACL is not set
1449CONFIG_NFS_V4=y
1450# CONFIG_NFS_V4_1 is not set
1451CONFIG_ROOT_NFS=y
1452# CONFIG_NFSD is not set
1453CONFIG_LOCKD=y
1454CONFIG_LOCKD_V4=y
1455CONFIG_NFS_COMMON=y
1456CONFIG_SUNRPC=y
1457CONFIG_SUNRPC_GSS=y
1458CONFIG_RPCSEC_GSS_KRB5=y
1459# CONFIG_RPCSEC_GSS_SPKM3 is not set
1460# CONFIG_SMB_FS is not set
1461# CONFIG_CIFS is not set
1462# CONFIG_NCP_FS is not set
1463# CONFIG_CODA_FS is not set
1464# CONFIG_AFS_FS is not set
1465
1466#
1467# Partition Types
1468#
1469CONFIG_PARTITION_ADVANCED=y
1470# CONFIG_ACORN_PARTITION is not set
1471# CONFIG_OSF_PARTITION is not set
1472# CONFIG_AMIGA_PARTITION is not set
1473# CONFIG_ATARI_PARTITION is not set
1474# CONFIG_MAC_PARTITION is not set
1475CONFIG_MSDOS_PARTITION=y
1476# CONFIG_BSD_DISKLABEL is not set
1477# CONFIG_MINIX_SUBPARTITION is not set
1478# CONFIG_SOLARIS_X86_PARTITION is not set
1479# CONFIG_UNIXWARE_DISKLABEL is not set
1480# CONFIG_LDM_PARTITION is not set
1481# CONFIG_SGI_PARTITION is not set
1482# CONFIG_ULTRIX_PARTITION is not set
1483# CONFIG_SUN_PARTITION is not set
1484# CONFIG_KARMA_PARTITION is not set
1485# CONFIG_EFI_PARTITION is not set
1486# CONFIG_SYSV68_PARTITION is not set
1487CONFIG_NLS=y
1488CONFIG_NLS_DEFAULT="iso8859-1"
1489CONFIG_NLS_CODEPAGE_437=y
1490# CONFIG_NLS_CODEPAGE_737 is not set
1491# CONFIG_NLS_CODEPAGE_775 is not set
1492# CONFIG_NLS_CODEPAGE_850 is not set
1493# CONFIG_NLS_CODEPAGE_852 is not set
1494# CONFIG_NLS_CODEPAGE_855 is not set
1495# CONFIG_NLS_CODEPAGE_857 is not set
1496# CONFIG_NLS_CODEPAGE_860 is not set
1497# CONFIG_NLS_CODEPAGE_861 is not set
1498# CONFIG_NLS_CODEPAGE_862 is not set
1499# CONFIG_NLS_CODEPAGE_863 is not set
1500# CONFIG_NLS_CODEPAGE_864 is not set
1501# CONFIG_NLS_CODEPAGE_865 is not set
1502# CONFIG_NLS_CODEPAGE_866 is not set
1503# CONFIG_NLS_CODEPAGE_869 is not set
1504# CONFIG_NLS_CODEPAGE_936 is not set
1505# CONFIG_NLS_CODEPAGE_950 is not set
1506# CONFIG_NLS_CODEPAGE_932 is not set
1507# CONFIG_NLS_CODEPAGE_949 is not set
1508# CONFIG_NLS_CODEPAGE_874 is not set
1509# CONFIG_NLS_ISO8859_8 is not set
1510# CONFIG_NLS_CODEPAGE_1250 is not set
1511# CONFIG_NLS_CODEPAGE_1251 is not set
1512# CONFIG_NLS_ASCII is not set
1513CONFIG_NLS_ISO8859_1=y
1514# CONFIG_NLS_ISO8859_2 is not set
1515# CONFIG_NLS_ISO8859_3 is not set
1516# CONFIG_NLS_ISO8859_4 is not set
1517# CONFIG_NLS_ISO8859_5 is not set
1518# CONFIG_NLS_ISO8859_6 is not set
1519# CONFIG_NLS_ISO8859_7 is not set
1520# CONFIG_NLS_ISO8859_9 is not set
1521# CONFIG_NLS_ISO8859_13 is not set
1522# CONFIG_NLS_ISO8859_14 is not set
1523# CONFIG_NLS_ISO8859_15 is not set
1524# CONFIG_NLS_KOI8_R is not set
1525# CONFIG_NLS_KOI8_U is not set
1526CONFIG_NLS_UTF8=m
1527# CONFIG_DLM is not set
1528
1529#
1530# Kernel hacking
1531#
1532# CONFIG_PRINTK_TIME is not set
1533CONFIG_ENABLE_WARN_DEPRECATED=y
1534CONFIG_ENABLE_MUST_CHECK=y
1535CONFIG_FRAME_WARN=1024
1536CONFIG_MAGIC_SYSRQ=y
1537# CONFIG_STRIP_ASM_SYMS is not set
1538# CONFIG_UNUSED_SYMBOLS is not set
1539CONFIG_DEBUG_FS=y
1540# CONFIG_HEADERS_CHECK is not set
1541CONFIG_DEBUG_KERNEL=y
1542# CONFIG_DEBUG_SHIRQ is not set
1543CONFIG_DETECT_SOFTLOCKUP=y
1544# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1545CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
1546CONFIG_DETECT_HUNG_TASK=y
1547# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
1548CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
1549# CONFIG_SCHED_DEBUG is not set
1550# CONFIG_SCHEDSTATS is not set
1551# CONFIG_TIMER_STATS is not set
1552# CONFIG_DEBUG_OBJECTS is not set
1553# CONFIG_DEBUG_SLAB is not set
1554# CONFIG_DEBUG_KMEMLEAK is not set
1555# CONFIG_DEBUG_RT_MUTEXES is not set
1556# CONFIG_RT_MUTEX_TESTER is not set
1557# CONFIG_DEBUG_SPINLOCK is not set
1558CONFIG_DEBUG_MUTEXES=y
1559# CONFIG_DEBUG_LOCK_ALLOC is not set
1560# CONFIG_PROVE_LOCKING is not set
1561# CONFIG_LOCK_STAT is not set
1562# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1563# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1564# CONFIG_DEBUG_KOBJECT is not set
1565# CONFIG_DEBUG_BUGVERBOSE is not set
1566CONFIG_DEBUG_INFO=y
1567# CONFIG_DEBUG_VM is not set
1568# CONFIG_DEBUG_WRITECOUNT is not set
1569# CONFIG_DEBUG_MEMORY_INIT is not set
1570# CONFIG_DEBUG_LIST is not set
1571# CONFIG_DEBUG_SG is not set
1572# CONFIG_DEBUG_NOTIFIERS is not set
1573# CONFIG_DEBUG_CREDENTIALS is not set
1574# CONFIG_BOOT_PRINTK_DELAY is not set
1575# CONFIG_RCU_TORTURE_TEST is not set
1576# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1577# CONFIG_BACKTRACE_SELF_TEST is not set
1578# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1579# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
1580# CONFIG_FAULT_INJECTION is not set
1581# CONFIG_LATENCYTOP is not set
1582# CONFIG_PAGE_POISONING is not set
1583CONFIG_HAVE_FUNCTION_TRACER=y
1584CONFIG_TRACING_SUPPORT=y
1585CONFIG_FTRACE=y
1586# CONFIG_FUNCTION_TRACER is not set
1587# CONFIG_IRQSOFF_TRACER is not set
1588# CONFIG_SCHED_TRACER is not set
1589# CONFIG_ENABLE_DEFAULT_TRACERS is not set
1590# CONFIG_BOOT_TRACER is not set
1591CONFIG_BRANCH_PROFILE_NONE=y
1592# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1593# CONFIG_PROFILE_ALL_BRANCHES is not set
1594# CONFIG_STACK_TRACER is not set
1595# CONFIG_KMEMTRACE is not set
1596# CONFIG_WORKQUEUE_TRACER is not set
1597# CONFIG_BLK_DEV_IO_TRACE is not set
1598# CONFIG_DYNAMIC_DEBUG is not set
1599# CONFIG_SAMPLES is not set
1600CONFIG_HAVE_ARCH_KGDB=y
1601# CONFIG_KGDB is not set
1602CONFIG_ARM_UNWIND=y
1603# CONFIG_DEBUG_USER is not set
1604# CONFIG_DEBUG_ERRORS is not set
1605# CONFIG_DEBUG_STACK_USAGE is not set
1606CONFIG_DEBUG_LL=y
1607# CONFIG_DEBUG_ICEDCC is not set
1608
1609#
1610# Security options
1611#
1612# CONFIG_KEYS is not set
1613# CONFIG_SECURITY is not set
1614# CONFIG_SECURITYFS is not set
1615# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1616CONFIG_CRYPTO=y
1617
1618#
1619# Crypto core or helper
1620#
1621CONFIG_CRYPTO_ALGAPI=y
1622CONFIG_CRYPTO_ALGAPI2=y
1623CONFIG_CRYPTO_AEAD2=y
1624CONFIG_CRYPTO_BLKCIPHER=y
1625CONFIG_CRYPTO_BLKCIPHER2=y
1626CONFIG_CRYPTO_HASH=y
1627CONFIG_CRYPTO_HASH2=y
1628CONFIG_CRYPTO_RNG2=y
1629CONFIG_CRYPTO_PCOMP=y
1630CONFIG_CRYPTO_MANAGER=y
1631CONFIG_CRYPTO_MANAGER2=y
1632# CONFIG_CRYPTO_GF128MUL is not set
1633# CONFIG_CRYPTO_NULL is not set
1634CONFIG_CRYPTO_WORKQUEUE=y
1635# CONFIG_CRYPTO_CRYPTD is not set
1636# CONFIG_CRYPTO_AUTHENC is not set
1637# CONFIG_CRYPTO_TEST is not set
1638
1639#
1640# Authenticated Encryption with Associated Data
1641#
1642# CONFIG_CRYPTO_CCM is not set
1643# CONFIG_CRYPTO_GCM is not set
1644# CONFIG_CRYPTO_SEQIV is not set
1645
1646#
1647# Block modes
1648#
1649CONFIG_CRYPTO_CBC=y
1650# CONFIG_CRYPTO_CTR is not set
1651# CONFIG_CRYPTO_CTS is not set
1652CONFIG_CRYPTO_ECB=m
1653# CONFIG_CRYPTO_LRW is not set
1654CONFIG_CRYPTO_PCBC=m
1655# CONFIG_CRYPTO_XTS is not set
1656
1657#
1658# Hash modes
1659#
1660# CONFIG_CRYPTO_HMAC is not set
1661# CONFIG_CRYPTO_XCBC is not set
1662# CONFIG_CRYPTO_VMAC is not set
1663
1664#
1665# Digest
1666#
1667CONFIG_CRYPTO_CRC32C=y
1668# CONFIG_CRYPTO_GHASH is not set
1669# CONFIG_CRYPTO_MD4 is not set
1670CONFIG_CRYPTO_MD5=y
1671# CONFIG_CRYPTO_MICHAEL_MIC is not set
1672# CONFIG_CRYPTO_RMD128 is not set
1673# CONFIG_CRYPTO_RMD160 is not set
1674# CONFIG_CRYPTO_RMD256 is not set
1675# CONFIG_CRYPTO_RMD320 is not set
1676# CONFIG_CRYPTO_SHA1 is not set
1677# CONFIG_CRYPTO_SHA256 is not set
1678# CONFIG_CRYPTO_SHA512 is not set
1679# CONFIG_CRYPTO_TGR192 is not set
1680# CONFIG_CRYPTO_WP512 is not set
1681
1682#
1683# Ciphers
1684#
1685# CONFIG_CRYPTO_AES is not set
1686# CONFIG_CRYPTO_ANUBIS is not set
1687# CONFIG_CRYPTO_ARC4 is not set
1688# CONFIG_CRYPTO_BLOWFISH is not set
1689# CONFIG_CRYPTO_CAMELLIA is not set
1690# CONFIG_CRYPTO_CAST5 is not set
1691# CONFIG_CRYPTO_CAST6 is not set
1692CONFIG_CRYPTO_DES=y
1693# CONFIG_CRYPTO_FCRYPT is not set
1694# CONFIG_CRYPTO_KHAZAD is not set
1695# CONFIG_CRYPTO_SALSA20 is not set
1696# CONFIG_CRYPTO_SEED is not set
1697# CONFIG_CRYPTO_SERPENT is not set
1698# CONFIG_CRYPTO_TEA is not set
1699# CONFIG_CRYPTO_TWOFISH is not set
1700
1701#
1702# Compression
1703#
1704# CONFIG_CRYPTO_DEFLATE is not set
1705# CONFIG_CRYPTO_ZLIB is not set
1706# CONFIG_CRYPTO_LZO is not set
1707
1708#
1709# Random Number Generation
1710#
1711# CONFIG_CRYPTO_ANSI_CPRNG is not set
1712CONFIG_CRYPTO_HW=y
1713# CONFIG_BINARY_PRINTF is not set
1714
1715#
1716# Library routines
1717#
1718CONFIG_BITREVERSE=y
1719CONFIG_GENERIC_FIND_LAST_BIT=y
1720CONFIG_CRC_CCITT=y
1721# CONFIG_CRC16 is not set
1722# CONFIG_CRC_T10DIF is not set
1723# CONFIG_CRC_ITU_T is not set
1724CONFIG_CRC32=y
1725# CONFIG_CRC7 is not set
1726CONFIG_LIBCRC32C=y
1727CONFIG_ZLIB_INFLATE=y
1728CONFIG_ZLIB_DEFLATE=y
1729CONFIG_DECOMPRESS_GZIP=y
1730CONFIG_HAS_IOMEM=y
1731CONFIG_HAS_IOPORT=y
1732CONFIG_HAS_DMA=y
1733CONFIG_NLATTR=y
diff --git a/arch/arm/configs/cm_x300_defconfig b/arch/arm/configs/cm_x300_defconfig
index d18d21bb41e4..a0170867130e 100644
--- a/arch/arm/configs/cm_x300_defconfig
+++ b/arch/arm/configs/cm_x300_defconfig
@@ -1,15 +1,13 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc8 3# Linux kernel version: 2.6.32-rc4
4# Thu Jun 4 09:53:21 2009 4# Tue Oct 13 19:03:13 2009
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y 7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y 8CONFIG_GENERIC_GPIO=y
9CONFIG_GENERIC_TIME=y 9CONFIG_GENERIC_TIME=y
10CONFIG_GENERIC_CLOCKEVENTS=y 10CONFIG_GENERIC_CLOCKEVENTS=y
11CONFIG_MMU=y
12# CONFIG_NO_IOPORT is not set
13CONFIG_GENERIC_HARDIRQS=y 11CONFIG_GENERIC_HARDIRQS=y
14CONFIG_STACKTRACE_SUPPORT=y 12CONFIG_STACKTRACE_SUPPORT=y
15CONFIG_HAVE_LATENCYTOP_SUPPORT=y 13CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -18,14 +16,14 @@ CONFIG_TRACE_IRQFLAGS_SUPPORT=y
18CONFIG_HARDIRQS_SW_RESEND=y 16CONFIG_HARDIRQS_SW_RESEND=y
19CONFIG_GENERIC_IRQ_PROBE=y 17CONFIG_GENERIC_IRQ_PROBE=y
20CONFIG_RWSEM_GENERIC_SPINLOCK=y 18CONFIG_RWSEM_GENERIC_SPINLOCK=y
21# CONFIG_ARCH_HAS_ILOG2_U32 is not set 19CONFIG_ARCH_HAS_CPUFREQ=y
22# CONFIG_ARCH_HAS_ILOG2_U64 is not set
23CONFIG_GENERIC_HWEIGHT=y 20CONFIG_GENERIC_HWEIGHT=y
24CONFIG_GENERIC_CALIBRATE_DELAY=y 21CONFIG_GENERIC_CALIBRATE_DELAY=y
25CONFIG_ARCH_MTD_XIP=y 22CONFIG_ARCH_MTD_XIP=y
26CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 23CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
27CONFIG_VECTORS_BASE=0xffff0000 24CONFIG_VECTORS_BASE=0xffff0000
28CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 25CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
26CONFIG_CONSTRUCTORS=y
29 27
30# 28#
31# General setup 29# General setup
@@ -46,11 +44,12 @@ CONFIG_SYSVIPC_SYSCTL=y
46# 44#
47# RCU Subsystem 45# RCU Subsystem
48# 46#
49CONFIG_CLASSIC_RCU=y 47CONFIG_TREE_RCU=y
50# CONFIG_TREE_RCU is not set 48# CONFIG_TREE_PREEMPT_RCU is not set
51# CONFIG_PREEMPT_RCU is not set 49# CONFIG_RCU_TRACE is not set
50CONFIG_RCU_FANOUT=32
51# CONFIG_RCU_FANOUT_EXACT is not set
52# CONFIG_TREE_RCU_TRACE is not set 52# CONFIG_TREE_RCU_TRACE is not set
53# CONFIG_PREEMPT_RCU_TRACE is not set
54CONFIG_IKCONFIG=y 53CONFIG_IKCONFIG=y
55CONFIG_IKCONFIG_PROC=y 54CONFIG_IKCONFIG_PROC=y
56CONFIG_LOG_BUF_SHIFT=18 55CONFIG_LOG_BUF_SHIFT=18
@@ -83,7 +82,6 @@ CONFIG_SYSCTL_SYSCALL=y
83CONFIG_KALLSYMS=y 82CONFIG_KALLSYMS=y
84# CONFIG_KALLSYMS_ALL is not set 83# CONFIG_KALLSYMS_ALL is not set
85# CONFIG_KALLSYMS_EXTRA_PASS is not set 84# CONFIG_KALLSYMS_EXTRA_PASS is not set
86# CONFIG_STRIP_ASM_SYMS is not set
87CONFIG_HOTPLUG=y 85CONFIG_HOTPLUG=y
88CONFIG_PRINTK=y 86CONFIG_PRINTK=y
89CONFIG_BUG=y 87CONFIG_BUG=y
@@ -96,6 +94,10 @@ CONFIG_TIMERFD=y
96CONFIG_EVENTFD=y 94CONFIG_EVENTFD=y
97CONFIG_SHMEM=y 95CONFIG_SHMEM=y
98CONFIG_AIO=y 96CONFIG_AIO=y
97
98#
99# Kernel Performance Events And Counters
100#
99CONFIG_VM_EVENT_COUNTERS=y 101CONFIG_VM_EVENT_COUNTERS=y
100CONFIG_SLUB_DEBUG=y 102CONFIG_SLUB_DEBUG=y
101CONFIG_COMPAT_BRK=y 103CONFIG_COMPAT_BRK=y
@@ -103,13 +105,17 @@ CONFIG_COMPAT_BRK=y
103CONFIG_SLUB=y 105CONFIG_SLUB=y
104# CONFIG_SLOB is not set 106# CONFIG_SLOB is not set
105# CONFIG_PROFILING is not set 107# CONFIG_PROFILING is not set
106# CONFIG_MARKERS is not set
107CONFIG_HAVE_OPROFILE=y 108CONFIG_HAVE_OPROFILE=y
108# CONFIG_KPROBES is not set 109# CONFIG_KPROBES is not set
109CONFIG_HAVE_KPROBES=y 110CONFIG_HAVE_KPROBES=y
110CONFIG_HAVE_KRETPROBES=y 111CONFIG_HAVE_KRETPROBES=y
111CONFIG_HAVE_CLK=y 112CONFIG_HAVE_CLK=y
112# CONFIG_SLOW_WORK is not set 113
114#
115# GCOV-based kernel profiling
116#
117# CONFIG_GCOV_KERNEL is not set
118CONFIG_SLOW_WORK=y
113CONFIG_HAVE_GENERIC_DMA_COHERENT=y 119CONFIG_HAVE_GENERIC_DMA_COHERENT=y
114CONFIG_SLABINFO=y 120CONFIG_SLABINFO=y
115CONFIG_RT_MUTEXES=y 121CONFIG_RT_MUTEXES=y
@@ -117,11 +123,11 @@ CONFIG_BASE_SMALL=0
117CONFIG_MODULES=y 123CONFIG_MODULES=y
118# CONFIG_MODULE_FORCE_LOAD is not set 124# CONFIG_MODULE_FORCE_LOAD is not set
119CONFIG_MODULE_UNLOAD=y 125CONFIG_MODULE_UNLOAD=y
120# CONFIG_MODULE_FORCE_UNLOAD is not set 126CONFIG_MODULE_FORCE_UNLOAD=y
121# CONFIG_MODVERSIONS is not set 127# CONFIG_MODVERSIONS is not set
122# CONFIG_MODULE_SRCVERSION_ALL is not set 128# CONFIG_MODULE_SRCVERSION_ALL is not set
123CONFIG_BLOCK=y 129CONFIG_BLOCK=y
124# CONFIG_LBD is not set 130CONFIG_LBDAF=y
125# CONFIG_BLK_DEV_BSG is not set 131# CONFIG_BLK_DEV_BSG is not set
126# CONFIG_BLK_DEV_INTEGRITY is not set 132# CONFIG_BLK_DEV_INTEGRITY is not set
127 133
@@ -142,19 +148,22 @@ CONFIG_FREEZER=y
142# 148#
143# System Type 149# System Type
144# 150#
151CONFIG_MMU=y
145# CONFIG_ARCH_AAEC2000 is not set 152# CONFIG_ARCH_AAEC2000 is not set
146# CONFIG_ARCH_INTEGRATOR is not set 153# CONFIG_ARCH_INTEGRATOR is not set
147# CONFIG_ARCH_REALVIEW is not set 154# CONFIG_ARCH_REALVIEW is not set
148# CONFIG_ARCH_VERSATILE is not set 155# CONFIG_ARCH_VERSATILE is not set
149# CONFIG_ARCH_AT91 is not set 156# CONFIG_ARCH_AT91 is not set
150# CONFIG_ARCH_CLPS711X is not set 157# CONFIG_ARCH_CLPS711X is not set
158# CONFIG_ARCH_GEMINI is not set
151# CONFIG_ARCH_EBSA110 is not set 159# CONFIG_ARCH_EBSA110 is not set
152# CONFIG_ARCH_EP93XX is not set 160# CONFIG_ARCH_EP93XX is not set
153# CONFIG_ARCH_GEMINI is not set
154# CONFIG_ARCH_FOOTBRIDGE is not set 161# CONFIG_ARCH_FOOTBRIDGE is not set
162# CONFIG_ARCH_MXC is not set
163# CONFIG_ARCH_STMP3XXX is not set
155# CONFIG_ARCH_NETX is not set 164# CONFIG_ARCH_NETX is not set
156# CONFIG_ARCH_H720X is not set 165# CONFIG_ARCH_H720X is not set
157# CONFIG_ARCH_IMX is not set 166# CONFIG_ARCH_NOMADIK is not set
158# CONFIG_ARCH_IOP13XX is not set 167# CONFIG_ARCH_IOP13XX is not set
159# CONFIG_ARCH_IOP32X is not set 168# CONFIG_ARCH_IOP32X is not set
160# CONFIG_ARCH_IOP33X is not set 169# CONFIG_ARCH_IOP33X is not set
@@ -163,25 +172,27 @@ CONFIG_FREEZER=y
163# CONFIG_ARCH_IXP4XX is not set 172# CONFIG_ARCH_IXP4XX is not set
164# CONFIG_ARCH_L7200 is not set 173# CONFIG_ARCH_L7200 is not set
165# CONFIG_ARCH_KIRKWOOD is not set 174# CONFIG_ARCH_KIRKWOOD is not set
166# CONFIG_ARCH_KS8695 is not set
167# CONFIG_ARCH_NS9XXX is not set
168# CONFIG_ARCH_LOKI is not set 175# CONFIG_ARCH_LOKI is not set
169# CONFIG_ARCH_MV78XX0 is not set 176# CONFIG_ARCH_MV78XX0 is not set
170# CONFIG_ARCH_MXC is not set
171# CONFIG_ARCH_ORION5X is not set 177# CONFIG_ARCH_ORION5X is not set
178# CONFIG_ARCH_MMP is not set
179# CONFIG_ARCH_KS8695 is not set
180# CONFIG_ARCH_NS9XXX is not set
181# CONFIG_ARCH_W90X900 is not set
172# CONFIG_ARCH_PNX4008 is not set 182# CONFIG_ARCH_PNX4008 is not set
173CONFIG_ARCH_PXA=y 183CONFIG_ARCH_PXA=y
174# CONFIG_ARCH_MMP is not set 184# CONFIG_ARCH_MSM is not set
175# CONFIG_ARCH_RPC is not set 185# CONFIG_ARCH_RPC is not set
176# CONFIG_ARCH_SA1100 is not set 186# CONFIG_ARCH_SA1100 is not set
177# CONFIG_ARCH_S3C2410 is not set 187# CONFIG_ARCH_S3C2410 is not set
178# CONFIG_ARCH_S3C64XX is not set 188# CONFIG_ARCH_S3C64XX is not set
189# CONFIG_ARCH_S5PC1XX is not set
179# CONFIG_ARCH_SHARK is not set 190# CONFIG_ARCH_SHARK is not set
180# CONFIG_ARCH_LH7A40X is not set 191# CONFIG_ARCH_LH7A40X is not set
192# CONFIG_ARCH_U300 is not set
181# CONFIG_ARCH_DAVINCI is not set 193# CONFIG_ARCH_DAVINCI is not set
182# CONFIG_ARCH_OMAP is not set 194# CONFIG_ARCH_OMAP is not set
183# CONFIG_ARCH_MSM is not set 195# CONFIG_ARCH_BCMRING is not set
184# CONFIG_ARCH_W90X900 is not set
185 196
186# 197#
187# Intel PXA2xx/PXA3xx Implementations 198# Intel PXA2xx/PXA3xx Implementations
@@ -191,16 +202,19 @@ CONFIG_ARCH_PXA=y
191# Supported PXA3xx Processor Variants 202# Supported PXA3xx Processor Variants
192# 203#
193CONFIG_CPU_PXA300=y 204CONFIG_CPU_PXA300=y
194# CONFIG_CPU_PXA310 is not set 205CONFIG_CPU_PXA310=y
195# CONFIG_CPU_PXA320 is not set 206# CONFIG_CPU_PXA320 is not set
196# CONFIG_CPU_PXA930 is not set 207# CONFIG_CPU_PXA930 is not set
197# CONFIG_CPU_PXA935 is not set 208# CONFIG_CPU_PXA935 is not set
209# CONFIG_CPU_PXA950 is not set
198# CONFIG_ARCH_GUMSTIX is not set 210# CONFIG_ARCH_GUMSTIX is not set
199# CONFIG_MACH_INTELMOTE2 is not set 211# CONFIG_MACH_INTELMOTE2 is not set
212# CONFIG_MACH_STARGATE2 is not set
200# CONFIG_ARCH_LUBBOCK is not set 213# CONFIG_ARCH_LUBBOCK is not set
201# CONFIG_MACH_LOGICPD_PXA270 is not set 214# CONFIG_MACH_LOGICPD_PXA270 is not set
202# CONFIG_MACH_MAINSTONE is not set 215# CONFIG_MACH_MAINSTONE is not set
203# CONFIG_MACH_MP900C is not set 216# CONFIG_MACH_MP900C is not set
217# CONFIG_MACH_BALLOON3 is not set
204# CONFIG_ARCH_PXA_IDP is not set 218# CONFIG_ARCH_PXA_IDP is not set
205# CONFIG_PXA_SHARPSL is not set 219# CONFIG_PXA_SHARPSL is not set
206# CONFIG_ARCH_VIPER is not set 220# CONFIG_ARCH_VIPER is not set
@@ -218,6 +232,7 @@ CONFIG_CPU_PXA300=y
218# CONFIG_MACH_SAAR is not set 232# CONFIG_MACH_SAAR is not set
219# CONFIG_MACH_ARMCORE is not set 233# CONFIG_MACH_ARMCORE is not set
220CONFIG_MACH_CM_X300=y 234CONFIG_MACH_CM_X300=y
235# CONFIG_MACH_H4700 is not set
221# CONFIG_MACH_MAGICIAN is not set 236# CONFIG_MACH_MAGICIAN is not set
222# CONFIG_MACH_HIMALAYA is not set 237# CONFIG_MACH_HIMALAYA is not set
223# CONFIG_MACH_MIOA701 is not set 238# CONFIG_MACH_MIOA701 is not set
@@ -225,8 +240,8 @@ CONFIG_MACH_CM_X300=y
225# CONFIG_ARCH_PXA_PALM is not set 240# CONFIG_ARCH_PXA_PALM is not set
226# CONFIG_MACH_CSB726 is not set 241# CONFIG_MACH_CSB726 is not set
227# CONFIG_PXA_EZX is not set 242# CONFIG_PXA_EZX is not set
243# CONFIG_MACH_XCEP is not set
228CONFIG_PXA3xx=y 244CONFIG_PXA3xx=y
229# CONFIG_PXA_PWM is not set
230CONFIG_PLAT_PXA=y 245CONFIG_PLAT_PXA=y
231 246
232# 247#
@@ -236,7 +251,7 @@ CONFIG_CPU_32=y
236CONFIG_CPU_XSC3=y 251CONFIG_CPU_XSC3=y
237CONFIG_CPU_32v5=y 252CONFIG_CPU_32v5=y
238CONFIG_CPU_ABRT_EV5T=y 253CONFIG_CPU_ABRT_EV5T=y
239CONFIG_CPU_PABRT_NOIFAR=y 254CONFIG_CPU_PABRT_LEGACY=y
240CONFIG_CPU_CACHE_VIVT=y 255CONFIG_CPU_CACHE_VIVT=y
241CONFIG_CPU_TLB_V4WBI=y 256CONFIG_CPU_TLB_V4WBI=y
242CONFIG_CPU_CP15=y 257CONFIG_CPU_CP15=y
@@ -246,11 +261,12 @@ CONFIG_IO_36=y
246# 261#
247# Processor Features 262# Processor Features
248# 263#
249# CONFIG_ARM_THUMB is not set 264CONFIG_ARM_THUMB=y
250# CONFIG_CPU_DCACHE_DISABLE is not set 265# CONFIG_CPU_DCACHE_DISABLE is not set
251# CONFIG_CPU_BPREDICT_DISABLE is not set 266# CONFIG_CPU_BPREDICT_DISABLE is not set
252CONFIG_OUTER_CACHE=y 267CONFIG_OUTER_CACHE=y
253CONFIG_CACHE_XSC3L2=y 268CONFIG_CACHE_XSC3L2=y
269CONFIG_ARM_L1_CACHE_SHIFT=5
254CONFIG_IWMMXT=y 270CONFIG_IWMMXT=y
255CONFIG_COMMON_CLKDEV=y 271CONFIG_COMMON_CLKDEV=y
256 272
@@ -272,11 +288,12 @@ CONFIG_VMSPLIT_3G=y
272# CONFIG_VMSPLIT_2G is not set 288# CONFIG_VMSPLIT_2G is not set
273# CONFIG_VMSPLIT_1G is not set 289# CONFIG_VMSPLIT_1G is not set
274CONFIG_PAGE_OFFSET=0xC0000000 290CONFIG_PAGE_OFFSET=0xC0000000
291CONFIG_PREEMPT_NONE=y
292# CONFIG_PREEMPT_VOLUNTARY is not set
275# CONFIG_PREEMPT is not set 293# CONFIG_PREEMPT is not set
276CONFIG_HZ=100 294CONFIG_HZ=100
277CONFIG_AEABI=y 295CONFIG_AEABI=y
278CONFIG_OABI_COMPAT=y 296CONFIG_OABI_COMPAT=y
279# CONFIG_ARCH_HAS_HOLES_MEMORYMODEL is not set
280# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set 297# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
281# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set 298# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
282CONFIG_HIGHMEM=y 299CONFIG_HIGHMEM=y
@@ -292,17 +309,19 @@ CONFIG_SPLIT_PTLOCK_CPUS=4096
292CONFIG_ZONE_DMA_FLAG=0 309CONFIG_ZONE_DMA_FLAG=0
293CONFIG_BOUNCE=y 310CONFIG_BOUNCE=y
294CONFIG_VIRT_TO_BUS=y 311CONFIG_VIRT_TO_BUS=y
295CONFIG_UNEVICTABLE_LRU=y
296CONFIG_HAVE_MLOCK=y 312CONFIG_HAVE_MLOCK=y
297CONFIG_HAVE_MLOCKED_PAGE_BIT=y 313CONFIG_HAVE_MLOCKED_PAGE_BIT=y
314# CONFIG_KSM is not set
315CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
298CONFIG_ALIGNMENT_TRAP=y 316CONFIG_ALIGNMENT_TRAP=y
317# CONFIG_UACCESS_WITH_MEMCPY is not set
299 318
300# 319#
301# Boot options 320# Boot options
302# 321#
303CONFIG_ZBOOT_ROM_TEXT=0x0 322CONFIG_ZBOOT_ROM_TEXT=0x0
304CONFIG_ZBOOT_ROM_BSS=0x0 323CONFIG_ZBOOT_ROM_BSS=0x0
305CONFIG_CMDLINE="root=/dev/mtdblock5 rootfstype=jffs2 console=ttyS2,38400" 324CONFIG_CMDLINE="root=/dev/mtdblock5 rootfstype=ubifs console=ttyS2,38400"
306# CONFIG_XIP_KERNEL is not set 325# CONFIG_XIP_KERNEL is not set
307# CONFIG_KEXEC is not set 326# CONFIG_KEXEC is not set
308 327
@@ -355,6 +374,7 @@ CONFIG_PM_SLEEP=y
355CONFIG_SUSPEND=y 374CONFIG_SUSPEND=y
356CONFIG_SUSPEND_FREEZER=y 375CONFIG_SUSPEND_FREEZER=y
357CONFIG_APM_EMULATION=y 376CONFIG_APM_EMULATION=y
377# CONFIG_PM_RUNTIME is not set
358CONFIG_ARCH_SUSPEND_POSSIBLE=y 378CONFIG_ARCH_SUSPEND_POSSIBLE=y
359CONFIG_NET=y 379CONFIG_NET=y
360 380
@@ -396,6 +416,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
396# CONFIG_NETFILTER is not set 416# CONFIG_NETFILTER is not set
397# CONFIG_IP_DCCP is not set 417# CONFIG_IP_DCCP is not set
398# CONFIG_IP_SCTP is not set 418# CONFIG_IP_SCTP is not set
419# CONFIG_RDS is not set
399# CONFIG_TIPC is not set 420# CONFIG_TIPC is not set
400# CONFIG_ATM is not set 421# CONFIG_ATM is not set
401# CONFIG_BRIDGE is not set 422# CONFIG_BRIDGE is not set
@@ -410,6 +431,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
410# CONFIG_ECONET is not set 431# CONFIG_ECONET is not set
411# CONFIG_WAN_ROUTER is not set 432# CONFIG_WAN_ROUTER is not set
412# CONFIG_PHONET is not set 433# CONFIG_PHONET is not set
434# CONFIG_IEEE802154 is not set
413# CONFIG_NET_SCHED is not set 435# CONFIG_NET_SCHED is not set
414# CONFIG_DCB is not set 436# CONFIG_DCB is not set
415 437
@@ -433,22 +455,27 @@ CONFIG_BT_HIDP=m
433# 455#
434# Bluetooth device drivers 456# Bluetooth device drivers
435# 457#
436# CONFIG_BT_HCIBTUSB is not set 458CONFIG_BT_HCIBTUSB=m
437# CONFIG_BT_HCIBTSDIO is not set 459# CONFIG_BT_HCIBTSDIO is not set
438# CONFIG_BT_HCIUART is not set 460# CONFIG_BT_HCIUART is not set
439# CONFIG_BT_HCIBCM203X is not set 461# CONFIG_BT_HCIBCM203X is not set
440# CONFIG_BT_HCIBPA10X is not set 462# CONFIG_BT_HCIBPA10X is not set
441# CONFIG_BT_HCIBFUSB is not set 463# CONFIG_BT_HCIBFUSB is not set
442# CONFIG_BT_HCIVHCI is not set 464# CONFIG_BT_HCIVHCI is not set
465# CONFIG_BT_MRVL is not set
443# CONFIG_AF_RXRPC is not set 466# CONFIG_AF_RXRPC is not set
444CONFIG_WIRELESS=y 467CONFIG_WIRELESS=y
445# CONFIG_CFG80211 is not set 468# CONFIG_CFG80211 is not set
469CONFIG_CFG80211_DEFAULT_PS_VALUE=0
446# CONFIG_WIRELESS_OLD_REGULATORY is not set 470# CONFIG_WIRELESS_OLD_REGULATORY is not set
447CONFIG_WIRELESS_EXT=y 471CONFIG_WIRELESS_EXT=y
448CONFIG_WIRELESS_EXT_SYSFS=y 472CONFIG_WIRELESS_EXT_SYSFS=y
449CONFIG_LIB80211=m 473CONFIG_LIB80211=m
450# CONFIG_LIB80211_DEBUG is not set 474# CONFIG_LIB80211_DEBUG is not set
451# CONFIG_MAC80211 is not set 475
476#
477# CFG80211 needs to be enabled for MAC80211
478#
452# CONFIG_WIMAX is not set 479# CONFIG_WIMAX is not set
453# CONFIG_RFKILL is not set 480# CONFIG_RFKILL is not set
454# CONFIG_NET_9P is not set 481# CONFIG_NET_9P is not set
@@ -461,6 +488,7 @@ CONFIG_LIB80211=m
461# Generic Driver Options 488# Generic Driver Options
462# 489#
463CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 490CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
491# CONFIG_DEVTMPFS is not set
464CONFIG_STANDALONE=y 492CONFIG_STANDALONE=y
465CONFIG_PREVENT_FIRMWARE_BUILD=y 493CONFIG_PREVENT_FIRMWARE_BUILD=y
466CONFIG_FW_LOADER=y 494CONFIG_FW_LOADER=y
@@ -472,9 +500,9 @@ CONFIG_EXTRA_FIRMWARE=""
472# CONFIG_CONNECTOR is not set 500# CONFIG_CONNECTOR is not set
473CONFIG_MTD=y 501CONFIG_MTD=y
474# CONFIG_MTD_DEBUG is not set 502# CONFIG_MTD_DEBUG is not set
503# CONFIG_MTD_TESTS is not set
475# CONFIG_MTD_CONCAT is not set 504# CONFIG_MTD_CONCAT is not set
476CONFIG_MTD_PARTITIONS=y 505CONFIG_MTD_PARTITIONS=y
477# CONFIG_MTD_TESTS is not set
478# CONFIG_MTD_REDBOOT_PARTS is not set 506# CONFIG_MTD_REDBOOT_PARTS is not set
479# CONFIG_MTD_CMDLINE_PARTS is not set 507# CONFIG_MTD_CMDLINE_PARTS is not set
480# CONFIG_MTD_AFS_PARTS is not set 508# CONFIG_MTD_AFS_PARTS is not set
@@ -521,6 +549,9 @@ CONFIG_MTD_CFI_I2=y
521# 549#
522# Self-contained MTD device drivers 550# Self-contained MTD device drivers
523# 551#
552# CONFIG_MTD_DATAFLASH is not set
553# CONFIG_MTD_M25P80 is not set
554# CONFIG_MTD_SST25L is not set
524# CONFIG_MTD_SLRAM is not set 555# CONFIG_MTD_SLRAM is not set
525# CONFIG_MTD_PHRAM is not set 556# CONFIG_MTD_PHRAM is not set
526# CONFIG_MTD_MTDRAM is not set 557# CONFIG_MTD_MTDRAM is not set
@@ -556,7 +587,15 @@ CONFIG_MTD_NAND_PXA3xx=y
556# 587#
557# UBI - Unsorted block images 588# UBI - Unsorted block images
558# 589#
559# CONFIG_MTD_UBI is not set 590CONFIG_MTD_UBI=y
591CONFIG_MTD_UBI_WL_THRESHOLD=4096
592CONFIG_MTD_UBI_BEB_RESERVE=1
593# CONFIG_MTD_UBI_GLUEBI is not set
594
595#
596# UBI debugging options
597#
598# CONFIG_MTD_UBI_DEBUG is not set
560# CONFIG_PARPORT is not set 599# CONFIG_PARPORT is not set
561CONFIG_BLK_DEV=y 600CONFIG_BLK_DEV=y
562# CONFIG_BLK_DEV_COW_COMMON is not set 601# CONFIG_BLK_DEV_COW_COMMON is not set
@@ -570,6 +609,7 @@ CONFIG_BLK_DEV_RAM_SIZE=4096
570# CONFIG_BLK_DEV_XIP is not set 609# CONFIG_BLK_DEV_XIP is not set
571# CONFIG_CDROM_PKTCDVD is not set 610# CONFIG_CDROM_PKTCDVD is not set
572# CONFIG_ATA_OVER_ETH is not set 611# CONFIG_ATA_OVER_ETH is not set
612# CONFIG_MG_DISK is not set
573# CONFIG_MISC_DEVICES is not set 613# CONFIG_MISC_DEVICES is not set
574CONFIG_HAVE_IDE=y 614CONFIG_HAVE_IDE=y
575# CONFIG_IDE is not set 615# CONFIG_IDE is not set
@@ -593,10 +633,6 @@ CONFIG_BLK_DEV_SD=y
593# CONFIG_BLK_DEV_SR is not set 633# CONFIG_BLK_DEV_SR is not set
594# CONFIG_CHR_DEV_SG is not set 634# CONFIG_CHR_DEV_SG is not set
595# CONFIG_CHR_DEV_SCH is not set 635# CONFIG_CHR_DEV_SCH is not set
596
597#
598# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
599#
600# CONFIG_SCSI_MULTI_LUN is not set 636# CONFIG_SCSI_MULTI_LUN is not set
601# CONFIG_SCSI_CONSTANTS is not set 637# CONFIG_SCSI_CONSTANTS is not set
602# CONFIG_SCSI_LOGGING is not set 638# CONFIG_SCSI_LOGGING is not set
@@ -621,7 +657,6 @@ CONFIG_SCSI_LOWLEVEL=y
621# CONFIG_ATA is not set 657# CONFIG_ATA is not set
622# CONFIG_MD is not set 658# CONFIG_MD is not set
623CONFIG_NETDEVICES=y 659CONFIG_NETDEVICES=y
624CONFIG_COMPAT_NET_DEV_OPS=y
625# CONFIG_DUMMY is not set 660# CONFIG_DUMMY is not set
626# CONFIG_BONDING is not set 661# CONFIG_BONDING is not set
627# CONFIG_MACVLAN is not set 662# CONFIG_MACVLAN is not set
@@ -636,6 +671,7 @@ CONFIG_MII=y
636CONFIG_DM9000=y 671CONFIG_DM9000=y
637CONFIG_DM9000_DEBUGLEVEL=0 672CONFIG_DM9000_DEBUGLEVEL=0
638CONFIG_DM9000_FORCE_SIMPLE_PHY_POLL=y 673CONFIG_DM9000_FORCE_SIMPLE_PHY_POLL=y
674# CONFIG_ENC28J60 is not set
639# CONFIG_ETHOC is not set 675# CONFIG_ETHOC is not set
640# CONFIG_SMC911X is not set 676# CONFIG_SMC911X is not set
641# CONFIG_SMSC911X is not set 677# CONFIG_SMSC911X is not set
@@ -648,20 +684,20 @@ CONFIG_DM9000_FORCE_SIMPLE_PHY_POLL=y
648# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set 684# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
649# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 685# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
650# CONFIG_B44 is not set 686# CONFIG_B44 is not set
687# CONFIG_KS8842 is not set
688# CONFIG_KS8851 is not set
689# CONFIG_KS8851_MLL is not set
651# CONFIG_NETDEV_1000 is not set 690# CONFIG_NETDEV_1000 is not set
652# CONFIG_NETDEV_10000 is not set 691# CONFIG_NETDEV_10000 is not set
653 692CONFIG_WLAN=y
654#
655# Wireless LAN
656#
657# CONFIG_WLAN_PRE80211 is not set 693# CONFIG_WLAN_PRE80211 is not set
658CONFIG_WLAN_80211=y 694CONFIG_WLAN_80211=y
659CONFIG_LIBERTAS=m 695CONFIG_LIBERTAS=m
660# CONFIG_LIBERTAS_USB is not set 696# CONFIG_LIBERTAS_USB is not set
661CONFIG_LIBERTAS_SDIO=m 697CONFIG_LIBERTAS_SDIO=m
698# CONFIG_LIBERTAS_SPI is not set
662# CONFIG_LIBERTAS_DEBUG is not set 699# CONFIG_LIBERTAS_DEBUG is not set
663# CONFIG_USB_ZD1201 is not set 700# CONFIG_USB_ZD1201 is not set
664# CONFIG_USB_NET_RNDIS_WLAN is not set
665# CONFIG_HOSTAP is not set 701# CONFIG_HOSTAP is not set
666 702
667# 703#
@@ -683,6 +719,7 @@ CONFIG_LIBERTAS_SDIO=m
683# CONFIG_NETPOLL is not set 719# CONFIG_NETPOLL is not set
684# CONFIG_NET_POLL_CONTROLLER is not set 720# CONFIG_NET_POLL_CONTROLLER is not set
685# CONFIG_ISDN is not set 721# CONFIG_ISDN is not set
722# CONFIG_PHONE is not set
686 723
687# 724#
688# Input device support 725# Input device support
@@ -706,33 +743,51 @@ CONFIG_INPUT_EVDEV=y
706# Input Device Drivers 743# Input Device Drivers
707# 744#
708CONFIG_INPUT_KEYBOARD=y 745CONFIG_INPUT_KEYBOARD=y
746# CONFIG_KEYBOARD_ADP5588 is not set
709# CONFIG_KEYBOARD_ATKBD is not set 747# CONFIG_KEYBOARD_ATKBD is not set
710# CONFIG_KEYBOARD_SUNKBD is not set 748# CONFIG_QT2160 is not set
711# CONFIG_KEYBOARD_LKKBD is not set 749# CONFIG_KEYBOARD_LKKBD is not set
712# CONFIG_KEYBOARD_XTKBD is not set 750# CONFIG_KEYBOARD_GPIO is not set
751# CONFIG_KEYBOARD_MATRIX is not set
752# CONFIG_KEYBOARD_LM8323 is not set
753# CONFIG_KEYBOARD_MAX7359 is not set
713# CONFIG_KEYBOARD_NEWTON is not set 754# CONFIG_KEYBOARD_NEWTON is not set
714# CONFIG_KEYBOARD_STOWAWAY is not set 755# CONFIG_KEYBOARD_OPENCORES is not set
715CONFIG_KEYBOARD_PXA27x=m 756CONFIG_KEYBOARD_PXA27x=m
716# CONFIG_KEYBOARD_GPIO is not set 757# CONFIG_KEYBOARD_STOWAWAY is not set
758# CONFIG_KEYBOARD_SUNKBD is not set
759# CONFIG_KEYBOARD_XTKBD is not set
717# CONFIG_INPUT_MOUSE is not set 760# CONFIG_INPUT_MOUSE is not set
718# CONFIG_INPUT_JOYSTICK is not set 761# CONFIG_INPUT_JOYSTICK is not set
719# CONFIG_INPUT_TABLET is not set 762# CONFIG_INPUT_TABLET is not set
720CONFIG_INPUT_TOUCHSCREEN=y 763CONFIG_INPUT_TOUCHSCREEN=y
764# CONFIG_TOUCHSCREEN_ADS7846 is not set
765# CONFIG_TOUCHSCREEN_AD7877 is not set
721# CONFIG_TOUCHSCREEN_AD7879_I2C is not set 766# CONFIG_TOUCHSCREEN_AD7879_I2C is not set
767# CONFIG_TOUCHSCREEN_AD7879_SPI is not set
722# CONFIG_TOUCHSCREEN_AD7879 is not set 768# CONFIG_TOUCHSCREEN_AD7879 is not set
769# CONFIG_TOUCHSCREEN_DA9034 is not set
770# CONFIG_TOUCHSCREEN_EETI is not set
723# CONFIG_TOUCHSCREEN_FUJITSU is not set 771# CONFIG_TOUCHSCREEN_FUJITSU is not set
724# CONFIG_TOUCHSCREEN_GUNZE is not set 772# CONFIG_TOUCHSCREEN_GUNZE is not set
725# CONFIG_TOUCHSCREEN_ELO is not set 773# CONFIG_TOUCHSCREEN_ELO is not set
726# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set 774# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
775# CONFIG_TOUCHSCREEN_MCS5000 is not set
727# CONFIG_TOUCHSCREEN_MTOUCH is not set 776# CONFIG_TOUCHSCREEN_MTOUCH is not set
728# CONFIG_TOUCHSCREEN_INEXIO is not set 777# CONFIG_TOUCHSCREEN_INEXIO is not set
729# CONFIG_TOUCHSCREEN_MK712 is not set 778# CONFIG_TOUCHSCREEN_MK712 is not set
730# CONFIG_TOUCHSCREEN_PENMOUNT is not set 779# CONFIG_TOUCHSCREEN_PENMOUNT is not set
731# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set 780# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
732# CONFIG_TOUCHSCREEN_TOUCHWIN is not set 781# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
782CONFIG_TOUCHSCREEN_WM97XX=m
783# CONFIG_TOUCHSCREEN_WM9705 is not set
784CONFIG_TOUCHSCREEN_WM9712=y
785# CONFIG_TOUCHSCREEN_WM9713 is not set
786# CONFIG_TOUCHSCREEN_WM97XX_MAINSTONE is not set
733# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set 787# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
734# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set 788# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
735# CONFIG_TOUCHSCREEN_TSC2007 is not set 789# CONFIG_TOUCHSCREEN_TSC2007 is not set
790# CONFIG_TOUCHSCREEN_W90X900 is not set
736# CONFIG_INPUT_MISC is not set 791# CONFIG_INPUT_MISC is not set
737 792
738# 793#
@@ -760,6 +815,7 @@ CONFIG_DEVKMEM=y
760# 815#
761# Non-8250 serial port support 816# Non-8250 serial port support
762# 817#
818# CONFIG_SERIAL_MAX3100 is not set
763CONFIG_SERIAL_PXA=y 819CONFIG_SERIAL_PXA=y
764CONFIG_SERIAL_PXA_CONSOLE=y 820CONFIG_SERIAL_PXA_CONSOLE=y
765CONFIG_SERIAL_CORE=y 821CONFIG_SERIAL_CORE=y
@@ -774,6 +830,7 @@ CONFIG_UNIX98_PTYS=y
774# CONFIG_TCG_TPM is not set 830# CONFIG_TCG_TPM is not set
775CONFIG_I2C=y 831CONFIG_I2C=y
776CONFIG_I2C_BOARDINFO=y 832CONFIG_I2C_BOARDINFO=y
833CONFIG_I2C_COMPAT=y
777# CONFIG_I2C_CHARDEV is not set 834# CONFIG_I2C_CHARDEV is not set
778CONFIG_I2C_HELPER_AUTO=y 835CONFIG_I2C_HELPER_AUTO=y
779 836
@@ -784,6 +841,7 @@ CONFIG_I2C_HELPER_AUTO=y
784# 841#
785# I2C system bus drivers (mostly embedded / system-on-chip) 842# I2C system bus drivers (mostly embedded / system-on-chip)
786# 843#
844# CONFIG_I2C_DESIGNWARE is not set
787# CONFIG_I2C_GPIO is not set 845# CONFIG_I2C_GPIO is not set
788# CONFIG_I2C_OCORES is not set 846# CONFIG_I2C_OCORES is not set
789CONFIG_I2C_PXA=y 847CONFIG_I2C_PXA=y
@@ -807,19 +865,36 @@ CONFIG_I2C_PXA=y
807# Miscellaneous I2C Chip support 865# Miscellaneous I2C Chip support
808# 866#
809# CONFIG_DS1682 is not set 867# CONFIG_DS1682 is not set
810# CONFIG_SENSORS_PCF8574 is not set
811# CONFIG_PCF8575 is not set
812# CONFIG_SENSORS_MAX6875 is not set
813# CONFIG_SENSORS_TSL2550 is not set 868# CONFIG_SENSORS_TSL2550 is not set
814# CONFIG_I2C_DEBUG_CORE is not set 869# CONFIG_I2C_DEBUG_CORE is not set
815# CONFIG_I2C_DEBUG_ALGO is not set 870# CONFIG_I2C_DEBUG_ALGO is not set
816# CONFIG_I2C_DEBUG_BUS is not set 871# CONFIG_I2C_DEBUG_BUS is not set
817# CONFIG_I2C_DEBUG_CHIP is not set 872# CONFIG_I2C_DEBUG_CHIP is not set
818# CONFIG_SPI is not set 873CONFIG_SPI=y
874# CONFIG_SPI_DEBUG is not set
875CONFIG_SPI_MASTER=y
876
877#
878# SPI Master Controller Drivers
879#
880CONFIG_SPI_BITBANG=y
881CONFIG_SPI_GPIO=y
882# CONFIG_SPI_PXA2XX is not set
883
884#
885# SPI Protocol Masters
886#
887# CONFIG_SPI_SPIDEV is not set
888# CONFIG_SPI_TLE62X0 is not set
889
890#
891# PPS support
892#
893# CONFIG_PPS is not set
819CONFIG_ARCH_REQUIRE_GPIOLIB=y 894CONFIG_ARCH_REQUIRE_GPIOLIB=y
820CONFIG_GPIOLIB=y 895CONFIG_GPIOLIB=y
821# CONFIG_DEBUG_GPIO is not set 896# CONFIG_DEBUG_GPIO is not set
822# CONFIG_GPIO_SYSFS is not set 897CONFIG_GPIO_SYSFS=y
823 898
824# 899#
825# Memory mapped GPIO expanders: 900# Memory mapped GPIO expanders:
@@ -839,11 +914,17 @@ CONFIG_GPIO_PCA953X=y
839# 914#
840# SPI GPIO expanders: 915# SPI GPIO expanders:
841# 916#
917# CONFIG_GPIO_MAX7301 is not set
918# CONFIG_GPIO_MCP23S08 is not set
919# CONFIG_GPIO_MC33880 is not set
920
921#
922# AC97 GPIO expanders:
923#
842# CONFIG_W1 is not set 924# CONFIG_W1 is not set
843# CONFIG_POWER_SUPPLY is not set 925# CONFIG_POWER_SUPPLY is not set
844# CONFIG_HWMON is not set 926# CONFIG_HWMON is not set
845# CONFIG_THERMAL is not set 927# CONFIG_THERMAL is not set
846# CONFIG_THERMAL_HWMON is not set
847# CONFIG_WATCHDOG is not set 928# CONFIG_WATCHDOG is not set
848CONFIG_SSB_POSSIBLE=y 929CONFIG_SSB_POSSIBLE=y
849 930
@@ -860,32 +941,33 @@ CONFIG_SSB_POSSIBLE=y
860# CONFIG_MFD_ASIC3 is not set 941# CONFIG_MFD_ASIC3 is not set
861# CONFIG_HTC_EGPIO is not set 942# CONFIG_HTC_EGPIO is not set
862# CONFIG_HTC_PASIC3 is not set 943# CONFIG_HTC_PASIC3 is not set
944# CONFIG_UCB1400_CORE is not set
863# CONFIG_TPS65010 is not set 945# CONFIG_TPS65010 is not set
864# CONFIG_TWL4030_CORE is not set 946# CONFIG_TWL4030_CORE is not set
865# CONFIG_MFD_TMIO is not set 947# CONFIG_MFD_TMIO is not set
866# CONFIG_MFD_T7L66XB is not set 948# CONFIG_MFD_T7L66XB is not set
867# CONFIG_MFD_TC6387XB is not set 949# CONFIG_MFD_TC6387XB is not set
868# CONFIG_MFD_TC6393XB is not set 950# CONFIG_MFD_TC6393XB is not set
869# CONFIG_PMIC_DA903X is not set 951CONFIG_PMIC_DA903X=y
870# CONFIG_MFD_WM8400 is not set 952# CONFIG_MFD_WM8400 is not set
953# CONFIG_MFD_WM831X is not set
871# CONFIG_MFD_WM8350_I2C is not set 954# CONFIG_MFD_WM8350_I2C is not set
872# CONFIG_MFD_PCF50633 is not set 955# CONFIG_MFD_PCF50633 is not set
873 956# CONFIG_MFD_MC13783 is not set
874# 957# CONFIG_AB3100_CORE is not set
875# Multimedia devices 958# CONFIG_EZX_PCAP is not set
876# 959CONFIG_REGULATOR=y
877 960# CONFIG_REGULATOR_DEBUG is not set
878# 961# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
879# Multimedia core support 962# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
880# 963# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set
881# CONFIG_VIDEO_DEV is not set 964# CONFIG_REGULATOR_BQ24022 is not set
882# CONFIG_DVB_CORE is not set 965# CONFIG_REGULATOR_MAX1586 is not set
883# CONFIG_VIDEO_MEDIA is not set 966CONFIG_REGULATOR_DA903X=y
884 967# CONFIG_REGULATOR_LP3971 is not set
885# 968# CONFIG_REGULATOR_TPS65023 is not set
886# Multimedia drivers 969# CONFIG_REGULATOR_TPS6507X is not set
887# 970# CONFIG_MEDIA_SUPPORT is not set
888# CONFIG_DAB is not set
889 971
890# 972#
891# Graphics support 973# Graphics support
@@ -925,7 +1007,17 @@ CONFIG_FB_PXA=y
925# CONFIG_FB_METRONOME is not set 1007# CONFIG_FB_METRONOME is not set
926# CONFIG_FB_MB862XX is not set 1008# CONFIG_FB_MB862XX is not set
927# CONFIG_FB_BROADSHEET is not set 1009# CONFIG_FB_BROADSHEET is not set
928# CONFIG_BACKLIGHT_LCD_SUPPORT is not set 1010CONFIG_BACKLIGHT_LCD_SUPPORT=y
1011CONFIG_LCD_CLASS_DEVICE=y
1012# CONFIG_LCD_LMS283GF05 is not set
1013# CONFIG_LCD_LTV350QV is not set
1014# CONFIG_LCD_ILI9320 is not set
1015CONFIG_LCD_TDO24M=y
1016# CONFIG_LCD_VGG2432A4 is not set
1017# CONFIG_LCD_PLATFORM is not set
1018CONFIG_BACKLIGHT_CLASS_DEVICE=m
1019# CONFIG_BACKLIGHT_GENERIC is not set
1020CONFIG_BACKLIGHT_DA903X=m
929 1021
930# 1022#
931# Display device support 1023# Display device support
@@ -956,38 +1048,48 @@ CONFIG_LOGO_LINUX_MONO=y
956CONFIG_LOGO_LINUX_VGA16=y 1048CONFIG_LOGO_LINUX_VGA16=y
957CONFIG_LOGO_LINUX_CLUT224=y 1049CONFIG_LOGO_LINUX_CLUT224=y
958CONFIG_SOUND=m 1050CONFIG_SOUND=m
959# CONFIG_SOUND_OSS_CORE is not set 1051CONFIG_SOUND_OSS_CORE=y
1052CONFIG_SOUND_OSS_CORE_PRECLAIM=y
960CONFIG_SND=m 1053CONFIG_SND=m
961CONFIG_SND_TIMER=m 1054CONFIG_SND_TIMER=m
962CONFIG_SND_PCM=m 1055CONFIG_SND_PCM=m
963CONFIG_SND_JACK=y 1056CONFIG_SND_JACK=y
964# CONFIG_SND_SEQUENCER is not set 1057# CONFIG_SND_SEQUENCER is not set
965# CONFIG_SND_MIXER_OSS is not set 1058CONFIG_SND_OSSEMUL=y
966# CONFIG_SND_PCM_OSS is not set 1059CONFIG_SND_MIXER_OSS=m
1060CONFIG_SND_PCM_OSS=m
1061CONFIG_SND_PCM_OSS_PLUGINS=y
967# CONFIG_SND_DYNAMIC_MINORS is not set 1062# CONFIG_SND_DYNAMIC_MINORS is not set
968CONFIG_SND_SUPPORT_OLD_API=y 1063CONFIG_SND_SUPPORT_OLD_API=y
969CONFIG_SND_VERBOSE_PROCFS=y 1064CONFIG_SND_VERBOSE_PROCFS=y
970# CONFIG_SND_VERBOSE_PRINTK is not set 1065# CONFIG_SND_VERBOSE_PRINTK is not set
971# CONFIG_SND_DEBUG is not set 1066# CONFIG_SND_DEBUG is not set
972CONFIG_SND_DRIVERS=y 1067CONFIG_SND_VMASTER=y
973# CONFIG_SND_DUMMY is not set 1068# CONFIG_SND_RAWMIDI_SEQ is not set
974# CONFIG_SND_MTPAV is not set 1069# CONFIG_SND_OPL3_LIB_SEQ is not set
975# CONFIG_SND_SERIAL_U16550 is not set 1070# CONFIG_SND_OPL4_LIB_SEQ is not set
976# CONFIG_SND_MPU401 is not set 1071# CONFIG_SND_SBAWE_SEQ is not set
1072# CONFIG_SND_EMU10K1_SEQ is not set
1073CONFIG_SND_AC97_CODEC=m
1074# CONFIG_SND_DRIVERS is not set
977CONFIG_SND_ARM=y 1075CONFIG_SND_ARM=y
978CONFIG_SND_PXA2XX_LIB=m 1076CONFIG_SND_PXA2XX_LIB=m
1077CONFIG_SND_PXA2XX_LIB_AC97=y
979# CONFIG_SND_PXA2XX_AC97 is not set 1078# CONFIG_SND_PXA2XX_AC97 is not set
980CONFIG_SND_USB=y 1079# CONFIG_SND_SPI is not set
981# CONFIG_SND_USB_AUDIO is not set 1080# CONFIG_SND_USB is not set
982# CONFIG_SND_USB_CAIAQ is not set
983CONFIG_SND_SOC=m 1081CONFIG_SND_SOC=m
1082CONFIG_SND_SOC_AC97_BUS=y
984CONFIG_SND_PXA2XX_SOC=m 1083CONFIG_SND_PXA2XX_SOC=m
1084CONFIG_SND_PXA2XX_SOC_AC97=m
1085CONFIG_SND_PXA2XX_SOC_EM_X270=m
985CONFIG_SND_SOC_I2C_AND_SPI=m 1086CONFIG_SND_SOC_I2C_AND_SPI=m
986# CONFIG_SND_SOC_ALL_CODECS is not set 1087# CONFIG_SND_SOC_ALL_CODECS is not set
1088CONFIG_SND_SOC_WM9712=m
987# CONFIG_SOUND_PRIME is not set 1089# CONFIG_SOUND_PRIME is not set
1090CONFIG_AC97_BUS=m
988CONFIG_HID_SUPPORT=y 1091CONFIG_HID_SUPPORT=y
989CONFIG_HID=y 1092CONFIG_HID=y
990CONFIG_HID_DEBUG=y
991# CONFIG_HIDRAW is not set 1093# CONFIG_HIDRAW is not set
992 1094
993# 1095#
@@ -1006,10 +1108,12 @@ CONFIG_HID_BELKIN=y
1006CONFIG_HID_CHERRY=y 1108CONFIG_HID_CHERRY=y
1007CONFIG_HID_CHICONY=y 1109CONFIG_HID_CHICONY=y
1008CONFIG_HID_CYPRESS=y 1110CONFIG_HID_CYPRESS=y
1111CONFIG_HID_DRAGONRISE=y
1009# CONFIG_DRAGONRISE_FF is not set 1112# CONFIG_DRAGONRISE_FF is not set
1010CONFIG_HID_EZKEY=y 1113CONFIG_HID_EZKEY=y
1011CONFIG_HID_KYE=y 1114CONFIG_HID_KYE=y
1012CONFIG_HID_GYRATION=y 1115CONFIG_HID_GYRATION=y
1116CONFIG_HID_TWINHAN=y
1013CONFIG_HID_KENSINGTON=y 1117CONFIG_HID_KENSINGTON=y
1014CONFIG_HID_LOGITECH=y 1118CONFIG_HID_LOGITECH=y
1015# CONFIG_LOGITECH_FF is not set 1119# CONFIG_LOGITECH_FF is not set
@@ -1023,9 +1127,15 @@ CONFIG_HID_PETALYNX=y
1023CONFIG_HID_SAMSUNG=y 1127CONFIG_HID_SAMSUNG=y
1024CONFIG_HID_SONY=y 1128CONFIG_HID_SONY=y
1025CONFIG_HID_SUNPLUS=y 1129CONFIG_HID_SUNPLUS=y
1130CONFIG_HID_GREENASIA=y
1026# CONFIG_GREENASIA_FF is not set 1131# CONFIG_GREENASIA_FF is not set
1132CONFIG_HID_SMARTJOYPLUS=y
1133# CONFIG_SMARTJOYPLUS_FF is not set
1027CONFIG_HID_TOPSEED=y 1134CONFIG_HID_TOPSEED=y
1135CONFIG_HID_THRUSTMASTER=y
1028# CONFIG_THRUSTMASTER_FF is not set 1136# CONFIG_THRUSTMASTER_FF is not set
1137CONFIG_HID_WACOM=m
1138CONFIG_HID_ZEROPLUS=y
1029# CONFIG_ZEROPLUS_FF is not set 1139# CONFIG_ZEROPLUS_FF is not set
1030CONFIG_USB_SUPPORT=y 1140CONFIG_USB_SUPPORT=y
1031CONFIG_USB_ARCH_HAS_HCD=y 1141CONFIG_USB_ARCH_HAS_HCD=y
@@ -1054,6 +1164,7 @@ CONFIG_USB_MON=y
1054# CONFIG_USB_OXU210HP_HCD is not set 1164# CONFIG_USB_OXU210HP_HCD is not set
1055# CONFIG_USB_ISP116X_HCD is not set 1165# CONFIG_USB_ISP116X_HCD is not set
1056# CONFIG_USB_ISP1760_HCD is not set 1166# CONFIG_USB_ISP1760_HCD is not set
1167# CONFIG_USB_ISP1362_HCD is not set
1057CONFIG_USB_OHCI_HCD=y 1168CONFIG_USB_OHCI_HCD=y
1058# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set 1169# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
1059# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set 1170# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
@@ -1151,8 +1262,9 @@ CONFIG_MMC_BLOCK_BOUNCE=y
1151# 1262#
1152CONFIG_MMC_PXA=m 1263CONFIG_MMC_PXA=m
1153# CONFIG_MMC_SDHCI is not set 1264# CONFIG_MMC_SDHCI is not set
1265# CONFIG_MMC_AT91 is not set
1266# CONFIG_MMC_ATMELMCI is not set
1154# CONFIG_MEMSTICK is not set 1267# CONFIG_MEMSTICK is not set
1155# CONFIG_ACCESSIBILITY is not set
1156CONFIG_NEW_LEDS=y 1268CONFIG_NEW_LEDS=y
1157CONFIG_LEDS_CLASS=y 1269CONFIG_LEDS_CLASS=y
1158 1270
@@ -1162,8 +1274,10 @@ CONFIG_LEDS_CLASS=y
1162# CONFIG_LEDS_PCA9532 is not set 1274# CONFIG_LEDS_PCA9532 is not set
1163CONFIG_LEDS_GPIO=y 1275CONFIG_LEDS_GPIO=y
1164CONFIG_LEDS_GPIO_PLATFORM=y 1276CONFIG_LEDS_GPIO_PLATFORM=y
1165# CONFIG_LEDS_LP5521 is not set 1277# CONFIG_LEDS_LP3944 is not set
1166# CONFIG_LEDS_PCA955X is not set 1278# CONFIG_LEDS_PCA955X is not set
1279# CONFIG_LEDS_DA903X is not set
1280# CONFIG_LEDS_DAC124S085 is not set
1167# CONFIG_LEDS_BD2802 is not set 1281# CONFIG_LEDS_BD2802 is not set
1168 1282
1169# 1283#
@@ -1179,6 +1293,7 @@ CONFIG_LEDS_TRIGGER_HEARTBEAT=y
1179# 1293#
1180# iptables trigger is under Netfilter config (LED target) 1294# iptables trigger is under Netfilter config (LED target)
1181# 1295#
1296# CONFIG_ACCESSIBILITY is not set
1182CONFIG_RTC_LIB=y 1297CONFIG_RTC_LIB=y
1183CONFIG_RTC_CLASS=y 1298CONFIG_RTC_CLASS=y
1184CONFIG_RTC_HCTOSYS=y 1299CONFIG_RTC_HCTOSYS=y
@@ -1210,10 +1325,19 @@ CONFIG_RTC_INTF_DEV=y
1210# CONFIG_RTC_DRV_S35390A is not set 1325# CONFIG_RTC_DRV_S35390A is not set
1211# CONFIG_RTC_DRV_FM3130 is not set 1326# CONFIG_RTC_DRV_FM3130 is not set
1212# CONFIG_RTC_DRV_RX8581 is not set 1327# CONFIG_RTC_DRV_RX8581 is not set
1328# CONFIG_RTC_DRV_RX8025 is not set
1213 1329
1214# 1330#
1215# SPI RTC drivers 1331# SPI RTC drivers
1216# 1332#
1333# CONFIG_RTC_DRV_M41T94 is not set
1334# CONFIG_RTC_DRV_DS1305 is not set
1335# CONFIG_RTC_DRV_DS1390 is not set
1336# CONFIG_RTC_DRV_MAX6902 is not set
1337# CONFIG_RTC_DRV_R9701 is not set
1338# CONFIG_RTC_DRV_RS5C348 is not set
1339# CONFIG_RTC_DRV_DS3234 is not set
1340# CONFIG_RTC_DRV_PCF2123 is not set
1217 1341
1218# 1342#
1219# Platform RTC drivers 1343# Platform RTC drivers
@@ -1233,12 +1357,15 @@ CONFIG_RTC_DRV_V3020=y
1233# 1357#
1234# on-CPU RTC drivers 1358# on-CPU RTC drivers
1235# 1359#
1236CONFIG_RTC_DRV_SA1100=y 1360# CONFIG_RTC_DRV_SA1100 is not set
1237# CONFIG_RTC_DRV_PXA is not set 1361CONFIG_RTC_DRV_PXA=y
1238# CONFIG_DMADEVICES is not set 1362# CONFIG_DMADEVICES is not set
1239# CONFIG_AUXDISPLAY is not set 1363# CONFIG_AUXDISPLAY is not set
1240# CONFIG_REGULATOR is not set
1241# CONFIG_UIO is not set 1364# CONFIG_UIO is not set
1365
1366#
1367# TI VLYNQ
1368#
1242# CONFIG_STAGING is not set 1369# CONFIG_STAGING is not set
1243 1370
1244# 1371#
@@ -1256,10 +1383,13 @@ CONFIG_JBD=y
1256# CONFIG_REISERFS_FS is not set 1383# CONFIG_REISERFS_FS is not set
1257# CONFIG_JFS_FS is not set 1384# CONFIG_JFS_FS is not set
1258CONFIG_FS_POSIX_ACL=y 1385CONFIG_FS_POSIX_ACL=y
1259CONFIG_FILE_LOCKING=y
1260# CONFIG_XFS_FS is not set 1386# CONFIG_XFS_FS is not set
1387# CONFIG_GFS2_FS is not set
1261# CONFIG_OCFS2_FS is not set 1388# CONFIG_OCFS2_FS is not set
1262# CONFIG_BTRFS_FS is not set 1389# CONFIG_BTRFS_FS is not set
1390# CONFIG_NILFS2_FS is not set
1391CONFIG_FILE_LOCKING=y
1392CONFIG_FSNOTIFY=y
1263CONFIG_DNOTIFY=y 1393CONFIG_DNOTIFY=y
1264CONFIG_INOTIFY=y 1394CONFIG_INOTIFY=y
1265CONFIG_INOTIFY_USER=y 1395CONFIG_INOTIFY_USER=y
@@ -1319,6 +1449,12 @@ CONFIG_JFFS2_ZLIB=y
1319# CONFIG_JFFS2_LZO is not set 1449# CONFIG_JFFS2_LZO is not set
1320CONFIG_JFFS2_RTIME=y 1450CONFIG_JFFS2_RTIME=y
1321# CONFIG_JFFS2_RUBIN is not set 1451# CONFIG_JFFS2_RUBIN is not set
1452CONFIG_UBIFS_FS=y
1453# CONFIG_UBIFS_FS_XATTR is not set
1454# CONFIG_UBIFS_FS_ADVANCED_COMPR is not set
1455CONFIG_UBIFS_FS_LZO=y
1456CONFIG_UBIFS_FS_ZLIB=y
1457# CONFIG_UBIFS_FS_DEBUG is not set
1322# CONFIG_CRAMFS is not set 1458# CONFIG_CRAMFS is not set
1323# CONFIG_SQUASHFS is not set 1459# CONFIG_SQUASHFS is not set
1324# CONFIG_VXFS_FS is not set 1460# CONFIG_VXFS_FS is not set
@@ -1329,12 +1465,12 @@ CONFIG_JFFS2_RTIME=y
1329# CONFIG_ROMFS_FS is not set 1465# CONFIG_ROMFS_FS is not set
1330# CONFIG_SYSV_FS is not set 1466# CONFIG_SYSV_FS is not set
1331# CONFIG_UFS_FS is not set 1467# CONFIG_UFS_FS is not set
1332# CONFIG_NILFS2_FS is not set
1333CONFIG_NETWORK_FILESYSTEMS=y 1468CONFIG_NETWORK_FILESYSTEMS=y
1334CONFIG_NFS_FS=y 1469CONFIG_NFS_FS=y
1335CONFIG_NFS_V3=y 1470CONFIG_NFS_V3=y
1336CONFIG_NFS_V3_ACL=y 1471CONFIG_NFS_V3_ACL=y
1337CONFIG_NFS_V4=y 1472CONFIG_NFS_V4=y
1473# CONFIG_NFS_V4_1 is not set
1338CONFIG_ROOT_NFS=y 1474CONFIG_ROOT_NFS=y
1339# CONFIG_NFSD is not set 1475# CONFIG_NFSD is not set
1340CONFIG_LOCKD=y 1476CONFIG_LOCKD=y
@@ -1378,7 +1514,7 @@ CONFIG_MSDOS_PARTITION=y
1378# CONFIG_KARMA_PARTITION is not set 1514# CONFIG_KARMA_PARTITION is not set
1379# CONFIG_EFI_PARTITION is not set 1515# CONFIG_EFI_PARTITION is not set
1380# CONFIG_SYSV68_PARTITION is not set 1516# CONFIG_SYSV68_PARTITION is not set
1381CONFIG_NLS=m 1517CONFIG_NLS=y
1382CONFIG_NLS_DEFAULT="iso8859-1" 1518CONFIG_NLS_DEFAULT="iso8859-1"
1383CONFIG_NLS_CODEPAGE_437=m 1519CONFIG_NLS_CODEPAGE_437=m
1384# CONFIG_NLS_CODEPAGE_737 is not set 1520# CONFIG_NLS_CODEPAGE_737 is not set
@@ -1428,6 +1564,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
1428CONFIG_ENABLE_MUST_CHECK=y 1564CONFIG_ENABLE_MUST_CHECK=y
1429CONFIG_FRAME_WARN=1024 1565CONFIG_FRAME_WARN=1024
1430# CONFIG_MAGIC_SYSRQ is not set 1566# CONFIG_MAGIC_SYSRQ is not set
1567# CONFIG_STRIP_ASM_SYMS is not set
1431# CONFIG_UNUSED_SYMBOLS is not set 1568# CONFIG_UNUSED_SYMBOLS is not set
1432CONFIG_DEBUG_FS=y 1569CONFIG_DEBUG_FS=y
1433# CONFIG_HEADERS_CHECK is not set 1570# CONFIG_HEADERS_CHECK is not set
@@ -1441,6 +1578,7 @@ CONFIG_DEBUG_KERNEL=y
1441# CONFIG_DEBUG_OBJECTS is not set 1578# CONFIG_DEBUG_OBJECTS is not set
1442# CONFIG_SLUB_DEBUG_ON is not set 1579# CONFIG_SLUB_DEBUG_ON is not set
1443# CONFIG_SLUB_STATS is not set 1580# CONFIG_SLUB_STATS is not set
1581# CONFIG_DEBUG_KMEMLEAK is not set
1444# CONFIG_DEBUG_RT_MUTEXES is not set 1582# CONFIG_DEBUG_RT_MUTEXES is not set
1445# CONFIG_RT_MUTEX_TESTER is not set 1583# CONFIG_RT_MUTEX_TESTER is not set
1446# CONFIG_DEBUG_SPINLOCK is not set 1584# CONFIG_DEBUG_SPINLOCK is not set
@@ -1460,32 +1598,20 @@ CONFIG_DEBUG_MEMORY_INIT=y
1460# CONFIG_DEBUG_LIST is not set 1598# CONFIG_DEBUG_LIST is not set
1461# CONFIG_DEBUG_SG is not set 1599# CONFIG_DEBUG_SG is not set
1462# CONFIG_DEBUG_NOTIFIERS is not set 1600# CONFIG_DEBUG_NOTIFIERS is not set
1601# CONFIG_DEBUG_CREDENTIALS is not set
1463# CONFIG_BOOT_PRINTK_DELAY is not set 1602# CONFIG_BOOT_PRINTK_DELAY is not set
1464# CONFIG_RCU_TORTURE_TEST is not set 1603# CONFIG_RCU_TORTURE_TEST is not set
1465# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1604# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1466# CONFIG_BACKTRACE_SELF_TEST is not set 1605# CONFIG_BACKTRACE_SELF_TEST is not set
1467# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 1606# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1607# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
1468# CONFIG_FAULT_INJECTION is not set 1608# CONFIG_FAULT_INJECTION is not set
1469# CONFIG_LATENCYTOP is not set 1609# CONFIG_LATENCYTOP is not set
1470CONFIG_SYSCTL_SYSCALL_CHECK=y 1610CONFIG_SYSCTL_SYSCALL_CHECK=y
1471# CONFIG_PAGE_POISONING is not set 1611# CONFIG_PAGE_POISONING is not set
1472CONFIG_HAVE_FUNCTION_TRACER=y 1612CONFIG_HAVE_FUNCTION_TRACER=y
1473CONFIG_TRACING_SUPPORT=y 1613CONFIG_TRACING_SUPPORT=y
1474 1614# CONFIG_FTRACE is not set
1475#
1476# Tracers
1477#
1478# CONFIG_FUNCTION_TRACER is not set
1479# CONFIG_IRQSOFF_TRACER is not set
1480# CONFIG_SCHED_TRACER is not set
1481# CONFIG_CONTEXT_SWITCH_TRACER is not set
1482# CONFIG_EVENT_TRACER is not set
1483# CONFIG_BOOT_TRACER is not set
1484# CONFIG_TRACE_BRANCH_PROFILING is not set
1485# CONFIG_STACK_TRACER is not set
1486# CONFIG_KMEMTRACE is not set
1487# CONFIG_WORKQUEUE_TRACER is not set
1488# CONFIG_BLK_DEV_IO_TRACE is not set
1489# CONFIG_DYNAMIC_DEBUG is not set 1615# CONFIG_DYNAMIC_DEBUG is not set
1490# CONFIG_SAMPLES is not set 1616# CONFIG_SAMPLES is not set
1491CONFIG_HAVE_ARCH_KGDB=y 1617CONFIG_HAVE_ARCH_KGDB=y
@@ -1509,7 +1635,6 @@ CONFIG_CRYPTO=y
1509# 1635#
1510# Crypto core or helper 1636# Crypto core or helper
1511# 1637#
1512# CONFIG_CRYPTO_FIPS is not set
1513CONFIG_CRYPTO_ALGAPI=y 1638CONFIG_CRYPTO_ALGAPI=y
1514CONFIG_CRYPTO_ALGAPI2=y 1639CONFIG_CRYPTO_ALGAPI2=y
1515CONFIG_CRYPTO_AEAD2=y 1640CONFIG_CRYPTO_AEAD2=y
@@ -1551,11 +1676,13 @@ CONFIG_CRYPTO_ECB=m
1551# 1676#
1552# CONFIG_CRYPTO_HMAC is not set 1677# CONFIG_CRYPTO_HMAC is not set
1553# CONFIG_CRYPTO_XCBC is not set 1678# CONFIG_CRYPTO_XCBC is not set
1679# CONFIG_CRYPTO_VMAC is not set
1554 1680
1555# 1681#
1556# Digest 1682# Digest
1557# 1683#
1558# CONFIG_CRYPTO_CRC32C is not set 1684# CONFIG_CRYPTO_CRC32C is not set
1685# CONFIG_CRYPTO_GHASH is not set
1559# CONFIG_CRYPTO_MD4 is not set 1686# CONFIG_CRYPTO_MD4 is not set
1560CONFIG_CRYPTO_MD5=y 1687CONFIG_CRYPTO_MD5=y
1561CONFIG_CRYPTO_MICHAEL_MIC=m 1688CONFIG_CRYPTO_MICHAEL_MIC=m
@@ -1591,9 +1718,9 @@ CONFIG_CRYPTO_DES=y
1591# 1718#
1592# Compression 1719# Compression
1593# 1720#
1594# CONFIG_CRYPTO_DEFLATE is not set 1721CONFIG_CRYPTO_DEFLATE=y
1595# CONFIG_CRYPTO_ZLIB is not set 1722# CONFIG_CRYPTO_ZLIB is not set
1596# CONFIG_CRYPTO_LZO is not set 1723CONFIG_CRYPTO_LZO=y
1597 1724
1598# 1725#
1599# Random Number Generation 1726# Random Number Generation
@@ -1608,7 +1735,7 @@ CONFIG_CRYPTO_DES=y
1608CONFIG_BITREVERSE=y 1735CONFIG_BITREVERSE=y
1609CONFIG_GENERIC_FIND_LAST_BIT=y 1736CONFIG_GENERIC_FIND_LAST_BIT=y
1610# CONFIG_CRC_CCITT is not set 1737# CONFIG_CRC_CCITT is not set
1611# CONFIG_CRC16 is not set 1738CONFIG_CRC16=y
1612CONFIG_CRC_T10DIF=y 1739CONFIG_CRC_T10DIF=y
1613# CONFIG_CRC_ITU_T is not set 1740# CONFIG_CRC_ITU_T is not set
1614CONFIG_CRC32=y 1741CONFIG_CRC32=y
@@ -1616,6 +1743,8 @@ CONFIG_CRC32=y
1616# CONFIG_LIBCRC32C is not set 1743# CONFIG_LIBCRC32C is not set
1617CONFIG_ZLIB_INFLATE=y 1744CONFIG_ZLIB_INFLATE=y
1618CONFIG_ZLIB_DEFLATE=y 1745CONFIG_ZLIB_DEFLATE=y
1746CONFIG_LZO_COMPRESS=y
1747CONFIG_LZO_DECOMPRESS=y
1619CONFIG_DECOMPRESS_GZIP=y 1748CONFIG_DECOMPRESS_GZIP=y
1620CONFIG_DECOMPRESS_BZIP2=y 1749CONFIG_DECOMPRESS_BZIP2=y
1621CONFIG_DECOMPRESS_LZMA=y 1750CONFIG_DECOMPRESS_LZMA=y
diff --git a/arch/arm/configs/da850_omapl138_defconfig b/arch/arm/configs/da8xx_omapl_defconfig
index 842a70b079bf..50bd25a10f0d 100644
--- a/arch/arm/configs/da850_omapl138_defconfig
+++ b/arch/arm/configs/da8xx_omapl_defconfig
@@ -1,15 +1,13 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-davinci1 3# Linux kernel version: 2.6.32-rc5
4# Mon Jun 29 07:54:15 2009 4# Thu Oct 22 12:19:19 2009
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y 7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y 8CONFIG_GENERIC_GPIO=y
9CONFIG_GENERIC_TIME=y 9CONFIG_GENERIC_TIME=y
10CONFIG_GENERIC_CLOCKEVENTS=y 10CONFIG_GENERIC_CLOCKEVENTS=y
11CONFIG_MMU=y
12# CONFIG_NO_IOPORT is not set
13CONFIG_GENERIC_HARDIRQS=y 11CONFIG_GENERIC_HARDIRQS=y
14CONFIG_STACKTRACE_SUPPORT=y 12CONFIG_STACKTRACE_SUPPORT=y
15CONFIG_HAVE_LATENCYTOP_SUPPORT=y 13CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -18,14 +16,14 @@ CONFIG_TRACE_IRQFLAGS_SUPPORT=y
18CONFIG_HARDIRQS_SW_RESEND=y 16CONFIG_HARDIRQS_SW_RESEND=y
19CONFIG_GENERIC_IRQ_PROBE=y 17CONFIG_GENERIC_IRQ_PROBE=y
20CONFIG_RWSEM_GENERIC_SPINLOCK=y 18CONFIG_RWSEM_GENERIC_SPINLOCK=y
21# CONFIG_ARCH_HAS_ILOG2_U32 is not set 19CONFIG_ARCH_HAS_CPUFREQ=y
22# CONFIG_ARCH_HAS_ILOG2_U64 is not set
23CONFIG_GENERIC_HWEIGHT=y 20CONFIG_GENERIC_HWEIGHT=y
24CONFIG_GENERIC_CALIBRATE_DELAY=y 21CONFIG_GENERIC_CALIBRATE_DELAY=y
25CONFIG_ZONE_DMA=y 22CONFIG_ZONE_DMA=y
26CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 23CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
27CONFIG_VECTORS_BASE=0xffff0000 24CONFIG_VECTORS_BASE=0xffff0000
28CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 25CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
26CONFIG_CONSTRUCTORS=y
29 27
30# 28#
31# General setup 29# General setup
@@ -48,11 +46,12 @@ CONFIG_POSIX_MQUEUE_SYSCTL=y
48# 46#
49# RCU Subsystem 47# RCU Subsystem
50# 48#
51CONFIG_CLASSIC_RCU=y 49CONFIG_TREE_RCU=y
52# CONFIG_TREE_RCU is not set 50# CONFIG_TREE_PREEMPT_RCU is not set
53# CONFIG_PREEMPT_RCU is not set 51# CONFIG_RCU_TRACE is not set
52CONFIG_RCU_FANOUT=32
53# CONFIG_RCU_FANOUT_EXACT is not set
54# CONFIG_TREE_RCU_TRACE is not set 54# CONFIG_TREE_RCU_TRACE is not set
55# CONFIG_PREEMPT_RCU_TRACE is not set
56CONFIG_IKCONFIG=y 55CONFIG_IKCONFIG=y
57CONFIG_IKCONFIG_PROC=y 56CONFIG_IKCONFIG_PROC=y
58CONFIG_LOG_BUF_SHIFT=14 57CONFIG_LOG_BUF_SHIFT=14
@@ -62,8 +61,7 @@ CONFIG_FAIR_GROUP_SCHED=y
62CONFIG_USER_SCHED=y 61CONFIG_USER_SCHED=y
63# CONFIG_CGROUP_SCHED is not set 62# CONFIG_CGROUP_SCHED is not set
64# CONFIG_CGROUPS is not set 63# CONFIG_CGROUPS is not set
65CONFIG_SYSFS_DEPRECATED=y 64# CONFIG_SYSFS_DEPRECATED_V2 is not set
66CONFIG_SYSFS_DEPRECATED_V2=y
67# CONFIG_RELAY is not set 65# CONFIG_RELAY is not set
68# CONFIG_NAMESPACES is not set 66# CONFIG_NAMESPACES is not set
69CONFIG_BLK_DEV_INITRD=y 67CONFIG_BLK_DEV_INITRD=y
@@ -80,7 +78,6 @@ CONFIG_SYSCTL_SYSCALL=y
80CONFIG_KALLSYMS=y 78CONFIG_KALLSYMS=y
81# CONFIG_KALLSYMS_ALL is not set 79# CONFIG_KALLSYMS_ALL is not set
82# CONFIG_KALLSYMS_EXTRA_PASS is not set 80# CONFIG_KALLSYMS_EXTRA_PASS is not set
83# CONFIG_STRIP_ASM_SYMS is not set
84CONFIG_HOTPLUG=y 81CONFIG_HOTPLUG=y
85CONFIG_PRINTK=y 82CONFIG_PRINTK=y
86CONFIG_BUG=y 83CONFIG_BUG=y
@@ -93,6 +90,10 @@ CONFIG_TIMERFD=y
93CONFIG_EVENTFD=y 90CONFIG_EVENTFD=y
94CONFIG_SHMEM=y 91CONFIG_SHMEM=y
95CONFIG_AIO=y 92CONFIG_AIO=y
93
94#
95# Kernel Performance Events And Counters
96#
96CONFIG_VM_EVENT_COUNTERS=y 97CONFIG_VM_EVENT_COUNTERS=y
97CONFIG_SLUB_DEBUG=y 98CONFIG_SLUB_DEBUG=y
98CONFIG_COMPAT_BRK=y 99CONFIG_COMPAT_BRK=y
@@ -100,12 +101,16 @@ CONFIG_COMPAT_BRK=y
100CONFIG_SLUB=y 101CONFIG_SLUB=y
101# CONFIG_SLOB is not set 102# CONFIG_SLOB is not set
102# CONFIG_PROFILING is not set 103# CONFIG_PROFILING is not set
103# CONFIG_MARKERS is not set
104CONFIG_HAVE_OPROFILE=y 104CONFIG_HAVE_OPROFILE=y
105# CONFIG_KPROBES is not set 105# CONFIG_KPROBES is not set
106CONFIG_HAVE_KPROBES=y 106CONFIG_HAVE_KPROBES=y
107CONFIG_HAVE_KRETPROBES=y 107CONFIG_HAVE_KRETPROBES=y
108CONFIG_HAVE_CLK=y 108CONFIG_HAVE_CLK=y
109
110#
111# GCOV-based kernel profiling
112#
113# CONFIG_GCOV_KERNEL is not set
109# CONFIG_SLOW_WORK is not set 114# CONFIG_SLOW_WORK is not set
110CONFIG_HAVE_GENERIC_DMA_COHERENT=y 115CONFIG_HAVE_GENERIC_DMA_COHERENT=y
111CONFIG_SLABINFO=y 116CONFIG_SLABINFO=y
@@ -118,7 +123,7 @@ CONFIG_MODULE_FORCE_UNLOAD=y
118CONFIG_MODVERSIONS=y 123CONFIG_MODVERSIONS=y
119# CONFIG_MODULE_SRCVERSION_ALL is not set 124# CONFIG_MODULE_SRCVERSION_ALL is not set
120CONFIG_BLOCK=y 125CONFIG_BLOCK=y
121# CONFIG_LBD is not set 126CONFIG_LBDAF=y
122# CONFIG_BLK_DEV_BSG is not set 127# CONFIG_BLK_DEV_BSG is not set
123# CONFIG_BLK_DEV_INTEGRITY is not set 128# CONFIG_BLK_DEV_INTEGRITY is not set
124 129
@@ -139,19 +144,22 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
139# 144#
140# System Type 145# System Type
141# 146#
147CONFIG_MMU=y
142# CONFIG_ARCH_AAEC2000 is not set 148# CONFIG_ARCH_AAEC2000 is not set
143# CONFIG_ARCH_INTEGRATOR is not set 149# CONFIG_ARCH_INTEGRATOR is not set
144# CONFIG_ARCH_REALVIEW is not set 150# CONFIG_ARCH_REALVIEW is not set
145# CONFIG_ARCH_VERSATILE is not set 151# CONFIG_ARCH_VERSATILE is not set
146# CONFIG_ARCH_AT91 is not set 152# CONFIG_ARCH_AT91 is not set
147# CONFIG_ARCH_CLPS711X is not set 153# CONFIG_ARCH_CLPS711X is not set
154# CONFIG_ARCH_GEMINI is not set
148# CONFIG_ARCH_EBSA110 is not set 155# CONFIG_ARCH_EBSA110 is not set
149# CONFIG_ARCH_EP93XX is not set 156# CONFIG_ARCH_EP93XX is not set
150# CONFIG_ARCH_GEMINI is not set
151# CONFIG_ARCH_FOOTBRIDGE is not set 157# CONFIG_ARCH_FOOTBRIDGE is not set
158# CONFIG_ARCH_MXC is not set
159# CONFIG_ARCH_STMP3XXX is not set
152# CONFIG_ARCH_NETX is not set 160# CONFIG_ARCH_NETX is not set
153# CONFIG_ARCH_H720X is not set 161# CONFIG_ARCH_H720X is not set
154# CONFIG_ARCH_IMX is not set 162# CONFIG_ARCH_NOMADIK is not set
155# CONFIG_ARCH_IOP13XX is not set 163# CONFIG_ARCH_IOP13XX is not set
156# CONFIG_ARCH_IOP32X is not set 164# CONFIG_ARCH_IOP32X is not set
157# CONFIG_ARCH_IOP33X is not set 165# CONFIG_ARCH_IOP33X is not set
@@ -160,25 +168,27 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
160# CONFIG_ARCH_IXP4XX is not set 168# CONFIG_ARCH_IXP4XX is not set
161# CONFIG_ARCH_L7200 is not set 169# CONFIG_ARCH_L7200 is not set
162# CONFIG_ARCH_KIRKWOOD is not set 170# CONFIG_ARCH_KIRKWOOD is not set
163# CONFIG_ARCH_KS8695 is not set
164# CONFIG_ARCH_NS9XXX is not set
165# CONFIG_ARCH_LOKI is not set 171# CONFIG_ARCH_LOKI is not set
166# CONFIG_ARCH_MV78XX0 is not set 172# CONFIG_ARCH_MV78XX0 is not set
167# CONFIG_ARCH_MXC is not set
168# CONFIG_ARCH_ORION5X is not set 173# CONFIG_ARCH_ORION5X is not set
174# CONFIG_ARCH_MMP is not set
175# CONFIG_ARCH_KS8695 is not set
176# CONFIG_ARCH_NS9XXX is not set
177# CONFIG_ARCH_W90X900 is not set
169# CONFIG_ARCH_PNX4008 is not set 178# CONFIG_ARCH_PNX4008 is not set
170# CONFIG_ARCH_PXA is not set 179# CONFIG_ARCH_PXA is not set
171# CONFIG_ARCH_MMP is not set 180# CONFIG_ARCH_MSM is not set
172# CONFIG_ARCH_RPC is not set 181# CONFIG_ARCH_RPC is not set
173# CONFIG_ARCH_SA1100 is not set 182# CONFIG_ARCH_SA1100 is not set
174# CONFIG_ARCH_S3C2410 is not set 183# CONFIG_ARCH_S3C2410 is not set
175# CONFIG_ARCH_S3C64XX is not set 184# CONFIG_ARCH_S3C64XX is not set
185# CONFIG_ARCH_S5PC1XX is not set
176# CONFIG_ARCH_SHARK is not set 186# CONFIG_ARCH_SHARK is not set
177# CONFIG_ARCH_LH7A40X is not set 187# CONFIG_ARCH_LH7A40X is not set
188# CONFIG_ARCH_U300 is not set
178CONFIG_ARCH_DAVINCI=y 189CONFIG_ARCH_DAVINCI=y
179# CONFIG_ARCH_OMAP is not set 190# CONFIG_ARCH_OMAP is not set
180# CONFIG_ARCH_MSM is not set 191# CONFIG_ARCH_BCMRING is not set
181# CONFIG_ARCH_W90X900 is not set
182CONFIG_CP_INTC=y 192CONFIG_CP_INTC=y
183 193
184# 194#
@@ -191,7 +201,7 @@ CONFIG_CP_INTC=y
191# CONFIG_ARCH_DAVINCI_DM644x is not set 201# CONFIG_ARCH_DAVINCI_DM644x is not set
192# CONFIG_ARCH_DAVINCI_DM355 is not set 202# CONFIG_ARCH_DAVINCI_DM355 is not set
193# CONFIG_ARCH_DAVINCI_DM646x is not set 203# CONFIG_ARCH_DAVINCI_DM646x is not set
194# CONFIG_ARCH_DAVINCI_DA830 is not set 204CONFIG_ARCH_DAVINCI_DA830=y
195CONFIG_ARCH_DAVINCI_DA850=y 205CONFIG_ARCH_DAVINCI_DA850=y
196CONFIG_ARCH_DAVINCI_DA8XX=y 206CONFIG_ARCH_DAVINCI_DA8XX=y
197# CONFIG_ARCH_DAVINCI_DM365 is not set 207# CONFIG_ARCH_DAVINCI_DM365 is not set
@@ -199,7 +209,14 @@ CONFIG_ARCH_DAVINCI_DA8XX=y
199# 209#
200# DaVinci Board Type 210# DaVinci Board Type
201# 211#
212CONFIG_MACH_DAVINCI_DA830_EVM=y
213CONFIG_DA830_UI=y
214CONFIG_DA830_UI_LCD=y
215# CONFIG_DA830_UI_NAND is not set
202CONFIG_MACH_DAVINCI_DA850_EVM=y 216CONFIG_MACH_DAVINCI_DA850_EVM=y
217CONFIG_DA850_UI_EXP=y
218CONFIG_DA850_UI_NONE=y
219# CONFIG_DA850_UI_RMII is not set
203CONFIG_DAVINCI_MUX=y 220CONFIG_DAVINCI_MUX=y
204# CONFIG_DAVINCI_MUX_DEBUG is not set 221# CONFIG_DAVINCI_MUX_DEBUG is not set
205# CONFIG_DAVINCI_MUX_WARNINGS is not set 222# CONFIG_DAVINCI_MUX_WARNINGS is not set
@@ -212,7 +229,7 @@ CONFIG_CPU_32=y
212CONFIG_CPU_ARM926T=y 229CONFIG_CPU_ARM926T=y
213CONFIG_CPU_32v5=y 230CONFIG_CPU_32v5=y
214CONFIG_CPU_ABRT_EV5TJ=y 231CONFIG_CPU_ABRT_EV5TJ=y
215CONFIG_CPU_PABRT_NOIFAR=y 232CONFIG_CPU_PABRT_LEGACY=y
216CONFIG_CPU_CACHE_VIVT=y 233CONFIG_CPU_CACHE_VIVT=y
217CONFIG_CPU_COPY_V4WB=y 234CONFIG_CPU_COPY_V4WB=y
218CONFIG_CPU_TLB_V4WBI=y 235CONFIG_CPU_TLB_V4WBI=y
@@ -225,9 +242,9 @@ CONFIG_CPU_CP15_MMU=y
225CONFIG_ARM_THUMB=y 242CONFIG_ARM_THUMB=y
226# CONFIG_CPU_ICACHE_DISABLE is not set 243# CONFIG_CPU_ICACHE_DISABLE is not set
227# CONFIG_CPU_DCACHE_DISABLE is not set 244# CONFIG_CPU_DCACHE_DISABLE is not set
228# CONFIG_CPU_DCACHE_WRITETHROUGH is not set 245CONFIG_CPU_DCACHE_WRITETHROUGH=y
229# CONFIG_CPU_CACHE_ROUND_ROBIN is not set 246# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
230# CONFIG_OUTER_CACHE is not set 247CONFIG_ARM_L1_CACHE_SHIFT=5
231CONFIG_COMMON_CLKDEV=y 248CONFIG_COMMON_CLKDEV=y
232 249
233# 250#
@@ -248,11 +265,12 @@ CONFIG_VMSPLIT_3G=y
248# CONFIG_VMSPLIT_2G is not set 265# CONFIG_VMSPLIT_2G is not set
249# CONFIG_VMSPLIT_1G is not set 266# CONFIG_VMSPLIT_1G is not set
250CONFIG_PAGE_OFFSET=0xC0000000 267CONFIG_PAGE_OFFSET=0xC0000000
268# CONFIG_PREEMPT_NONE is not set
269# CONFIG_PREEMPT_VOLUNTARY is not set
251CONFIG_PREEMPT=y 270CONFIG_PREEMPT=y
252CONFIG_HZ=100 271CONFIG_HZ=100
253CONFIG_AEABI=y 272CONFIG_AEABI=y
254# CONFIG_OABI_COMPAT is not set 273# CONFIG_OABI_COMPAT is not set
255# CONFIG_ARCH_HAS_HOLES_MEMORYMODEL is not set
256# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set 274# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
257# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set 275# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
258# CONFIG_HIGHMEM is not set 276# CONFIG_HIGHMEM is not set
@@ -268,12 +286,14 @@ CONFIG_SPLIT_PTLOCK_CPUS=4096
268CONFIG_ZONE_DMA_FLAG=1 286CONFIG_ZONE_DMA_FLAG=1
269CONFIG_BOUNCE=y 287CONFIG_BOUNCE=y
270CONFIG_VIRT_TO_BUS=y 288CONFIG_VIRT_TO_BUS=y
271CONFIG_UNEVICTABLE_LRU=y
272CONFIG_HAVE_MLOCK=y 289CONFIG_HAVE_MLOCK=y
273CONFIG_HAVE_MLOCKED_PAGE_BIT=y 290CONFIG_HAVE_MLOCKED_PAGE_BIT=y
291# CONFIG_KSM is not set
292CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
274CONFIG_LEDS=y 293CONFIG_LEDS=y
275# CONFIG_LEDS_CPU is not set 294# CONFIG_LEDS_CPU is not set
276CONFIG_ALIGNMENT_TRAP=y 295CONFIG_ALIGNMENT_TRAP=y
296# CONFIG_UACCESS_WITH_MEMCPY is not set
277 297
278# 298#
279# Boot options 299# Boot options
@@ -287,7 +307,24 @@ CONFIG_CMDLINE=""
287# 307#
288# CPU Power Management 308# CPU Power Management
289# 309#
290# CONFIG_CPU_IDLE is not set 310CONFIG_CPU_FREQ=y
311CONFIG_CPU_FREQ_TABLE=y
312# CONFIG_CPU_FREQ_DEBUG is not set
313CONFIG_CPU_FREQ_STAT=y
314# CONFIG_CPU_FREQ_STAT_DETAILS is not set
315# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
316# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
317CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
318# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
319# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
320CONFIG_CPU_FREQ_GOV_PERFORMANCE=m
321CONFIG_CPU_FREQ_GOV_POWERSAVE=m
322CONFIG_CPU_FREQ_GOV_USERSPACE=y
323CONFIG_CPU_FREQ_GOV_ONDEMAND=m
324# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
325CONFIG_CPU_IDLE=y
326CONFIG_CPU_IDLE_GOV_LADDER=y
327CONFIG_CPU_IDLE_GOV_MENU=y
291 328
292# 329#
293# Floating point emulation 330# Floating point emulation
@@ -401,6 +438,7 @@ CONFIG_NETFILTER_ADVANCED=y
401# CONFIG_IP6_NF_IPTABLES is not set 438# CONFIG_IP6_NF_IPTABLES is not set
402# CONFIG_IP_DCCP is not set 439# CONFIG_IP_DCCP is not set
403# CONFIG_IP_SCTP is not set 440# CONFIG_IP_SCTP is not set
441# CONFIG_RDS is not set
404# CONFIG_TIPC is not set 442# CONFIG_TIPC is not set
405# CONFIG_ATM is not set 443# CONFIG_ATM is not set
406# CONFIG_BRIDGE is not set 444# CONFIG_BRIDGE is not set
@@ -415,6 +453,7 @@ CONFIG_NETFILTER_ADVANCED=y
415# CONFIG_ECONET is not set 453# CONFIG_ECONET is not set
416# CONFIG_WAN_ROUTER is not set 454# CONFIG_WAN_ROUTER is not set
417# CONFIG_PHONET is not set 455# CONFIG_PHONET is not set
456# CONFIG_IEEE802154 is not set
418# CONFIG_NET_SCHED is not set 457# CONFIG_NET_SCHED is not set
419# CONFIG_DCB is not set 458# CONFIG_DCB is not set
420 459
@@ -440,6 +479,7 @@ CONFIG_NETFILTER_ADVANCED=y
440# Generic Driver Options 479# Generic Driver Options
441# 480#
442CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 481CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
482# CONFIG_DEVTMPFS is not set
443CONFIG_STANDALONE=y 483CONFIG_STANDALONE=y
444CONFIG_PREVENT_FIRMWARE_BUILD=y 484CONFIG_PREVENT_FIRMWARE_BUILD=y
445# CONFIG_FW_LOADER is not set 485# CONFIG_FW_LOADER is not set
@@ -460,6 +500,7 @@ CONFIG_BLK_DEV_RAM_SIZE=32768
460# CONFIG_BLK_DEV_XIP is not set 500# CONFIG_BLK_DEV_XIP is not set
461# CONFIG_CDROM_PKTCDVD is not set 501# CONFIG_CDROM_PKTCDVD is not set
462# CONFIG_ATA_OVER_ETH is not set 502# CONFIG_ATA_OVER_ETH is not set
503# CONFIG_MG_DISK is not set
463CONFIG_MISC_DEVICES=y 504CONFIG_MISC_DEVICES=y
464# CONFIG_ICS932S401 is not set 505# CONFIG_ICS932S401 is not set
465# CONFIG_ENCLOSURE_SERVICES is not set 506# CONFIG_ENCLOSURE_SERVICES is not set
@@ -471,6 +512,7 @@ CONFIG_MISC_DEVICES=y
471# 512#
472CONFIG_EEPROM_AT24=y 513CONFIG_EEPROM_AT24=y
473# CONFIG_EEPROM_LEGACY is not set 514# CONFIG_EEPROM_LEGACY is not set
515# CONFIG_EEPROM_MAX6875 is not set
474# CONFIG_EEPROM_93CX6 is not set 516# CONFIG_EEPROM_93CX6 is not set
475CONFIG_HAVE_IDE=y 517CONFIG_HAVE_IDE=y
476# CONFIG_IDE is not set 518# CONFIG_IDE is not set
@@ -494,10 +536,6 @@ CONFIG_BLK_DEV_SD=m
494# CONFIG_BLK_DEV_SR is not set 536# CONFIG_BLK_DEV_SR is not set
495# CONFIG_CHR_DEV_SG is not set 537# CONFIG_CHR_DEV_SG is not set
496# CONFIG_CHR_DEV_SCH is not set 538# CONFIG_CHR_DEV_SCH is not set
497
498#
499# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
500#
501# CONFIG_SCSI_MULTI_LUN is not set 539# CONFIG_SCSI_MULTI_LUN is not set
502# CONFIG_SCSI_CONSTANTS is not set 540# CONFIG_SCSI_CONSTANTS is not set
503# CONFIG_SCSI_LOGGING is not set 541# CONFIG_SCSI_LOGGING is not set
@@ -522,7 +560,6 @@ CONFIG_SCSI_LOWLEVEL=y
522# CONFIG_ATA is not set 560# CONFIG_ATA is not set
523# CONFIG_MD is not set 561# CONFIG_MD is not set
524CONFIG_NETDEVICES=y 562CONFIG_NETDEVICES=y
525CONFIG_COMPAT_NET_DEV_OPS=y
526# CONFIG_DUMMY is not set 563# CONFIG_DUMMY is not set
527# CONFIG_BONDING is not set 564# CONFIG_BONDING is not set
528# CONFIG_MACVLAN is not set 565# CONFIG_MACVLAN is not set
@@ -553,7 +590,7 @@ CONFIG_NET_ETHERNET=y
553CONFIG_MII=y 590CONFIG_MII=y
554# CONFIG_AX88796 is not set 591# CONFIG_AX88796 is not set
555# CONFIG_SMC91X is not set 592# CONFIG_SMC91X is not set
556# CONFIG_TI_DAVINCI_EMAC is not set 593CONFIG_TI_DAVINCI_EMAC=y
557# CONFIG_DM9000 is not set 594# CONFIG_DM9000 is not set
558# CONFIG_ETHOC is not set 595# CONFIG_ETHOC is not set
559# CONFIG_SMC911X is not set 596# CONFIG_SMC911X is not set
@@ -567,12 +604,11 @@ CONFIG_MII=y
567# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set 604# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
568# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 605# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
569# CONFIG_B44 is not set 606# CONFIG_B44 is not set
607# CONFIG_KS8842 is not set
608# CONFIG_KS8851_MLL is not set
570# CONFIG_NETDEV_1000 is not set 609# CONFIG_NETDEV_1000 is not set
571# CONFIG_NETDEV_10000 is not set 610# CONFIG_NETDEV_10000 is not set
572 611CONFIG_WLAN=y
573#
574# Wireless LAN
575#
576# CONFIG_WLAN_PRE80211 is not set 612# CONFIG_WLAN_PRE80211 is not set
577# CONFIG_WLAN_80211 is not set 613# CONFIG_WLAN_80211 is not set
578 614
@@ -588,6 +624,7 @@ CONFIG_NETPOLL=y
588CONFIG_NETPOLL_TRAP=y 624CONFIG_NETPOLL_TRAP=y
589CONFIG_NET_POLL_CONTROLLER=y 625CONFIG_NET_POLL_CONTROLLER=y
590# CONFIG_ISDN is not set 626# CONFIG_ISDN is not set
627# CONFIG_PHONE is not set
591 628
592# 629#
593# Input device support 630# Input device support
@@ -611,23 +648,30 @@ CONFIG_INPUT_EVBUG=m
611# Input Device Drivers 648# Input Device Drivers
612# 649#
613CONFIG_INPUT_KEYBOARD=y 650CONFIG_INPUT_KEYBOARD=y
651# CONFIG_KEYBOARD_ADP5588 is not set
614CONFIG_KEYBOARD_ATKBD=m 652CONFIG_KEYBOARD_ATKBD=m
615# CONFIG_KEYBOARD_SUNKBD is not set 653# CONFIG_QT2160 is not set
616# CONFIG_KEYBOARD_LKKBD is not set 654# CONFIG_KEYBOARD_LKKBD is not set
617CONFIG_KEYBOARD_XTKBD=m 655CONFIG_KEYBOARD_GPIO=y
656# CONFIG_KEYBOARD_MATRIX is not set
657# CONFIG_KEYBOARD_MAX7359 is not set
618# CONFIG_KEYBOARD_NEWTON is not set 658# CONFIG_KEYBOARD_NEWTON is not set
659# CONFIG_KEYBOARD_OPENCORES is not set
619# CONFIG_KEYBOARD_STOWAWAY is not set 660# CONFIG_KEYBOARD_STOWAWAY is not set
620CONFIG_KEYBOARD_GPIO=y 661# CONFIG_KEYBOARD_SUNKBD is not set
662CONFIG_KEYBOARD_XTKBD=m
621# CONFIG_INPUT_MOUSE is not set 663# CONFIG_INPUT_MOUSE is not set
622# CONFIG_INPUT_JOYSTICK is not set 664# CONFIG_INPUT_JOYSTICK is not set
623# CONFIG_INPUT_TABLET is not set 665# CONFIG_INPUT_TABLET is not set
624CONFIG_INPUT_TOUCHSCREEN=y 666CONFIG_INPUT_TOUCHSCREEN=y
625# CONFIG_TOUCHSCREEN_AD7879_I2C is not set 667# CONFIG_TOUCHSCREEN_AD7879_I2C is not set
626# CONFIG_TOUCHSCREEN_AD7879 is not set 668# CONFIG_TOUCHSCREEN_AD7879 is not set
669# CONFIG_TOUCHSCREEN_EETI is not set
627# CONFIG_TOUCHSCREEN_FUJITSU is not set 670# CONFIG_TOUCHSCREEN_FUJITSU is not set
628# CONFIG_TOUCHSCREEN_GUNZE is not set 671# CONFIG_TOUCHSCREEN_GUNZE is not set
629# CONFIG_TOUCHSCREEN_ELO is not set 672# CONFIG_TOUCHSCREEN_ELO is not set
630# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set 673# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
674# CONFIG_TOUCHSCREEN_MCS5000 is not set
631# CONFIG_TOUCHSCREEN_MTOUCH is not set 675# CONFIG_TOUCHSCREEN_MTOUCH is not set
632# CONFIG_TOUCHSCREEN_INEXIO is not set 676# CONFIG_TOUCHSCREEN_INEXIO is not set
633# CONFIG_TOUCHSCREEN_MK712 is not set 677# CONFIG_TOUCHSCREEN_MK712 is not set
@@ -636,6 +680,7 @@ CONFIG_INPUT_TOUCHSCREEN=y
636# CONFIG_TOUCHSCREEN_TOUCHWIN is not set 680# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
637# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set 681# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
638# CONFIG_TOUCHSCREEN_TSC2007 is not set 682# CONFIG_TOUCHSCREEN_TSC2007 is not set
683# CONFIG_TOUCHSCREEN_W90X900 is not set
639# CONFIG_INPUT_MISC is not set 684# CONFIG_INPUT_MISC is not set
640 685
641# 686#
@@ -684,6 +729,7 @@ CONFIG_HW_RANDOM=m
684# CONFIG_TCG_TPM is not set 729# CONFIG_TCG_TPM is not set
685CONFIG_I2C=y 730CONFIG_I2C=y
686CONFIG_I2C_BOARDINFO=y 731CONFIG_I2C_BOARDINFO=y
732CONFIG_I2C_COMPAT=y
687CONFIG_I2C_CHARDEV=y 733CONFIG_I2C_CHARDEV=y
688CONFIG_I2C_HELPER_AUTO=y 734CONFIG_I2C_HELPER_AUTO=y
689 735
@@ -695,6 +741,7 @@ CONFIG_I2C_HELPER_AUTO=y
695# I2C system bus drivers (mostly embedded / system-on-chip) 741# I2C system bus drivers (mostly embedded / system-on-chip)
696# 742#
697CONFIG_I2C_DAVINCI=y 743CONFIG_I2C_DAVINCI=y
744# CONFIG_I2C_DESIGNWARE is not set
698# CONFIG_I2C_GPIO is not set 745# CONFIG_I2C_GPIO is not set
699# CONFIG_I2C_OCORES is not set 746# CONFIG_I2C_OCORES is not set
700# CONFIG_I2C_SIMTEC is not set 747# CONFIG_I2C_SIMTEC is not set
@@ -715,14 +762,17 @@ CONFIG_I2C_DAVINCI=y
715# Miscellaneous I2C Chip support 762# Miscellaneous I2C Chip support
716# 763#
717# CONFIG_DS1682 is not set 764# CONFIG_DS1682 is not set
718# CONFIG_SENSORS_PCA9539 is not set
719# CONFIG_SENSORS_MAX6875 is not set
720# CONFIG_SENSORS_TSL2550 is not set 765# CONFIG_SENSORS_TSL2550 is not set
721# CONFIG_I2C_DEBUG_CORE is not set 766# CONFIG_I2C_DEBUG_CORE is not set
722# CONFIG_I2C_DEBUG_ALGO is not set 767# CONFIG_I2C_DEBUG_ALGO is not set
723# CONFIG_I2C_DEBUG_BUS is not set 768# CONFIG_I2C_DEBUG_BUS is not set
724# CONFIG_I2C_DEBUG_CHIP is not set 769# CONFIG_I2C_DEBUG_CHIP is not set
725# CONFIG_SPI is not set 770# CONFIG_SPI is not set
771
772#
773# PPS support
774#
775# CONFIG_PPS is not set
726CONFIG_ARCH_REQUIRE_GPIOLIB=y 776CONFIG_ARCH_REQUIRE_GPIOLIB=y
727CONFIG_GPIOLIB=y 777CONFIG_GPIOLIB=y
728# CONFIG_DEBUG_GPIO is not set 778# CONFIG_DEBUG_GPIO is not set
@@ -736,8 +786,8 @@ CONFIG_GPIOLIB=y
736# I2C GPIO expanders: 786# I2C GPIO expanders:
737# 787#
738# CONFIG_GPIO_MAX732X is not set 788# CONFIG_GPIO_MAX732X is not set
739# CONFIG_GPIO_PCA953X is not set 789CONFIG_GPIO_PCA953X=y
740CONFIG_GPIO_PCF857X=m 790CONFIG_GPIO_PCF857X=y
741 791
742# 792#
743# PCI GPIO expanders: 793# PCI GPIO expanders:
@@ -746,11 +796,14 @@ CONFIG_GPIO_PCF857X=m
746# 796#
747# SPI GPIO expanders: 797# SPI GPIO expanders:
748# 798#
799
800#
801# AC97 GPIO expanders:
802#
749# CONFIG_W1 is not set 803# CONFIG_W1 is not set
750# CONFIG_POWER_SUPPLY is not set 804# CONFIG_POWER_SUPPLY is not set
751# CONFIG_HWMON is not set 805# CONFIG_HWMON is not set
752# CONFIG_THERMAL is not set 806# CONFIG_THERMAL is not set
753# CONFIG_THERMAL_HWMON is not set
754CONFIG_WATCHDOG=y 807CONFIG_WATCHDOG=y
755# CONFIG_WATCHDOG_NOWAYOUT is not set 808# CONFIG_WATCHDOG_NOWAYOUT is not set
756 809
@@ -782,31 +835,56 @@ CONFIG_SSB_POSSIBLE=y
782# CONFIG_MFD_TC6393XB is not set 835# CONFIG_MFD_TC6393XB is not set
783# CONFIG_PMIC_DA903X is not set 836# CONFIG_PMIC_DA903X is not set
784# CONFIG_MFD_WM8400 is not set 837# CONFIG_MFD_WM8400 is not set
838# CONFIG_MFD_WM831X is not set
785# CONFIG_MFD_WM8350_I2C is not set 839# CONFIG_MFD_WM8350_I2C is not set
786# CONFIG_MFD_PCF50633 is not set 840# CONFIG_MFD_PCF50633 is not set
787 841# CONFIG_AB3100_CORE is not set
788# 842CONFIG_REGULATOR=y
789# Multimedia devices 843# CONFIG_REGULATOR_DEBUG is not set
790# 844# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
791 845# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
792# 846# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set
793# Multimedia core support 847# CONFIG_REGULATOR_BQ24022 is not set
794# 848# CONFIG_REGULATOR_MAX1586 is not set
795# CONFIG_VIDEO_DEV is not set 849# CONFIG_REGULATOR_LP3971 is not set
796# CONFIG_DVB_CORE is not set 850# CONFIG_REGULATOR_TPS65023 is not set
797# CONFIG_VIDEO_MEDIA is not set 851CONFIG_REGULATOR_TPS6507X=y
798 852# CONFIG_MEDIA_SUPPORT is not set
799#
800# Multimedia drivers
801#
802# CONFIG_DAB is not set
803 853
804# 854#
805# Graphics support 855# Graphics support
806# 856#
807# CONFIG_VGASTATE is not set 857# CONFIG_VGASTATE is not set
808# CONFIG_VIDEO_OUTPUT_CONTROL is not set 858# CONFIG_VIDEO_OUTPUT_CONTROL is not set
809# CONFIG_FB is not set 859CONFIG_FB=y
860# CONFIG_FIRMWARE_EDID is not set
861# CONFIG_FB_DDC is not set
862# CONFIG_FB_BOOT_VESA_SUPPORT is not set
863CONFIG_FB_CFB_FILLRECT=y
864CONFIG_FB_CFB_COPYAREA=y
865CONFIG_FB_CFB_IMAGEBLIT=y
866# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
867# CONFIG_FB_SYS_FILLRECT is not set
868# CONFIG_FB_SYS_COPYAREA is not set
869# CONFIG_FB_SYS_IMAGEBLIT is not set
870# CONFIG_FB_FOREIGN_ENDIAN is not set
871# CONFIG_FB_SYS_FOPS is not set
872# CONFIG_FB_SVGALIB is not set
873# CONFIG_FB_MACMODES is not set
874# CONFIG_FB_BACKLIGHT is not set
875# CONFIG_FB_MODE_HELPERS is not set
876# CONFIG_FB_TILEBLITTING is not set
877
878#
879# Frame buffer hardware drivers
880#
881# CONFIG_FB_S1D13XXX is not set
882# CONFIG_FB_DAVINCI is not set
883# CONFIG_FB_VIRTUAL is not set
884CONFIG_FB_DA8XX=y
885# CONFIG_FB_METRONOME is not set
886# CONFIG_FB_MB862XX is not set
887# CONFIG_FB_BROADSHEET is not set
810# CONFIG_BACKLIGHT_LCD_SUPPORT is not set 888# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
811 889
812# 890#
@@ -819,6 +897,16 @@ CONFIG_SSB_POSSIBLE=y
819# 897#
820# CONFIG_VGA_CONSOLE is not set 898# CONFIG_VGA_CONSOLE is not set
821CONFIG_DUMMY_CONSOLE=y 899CONFIG_DUMMY_CONSOLE=y
900CONFIG_FRAMEBUFFER_CONSOLE=y
901# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
902# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
903# CONFIG_FONTS is not set
904CONFIG_FONT_8x8=y
905CONFIG_FONT_8x16=y
906CONFIG_LOGO=y
907CONFIG_LOGO_LINUX_MONO=y
908CONFIG_LOGO_LINUX_VGA16=y
909CONFIG_LOGO_LINUX_CLUT224=y
822CONFIG_SOUND=m 910CONFIG_SOUND=m
823# CONFIG_SOUND_OSS_CORE is not set 911# CONFIG_SOUND_OSS_CORE is not set
824CONFIG_SND=m 912CONFIG_SND=m
@@ -834,6 +922,11 @@ CONFIG_SND_SUPPORT_OLD_API=y
834CONFIG_SND_VERBOSE_PROCFS=y 922CONFIG_SND_VERBOSE_PROCFS=y
835# CONFIG_SND_VERBOSE_PRINTK is not set 923# CONFIG_SND_VERBOSE_PRINTK is not set
836# CONFIG_SND_DEBUG is not set 924# CONFIG_SND_DEBUG is not set
925# CONFIG_SND_RAWMIDI_SEQ is not set
926# CONFIG_SND_OPL3_LIB_SEQ is not set
927# CONFIG_SND_OPL4_LIB_SEQ is not set
928# CONFIG_SND_SBAWE_SEQ is not set
929# CONFIG_SND_EMU10K1_SEQ is not set
837CONFIG_SND_DRIVERS=y 930CONFIG_SND_DRIVERS=y
838# CONFIG_SND_DUMMY is not set 931# CONFIG_SND_DUMMY is not set
839# CONFIG_SND_MTPAV is not set 932# CONFIG_SND_MTPAV is not set
@@ -842,6 +935,8 @@ CONFIG_SND_DRIVERS=y
842CONFIG_SND_ARM=y 935CONFIG_SND_ARM=y
843CONFIG_SND_SOC=m 936CONFIG_SND_SOC=m
844CONFIG_SND_DAVINCI_SOC=m 937CONFIG_SND_DAVINCI_SOC=m
938# CONFIG_SND_DA830_SOC_EVM is not set
939# CONFIG_SND_DA850_SOC_EVM is not set
845CONFIG_SND_SOC_I2C_AND_SPI=m 940CONFIG_SND_SOC_I2C_AND_SPI=m
846# CONFIG_SND_SOC_ALL_CODECS is not set 941# CONFIG_SND_SOC_ALL_CODECS is not set
847# CONFIG_SOUND_PRIME is not set 942# CONFIG_SOUND_PRIME is not set
@@ -849,14 +944,17 @@ CONFIG_SND_SOC_I2C_AND_SPI=m
849# CONFIG_USB_SUPPORT is not set 944# CONFIG_USB_SUPPORT is not set
850# CONFIG_MMC is not set 945# CONFIG_MMC is not set
851# CONFIG_MEMSTICK is not set 946# CONFIG_MEMSTICK is not set
852# CONFIG_ACCESSIBILITY is not set
853# CONFIG_NEW_LEDS is not set 947# CONFIG_NEW_LEDS is not set
948# CONFIG_ACCESSIBILITY is not set
854CONFIG_RTC_LIB=y 949CONFIG_RTC_LIB=y
855# CONFIG_RTC_CLASS is not set 950# CONFIG_RTC_CLASS is not set
856# CONFIG_DMADEVICES is not set 951# CONFIG_DMADEVICES is not set
857# CONFIG_AUXDISPLAY is not set 952# CONFIG_AUXDISPLAY is not set
858# CONFIG_REGULATOR is not set
859# CONFIG_UIO is not set 953# CONFIG_UIO is not set
954
955#
956# TI VLYNQ
957#
860# CONFIG_STAGING is not set 958# CONFIG_STAGING is not set
861 959
862# 960#
@@ -877,14 +975,17 @@ CONFIG_FS_MBCACHE=y
877# CONFIG_REISERFS_FS is not set 975# CONFIG_REISERFS_FS is not set
878# CONFIG_JFS_FS is not set 976# CONFIG_JFS_FS is not set
879# CONFIG_FS_POSIX_ACL is not set 977# CONFIG_FS_POSIX_ACL is not set
880CONFIG_FILE_LOCKING=y
881CONFIG_XFS_FS=m 978CONFIG_XFS_FS=m
882# CONFIG_XFS_QUOTA is not set 979# CONFIG_XFS_QUOTA is not set
883# CONFIG_XFS_POSIX_ACL is not set 980# CONFIG_XFS_POSIX_ACL is not set
884# CONFIG_XFS_RT is not set 981# CONFIG_XFS_RT is not set
885# CONFIG_XFS_DEBUG is not set 982# CONFIG_XFS_DEBUG is not set
983# CONFIG_GFS2_FS is not set
886# CONFIG_OCFS2_FS is not set 984# CONFIG_OCFS2_FS is not set
887# CONFIG_BTRFS_FS is not set 985# CONFIG_BTRFS_FS is not set
986# CONFIG_NILFS2_FS is not set
987CONFIG_FILE_LOCKING=y
988CONFIG_FSNOTIFY=y
888CONFIG_DNOTIFY=y 989CONFIG_DNOTIFY=y
889CONFIG_INOTIFY=y 990CONFIG_INOTIFY=y
890CONFIG_INOTIFY_USER=y 991CONFIG_INOTIFY_USER=y
@@ -943,7 +1044,6 @@ CONFIG_MINIX_FS=m
943# CONFIG_ROMFS_FS is not set 1044# CONFIG_ROMFS_FS is not set
944# CONFIG_SYSV_FS is not set 1045# CONFIG_SYSV_FS is not set
945# CONFIG_UFS_FS is not set 1046# CONFIG_UFS_FS is not set
946# CONFIG_NILFS2_FS is not set
947CONFIG_NETWORK_FILESYSTEMS=y 1047CONFIG_NETWORK_FILESYSTEMS=y
948CONFIG_NFS_FS=y 1048CONFIG_NFS_FS=y
949CONFIG_NFS_V3=y 1049CONFIG_NFS_V3=y
@@ -1039,6 +1139,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
1039CONFIG_ENABLE_MUST_CHECK=y 1139CONFIG_ENABLE_MUST_CHECK=y
1040CONFIG_FRAME_WARN=1024 1140CONFIG_FRAME_WARN=1024
1041# CONFIG_MAGIC_SYSRQ is not set 1141# CONFIG_MAGIC_SYSRQ is not set
1142# CONFIG_STRIP_ASM_SYMS is not set
1042# CONFIG_UNUSED_SYMBOLS is not set 1143# CONFIG_UNUSED_SYMBOLS is not set
1043CONFIG_DEBUG_FS=y 1144CONFIG_DEBUG_FS=y
1044# CONFIG_HEADERS_CHECK is not set 1145# CONFIG_HEADERS_CHECK is not set
@@ -1056,6 +1157,7 @@ CONFIG_TIMER_STATS=y
1056# CONFIG_DEBUG_OBJECTS is not set 1157# CONFIG_DEBUG_OBJECTS is not set
1057# CONFIG_SLUB_DEBUG_ON is not set 1158# CONFIG_SLUB_DEBUG_ON is not set
1058# CONFIG_SLUB_STATS is not set 1159# CONFIG_SLUB_STATS is not set
1160# CONFIG_DEBUG_KMEMLEAK is not set
1059CONFIG_DEBUG_PREEMPT=y 1161CONFIG_DEBUG_PREEMPT=y
1060CONFIG_DEBUG_RT_MUTEXES=y 1162CONFIG_DEBUG_RT_MUTEXES=y
1061CONFIG_DEBUG_PI_LIST=y 1163CONFIG_DEBUG_PI_LIST=y
@@ -1076,29 +1178,29 @@ CONFIG_DEBUG_BUGVERBOSE=y
1076# CONFIG_DEBUG_LIST is not set 1178# CONFIG_DEBUG_LIST is not set
1077# CONFIG_DEBUG_SG is not set 1179# CONFIG_DEBUG_SG is not set
1078# CONFIG_DEBUG_NOTIFIERS is not set 1180# CONFIG_DEBUG_NOTIFIERS is not set
1181# CONFIG_DEBUG_CREDENTIALS is not set
1079# CONFIG_BOOT_PRINTK_DELAY is not set 1182# CONFIG_BOOT_PRINTK_DELAY is not set
1080# CONFIG_RCU_TORTURE_TEST is not set 1183# CONFIG_RCU_TORTURE_TEST is not set
1081# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1184# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1082# CONFIG_BACKTRACE_SELF_TEST is not set 1185# CONFIG_BACKTRACE_SELF_TEST is not set
1083# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 1186# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1187# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
1084# CONFIG_FAULT_INJECTION is not set 1188# CONFIG_FAULT_INJECTION is not set
1085# CONFIG_LATENCYTOP is not set 1189# CONFIG_LATENCYTOP is not set
1086# CONFIG_SYSCTL_SYSCALL_CHECK is not set 1190# CONFIG_SYSCTL_SYSCALL_CHECK is not set
1087# CONFIG_PAGE_POISONING is not set 1191# CONFIG_PAGE_POISONING is not set
1088CONFIG_HAVE_FUNCTION_TRACER=y 1192CONFIG_HAVE_FUNCTION_TRACER=y
1089CONFIG_TRACING_SUPPORT=y 1193CONFIG_TRACING_SUPPORT=y
1090 1194CONFIG_FTRACE=y
1091#
1092# Tracers
1093#
1094# CONFIG_FUNCTION_TRACER is not set 1195# CONFIG_FUNCTION_TRACER is not set
1095# CONFIG_IRQSOFF_TRACER is not set 1196# CONFIG_IRQSOFF_TRACER is not set
1096# CONFIG_PREEMPT_TRACER is not set 1197# CONFIG_PREEMPT_TRACER is not set
1097# CONFIG_SCHED_TRACER is not set 1198# CONFIG_SCHED_TRACER is not set
1098# CONFIG_CONTEXT_SWITCH_TRACER is not set 1199# CONFIG_ENABLE_DEFAULT_TRACERS is not set
1099# CONFIG_EVENT_TRACER is not set
1100# CONFIG_BOOT_TRACER is not set 1200# CONFIG_BOOT_TRACER is not set
1101# CONFIG_TRACE_BRANCH_PROFILING is not set 1201CONFIG_BRANCH_PROFILE_NONE=y
1202# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1203# CONFIG_PROFILE_ALL_BRANCHES is not set
1102# CONFIG_STACK_TRACER is not set 1204# CONFIG_STACK_TRACER is not set
1103# CONFIG_KMEMTRACE is not set 1205# CONFIG_KMEMTRACE is not set
1104# CONFIG_WORKQUEUE_TRACER is not set 1206# CONFIG_WORKQUEUE_TRACER is not set
@@ -1125,7 +1227,6 @@ CONFIG_CRYPTO=y
1125# 1227#
1126# Crypto core or helper 1228# Crypto core or helper
1127# 1229#
1128# CONFIG_CRYPTO_FIPS is not set
1129# CONFIG_CRYPTO_MANAGER is not set 1230# CONFIG_CRYPTO_MANAGER is not set
1130# CONFIG_CRYPTO_MANAGER2 is not set 1231# CONFIG_CRYPTO_MANAGER2 is not set
1131# CONFIG_CRYPTO_GF128MUL is not set 1232# CONFIG_CRYPTO_GF128MUL is not set
@@ -1157,11 +1258,13 @@ CONFIG_CRYPTO=y
1157# 1258#
1158# CONFIG_CRYPTO_HMAC is not set 1259# CONFIG_CRYPTO_HMAC is not set
1159# CONFIG_CRYPTO_XCBC is not set 1260# CONFIG_CRYPTO_XCBC is not set
1261# CONFIG_CRYPTO_VMAC is not set
1160 1262
1161# 1263#
1162# Digest 1264# Digest
1163# 1265#
1164# CONFIG_CRYPTO_CRC32C is not set 1266# CONFIG_CRYPTO_CRC32C is not set
1267# CONFIG_CRYPTO_GHASH is not set
1165# CONFIG_CRYPTO_MD4 is not set 1268# CONFIG_CRYPTO_MD4 is not set
1166# CONFIG_CRYPTO_MD5 is not set 1269# CONFIG_CRYPTO_MD5 is not set
1167# CONFIG_CRYPTO_MICHAEL_MIC is not set 1270# CONFIG_CRYPTO_MICHAEL_MIC is not set
diff --git a/arch/arm/configs/davinci_all_defconfig b/arch/arm/configs/davinci_all_defconfig
index ddffe39d9f87..bd656e8e6e4c 100644
--- a/arch/arm/configs/davinci_all_defconfig
+++ b/arch/arm/configs/davinci_all_defconfig
@@ -1,14 +1,13 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.31-rc3-davinci1 3# Linux kernel version: 2.6.32-rc4
4# Fri Jul 17 08:26:52 2009 4# Mon Oct 12 14:13:12 2009
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y 7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y 8CONFIG_GENERIC_GPIO=y
9CONFIG_GENERIC_TIME=y 9CONFIG_GENERIC_TIME=y
10CONFIG_GENERIC_CLOCKEVENTS=y 10CONFIG_GENERIC_CLOCKEVENTS=y
11CONFIG_MMU=y
12CONFIG_GENERIC_HARDIRQS=y 11CONFIG_GENERIC_HARDIRQS=y
13CONFIG_STACKTRACE_SUPPORT=y 12CONFIG_STACKTRACE_SUPPORT=y
14CONFIG_HAVE_LATENCYTOP_SUPPORT=y 13CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -46,11 +45,12 @@ CONFIG_POSIX_MQUEUE_SYSCTL=y
46# 45#
47# RCU Subsystem 46# RCU Subsystem
48# 47#
49CONFIG_CLASSIC_RCU=y 48CONFIG_TREE_RCU=y
50# CONFIG_TREE_RCU is not set 49# CONFIG_TREE_PREEMPT_RCU is not set
51# CONFIG_PREEMPT_RCU is not set 50# CONFIG_RCU_TRACE is not set
51CONFIG_RCU_FANOUT=32
52# CONFIG_RCU_FANOUT_EXACT is not set
52# CONFIG_TREE_RCU_TRACE is not set 53# CONFIG_TREE_RCU_TRACE is not set
53# CONFIG_PREEMPT_RCU_TRACE is not set
54CONFIG_IKCONFIG=y 54CONFIG_IKCONFIG=y
55CONFIG_IKCONFIG_PROC=y 55CONFIG_IKCONFIG_PROC=y
56CONFIG_LOG_BUF_SHIFT=14 56CONFIG_LOG_BUF_SHIFT=14
@@ -91,17 +91,15 @@ CONFIG_SHMEM=y
91CONFIG_AIO=y 91CONFIG_AIO=y
92 92
93# 93#
94# Performance Counters 94# Kernel Performance Events And Counters
95# 95#
96CONFIG_VM_EVENT_COUNTERS=y 96CONFIG_VM_EVENT_COUNTERS=y
97CONFIG_SLUB_DEBUG=y 97CONFIG_SLUB_DEBUG=y
98# CONFIG_STRIP_ASM_SYMS is not set
99CONFIG_COMPAT_BRK=y 98CONFIG_COMPAT_BRK=y
100# CONFIG_SLAB is not set 99# CONFIG_SLAB is not set
101CONFIG_SLUB=y 100CONFIG_SLUB=y
102# CONFIG_SLOB is not set 101# CONFIG_SLOB is not set
103# CONFIG_PROFILING is not set 102# CONFIG_PROFILING is not set
104# CONFIG_MARKERS is not set
105CONFIG_HAVE_OPROFILE=y 103CONFIG_HAVE_OPROFILE=y
106# CONFIG_KPROBES is not set 104# CONFIG_KPROBES is not set
107CONFIG_HAVE_KPROBES=y 105CONFIG_HAVE_KPROBES=y
@@ -145,6 +143,7 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
145# 143#
146# System Type 144# System Type
147# 145#
146CONFIG_MMU=y
148# CONFIG_ARCH_AAEC2000 is not set 147# CONFIG_ARCH_AAEC2000 is not set
149# CONFIG_ARCH_INTEGRATOR is not set 148# CONFIG_ARCH_INTEGRATOR is not set
150# CONFIG_ARCH_REALVIEW is not set 149# CONFIG_ARCH_REALVIEW is not set
@@ -159,6 +158,7 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
159# CONFIG_ARCH_STMP3XXX is not set 158# CONFIG_ARCH_STMP3XXX is not set
160# CONFIG_ARCH_NETX is not set 159# CONFIG_ARCH_NETX is not set
161# CONFIG_ARCH_H720X is not set 160# CONFIG_ARCH_H720X is not set
161# CONFIG_ARCH_NOMADIK is not set
162# CONFIG_ARCH_IOP13XX is not set 162# CONFIG_ARCH_IOP13XX is not set
163# CONFIG_ARCH_IOP32X is not set 163# CONFIG_ARCH_IOP32X is not set
164# CONFIG_ARCH_IOP33X is not set 164# CONFIG_ARCH_IOP33X is not set
@@ -181,11 +181,13 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
181# CONFIG_ARCH_SA1100 is not set 181# CONFIG_ARCH_SA1100 is not set
182# CONFIG_ARCH_S3C2410 is not set 182# CONFIG_ARCH_S3C2410 is not set
183# CONFIG_ARCH_S3C64XX is not set 183# CONFIG_ARCH_S3C64XX is not set
184# CONFIG_ARCH_S5PC1XX is not set
184# CONFIG_ARCH_SHARK is not set 185# CONFIG_ARCH_SHARK is not set
185# CONFIG_ARCH_LH7A40X is not set 186# CONFIG_ARCH_LH7A40X is not set
186# CONFIG_ARCH_U300 is not set 187# CONFIG_ARCH_U300 is not set
187CONFIG_ARCH_DAVINCI=y 188CONFIG_ARCH_DAVINCI=y
188# CONFIG_ARCH_OMAP is not set 189# CONFIG_ARCH_OMAP is not set
190# CONFIG_ARCH_BCMRING is not set
189CONFIG_AINTC=y 191CONFIG_AINTC=y
190CONFIG_ARCH_DAVINCI_DMx=y 192CONFIG_ARCH_DAVINCI_DMx=y
191 193
@@ -208,6 +210,7 @@ CONFIG_ARCH_DAVINCI_DM365=y
208# 210#
209CONFIG_MACH_DAVINCI_EVM=y 211CONFIG_MACH_DAVINCI_EVM=y
210CONFIG_MACH_SFFSDR=y 212CONFIG_MACH_SFFSDR=y
213CONFIG_MACH_NEUROS_OSD2=y
211CONFIG_MACH_DAVINCI_DM355_EVM=y 214CONFIG_MACH_DAVINCI_DM355_EVM=y
212CONFIG_MACH_DM355_LEOPARD=y 215CONFIG_MACH_DM355_LEOPARD=y
213CONFIG_MACH_DAVINCI_DM6467_EVM=y 216CONFIG_MACH_DAVINCI_DM6467_EVM=y
@@ -224,7 +227,7 @@ CONFIG_CPU_32=y
224CONFIG_CPU_ARM926T=y 227CONFIG_CPU_ARM926T=y
225CONFIG_CPU_32v5=y 228CONFIG_CPU_32v5=y
226CONFIG_CPU_ABRT_EV5TJ=y 229CONFIG_CPU_ABRT_EV5TJ=y
227CONFIG_CPU_PABRT_NOIFAR=y 230CONFIG_CPU_PABRT_LEGACY=y
228CONFIG_CPU_CACHE_VIVT=y 231CONFIG_CPU_CACHE_VIVT=y
229CONFIG_CPU_COPY_V4WB=y 232CONFIG_CPU_COPY_V4WB=y
230CONFIG_CPU_TLB_V4WBI=y 233CONFIG_CPU_TLB_V4WBI=y
@@ -239,6 +242,7 @@ CONFIG_ARM_THUMB=y
239# CONFIG_CPU_DCACHE_DISABLE is not set 242# CONFIG_CPU_DCACHE_DISABLE is not set
240# CONFIG_CPU_DCACHE_WRITETHROUGH is not set 243# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
241# CONFIG_CPU_CACHE_ROUND_ROBIN is not set 244# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
245CONFIG_ARM_L1_CACHE_SHIFT=5
242CONFIG_COMMON_CLKDEV=y 246CONFIG_COMMON_CLKDEV=y
243 247
244# 248#
@@ -259,6 +263,8 @@ CONFIG_VMSPLIT_3G=y
259# CONFIG_VMSPLIT_2G is not set 263# CONFIG_VMSPLIT_2G is not set
260# CONFIG_VMSPLIT_1G is not set 264# CONFIG_VMSPLIT_1G is not set
261CONFIG_PAGE_OFFSET=0xC0000000 265CONFIG_PAGE_OFFSET=0xC0000000
266# CONFIG_PREEMPT_NONE is not set
267# CONFIG_PREEMPT_VOLUNTARY is not set
262CONFIG_PREEMPT=y 268CONFIG_PREEMPT=y
263CONFIG_HZ=100 269CONFIG_HZ=100
264CONFIG_AEABI=y 270CONFIG_AEABI=y
@@ -280,6 +286,7 @@ CONFIG_BOUNCE=y
280CONFIG_VIRT_TO_BUS=y 286CONFIG_VIRT_TO_BUS=y
281CONFIG_HAVE_MLOCK=y 287CONFIG_HAVE_MLOCK=y
282CONFIG_HAVE_MLOCKED_PAGE_BIT=y 288CONFIG_HAVE_MLOCKED_PAGE_BIT=y
289# CONFIG_KSM is not set
283CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 290CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
284CONFIG_LEDS=y 291CONFIG_LEDS=y
285# CONFIG_LEDS_CPU is not set 292# CONFIG_LEDS_CPU is not set
@@ -412,6 +419,7 @@ CONFIG_NETFILTER_ADVANCED=y
412# CONFIG_IP6_NF_IPTABLES is not set 419# CONFIG_IP6_NF_IPTABLES is not set
413# CONFIG_IP_DCCP is not set 420# CONFIG_IP_DCCP is not set
414# CONFIG_IP_SCTP is not set 421# CONFIG_IP_SCTP is not set
422# CONFIG_RDS is not set
415# CONFIG_TIPC is not set 423# CONFIG_TIPC is not set
416# CONFIG_ATM is not set 424# CONFIG_ATM is not set
417# CONFIG_BRIDGE is not set 425# CONFIG_BRIDGE is not set
@@ -452,6 +460,7 @@ CONFIG_NETFILTER_ADVANCED=y
452# Generic Driver Options 460# Generic Driver Options
453# 461#
454CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 462CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
463# CONFIG_DEVTMPFS is not set
455CONFIG_STANDALONE=y 464CONFIG_STANDALONE=y
456CONFIG_PREVENT_FIRMWARE_BUILD=y 465CONFIG_PREVENT_FIRMWARE_BUILD=y
457# CONFIG_FW_LOADER is not set 466# CONFIG_FW_LOADER is not set
@@ -461,9 +470,9 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
461# CONFIG_CONNECTOR is not set 470# CONFIG_CONNECTOR is not set
462CONFIG_MTD=m 471CONFIG_MTD=m
463# CONFIG_MTD_DEBUG is not set 472# CONFIG_MTD_DEBUG is not set
473# CONFIG_MTD_TESTS is not set
464# CONFIG_MTD_CONCAT is not set 474# CONFIG_MTD_CONCAT is not set
465CONFIG_MTD_PARTITIONS=y 475CONFIG_MTD_PARTITIONS=y
466# CONFIG_MTD_TESTS is not set
467# CONFIG_MTD_REDBOOT_PARTS is not set 476# CONFIG_MTD_REDBOOT_PARTS is not set
468# CONFIG_MTD_AFS_PARTS is not set 477# CONFIG_MTD_AFS_PARTS is not set
469# CONFIG_MTD_AR7_PARTS is not set 478# CONFIG_MTD_AR7_PARTS is not set
@@ -499,7 +508,7 @@ CONFIG_MTD_CFI_I1=y
499CONFIG_MTD_CFI_I2=y 508CONFIG_MTD_CFI_I2=y
500# CONFIG_MTD_CFI_I4 is not set 509# CONFIG_MTD_CFI_I4 is not set
501# CONFIG_MTD_CFI_I8 is not set 510# CONFIG_MTD_CFI_I8 is not set
502# CONFIG_MTD_CFI_INTELEXT is not set 511CONFIG_MTD_CFI_INTELEXT=m
503CONFIG_MTD_CFI_AMDSTD=m 512CONFIG_MTD_CFI_AMDSTD=m
504# CONFIG_MTD_CFI_STAA is not set 513# CONFIG_MTD_CFI_STAA is not set
505CONFIG_MTD_CFI_UTIL=m 514CONFIG_MTD_CFI_UTIL=m
@@ -694,12 +703,10 @@ CONFIG_DM9000_DEBUGLEVEL=4
694# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 703# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
695# CONFIG_B44 is not set 704# CONFIG_B44 is not set
696# CONFIG_KS8842 is not set 705# CONFIG_KS8842 is not set
706# CONFIG_KS8851_MLL is not set
697# CONFIG_NETDEV_1000 is not set 707# CONFIG_NETDEV_1000 is not set
698# CONFIG_NETDEV_10000 is not set 708# CONFIG_NETDEV_10000 is not set
699 709CONFIG_WLAN=y
700#
701# Wireless LAN
702#
703# CONFIG_WLAN_PRE80211 is not set 710# CONFIG_WLAN_PRE80211 is not set
704# CONFIG_WLAN_80211 is not set 711# CONFIG_WLAN_80211 is not set
705 712
@@ -734,6 +741,7 @@ CONFIG_NETPOLL=y
734CONFIG_NETPOLL_TRAP=y 741CONFIG_NETPOLL_TRAP=y
735CONFIG_NET_POLL_CONTROLLER=y 742CONFIG_NET_POLL_CONTROLLER=y
736# CONFIG_ISDN is not set 743# CONFIG_ISDN is not set
744# CONFIG_PHONE is not set
737 745
738# 746#
739# Input device support 747# Input device support
@@ -745,10 +753,7 @@ CONFIG_INPUT=y
745# 753#
746# Userland interfaces 754# Userland interfaces
747# 755#
748CONFIG_INPUT_MOUSEDEV=m 756# CONFIG_INPUT_MOUSEDEV is not set
749CONFIG_INPUT_MOUSEDEV_PSAUX=y
750CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
751CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
752# CONFIG_INPUT_JOYDEV is not set 757# CONFIG_INPUT_JOYDEV is not set
753CONFIG_INPUT_EVDEV=m 758CONFIG_INPUT_EVDEV=m
754CONFIG_INPUT_EVBUG=m 759CONFIG_INPUT_EVBUG=m
@@ -757,12 +762,16 @@ CONFIG_INPUT_EVBUG=m
757# Input Device Drivers 762# Input Device Drivers
758# 763#
759CONFIG_INPUT_KEYBOARD=y 764CONFIG_INPUT_KEYBOARD=y
765# CONFIG_KEYBOARD_ADP5588 is not set
760CONFIG_KEYBOARD_ATKBD=m 766CONFIG_KEYBOARD_ATKBD=m
767# CONFIG_QT2160 is not set
761# CONFIG_KEYBOARD_LKKBD is not set 768# CONFIG_KEYBOARD_LKKBD is not set
762CONFIG_KEYBOARD_GPIO=y 769CONFIG_KEYBOARD_GPIO=y
763# CONFIG_KEYBOARD_MATRIX is not set 770# CONFIG_KEYBOARD_MATRIX is not set
764# CONFIG_KEYBOARD_LM8323 is not set 771# CONFIG_KEYBOARD_LM8323 is not set
772# CONFIG_KEYBOARD_MAX7359 is not set
765# CONFIG_KEYBOARD_NEWTON is not set 773# CONFIG_KEYBOARD_NEWTON is not set
774# CONFIG_KEYBOARD_OPENCORES is not set
766# CONFIG_KEYBOARD_STOWAWAY is not set 775# CONFIG_KEYBOARD_STOWAWAY is not set
767# CONFIG_KEYBOARD_SUNKBD is not set 776# CONFIG_KEYBOARD_SUNKBD is not set
768CONFIG_KEYBOARD_XTKBD=m 777CONFIG_KEYBOARD_XTKBD=m
@@ -777,6 +786,7 @@ CONFIG_INPUT_TOUCHSCREEN=y
777# CONFIG_TOUCHSCREEN_GUNZE is not set 786# CONFIG_TOUCHSCREEN_GUNZE is not set
778# CONFIG_TOUCHSCREEN_ELO is not set 787# CONFIG_TOUCHSCREEN_ELO is not set
779# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set 788# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
789# CONFIG_TOUCHSCREEN_MCS5000 is not set
780# CONFIG_TOUCHSCREEN_MTOUCH is not set 790# CONFIG_TOUCHSCREEN_MTOUCH is not set
781# CONFIG_TOUCHSCREEN_INEXIO is not set 791# CONFIG_TOUCHSCREEN_INEXIO is not set
782# CONFIG_TOUCHSCREEN_MK712 is not set 792# CONFIG_TOUCHSCREEN_MK712 is not set
@@ -787,7 +797,17 @@ CONFIG_INPUT_TOUCHSCREEN=y
787# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set 797# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
788# CONFIG_TOUCHSCREEN_TSC2007 is not set 798# CONFIG_TOUCHSCREEN_TSC2007 is not set
789# CONFIG_TOUCHSCREEN_W90X900 is not set 799# CONFIG_TOUCHSCREEN_W90X900 is not set
790# CONFIG_INPUT_MISC is not set 800CONFIG_INPUT_MISC=y
801# CONFIG_INPUT_ATI_REMOTE is not set
802# CONFIG_INPUT_ATI_REMOTE2 is not set
803# CONFIG_INPUT_KEYSPAN_REMOTE is not set
804# CONFIG_INPUT_POWERMATE is not set
805# CONFIG_INPUT_YEALINK is not set
806# CONFIG_INPUT_CM109 is not set
807# CONFIG_INPUT_UINPUT is not set
808# CONFIG_INPUT_GPIO_ROTARY_ENCODER is not set
809CONFIG_INPUT_DM355EVM=m
810CONFIG_INPUT_DM365EVM=m
791 811
792# 812#
793# Hardware I/O ports 813# Hardware I/O ports
@@ -828,13 +848,13 @@ CONFIG_UNIX98_PTYS=y
828CONFIG_LEGACY_PTYS=y 848CONFIG_LEGACY_PTYS=y
829CONFIG_LEGACY_PTY_COUNT=256 849CONFIG_LEGACY_PTY_COUNT=256
830# CONFIG_IPMI_HANDLER is not set 850# CONFIG_IPMI_HANDLER is not set
831CONFIG_HW_RANDOM=m 851# CONFIG_HW_RANDOM is not set
832# CONFIG_HW_RANDOM_TIMERIOMEM is not set
833# CONFIG_R3964 is not set 852# CONFIG_R3964 is not set
834# CONFIG_RAW_DRIVER is not set 853# CONFIG_RAW_DRIVER is not set
835# CONFIG_TCG_TPM is not set 854# CONFIG_TCG_TPM is not set
836CONFIG_I2C=y 855CONFIG_I2C=y
837CONFIG_I2C_BOARDINFO=y 856CONFIG_I2C_BOARDINFO=y
857CONFIG_I2C_COMPAT=y
838CONFIG_I2C_CHARDEV=y 858CONFIG_I2C_CHARDEV=y
839CONFIG_I2C_HELPER_AUTO=y 859CONFIG_I2C_HELPER_AUTO=y
840 860
@@ -868,13 +888,17 @@ CONFIG_I2C_DAVINCI=y
868# Miscellaneous I2C Chip support 888# Miscellaneous I2C Chip support
869# 889#
870# CONFIG_DS1682 is not set 890# CONFIG_DS1682 is not set
871# CONFIG_SENSORS_PCA9539 is not set
872# CONFIG_SENSORS_TSL2550 is not set 891# CONFIG_SENSORS_TSL2550 is not set
873# CONFIG_I2C_DEBUG_CORE is not set 892# CONFIG_I2C_DEBUG_CORE is not set
874# CONFIG_I2C_DEBUG_ALGO is not set 893# CONFIG_I2C_DEBUG_ALGO is not set
875# CONFIG_I2C_DEBUG_BUS is not set 894# CONFIG_I2C_DEBUG_BUS is not set
876# CONFIG_I2C_DEBUG_CHIP is not set 895# CONFIG_I2C_DEBUG_CHIP is not set
877# CONFIG_SPI is not set 896# CONFIG_SPI is not set
897
898#
899# PPS support
900#
901# CONFIG_PPS is not set
878CONFIG_ARCH_REQUIRE_GPIOLIB=y 902CONFIG_ARCH_REQUIRE_GPIOLIB=y
879CONFIG_GPIOLIB=y 903CONFIG_GPIOLIB=y
880# CONFIG_DEBUG_GPIO is not set 904# CONFIG_DEBUG_GPIO is not set
@@ -889,7 +913,7 @@ CONFIG_GPIOLIB=y
889# 913#
890# CONFIG_GPIO_MAX732X is not set 914# CONFIG_GPIO_MAX732X is not set
891# CONFIG_GPIO_PCA953X is not set 915# CONFIG_GPIO_PCA953X is not set
892CONFIG_GPIO_PCF857X=m 916CONFIG_GPIO_PCF857X=y
893 917
894# 918#
895# PCI GPIO expanders: 919# PCI GPIO expanders:
@@ -898,10 +922,19 @@ CONFIG_GPIO_PCF857X=m
898# 922#
899# SPI GPIO expanders: 923# SPI GPIO expanders:
900# 924#
925
926#
927# AC97 GPIO expanders:
928#
901# CONFIG_W1 is not set 929# CONFIG_W1 is not set
902# CONFIG_POWER_SUPPLY is not set 930# CONFIG_POWER_SUPPLY is not set
903CONFIG_HWMON=y 931CONFIG_HWMON=y
904# CONFIG_HWMON_VID is not set 932# CONFIG_HWMON_VID is not set
933# CONFIG_HWMON_DEBUG_CHIP is not set
934
935#
936# Native drivers
937#
905# CONFIG_SENSORS_AD7414 is not set 938# CONFIG_SENSORS_AD7414 is not set
906# CONFIG_SENSORS_AD7418 is not set 939# CONFIG_SENSORS_AD7418 is not set
907# CONFIG_SENSORS_ADM1021 is not set 940# CONFIG_SENSORS_ADM1021 is not set
@@ -950,6 +983,7 @@ CONFIG_HWMON=y
950# CONFIG_SENSORS_ADS7828 is not set 983# CONFIG_SENSORS_ADS7828 is not set
951# CONFIG_SENSORS_THMC50 is not set 984# CONFIG_SENSORS_THMC50 is not set
952# CONFIG_SENSORS_TMP401 is not set 985# CONFIG_SENSORS_TMP401 is not set
986# CONFIG_SENSORS_TMP421 is not set
953# CONFIG_SENSORS_VT1211 is not set 987# CONFIG_SENSORS_VT1211 is not set
954# CONFIG_SENSORS_W83781D is not set 988# CONFIG_SENSORS_W83781D is not set
955# CONFIG_SENSORS_W83791D is not set 989# CONFIG_SENSORS_W83791D is not set
@@ -959,9 +993,7 @@ CONFIG_HWMON=y
959# CONFIG_SENSORS_W83L786NG is not set 993# CONFIG_SENSORS_W83L786NG is not set
960# CONFIG_SENSORS_W83627HF is not set 994# CONFIG_SENSORS_W83627HF is not set
961# CONFIG_SENSORS_W83627EHF is not set 995# CONFIG_SENSORS_W83627EHF is not set
962# CONFIG_HWMON_DEBUG_CHIP is not set
963# CONFIG_THERMAL is not set 996# CONFIG_THERMAL is not set
964# CONFIG_THERMAL_HWMON is not set
965CONFIG_WATCHDOG=y 997CONFIG_WATCHDOG=y
966# CONFIG_WATCHDOG_NOWAYOUT is not set 998# CONFIG_WATCHDOG_NOWAYOUT is not set
967 999
@@ -988,7 +1020,7 @@ CONFIG_SSB_POSSIBLE=y
988# CONFIG_MFD_CORE is not set 1020# CONFIG_MFD_CORE is not set
989# CONFIG_MFD_SM501 is not set 1021# CONFIG_MFD_SM501 is not set
990# CONFIG_MFD_ASIC3 is not set 1022# CONFIG_MFD_ASIC3 is not set
991# CONFIG_MFD_DM355EVM_MSP is not set 1023CONFIG_MFD_DM355EVM_MSP=y
992# CONFIG_HTC_EGPIO is not set 1024# CONFIG_HTC_EGPIO is not set
993# CONFIG_HTC_PASIC3 is not set 1025# CONFIG_HTC_PASIC3 is not set
994# CONFIG_TPS65010 is not set 1026# CONFIG_TPS65010 is not set
@@ -999,9 +1031,11 @@ CONFIG_SSB_POSSIBLE=y
999# CONFIG_MFD_TC6393XB is not set 1031# CONFIG_MFD_TC6393XB is not set
1000# CONFIG_PMIC_DA903X is not set 1032# CONFIG_PMIC_DA903X is not set
1001# CONFIG_MFD_WM8400 is not set 1033# CONFIG_MFD_WM8400 is not set
1034# CONFIG_MFD_WM831X is not set
1002# CONFIG_MFD_WM8350_I2C is not set 1035# CONFIG_MFD_WM8350_I2C is not set
1003# CONFIG_MFD_PCF50633 is not set 1036# CONFIG_MFD_PCF50633 is not set
1004# CONFIG_AB3100_CORE is not set 1037# CONFIG_AB3100_CORE is not set
1038# CONFIG_REGULATOR is not set
1005# CONFIG_MEDIA_SUPPORT is not set 1039# CONFIG_MEDIA_SUPPORT is not set
1006 1040
1007# 1041#
@@ -1013,9 +1047,9 @@ CONFIG_FB=y
1013CONFIG_FIRMWARE_EDID=y 1047CONFIG_FIRMWARE_EDID=y
1014# CONFIG_FB_DDC is not set 1048# CONFIG_FB_DDC is not set
1015# CONFIG_FB_BOOT_VESA_SUPPORT is not set 1049# CONFIG_FB_BOOT_VESA_SUPPORT is not set
1016# CONFIG_FB_CFB_FILLRECT is not set 1050CONFIG_FB_CFB_FILLRECT=y
1017# CONFIG_FB_CFB_COPYAREA is not set 1051CONFIG_FB_CFB_COPYAREA=y
1018# CONFIG_FB_CFB_IMAGEBLIT is not set 1052CONFIG_FB_CFB_IMAGEBLIT=y
1019# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set 1053# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
1020# CONFIG_FB_SYS_FILLRECT is not set 1054# CONFIG_FB_SYS_FILLRECT is not set
1021# CONFIG_FB_SYS_COPYAREA is not set 1055# CONFIG_FB_SYS_COPYAREA is not set
@@ -1032,6 +1066,7 @@ CONFIG_FIRMWARE_EDID=y
1032# Frame buffer hardware drivers 1066# Frame buffer hardware drivers
1033# 1067#
1034# CONFIG_FB_S1D13XXX is not set 1068# CONFIG_FB_S1D13XXX is not set
1069CONFIG_FB_DAVINCI=y
1035# CONFIG_FB_VIRTUAL is not set 1070# CONFIG_FB_VIRTUAL is not set
1036# CONFIG_FB_METRONOME is not set 1071# CONFIG_FB_METRONOME is not set
1037# CONFIG_FB_MB862XX is not set 1072# CONFIG_FB_MB862XX is not set
@@ -1101,7 +1136,6 @@ CONFIG_SND_SOC_TLV320AIC3X=m
1101# CONFIG_SOUND_PRIME is not set 1136# CONFIG_SOUND_PRIME is not set
1102CONFIG_HID_SUPPORT=y 1137CONFIG_HID_SUPPORT=y
1103CONFIG_HID=m 1138CONFIG_HID=m
1104# CONFIG_HID_DEBUG is not set
1105# CONFIG_HIDRAW is not set 1139# CONFIG_HIDRAW is not set
1106 1140
1107# 1141#
@@ -1130,6 +1164,7 @@ CONFIG_HID_CYPRESS=m
1130CONFIG_HID_EZKEY=m 1164CONFIG_HID_EZKEY=m
1131# CONFIG_HID_KYE is not set 1165# CONFIG_HID_KYE is not set
1132CONFIG_HID_GYRATION=m 1166CONFIG_HID_GYRATION=m
1167# CONFIG_HID_TWINHAN is not set
1133# CONFIG_HID_KENSINGTON is not set 1168# CONFIG_HID_KENSINGTON is not set
1134CONFIG_HID_LOGITECH=m 1169CONFIG_HID_LOGITECH=m
1135# CONFIG_LOGITECH_FF is not set 1170# CONFIG_LOGITECH_FF is not set
@@ -1176,6 +1211,7 @@ CONFIG_USB_MON=m
1176# CONFIG_USB_OXU210HP_HCD is not set 1211# CONFIG_USB_OXU210HP_HCD is not set
1177# CONFIG_USB_ISP116X_HCD is not set 1212# CONFIG_USB_ISP116X_HCD is not set
1178# CONFIG_USB_ISP1760_HCD is not set 1213# CONFIG_USB_ISP1760_HCD is not set
1214# CONFIG_USB_ISP1362_HCD is not set
1179# CONFIG_USB_SL811_HCD is not set 1215# CONFIG_USB_SL811_HCD is not set
1180# CONFIG_USB_R8A66597_HCD is not set 1216# CONFIG_USB_R8A66597_HCD is not set
1181# CONFIG_USB_HWA_HCD is not set 1217# CONFIG_USB_HWA_HCD is not set
@@ -1269,6 +1305,7 @@ CONFIG_USB_GADGET_SELECTED=y
1269# CONFIG_USB_GADGET_LH7A40X is not set 1305# CONFIG_USB_GADGET_LH7A40X is not set
1270# CONFIG_USB_GADGET_OMAP is not set 1306# CONFIG_USB_GADGET_OMAP is not set
1271# CONFIG_USB_GADGET_PXA25X is not set 1307# CONFIG_USB_GADGET_PXA25X is not set
1308# CONFIG_USB_GADGET_R8A66597 is not set
1272# CONFIG_USB_GADGET_PXA27X is not set 1309# CONFIG_USB_GADGET_PXA27X is not set
1273# CONFIG_USB_GADGET_S3C_HSOTG is not set 1310# CONFIG_USB_GADGET_S3C_HSOTG is not set
1274# CONFIG_USB_GADGET_IMX is not set 1311# CONFIG_USB_GADGET_IMX is not set
@@ -1286,6 +1323,7 @@ CONFIG_USB_ZERO=m
1286# CONFIG_USB_AUDIO is not set 1323# CONFIG_USB_AUDIO is not set
1287CONFIG_USB_ETH=m 1324CONFIG_USB_ETH=m
1288CONFIG_USB_ETH_RNDIS=y 1325CONFIG_USB_ETH_RNDIS=y
1326# CONFIG_USB_ETH_EEM is not set
1289CONFIG_USB_GADGETFS=m 1327CONFIG_USB_GADGETFS=m
1290CONFIG_USB_FILE_STORAGE=m 1328CONFIG_USB_FILE_STORAGE=m
1291# CONFIG_USB_FILE_STORAGE_TEST is not set 1329# CONFIG_USB_FILE_STORAGE_TEST is not set
@@ -1316,8 +1354,10 @@ CONFIG_MMC_BLOCK=m
1316# MMC/SD/SDIO Host Controller Drivers 1354# MMC/SD/SDIO Host Controller Drivers
1317# 1355#
1318# CONFIG_MMC_SDHCI is not set 1356# CONFIG_MMC_SDHCI is not set
1357# CONFIG_MMC_AT91 is not set
1358# CONFIG_MMC_ATMELMCI is not set
1359CONFIG_MMC_DAVINCI=m
1319# CONFIG_MEMSTICK is not set 1360# CONFIG_MEMSTICK is not set
1320# CONFIG_ACCESSIBILITY is not set
1321CONFIG_NEW_LEDS=y 1361CONFIG_NEW_LEDS=y
1322CONFIG_LEDS_CLASS=m 1362CONFIG_LEDS_CLASS=m
1323 1363
@@ -1345,6 +1385,7 @@ CONFIG_LEDS_TRIGGER_HEARTBEAT=m
1345# 1385#
1346# iptables trigger is under Netfilter config (LED target) 1386# iptables trigger is under Netfilter config (LED target)
1347# 1387#
1388# CONFIG_ACCESSIBILITY is not set
1348CONFIG_RTC_LIB=y 1389CONFIG_RTC_LIB=y
1349CONFIG_RTC_CLASS=m 1390CONFIG_RTC_CLASS=m
1350 1391
@@ -1370,6 +1411,7 @@ CONFIG_RTC_INTF_DEV=y
1370# CONFIG_RTC_DRV_PCF8563 is not set 1411# CONFIG_RTC_DRV_PCF8563 is not set
1371# CONFIG_RTC_DRV_PCF8583 is not set 1412# CONFIG_RTC_DRV_PCF8583 is not set
1372# CONFIG_RTC_DRV_M41T80 is not set 1413# CONFIG_RTC_DRV_M41T80 is not set
1414# CONFIG_RTC_DRV_DM355EVM is not set
1373# CONFIG_RTC_DRV_S35390A is not set 1415# CONFIG_RTC_DRV_S35390A is not set
1374# CONFIG_RTC_DRV_FM3130 is not set 1416# CONFIG_RTC_DRV_FM3130 is not set
1375# CONFIG_RTC_DRV_RX8581 is not set 1417# CONFIG_RTC_DRV_RX8581 is not set
@@ -1399,8 +1441,11 @@ CONFIG_RTC_INTF_DEV=y
1399# 1441#
1400# CONFIG_DMADEVICES is not set 1442# CONFIG_DMADEVICES is not set
1401# CONFIG_AUXDISPLAY is not set 1443# CONFIG_AUXDISPLAY is not set
1402# CONFIG_REGULATOR is not set
1403# CONFIG_UIO is not set 1444# CONFIG_UIO is not set
1445
1446#
1447# TI VLYNQ
1448#
1404# CONFIG_STAGING is not set 1449# CONFIG_STAGING is not set
1405 1450
1406# 1451#
@@ -1429,6 +1474,7 @@ CONFIG_XFS_FS=m
1429# CONFIG_GFS2_FS is not set 1474# CONFIG_GFS2_FS is not set
1430# CONFIG_OCFS2_FS is not set 1475# CONFIG_OCFS2_FS is not set
1431# CONFIG_BTRFS_FS is not set 1476# CONFIG_BTRFS_FS is not set
1477# CONFIG_NILFS2_FS is not set
1432CONFIG_FILE_LOCKING=y 1478CONFIG_FILE_LOCKING=y
1433CONFIG_FSNOTIFY=y 1479CONFIG_FSNOTIFY=y
1434CONFIG_DNOTIFY=y 1480CONFIG_DNOTIFY=y
@@ -1500,7 +1546,6 @@ CONFIG_MINIX_FS=m
1500# CONFIG_ROMFS_FS is not set 1546# CONFIG_ROMFS_FS is not set
1501# CONFIG_SYSV_FS is not set 1547# CONFIG_SYSV_FS is not set
1502# CONFIG_UFS_FS is not set 1548# CONFIG_UFS_FS is not set
1503# CONFIG_NILFS2_FS is not set
1504CONFIG_NETWORK_FILESYSTEMS=y 1549CONFIG_NETWORK_FILESYSTEMS=y
1505CONFIG_NFS_FS=y 1550CONFIG_NFS_FS=y
1506CONFIG_NFS_V3=y 1551CONFIG_NFS_V3=y
@@ -1596,6 +1641,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
1596CONFIG_ENABLE_MUST_CHECK=y 1641CONFIG_ENABLE_MUST_CHECK=y
1597CONFIG_FRAME_WARN=1024 1642CONFIG_FRAME_WARN=1024
1598# CONFIG_MAGIC_SYSRQ is not set 1643# CONFIG_MAGIC_SYSRQ is not set
1644# CONFIG_STRIP_ASM_SYMS is not set
1599# CONFIG_UNUSED_SYMBOLS is not set 1645# CONFIG_UNUSED_SYMBOLS is not set
1600CONFIG_DEBUG_FS=y 1646CONFIG_DEBUG_FS=y
1601# CONFIG_HEADERS_CHECK is not set 1647# CONFIG_HEADERS_CHECK is not set
@@ -1634,11 +1680,14 @@ CONFIG_DEBUG_BUGVERBOSE=y
1634# CONFIG_DEBUG_LIST is not set 1680# CONFIG_DEBUG_LIST is not set
1635# CONFIG_DEBUG_SG is not set 1681# CONFIG_DEBUG_SG is not set
1636# CONFIG_DEBUG_NOTIFIERS is not set 1682# CONFIG_DEBUG_NOTIFIERS is not set
1683# CONFIG_DEBUG_CREDENTIALS is not set
1684CONFIG_FRAME_POINTER=y
1637# CONFIG_BOOT_PRINTK_DELAY is not set 1685# CONFIG_BOOT_PRINTK_DELAY is not set
1638# CONFIG_RCU_TORTURE_TEST is not set 1686# CONFIG_RCU_TORTURE_TEST is not set
1639# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1687# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1640# CONFIG_BACKTRACE_SELF_TEST is not set 1688# CONFIG_BACKTRACE_SELF_TEST is not set
1641# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 1689# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1690# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
1642# CONFIG_FAULT_INJECTION is not set 1691# CONFIG_FAULT_INJECTION is not set
1643# CONFIG_LATENCYTOP is not set 1692# CONFIG_LATENCYTOP is not set
1644# CONFIG_SYSCTL_SYSCALL_CHECK is not set 1693# CONFIG_SYSCTL_SYSCALL_CHECK is not set
@@ -1663,7 +1712,7 @@ CONFIG_BRANCH_PROFILE_NONE=y
1663# CONFIG_SAMPLES is not set 1712# CONFIG_SAMPLES is not set
1664CONFIG_HAVE_ARCH_KGDB=y 1713CONFIG_HAVE_ARCH_KGDB=y
1665# CONFIG_KGDB is not set 1714# CONFIG_KGDB is not set
1666CONFIG_ARM_UNWIND=y 1715# CONFIG_ARM_UNWIND is not set
1667CONFIG_DEBUG_USER=y 1716CONFIG_DEBUG_USER=y
1668CONFIG_DEBUG_ERRORS=y 1717CONFIG_DEBUG_ERRORS=y
1669# CONFIG_DEBUG_STACK_USAGE is not set 1718# CONFIG_DEBUG_STACK_USAGE is not set
@@ -1681,7 +1730,6 @@ CONFIG_CRYPTO=y
1681# 1730#
1682# Crypto core or helper 1731# Crypto core or helper
1683# 1732#
1684# CONFIG_CRYPTO_FIPS is not set
1685# CONFIG_CRYPTO_MANAGER is not set 1733# CONFIG_CRYPTO_MANAGER is not set
1686# CONFIG_CRYPTO_MANAGER2 is not set 1734# CONFIG_CRYPTO_MANAGER2 is not set
1687# CONFIG_CRYPTO_GF128MUL is not set 1735# CONFIG_CRYPTO_GF128MUL is not set
@@ -1713,11 +1761,13 @@ CONFIG_CRYPTO=y
1713# 1761#
1714# CONFIG_CRYPTO_HMAC is not set 1762# CONFIG_CRYPTO_HMAC is not set
1715# CONFIG_CRYPTO_XCBC is not set 1763# CONFIG_CRYPTO_XCBC is not set
1764# CONFIG_CRYPTO_VMAC is not set
1716 1765
1717# 1766#
1718# Digest 1767# Digest
1719# 1768#
1720# CONFIG_CRYPTO_CRC32C is not set 1769# CONFIG_CRYPTO_CRC32C is not set
1770# CONFIG_CRYPTO_GHASH is not set
1721# CONFIG_CRYPTO_MD4 is not set 1771# CONFIG_CRYPTO_MD4 is not set
1722# CONFIG_CRYPTO_MD5 is not set 1772# CONFIG_CRYPTO_MD5 is not set
1723# CONFIG_CRYPTO_MICHAEL_MIC is not set 1773# CONFIG_CRYPTO_MICHAEL_MIC is not set
diff --git a/arch/arm/configs/dove_defconfig b/arch/arm/configs/dove_defconfig
new file mode 100644
index 000000000000..b3a491675d59
--- /dev/null
+++ b/arch/arm/configs/dove_defconfig
@@ -0,0 +1,1620 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.32-rc6
4# Tue Nov 24 13:53:37 2009
5#
6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y
9CONFIG_GENERIC_TIME=y
10CONFIG_GENERIC_CLOCKEVENTS=y
11CONFIG_GENERIC_HARDIRQS=y
12CONFIG_STACKTRACE_SUPPORT=y
13CONFIG_HAVE_LATENCYTOP_SUPPORT=y
14CONFIG_LOCKDEP_SUPPORT=y
15CONFIG_TRACE_IRQFLAGS_SUPPORT=y
16CONFIG_HARDIRQS_SW_RESEND=y
17CONFIG_GENERIC_IRQ_PROBE=y
18CONFIG_RWSEM_GENERIC_SPINLOCK=y
19CONFIG_GENERIC_HWEIGHT=y
20CONFIG_GENERIC_CALIBRATE_DELAY=y
21CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
22CONFIG_VECTORS_BASE=0xffff0000
23CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
24CONFIG_CONSTRUCTORS=y
25
26#
27# General setup
28#
29CONFIG_EXPERIMENTAL=y
30CONFIG_BROKEN_ON_SMP=y
31CONFIG_INIT_ENV_ARG_LIMIT=32
32CONFIG_LOCALVERSION=""
33CONFIG_LOCALVERSION_AUTO=y
34CONFIG_SWAP=y
35CONFIG_SYSVIPC=y
36CONFIG_SYSVIPC_SYSCTL=y
37# CONFIG_POSIX_MQUEUE is not set
38# CONFIG_BSD_PROCESS_ACCT is not set
39# CONFIG_TASKSTATS is not set
40# CONFIG_AUDIT is not set
41
42#
43# RCU Subsystem
44#
45CONFIG_TREE_RCU=y
46# CONFIG_TREE_PREEMPT_RCU is not set
47# CONFIG_RCU_TRACE is not set
48CONFIG_RCU_FANOUT=32
49# CONFIG_RCU_FANOUT_EXACT is not set
50# CONFIG_TREE_RCU_TRACE is not set
51# CONFIG_IKCONFIG is not set
52CONFIG_LOG_BUF_SHIFT=14
53# CONFIG_GROUP_SCHED is not set
54# CONFIG_CGROUPS is not set
55# CONFIG_SYSFS_DEPRECATED_V2 is not set
56# CONFIG_RELAY is not set
57# CONFIG_NAMESPACES is not set
58# CONFIG_BLK_DEV_INITRD is not set
59CONFIG_CC_OPTIMIZE_FOR_SIZE=y
60CONFIG_SYSCTL=y
61CONFIG_ANON_INODES=y
62CONFIG_EMBEDDED=y
63CONFIG_UID16=y
64CONFIG_SYSCTL_SYSCALL=y
65CONFIG_KALLSYMS=y
66# CONFIG_KALLSYMS_ALL is not set
67# CONFIG_KALLSYMS_EXTRA_PASS is not set
68CONFIG_HOTPLUG=y
69CONFIG_PRINTK=y
70CONFIG_BUG=y
71CONFIG_ELF_CORE=y
72CONFIG_BASE_FULL=y
73CONFIG_FUTEX=y
74CONFIG_EPOLL=y
75CONFIG_SIGNALFD=y
76CONFIG_TIMERFD=y
77CONFIG_EVENTFD=y
78CONFIG_SHMEM=y
79CONFIG_AIO=y
80
81#
82# Kernel Performance Events And Counters
83#
84CONFIG_VM_EVENT_COUNTERS=y
85CONFIG_PCI_QUIRKS=y
86CONFIG_COMPAT_BRK=y
87CONFIG_SLAB=y
88# CONFIG_SLUB is not set
89# CONFIG_SLOB is not set
90# CONFIG_PROFILING is not set
91CONFIG_HAVE_OPROFILE=y
92# CONFIG_KPROBES is not set
93CONFIG_HAVE_KPROBES=y
94CONFIG_HAVE_KRETPROBES=y
95
96#
97# GCOV-based kernel profiling
98#
99# CONFIG_GCOV_KERNEL is not set
100# CONFIG_SLOW_WORK is not set
101CONFIG_HAVE_GENERIC_DMA_COHERENT=y
102CONFIG_SLABINFO=y
103CONFIG_RT_MUTEXES=y
104CONFIG_BASE_SMALL=0
105CONFIG_MODULES=y
106# CONFIG_MODULE_FORCE_LOAD is not set
107CONFIG_MODULE_UNLOAD=y
108# CONFIG_MODULE_FORCE_UNLOAD is not set
109# CONFIG_MODVERSIONS is not set
110# CONFIG_MODULE_SRCVERSION_ALL is not set
111CONFIG_BLOCK=y
112CONFIG_LBDAF=y
113# CONFIG_BLK_DEV_BSG is not set
114# CONFIG_BLK_DEV_INTEGRITY is not set
115
116#
117# IO Schedulers
118#
119CONFIG_IOSCHED_NOOP=y
120CONFIG_IOSCHED_AS=y
121CONFIG_IOSCHED_DEADLINE=y
122CONFIG_IOSCHED_CFQ=y
123# CONFIG_DEFAULT_AS is not set
124# CONFIG_DEFAULT_DEADLINE is not set
125CONFIG_DEFAULT_CFQ=y
126# CONFIG_DEFAULT_NOOP is not set
127CONFIG_DEFAULT_IOSCHED="cfq"
128# CONFIG_FREEZER is not set
129
130#
131# System Type
132#
133CONFIG_MMU=y
134# CONFIG_ARCH_AAEC2000 is not set
135# CONFIG_ARCH_INTEGRATOR is not set
136# CONFIG_ARCH_REALVIEW is not set
137# CONFIG_ARCH_VERSATILE is not set
138# CONFIG_ARCH_AT91 is not set
139# CONFIG_ARCH_CLPS711X is not set
140# CONFIG_ARCH_GEMINI is not set
141# CONFIG_ARCH_EBSA110 is not set
142# CONFIG_ARCH_EP93XX is not set
143# CONFIG_ARCH_FOOTBRIDGE is not set
144# CONFIG_ARCH_MXC is not set
145# CONFIG_ARCH_STMP3XXX is not set
146# CONFIG_ARCH_NETX is not set
147# CONFIG_ARCH_H720X is not set
148# CONFIG_ARCH_NOMADIK is not set
149# CONFIG_ARCH_IOP13XX is not set
150# CONFIG_ARCH_IOP32X is not set
151# CONFIG_ARCH_IOP33X is not set
152# CONFIG_ARCH_IXP23XX is not set
153# CONFIG_ARCH_IXP2000 is not set
154# CONFIG_ARCH_IXP4XX is not set
155# CONFIG_ARCH_L7200 is not set
156CONFIG_ARCH_DOVE=y
157# CONFIG_ARCH_KIRKWOOD is not set
158# CONFIG_ARCH_LOKI is not set
159# CONFIG_ARCH_MV78XX0 is not set
160# CONFIG_ARCH_ORION5X is not set
161# CONFIG_ARCH_MMP is not set
162# CONFIG_ARCH_KS8695 is not set
163# CONFIG_ARCH_NS9XXX is not set
164# CONFIG_ARCH_W90X900 is not set
165# CONFIG_ARCH_PNX4008 is not set
166# CONFIG_ARCH_PXA is not set
167# CONFIG_ARCH_MSM is not set
168# CONFIG_ARCH_RPC is not set
169# CONFIG_ARCH_SA1100 is not set
170# CONFIG_ARCH_S3C2410 is not set
171# CONFIG_ARCH_S3C64XX is not set
172# CONFIG_ARCH_S5PC1XX is not set
173# CONFIG_ARCH_SHARK is not set
174# CONFIG_ARCH_LH7A40X is not set
175# CONFIG_ARCH_U300 is not set
176# CONFIG_ARCH_DAVINCI is not set
177# CONFIG_ARCH_OMAP is not set
178# CONFIG_ARCH_BCMRING is not set
179
180#
181# Marvell Dove Implementations
182#
183CONFIG_MACH_DOVE_DB=y
184CONFIG_PLAT_ORION=y
185
186#
187# Processor Type
188#
189CONFIG_CPU_32=y
190CONFIG_CPU_V6=y
191CONFIG_CPU_32v6K=y
192CONFIG_CPU_32v6=y
193CONFIG_CPU_ABRT_EV6=y
194CONFIG_CPU_PABRT_V6=y
195CONFIG_CPU_CACHE_V6=y
196CONFIG_CPU_CACHE_VIPT=y
197CONFIG_CPU_COPY_V6=y
198CONFIG_CPU_TLB_V6=y
199CONFIG_CPU_HAS_ASID=y
200CONFIG_CPU_CP15=y
201CONFIG_CPU_CP15_MMU=y
202
203#
204# Processor Features
205#
206CONFIG_ARM_THUMB=y
207# CONFIG_CPU_ICACHE_DISABLE is not set
208# CONFIG_CPU_DCACHE_DISABLE is not set
209# CONFIG_CPU_BPREDICT_DISABLE is not set
210CONFIG_OUTER_CACHE=y
211CONFIG_CACHE_TAUROS2=y
212CONFIG_ARM_L1_CACHE_SHIFT=5
213# CONFIG_ARM_ERRATA_411920 is not set
214
215#
216# Bus support
217#
218CONFIG_PCI=y
219CONFIG_PCI_SYSCALL=y
220# CONFIG_ARCH_SUPPORTS_MSI is not set
221CONFIG_PCI_LEGACY=y
222# CONFIG_PCI_DEBUG is not set
223# CONFIG_PCI_STUB is not set
224# CONFIG_PCI_IOV is not set
225# CONFIG_PCCARD is not set
226
227#
228# Kernel Features
229#
230CONFIG_TICK_ONESHOT=y
231CONFIG_NO_HZ=y
232CONFIG_HIGH_RES_TIMERS=y
233CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
234CONFIG_VMSPLIT_3G=y
235# CONFIG_VMSPLIT_2G is not set
236# CONFIG_VMSPLIT_1G is not set
237CONFIG_PAGE_OFFSET=0xC0000000
238CONFIG_PREEMPT_NONE=y
239# CONFIG_PREEMPT_VOLUNTARY is not set
240# CONFIG_PREEMPT is not set
241CONFIG_HZ=100
242CONFIG_AEABI=y
243CONFIG_OABI_COMPAT=y
244# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
245# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
246# CONFIG_HIGHMEM is not set
247CONFIG_SELECT_MEMORY_MODEL=y
248CONFIG_FLATMEM_MANUAL=y
249# CONFIG_DISCONTIGMEM_MANUAL is not set
250# CONFIG_SPARSEMEM_MANUAL is not set
251CONFIG_FLATMEM=y
252CONFIG_FLAT_NODE_MEM_MAP=y
253CONFIG_PAGEFLAGS_EXTENDED=y
254CONFIG_SPLIT_PTLOCK_CPUS=4
255# CONFIG_PHYS_ADDR_T_64BIT is not set
256CONFIG_ZONE_DMA_FLAG=0
257CONFIG_VIRT_TO_BUS=y
258CONFIG_HAVE_MLOCK=y
259CONFIG_HAVE_MLOCKED_PAGE_BIT=y
260# CONFIG_KSM is not set
261CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
262CONFIG_ALIGNMENT_TRAP=y
263# CONFIG_UACCESS_WITH_MEMCPY is not set
264
265#
266# Boot options
267#
268CONFIG_ZBOOT_ROM_TEXT=0x0
269CONFIG_ZBOOT_ROM_BSS=0x0
270CONFIG_CMDLINE=""
271# CONFIG_XIP_KERNEL is not set
272# CONFIG_KEXEC is not set
273
274#
275# CPU Power Management
276#
277# CONFIG_CPU_IDLE is not set
278
279#
280# Floating point emulation
281#
282
283#
284# At least one emulation must be selected
285#
286# CONFIG_FPE_NWFPE is not set
287# CONFIG_FPE_FASTFPE is not set
288CONFIG_VFP=y
289
290#
291# Userspace binary formats
292#
293CONFIG_BINFMT_ELF=y
294# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
295CONFIG_HAVE_AOUT=y
296# CONFIG_BINFMT_AOUT is not set
297# CONFIG_BINFMT_MISC is not set
298
299#
300# Power management options
301#
302# CONFIG_PM is not set
303CONFIG_ARCH_SUSPEND_POSSIBLE=y
304CONFIG_NET=y
305
306#
307# Networking options
308#
309CONFIG_PACKET=y
310CONFIG_PACKET_MMAP=y
311CONFIG_UNIX=y
312CONFIG_XFRM=y
313# CONFIG_XFRM_USER is not set
314# CONFIG_XFRM_SUB_POLICY is not set
315# CONFIG_XFRM_MIGRATE is not set
316# CONFIG_XFRM_STATISTICS is not set
317# CONFIG_NET_KEY is not set
318CONFIG_INET=y
319CONFIG_IP_MULTICAST=y
320# CONFIG_IP_ADVANCED_ROUTER is not set
321CONFIG_IP_FIB_HASH=y
322CONFIG_IP_PNP=y
323CONFIG_IP_PNP_DHCP=y
324CONFIG_IP_PNP_BOOTP=y
325# CONFIG_IP_PNP_RARP is not set
326# CONFIG_NET_IPIP is not set
327# CONFIG_NET_IPGRE is not set
328# CONFIG_IP_MROUTE is not set
329# CONFIG_ARPD is not set
330# CONFIG_SYN_COOKIES is not set
331# CONFIG_INET_AH is not set
332# CONFIG_INET_ESP is not set
333# CONFIG_INET_IPCOMP is not set
334# CONFIG_INET_XFRM_TUNNEL is not set
335# CONFIG_INET_TUNNEL is not set
336CONFIG_INET_XFRM_MODE_TRANSPORT=y
337CONFIG_INET_XFRM_MODE_TUNNEL=y
338CONFIG_INET_XFRM_MODE_BEET=y
339CONFIG_INET_LRO=y
340CONFIG_INET_DIAG=y
341CONFIG_INET_TCP_DIAG=y
342# CONFIG_TCP_CONG_ADVANCED is not set
343CONFIG_TCP_CONG_CUBIC=y
344CONFIG_DEFAULT_TCP_CONG="cubic"
345# CONFIG_TCP_MD5SIG is not set
346# CONFIG_IPV6 is not set
347# CONFIG_NETWORK_SECMARK is not set
348# CONFIG_NETFILTER is not set
349# CONFIG_IP_DCCP is not set
350# CONFIG_IP_SCTP is not set
351# CONFIG_RDS is not set
352# CONFIG_TIPC is not set
353# CONFIG_ATM is not set
354# CONFIG_BRIDGE is not set
355# CONFIG_NET_DSA is not set
356# CONFIG_VLAN_8021Q is not set
357# CONFIG_DECNET is not set
358# CONFIG_LLC2 is not set
359# CONFIG_IPX is not set
360# CONFIG_ATALK is not set
361# CONFIG_X25 is not set
362# CONFIG_LAPB is not set
363# CONFIG_ECONET is not set
364# CONFIG_WAN_ROUTER is not set
365# CONFIG_PHONET is not set
366# CONFIG_IEEE802154 is not set
367# CONFIG_NET_SCHED is not set
368# CONFIG_DCB is not set
369
370#
371# Network testing
372#
373# CONFIG_NET_PKTGEN is not set
374# CONFIG_HAMRADIO is not set
375# CONFIG_CAN is not set
376# CONFIG_IRDA is not set
377# CONFIG_BT is not set
378# CONFIG_AF_RXRPC is not set
379# CONFIG_WIRELESS is not set
380# CONFIG_WIMAX is not set
381# CONFIG_RFKILL is not set
382# CONFIG_NET_9P is not set
383
384#
385# Device Drivers
386#
387
388#
389# Generic Driver Options
390#
391CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
392# CONFIG_DEVTMPFS is not set
393CONFIG_STANDALONE=y
394CONFIG_PREVENT_FIRMWARE_BUILD=y
395CONFIG_FW_LOADER=y
396CONFIG_FIRMWARE_IN_KERNEL=y
397CONFIG_EXTRA_FIRMWARE=""
398# CONFIG_DEBUG_DRIVER is not set
399# CONFIG_DEBUG_DEVRES is not set
400# CONFIG_SYS_HYPERVISOR is not set
401# CONFIG_CONNECTOR is not set
402CONFIG_MTD=y
403# CONFIG_MTD_DEBUG is not set
404# CONFIG_MTD_TESTS is not set
405# CONFIG_MTD_CONCAT is not set
406CONFIG_MTD_PARTITIONS=y
407# CONFIG_MTD_REDBOOT_PARTS is not set
408CONFIG_MTD_CMDLINE_PARTS=y
409# CONFIG_MTD_AFS_PARTS is not set
410# CONFIG_MTD_AR7_PARTS is not set
411
412#
413# User Modules And Translation Layers
414#
415CONFIG_MTD_CHAR=y
416CONFIG_MTD_BLKDEVS=y
417CONFIG_MTD_BLOCK=y
418# CONFIG_FTL is not set
419# CONFIG_NFTL is not set
420# CONFIG_INFTL is not set
421# CONFIG_RFD_FTL is not set
422# CONFIG_SSFDC is not set
423# CONFIG_MTD_OOPS is not set
424
425#
426# RAM/ROM/Flash chip drivers
427#
428CONFIG_MTD_CFI=y
429CONFIG_MTD_JEDECPROBE=y
430CONFIG_MTD_GEN_PROBE=y
431CONFIG_MTD_CFI_ADV_OPTIONS=y
432CONFIG_MTD_CFI_NOSWAP=y
433# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
434# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
435CONFIG_MTD_CFI_GEOMETRY=y
436CONFIG_MTD_MAP_BANK_WIDTH_1=y
437CONFIG_MTD_MAP_BANK_WIDTH_2=y
438# CONFIG_MTD_MAP_BANK_WIDTH_4 is not set
439# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
440# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
441# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
442CONFIG_MTD_CFI_I1=y
443CONFIG_MTD_CFI_I2=y
444# CONFIG_MTD_CFI_I4 is not set
445# CONFIG_MTD_CFI_I8 is not set
446# CONFIG_MTD_OTP is not set
447CONFIG_MTD_CFI_INTELEXT=y
448# CONFIG_MTD_CFI_AMDSTD is not set
449CONFIG_MTD_CFI_STAA=y
450CONFIG_MTD_CFI_UTIL=y
451# CONFIG_MTD_RAM is not set
452# CONFIG_MTD_ROM is not set
453# CONFIG_MTD_ABSENT is not set
454
455#
456# Mapping drivers for chip access
457#
458# CONFIG_MTD_COMPLEX_MAPPINGS is not set
459CONFIG_MTD_PHYSMAP=y
460# CONFIG_MTD_PHYSMAP_COMPAT is not set
461# CONFIG_MTD_ARM_INTEGRATOR is not set
462# CONFIG_MTD_IMPA7 is not set
463# CONFIG_MTD_INTEL_VR_NOR is not set
464# CONFIG_MTD_PLATRAM is not set
465
466#
467# Self-contained MTD device drivers
468#
469# CONFIG_MTD_PMC551 is not set
470# CONFIG_MTD_DATAFLASH is not set
471CONFIG_MTD_M25P80=y
472CONFIG_M25PXX_USE_FAST_READ=y
473# CONFIG_MTD_SST25L is not set
474# CONFIG_MTD_SLRAM is not set
475# CONFIG_MTD_PHRAM is not set
476# CONFIG_MTD_MTDRAM is not set
477# CONFIG_MTD_BLOCK2MTD is not set
478
479#
480# Disk-On-Chip Device Drivers
481#
482# CONFIG_MTD_DOC2000 is not set
483# CONFIG_MTD_DOC2001 is not set
484# CONFIG_MTD_DOC2001PLUS is not set
485# CONFIG_MTD_NAND is not set
486# CONFIG_MTD_ONENAND is not set
487
488#
489# LPDDR flash memory drivers
490#
491# CONFIG_MTD_LPDDR is not set
492
493#
494# UBI - Unsorted block images
495#
496CONFIG_MTD_UBI=y
497CONFIG_MTD_UBI_WL_THRESHOLD=4096
498CONFIG_MTD_UBI_BEB_RESERVE=1
499# CONFIG_MTD_UBI_GLUEBI is not set
500
501#
502# UBI debugging options
503#
504# CONFIG_MTD_UBI_DEBUG is not set
505# CONFIG_PARPORT is not set
506CONFIG_BLK_DEV=y
507# CONFIG_BLK_CPQ_DA is not set
508# CONFIG_BLK_CPQ_CISS_DA is not set
509# CONFIG_BLK_DEV_DAC960 is not set
510# CONFIG_BLK_DEV_UMEM is not set
511# CONFIG_BLK_DEV_COW_COMMON is not set
512CONFIG_BLK_DEV_LOOP=y
513# CONFIG_BLK_DEV_CRYPTOLOOP is not set
514# CONFIG_BLK_DEV_NBD is not set
515# CONFIG_BLK_DEV_SX8 is not set
516# CONFIG_BLK_DEV_UB is not set
517CONFIG_BLK_DEV_RAM=y
518CONFIG_BLK_DEV_RAM_COUNT=1
519CONFIG_BLK_DEV_RAM_SIZE=4096
520# CONFIG_BLK_DEV_XIP is not set
521# CONFIG_CDROM_PKTCDVD is not set
522# CONFIG_ATA_OVER_ETH is not set
523# CONFIG_MG_DISK is not set
524# CONFIG_MISC_DEVICES is not set
525CONFIG_HAVE_IDE=y
526# CONFIG_IDE is not set
527
528#
529# SCSI device support
530#
531# CONFIG_RAID_ATTRS is not set
532CONFIG_SCSI=y
533CONFIG_SCSI_DMA=y
534# CONFIG_SCSI_TGT is not set
535# CONFIG_SCSI_NETLINK is not set
536# CONFIG_SCSI_PROC_FS is not set
537
538#
539# SCSI support type (disk, tape, CD-ROM)
540#
541CONFIG_BLK_DEV_SD=y
542# CONFIG_CHR_DEV_ST is not set
543# CONFIG_CHR_DEV_OSST is not set
544# CONFIG_BLK_DEV_SR is not set
545# CONFIG_CHR_DEV_SG is not set
546# CONFIG_CHR_DEV_SCH is not set
547# CONFIG_SCSI_MULTI_LUN is not set
548# CONFIG_SCSI_CONSTANTS is not set
549# CONFIG_SCSI_LOGGING is not set
550# CONFIG_SCSI_SCAN_ASYNC is not set
551CONFIG_SCSI_WAIT_SCAN=m
552
553#
554# SCSI Transports
555#
556# CONFIG_SCSI_SPI_ATTRS is not set
557# CONFIG_SCSI_FC_ATTRS is not set
558# CONFIG_SCSI_ISCSI_ATTRS is not set
559# CONFIG_SCSI_SAS_LIBSAS is not set
560# CONFIG_SCSI_SRP_ATTRS is not set
561# CONFIG_SCSI_LOWLEVEL is not set
562# CONFIG_SCSI_DH is not set
563# CONFIG_SCSI_OSD_INITIATOR is not set
564CONFIG_ATA=y
565# CONFIG_ATA_NONSTANDARD is not set
566CONFIG_ATA_VERBOSE_ERROR=y
567CONFIG_SATA_PMP=y
568# CONFIG_SATA_AHCI is not set
569# CONFIG_SATA_SIL24 is not set
570CONFIG_ATA_SFF=y
571# CONFIG_SATA_SVW is not set
572# CONFIG_ATA_PIIX is not set
573CONFIG_SATA_MV=y
574# CONFIG_SATA_NV is not set
575# CONFIG_PDC_ADMA is not set
576# CONFIG_SATA_QSTOR is not set
577# CONFIG_SATA_PROMISE is not set
578# CONFIG_SATA_SX4 is not set
579# CONFIG_SATA_SIL is not set
580# CONFIG_SATA_SIS is not set
581# CONFIG_SATA_ULI is not set
582# CONFIG_SATA_VIA is not set
583# CONFIG_SATA_VITESSE is not set
584# CONFIG_SATA_INIC162X is not set
585# CONFIG_PATA_ALI is not set
586# CONFIG_PATA_AMD is not set
587# CONFIG_PATA_ARTOP is not set
588# CONFIG_PATA_ATP867X is not set
589# CONFIG_PATA_ATIIXP is not set
590# CONFIG_PATA_CMD640_PCI is not set
591# CONFIG_PATA_CMD64X is not set
592# CONFIG_PATA_CS5520 is not set
593# CONFIG_PATA_CS5530 is not set
594# CONFIG_PATA_CYPRESS is not set
595# CONFIG_PATA_EFAR is not set
596# CONFIG_ATA_GENERIC is not set
597# CONFIG_PATA_HPT366 is not set
598# CONFIG_PATA_HPT37X is not set
599# CONFIG_PATA_HPT3X2N is not set
600# CONFIG_PATA_HPT3X3 is not set
601# CONFIG_PATA_IT821X is not set
602# CONFIG_PATA_IT8213 is not set
603# CONFIG_PATA_JMICRON is not set
604# CONFIG_PATA_TRIFLEX is not set
605# CONFIG_PATA_MARVELL is not set
606# CONFIG_PATA_MPIIX is not set
607# CONFIG_PATA_OLDPIIX is not set
608# CONFIG_PATA_NETCELL is not set
609# CONFIG_PATA_NINJA32 is not set
610# CONFIG_PATA_NS87410 is not set
611# CONFIG_PATA_NS87415 is not set
612# CONFIG_PATA_OPTI is not set
613# CONFIG_PATA_OPTIDMA is not set
614# CONFIG_PATA_PDC_OLD is not set
615# CONFIG_PATA_RADISYS is not set
616# CONFIG_PATA_RDC is not set
617# CONFIG_PATA_RZ1000 is not set
618# CONFIG_PATA_SC1200 is not set
619# CONFIG_PATA_SERVERWORKS is not set
620# CONFIG_PATA_PDC2027X is not set
621# CONFIG_PATA_SIL680 is not set
622# CONFIG_PATA_SIS is not set
623# CONFIG_PATA_VIA is not set
624# CONFIG_PATA_WINBOND is not set
625# CONFIG_PATA_PLATFORM is not set
626# CONFIG_PATA_SCH is not set
627# CONFIG_MD is not set
628# CONFIG_FUSION is not set
629
630#
631# IEEE 1394 (FireWire) support
632#
633
634#
635# You can enable one or both FireWire driver stacks.
636#
637
638#
639# See the help texts for more information.
640#
641# CONFIG_FIREWIRE is not set
642# CONFIG_IEEE1394 is not set
643# CONFIG_I2O is not set
644CONFIG_NETDEVICES=y
645# CONFIG_DUMMY is not set
646# CONFIG_BONDING is not set
647# CONFIG_MACVLAN is not set
648# CONFIG_EQUALIZER is not set
649# CONFIG_TUN is not set
650# CONFIG_VETH is not set
651# CONFIG_ARCNET is not set
652CONFIG_PHYLIB=y
653
654#
655# MII PHY device drivers
656#
657# CONFIG_MARVELL_PHY is not set
658# CONFIG_DAVICOM_PHY is not set
659# CONFIG_QSEMI_PHY is not set
660# CONFIG_LXT_PHY is not set
661# CONFIG_CICADA_PHY is not set
662# CONFIG_VITESSE_PHY is not set
663# CONFIG_SMSC_PHY is not set
664# CONFIG_BROADCOM_PHY is not set
665# CONFIG_ICPLUS_PHY is not set
666# CONFIG_REALTEK_PHY is not set
667# CONFIG_NATIONAL_PHY is not set
668# CONFIG_STE10XP is not set
669# CONFIG_LSI_ET1011C_PHY is not set
670# CONFIG_FIXED_PHY is not set
671# CONFIG_MDIO_BITBANG is not set
672# CONFIG_NET_ETHERNET is not set
673CONFIG_NETDEV_1000=y
674# CONFIG_ACENIC is not set
675# CONFIG_DL2K is not set
676# CONFIG_E1000 is not set
677# CONFIG_E1000E is not set
678# CONFIG_IP1000 is not set
679# CONFIG_IGB is not set
680# CONFIG_IGBVF is not set
681# CONFIG_NS83820 is not set
682# CONFIG_HAMACHI is not set
683# CONFIG_YELLOWFIN is not set
684# CONFIG_R8169 is not set
685# CONFIG_SIS190 is not set
686# CONFIG_SKGE is not set
687# CONFIG_SKY2 is not set
688# CONFIG_VIA_VELOCITY is not set
689# CONFIG_TIGON3 is not set
690# CONFIG_BNX2 is not set
691# CONFIG_CNIC is not set
692CONFIG_MV643XX_ETH=y
693# CONFIG_QLA3XXX is not set
694# CONFIG_ATL1 is not set
695# CONFIG_ATL1E is not set
696# CONFIG_ATL1C is not set
697# CONFIG_JME is not set
698# CONFIG_NETDEV_10000 is not set
699# CONFIG_TR is not set
700CONFIG_WLAN=y
701# CONFIG_WLAN_PRE80211 is not set
702# CONFIG_WLAN_80211 is not set
703
704#
705# Enable WiMAX (Networking options) to see the WiMAX drivers
706#
707
708#
709# USB Network Adapters
710#
711# CONFIG_USB_CATC is not set
712# CONFIG_USB_KAWETH is not set
713# CONFIG_USB_PEGASUS is not set
714# CONFIG_USB_RTL8150 is not set
715# CONFIG_USB_USBNET is not set
716# CONFIG_WAN is not set
717# CONFIG_FDDI is not set
718# CONFIG_HIPPI is not set
719# CONFIG_PPP is not set
720# CONFIG_SLIP is not set
721# CONFIG_NET_FC is not set
722# CONFIG_NETCONSOLE is not set
723# CONFIG_NETPOLL is not set
724# CONFIG_NET_POLL_CONTROLLER is not set
725# CONFIG_ISDN is not set
726# CONFIG_PHONE is not set
727
728#
729# Input device support
730#
731CONFIG_INPUT=y
732# CONFIG_INPUT_FF_MEMLESS is not set
733CONFIG_INPUT_POLLDEV=y
734
735#
736# Userland interfaces
737#
738# CONFIG_INPUT_MOUSEDEV is not set
739# CONFIG_INPUT_JOYDEV is not set
740CONFIG_INPUT_EVDEV=y
741# CONFIG_INPUT_EVBUG is not set
742
743#
744# Input Device Drivers
745#
746CONFIG_INPUT_KEYBOARD=y
747# CONFIG_KEYBOARD_ADP5588 is not set
748# CONFIG_KEYBOARD_ATKBD is not set
749# CONFIG_QT2160 is not set
750# CONFIG_KEYBOARD_LKKBD is not set
751# CONFIG_KEYBOARD_GPIO is not set
752# CONFIG_KEYBOARD_MATRIX is not set
753# CONFIG_KEYBOARD_MAX7359 is not set
754# CONFIG_KEYBOARD_NEWTON is not set
755# CONFIG_KEYBOARD_OPENCORES is not set
756# CONFIG_KEYBOARD_STOWAWAY is not set
757# CONFIG_KEYBOARD_SUNKBD is not set
758# CONFIG_KEYBOARD_XTKBD is not set
759CONFIG_INPUT_MOUSE=y
760# CONFIG_MOUSE_PS2 is not set
761# CONFIG_MOUSE_SERIAL is not set
762# CONFIG_MOUSE_APPLETOUCH is not set
763# CONFIG_MOUSE_BCM5974 is not set
764# CONFIG_MOUSE_VSXXXAA is not set
765# CONFIG_MOUSE_GPIO is not set
766# CONFIG_MOUSE_SYNAPTICS_I2C is not set
767# CONFIG_INPUT_JOYSTICK is not set
768# CONFIG_INPUT_TABLET is not set
769# CONFIG_INPUT_TOUCHSCREEN is not set
770# CONFIG_INPUT_MISC is not set
771
772#
773# Hardware I/O ports
774#
775# CONFIG_SERIO is not set
776# CONFIG_GAMEPORT is not set
777
778#
779# Character devices
780#
781CONFIG_VT=y
782CONFIG_CONSOLE_TRANSLATIONS=y
783CONFIG_VT_CONSOLE=y
784CONFIG_HW_CONSOLE=y
785# CONFIG_VT_HW_CONSOLE_BINDING is not set
786# CONFIG_DEVKMEM is not set
787# CONFIG_SERIAL_NONSTANDARD is not set
788# CONFIG_NOZOMI is not set
789
790#
791# Serial drivers
792#
793CONFIG_SERIAL_8250=y
794CONFIG_SERIAL_8250_CONSOLE=y
795# CONFIG_SERIAL_8250_PCI is not set
796CONFIG_SERIAL_8250_NR_UARTS=4
797CONFIG_SERIAL_8250_RUNTIME_UARTS=2
798# CONFIG_SERIAL_8250_EXTENDED is not set
799
800#
801# Non-8250 serial port support
802#
803# CONFIG_SERIAL_MAX3100 is not set
804CONFIG_SERIAL_CORE=y
805CONFIG_SERIAL_CORE_CONSOLE=y
806# CONFIG_SERIAL_JSM is not set
807CONFIG_UNIX98_PTYS=y
808# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
809CONFIG_LEGACY_PTYS=y
810CONFIG_LEGACY_PTY_COUNT=16
811# CONFIG_IPMI_HANDLER is not set
812# CONFIG_HW_RANDOM is not set
813# CONFIG_R3964 is not set
814# CONFIG_APPLICOM is not set
815# CONFIG_RAW_DRIVER is not set
816# CONFIG_TCG_TPM is not set
817CONFIG_DEVPORT=y
818CONFIG_I2C=y
819CONFIG_I2C_BOARDINFO=y
820CONFIG_I2C_COMPAT=y
821CONFIG_I2C_CHARDEV=y
822CONFIG_I2C_HELPER_AUTO=y
823
824#
825# I2C Hardware Bus support
826#
827
828#
829# PC SMBus host controller drivers
830#
831# CONFIG_I2C_ALI1535 is not set
832# CONFIG_I2C_ALI1563 is not set
833# CONFIG_I2C_ALI15X3 is not set
834# CONFIG_I2C_AMD756 is not set
835# CONFIG_I2C_AMD8111 is not set
836# CONFIG_I2C_I801 is not set
837# CONFIG_I2C_ISCH is not set
838# CONFIG_I2C_PIIX4 is not set
839# CONFIG_I2C_NFORCE2 is not set
840# CONFIG_I2C_SIS5595 is not set
841# CONFIG_I2C_SIS630 is not set
842# CONFIG_I2C_SIS96X is not set
843# CONFIG_I2C_VIA is not set
844# CONFIG_I2C_VIAPRO is not set
845
846#
847# I2C system bus drivers (mostly embedded / system-on-chip)
848#
849# CONFIG_I2C_GPIO is not set
850CONFIG_I2C_MV64XXX=y
851# CONFIG_I2C_OCORES is not set
852# CONFIG_I2C_SIMTEC is not set
853
854#
855# External I2C/SMBus adapter drivers
856#
857# CONFIG_I2C_PARPORT_LIGHT is not set
858# CONFIG_I2C_TAOS_EVM is not set
859# CONFIG_I2C_TINY_USB is not set
860
861#
862# Graphics adapter I2C/DDC channel drivers
863#
864# CONFIG_I2C_VOODOO3 is not set
865
866#
867# Other I2C/SMBus bus drivers
868#
869# CONFIG_I2C_PCA_PLATFORM is not set
870# CONFIG_I2C_STUB is not set
871
872#
873# Miscellaneous I2C Chip support
874#
875# CONFIG_DS1682 is not set
876# CONFIG_SENSORS_TSL2550 is not set
877# CONFIG_I2C_DEBUG_CORE is not set
878# CONFIG_I2C_DEBUG_ALGO is not set
879# CONFIG_I2C_DEBUG_BUS is not set
880# CONFIG_I2C_DEBUG_CHIP is not set
881CONFIG_SPI=y
882# CONFIG_SPI_DEBUG is not set
883CONFIG_SPI_MASTER=y
884
885#
886# SPI Master Controller Drivers
887#
888# CONFIG_SPI_BITBANG is not set
889# CONFIG_SPI_GPIO is not set
890CONFIG_SPI_ORION=y
891
892#
893# SPI Protocol Masters
894#
895# CONFIG_SPI_SPIDEV is not set
896# CONFIG_SPI_TLE62X0 is not set
897
898#
899# PPS support
900#
901# CONFIG_PPS is not set
902CONFIG_ARCH_REQUIRE_GPIOLIB=y
903CONFIG_GPIOLIB=y
904# CONFIG_DEBUG_GPIO is not set
905# CONFIG_GPIO_SYSFS is not set
906
907#
908# Memory mapped GPIO expanders:
909#
910
911#
912# I2C GPIO expanders:
913#
914# CONFIG_GPIO_MAX732X is not set
915# CONFIG_GPIO_PCA953X is not set
916# CONFIG_GPIO_PCF857X is not set
917
918#
919# PCI GPIO expanders:
920#
921# CONFIG_GPIO_BT8XX is not set
922# CONFIG_GPIO_LANGWELL is not set
923
924#
925# SPI GPIO expanders:
926#
927# CONFIG_GPIO_MAX7301 is not set
928# CONFIG_GPIO_MCP23S08 is not set
929# CONFIG_GPIO_MC33880 is not set
930
931#
932# AC97 GPIO expanders:
933#
934# CONFIG_W1 is not set
935# CONFIG_POWER_SUPPLY is not set
936# CONFIG_HWMON is not set
937# CONFIG_THERMAL is not set
938# CONFIG_WATCHDOG is not set
939CONFIG_SSB_POSSIBLE=y
940
941#
942# Sonics Silicon Backplane
943#
944# CONFIG_SSB is not set
945
946#
947# Multifunction device drivers
948#
949# CONFIG_MFD_CORE is not set
950# CONFIG_MFD_SM501 is not set
951# CONFIG_MFD_ASIC3 is not set
952# CONFIG_HTC_EGPIO is not set
953# CONFIG_HTC_PASIC3 is not set
954# CONFIG_TPS65010 is not set
955# CONFIG_TWL4030_CORE is not set
956# CONFIG_MFD_TMIO is not set
957# CONFIG_MFD_TC6393XB is not set
958# CONFIG_PMIC_DA903X is not set
959# CONFIG_MFD_WM8400 is not set
960# CONFIG_MFD_WM831X is not set
961# CONFIG_MFD_WM8350_I2C is not set
962# CONFIG_MFD_PCF50633 is not set
963# CONFIG_MFD_MC13783 is not set
964# CONFIG_AB3100_CORE is not set
965# CONFIG_EZX_PCAP is not set
966# CONFIG_REGULATOR is not set
967# CONFIG_MEDIA_SUPPORT is not set
968
969#
970# Graphics support
971#
972CONFIG_VGA_ARB=y
973# CONFIG_DRM is not set
974# CONFIG_VGASTATE is not set
975# CONFIG_VIDEO_OUTPUT_CONTROL is not set
976# CONFIG_FB is not set
977# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
978
979#
980# Display device support
981#
982# CONFIG_DISPLAY_SUPPORT is not set
983
984#
985# Console display driver support
986#
987# CONFIG_VGA_CONSOLE is not set
988CONFIG_DUMMY_CONSOLE=y
989# CONFIG_SOUND is not set
990CONFIG_HID_SUPPORT=y
991CONFIG_HID=y
992# CONFIG_HIDRAW is not set
993
994#
995# USB Input Devices
996#
997CONFIG_USB_HID=y
998# CONFIG_HID_PID is not set
999# CONFIG_USB_HIDDEV is not set
1000
1001#
1002# Special HID drivers
1003#
1004# CONFIG_HID_A4TECH is not set
1005# CONFIG_HID_APPLE is not set
1006# CONFIG_HID_BELKIN is not set
1007# CONFIG_HID_CHERRY is not set
1008# CONFIG_HID_CHICONY is not set
1009# CONFIG_HID_CYPRESS is not set
1010# CONFIG_HID_DRAGONRISE is not set
1011# CONFIG_HID_EZKEY is not set
1012# CONFIG_HID_KYE is not set
1013# CONFIG_HID_GYRATION is not set
1014# CONFIG_HID_TWINHAN is not set
1015# CONFIG_HID_KENSINGTON is not set
1016# CONFIG_HID_LOGITECH is not set
1017# CONFIG_HID_MICROSOFT is not set
1018# CONFIG_HID_MONTEREY is not set
1019# CONFIG_HID_NTRIG is not set
1020# CONFIG_HID_PANTHERLORD is not set
1021# CONFIG_HID_PETALYNX is not set
1022# CONFIG_HID_SAMSUNG is not set
1023# CONFIG_HID_SONY is not set
1024# CONFIG_HID_SUNPLUS is not set
1025# CONFIG_HID_GREENASIA is not set
1026# CONFIG_HID_SMARTJOYPLUS is not set
1027# CONFIG_HID_TOPSEED is not set
1028# CONFIG_HID_THRUSTMASTER is not set
1029# CONFIG_HID_ZEROPLUS is not set
1030CONFIG_USB_SUPPORT=y
1031CONFIG_USB_ARCH_HAS_HCD=y
1032CONFIG_USB_ARCH_HAS_OHCI=y
1033CONFIG_USB_ARCH_HAS_EHCI=y
1034CONFIG_USB=y
1035# CONFIG_USB_DEBUG is not set
1036# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
1037
1038#
1039# Miscellaneous USB options
1040#
1041CONFIG_USB_DEVICEFS=y
1042CONFIG_USB_DEVICE_CLASS=y
1043# CONFIG_USB_DYNAMIC_MINORS is not set
1044# CONFIG_USB_OTG is not set
1045# CONFIG_USB_OTG_WHITELIST is not set
1046# CONFIG_USB_OTG_BLACKLIST_HUB is not set
1047# CONFIG_USB_MON is not set
1048# CONFIG_USB_WUSB is not set
1049# CONFIG_USB_WUSB_CBAF is not set
1050
1051#
1052# USB Host Controller Drivers
1053#
1054# CONFIG_USB_C67X00_HCD is not set
1055# CONFIG_USB_XHCI_HCD is not set
1056CONFIG_USB_EHCI_HCD=y
1057CONFIG_USB_EHCI_ROOT_HUB_TT=y
1058CONFIG_USB_EHCI_TT_NEWSCHED=y
1059# CONFIG_USB_OXU210HP_HCD is not set
1060# CONFIG_USB_ISP116X_HCD is not set
1061# CONFIG_USB_ISP1760_HCD is not set
1062# CONFIG_USB_ISP1362_HCD is not set
1063# CONFIG_USB_OHCI_HCD is not set
1064# CONFIG_USB_UHCI_HCD is not set
1065# CONFIG_USB_SL811_HCD is not set
1066# CONFIG_USB_R8A66597_HCD is not set
1067# CONFIG_USB_WHCI_HCD is not set
1068# CONFIG_USB_HWA_HCD is not set
1069# CONFIG_USB_MUSB_HDRC is not set
1070
1071#
1072# USB Device Class drivers
1073#
1074# CONFIG_USB_ACM is not set
1075# CONFIG_USB_PRINTER is not set
1076# CONFIG_USB_WDM is not set
1077# CONFIG_USB_TMC is not set
1078
1079#
1080# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
1081#
1082
1083#
1084# also be needed; see USB_STORAGE Help for more info
1085#
1086CONFIG_USB_STORAGE=y
1087# CONFIG_USB_STORAGE_DEBUG is not set
1088# CONFIG_USB_STORAGE_DATAFAB is not set
1089# CONFIG_USB_STORAGE_FREECOM is not set
1090# CONFIG_USB_STORAGE_ISD200 is not set
1091# CONFIG_USB_STORAGE_USBAT is not set
1092# CONFIG_USB_STORAGE_SDDR09 is not set
1093# CONFIG_USB_STORAGE_SDDR55 is not set
1094# CONFIG_USB_STORAGE_JUMPSHOT is not set
1095# CONFIG_USB_STORAGE_ALAUDA is not set
1096# CONFIG_USB_STORAGE_ONETOUCH is not set
1097# CONFIG_USB_STORAGE_KARMA is not set
1098# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
1099# CONFIG_USB_LIBUSUAL is not set
1100
1101#
1102# USB Imaging devices
1103#
1104# CONFIG_USB_MDC800 is not set
1105# CONFIG_USB_MICROTEK is not set
1106
1107#
1108# USB port drivers
1109#
1110# CONFIG_USB_SERIAL is not set
1111
1112#
1113# USB Miscellaneous drivers
1114#
1115# CONFIG_USB_EMI62 is not set
1116# CONFIG_USB_EMI26 is not set
1117# CONFIG_USB_ADUTUX is not set
1118# CONFIG_USB_SEVSEG is not set
1119# CONFIG_USB_RIO500 is not set
1120# CONFIG_USB_LEGOTOWER is not set
1121# CONFIG_USB_LCD is not set
1122# CONFIG_USB_BERRY_CHARGE is not set
1123# CONFIG_USB_LED is not set
1124# CONFIG_USB_CYPRESS_CY7C63 is not set
1125# CONFIG_USB_CYTHERM is not set
1126# CONFIG_USB_IDMOUSE is not set
1127# CONFIG_USB_FTDI_ELAN is not set
1128# CONFIG_USB_APPLEDISPLAY is not set
1129# CONFIG_USB_SISUSBVGA is not set
1130# CONFIG_USB_LD is not set
1131# CONFIG_USB_TRANCEVIBRATOR is not set
1132# CONFIG_USB_IOWARRIOR is not set
1133# CONFIG_USB_TEST is not set
1134# CONFIG_USB_ISIGHTFW is not set
1135# CONFIG_USB_VST is not set
1136# CONFIG_USB_GADGET is not set
1137
1138#
1139# OTG and related infrastructure
1140#
1141# CONFIG_USB_GPIO_VBUS is not set
1142# CONFIG_NOP_USB_XCEIV is not set
1143# CONFIG_UWB is not set
1144# CONFIG_MMC is not set
1145# CONFIG_MEMSTICK is not set
1146# CONFIG_NEW_LEDS is not set
1147# CONFIG_ACCESSIBILITY is not set
1148# CONFIG_INFINIBAND is not set
1149CONFIG_RTC_LIB=y
1150CONFIG_RTC_CLASS=y
1151CONFIG_RTC_HCTOSYS=y
1152CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
1153# CONFIG_RTC_DEBUG is not set
1154
1155#
1156# RTC interfaces
1157#
1158CONFIG_RTC_INTF_SYSFS=y
1159CONFIG_RTC_INTF_PROC=y
1160CONFIG_RTC_INTF_DEV=y
1161# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
1162# CONFIG_RTC_DRV_TEST is not set
1163
1164#
1165# I2C RTC drivers
1166#
1167# CONFIG_RTC_DRV_DS1307 is not set
1168# CONFIG_RTC_DRV_DS1374 is not set
1169# CONFIG_RTC_DRV_DS1672 is not set
1170# CONFIG_RTC_DRV_MAX6900 is not set
1171# CONFIG_RTC_DRV_RS5C372 is not set
1172# CONFIG_RTC_DRV_ISL1208 is not set
1173# CONFIG_RTC_DRV_X1205 is not set
1174# CONFIG_RTC_DRV_PCF8563 is not set
1175# CONFIG_RTC_DRV_PCF8583 is not set
1176# CONFIG_RTC_DRV_M41T80 is not set
1177# CONFIG_RTC_DRV_S35390A is not set
1178# CONFIG_RTC_DRV_FM3130 is not set
1179# CONFIG_RTC_DRV_RX8581 is not set
1180# CONFIG_RTC_DRV_RX8025 is not set
1181
1182#
1183# SPI RTC drivers
1184#
1185# CONFIG_RTC_DRV_M41T94 is not set
1186# CONFIG_RTC_DRV_DS1305 is not set
1187# CONFIG_RTC_DRV_DS1390 is not set
1188# CONFIG_RTC_DRV_MAX6902 is not set
1189# CONFIG_RTC_DRV_R9701 is not set
1190# CONFIG_RTC_DRV_RS5C348 is not set
1191# CONFIG_RTC_DRV_DS3234 is not set
1192# CONFIG_RTC_DRV_PCF2123 is not set
1193
1194#
1195# Platform RTC drivers
1196#
1197# CONFIG_RTC_DRV_CMOS is not set
1198# CONFIG_RTC_DRV_DS1286 is not set
1199# CONFIG_RTC_DRV_DS1511 is not set
1200# CONFIG_RTC_DRV_DS1553 is not set
1201# CONFIG_RTC_DRV_DS1742 is not set
1202# CONFIG_RTC_DRV_STK17TA8 is not set
1203# CONFIG_RTC_DRV_M48T86 is not set
1204# CONFIG_RTC_DRV_M48T35 is not set
1205# CONFIG_RTC_DRV_M48T59 is not set
1206# CONFIG_RTC_DRV_BQ4802 is not set
1207# CONFIG_RTC_DRV_V3020 is not set
1208
1209#
1210# on-CPU RTC drivers
1211#
1212CONFIG_RTC_DRV_MV=y
1213CONFIG_DMADEVICES=y
1214
1215#
1216# DMA Devices
1217#
1218CONFIG_MV_XOR=y
1219CONFIG_DMA_ENGINE=y
1220
1221#
1222# DMA Clients
1223#
1224# CONFIG_NET_DMA is not set
1225# CONFIG_ASYNC_TX_DMA is not set
1226# CONFIG_DMATEST is not set
1227# CONFIG_AUXDISPLAY is not set
1228# CONFIG_UIO is not set
1229
1230#
1231# TI VLYNQ
1232#
1233# CONFIG_STAGING is not set
1234
1235#
1236# File systems
1237#
1238CONFIG_EXT2_FS=y
1239# CONFIG_EXT2_FS_XATTR is not set
1240# CONFIG_EXT2_FS_XIP is not set
1241CONFIG_EXT3_FS=y
1242# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
1243# CONFIG_EXT3_FS_XATTR is not set
1244# CONFIG_EXT4_FS is not set
1245CONFIG_JBD=y
1246# CONFIG_JBD_DEBUG is not set
1247# CONFIG_REISERFS_FS is not set
1248# CONFIG_JFS_FS is not set
1249# CONFIG_FS_POSIX_ACL is not set
1250# CONFIG_XFS_FS is not set
1251# CONFIG_GFS2_FS is not set
1252# CONFIG_OCFS2_FS is not set
1253# CONFIG_BTRFS_FS is not set
1254# CONFIG_NILFS2_FS is not set
1255CONFIG_FILE_LOCKING=y
1256CONFIG_FSNOTIFY=y
1257CONFIG_DNOTIFY=y
1258CONFIG_INOTIFY=y
1259CONFIG_INOTIFY_USER=y
1260# CONFIG_QUOTA is not set
1261# CONFIG_AUTOFS_FS is not set
1262# CONFIG_AUTOFS4_FS is not set
1263# CONFIG_FUSE_FS is not set
1264
1265#
1266# Caches
1267#
1268# CONFIG_FSCACHE is not set
1269
1270#
1271# CD-ROM/DVD Filesystems
1272#
1273CONFIG_ISO9660_FS=y
1274CONFIG_JOLIET=y
1275# CONFIG_ZISOFS is not set
1276CONFIG_UDF_FS=m
1277CONFIG_UDF_NLS=y
1278
1279#
1280# DOS/FAT/NT Filesystems
1281#
1282CONFIG_FAT_FS=y
1283CONFIG_MSDOS_FS=y
1284CONFIG_VFAT_FS=y
1285CONFIG_FAT_DEFAULT_CODEPAGE=437
1286CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1287# CONFIG_NTFS_FS is not set
1288
1289#
1290# Pseudo filesystems
1291#
1292CONFIG_PROC_FS=y
1293CONFIG_PROC_SYSCTL=y
1294CONFIG_PROC_PAGE_MONITOR=y
1295CONFIG_SYSFS=y
1296CONFIG_TMPFS=y
1297# CONFIG_TMPFS_POSIX_ACL is not set
1298# CONFIG_HUGETLB_PAGE is not set
1299# CONFIG_CONFIGFS_FS is not set
1300CONFIG_MISC_FILESYSTEMS=y
1301# CONFIG_ADFS_FS is not set
1302# CONFIG_AFFS_FS is not set
1303# CONFIG_HFS_FS is not set
1304# CONFIG_HFSPLUS_FS is not set
1305# CONFIG_BEFS_FS is not set
1306# CONFIG_BFS_FS is not set
1307# CONFIG_EFS_FS is not set
1308CONFIG_JFFS2_FS=y
1309CONFIG_JFFS2_FS_DEBUG=0
1310CONFIG_JFFS2_FS_WRITEBUFFER=y
1311# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
1312# CONFIG_JFFS2_SUMMARY is not set
1313# CONFIG_JFFS2_FS_XATTR is not set
1314# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
1315CONFIG_JFFS2_ZLIB=y
1316# CONFIG_JFFS2_LZO is not set
1317CONFIG_JFFS2_RTIME=y
1318# CONFIG_JFFS2_RUBIN is not set
1319# CONFIG_UBIFS_FS is not set
1320# CONFIG_CRAMFS is not set
1321# CONFIG_SQUASHFS is not set
1322# CONFIG_VXFS_FS is not set
1323# CONFIG_MINIX_FS is not set
1324# CONFIG_OMFS_FS is not set
1325# CONFIG_HPFS_FS is not set
1326# CONFIG_QNX4FS_FS is not set
1327# CONFIG_ROMFS_FS is not set
1328# CONFIG_SYSV_FS is not set
1329# CONFIG_UFS_FS is not set
1330CONFIG_NETWORK_FILESYSTEMS=y
1331CONFIG_NFS_FS=y
1332CONFIG_NFS_V3=y
1333# CONFIG_NFS_V3_ACL is not set
1334# CONFIG_NFS_V4 is not set
1335CONFIG_ROOT_NFS=y
1336# CONFIG_NFSD is not set
1337CONFIG_LOCKD=y
1338CONFIG_LOCKD_V4=y
1339CONFIG_NFS_COMMON=y
1340CONFIG_SUNRPC=y
1341# CONFIG_RPCSEC_GSS_KRB5 is not set
1342# CONFIG_RPCSEC_GSS_SPKM3 is not set
1343# CONFIG_SMB_FS is not set
1344# CONFIG_CIFS is not set
1345# CONFIG_NCP_FS is not set
1346# CONFIG_CODA_FS is not set
1347# CONFIG_AFS_FS is not set
1348
1349#
1350# Partition Types
1351#
1352CONFIG_PARTITION_ADVANCED=y
1353# CONFIG_ACORN_PARTITION is not set
1354# CONFIG_OSF_PARTITION is not set
1355# CONFIG_AMIGA_PARTITION is not set
1356# CONFIG_ATARI_PARTITION is not set
1357# CONFIG_MAC_PARTITION is not set
1358CONFIG_MSDOS_PARTITION=y
1359# CONFIG_BSD_DISKLABEL is not set
1360# CONFIG_MINIX_SUBPARTITION is not set
1361# CONFIG_SOLARIS_X86_PARTITION is not set
1362# CONFIG_UNIXWARE_DISKLABEL is not set
1363# CONFIG_LDM_PARTITION is not set
1364# CONFIG_SGI_PARTITION is not set
1365# CONFIG_ULTRIX_PARTITION is not set
1366# CONFIG_SUN_PARTITION is not set
1367# CONFIG_KARMA_PARTITION is not set
1368# CONFIG_EFI_PARTITION is not set
1369# CONFIG_SYSV68_PARTITION is not set
1370CONFIG_NLS=y
1371CONFIG_NLS_DEFAULT="iso8859-1"
1372CONFIG_NLS_CODEPAGE_437=y
1373# CONFIG_NLS_CODEPAGE_737 is not set
1374# CONFIG_NLS_CODEPAGE_775 is not set
1375CONFIG_NLS_CODEPAGE_850=y
1376# CONFIG_NLS_CODEPAGE_852 is not set
1377# CONFIG_NLS_CODEPAGE_855 is not set
1378# CONFIG_NLS_CODEPAGE_857 is not set
1379# CONFIG_NLS_CODEPAGE_860 is not set
1380# CONFIG_NLS_CODEPAGE_861 is not set
1381# CONFIG_NLS_CODEPAGE_862 is not set
1382# CONFIG_NLS_CODEPAGE_863 is not set
1383# CONFIG_NLS_CODEPAGE_864 is not set
1384# CONFIG_NLS_CODEPAGE_865 is not set
1385# CONFIG_NLS_CODEPAGE_866 is not set
1386# CONFIG_NLS_CODEPAGE_869 is not set
1387# CONFIG_NLS_CODEPAGE_936 is not set
1388# CONFIG_NLS_CODEPAGE_950 is not set
1389# CONFIG_NLS_CODEPAGE_932 is not set
1390# CONFIG_NLS_CODEPAGE_949 is not set
1391# CONFIG_NLS_CODEPAGE_874 is not set
1392# CONFIG_NLS_ISO8859_8 is not set
1393# CONFIG_NLS_CODEPAGE_1250 is not set
1394# CONFIG_NLS_CODEPAGE_1251 is not set
1395# CONFIG_NLS_ASCII is not set
1396CONFIG_NLS_ISO8859_1=y
1397CONFIG_NLS_ISO8859_2=y
1398# CONFIG_NLS_ISO8859_3 is not set
1399# CONFIG_NLS_ISO8859_4 is not set
1400# CONFIG_NLS_ISO8859_5 is not set
1401# CONFIG_NLS_ISO8859_6 is not set
1402# CONFIG_NLS_ISO8859_7 is not set
1403# CONFIG_NLS_ISO8859_9 is not set
1404# CONFIG_NLS_ISO8859_13 is not set
1405# CONFIG_NLS_ISO8859_14 is not set
1406# CONFIG_NLS_ISO8859_15 is not set
1407# CONFIG_NLS_KOI8_R is not set
1408# CONFIG_NLS_KOI8_U is not set
1409CONFIG_NLS_UTF8=y
1410# CONFIG_DLM is not set
1411
1412#
1413# Kernel hacking
1414#
1415# CONFIG_PRINTK_TIME is not set
1416CONFIG_ENABLE_WARN_DEPRECATED=y
1417CONFIG_ENABLE_MUST_CHECK=y
1418CONFIG_FRAME_WARN=1024
1419CONFIG_MAGIC_SYSRQ=y
1420# CONFIG_STRIP_ASM_SYMS is not set
1421# CONFIG_UNUSED_SYMBOLS is not set
1422CONFIG_DEBUG_FS=y
1423# CONFIG_HEADERS_CHECK is not set
1424CONFIG_DEBUG_KERNEL=y
1425# CONFIG_DEBUG_SHIRQ is not set
1426CONFIG_DETECT_SOFTLOCKUP=y
1427# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1428CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
1429CONFIG_DETECT_HUNG_TASK=y
1430# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
1431CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
1432# CONFIG_SCHED_DEBUG is not set
1433# CONFIG_SCHEDSTATS is not set
1434CONFIG_TIMER_STATS=y
1435# CONFIG_DEBUG_OBJECTS is not set
1436# CONFIG_DEBUG_SLAB is not set
1437# CONFIG_DEBUG_KMEMLEAK is not set
1438# CONFIG_DEBUG_RT_MUTEXES is not set
1439# CONFIG_RT_MUTEX_TESTER is not set
1440# CONFIG_DEBUG_SPINLOCK is not set
1441# CONFIG_DEBUG_MUTEXES is not set
1442# CONFIG_DEBUG_LOCK_ALLOC is not set
1443# CONFIG_PROVE_LOCKING is not set
1444# CONFIG_LOCK_STAT is not set
1445# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1446# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1447# CONFIG_DEBUG_KOBJECT is not set
1448# CONFIG_DEBUG_BUGVERBOSE is not set
1449CONFIG_DEBUG_INFO=y
1450# CONFIG_DEBUG_VM is not set
1451# CONFIG_DEBUG_WRITECOUNT is not set
1452# CONFIG_DEBUG_MEMORY_INIT is not set
1453# CONFIG_DEBUG_LIST is not set
1454# CONFIG_DEBUG_SG is not set
1455# CONFIG_DEBUG_NOTIFIERS is not set
1456# CONFIG_DEBUG_CREDENTIALS is not set
1457# CONFIG_BOOT_PRINTK_DELAY is not set
1458# CONFIG_RCU_TORTURE_TEST is not set
1459# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1460# CONFIG_BACKTRACE_SELF_TEST is not set
1461# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1462# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
1463# CONFIG_FAULT_INJECTION is not set
1464# CONFIG_LATENCYTOP is not set
1465CONFIG_SYSCTL_SYSCALL_CHECK=y
1466# CONFIG_PAGE_POISONING is not set
1467CONFIG_HAVE_FUNCTION_TRACER=y
1468CONFIG_TRACING_SUPPORT=y
1469CONFIG_FTRACE=y
1470# CONFIG_FUNCTION_TRACER is not set
1471# CONFIG_IRQSOFF_TRACER is not set
1472# CONFIG_SCHED_TRACER is not set
1473# CONFIG_ENABLE_DEFAULT_TRACERS is not set
1474# CONFIG_BOOT_TRACER is not set
1475CONFIG_BRANCH_PROFILE_NONE=y
1476# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1477# CONFIG_PROFILE_ALL_BRANCHES is not set
1478# CONFIG_STACK_TRACER is not set
1479# CONFIG_KMEMTRACE is not set
1480# CONFIG_WORKQUEUE_TRACER is not set
1481# CONFIG_BLK_DEV_IO_TRACE is not set
1482# CONFIG_DYNAMIC_DEBUG is not set
1483# CONFIG_SAMPLES is not set
1484CONFIG_HAVE_ARCH_KGDB=y
1485# CONFIG_KGDB is not set
1486CONFIG_ARM_UNWIND=y
1487CONFIG_DEBUG_USER=y
1488CONFIG_DEBUG_ERRORS=y
1489# CONFIG_DEBUG_STACK_USAGE is not set
1490# CONFIG_DEBUG_LL is not set
1491
1492#
1493# Security options
1494#
1495# CONFIG_KEYS is not set
1496# CONFIG_SECURITY is not set
1497# CONFIG_SECURITYFS is not set
1498# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1499CONFIG_CRYPTO=y
1500
1501#
1502# Crypto core or helper
1503#
1504CONFIG_CRYPTO_ALGAPI=y
1505CONFIG_CRYPTO_ALGAPI2=y
1506CONFIG_CRYPTO_AEAD2=y
1507CONFIG_CRYPTO_BLKCIPHER=y
1508CONFIG_CRYPTO_BLKCIPHER2=y
1509CONFIG_CRYPTO_HASH=y
1510CONFIG_CRYPTO_HASH2=y
1511CONFIG_CRYPTO_RNG2=y
1512CONFIG_CRYPTO_PCOMP=y
1513CONFIG_CRYPTO_MANAGER=y
1514CONFIG_CRYPTO_MANAGER2=y
1515# CONFIG_CRYPTO_GF128MUL is not set
1516CONFIG_CRYPTO_NULL=y
1517CONFIG_CRYPTO_WORKQUEUE=y
1518# CONFIG_CRYPTO_CRYPTD is not set
1519# CONFIG_CRYPTO_AUTHENC is not set
1520# CONFIG_CRYPTO_TEST is not set
1521
1522#
1523# Authenticated Encryption with Associated Data
1524#
1525# CONFIG_CRYPTO_CCM is not set
1526# CONFIG_CRYPTO_GCM is not set
1527# CONFIG_CRYPTO_SEQIV is not set
1528
1529#
1530# Block modes
1531#
1532CONFIG_CRYPTO_CBC=y
1533# CONFIG_CRYPTO_CTR is not set
1534# CONFIG_CRYPTO_CTS is not set
1535CONFIG_CRYPTO_ECB=m
1536# CONFIG_CRYPTO_LRW is not set
1537CONFIG_CRYPTO_PCBC=m
1538# CONFIG_CRYPTO_XTS is not set
1539
1540#
1541# Hash modes
1542#
1543CONFIG_CRYPTO_HMAC=y
1544# CONFIG_CRYPTO_XCBC is not set
1545# CONFIG_CRYPTO_VMAC is not set
1546
1547#
1548# Digest
1549#
1550CONFIG_CRYPTO_CRC32C=y
1551# CONFIG_CRYPTO_GHASH is not set
1552CONFIG_CRYPTO_MD4=y
1553CONFIG_CRYPTO_MD5=y
1554# CONFIG_CRYPTO_MICHAEL_MIC is not set
1555# CONFIG_CRYPTO_RMD128 is not set
1556# CONFIG_CRYPTO_RMD160 is not set
1557# CONFIG_CRYPTO_RMD256 is not set
1558# CONFIG_CRYPTO_RMD320 is not set
1559CONFIG_CRYPTO_SHA1=y
1560CONFIG_CRYPTO_SHA256=y
1561CONFIG_CRYPTO_SHA512=y
1562# CONFIG_CRYPTO_TGR192 is not set
1563# CONFIG_CRYPTO_WP512 is not set
1564
1565#
1566# Ciphers
1567#
1568CONFIG_CRYPTO_AES=y
1569# CONFIG_CRYPTO_ANUBIS is not set
1570# CONFIG_CRYPTO_ARC4 is not set
1571CONFIG_CRYPTO_BLOWFISH=y
1572# CONFIG_CRYPTO_CAMELLIA is not set
1573# CONFIG_CRYPTO_CAST5 is not set
1574# CONFIG_CRYPTO_CAST6 is not set
1575CONFIG_CRYPTO_DES=y
1576# CONFIG_CRYPTO_FCRYPT is not set
1577# CONFIG_CRYPTO_KHAZAD is not set
1578# CONFIG_CRYPTO_SALSA20 is not set
1579# CONFIG_CRYPTO_SEED is not set
1580# CONFIG_CRYPTO_SERPENT is not set
1581CONFIG_CRYPTO_TEA=y
1582CONFIG_CRYPTO_TWOFISH=y
1583CONFIG_CRYPTO_TWOFISH_COMMON=y
1584
1585#
1586# Compression
1587#
1588CONFIG_CRYPTO_DEFLATE=y
1589# CONFIG_CRYPTO_ZLIB is not set
1590CONFIG_CRYPTO_LZO=y
1591
1592#
1593# Random Number Generation
1594#
1595# CONFIG_CRYPTO_ANSI_CPRNG is not set
1596CONFIG_CRYPTO_HW=y
1597# CONFIG_CRYPTO_DEV_MV_CESA is not set
1598# CONFIG_CRYPTO_DEV_HIFN_795X is not set
1599# CONFIG_BINARY_PRINTF is not set
1600
1601#
1602# Library routines
1603#
1604CONFIG_BITREVERSE=y
1605CONFIG_GENERIC_FIND_LAST_BIT=y
1606CONFIG_CRC_CCITT=y
1607CONFIG_CRC16=y
1608# CONFIG_CRC_T10DIF is not set
1609CONFIG_CRC_ITU_T=m
1610CONFIG_CRC32=y
1611# CONFIG_CRC7 is not set
1612CONFIG_LIBCRC32C=y
1613CONFIG_ZLIB_INFLATE=y
1614CONFIG_ZLIB_DEFLATE=y
1615CONFIG_LZO_COMPRESS=y
1616CONFIG_LZO_DECOMPRESS=y
1617CONFIG_HAS_IOMEM=y
1618CONFIG_HAS_IOPORT=y
1619CONFIG_HAS_DMA=y
1620CONFIG_NLATTR=y
diff --git a/arch/arm/configs/ezx_defconfig b/arch/arm/configs/ezx_defconfig
index d5ee16e6abf3..492f29aba332 100644
--- a/arch/arm/configs/ezx_defconfig
+++ b/arch/arm/configs/ezx_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.26-rc3 3# Linux kernel version: 2.6.32-rc5
4# Mon Jul 7 17:52:21 2008 4# Mon Nov 2 13:18:50 2009
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_HAVE_PWM=y 7CONFIG_HAVE_PWM=y
@@ -9,24 +9,22 @@ CONFIG_SYS_SUPPORTS_APM_EMULATION=y
9CONFIG_GENERIC_GPIO=y 9CONFIG_GENERIC_GPIO=y
10CONFIG_GENERIC_TIME=y 10CONFIG_GENERIC_TIME=y
11CONFIG_GENERIC_CLOCKEVENTS=y 11CONFIG_GENERIC_CLOCKEVENTS=y
12CONFIG_MMU=y
13# CONFIG_NO_IOPORT is not set
14CONFIG_GENERIC_HARDIRQS=y 12CONFIG_GENERIC_HARDIRQS=y
15CONFIG_STACKTRACE_SUPPORT=y 13CONFIG_STACKTRACE_SUPPORT=y
14CONFIG_HAVE_LATENCYTOP_SUPPORT=y
16CONFIG_LOCKDEP_SUPPORT=y 15CONFIG_LOCKDEP_SUPPORT=y
17CONFIG_TRACE_IRQFLAGS_SUPPORT=y 16CONFIG_TRACE_IRQFLAGS_SUPPORT=y
18CONFIG_HARDIRQS_SW_RESEND=y 17CONFIG_HARDIRQS_SW_RESEND=y
19CONFIG_GENERIC_IRQ_PROBE=y 18CONFIG_GENERIC_IRQ_PROBE=y
20CONFIG_RWSEM_GENERIC_SPINLOCK=y 19CONFIG_RWSEM_GENERIC_SPINLOCK=y
21# CONFIG_ARCH_HAS_ILOG2_U32 is not set 20CONFIG_ARCH_HAS_CPUFREQ=y
22# CONFIG_ARCH_HAS_ILOG2_U64 is not set
23CONFIG_GENERIC_HWEIGHT=y 21CONFIG_GENERIC_HWEIGHT=y
24CONFIG_GENERIC_CALIBRATE_DELAY=y 22CONFIG_GENERIC_CALIBRATE_DELAY=y
25CONFIG_ARCH_SUPPORTS_AOUT=y
26CONFIG_ZONE_DMA=y
27CONFIG_ARCH_MTD_XIP=y 23CONFIG_ARCH_MTD_XIP=y
24CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
28CONFIG_VECTORS_BASE=0xffff0000 25CONFIG_VECTORS_BASE=0xffff0000
29CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 26CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
27CONFIG_CONSTRUCTORS=y
30 28
31# 29#
32# General setup 30# General setup
@@ -35,7 +33,7 @@ CONFIG_EXPERIMENTAL=y
35CONFIG_BROKEN_ON_SMP=y 33CONFIG_BROKEN_ON_SMP=y
36CONFIG_LOCK_KERNEL=y 34CONFIG_LOCK_KERNEL=y
37CONFIG_INIT_ENV_ARG_LIMIT=32 35CONFIG_INIT_ENV_ARG_LIMIT=32
38CONFIG_LOCALVERSION="-ezxdev" 36CONFIG_LOCALVERSION="-ezx200910312315"
39# CONFIG_LOCALVERSION_AUTO is not set 37# CONFIG_LOCALVERSION_AUTO is not set
40CONFIG_SWAP=y 38CONFIG_SWAP=y
41CONFIG_SYSVIPC=y 39CONFIG_SYSVIPC=y
@@ -44,56 +42,78 @@ CONFIG_SYSVIPC_SYSCTL=y
44# CONFIG_BSD_PROCESS_ACCT is not set 42# CONFIG_BSD_PROCESS_ACCT is not set
45# CONFIG_TASKSTATS is not set 43# CONFIG_TASKSTATS is not set
46# CONFIG_AUDIT is not set 44# CONFIG_AUDIT is not set
47CONFIG_IKCONFIG=y 45
48CONFIG_IKCONFIG_PROC=y 46#
47# RCU Subsystem
48#
49CONFIG_TREE_RCU=y
50# CONFIG_TREE_PREEMPT_RCU is not set
51# CONFIG_RCU_TRACE is not set
52CONFIG_RCU_FANOUT=32
53# CONFIG_RCU_FANOUT_EXACT is not set
54# CONFIG_TREE_RCU_TRACE is not set
55# CONFIG_IKCONFIG is not set
49CONFIG_LOG_BUF_SHIFT=14 56CONFIG_LOG_BUF_SHIFT=14
50# CONFIG_CGROUPS is not set
51CONFIG_GROUP_SCHED=y 57CONFIG_GROUP_SCHED=y
52CONFIG_FAIR_GROUP_SCHED=y 58CONFIG_FAIR_GROUP_SCHED=y
53# CONFIG_RT_GROUP_SCHED is not set 59# CONFIG_RT_GROUP_SCHED is not set
54CONFIG_USER_SCHED=y 60CONFIG_USER_SCHED=y
55# CONFIG_CGROUP_SCHED is not set 61# CONFIG_CGROUP_SCHED is not set
62# CONFIG_CGROUPS is not set
56CONFIG_SYSFS_DEPRECATED=y 63CONFIG_SYSFS_DEPRECATED=y
57CONFIG_SYSFS_DEPRECATED_V2=y 64CONFIG_SYSFS_DEPRECATED_V2=y
58# CONFIG_RELAY is not set 65# CONFIG_RELAY is not set
59# CONFIG_NAMESPACES is not set 66# CONFIG_NAMESPACES is not set
60# CONFIG_BLK_DEV_INITRD is not set 67CONFIG_BLK_DEV_INITRD=y
68CONFIG_INITRAMFS_SOURCE=""
69CONFIG_RD_GZIP=y
70CONFIG_RD_BZIP2=y
71CONFIG_RD_LZMA=y
61CONFIG_CC_OPTIMIZE_FOR_SIZE=y 72CONFIG_CC_OPTIMIZE_FOR_SIZE=y
62CONFIG_SYSCTL=y 73CONFIG_SYSCTL=y
74CONFIG_ANON_INODES=y
63CONFIG_EMBEDDED=y 75CONFIG_EMBEDDED=y
64CONFIG_UID16=y 76CONFIG_UID16=y
65CONFIG_SYSCTL_SYSCALL=y 77CONFIG_SYSCTL_SYSCALL=y
66CONFIG_SYSCTL_SYSCALL_CHECK=y
67CONFIG_KALLSYMS=y 78CONFIG_KALLSYMS=y
79CONFIG_KALLSYMS_ALL=y
68# CONFIG_KALLSYMS_EXTRA_PASS is not set 80# CONFIG_KALLSYMS_EXTRA_PASS is not set
69CONFIG_HOTPLUG=y 81CONFIG_HOTPLUG=y
70CONFIG_PRINTK=y 82CONFIG_PRINTK=y
71CONFIG_BUG=y 83CONFIG_BUG=y
72CONFIG_ELF_CORE=y 84CONFIG_ELF_CORE=y
73# CONFIG_COMPAT_BRK is not set
74CONFIG_BASE_FULL=y 85CONFIG_BASE_FULL=y
75CONFIG_FUTEX=y 86CONFIG_FUTEX=y
76CONFIG_ANON_INODES=y
77CONFIG_EPOLL=y 87CONFIG_EPOLL=y
78CONFIG_SIGNALFD=y 88CONFIG_SIGNALFD=y
79CONFIG_TIMERFD=y 89CONFIG_TIMERFD=y
80CONFIG_EVENTFD=y 90CONFIG_EVENTFD=y
81CONFIG_SHMEM=y 91CONFIG_SHMEM=y
92CONFIG_AIO=y
93
94#
95# Kernel Performance Events And Counters
96#
82CONFIG_VM_EVENT_COUNTERS=y 97CONFIG_VM_EVENT_COUNTERS=y
98# CONFIG_COMPAT_BRK is not set
83CONFIG_SLAB=y 99CONFIG_SLAB=y
84# CONFIG_SLUB is not set 100# CONFIG_SLUB is not set
85# CONFIG_SLOB is not set 101# CONFIG_SLOB is not set
86# CONFIG_PROFILING is not set 102# CONFIG_PROFILING is not set
87# CONFIG_MARKERS is not set
88CONFIG_HAVE_OPROFILE=y 103CONFIG_HAVE_OPROFILE=y
89# CONFIG_KPROBES is not set 104# CONFIG_KPROBES is not set
90CONFIG_HAVE_KPROBES=y 105CONFIG_HAVE_KPROBES=y
91CONFIG_HAVE_KRETPROBES=y 106CONFIG_HAVE_KRETPROBES=y
92# CONFIG_HAVE_DMA_ATTRS is not set 107CONFIG_HAVE_CLK=y
93CONFIG_PROC_PAGE_MONITOR=y 108
109#
110# GCOV-based kernel profiling
111#
112# CONFIG_GCOV_KERNEL is not set
113CONFIG_SLOW_WORK=y
114CONFIG_HAVE_GENERIC_DMA_COHERENT=y
94CONFIG_SLABINFO=y 115CONFIG_SLABINFO=y
95CONFIG_RT_MUTEXES=y 116CONFIG_RT_MUTEXES=y
96# CONFIG_TINY_SHMEM is not set
97CONFIG_BASE_SMALL=0 117CONFIG_BASE_SMALL=0
98CONFIG_MODULES=y 118CONFIG_MODULES=y
99# CONFIG_MODULE_FORCE_LOAD is not set 119# CONFIG_MODULE_FORCE_LOAD is not set
@@ -101,12 +121,10 @@ CONFIG_MODULE_UNLOAD=y
101CONFIG_MODULE_FORCE_UNLOAD=y 121CONFIG_MODULE_FORCE_UNLOAD=y
102CONFIG_MODVERSIONS=y 122CONFIG_MODVERSIONS=y
103# CONFIG_MODULE_SRCVERSION_ALL is not set 123# CONFIG_MODULE_SRCVERSION_ALL is not set
104CONFIG_KMOD=y
105CONFIG_BLOCK=y 124CONFIG_BLOCK=y
106# CONFIG_LBD is not set 125# CONFIG_LBDAF is not set
107# CONFIG_BLK_DEV_IO_TRACE is not set
108# CONFIG_LSF is not set
109# CONFIG_BLK_DEV_BSG is not set 126# CONFIG_BLK_DEV_BSG is not set
127# CONFIG_BLK_DEV_INTEGRITY is not set
110 128
111# 129#
112# IO Schedulers 130# IO Schedulers
@@ -120,25 +138,27 @@ CONFIG_DEFAULT_DEADLINE=y
120# CONFIG_DEFAULT_CFQ is not set 138# CONFIG_DEFAULT_CFQ is not set
121# CONFIG_DEFAULT_NOOP is not set 139# CONFIG_DEFAULT_NOOP is not set
122CONFIG_DEFAULT_IOSCHED="deadline" 140CONFIG_DEFAULT_IOSCHED="deadline"
123CONFIG_CLASSIC_RCU=y 141CONFIG_FREEZER=y
124 142
125# 143#
126# System Type 144# System Type
127# 145#
146CONFIG_MMU=y
128# CONFIG_ARCH_AAEC2000 is not set 147# CONFIG_ARCH_AAEC2000 is not set
129# CONFIG_ARCH_INTEGRATOR is not set 148# CONFIG_ARCH_INTEGRATOR is not set
130# CONFIG_ARCH_REALVIEW is not set 149# CONFIG_ARCH_REALVIEW is not set
131# CONFIG_ARCH_VERSATILE is not set 150# CONFIG_ARCH_VERSATILE is not set
132# CONFIG_ARCH_AT91 is not set 151# CONFIG_ARCH_AT91 is not set
133# CONFIG_ARCH_CLPS7500 is not set
134# CONFIG_ARCH_CLPS711X is not set 152# CONFIG_ARCH_CLPS711X is not set
135# CONFIG_ARCH_CO285 is not set 153# CONFIG_ARCH_GEMINI is not set
136# CONFIG_ARCH_EBSA110 is not set 154# CONFIG_ARCH_EBSA110 is not set
137# CONFIG_ARCH_EP93XX is not set 155# CONFIG_ARCH_EP93XX is not set
138# CONFIG_ARCH_FOOTBRIDGE is not set 156# CONFIG_ARCH_FOOTBRIDGE is not set
157# CONFIG_ARCH_MXC is not set
158# CONFIG_ARCH_STMP3XXX is not set
139# CONFIG_ARCH_NETX is not set 159# CONFIG_ARCH_NETX is not set
140# CONFIG_ARCH_H720X is not set 160# CONFIG_ARCH_H720X is not set
141# CONFIG_ARCH_IMX is not set 161# CONFIG_ARCH_NOMADIK is not set
142# CONFIG_ARCH_IOP13XX is not set 162# CONFIG_ARCH_IOP13XX is not set
143# CONFIG_ARCH_IOP32X is not set 163# CONFIG_ARCH_IOP32X is not set
144# CONFIG_ARCH_IOP33X is not set 164# CONFIG_ARCH_IOP33X is not set
@@ -146,39 +166,64 @@ CONFIG_CLASSIC_RCU=y
146# CONFIG_ARCH_IXP2000 is not set 166# CONFIG_ARCH_IXP2000 is not set
147# CONFIG_ARCH_IXP4XX is not set 167# CONFIG_ARCH_IXP4XX is not set
148# CONFIG_ARCH_L7200 is not set 168# CONFIG_ARCH_L7200 is not set
169# CONFIG_ARCH_KIRKWOOD is not set
170# CONFIG_ARCH_LOKI is not set
171# CONFIG_ARCH_MV78XX0 is not set
172# CONFIG_ARCH_ORION5X is not set
173# CONFIG_ARCH_MMP is not set
149# CONFIG_ARCH_KS8695 is not set 174# CONFIG_ARCH_KS8695 is not set
150# CONFIG_ARCH_NS9XXX is not set 175# CONFIG_ARCH_NS9XXX is not set
151# CONFIG_ARCH_MXC is not set 176# CONFIG_ARCH_W90X900 is not set
152# CONFIG_ARCH_ORION5X is not set
153# CONFIG_ARCH_PNX4008 is not set 177# CONFIG_ARCH_PNX4008 is not set
154CONFIG_ARCH_PXA=y 178CONFIG_ARCH_PXA=y
179# CONFIG_ARCH_MSM is not set
155# CONFIG_ARCH_RPC is not set 180# CONFIG_ARCH_RPC is not set
156# CONFIG_ARCH_SA1100 is not set 181# CONFIG_ARCH_SA1100 is not set
157# CONFIG_ARCH_S3C2410 is not set 182# CONFIG_ARCH_S3C2410 is not set
183# CONFIG_ARCH_S3C64XX is not set
184# CONFIG_ARCH_S5PC1XX is not set
158# CONFIG_ARCH_SHARK is not set 185# CONFIG_ARCH_SHARK is not set
159# CONFIG_ARCH_LH7A40X is not set 186# CONFIG_ARCH_LH7A40X is not set
187# CONFIG_ARCH_U300 is not set
160# CONFIG_ARCH_DAVINCI is not set 188# CONFIG_ARCH_DAVINCI is not set
161# CONFIG_ARCH_OMAP is not set 189# CONFIG_ARCH_OMAP is not set
162# CONFIG_ARCH_MSM7X00A is not set 190# CONFIG_ARCH_BCMRING is not set
163 191
164# 192#
165# Intel PXA2xx/PXA3xx Implementations 193# Intel PXA2xx/PXA3xx Implementations
166# 194#
167# CONFIG_ARCH_GUMSTIX is not set 195# CONFIG_ARCH_GUMSTIX is not set
196# CONFIG_MACH_INTELMOTE2 is not set
197# CONFIG_MACH_STARGATE2 is not set
168# CONFIG_ARCH_LUBBOCK is not set 198# CONFIG_ARCH_LUBBOCK is not set
169# CONFIG_MACH_LOGICPD_PXA270 is not set 199# CONFIG_MACH_LOGICPD_PXA270 is not set
170# CONFIG_MACH_MAINSTONE is not set 200# CONFIG_MACH_MAINSTONE is not set
201# CONFIG_MACH_MP900C is not set
202# CONFIG_MACH_BALLOON3 is not set
171# CONFIG_ARCH_PXA_IDP is not set 203# CONFIG_ARCH_PXA_IDP is not set
172# CONFIG_PXA_SHARPSL is not set 204# CONFIG_PXA_SHARPSL is not set
205# CONFIG_ARCH_VIPER is not set
173# CONFIG_ARCH_PXA_ESERIES is not set 206# CONFIG_ARCH_PXA_ESERIES is not set
174# CONFIG_MACH_TRIZEPS4 is not set 207# CONFIG_TRIZEPS_PXA is not set
208# CONFIG_MACH_H5000 is not set
175# CONFIG_MACH_EM_X270 is not set 209# CONFIG_MACH_EM_X270 is not set
210# CONFIG_MACH_EXEDA is not set
176# CONFIG_MACH_COLIBRI is not set 211# CONFIG_MACH_COLIBRI is not set
212# CONFIG_MACH_COLIBRI300 is not set
213# CONFIG_MACH_COLIBRI320 is not set
177# CONFIG_MACH_ZYLONITE is not set 214# CONFIG_MACH_ZYLONITE is not set
178# CONFIG_MACH_LITTLETON is not set 215# CONFIG_MACH_LITTLETON is not set
216# CONFIG_MACH_TAVOREVB is not set
217# CONFIG_MACH_SAAR is not set
179# CONFIG_MACH_ARMCORE is not set 218# CONFIG_MACH_ARMCORE is not set
219# CONFIG_MACH_CM_X300 is not set
220# CONFIG_MACH_H4700 is not set
180# CONFIG_MACH_MAGICIAN is not set 221# CONFIG_MACH_MAGICIAN is not set
222# CONFIG_MACH_HIMALAYA is not set
223# CONFIG_MACH_MIOA701 is not set
181# CONFIG_MACH_PCM027 is not set 224# CONFIG_MACH_PCM027 is not set
225# CONFIG_ARCH_PXA_PALM is not set
226# CONFIG_MACH_CSB726 is not set
182CONFIG_PXA_EZX=y 227CONFIG_PXA_EZX=y
183CONFIG_MACH_EZX_A780=y 228CONFIG_MACH_EZX_A780=y
184CONFIG_MACH_EZX_E680=y 229CONFIG_MACH_EZX_E680=y
@@ -186,17 +231,11 @@ CONFIG_MACH_EZX_A1200=y
186CONFIG_MACH_EZX_A910=y 231CONFIG_MACH_EZX_A910=y
187CONFIG_MACH_EZX_E6=y 232CONFIG_MACH_EZX_E6=y
188CONFIG_MACH_EZX_E2=y 233CONFIG_MACH_EZX_E2=y
234# CONFIG_MACH_XCEP is not set
189CONFIG_PXA27x=y 235CONFIG_PXA27x=y
190CONFIG_PXA_SSP=y 236CONFIG_PXA_SSP=y
191CONFIG_PXA_PWM=y 237CONFIG_PXA_HAVE_BOARD_IRQS=y
192 238CONFIG_PLAT_PXA=y
193#
194# Boot options
195#
196
197#
198# Power management
199#
200 239
201# 240#
202# Processor Type 241# Processor Type
@@ -205,7 +244,7 @@ CONFIG_CPU_32=y
205CONFIG_CPU_XSCALE=y 244CONFIG_CPU_XSCALE=y
206CONFIG_CPU_32v5=y 245CONFIG_CPU_32v5=y
207CONFIG_CPU_ABRT_EV5T=y 246CONFIG_CPU_ABRT_EV5T=y
208CONFIG_CPU_PABRT_NOIFAR=y 247CONFIG_CPU_PABRT_LEGACY=y
209CONFIG_CPU_CACHE_VIVT=y 248CONFIG_CPU_CACHE_VIVT=y
210CONFIG_CPU_TLB_V4WBI=y 249CONFIG_CPU_TLB_V4WBI=y
211CONFIG_CPU_CP15=y 250CONFIG_CPU_CP15=y
@@ -216,9 +255,10 @@ CONFIG_CPU_CP15_MMU=y
216# 255#
217CONFIG_ARM_THUMB=y 256CONFIG_ARM_THUMB=y
218# CONFIG_CPU_DCACHE_DISABLE is not set 257# CONFIG_CPU_DCACHE_DISABLE is not set
219# CONFIG_OUTER_CACHE is not set 258CONFIG_ARM_L1_CACHE_SHIFT=5
220CONFIG_IWMMXT=y 259CONFIG_IWMMXT=y
221CONFIG_XSCALE_PMU=y 260CONFIG_XSCALE_PMU=y
261CONFIG_COMMON_CLKDEV=y
222 262
223# 263#
224# Bus support 264# Bus support
@@ -231,44 +271,71 @@ CONFIG_XSCALE_PMU=y
231# Kernel Features 271# Kernel Features
232# 272#
233CONFIG_TICK_ONESHOT=y 273CONFIG_TICK_ONESHOT=y
234# CONFIG_NO_HZ is not set 274CONFIG_NO_HZ=y
235CONFIG_HIGH_RES_TIMERS=y 275CONFIG_HIGH_RES_TIMERS=y
236CONFIG_GENERIC_CLOCKEVENTS_BUILD=y 276CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
277CONFIG_VMSPLIT_3G=y
278# CONFIG_VMSPLIT_2G is not set
279# CONFIG_VMSPLIT_1G is not set
280CONFIG_PAGE_OFFSET=0xC0000000
281# CONFIG_PREEMPT_NONE is not set
282# CONFIG_PREEMPT_VOLUNTARY is not set
237CONFIG_PREEMPT=y 283CONFIG_PREEMPT=y
238CONFIG_HZ=100 284CONFIG_HZ=100
239CONFIG_AEABI=y 285CONFIG_AEABI=y
240CONFIG_OABI_COMPAT=y 286CONFIG_OABI_COMPAT=y
241# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set 287# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
288# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
289# CONFIG_HIGHMEM is not set
242CONFIG_SELECT_MEMORY_MODEL=y 290CONFIG_SELECT_MEMORY_MODEL=y
243CONFIG_FLATMEM_MANUAL=y 291CONFIG_FLATMEM_MANUAL=y
244# CONFIG_DISCONTIGMEM_MANUAL is not set 292# CONFIG_DISCONTIGMEM_MANUAL is not set
245# CONFIG_SPARSEMEM_MANUAL is not set 293# CONFIG_SPARSEMEM_MANUAL is not set
246CONFIG_FLATMEM=y 294CONFIG_FLATMEM=y
247CONFIG_FLAT_NODE_MEM_MAP=y 295CONFIG_FLAT_NODE_MEM_MAP=y
248# CONFIG_SPARSEMEM_STATIC is not set
249# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
250CONFIG_PAGEFLAGS_EXTENDED=y 296CONFIG_PAGEFLAGS_EXTENDED=y
251CONFIG_SPLIT_PTLOCK_CPUS=4096 297CONFIG_SPLIT_PTLOCK_CPUS=4096
252# CONFIG_RESOURCES_64BIT is not set 298# CONFIG_PHYS_ADDR_T_64BIT is not set
253CONFIG_ZONE_DMA_FLAG=1 299CONFIG_ZONE_DMA_FLAG=0
254CONFIG_BOUNCE=y
255CONFIG_VIRT_TO_BUS=y 300CONFIG_VIRT_TO_BUS=y
301CONFIG_HAVE_MLOCK=y
302CONFIG_HAVE_MLOCKED_PAGE_BIT=y
303# CONFIG_KSM is not set
304CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
256CONFIG_ALIGNMENT_TRAP=y 305CONFIG_ALIGNMENT_TRAP=y
306# CONFIG_UACCESS_WITH_MEMCPY is not set
257 307
258# 308#
259# Boot options 309# Boot options
260# 310#
261CONFIG_ZBOOT_ROM_TEXT=0x0 311CONFIG_ZBOOT_ROM_TEXT=0x0
262CONFIG_ZBOOT_ROM_BSS=0x0 312CONFIG_ZBOOT_ROM_BSS=0x0
263CONFIG_CMDLINE="console=tty1 root=/dev/mmcblk0p2 rootfstype=ext2 rootdelay=1 ip=192.168.0.202:192.168.0.200:192.168.0.200:255.255.255.0 debug" 313CONFIG_CMDLINE="console=tty1 root=/dev/mmcblk0p2 rootfstype=ext2 rootdelay=3 ip=192.168.0.202:192.168.0.200:192.168.0.200:255.255.255.0 debug"
264# CONFIG_XIP_KERNEL is not set 314# CONFIG_XIP_KERNEL is not set
265CONFIG_KEXEC=y 315CONFIG_KEXEC=y
266CONFIG_ATAGS_PROC=y 316CONFIG_ATAGS_PROC=y
267 317
268# 318#
269# CPU Frequency scaling 319# CPU Power Management
270# 320#
271# CONFIG_CPU_FREQ is not set 321CONFIG_CPU_FREQ=y
322CONFIG_CPU_FREQ_TABLE=y
323CONFIG_CPU_FREQ_DEBUG=y
324CONFIG_CPU_FREQ_STAT=y
325# CONFIG_CPU_FREQ_STAT_DETAILS is not set
326CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
327# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
328# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
329# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
330# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
331CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
332CONFIG_CPU_FREQ_GOV_POWERSAVE=m
333CONFIG_CPU_FREQ_GOV_USERSPACE=m
334CONFIG_CPU_FREQ_GOV_ONDEMAND=m
335CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m
336CONFIG_CPU_IDLE=y
337CONFIG_CPU_IDLE_GOV_LADDER=y
338CONFIG_CPU_IDLE_GOV_MENU=y
272 339
273# 340#
274# Floating point emulation 341# Floating point emulation
@@ -285,6 +352,8 @@ CONFIG_FPE_NWFPE=y
285# Userspace binary formats 352# Userspace binary formats
286# 353#
287CONFIG_BINFMT_ELF=y 354CONFIG_BINFMT_ELF=y
355# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
356CONFIG_HAVE_AOUT=y
288CONFIG_BINFMT_AOUT=m 357CONFIG_BINFMT_AOUT=m
289CONFIG_BINFMT_MISC=m 358CONFIG_BINFMT_MISC=m
290 359
@@ -297,11 +366,8 @@ CONFIG_PM_SLEEP=y
297CONFIG_SUSPEND=y 366CONFIG_SUSPEND=y
298CONFIG_SUSPEND_FREEZER=y 367CONFIG_SUSPEND_FREEZER=y
299CONFIG_APM_EMULATION=y 368CONFIG_APM_EMULATION=y
369CONFIG_PM_RUNTIME=y
300CONFIG_ARCH_SUSPEND_POSSIBLE=y 370CONFIG_ARCH_SUSPEND_POSSIBLE=y
301
302#
303# Networking
304#
305CONFIG_NET=y 371CONFIG_NET=y
306 372
307# 373#
@@ -315,6 +381,7 @@ CONFIG_XFRM=y
315# CONFIG_XFRM_SUB_POLICY is not set 381# CONFIG_XFRM_SUB_POLICY is not set
316# CONFIG_XFRM_MIGRATE is not set 382# CONFIG_XFRM_MIGRATE is not set
317# CONFIG_XFRM_STATISTICS is not set 383# CONFIG_XFRM_STATISTICS is not set
384CONFIG_XFRM_IPCOMP=m
318# CONFIG_NET_KEY is not set 385# CONFIG_NET_KEY is not set
319CONFIG_INET=y 386CONFIG_INET=y
320# CONFIG_IP_MULTICAST is not set 387# CONFIG_IP_MULTICAST is not set
@@ -342,7 +409,6 @@ CONFIG_INET_TUNNEL=m
342CONFIG_TCP_CONG_CUBIC=y 409CONFIG_TCP_CONG_CUBIC=y
343CONFIG_DEFAULT_TCP_CONG="cubic" 410CONFIG_DEFAULT_TCP_CONG="cubic"
344# CONFIG_TCP_MD5SIG is not set 411# CONFIG_TCP_MD5SIG is not set
345# CONFIG_IP_VS is not set
346CONFIG_IPV6=m 412CONFIG_IPV6=m
347# CONFIG_IPV6_PRIVACY is not set 413# CONFIG_IPV6_PRIVACY is not set
348# CONFIG_IPV6_ROUTER_PREF is not set 414# CONFIG_IPV6_ROUTER_PREF is not set
@@ -393,18 +459,22 @@ CONFIG_NF_CONNTRACK_SANE=m
393CONFIG_NF_CONNTRACK_SIP=m 459CONFIG_NF_CONNTRACK_SIP=m
394CONFIG_NF_CONNTRACK_TFTP=m 460CONFIG_NF_CONNTRACK_TFTP=m
395CONFIG_NF_CT_NETLINK=m 461CONFIG_NF_CT_NETLINK=m
462# CONFIG_NETFILTER_TPROXY is not set
396CONFIG_NETFILTER_XTABLES=m 463CONFIG_NETFILTER_XTABLES=m
397CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m 464CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
398# CONFIG_NETFILTER_XT_TARGET_CONNMARK is not set 465# CONFIG_NETFILTER_XT_TARGET_CONNMARK is not set
399# CONFIG_NETFILTER_XT_TARGET_DSCP is not set 466# CONFIG_NETFILTER_XT_TARGET_DSCP is not set
467CONFIG_NETFILTER_XT_TARGET_HL=m
468CONFIG_NETFILTER_XT_TARGET_LED=m
400CONFIG_NETFILTER_XT_TARGET_MARK=m 469CONFIG_NETFILTER_XT_TARGET_MARK=m
401CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
402CONFIG_NETFILTER_XT_TARGET_NFLOG=m 470CONFIG_NETFILTER_XT_TARGET_NFLOG=m
471CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
403# CONFIG_NETFILTER_XT_TARGET_NOTRACK is not set 472# CONFIG_NETFILTER_XT_TARGET_NOTRACK is not set
404# CONFIG_NETFILTER_XT_TARGET_RATEEST is not set 473# CONFIG_NETFILTER_XT_TARGET_RATEEST is not set
405# CONFIG_NETFILTER_XT_TARGET_TRACE is not set 474# CONFIG_NETFILTER_XT_TARGET_TRACE is not set
406CONFIG_NETFILTER_XT_TARGET_TCPMSS=m 475CONFIG_NETFILTER_XT_TARGET_TCPMSS=m
407# CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP is not set 476# CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP is not set
477# CONFIG_NETFILTER_XT_MATCH_CLUSTER is not set
408CONFIG_NETFILTER_XT_MATCH_COMMENT=m 478CONFIG_NETFILTER_XT_MATCH_COMMENT=m
409CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m 479CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
410CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m 480CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m
@@ -413,20 +483,23 @@ CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
413CONFIG_NETFILTER_XT_MATCH_DCCP=m 483CONFIG_NETFILTER_XT_MATCH_DCCP=m
414CONFIG_NETFILTER_XT_MATCH_DSCP=m 484CONFIG_NETFILTER_XT_MATCH_DSCP=m
415CONFIG_NETFILTER_XT_MATCH_ESP=m 485CONFIG_NETFILTER_XT_MATCH_ESP=m
486CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
416CONFIG_NETFILTER_XT_MATCH_HELPER=m 487CONFIG_NETFILTER_XT_MATCH_HELPER=m
488CONFIG_NETFILTER_XT_MATCH_HL=m
417# CONFIG_NETFILTER_XT_MATCH_IPRANGE is not set 489# CONFIG_NETFILTER_XT_MATCH_IPRANGE is not set
418CONFIG_NETFILTER_XT_MATCH_LENGTH=m 490CONFIG_NETFILTER_XT_MATCH_LENGTH=m
419CONFIG_NETFILTER_XT_MATCH_LIMIT=m 491CONFIG_NETFILTER_XT_MATCH_LIMIT=m
420CONFIG_NETFILTER_XT_MATCH_MAC=m 492CONFIG_NETFILTER_XT_MATCH_MAC=m
421CONFIG_NETFILTER_XT_MATCH_MARK=m 493CONFIG_NETFILTER_XT_MATCH_MARK=m
494CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
422# CONFIG_NETFILTER_XT_MATCH_OWNER is not set 495# CONFIG_NETFILTER_XT_MATCH_OWNER is not set
423CONFIG_NETFILTER_XT_MATCH_POLICY=m 496CONFIG_NETFILTER_XT_MATCH_POLICY=m
424CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
425# CONFIG_NETFILTER_XT_MATCH_PHYSDEV is not set 497# CONFIG_NETFILTER_XT_MATCH_PHYSDEV is not set
426CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m 498CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
427CONFIG_NETFILTER_XT_MATCH_QUOTA=m 499CONFIG_NETFILTER_XT_MATCH_QUOTA=m
428# CONFIG_NETFILTER_XT_MATCH_RATEEST is not set 500# CONFIG_NETFILTER_XT_MATCH_RATEEST is not set
429CONFIG_NETFILTER_XT_MATCH_REALM=m 501CONFIG_NETFILTER_XT_MATCH_REALM=m
502# CONFIG_NETFILTER_XT_MATCH_RECENT is not set
430CONFIG_NETFILTER_XT_MATCH_SCTP=m 503CONFIG_NETFILTER_XT_MATCH_SCTP=m
431CONFIG_NETFILTER_XT_MATCH_STATE=m 504CONFIG_NETFILTER_XT_MATCH_STATE=m
432CONFIG_NETFILTER_XT_MATCH_STATISTIC=m 505CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
@@ -434,20 +507,21 @@ CONFIG_NETFILTER_XT_MATCH_STRING=m
434CONFIG_NETFILTER_XT_MATCH_TCPMSS=m 507CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
435CONFIG_NETFILTER_XT_MATCH_TIME=m 508CONFIG_NETFILTER_XT_MATCH_TIME=m
436CONFIG_NETFILTER_XT_MATCH_U32=m 509CONFIG_NETFILTER_XT_MATCH_U32=m
437CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m 510# CONFIG_NETFILTER_XT_MATCH_OSF is not set
511# CONFIG_IP_VS is not set
438 512
439# 513#
440# IP: Netfilter Configuration 514# IP: Netfilter Configuration
441# 515#
516CONFIG_NF_DEFRAG_IPV4=m
442CONFIG_NF_CONNTRACK_IPV4=m 517CONFIG_NF_CONNTRACK_IPV4=m
443CONFIG_NF_CONNTRACK_PROC_COMPAT=y 518CONFIG_NF_CONNTRACK_PROC_COMPAT=y
444CONFIG_IP_NF_QUEUE=m 519CONFIG_IP_NF_QUEUE=m
445CONFIG_IP_NF_IPTABLES=m 520CONFIG_IP_NF_IPTABLES=m
446CONFIG_IP_NF_MATCH_RECENT=m 521CONFIG_IP_NF_MATCH_ADDRTYPE=m
447CONFIG_IP_NF_MATCH_ECN=m
448CONFIG_IP_NF_MATCH_AH=m 522CONFIG_IP_NF_MATCH_AH=m
523CONFIG_IP_NF_MATCH_ECN=m
449CONFIG_IP_NF_MATCH_TTL=m 524CONFIG_IP_NF_MATCH_TTL=m
450CONFIG_IP_NF_MATCH_ADDRTYPE=m
451CONFIG_IP_NF_FILTER=m 525CONFIG_IP_NF_FILTER=m
452CONFIG_IP_NF_TARGET_REJECT=m 526CONFIG_IP_NF_TARGET_REJECT=m
453CONFIG_IP_NF_TARGET_LOG=m 527CONFIG_IP_NF_TARGET_LOG=m
@@ -455,8 +529,8 @@ CONFIG_IP_NF_TARGET_ULOG=m
455CONFIG_NF_NAT=m 529CONFIG_NF_NAT=m
456CONFIG_NF_NAT_NEEDED=y 530CONFIG_NF_NAT_NEEDED=y
457CONFIG_IP_NF_TARGET_MASQUERADE=m 531CONFIG_IP_NF_TARGET_MASQUERADE=m
458CONFIG_IP_NF_TARGET_REDIRECT=m
459CONFIG_IP_NF_TARGET_NETMAP=m 532CONFIG_IP_NF_TARGET_NETMAP=m
533CONFIG_IP_NF_TARGET_REDIRECT=m
460CONFIG_NF_NAT_SNMP_BASIC=m 534CONFIG_NF_NAT_SNMP_BASIC=m
461CONFIG_NF_NAT_PROTO_GRE=m 535CONFIG_NF_NAT_PROTO_GRE=m
462CONFIG_NF_NAT_PROTO_UDPLITE=m 536CONFIG_NF_NAT_PROTO_UDPLITE=m
@@ -469,9 +543,9 @@ CONFIG_NF_NAT_PPTP=m
469CONFIG_NF_NAT_H323=m 543CONFIG_NF_NAT_H323=m
470CONFIG_NF_NAT_SIP=m 544CONFIG_NF_NAT_SIP=m
471CONFIG_IP_NF_MANGLE=m 545CONFIG_IP_NF_MANGLE=m
546CONFIG_IP_NF_TARGET_CLUSTERIP=m
472CONFIG_IP_NF_TARGET_ECN=m 547CONFIG_IP_NF_TARGET_ECN=m
473CONFIG_IP_NF_TARGET_TTL=m 548CONFIG_IP_NF_TARGET_TTL=m
474CONFIG_IP_NF_TARGET_CLUSTERIP=m
475CONFIG_IP_NF_RAW=m 549CONFIG_IP_NF_RAW=m
476CONFIG_IP_NF_ARPTABLES=m 550CONFIG_IP_NF_ARPTABLES=m
477CONFIG_IP_NF_ARPFILTER=m 551CONFIG_IP_NF_ARPFILTER=m
@@ -483,30 +557,29 @@ CONFIG_IP_NF_ARP_MANGLE=m
483CONFIG_NF_CONNTRACK_IPV6=m 557CONFIG_NF_CONNTRACK_IPV6=m
484CONFIG_IP6_NF_QUEUE=m 558CONFIG_IP6_NF_QUEUE=m
485CONFIG_IP6_NF_IPTABLES=m 559CONFIG_IP6_NF_IPTABLES=m
486CONFIG_IP6_NF_MATCH_RT=m 560CONFIG_IP6_NF_MATCH_AH=m
487CONFIG_IP6_NF_MATCH_OPTS=m 561CONFIG_IP6_NF_MATCH_EUI64=m
488CONFIG_IP6_NF_MATCH_FRAG=m 562CONFIG_IP6_NF_MATCH_FRAG=m
563CONFIG_IP6_NF_MATCH_OPTS=m
489CONFIG_IP6_NF_MATCH_HL=m 564CONFIG_IP6_NF_MATCH_HL=m
490CONFIG_IP6_NF_MATCH_IPV6HEADER=m 565CONFIG_IP6_NF_MATCH_IPV6HEADER=m
491CONFIG_IP6_NF_MATCH_AH=m
492CONFIG_IP6_NF_MATCH_MH=m 566CONFIG_IP6_NF_MATCH_MH=m
493CONFIG_IP6_NF_MATCH_EUI64=m 567CONFIG_IP6_NF_MATCH_RT=m
494CONFIG_IP6_NF_FILTER=m 568CONFIG_IP6_NF_TARGET_HL=m
495CONFIG_IP6_NF_TARGET_LOG=m 569CONFIG_IP6_NF_TARGET_LOG=m
570CONFIG_IP6_NF_FILTER=m
496CONFIG_IP6_NF_TARGET_REJECT=m 571CONFIG_IP6_NF_TARGET_REJECT=m
497CONFIG_IP6_NF_MANGLE=m 572CONFIG_IP6_NF_MANGLE=m
498CONFIG_IP6_NF_TARGET_HL=m
499CONFIG_IP6_NF_RAW=m 573CONFIG_IP6_NF_RAW=m
500
501#
502# Bridge: Netfilter Configuration
503#
504# CONFIG_BRIDGE_NF_EBTABLES is not set 574# CONFIG_BRIDGE_NF_EBTABLES is not set
505# CONFIG_IP_DCCP is not set 575# CONFIG_IP_DCCP is not set
506# CONFIG_IP_SCTP is not set 576# CONFIG_IP_SCTP is not set
577# CONFIG_RDS is not set
507# CONFIG_TIPC is not set 578# CONFIG_TIPC is not set
508# CONFIG_ATM is not set 579# CONFIG_ATM is not set
580CONFIG_STP=m
509CONFIG_BRIDGE=m 581CONFIG_BRIDGE=m
582# CONFIG_NET_DSA is not set
510# CONFIG_VLAN_8021Q is not set 583# CONFIG_VLAN_8021Q is not set
511# CONFIG_DECNET is not set 584# CONFIG_DECNET is not set
512CONFIG_LLC=m 585CONFIG_LLC=m
@@ -517,9 +590,11 @@ CONFIG_LLC=m
517# CONFIG_LAPB is not set 590# CONFIG_LAPB is not set
518# CONFIG_ECONET is not set 591# CONFIG_ECONET is not set
519# CONFIG_WAN_ROUTER is not set 592# CONFIG_WAN_ROUTER is not set
593# CONFIG_PHONET is not set
594# CONFIG_IEEE802154 is not set
520# CONFIG_NET_SCHED is not set 595# CONFIG_NET_SCHED is not set
521CONFIG_NET_CLS_ROUTE=y 596CONFIG_NET_CLS_ROUTE=y
522CONFIG_NET_SCH_FIFO=y 597# CONFIG_DCB is not set
523 598
524# 599#
525# Network testing 600# Network testing
@@ -529,64 +604,34 @@ CONFIG_NET_SCH_FIFO=y
529# CONFIG_CAN is not set 604# CONFIG_CAN is not set
530# CONFIG_IRDA is not set 605# CONFIG_IRDA is not set
531CONFIG_BT=y 606CONFIG_BT=y
532CONFIG_BT_L2CAP=m 607CONFIG_BT_L2CAP=y
533CONFIG_BT_SCO=y 608CONFIG_BT_SCO=y
534CONFIG_BT_RFCOMM=m 609CONFIG_BT_RFCOMM=y
535CONFIG_BT_RFCOMM_TTY=y 610CONFIG_BT_RFCOMM_TTY=y
536CONFIG_BT_BNEP=m 611CONFIG_BT_BNEP=y
537CONFIG_BT_BNEP_MC_FILTER=y 612CONFIG_BT_BNEP_MC_FILTER=y
538CONFIG_BT_BNEP_PROTO_FILTER=y 613CONFIG_BT_BNEP_PROTO_FILTER=y
539CONFIG_BT_HIDP=m 614CONFIG_BT_HIDP=y
540 615
541# 616#
542# Bluetooth device drivers 617# Bluetooth device drivers
543# 618#
544# CONFIG_BT_HCIUSB is not set 619CONFIG_BT_HCIBTUSB=m
545# CONFIG_BT_HCIBTUSB is not set 620CONFIG_BT_HCIBTSDIO=m
546# CONFIG_BT_HCIBTSDIO is not set
547CONFIG_BT_HCIUART=y 621CONFIG_BT_HCIUART=y
548CONFIG_BT_HCIUART_H4=y 622CONFIG_BT_HCIUART_H4=y
549# CONFIG_BT_HCIUART_BCSP is not set 623# CONFIG_BT_HCIUART_BCSP is not set
550# CONFIG_BT_HCIUART_LL is not set 624# CONFIG_BT_HCIUART_LL is not set
551# CONFIG_BT_HCIBCM203X is not set 625CONFIG_BT_HCIBCM203X=m
552# CONFIG_BT_HCIBPA10X is not set 626CONFIG_BT_HCIBPA10X=m
553# CONFIG_BT_HCIBFUSB is not set 627CONFIG_BT_HCIBFUSB=m
554# CONFIG_BT_HCIVHCI is not set 628CONFIG_BT_HCIVHCI=m
629CONFIG_BT_MRVL=m
630CONFIG_BT_MRVL_SDIO=m
555# CONFIG_AF_RXRPC is not set 631# CONFIG_AF_RXRPC is not set
556CONFIG_FIB_RULES=y 632CONFIG_FIB_RULES=y
557 633# CONFIG_WIRELESS is not set
558# 634# CONFIG_WIMAX is not set
559# Wireless
560#
561CONFIG_CFG80211=m
562CONFIG_NL80211=y
563CONFIG_WIRELESS_EXT=y
564CONFIG_MAC80211=m
565
566#
567# Rate control algorithm selection
568#
569CONFIG_MAC80211_RC_DEFAULT_PID=y
570# CONFIG_MAC80211_RC_DEFAULT_NONE is not set
571
572#
573# Selecting 'y' for an algorithm will
574#
575
576#
577# build the algorithm into mac80211.
578#
579CONFIG_MAC80211_RC_DEFAULT="pid"
580CONFIG_MAC80211_RC_PID=y
581# CONFIG_MAC80211_MESH is not set
582CONFIG_MAC80211_LEDS=y
583# CONFIG_MAC80211_DEBUG_PACKET_ALIGNMENT is not set
584# CONFIG_MAC80211_DEBUG is not set
585CONFIG_IEEE80211=m
586# CONFIG_IEEE80211_DEBUG is not set
587CONFIG_IEEE80211_CRYPT_WEP=m
588CONFIG_IEEE80211_CRYPT_CCMP=m
589CONFIG_IEEE80211_CRYPT_TKIP=m
590# CONFIG_RFKILL is not set 635# CONFIG_RFKILL is not set
591# CONFIG_NET_9P is not set 636# CONFIG_NET_9P is not set
592 637
@@ -598,13 +643,19 @@ CONFIG_IEEE80211_CRYPT_TKIP=m
598# Generic Driver Options 643# Generic Driver Options
599# 644#
600CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 645CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
646# CONFIG_DEVTMPFS is not set
601CONFIG_STANDALONE=y 647CONFIG_STANDALONE=y
602CONFIG_PREVENT_FIRMWARE_BUILD=y 648CONFIG_PREVENT_FIRMWARE_BUILD=y
603CONFIG_FW_LOADER=m 649CONFIG_FW_LOADER=m
650CONFIG_FIRMWARE_IN_KERNEL=y
651CONFIG_EXTRA_FIRMWARE=""
652# CONFIG_DEBUG_DRIVER is not set
653# CONFIG_DEBUG_DEVRES is not set
604# CONFIG_SYS_HYPERVISOR is not set 654# CONFIG_SYS_HYPERVISOR is not set
605CONFIG_CONNECTOR=m 655CONFIG_CONNECTOR=m
606CONFIG_MTD=y 656CONFIG_MTD=y
607# CONFIG_MTD_DEBUG is not set 657# CONFIG_MTD_DEBUG is not set
658# CONFIG_MTD_TESTS is not set
608# CONFIG_MTD_CONCAT is not set 659# CONFIG_MTD_CONCAT is not set
609CONFIG_MTD_PARTITIONS=y 660CONFIG_MTD_PARTITIONS=y
610# CONFIG_MTD_REDBOOT_PARTS is not set 661# CONFIG_MTD_REDBOOT_PARTS is not set
@@ -616,9 +667,9 @@ CONFIG_MTD_PARTITIONS=y
616# User Modules And Translation Layers 667# User Modules And Translation Layers
617# 668#
618CONFIG_MTD_CHAR=y 669CONFIG_MTD_CHAR=y
619# CONFIG_MTD_BLKDEVS is not set 670CONFIG_HAVE_MTD_OTP=y
620# CONFIG_MTD_BLOCK is not set 671CONFIG_MTD_BLKDEVS=y
621# CONFIG_MTD_BLOCK_RO is not set 672CONFIG_MTD_BLOCK=y
622# CONFIG_FTL is not set 673# CONFIG_FTL is not set
623# CONFIG_NFTL is not set 674# CONFIG_NFTL is not set
624# CONFIG_INFTL is not set 675# CONFIG_INFTL is not set
@@ -647,7 +698,7 @@ CONFIG_MTD_CFI_I1=y
647# CONFIG_MTD_CFI_I2 is not set 698# CONFIG_MTD_CFI_I2 is not set
648# CONFIG_MTD_CFI_I4 is not set 699# CONFIG_MTD_CFI_I4 is not set
649# CONFIG_MTD_CFI_I8 is not set 700# CONFIG_MTD_CFI_I8 is not set
650# CONFIG_MTD_OTP is not set 701CONFIG_MTD_OTP=y
651CONFIG_MTD_CFI_INTELEXT=y 702CONFIG_MTD_CFI_INTELEXT=y
652# CONFIG_MTD_CFI_AMDSTD is not set 703# CONFIG_MTD_CFI_AMDSTD is not set
653# CONFIG_MTD_CFI_STAA is not set 704# CONFIG_MTD_CFI_STAA is not set
@@ -655,19 +706,15 @@ CONFIG_MTD_CFI_UTIL=y
655# CONFIG_MTD_RAM is not set 706# CONFIG_MTD_RAM is not set
656# CONFIG_MTD_ROM is not set 707# CONFIG_MTD_ROM is not set
657# CONFIG_MTD_ABSENT is not set 708# CONFIG_MTD_ABSENT is not set
658CONFIG_MTD_XIP=y 709# CONFIG_MTD_XIP is not set
659 710
660# 711#
661# Mapping drivers for chip access 712# Mapping drivers for chip access
662# 713#
663# CONFIG_MTD_COMPLEX_MAPPINGS is not set 714# CONFIG_MTD_COMPLEX_MAPPINGS is not set
664CONFIG_MTD_PHYSMAP=y 715# CONFIG_MTD_PHYSMAP is not set
665CONFIG_MTD_PHYSMAP_START=0x0 716CONFIG_MTD_PXA2XX=y
666CONFIG_MTD_PHYSMAP_LEN=0x0
667CONFIG_MTD_PHYSMAP_BANKWIDTH=2
668# CONFIG_MTD_PXA2XX is not set
669# CONFIG_MTD_ARM_INTEGRATOR is not set 717# CONFIG_MTD_ARM_INTEGRATOR is not set
670# CONFIG_MTD_SHARP_SL is not set
671# CONFIG_MTD_PLATRAM is not set 718# CONFIG_MTD_PLATRAM is not set
672 719
673# 720#
@@ -675,6 +722,7 @@ CONFIG_MTD_PHYSMAP_BANKWIDTH=2
675# 722#
676# CONFIG_MTD_DATAFLASH is not set 723# CONFIG_MTD_DATAFLASH is not set
677# CONFIG_MTD_M25P80 is not set 724# CONFIG_MTD_M25P80 is not set
725# CONFIG_MTD_SST25L is not set
678# CONFIG_MTD_SLRAM is not set 726# CONFIG_MTD_SLRAM is not set
679# CONFIG_MTD_PHRAM is not set 727# CONFIG_MTD_PHRAM is not set
680# CONFIG_MTD_MTDRAM is not set 728# CONFIG_MTD_MTDRAM is not set
@@ -690,6 +738,11 @@ CONFIG_MTD_PHYSMAP_BANKWIDTH=2
690# CONFIG_MTD_ONENAND is not set 738# CONFIG_MTD_ONENAND is not set
691 739
692# 740#
741# LPDDR flash memory drivers
742#
743# CONFIG_MTD_LPDDR is not set
744
745#
693# UBI - Unsorted block images 746# UBI - Unsorted block images
694# 747#
695# CONFIG_MTD_UBI is not set 748# CONFIG_MTD_UBI is not set
@@ -700,15 +753,14 @@ CONFIG_BLK_DEV_LOOP=m
700CONFIG_BLK_DEV_CRYPTOLOOP=m 753CONFIG_BLK_DEV_CRYPTOLOOP=m
701CONFIG_BLK_DEV_NBD=m 754CONFIG_BLK_DEV_NBD=m
702# CONFIG_BLK_DEV_UB is not set 755# CONFIG_BLK_DEV_UB is not set
703CONFIG_BLK_DEV_RAM=m 756CONFIG_BLK_DEV_RAM=y
704CONFIG_BLK_DEV_RAM_COUNT=16 757CONFIG_BLK_DEV_RAM_COUNT=16
705CONFIG_BLK_DEV_RAM_SIZE=4096 758CONFIG_BLK_DEV_RAM_SIZE=4096
706# CONFIG_BLK_DEV_XIP is not set 759# CONFIG_BLK_DEV_XIP is not set
707# CONFIG_CDROM_PKTCDVD is not set 760# CONFIG_CDROM_PKTCDVD is not set
708# CONFIG_ATA_OVER_ETH is not set 761# CONFIG_ATA_OVER_ETH is not set
709CONFIG_MISC_DEVICES=y 762# CONFIG_MG_DISK is not set
710# CONFIG_EEPROM_93CX6 is not set 763# CONFIG_MISC_DEVICES is not set
711# CONFIG_ENCLOSURE_SERVICES is not set
712CONFIG_HAVE_IDE=y 764CONFIG_HAVE_IDE=y
713# CONFIG_IDE is not set 765# CONFIG_IDE is not set
714 766
@@ -722,7 +774,6 @@ CONFIG_HAVE_IDE=y
722# CONFIG_ATA is not set 774# CONFIG_ATA is not set
723# CONFIG_MD is not set 775# CONFIG_MD is not set
724CONFIG_NETDEVICES=y 776CONFIG_NETDEVICES=y
725# CONFIG_NETDEVICES_MULTIQUEUE is not set
726CONFIG_DUMMY=y 777CONFIG_DUMMY=y
727# CONFIG_BONDING is not set 778# CONFIG_BONDING is not set
728# CONFIG_MACVLAN is not set 779# CONFIG_MACVLAN is not set
@@ -732,13 +783,11 @@ CONFIG_DUMMY=y
732# CONFIG_NET_ETHERNET is not set 783# CONFIG_NET_ETHERNET is not set
733# CONFIG_NETDEV_1000 is not set 784# CONFIG_NETDEV_1000 is not set
734# CONFIG_NETDEV_10000 is not set 785# CONFIG_NETDEV_10000 is not set
786# CONFIG_WLAN is not set
735 787
736# 788#
737# Wireless LAN 789# Enable WiMAX (Networking options) to see the WiMAX drivers
738# 790#
739# CONFIG_WLAN_PRE80211 is not set
740# CONFIG_WLAN_80211 is not set
741# CONFIG_IWLWIFI_LEDS is not set
742 791
743# 792#
744# USB Network Adapters 793# USB Network Adapters
@@ -765,6 +814,7 @@ CONFIG_SLHC=m
765# CONFIG_NETPOLL is not set 814# CONFIG_NETPOLL is not set
766# CONFIG_NET_POLL_CONTROLLER is not set 815# CONFIG_NET_POLL_CONTROLLER is not set
767# CONFIG_ISDN is not set 816# CONFIG_ISDN is not set
817# CONFIG_PHONE is not set
768 818
769# 819#
770# Input device support 820# Input device support
@@ -786,29 +836,45 @@ CONFIG_INPUT_EVDEV=y
786# Input Device Drivers 836# Input Device Drivers
787# 837#
788CONFIG_INPUT_KEYBOARD=y 838CONFIG_INPUT_KEYBOARD=y
839# CONFIG_KEYBOARD_ADP5588 is not set
789# CONFIG_KEYBOARD_ATKBD is not set 840# CONFIG_KEYBOARD_ATKBD is not set
790# CONFIG_KEYBOARD_SUNKBD is not set 841# CONFIG_QT2160 is not set
791# CONFIG_KEYBOARD_LKKBD is not set 842# CONFIG_KEYBOARD_LKKBD is not set
792# CONFIG_KEYBOARD_XTKBD is not set 843CONFIG_KEYBOARD_GPIO=y
844# CONFIG_KEYBOARD_MATRIX is not set
845# CONFIG_KEYBOARD_LM8323 is not set
846# CONFIG_KEYBOARD_MAX7359 is not set
793# CONFIG_KEYBOARD_NEWTON is not set 847# CONFIG_KEYBOARD_NEWTON is not set
794# CONFIG_KEYBOARD_STOWAWAY is not set 848# CONFIG_KEYBOARD_OPENCORES is not set
795CONFIG_KEYBOARD_PXA27x=y 849CONFIG_KEYBOARD_PXA27x=y
796CONFIG_KEYBOARD_GPIO=y 850# CONFIG_KEYBOARD_STOWAWAY is not set
851# CONFIG_KEYBOARD_SUNKBD is not set
852# CONFIG_KEYBOARD_XTKBD is not set
797# CONFIG_INPUT_MOUSE is not set 853# CONFIG_INPUT_MOUSE is not set
798# CONFIG_INPUT_JOYSTICK is not set 854# CONFIG_INPUT_JOYSTICK is not set
799# CONFIG_INPUT_TABLET is not set 855# CONFIG_INPUT_TABLET is not set
800CONFIG_INPUT_TOUCHSCREEN=y 856CONFIG_INPUT_TOUCHSCREEN=y
801# CONFIG_TOUCHSCREEN_ADS7846 is not set 857# CONFIG_TOUCHSCREEN_ADS7846 is not set
858# CONFIG_TOUCHSCREEN_AD7877 is not set
859# CONFIG_TOUCHSCREEN_AD7879_I2C is not set
860# CONFIG_TOUCHSCREEN_AD7879_SPI is not set
861# CONFIG_TOUCHSCREEN_AD7879 is not set
862# CONFIG_TOUCHSCREEN_EETI is not set
802# CONFIG_TOUCHSCREEN_FUJITSU is not set 863# CONFIG_TOUCHSCREEN_FUJITSU is not set
803# CONFIG_TOUCHSCREEN_GUNZE is not set 864# CONFIG_TOUCHSCREEN_GUNZE is not set
804# CONFIG_TOUCHSCREEN_ELO is not set 865# CONFIG_TOUCHSCREEN_ELO is not set
866# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
867# CONFIG_TOUCHSCREEN_MCS5000 is not set
805# CONFIG_TOUCHSCREEN_MTOUCH is not set 868# CONFIG_TOUCHSCREEN_MTOUCH is not set
869# CONFIG_TOUCHSCREEN_INEXIO is not set
806# CONFIG_TOUCHSCREEN_MK712 is not set 870# CONFIG_TOUCHSCREEN_MK712 is not set
807# CONFIG_TOUCHSCREEN_PENMOUNT is not set 871# CONFIG_TOUCHSCREEN_PENMOUNT is not set
808# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set 872# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
809# CONFIG_TOUCHSCREEN_TOUCHWIN is not set 873# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
810# CONFIG_TOUCHSCREEN_UCB1400 is not set
811# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set 874# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
875# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
876# CONFIG_TOUCHSCREEN_TSC2007 is not set
877# CONFIG_TOUCHSCREEN_W90X900 is not set
812CONFIG_TOUCHSCREEN_PCAP=y 878CONFIG_TOUCHSCREEN_PCAP=y
813CONFIG_INPUT_MISC=y 879CONFIG_INPUT_MISC=y
814# CONFIG_INPUT_ATI_REMOTE is not set 880# CONFIG_INPUT_ATI_REMOTE is not set
@@ -816,7 +882,10 @@ CONFIG_INPUT_MISC=y
816# CONFIG_INPUT_KEYSPAN_REMOTE is not set 882# CONFIG_INPUT_KEYSPAN_REMOTE is not set
817# CONFIG_INPUT_POWERMATE is not set 883# CONFIG_INPUT_POWERMATE is not set
818# CONFIG_INPUT_YEALINK is not set 884# CONFIG_INPUT_YEALINK is not set
885# CONFIG_INPUT_CM109 is not set
819CONFIG_INPUT_UINPUT=y 886CONFIG_INPUT_UINPUT=y
887# CONFIG_INPUT_GPIO_ROTARY_ENCODER is not set
888CONFIG_INPUT_PCAP=y
820 889
821# 890#
822# Hardware I/O ports 891# Hardware I/O ports
@@ -828,6 +897,7 @@ CONFIG_INPUT_UINPUT=y
828# Character devices 897# Character devices
829# 898#
830CONFIG_VT=y 899CONFIG_VT=y
900CONFIG_CONSOLE_TRANSLATIONS=y
831CONFIG_VT_CONSOLE=y 901CONFIG_VT_CONSOLE=y
832CONFIG_HW_CONSOLE=y 902CONFIG_HW_CONSOLE=y
833# CONFIG_VT_HW_CONSOLE_BINDING is not set 903# CONFIG_VT_HW_CONSOLE_BINDING is not set
@@ -842,92 +912,130 @@ CONFIG_DEVKMEM=y
842# 912#
843# Non-8250 serial port support 913# Non-8250 serial port support
844# 914#
915# CONFIG_SERIAL_MAX3100 is not set
845CONFIG_SERIAL_PXA=y 916CONFIG_SERIAL_PXA=y
846CONFIG_SERIAL_PXA_CONSOLE=y 917CONFIG_SERIAL_PXA_CONSOLE=y
847CONFIG_SERIAL_CORE=y 918CONFIG_SERIAL_CORE=y
848CONFIG_SERIAL_CORE_CONSOLE=y 919CONFIG_SERIAL_CORE_CONSOLE=y
849CONFIG_UNIX98_PTYS=y 920CONFIG_UNIX98_PTYS=y
921# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
850CONFIG_LEGACY_PTYS=y 922CONFIG_LEGACY_PTYS=y
851CONFIG_LEGACY_PTY_COUNT=8 923CONFIG_LEGACY_PTY_COUNT=8
852# CONFIG_IPMI_HANDLER is not set 924# CONFIG_IPMI_HANDLER is not set
853CONFIG_HW_RANDOM=y 925# CONFIG_HW_RANDOM is not set
854# CONFIG_NVRAM is not set
855# CONFIG_R3964 is not set 926# CONFIG_R3964 is not set
856# CONFIG_RAW_DRIVER is not set 927# CONFIG_RAW_DRIVER is not set
857# CONFIG_TCG_TPM is not set 928# CONFIG_TCG_TPM is not set
858CONFIG_I2C=y 929CONFIG_I2C=y
859CONFIG_I2C_BOARDINFO=y 930CONFIG_I2C_BOARDINFO=y
931CONFIG_I2C_COMPAT=y
860CONFIG_I2C_CHARDEV=y 932CONFIG_I2C_CHARDEV=y
933CONFIG_I2C_HELPER_AUTO=y
861 934
862# 935#
863# I2C Hardware Bus support 936# I2C Hardware Bus support
864# 937#
938
939#
940# I2C system bus drivers (mostly embedded / system-on-chip)
941#
942# CONFIG_I2C_DESIGNWARE is not set
865# CONFIG_I2C_GPIO is not set 943# CONFIG_I2C_GPIO is not set
944# CONFIG_I2C_OCORES is not set
866CONFIG_I2C_PXA=y 945CONFIG_I2C_PXA=y
867# CONFIG_I2C_PXA_SLAVE is not set 946# CONFIG_I2C_PXA_SLAVE is not set
868# CONFIG_I2C_OCORES is not set
869# CONFIG_I2C_PARPORT_LIGHT is not set
870# CONFIG_I2C_SIMTEC is not set 947# CONFIG_I2C_SIMTEC is not set
948
949#
950# External I2C/SMBus adapter drivers
951#
952# CONFIG_I2C_PARPORT_LIGHT is not set
871# CONFIG_I2C_TAOS_EVM is not set 953# CONFIG_I2C_TAOS_EVM is not set
872# CONFIG_I2C_STUB is not set
873# CONFIG_I2C_TINY_USB is not set 954# CONFIG_I2C_TINY_USB is not set
955
956#
957# Other I2C/SMBus bus drivers
958#
874# CONFIG_I2C_PCA_PLATFORM is not set 959# CONFIG_I2C_PCA_PLATFORM is not set
960# CONFIG_I2C_STUB is not set
875 961
876# 962#
877# Miscellaneous I2C Chip support 963# Miscellaneous I2C Chip support
878# 964#
879# CONFIG_DS1682 is not set 965# CONFIG_DS1682 is not set
880# CONFIG_EEPROM_LEGACY is not set
881# CONFIG_SENSORS_PCF8574 is not set
882# CONFIG_PCF8575 is not set
883# CONFIG_SENSORS_PCF8591 is not set
884# CONFIG_TPS65010 is not set
885# CONFIG_SENSORS_MAX6875 is not set
886# CONFIG_SENSORS_TSL2550 is not set 966# CONFIG_SENSORS_TSL2550 is not set
887# CONFIG_I2C_DEBUG_CORE is not set 967# CONFIG_I2C_DEBUG_CORE is not set
888# CONFIG_I2C_DEBUG_ALGO is not set 968# CONFIG_I2C_DEBUG_ALGO is not set
889# CONFIG_I2C_DEBUG_BUS is not set 969# CONFIG_I2C_DEBUG_BUS is not set
890# CONFIG_I2C_DEBUG_CHIP is not set 970# CONFIG_I2C_DEBUG_CHIP is not set
891CONFIG_SPI=y 971CONFIG_SPI=y
972# CONFIG_SPI_DEBUG is not set
892CONFIG_SPI_MASTER=y 973CONFIG_SPI_MASTER=y
893 974
894# 975#
895# SPI Master Controller Drivers 976# SPI Master Controller Drivers
896# 977#
897# CONFIG_SPI_BITBANG is not set 978# CONFIG_SPI_BITBANG is not set
898CONFIG_SPI_PXA2XX=m 979# CONFIG_SPI_GPIO is not set
980CONFIG_SPI_PXA2XX=y
899 981
900# 982#
901# SPI Protocol Masters 983# SPI Protocol Masters
902# 984#
903# CONFIG_EEPROM_AT25 is not set
904# CONFIG_SPI_SPIDEV is not set 985# CONFIG_SPI_SPIDEV is not set
905# CONFIG_SPI_TLE62X0 is not set 986# CONFIG_SPI_TLE62X0 is not set
906CONFIG_HAVE_GPIO_LIB=y
907 987
908# 988#
909# GPIO Support 989# PPS support
990#
991# CONFIG_PPS is not set
992CONFIG_ARCH_REQUIRE_GPIOLIB=y
993CONFIG_GPIOLIB=y
994# CONFIG_DEBUG_GPIO is not set
995CONFIG_GPIO_SYSFS=y
996
997#
998# Memory mapped GPIO expanders:
910# 999#
911 1000
912# 1001#
913# I2C GPIO expanders: 1002# I2C GPIO expanders:
914# 1003#
1004# CONFIG_GPIO_MAX732X is not set
915# CONFIG_GPIO_PCA953X is not set 1005# CONFIG_GPIO_PCA953X is not set
916# CONFIG_GPIO_PCF857X is not set 1006# CONFIG_GPIO_PCF857X is not set
917 1007
918# 1008#
1009# PCI GPIO expanders:
1010#
1011
1012#
919# SPI GPIO expanders: 1013# SPI GPIO expanders:
920# 1014#
1015# CONFIG_GPIO_MAX7301 is not set
921# CONFIG_GPIO_MCP23S08 is not set 1016# CONFIG_GPIO_MCP23S08 is not set
1017# CONFIG_GPIO_MC33880 is not set
1018
1019#
1020# AC97 GPIO expanders:
1021#
922# CONFIG_W1 is not set 1022# CONFIG_W1 is not set
923# CONFIG_POWER_SUPPLY is not set 1023CONFIG_POWER_SUPPLY=y
1024# CONFIG_POWER_SUPPLY_DEBUG is not set
1025# CONFIG_PDA_POWER is not set
1026# CONFIG_APM_POWER is not set
1027# CONFIG_BATTERY_DS2760 is not set
1028# CONFIG_BATTERY_DS2782 is not set
1029# CONFIG_BATTERY_BQ27x00 is not set
1030# CONFIG_BATTERY_MAX17040 is not set
924# CONFIG_HWMON is not set 1031# CONFIG_HWMON is not set
1032# CONFIG_THERMAL is not set
925# CONFIG_WATCHDOG is not set 1033# CONFIG_WATCHDOG is not set
1034CONFIG_SSB_POSSIBLE=y
926 1035
927# 1036#
928# Sonics Silicon Backplane 1037# Sonics Silicon Backplane
929# 1038#
930CONFIG_SSB_POSSIBLE=y
931# CONFIG_SSB is not set 1039# CONFIG_SSB is not set
932 1040
933# 1041#
@@ -938,54 +1046,170 @@ CONFIG_SSB_POSSIBLE=y
938# CONFIG_MFD_ASIC3 is not set 1046# CONFIG_MFD_ASIC3 is not set
939# CONFIG_HTC_EGPIO is not set 1047# CONFIG_HTC_EGPIO is not set
940# CONFIG_HTC_PASIC3 is not set 1048# CONFIG_HTC_PASIC3 is not set
1049# CONFIG_TPS65010 is not set
1050# CONFIG_TWL4030_CORE is not set
1051# CONFIG_MFD_TMIO is not set
1052# CONFIG_MFD_T7L66XB is not set
1053# CONFIG_MFD_TC6387XB is not set
941# CONFIG_MFD_TC6393XB is not set 1054# CONFIG_MFD_TC6393XB is not set
1055# CONFIG_PMIC_DA903X is not set
1056# CONFIG_MFD_WM8400 is not set
1057# CONFIG_MFD_WM831X is not set
1058# CONFIG_MFD_WM8350_I2C is not set
1059# CONFIG_MFD_PCF50633 is not set
1060# CONFIG_MFD_MC13783 is not set
1061# CONFIG_AB3100_CORE is not set
942CONFIG_EZX_PCAP=y 1062CONFIG_EZX_PCAP=y
943 1063CONFIG_REGULATOR=y
944# 1064CONFIG_REGULATOR_DEBUG=y
945# Multimedia devices 1065# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
946# 1066CONFIG_REGULATOR_VIRTUAL_CONSUMER=y
1067CONFIG_REGULATOR_USERSPACE_CONSUMER=y
1068# CONFIG_REGULATOR_BQ24022 is not set
1069# CONFIG_REGULATOR_MAX1586 is not set
1070# CONFIG_REGULATOR_LP3971 is not set
1071CONFIG_REGULATOR_PCAP=y
1072# CONFIG_REGULATOR_TPS65023 is not set
1073# CONFIG_REGULATOR_TPS6507X is not set
1074CONFIG_MEDIA_SUPPORT=y
947 1075
948# 1076#
949# Multimedia core support 1077# Multimedia core support
950# 1078#
951CONFIG_VIDEO_DEV=m 1079CONFIG_VIDEO_DEV=y
952CONFIG_VIDEO_V4L2_COMMON=m 1080CONFIG_VIDEO_V4L2_COMMON=y
953CONFIG_VIDEO_ALLOW_V4L1=y 1081CONFIG_VIDEO_ALLOW_V4L1=y
954CONFIG_VIDEO_V4L1_COMPAT=y 1082CONFIG_VIDEO_V4L1_COMPAT=y
955# CONFIG_DVB_CORE is not set 1083# CONFIG_DVB_CORE is not set
956CONFIG_VIDEO_MEDIA=m 1084CONFIG_VIDEO_MEDIA=y
957 1085
958# 1086#
959# Multimedia drivers 1087# Multimedia drivers
960# 1088#
961# CONFIG_MEDIA_ATTACH is not set 1089# CONFIG_MEDIA_ATTACH is not set
962CONFIG_MEDIA_TUNER=m 1090CONFIG_MEDIA_TUNER=y
963# CONFIG_MEDIA_TUNER_CUSTOMIZE is not set 1091CONFIG_MEDIA_TUNER_CUSTOMISE=y
964CONFIG_MEDIA_TUNER_SIMPLE=m 1092# CONFIG_MEDIA_TUNER_SIMPLE is not set
965CONFIG_MEDIA_TUNER_TDA8290=m 1093# CONFIG_MEDIA_TUNER_TDA8290 is not set
966CONFIG_MEDIA_TUNER_TDA9887=m 1094# CONFIG_MEDIA_TUNER_TDA827X is not set
967CONFIG_MEDIA_TUNER_TEA5761=m 1095# CONFIG_MEDIA_TUNER_TDA18271 is not set
968CONFIG_MEDIA_TUNER_TEA5767=m 1096# CONFIG_MEDIA_TUNER_TDA9887 is not set
969CONFIG_MEDIA_TUNER_MT20XX=m 1097# CONFIG_MEDIA_TUNER_TEA5761 is not set
970CONFIG_MEDIA_TUNER_XC2028=m 1098# CONFIG_MEDIA_TUNER_TEA5767 is not set
971CONFIG_MEDIA_TUNER_XC5000=m 1099# CONFIG_MEDIA_TUNER_MT20XX is not set
972CONFIG_VIDEO_V4L2=m 1100# CONFIG_MEDIA_TUNER_MT2060 is not set
973CONFIG_VIDEO_V4L1=m 1101# CONFIG_MEDIA_TUNER_MT2266 is not set
1102# CONFIG_MEDIA_TUNER_MT2131 is not set
1103# CONFIG_MEDIA_TUNER_QT1010 is not set
1104# CONFIG_MEDIA_TUNER_XC2028 is not set
1105# CONFIG_MEDIA_TUNER_XC5000 is not set
1106# CONFIG_MEDIA_TUNER_MXL5005S is not set
1107# CONFIG_MEDIA_TUNER_MXL5007T is not set
1108# CONFIG_MEDIA_TUNER_MC44S803 is not set
1109CONFIG_VIDEO_V4L2=y
1110CONFIG_VIDEO_V4L1=y
1111CONFIG_VIDEOBUF_GEN=y
1112CONFIG_VIDEOBUF_DMA_SG=y
974CONFIG_VIDEO_CAPTURE_DRIVERS=y 1113CONFIG_VIDEO_CAPTURE_DRIVERS=y
975# CONFIG_VIDEO_ADV_DEBUG is not set 1114# CONFIG_VIDEO_ADV_DEBUG is not set
976CONFIG_VIDEO_HELPER_CHIPS_AUTO=y 1115# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
1116# CONFIG_VIDEO_HELPER_CHIPS_AUTO is not set
1117
1118#
1119# Encoders/decoders and other helper chips
1120#
1121
1122#
1123# Audio decoders
1124#
1125# CONFIG_VIDEO_TVAUDIO is not set
1126# CONFIG_VIDEO_TDA7432 is not set
1127# CONFIG_VIDEO_TDA9840 is not set
1128# CONFIG_VIDEO_TDA9875 is not set
1129# CONFIG_VIDEO_TEA6415C is not set
1130# CONFIG_VIDEO_TEA6420 is not set
1131# CONFIG_VIDEO_MSP3400 is not set
1132# CONFIG_VIDEO_CS5345 is not set
1133# CONFIG_VIDEO_CS53L32A is not set
1134# CONFIG_VIDEO_M52790 is not set
1135# CONFIG_VIDEO_TLV320AIC23B is not set
1136# CONFIG_VIDEO_WM8775 is not set
1137# CONFIG_VIDEO_WM8739 is not set
1138# CONFIG_VIDEO_VP27SMPX is not set
1139
1140#
1141# RDS decoders
1142#
1143# CONFIG_VIDEO_SAA6588 is not set
1144
1145#
1146# Video decoders
1147#
1148# CONFIG_VIDEO_ADV7180 is not set
1149# CONFIG_VIDEO_BT819 is not set
1150# CONFIG_VIDEO_BT856 is not set
1151# CONFIG_VIDEO_BT866 is not set
1152# CONFIG_VIDEO_KS0127 is not set
1153# CONFIG_VIDEO_OV7670 is not set
1154# CONFIG_VIDEO_MT9V011 is not set
1155# CONFIG_VIDEO_TCM825X is not set
1156# CONFIG_VIDEO_SAA7110 is not set
1157# CONFIG_VIDEO_SAA711X is not set
1158# CONFIG_VIDEO_SAA717X is not set
1159# CONFIG_VIDEO_SAA7191 is not set
1160# CONFIG_VIDEO_TVP514X is not set
1161# CONFIG_VIDEO_TVP5150 is not set
1162# CONFIG_VIDEO_VPX3220 is not set
1163
1164#
1165# Video and audio decoders
1166#
1167# CONFIG_VIDEO_CX25840 is not set
1168
1169#
1170# MPEG video encoders
1171#
1172# CONFIG_VIDEO_CX2341X is not set
1173
1174#
1175# Video encoders
1176#
1177# CONFIG_VIDEO_SAA7127 is not set
1178# CONFIG_VIDEO_SAA7185 is not set
1179# CONFIG_VIDEO_ADV7170 is not set
1180# CONFIG_VIDEO_ADV7175 is not set
1181# CONFIG_VIDEO_THS7303 is not set
1182# CONFIG_VIDEO_ADV7343 is not set
1183
1184#
1185# Video improvement chips
1186#
1187# CONFIG_VIDEO_UPD64031A is not set
1188# CONFIG_VIDEO_UPD64083 is not set
977# CONFIG_VIDEO_VIVI is not set 1189# CONFIG_VIDEO_VIVI is not set
978# CONFIG_VIDEO_CPIA is not set 1190# CONFIG_VIDEO_CPIA is not set
979# CONFIG_VIDEO_CPIA2 is not set 1191# CONFIG_VIDEO_CPIA2 is not set
980# CONFIG_VIDEO_SAA5246A is not set 1192# CONFIG_VIDEO_SAA5246A is not set
981# CONFIG_VIDEO_SAA5249 is not set 1193# CONFIG_VIDEO_SAA5249 is not set
982# CONFIG_TUNER_3036 is not set 1194CONFIG_SOC_CAMERA=y
1195# CONFIG_SOC_CAMERA_MT9M001 is not set
1196CONFIG_SOC_CAMERA_MT9M111=y
1197# CONFIG_SOC_CAMERA_MT9T031 is not set
1198# CONFIG_SOC_CAMERA_MT9V022 is not set
1199# CONFIG_SOC_CAMERA_TW9910 is not set
1200# CONFIG_SOC_CAMERA_PLATFORM is not set
1201# CONFIG_SOC_CAMERA_OV772X is not set
1202CONFIG_VIDEO_PXA27x=y
1203# CONFIG_VIDEO_SH_MOBILE_CEU is not set
983# CONFIG_V4L_USB_DRIVERS is not set 1204# CONFIG_V4L_USB_DRIVERS is not set
984# CONFIG_SOC_CAMERA is not set
985# CONFIG_VIDEO_PXA27x is not set
986CONFIG_RADIO_ADAPTERS=y 1205CONFIG_RADIO_ADAPTERS=y
1206# CONFIG_I2C_SI4713 is not set
1207# CONFIG_RADIO_SI4713 is not set
987# CONFIG_USB_DSBR is not set 1208# CONFIG_USB_DSBR is not set
988# CONFIG_USB_SI470X is not set 1209# CONFIG_RADIO_SI470X is not set
1210# CONFIG_USB_MR800 is not set
1211CONFIG_RADIO_TEA5764=y
1212CONFIG_RADIO_TEA5764_XTAL=y
989# CONFIG_DAB is not set 1213# CONFIG_DAB is not set
990 1214
991# 1215#
@@ -996,6 +1220,7 @@ CONFIG_RADIO_ADAPTERS=y
996CONFIG_FB=y 1220CONFIG_FB=y
997# CONFIG_FIRMWARE_EDID is not set 1221# CONFIG_FIRMWARE_EDID is not set
998# CONFIG_FB_DDC is not set 1222# CONFIG_FB_DDC is not set
1223# CONFIG_FB_BOOT_VESA_SUPPORT is not set
999CONFIG_FB_CFB_FILLRECT=y 1224CONFIG_FB_CFB_FILLRECT=y
1000CONFIG_FB_CFB_COPYAREA=y 1225CONFIG_FB_CFB_COPYAREA=y
1001CONFIG_FB_CFB_IMAGEBLIT=y 1226CONFIG_FB_CFB_IMAGEBLIT=y
@@ -1017,15 +1242,19 @@ CONFIG_FB_CFB_IMAGEBLIT=y
1017# CONFIG_FB_UVESA is not set 1242# CONFIG_FB_UVESA is not set
1018# CONFIG_FB_S1D13XXX is not set 1243# CONFIG_FB_S1D13XXX is not set
1019CONFIG_FB_PXA=y 1244CONFIG_FB_PXA=y
1245CONFIG_FB_PXA_OVERLAY=y
1020# CONFIG_FB_PXA_SMARTPANEL is not set 1246# CONFIG_FB_PXA_SMARTPANEL is not set
1021CONFIG_FB_PXA_PARAMETERS=y 1247CONFIG_FB_PXA_PARAMETERS=y
1022# CONFIG_FB_MBX is not set 1248# CONFIG_FB_MBX is not set
1023# CONFIG_FB_AM200EPD is not set 1249# CONFIG_FB_W100 is not set
1024# CONFIG_FB_VIRTUAL is not set 1250# CONFIG_FB_VIRTUAL is not set
1251# CONFIG_FB_METRONOME is not set
1252# CONFIG_FB_MB862XX is not set
1253# CONFIG_FB_BROADSHEET is not set
1025CONFIG_BACKLIGHT_LCD_SUPPORT=y 1254CONFIG_BACKLIGHT_LCD_SUPPORT=y
1026# CONFIG_LCD_CLASS_DEVICE is not set 1255# CONFIG_LCD_CLASS_DEVICE is not set
1027CONFIG_BACKLIGHT_CLASS_DEVICE=y 1256CONFIG_BACKLIGHT_CLASS_DEVICE=y
1028# CONFIG_BACKLIGHT_CORGI is not set 1257CONFIG_BACKLIGHT_GENERIC=y
1029CONFIG_BACKLIGHT_PWM=y 1258CONFIG_BACKLIGHT_PWM=y
1030 1259
1031# 1260#
@@ -1053,85 +1282,60 @@ CONFIG_FONT_MINI_4x6=y
1053# CONFIG_FONT_SUN12x22 is not set 1282# CONFIG_FONT_SUN12x22 is not set
1054# CONFIG_FONT_10x18 is not set 1283# CONFIG_FONT_10x18 is not set
1055# CONFIG_LOGO is not set 1284# CONFIG_LOGO is not set
1056
1057#
1058# Sound
1059#
1060CONFIG_SOUND=y 1285CONFIG_SOUND=y
1061 1286CONFIG_SOUND_OSS_CORE=y
1062# 1287CONFIG_SOUND_OSS_CORE_PRECLAIM=y
1063# Advanced Linux Sound Architecture
1064#
1065CONFIG_SND=y 1288CONFIG_SND=y
1066CONFIG_SND_TIMER=y 1289CONFIG_SND_TIMER=y
1067CONFIG_SND_PCM=y 1290CONFIG_SND_PCM=y
1291CONFIG_SND_JACK=y
1068# CONFIG_SND_SEQUENCER is not set 1292# CONFIG_SND_SEQUENCER is not set
1069CONFIG_SND_OSSEMUL=y 1293CONFIG_SND_OSSEMUL=y
1070CONFIG_SND_MIXER_OSS=y 1294CONFIG_SND_MIXER_OSS=y
1071CONFIG_SND_PCM_OSS=y 1295CONFIG_SND_PCM_OSS=y
1072CONFIG_SND_PCM_OSS_PLUGINS=y 1296CONFIG_SND_PCM_OSS_PLUGINS=y
1297# CONFIG_SND_HRTIMER is not set
1073# CONFIG_SND_DYNAMIC_MINORS is not set 1298# CONFIG_SND_DYNAMIC_MINORS is not set
1074CONFIG_SND_SUPPORT_OLD_API=y 1299CONFIG_SND_SUPPORT_OLD_API=y
1075CONFIG_SND_VERBOSE_PROCFS=y 1300CONFIG_SND_VERBOSE_PROCFS=y
1076# CONFIG_SND_VERBOSE_PRINTK is not set 1301# CONFIG_SND_VERBOSE_PRINTK is not set
1077# CONFIG_SND_DEBUG is not set 1302# CONFIG_SND_DEBUG is not set
1078 1303# CONFIG_SND_RAWMIDI_SEQ is not set
1079# 1304# CONFIG_SND_OPL3_LIB_SEQ is not set
1080# Generic devices 1305# CONFIG_SND_OPL4_LIB_SEQ is not set
1081# 1306# CONFIG_SND_SBAWE_SEQ is not set
1082# CONFIG_SND_DUMMY is not set 1307# CONFIG_SND_EMU10K1_SEQ is not set
1083# CONFIG_SND_MTPAV is not set 1308# CONFIG_SND_DRIVERS is not set
1084# CONFIG_SND_SERIAL_U16550 is not set 1309# CONFIG_SND_ARM is not set
1085# CONFIG_SND_MPU401 is not set 1310CONFIG_SND_PXA2XX_LIB=y
1086 1311# CONFIG_SND_SPI is not set
1087# 1312# CONFIG_SND_USB is not set
1088# ALSA ARM devices
1089#
1090# CONFIG_SND_PXA2XX_AC97 is not set
1091
1092#
1093# SPI devices
1094#
1095
1096#
1097# USB devices
1098#
1099# CONFIG_SND_USB_AUDIO is not set
1100# CONFIG_SND_USB_CAIAQ is not set
1101
1102#
1103# System on Chip audio support
1104#
1105CONFIG_SND_SOC=y 1313CONFIG_SND_SOC=y
1106CONFIG_SND_PXA2XX_SOC=y 1314CONFIG_SND_PXA2XX_SOC=y
1107 1315CONFIG_SND_SOC_I2C_AND_SPI=y
1108# 1316# CONFIG_SND_SOC_ALL_CODECS is not set
1109# ALSA SoC audio for Freescale SOCs
1110#
1111
1112#
1113# SoC Audio for the Texas Instruments OMAP
1114#
1115
1116#
1117# Open Sound System
1118#
1119# CONFIG_SOUND_PRIME is not set 1317# CONFIG_SOUND_PRIME is not set
1120CONFIG_HID_SUPPORT=y 1318CONFIG_HID_SUPPORT=y
1121CONFIG_HID=y 1319CONFIG_HID=y
1122# CONFIG_HID_DEBUG is not set
1123# CONFIG_HIDRAW is not set 1320# CONFIG_HIDRAW is not set
1124 1321
1125# 1322#
1126# USB Input Devices 1323# USB Input Devices
1127# 1324#
1128# CONFIG_USB_HID is not set 1325# CONFIG_USB_HID is not set
1326# CONFIG_HID_PID is not set
1129 1327
1130# 1328#
1131# USB HID Boot Protocol drivers 1329# USB HID Boot Protocol drivers
1132# 1330#
1133# CONFIG_USB_KBD is not set 1331# CONFIG_USB_KBD is not set
1134# CONFIG_USB_MOUSE is not set 1332# CONFIG_USB_MOUSE is not set
1333
1334#
1335# Special HID drivers
1336#
1337CONFIG_HID_APPLE=m
1338# CONFIG_HID_WACOM is not set
1135CONFIG_USB_SUPPORT=y 1339CONFIG_USB_SUPPORT=y
1136CONFIG_USB_ARCH_HAS_HCD=y 1340CONFIG_USB_ARCH_HAS_HCD=y
1137CONFIG_USB_ARCH_HAS_OHCI=y 1341CONFIG_USB_ARCH_HAS_OHCI=y
@@ -1150,32 +1354,42 @@ CONFIG_USB=y
1150# CONFIG_USB_OTG is not set 1354# CONFIG_USB_OTG is not set
1151# CONFIG_USB_OTG_WHITELIST is not set 1355# CONFIG_USB_OTG_WHITELIST is not set
1152# CONFIG_USB_OTG_BLACKLIST_HUB is not set 1356# CONFIG_USB_OTG_BLACKLIST_HUB is not set
1357# CONFIG_USB_MON is not set
1358# CONFIG_USB_WUSB is not set
1359# CONFIG_USB_WUSB_CBAF is not set
1153 1360
1154# 1361#
1155# USB Host Controller Drivers 1362# USB Host Controller Drivers
1156# 1363#
1157# CONFIG_USB_C67X00_HCD is not set 1364# CONFIG_USB_C67X00_HCD is not set
1365# CONFIG_USB_OXU210HP_HCD is not set
1158# CONFIG_USB_ISP116X_HCD is not set 1366# CONFIG_USB_ISP116X_HCD is not set
1159# CONFIG_USB_ISP1760_HCD is not set 1367# CONFIG_USB_ISP1760_HCD is not set
1368# CONFIG_USB_ISP1362_HCD is not set
1160CONFIG_USB_OHCI_HCD=y 1369CONFIG_USB_OHCI_HCD=y
1161# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set 1370# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
1162# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set 1371# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
1163CONFIG_USB_OHCI_LITTLE_ENDIAN=y 1372CONFIG_USB_OHCI_LITTLE_ENDIAN=y
1164# CONFIG_USB_SL811_HCD is not set 1373# CONFIG_USB_SL811_HCD is not set
1165# CONFIG_USB_R8A66597_HCD is not set 1374# CONFIG_USB_R8A66597_HCD is not set
1375# CONFIG_USB_HWA_HCD is not set
1376# CONFIG_USB_MUSB_HDRC is not set
1377# CONFIG_USB_GADGET_MUSB_HDRC is not set
1166 1378
1167# 1379#
1168# USB Device Class drivers 1380# USB Device Class drivers
1169# 1381#
1170# CONFIG_USB_ACM is not set 1382# CONFIG_USB_ACM is not set
1171# CONFIG_USB_PRINTER is not set 1383# CONFIG_USB_PRINTER is not set
1384# CONFIG_USB_WDM is not set
1385# CONFIG_USB_TMC is not set
1172 1386
1173# 1387#
1174# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 1388# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
1175# 1389#
1176 1390
1177# 1391#
1178# may also be needed; see USB_STORAGE Help for more information 1392# also be needed; see USB_STORAGE Help for more info
1179# 1393#
1180# CONFIG_USB_LIBUSUAL is not set 1394# CONFIG_USB_LIBUSUAL is not set
1181 1395
@@ -1183,7 +1397,6 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y
1183# USB Imaging devices 1397# USB Imaging devices
1184# 1398#
1185# CONFIG_USB_MDC800 is not set 1399# CONFIG_USB_MDC800 is not set
1186# CONFIG_USB_MON is not set
1187 1400
1188# 1401#
1189# USB port drivers 1402# USB port drivers
@@ -1196,7 +1409,7 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y
1196# CONFIG_USB_EMI62 is not set 1409# CONFIG_USB_EMI62 is not set
1197# CONFIG_USB_EMI26 is not set 1410# CONFIG_USB_EMI26 is not set
1198# CONFIG_USB_ADUTUX is not set 1411# CONFIG_USB_ADUTUX is not set
1199# CONFIG_USB_AUERSWALD is not set 1412# CONFIG_USB_SEVSEG is not set
1200# CONFIG_USB_RIO500 is not set 1413# CONFIG_USB_RIO500 is not set
1201# CONFIG_USB_LEGOTOWER is not set 1414# CONFIG_USB_LEGOTOWER is not set
1202# CONFIG_USB_LCD is not set 1415# CONFIG_USB_LCD is not set
@@ -1204,62 +1417,94 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y
1204# CONFIG_USB_LED is not set 1417# CONFIG_USB_LED is not set
1205# CONFIG_USB_CYPRESS_CY7C63 is not set 1418# CONFIG_USB_CYPRESS_CY7C63 is not set
1206# CONFIG_USB_CYTHERM is not set 1419# CONFIG_USB_CYTHERM is not set
1207# CONFIG_USB_PHIDGET is not set
1208# CONFIG_USB_IDMOUSE is not set 1420# CONFIG_USB_IDMOUSE is not set
1209# CONFIG_USB_FTDI_ELAN is not set 1421# CONFIG_USB_FTDI_ELAN is not set
1210# CONFIG_USB_APPLEDISPLAY is not set 1422# CONFIG_USB_APPLEDISPLAY is not set
1211# CONFIG_USB_LD is not set 1423# CONFIG_USB_LD is not set
1212# CONFIG_USB_TRANCEVIBRATOR is not set 1424# CONFIG_USB_TRANCEVIBRATOR is not set
1213# CONFIG_USB_IOWARRIOR is not set 1425# CONFIG_USB_IOWARRIOR is not set
1426# CONFIG_USB_TEST is not set
1427# CONFIG_USB_ISIGHTFW is not set
1428# CONFIG_USB_VST is not set
1214CONFIG_USB_GADGET=y 1429CONFIG_USB_GADGET=y
1430# CONFIG_USB_GADGET_DEBUG is not set
1215# CONFIG_USB_GADGET_DEBUG_FILES is not set 1431# CONFIG_USB_GADGET_DEBUG_FILES is not set
1432# CONFIG_USB_GADGET_DEBUG_FS is not set
1433CONFIG_USB_GADGET_VBUS_DRAW=2
1216CONFIG_USB_GADGET_SELECTED=y 1434CONFIG_USB_GADGET_SELECTED=y
1217# CONFIG_USB_GADGET_AMD5536UDC is not set 1435# CONFIG_USB_GADGET_AT91 is not set
1218# CONFIG_USB_GADGET_ATMEL_USBA is not set 1436# CONFIG_USB_GADGET_ATMEL_USBA is not set
1219# CONFIG_USB_GADGET_FSL_USB2 is not set 1437# CONFIG_USB_GADGET_FSL_USB2 is not set
1220# CONFIG_USB_GADGET_NET2280 is not set 1438# CONFIG_USB_GADGET_LH7A40X is not set
1439# CONFIG_USB_GADGET_OMAP is not set
1221# CONFIG_USB_GADGET_PXA25X is not set 1440# CONFIG_USB_GADGET_PXA25X is not set
1222# CONFIG_USB_GADGET_M66592 is not set 1441# CONFIG_USB_GADGET_R8A66597 is not set
1223CONFIG_USB_GADGET_PXA27X=y 1442CONFIG_USB_GADGET_PXA27X=y
1224CONFIG_USB_PXA27X=y 1443CONFIG_USB_PXA27X=y
1225# CONFIG_USB_GADGET_GOKU is not set 1444# CONFIG_USB_GADGET_S3C_HSOTG is not set
1226# CONFIG_USB_GADGET_LH7A40X is not set 1445# CONFIG_USB_GADGET_IMX is not set
1227# CONFIG_USB_GADGET_OMAP is not set
1228# CONFIG_USB_GADGET_S3C2410 is not set 1446# CONFIG_USB_GADGET_S3C2410 is not set
1229# CONFIG_USB_GADGET_AT91 is not set 1447# CONFIG_USB_GADGET_M66592 is not set
1448# CONFIG_USB_GADGET_AMD5536UDC is not set
1449# CONFIG_USB_GADGET_FSL_QE is not set
1450# CONFIG_USB_GADGET_CI13XXX is not set
1451# CONFIG_USB_GADGET_NET2280 is not set
1452# CONFIG_USB_GADGET_GOKU is not set
1453# CONFIG_USB_GADGET_LANGWELL is not set
1230# CONFIG_USB_GADGET_DUMMY_HCD is not set 1454# CONFIG_USB_GADGET_DUMMY_HCD is not set
1231# CONFIG_USB_GADGET_DUALSPEED is not set 1455# CONFIG_USB_GADGET_DUALSPEED is not set
1232# CONFIG_USB_ZERO is not set 1456# CONFIG_USB_ZERO is not set
1457# CONFIG_USB_AUDIO is not set
1233CONFIG_USB_ETH=y 1458CONFIG_USB_ETH=y
1234# CONFIG_USB_ETH_RNDIS is not set 1459# CONFIG_USB_ETH_RNDIS is not set
1460# CONFIG_USB_ETH_EEM is not set
1235# CONFIG_USB_GADGETFS is not set 1461# CONFIG_USB_GADGETFS is not set
1236# CONFIG_USB_FILE_STORAGE is not set 1462# CONFIG_USB_FILE_STORAGE is not set
1237# CONFIG_USB_G_SERIAL is not set 1463# CONFIG_USB_G_SERIAL is not set
1238# CONFIG_USB_MIDI_GADGET is not set 1464# CONFIG_USB_MIDI_GADGET is not set
1239# CONFIG_USB_G_PRINTER is not set 1465# CONFIG_USB_G_PRINTER is not set
1466# CONFIG_USB_CDC_COMPOSITE is not set
1467
1468#
1469# OTG and related infrastructure
1470#
1471CONFIG_USB_OTG_UTILS=y
1472# CONFIG_USB_GPIO_VBUS is not set
1473# CONFIG_NOP_USB_XCEIV is not set
1240CONFIG_MMC=y 1474CONFIG_MMC=y
1241# CONFIG_MMC_DEBUG is not set 1475# CONFIG_MMC_DEBUG is not set
1242CONFIG_MMC_UNSAFE_RESUME=y 1476CONFIG_MMC_UNSAFE_RESUME=y
1243 1477
1244# 1478#
1245# MMC/SD Card Drivers 1479# MMC/SD/SDIO Card Drivers
1246# 1480#
1247CONFIG_MMC_BLOCK=y 1481CONFIG_MMC_BLOCK=y
1248CONFIG_MMC_BLOCK_BOUNCE=y 1482CONFIG_MMC_BLOCK_BOUNCE=y
1249CONFIG_SDIO_UART=y 1483CONFIG_SDIO_UART=m
1484# CONFIG_MMC_TEST is not set
1250 1485
1251# 1486#
1252# MMC/SD Host Controller Drivers 1487# MMC/SD/SDIO Host Controller Drivers
1253# 1488#
1254CONFIG_MMC_PXA=y 1489CONFIG_MMC_PXA=y
1255# CONFIG_MMC_SPI is not set 1490# CONFIG_MMC_SDHCI is not set
1491# CONFIG_MMC_AT91 is not set
1492# CONFIG_MMC_ATMELMCI is not set
1493CONFIG_MMC_SPI=y
1494# CONFIG_MEMSTICK is not set
1256CONFIG_NEW_LEDS=y 1495CONFIG_NEW_LEDS=y
1257CONFIG_LEDS_CLASS=y 1496CONFIG_LEDS_CLASS=y
1258 1497
1259# 1498#
1260# LED drivers 1499# LED drivers
1261# 1500#
1501# CONFIG_LEDS_PCA9532 is not set
1262# CONFIG_LEDS_GPIO is not set 1502# CONFIG_LEDS_GPIO is not set
1503CONFIG_LEDS_LP3944=y
1504# CONFIG_LEDS_PCA955X is not set
1505# CONFIG_LEDS_DAC124S085 is not set
1506# CONFIG_LEDS_PWM is not set
1507# CONFIG_LEDS_BD2802 is not set
1263 1508
1264# 1509#
1265# LED Triggers 1510# LED Triggers
@@ -1267,7 +1512,14 @@ CONFIG_LEDS_CLASS=y
1267CONFIG_LEDS_TRIGGERS=y 1512CONFIG_LEDS_TRIGGERS=y
1268CONFIG_LEDS_TRIGGER_TIMER=y 1513CONFIG_LEDS_TRIGGER_TIMER=y
1269CONFIG_LEDS_TRIGGER_HEARTBEAT=y 1514CONFIG_LEDS_TRIGGER_HEARTBEAT=y
1270# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set 1515CONFIG_LEDS_TRIGGER_BACKLIGHT=y
1516CONFIG_LEDS_TRIGGER_GPIO=y
1517CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
1518
1519#
1520# iptables trigger is under Netfilter config (LED target)
1521#
1522# CONFIG_ACCESSIBILITY is not set
1271CONFIG_RTC_LIB=y 1523CONFIG_RTC_LIB=y
1272CONFIG_RTC_CLASS=y 1524CONFIG_RTC_CLASS=y
1273CONFIG_RTC_HCTOSYS=y 1525CONFIG_RTC_HCTOSYS=y
@@ -1297,45 +1549,67 @@ CONFIG_RTC_INTF_DEV=y
1297# CONFIG_RTC_DRV_PCF8583 is not set 1549# CONFIG_RTC_DRV_PCF8583 is not set
1298# CONFIG_RTC_DRV_M41T80 is not set 1550# CONFIG_RTC_DRV_M41T80 is not set
1299# CONFIG_RTC_DRV_S35390A is not set 1551# CONFIG_RTC_DRV_S35390A is not set
1552# CONFIG_RTC_DRV_FM3130 is not set
1553# CONFIG_RTC_DRV_RX8581 is not set
1554# CONFIG_RTC_DRV_RX8025 is not set
1300 1555
1301# 1556#
1302# SPI RTC drivers 1557# SPI RTC drivers
1303# 1558#
1559# CONFIG_RTC_DRV_M41T94 is not set
1560# CONFIG_RTC_DRV_DS1305 is not set
1561# CONFIG_RTC_DRV_DS1390 is not set
1304# CONFIG_RTC_DRV_MAX6902 is not set 1562# CONFIG_RTC_DRV_MAX6902 is not set
1305# CONFIG_RTC_DRV_R9701 is not set 1563# CONFIG_RTC_DRV_R9701 is not set
1306# CONFIG_RTC_DRV_RS5C348 is not set 1564# CONFIG_RTC_DRV_RS5C348 is not set
1565# CONFIG_RTC_DRV_DS3234 is not set
1566# CONFIG_RTC_DRV_PCF2123 is not set
1307 1567
1308# 1568#
1309# Platform RTC drivers 1569# Platform RTC drivers
1310# 1570#
1311# CONFIG_RTC_DRV_CMOS is not set 1571# CONFIG_RTC_DRV_CMOS is not set
1572# CONFIG_RTC_DRV_DS1286 is not set
1312# CONFIG_RTC_DRV_DS1511 is not set 1573# CONFIG_RTC_DRV_DS1511 is not set
1313# CONFIG_RTC_DRV_DS1553 is not set 1574# CONFIG_RTC_DRV_DS1553 is not set
1314# CONFIG_RTC_DRV_DS1742 is not set 1575# CONFIG_RTC_DRV_DS1742 is not set
1315# CONFIG_RTC_DRV_STK17TA8 is not set 1576# CONFIG_RTC_DRV_STK17TA8 is not set
1316# CONFIG_RTC_DRV_M48T86 is not set 1577# CONFIG_RTC_DRV_M48T86 is not set
1578# CONFIG_RTC_DRV_M48T35 is not set
1317# CONFIG_RTC_DRV_M48T59 is not set 1579# CONFIG_RTC_DRV_M48T59 is not set
1580# CONFIG_RTC_DRV_BQ4802 is not set
1318# CONFIG_RTC_DRV_V3020 is not set 1581# CONFIG_RTC_DRV_V3020 is not set
1319 1582
1320# 1583#
1321# on-CPU RTC drivers 1584# on-CPU RTC drivers
1322# 1585#
1323CONFIG_RTC_DRV_SA1100=m 1586# CONFIG_RTC_DRV_SA1100 is not set
1587# CONFIG_RTC_DRV_PXA is not set
1588CONFIG_RTC_DRV_PCAP=y
1589# CONFIG_DMADEVICES is not set
1590# CONFIG_AUXDISPLAY is not set
1324# CONFIG_UIO is not set 1591# CONFIG_UIO is not set
1325 1592
1326# 1593#
1594# TI VLYNQ
1595#
1596# CONFIG_STAGING is not set
1597
1598#
1327# File systems 1599# File systems
1328# 1600#
1329CONFIG_EXT2_FS=y 1601CONFIG_EXT2_FS=y
1330# CONFIG_EXT2_FS_XATTR is not set 1602# CONFIG_EXT2_FS_XATTR is not set
1331# CONFIG_EXT2_FS_XIP is not set 1603# CONFIG_EXT2_FS_XIP is not set
1332CONFIG_EXT3_FS=m 1604CONFIG_EXT3_FS=m
1605# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
1333CONFIG_EXT3_FS_XATTR=y 1606CONFIG_EXT3_FS_XATTR=y
1334# CONFIG_EXT3_FS_POSIX_ACL is not set 1607# CONFIG_EXT3_FS_POSIX_ACL is not set
1335# CONFIG_EXT3_FS_SECURITY is not set 1608# CONFIG_EXT3_FS_SECURITY is not set
1336# CONFIG_EXT4DEV_FS is not set 1609# CONFIG_EXT4_FS is not set
1337CONFIG_JBD=m 1610CONFIG_JBD=m
1338CONFIG_FS_MBCACHE=y 1611# CONFIG_JBD_DEBUG is not set
1612CONFIG_FS_MBCACHE=m
1339CONFIG_REISERFS_FS=m 1613CONFIG_REISERFS_FS=m
1340# CONFIG_REISERFS_CHECK is not set 1614# CONFIG_REISERFS_CHECK is not set
1341# CONFIG_REISERFS_PROC_INFO is not set 1615# CONFIG_REISERFS_PROC_INFO is not set
@@ -1350,6 +1624,10 @@ CONFIG_XFS_FS=m
1350# CONFIG_XFS_RT is not set 1624# CONFIG_XFS_RT is not set
1351# CONFIG_XFS_DEBUG is not set 1625# CONFIG_XFS_DEBUG is not set
1352# CONFIG_OCFS2_FS is not set 1626# CONFIG_OCFS2_FS is not set
1627# CONFIG_BTRFS_FS is not set
1628# CONFIG_NILFS2_FS is not set
1629CONFIG_FILE_LOCKING=y
1630CONFIG_FSNOTIFY=y
1353CONFIG_DNOTIFY=y 1631CONFIG_DNOTIFY=y
1354CONFIG_INOTIFY=y 1632CONFIG_INOTIFY=y
1355CONFIG_INOTIFY_USER=y 1633CONFIG_INOTIFY_USER=y
@@ -1357,6 +1635,12 @@ CONFIG_INOTIFY_USER=y
1357CONFIG_AUTOFS_FS=y 1635CONFIG_AUTOFS_FS=y
1358CONFIG_AUTOFS4_FS=y 1636CONFIG_AUTOFS4_FS=y
1359CONFIG_FUSE_FS=m 1637CONFIG_FUSE_FS=m
1638CONFIG_CUSE=m
1639
1640#
1641# Caches
1642#
1643# CONFIG_FSCACHE is not set
1360 1644
1361# 1645#
1362# CD-ROM/DVD Filesystems 1646# CD-ROM/DVD Filesystems
@@ -1381,15 +1665,13 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1381# 1665#
1382CONFIG_PROC_FS=y 1666CONFIG_PROC_FS=y
1383CONFIG_PROC_SYSCTL=y 1667CONFIG_PROC_SYSCTL=y
1668CONFIG_PROC_PAGE_MONITOR=y
1384CONFIG_SYSFS=y 1669CONFIG_SYSFS=y
1385CONFIG_TMPFS=y 1670CONFIG_TMPFS=y
1386# CONFIG_TMPFS_POSIX_ACL is not set 1671# CONFIG_TMPFS_POSIX_ACL is not set
1387# CONFIG_HUGETLB_PAGE is not set 1672# CONFIG_HUGETLB_PAGE is not set
1388# CONFIG_CONFIGFS_FS is not set 1673# CONFIG_CONFIGFS_FS is not set
1389 1674CONFIG_MISC_FILESYSTEMS=y
1390#
1391# Miscellaneous filesystems
1392#
1393# CONFIG_ADFS_FS is not set 1675# CONFIG_ADFS_FS is not set
1394# CONFIG_AFFS_FS is not set 1676# CONFIG_AFFS_FS is not set
1395# CONFIG_HFS_FS is not set 1677# CONFIG_HFS_FS is not set
@@ -1397,13 +1679,35 @@ CONFIG_TMPFS=y
1397# CONFIG_BEFS_FS is not set 1679# CONFIG_BEFS_FS is not set
1398# CONFIG_BFS_FS is not set 1680# CONFIG_BFS_FS is not set
1399# CONFIG_EFS_FS is not set 1681# CONFIG_EFS_FS is not set
1400# CONFIG_JFFS2_FS is not set 1682CONFIG_JFFS2_FS=m
1683CONFIG_JFFS2_FS_DEBUG=0
1684CONFIG_JFFS2_FS_WRITEBUFFER=y
1685# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
1686# CONFIG_JFFS2_SUMMARY is not set
1687# CONFIG_JFFS2_FS_XATTR is not set
1688CONFIG_JFFS2_COMPRESSION_OPTIONS=y
1689CONFIG_JFFS2_ZLIB=y
1690CONFIG_JFFS2_LZO=y
1691CONFIG_JFFS2_RTIME=y
1692CONFIG_JFFS2_RUBIN=y
1693# CONFIG_JFFS2_CMODE_NONE is not set
1694CONFIG_JFFS2_CMODE_PRIORITY=y
1695# CONFIG_JFFS2_CMODE_SIZE is not set
1696# CONFIG_JFFS2_CMODE_FAVOURLZO is not set
1401CONFIG_CRAMFS=m 1697CONFIG_CRAMFS=m
1698CONFIG_SQUASHFS=m
1699# CONFIG_SQUASHFS_EMBEDDED is not set
1700CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
1402# CONFIG_VXFS_FS is not set 1701# CONFIG_VXFS_FS is not set
1403# CONFIG_MINIX_FS is not set 1702# CONFIG_MINIX_FS is not set
1703# CONFIG_OMFS_FS is not set
1404# CONFIG_HPFS_FS is not set 1704# CONFIG_HPFS_FS is not set
1405# CONFIG_QNX4FS_FS is not set 1705# CONFIG_QNX4FS_FS is not set
1406# CONFIG_ROMFS_FS is not set 1706CONFIG_ROMFS_FS=m
1707CONFIG_ROMFS_BACKED_BY_BLOCK=y
1708# CONFIG_ROMFS_BACKED_BY_MTD is not set
1709# CONFIG_ROMFS_BACKED_BY_BOTH is not set
1710CONFIG_ROMFS_ON_BLOCK=y
1407# CONFIG_SYSV_FS is not set 1711# CONFIG_SYSV_FS is not set
1408# CONFIG_UFS_FS is not set 1712# CONFIG_UFS_FS is not set
1409CONFIG_NETWORK_FILESYSTEMS=y 1713CONFIG_NETWORK_FILESYSTEMS=y
@@ -1411,19 +1715,18 @@ CONFIG_NFS_FS=y
1411CONFIG_NFS_V3=y 1715CONFIG_NFS_V3=y
1412CONFIG_NFS_V3_ACL=y 1716CONFIG_NFS_V3_ACL=y
1413# CONFIG_NFS_V4 is not set 1717# CONFIG_NFS_V4 is not set
1718# CONFIG_ROOT_NFS is not set
1414CONFIG_NFSD=m 1719CONFIG_NFSD=m
1415CONFIG_NFSD_V2_ACL=y 1720CONFIG_NFSD_V2_ACL=y
1416CONFIG_NFSD_V3=y 1721CONFIG_NFSD_V3=y
1417CONFIG_NFSD_V3_ACL=y 1722CONFIG_NFSD_V3_ACL=y
1418# CONFIG_NFSD_V4 is not set 1723# CONFIG_NFSD_V4 is not set
1419# CONFIG_ROOT_NFS is not set
1420CONFIG_LOCKD=y 1724CONFIG_LOCKD=y
1421CONFIG_LOCKD_V4=y 1725CONFIG_LOCKD_V4=y
1422CONFIG_EXPORTFS=m 1726CONFIG_EXPORTFS=m
1423CONFIG_NFS_ACL_SUPPORT=y 1727CONFIG_NFS_ACL_SUPPORT=y
1424CONFIG_NFS_COMMON=y 1728CONFIG_NFS_COMMON=y
1425CONFIG_SUNRPC=y 1729CONFIG_SUNRPC=y
1426# CONFIG_SUNRPC_BIND34 is not set
1427# CONFIG_RPCSEC_GSS_KRB5 is not set 1730# CONFIG_RPCSEC_GSS_KRB5 is not set
1428# CONFIG_RPCSEC_GSS_SPKM3 is not set 1731# CONFIG_RPCSEC_GSS_SPKM3 is not set
1429CONFIG_SMB_FS=m 1732CONFIG_SMB_FS=m
@@ -1490,25 +1793,83 @@ CONFIG_NLS_UTF8=m
1490# 1793#
1491# Kernel hacking 1794# Kernel hacking
1492# 1795#
1493# CONFIG_PRINTK_TIME is not set 1796CONFIG_PRINTK_TIME=y
1494CONFIG_ENABLE_WARN_DEPRECATED=y 1797CONFIG_ENABLE_WARN_DEPRECATED=y
1495# CONFIG_ENABLE_MUST_CHECK is not set 1798CONFIG_ENABLE_MUST_CHECK=y
1496CONFIG_FRAME_WARN=1024 1799CONFIG_FRAME_WARN=1024
1497# CONFIG_MAGIC_SYSRQ is not set 1800# CONFIG_MAGIC_SYSRQ is not set
1801# CONFIG_STRIP_ASM_SYMS is not set
1498# CONFIG_UNUSED_SYMBOLS is not set 1802# CONFIG_UNUSED_SYMBOLS is not set
1499# CONFIG_DEBUG_FS is not set 1803CONFIG_DEBUG_FS=y
1500# CONFIG_HEADERS_CHECK is not set 1804# CONFIG_HEADERS_CHECK is not set
1501# CONFIG_DEBUG_KERNEL is not set 1805CONFIG_DEBUG_KERNEL=y
1502# CONFIG_DEBUG_BUGVERBOSE is not set 1806# CONFIG_DEBUG_SHIRQ is not set
1503CONFIG_FRAME_POINTER=y 1807CONFIG_DETECT_SOFTLOCKUP=y
1808# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1809CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
1810CONFIG_DETECT_HUNG_TASK=y
1811# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
1812CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
1813# CONFIG_SCHED_DEBUG is not set
1814# CONFIG_SCHEDSTATS is not set
1815# CONFIG_TIMER_STATS is not set
1816# CONFIG_DEBUG_OBJECTS is not set
1817# CONFIG_DEBUG_SLAB is not set
1818# CONFIG_DEBUG_KMEMLEAK is not set
1819CONFIG_DEBUG_PREEMPT=y
1820CONFIG_DEBUG_RT_MUTEXES=y
1821CONFIG_DEBUG_PI_LIST=y
1822# CONFIG_RT_MUTEX_TESTER is not set
1823CONFIG_DEBUG_SPINLOCK=y
1824CONFIG_DEBUG_MUTEXES=y
1825CONFIG_DEBUG_LOCK_ALLOC=y
1826CONFIG_PROVE_LOCKING=y
1827CONFIG_LOCKDEP=y
1828# CONFIG_LOCK_STAT is not set
1829# CONFIG_DEBUG_LOCKDEP is not set
1830CONFIG_TRACE_IRQFLAGS=y
1831# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1832# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1833CONFIG_STACKTRACE=y
1834# CONFIG_DEBUG_KOBJECT is not set
1835CONFIG_DEBUG_BUGVERBOSE=y
1836# CONFIG_DEBUG_INFO is not set
1837# CONFIG_DEBUG_VM is not set
1838# CONFIG_DEBUG_WRITECOUNT is not set
1839# CONFIG_DEBUG_MEMORY_INIT is not set
1840# CONFIG_DEBUG_LIST is not set
1841# CONFIG_DEBUG_SG is not set
1842# CONFIG_DEBUG_NOTIFIERS is not set
1843# CONFIG_DEBUG_CREDENTIALS is not set
1844# CONFIG_BOOT_PRINTK_DELAY is not set
1845# CONFIG_RCU_TORTURE_TEST is not set
1846# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1847# CONFIG_BACKTRACE_SELF_TEST is not set
1848# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1849# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
1850# CONFIG_FAULT_INJECTION is not set
1851# CONFIG_LATENCYTOP is not set
1852# CONFIG_SYSCTL_SYSCALL_CHECK is not set
1853# CONFIG_PAGE_POISONING is not set
1854CONFIG_HAVE_FUNCTION_TRACER=y
1855CONFIG_TRACING_SUPPORT=y
1856# CONFIG_FTRACE is not set
1857# CONFIG_DYNAMIC_DEBUG is not set
1504# CONFIG_SAMPLES is not set 1858# CONFIG_SAMPLES is not set
1505# CONFIG_DEBUG_USER is not set 1859CONFIG_HAVE_ARCH_KGDB=y
1860# CONFIG_KGDB is not set
1861CONFIG_ARM_UNWIND=y
1862CONFIG_DEBUG_USER=y
1863CONFIG_DEBUG_ERRORS=y
1864# CONFIG_DEBUG_STACK_USAGE is not set
1865# CONFIG_DEBUG_LL is not set
1506 1866
1507# 1867#
1508# Security options 1868# Security options
1509# 1869#
1510# CONFIG_KEYS is not set 1870# CONFIG_KEYS is not set
1511# CONFIG_SECURITY is not set 1871# CONFIG_SECURITY is not set
1872# CONFIG_SECURITYFS is not set
1512# CONFIG_SECURITY_FILE_CAPABILITIES is not set 1873# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1513CONFIG_CRYPTO=y 1874CONFIG_CRYPTO=y
1514 1875
@@ -1516,12 +1877,20 @@ CONFIG_CRYPTO=y
1516# Crypto core or helper 1877# Crypto core or helper
1517# 1878#
1518CONFIG_CRYPTO_ALGAPI=m 1879CONFIG_CRYPTO_ALGAPI=m
1880CONFIG_CRYPTO_ALGAPI2=m
1519CONFIG_CRYPTO_AEAD=m 1881CONFIG_CRYPTO_AEAD=m
1882CONFIG_CRYPTO_AEAD2=m
1520CONFIG_CRYPTO_BLKCIPHER=m 1883CONFIG_CRYPTO_BLKCIPHER=m
1884CONFIG_CRYPTO_BLKCIPHER2=m
1521CONFIG_CRYPTO_HASH=m 1885CONFIG_CRYPTO_HASH=m
1886CONFIG_CRYPTO_HASH2=m
1887CONFIG_CRYPTO_RNG2=m
1888CONFIG_CRYPTO_PCOMP=m
1522CONFIG_CRYPTO_MANAGER=m 1889CONFIG_CRYPTO_MANAGER=m
1890CONFIG_CRYPTO_MANAGER2=m
1523CONFIG_CRYPTO_GF128MUL=m 1891CONFIG_CRYPTO_GF128MUL=m
1524CONFIG_CRYPTO_NULL=m 1892CONFIG_CRYPTO_NULL=m
1893CONFIG_CRYPTO_WORKQUEUE=m
1525CONFIG_CRYPTO_CRYPTD=m 1894CONFIG_CRYPTO_CRYPTD=m
1526CONFIG_CRYPTO_AUTHENC=m 1895CONFIG_CRYPTO_AUTHENC=m
1527CONFIG_CRYPTO_TEST=m 1896CONFIG_CRYPTO_TEST=m
@@ -1549,14 +1918,20 @@ CONFIG_CRYPTO_XTS=m
1549# 1918#
1550CONFIG_CRYPTO_HMAC=m 1919CONFIG_CRYPTO_HMAC=m
1551CONFIG_CRYPTO_XCBC=m 1920CONFIG_CRYPTO_XCBC=m
1921CONFIG_CRYPTO_VMAC=m
1552 1922
1553# 1923#
1554# Digest 1924# Digest
1555# 1925#
1556CONFIG_CRYPTO_CRC32C=m 1926CONFIG_CRYPTO_CRC32C=m
1927CONFIG_CRYPTO_GHASH=m
1557CONFIG_CRYPTO_MD4=m 1928CONFIG_CRYPTO_MD4=m
1558CONFIG_CRYPTO_MD5=m 1929CONFIG_CRYPTO_MD5=m
1559CONFIG_CRYPTO_MICHAEL_MIC=m 1930CONFIG_CRYPTO_MICHAEL_MIC=m
1931# CONFIG_CRYPTO_RMD128 is not set
1932# CONFIG_CRYPTO_RMD160 is not set
1933# CONFIG_CRYPTO_RMD256 is not set
1934# CONFIG_CRYPTO_RMD320 is not set
1560CONFIG_CRYPTO_SHA1=m 1935CONFIG_CRYPTO_SHA1=m
1561CONFIG_CRYPTO_SHA256=m 1936CONFIG_CRYPTO_SHA256=m
1562CONFIG_CRYPTO_SHA512=m 1937CONFIG_CRYPTO_SHA512=m
@@ -1587,28 +1962,40 @@ CONFIG_CRYPTO_TWOFISH_COMMON=m
1587# Compression 1962# Compression
1588# 1963#
1589CONFIG_CRYPTO_DEFLATE=m 1964CONFIG_CRYPTO_DEFLATE=m
1965# CONFIG_CRYPTO_ZLIB is not set
1590# CONFIG_CRYPTO_LZO is not set 1966# CONFIG_CRYPTO_LZO is not set
1967
1968#
1969# Random Number Generation
1970#
1971# CONFIG_CRYPTO_ANSI_CPRNG is not set
1591CONFIG_CRYPTO_HW=y 1972CONFIG_CRYPTO_HW=y
1973# CONFIG_BINARY_PRINTF is not set
1592 1974
1593# 1975#
1594# Library routines 1976# Library routines
1595# 1977#
1596CONFIG_BITREVERSE=y 1978CONFIG_BITREVERSE=y
1597# CONFIG_GENERIC_FIND_FIRST_BIT is not set 1979CONFIG_GENERIC_FIND_LAST_BIT=y
1598# CONFIG_GENERIC_FIND_NEXT_BIT is not set
1599CONFIG_CRC_CCITT=m 1980CONFIG_CRC_CCITT=m
1600CONFIG_CRC16=m 1981CONFIG_CRC16=y
1601# CONFIG_CRC_ITU_T is not set 1982# CONFIG_CRC_T10DIF is not set
1983CONFIG_CRC_ITU_T=y
1602CONFIG_CRC32=y 1984CONFIG_CRC32=y
1603# CONFIG_CRC7 is not set 1985CONFIG_CRC7=y
1604CONFIG_LIBCRC32C=m 1986CONFIG_LIBCRC32C=m
1605CONFIG_ZLIB_INFLATE=m 1987CONFIG_ZLIB_INFLATE=y
1606CONFIG_ZLIB_DEFLATE=m 1988CONFIG_ZLIB_DEFLATE=m
1989CONFIG_LZO_COMPRESS=m
1990CONFIG_LZO_DECOMPRESS=m
1991CONFIG_DECOMPRESS_GZIP=y
1992CONFIG_DECOMPRESS_BZIP2=y
1993CONFIG_DECOMPRESS_LZMA=y
1607CONFIG_TEXTSEARCH=y 1994CONFIG_TEXTSEARCH=y
1608CONFIG_TEXTSEARCH_KMP=m 1995CONFIG_TEXTSEARCH_KMP=m
1609CONFIG_TEXTSEARCH_BM=m 1996CONFIG_TEXTSEARCH_BM=m
1610CONFIG_TEXTSEARCH_FSM=m 1997CONFIG_TEXTSEARCH_FSM=m
1611CONFIG_PLIST=y
1612CONFIG_HAS_IOMEM=y 1998CONFIG_HAS_IOMEM=y
1613CONFIG_HAS_IOPORT=y 1999CONFIG_HAS_IOPORT=y
1614CONFIG_HAS_DMA=y 2000CONFIG_HAS_DMA=y
2001CONFIG_NLATTR=y
diff --git a/arch/arm/configs/h3600_defconfig b/arch/arm/configs/h3600_defconfig
index f6aed7747d4d..efa78e144e5c 100644
--- a/arch/arm/configs/h3600_defconfig
+++ b/arch/arm/configs/h3600_defconfig
@@ -1,86 +1,189 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc4 3# Linux kernel version: 2.6.32-rc5
4# Thu Jun 9 01:59:03 2005 4# Sat Oct 24 00:09:30 2009
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_MMU=y 7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_UID16=y 8CONFIG_GENERIC_GPIO=y
9CONFIG_GENERIC_TIME=y
10CONFIG_GENERIC_CLOCKEVENTS=y
11CONFIG_GENERIC_HARDIRQS=y
12CONFIG_STACKTRACE_SUPPORT=y
13CONFIG_HAVE_LATENCYTOP_SUPPORT=y
14CONFIG_LOCKDEP_SUPPORT=y
15CONFIG_TRACE_IRQFLAGS_SUPPORT=y
16CONFIG_HARDIRQS_SW_RESEND=y
17CONFIG_GENERIC_IRQ_PROBE=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y 18CONFIG_RWSEM_GENERIC_SPINLOCK=y
19CONFIG_ARCH_HAS_CPUFREQ=y
20CONFIG_GENERIC_HWEIGHT=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y 21CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y 22CONFIG_ARCH_MTD_XIP=y
23CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
24CONFIG_VECTORS_BASE=0xffff0000
25CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
26CONFIG_CONSTRUCTORS=y
12 27
13# 28#
14# Code maturity level options 29# General setup
15# 30#
16CONFIG_EXPERIMENTAL=y 31CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y 32CONFIG_BROKEN_ON_SMP=y
19CONFIG_INIT_ENV_ARG_LIMIT=32 33CONFIG_INIT_ENV_ARG_LIMIT=32
20
21#
22# General setup
23#
24CONFIG_LOCALVERSION="" 34CONFIG_LOCALVERSION=""
35CONFIG_LOCALVERSION_AUTO=y
25CONFIG_SWAP=y 36CONFIG_SWAP=y
26CONFIG_SYSVIPC=y 37CONFIG_SYSVIPC=y
38CONFIG_SYSVIPC_SYSCTL=y
27# CONFIG_POSIX_MQUEUE is not set 39# CONFIG_POSIX_MQUEUE is not set
28# CONFIG_BSD_PROCESS_ACCT is not set 40# CONFIG_BSD_PROCESS_ACCT is not set
29CONFIG_SYSCTL=y 41# CONFIG_TASKSTATS is not set
30# CONFIG_AUDIT is not set 42# CONFIG_AUDIT is not set
31CONFIG_HOTPLUG=y 43
32CONFIG_KOBJECT_UEVENT=y 44#
45# RCU Subsystem
46#
47CONFIG_TREE_RCU=y
48# CONFIG_TREE_PREEMPT_RCU is not set
49# CONFIG_RCU_TRACE is not set
50CONFIG_RCU_FANOUT=32
51# CONFIG_RCU_FANOUT_EXACT is not set
52# CONFIG_TREE_RCU_TRACE is not set
33# CONFIG_IKCONFIG is not set 53# CONFIG_IKCONFIG is not set
54CONFIG_LOG_BUF_SHIFT=14
55# CONFIG_GROUP_SCHED is not set
56# CONFIG_CGROUPS is not set
57# CONFIG_SYSFS_DEPRECATED_V2 is not set
58# CONFIG_RELAY is not set
59CONFIG_NAMESPACES=y
60# CONFIG_UTS_NS is not set
61# CONFIG_IPC_NS is not set
62# CONFIG_USER_NS is not set
63# CONFIG_PID_NS is not set
64# CONFIG_NET_NS is not set
65CONFIG_BLK_DEV_INITRD=y
66CONFIG_INITRAMFS_SOURCE=""
67CONFIG_RD_GZIP=y
68CONFIG_RD_BZIP2=y
69CONFIG_RD_LZMA=y
70CONFIG_CC_OPTIMIZE_FOR_SIZE=y
71CONFIG_SYSCTL=y
72CONFIG_ANON_INODES=y
34# CONFIG_EMBEDDED is not set 73# CONFIG_EMBEDDED is not set
74CONFIG_UID16=y
75CONFIG_SYSCTL_SYSCALL=y
35CONFIG_KALLSYMS=y 76CONFIG_KALLSYMS=y
36# CONFIG_KALLSYMS_EXTRA_PASS is not set 77# CONFIG_KALLSYMS_EXTRA_PASS is not set
78CONFIG_HOTPLUG=y
37CONFIG_PRINTK=y 79CONFIG_PRINTK=y
38CONFIG_BUG=y 80CONFIG_BUG=y
81CONFIG_ELF_CORE=y
39CONFIG_BASE_FULL=y 82CONFIG_BASE_FULL=y
40CONFIG_FUTEX=y 83CONFIG_FUTEX=y
41CONFIG_EPOLL=y 84CONFIG_EPOLL=y
42CONFIG_CC_OPTIMIZE_FOR_SIZE=y 85CONFIG_SIGNALFD=y
86CONFIG_TIMERFD=y
87CONFIG_EVENTFD=y
43CONFIG_SHMEM=y 88CONFIG_SHMEM=y
44CONFIG_CC_ALIGN_FUNCTIONS=0 89CONFIG_AIO=y
45CONFIG_CC_ALIGN_LABELS=0 90
46CONFIG_CC_ALIGN_LOOPS=0 91#
47CONFIG_CC_ALIGN_JUMPS=0 92# Kernel Performance Events And Counters
48# CONFIG_TINY_SHMEM is not set 93#
49CONFIG_BASE_SMALL=0 94CONFIG_VM_EVENT_COUNTERS=y
95CONFIG_SLUB_DEBUG=y
96CONFIG_COMPAT_BRK=y
97# CONFIG_SLAB is not set
98CONFIG_SLUB=y
99# CONFIG_SLOB is not set
100# CONFIG_PROFILING is not set
101CONFIG_HAVE_OPROFILE=y
102# CONFIG_KPROBES is not set
103CONFIG_HAVE_KPROBES=y
104CONFIG_HAVE_KRETPROBES=y
105CONFIG_HAVE_CLK=y
50 106
51# 107#
52# Loadable module support 108# GCOV-based kernel profiling
53# 109#
110# CONFIG_SLOW_WORK is not set
111CONFIG_HAVE_GENERIC_DMA_COHERENT=y
112CONFIG_SLABINFO=y
113CONFIG_RT_MUTEXES=y
114CONFIG_BASE_SMALL=0
54CONFIG_MODULES=y 115CONFIG_MODULES=y
116# CONFIG_MODULE_FORCE_LOAD is not set
55# CONFIG_MODULE_UNLOAD is not set 117# CONFIG_MODULE_UNLOAD is not set
56CONFIG_OBSOLETE_MODPARM=y
57# CONFIG_MODVERSIONS is not set 118# CONFIG_MODVERSIONS is not set
58# CONFIG_MODULE_SRCVERSION_ALL is not set 119# CONFIG_MODULE_SRCVERSION_ALL is not set
59# CONFIG_KMOD is not set 120CONFIG_BLOCK=y
121# CONFIG_LBDAF is not set
122# CONFIG_BLK_DEV_BSG is not set
123# CONFIG_BLK_DEV_INTEGRITY is not set
124
125#
126# IO Schedulers
127#
128CONFIG_IOSCHED_NOOP=y
129# CONFIG_IOSCHED_AS is not set
130# CONFIG_IOSCHED_DEADLINE is not set
131# CONFIG_IOSCHED_CFQ is not set
132# CONFIG_DEFAULT_AS is not set
133# CONFIG_DEFAULT_DEADLINE is not set
134# CONFIG_DEFAULT_CFQ is not set
135CONFIG_DEFAULT_NOOP=y
136CONFIG_DEFAULT_IOSCHED="noop"
137CONFIG_FREEZER=y
60 138
61# 139#
62# System Type 140# System Type
63# 141#
64# CONFIG_ARCH_CLPS7500 is not set 142CONFIG_MMU=y
143# CONFIG_ARCH_AAEC2000 is not set
144# CONFIG_ARCH_INTEGRATOR is not set
145# CONFIG_ARCH_REALVIEW is not set
146# CONFIG_ARCH_VERSATILE is not set
147# CONFIG_ARCH_AT91 is not set
65# CONFIG_ARCH_CLPS711X is not set 148# CONFIG_ARCH_CLPS711X is not set
66# CONFIG_ARCH_CO285 is not set 149# CONFIG_ARCH_GEMINI is not set
67# CONFIG_ARCH_EBSA110 is not set 150# CONFIG_ARCH_EBSA110 is not set
151# CONFIG_ARCH_EP93XX is not set
68# CONFIG_ARCH_FOOTBRIDGE is not set 152# CONFIG_ARCH_FOOTBRIDGE is not set
69# CONFIG_ARCH_INTEGRATOR is not set 153# CONFIG_ARCH_MXC is not set
70# CONFIG_ARCH_IOP3XX is not set 154# CONFIG_ARCH_STMP3XXX is not set
71# CONFIG_ARCH_IXP4XX is not set 155# CONFIG_ARCH_NETX is not set
156# CONFIG_ARCH_H720X is not set
157# CONFIG_ARCH_NOMADIK is not set
158# CONFIG_ARCH_IOP13XX is not set
159# CONFIG_ARCH_IOP32X is not set
160# CONFIG_ARCH_IOP33X is not set
161# CONFIG_ARCH_IXP23XX is not set
72# CONFIG_ARCH_IXP2000 is not set 162# CONFIG_ARCH_IXP2000 is not set
163# CONFIG_ARCH_IXP4XX is not set
73# CONFIG_ARCH_L7200 is not set 164# CONFIG_ARCH_L7200 is not set
165# CONFIG_ARCH_KIRKWOOD is not set
166# CONFIG_ARCH_LOKI is not set
167# CONFIG_ARCH_MV78XX0 is not set
168# CONFIG_ARCH_ORION5X is not set
169# CONFIG_ARCH_MMP is not set
170# CONFIG_ARCH_KS8695 is not set
171# CONFIG_ARCH_NS9XXX is not set
172# CONFIG_ARCH_W90X900 is not set
173# CONFIG_ARCH_PNX4008 is not set
74# CONFIG_ARCH_PXA is not set 174# CONFIG_ARCH_PXA is not set
175# CONFIG_ARCH_MSM is not set
75# CONFIG_ARCH_RPC is not set 176# CONFIG_ARCH_RPC is not set
76CONFIG_ARCH_SA1100=y 177CONFIG_ARCH_SA1100=y
77# CONFIG_ARCH_S3C2410 is not set 178# CONFIG_ARCH_S3C2410 is not set
179# CONFIG_ARCH_S3C64XX is not set
180# CONFIG_ARCH_S5PC1XX is not set
78# CONFIG_ARCH_SHARK is not set 181# CONFIG_ARCH_SHARK is not set
79# CONFIG_ARCH_LH7A40X is not set 182# CONFIG_ARCH_LH7A40X is not set
183# CONFIG_ARCH_U300 is not set
184# CONFIG_ARCH_DAVINCI is not set
80# CONFIG_ARCH_OMAP is not set 185# CONFIG_ARCH_OMAP is not set
81# CONFIG_ARCH_VERSATILE is not set 186# CONFIG_ARCH_BCMRING is not set
82# CONFIG_ARCH_IMX is not set
83# CONFIG_ARCH_H720X is not set
84 187
85# 188#
86# SA11x0 Implementations 189# SA11x0 Implementations
@@ -106,27 +209,31 @@ CONFIG_CPU_32=y
106CONFIG_CPU_SA1100=y 209CONFIG_CPU_SA1100=y
107CONFIG_CPU_32v4=y 210CONFIG_CPU_32v4=y
108CONFIG_CPU_ABRT_EV4=y 211CONFIG_CPU_ABRT_EV4=y
212CONFIG_CPU_PABRT_LEGACY=y
109CONFIG_CPU_CACHE_V4WB=y 213CONFIG_CPU_CACHE_V4WB=y
110CONFIG_CPU_CACHE_VIVT=y 214CONFIG_CPU_CACHE_VIVT=y
111CONFIG_CPU_TLB_V4WB=y 215CONFIG_CPU_TLB_V4WB=y
112CONFIG_CPU_MINICACHE=y 216CONFIG_CPU_CP15=y
217CONFIG_CPU_CP15_MMU=y
113 218
114# 219#
115# Processor Features 220# Processor Features
116# 221#
222# CONFIG_CPU_ICACHE_DISABLE is not set
223# CONFIG_CPU_DCACHE_DISABLE is not set
224CONFIG_ARM_L1_CACHE_SHIFT=5
117 225
118# 226#
119# Bus support 227# Bus support
120# 228#
121CONFIG_ISA=y 229CONFIG_ISA=y
122CONFIG_ISA_DMA_API=y 230# CONFIG_PCI_SYSCALL is not set
123 231# CONFIG_ARCH_SUPPORTS_MSI is not set
124#
125# PCCARD (PCMCIA/CardBus) support
126#
127CONFIG_PCCARD=y 232CONFIG_PCCARD=y
128# CONFIG_PCMCIA_DEBUG is not set 233# CONFIG_PCMCIA_DEBUG is not set
129CONFIG_PCMCIA=y 234CONFIG_PCMCIA=y
235CONFIG_PCMCIA_LOAD_CIS=y
236CONFIG_PCMCIA_IOCTL=y
130 237
131# 238#
132# PC-card bridges 239# PC-card bridges
@@ -138,11 +245,41 @@ CONFIG_PCMCIA_SA1100=y
138# 245#
139# Kernel Features 246# Kernel Features
140# 247#
141# CONFIG_SMP is not set 248CONFIG_TICK_ONESHOT=y
249# CONFIG_NO_HZ is not set
250# CONFIG_HIGH_RES_TIMERS is not set
251CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
252CONFIG_VMSPLIT_3G=y
253# CONFIG_VMSPLIT_2G is not set
254# CONFIG_VMSPLIT_1G is not set
255CONFIG_PAGE_OFFSET=0xC0000000
256CONFIG_PREEMPT_NONE=y
257# CONFIG_PREEMPT_VOLUNTARY is not set
142# CONFIG_PREEMPT is not set 258# CONFIG_PREEMPT is not set
143CONFIG_DISCONTIGMEM=y 259CONFIG_HZ=100
260# CONFIG_AEABI is not set
261CONFIG_ARCH_SPARSEMEM_ENABLE=y
262CONFIG_ARCH_SPARSEMEM_DEFAULT=y
263# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
264# CONFIG_HIGHMEM is not set
265CONFIG_SELECT_MEMORY_MODEL=y
266# CONFIG_FLATMEM_MANUAL is not set
267# CONFIG_DISCONTIGMEM_MANUAL is not set
268CONFIG_SPARSEMEM_MANUAL=y
269CONFIG_SPARSEMEM=y
270CONFIG_HAVE_MEMORY_PRESENT=y
271CONFIG_SPARSEMEM_EXTREME=y
272CONFIG_SPLIT_PTLOCK_CPUS=4096
273# CONFIG_PHYS_ADDR_T_64BIT is not set
274CONFIG_ZONE_DMA_FLAG=0
275CONFIG_VIRT_TO_BUS=y
276CONFIG_HAVE_MLOCK=y
277CONFIG_HAVE_MLOCKED_PAGE_BIT=y
278# CONFIG_KSM is not set
279CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
144# CONFIG_LEDS is not set 280# CONFIG_LEDS is not set
145CONFIG_ALIGNMENT_TRAP=y 281CONFIG_ALIGNMENT_TRAP=y
282# CONFIG_UACCESS_WITH_MEMCPY is not set
146 283
147# 284#
148# Boot options 285# Boot options
@@ -151,22 +288,26 @@ CONFIG_ZBOOT_ROM_TEXT=0x0
151CONFIG_ZBOOT_ROM_BSS=0x0 288CONFIG_ZBOOT_ROM_BSS=0x0
152CONFIG_CMDLINE="" 289CONFIG_CMDLINE=""
153# CONFIG_XIP_KERNEL is not set 290# CONFIG_XIP_KERNEL is not set
291# CONFIG_KEXEC is not set
154 292
155# 293#
156# CPU Frequency scaling 294# CPU Power Management
157# 295#
158CONFIG_CPU_FREQ=y 296CONFIG_CPU_FREQ=y
159CONFIG_CPU_FREQ_TABLE=y
160# CONFIG_CPU_FREQ_DEBUG is not set 297# CONFIG_CPU_FREQ_DEBUG is not set
161CONFIG_CPU_FREQ_STAT=y 298# CONFIG_CPU_FREQ_STAT is not set
162# CONFIG_CPU_FREQ_STAT_DETAILS is not set
163# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set 299# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
300# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
164CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y 301CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
302# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
303# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
165# CONFIG_CPU_FREQ_GOV_PERFORMANCE is not set 304# CONFIG_CPU_FREQ_GOV_PERFORMANCE is not set
166# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set 305# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
167CONFIG_CPU_FREQ_GOV_USERSPACE=y 306CONFIG_CPU_FREQ_GOV_USERSPACE=y
168# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set 307# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set
308# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
169CONFIG_CPU_FREQ_SA1100=y 309CONFIG_CPU_FREQ_SA1100=y
310# CONFIG_CPU_IDLE is not set
170 311
171# 312#
172# Floating point emulation 313# Floating point emulation
@@ -183,6 +324,8 @@ CONFIG_FPE_NWFPE=y
183# Userspace binary formats 324# Userspace binary formats
184# 325#
185CONFIG_BINFMT_ELF=y 326CONFIG_BINFMT_ELF=y
327# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
328CONFIG_HAVE_AOUT=y
186# CONFIG_BINFMT_AOUT is not set 329# CONFIG_BINFMT_AOUT is not set
187# CONFIG_BINFMT_MISC is not set 330# CONFIG_BINFMT_MISC is not set
188# CONFIG_ARTHUR is not set 331# CONFIG_ARTHUR is not set
@@ -191,8 +334,120 @@ CONFIG_BINFMT_ELF=y
191# Power management options 334# Power management options
192# 335#
193CONFIG_PM=y 336CONFIG_PM=y
194# CONFIG_PM_LEGACY is not set 337# CONFIG_PM_DEBUG is not set
195# CONFIG_APM is not set 338CONFIG_PM_SLEEP=y
339CONFIG_SUSPEND=y
340CONFIG_SUSPEND_FREEZER=y
341# CONFIG_APM_EMULATION is not set
342# CONFIG_PM_RUNTIME is not set
343CONFIG_ARCH_SUSPEND_POSSIBLE=y
344CONFIG_NET=y
345
346#
347# Networking options
348#
349# CONFIG_PACKET is not set
350CONFIG_UNIX=y
351CONFIG_XFRM=y
352# CONFIG_XFRM_USER is not set
353# CONFIG_XFRM_SUB_POLICY is not set
354# CONFIG_XFRM_MIGRATE is not set
355# CONFIG_XFRM_STATISTICS is not set
356# CONFIG_NET_KEY is not set
357CONFIG_INET=y
358# CONFIG_IP_MULTICAST is not set
359# CONFIG_IP_ADVANCED_ROUTER is not set
360CONFIG_IP_FIB_HASH=y
361# CONFIG_IP_PNP is not set
362# CONFIG_NET_IPIP is not set
363# CONFIG_NET_IPGRE is not set
364# CONFIG_ARPD is not set
365# CONFIG_SYN_COOKIES is not set
366# CONFIG_INET_AH is not set
367# CONFIG_INET_ESP is not set
368# CONFIG_INET_IPCOMP is not set
369# CONFIG_INET_XFRM_TUNNEL is not set
370# CONFIG_INET_TUNNEL is not set
371CONFIG_INET_XFRM_MODE_TRANSPORT=y
372CONFIG_INET_XFRM_MODE_TUNNEL=y
373CONFIG_INET_XFRM_MODE_BEET=y
374CONFIG_INET_LRO=y
375CONFIG_INET_DIAG=y
376CONFIG_INET_TCP_DIAG=y
377# CONFIG_TCP_CONG_ADVANCED is not set
378CONFIG_TCP_CONG_CUBIC=y
379CONFIG_DEFAULT_TCP_CONG="cubic"
380# CONFIG_TCP_MD5SIG is not set
381# CONFIG_IPV6 is not set
382# CONFIG_NETWORK_SECMARK is not set
383# CONFIG_NETFILTER is not set
384# CONFIG_IP_DCCP is not set
385# CONFIG_IP_SCTP is not set
386# CONFIG_RDS is not set
387# CONFIG_TIPC is not set
388# CONFIG_ATM is not set
389# CONFIG_BRIDGE is not set
390# CONFIG_NET_DSA is not set
391# CONFIG_VLAN_8021Q is not set
392# CONFIG_DECNET is not set
393# CONFIG_LLC2 is not set
394# CONFIG_IPX is not set
395# CONFIG_ATALK is not set
396# CONFIG_X25 is not set
397# CONFIG_LAPB is not set
398# CONFIG_ECONET is not set
399# CONFIG_WAN_ROUTER is not set
400# CONFIG_PHONET is not set
401# CONFIG_IEEE802154 is not set
402# CONFIG_NET_SCHED is not set
403# CONFIG_DCB is not set
404
405#
406# Network testing
407#
408# CONFIG_NET_PKTGEN is not set
409# CONFIG_HAMRADIO is not set
410# CONFIG_CAN is not set
411CONFIG_IRDA=m
412
413#
414# IrDA protocols
415#
416CONFIG_IRLAN=m
417CONFIG_IRNET=m
418CONFIG_IRCOMM=m
419# CONFIG_IRDA_ULTRA is not set
420
421#
422# IrDA options
423#
424# CONFIG_IRDA_CACHE_LAST_LSAP is not set
425# CONFIG_IRDA_FAST_RR is not set
426# CONFIG_IRDA_DEBUG is not set
427
428#
429# Infrared-port device drivers
430#
431
432#
433# SIR device drivers
434#
435# CONFIG_IRTTY_SIR is not set
436
437#
438# Dongle support
439#
440
441#
442# FIR device drivers
443#
444CONFIG_SA1100_FIR=m
445# CONFIG_BT is not set
446# CONFIG_AF_RXRPC is not set
447# CONFIG_WIRELESS is not set
448# CONFIG_WIMAX is not set
449# CONFIG_RFKILL is not set
450# CONFIG_NET_9P is not set
196 451
197# 452#
198# Device Drivers 453# Device Drivers
@@ -201,15 +456,17 @@ CONFIG_PM=y
201# 456#
202# Generic Driver Options 457# Generic Driver Options
203# 458#
459CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
204CONFIG_STANDALONE=y 460CONFIG_STANDALONE=y
205CONFIG_PREVENT_FIRMWARE_BUILD=y 461CONFIG_PREVENT_FIRMWARE_BUILD=y
206# CONFIG_FW_LOADER is not set 462CONFIG_FW_LOADER=y
207 463CONFIG_FIRMWARE_IN_KERNEL=y
208# 464CONFIG_EXTRA_FIRMWARE=""
209# Memory Technology Devices (MTD) 465# CONFIG_SYS_HYPERVISOR is not set
210# 466# CONFIG_CONNECTOR is not set
211CONFIG_MTD=y 467CONFIG_MTD=y
212# CONFIG_MTD_DEBUG is not set 468# CONFIG_MTD_DEBUG is not set
469# CONFIG_MTD_TESTS is not set
213# CONFIG_MTD_CONCAT is not set 470# CONFIG_MTD_CONCAT is not set
214CONFIG_MTD_PARTITIONS=y 471CONFIG_MTD_PARTITIONS=y
215CONFIG_MTD_REDBOOT_PARTS=y 472CONFIG_MTD_REDBOOT_PARTS=y
@@ -218,15 +475,20 @@ CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
218# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set 475# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set
219# CONFIG_MTD_CMDLINE_PARTS is not set 476# CONFIG_MTD_CMDLINE_PARTS is not set
220# CONFIG_MTD_AFS_PARTS is not set 477# CONFIG_MTD_AFS_PARTS is not set
478# CONFIG_MTD_AR7_PARTS is not set
221 479
222# 480#
223# User Modules And Translation Layers 481# User Modules And Translation Layers
224# 482#
225CONFIG_MTD_CHAR=y 483CONFIG_MTD_CHAR=y
484CONFIG_MTD_BLKDEVS=y
226CONFIG_MTD_BLOCK=y 485CONFIG_MTD_BLOCK=y
227# CONFIG_FTL is not set 486# CONFIG_FTL is not set
228# CONFIG_NFTL is not set 487# CONFIG_NFTL is not set
229# CONFIG_INFTL is not set 488# CONFIG_INFTL is not set
489# CONFIG_RFD_FTL is not set
490# CONFIG_SSFDC is not set
491# CONFIG_MTD_OOPS is not set
230 492
231# 493#
232# RAM/ROM/Flash chip drivers 494# RAM/ROM/Flash chip drivers
@@ -249,6 +511,7 @@ CONFIG_MTD_MAP_BANK_WIDTH_4=y
249CONFIG_MTD_CFI_I2=y 511CONFIG_MTD_CFI_I2=y
250# CONFIG_MTD_CFI_I4 is not set 512# CONFIG_MTD_CFI_I4 is not set
251# CONFIG_MTD_CFI_I8 is not set 513# CONFIG_MTD_CFI_I8 is not set
514# CONFIG_MTD_OTP is not set
252CONFIG_MTD_CFI_INTELEXT=y 515CONFIG_MTD_CFI_INTELEXT=y
253# CONFIG_MTD_CFI_AMDSTD is not set 516# CONFIG_MTD_CFI_AMDSTD is not set
254# CONFIG_MTD_CFI_STAA is not set 517# CONFIG_MTD_CFI_STAA is not set
@@ -265,7 +528,7 @@ CONFIG_MTD_CFI_UTIL=y
265# CONFIG_MTD_PHYSMAP is not set 528# CONFIG_MTD_PHYSMAP is not set
266# CONFIG_MTD_ARM_INTEGRATOR is not set 529# CONFIG_MTD_ARM_INTEGRATOR is not set
267CONFIG_MTD_SA1100=y 530CONFIG_MTD_SA1100=y
268# CONFIG_MTD_EDB7312 is not set 531# CONFIG_MTD_PLATRAM is not set
269 532
270# 533#
271# Self-contained MTD device drivers 534# Self-contained MTD device drivers
@@ -273,7 +536,6 @@ CONFIG_MTD_SA1100=y
273# CONFIG_MTD_SLRAM is not set 536# CONFIG_MTD_SLRAM is not set
274# CONFIG_MTD_PHRAM is not set 537# CONFIG_MTD_PHRAM is not set
275# CONFIG_MTD_MTDRAM is not set 538# CONFIG_MTD_MTDRAM is not set
276# CONFIG_MTD_BLKMTD is not set
277# CONFIG_MTD_BLOCK2MTD is not set 539# CONFIG_MTD_BLOCK2MTD is not set
278 540
279# 541#
@@ -282,26 +544,21 @@ CONFIG_MTD_SA1100=y
282# CONFIG_MTD_DOC2000 is not set 544# CONFIG_MTD_DOC2000 is not set
283# CONFIG_MTD_DOC2001 is not set 545# CONFIG_MTD_DOC2001 is not set
284# CONFIG_MTD_DOC2001PLUS is not set 546# CONFIG_MTD_DOC2001PLUS is not set
285
286#
287# NAND Flash Device Drivers
288#
289# CONFIG_MTD_NAND is not set 547# CONFIG_MTD_NAND is not set
548# CONFIG_MTD_ONENAND is not set
290 549
291# 550#
292# Parallel port support 551# LPDDR flash memory drivers
293# 552#
294# CONFIG_PARPORT is not set 553# CONFIG_MTD_LPDDR is not set
295 554
296# 555#
297# Plug and Play support 556# UBI - Unsorted block images
298# 557#
558# CONFIG_MTD_UBI is not set
559# CONFIG_PARPORT is not set
299# CONFIG_PNP is not set 560# CONFIG_PNP is not set
300 561CONFIG_BLK_DEV=y
301#
302# Block devices
303#
304# CONFIG_BLK_DEV_XD is not set
305# CONFIG_BLK_DEV_COW_COMMON is not set 562# CONFIG_BLK_DEV_COW_COMMON is not set
306CONFIG_BLK_DEV_LOOP=m 563CONFIG_BLK_DEV_LOOP=m
307# CONFIG_BLK_DEV_CRYPTOLOOP is not set 564# CONFIG_BLK_DEV_CRYPTOLOOP is not set
@@ -309,212 +566,58 @@ CONFIG_BLK_DEV_LOOP=m
309CONFIG_BLK_DEV_RAM=y 566CONFIG_BLK_DEV_RAM=y
310CONFIG_BLK_DEV_RAM_COUNT=16 567CONFIG_BLK_DEV_RAM_COUNT=16
311CONFIG_BLK_DEV_RAM_SIZE=8192 568CONFIG_BLK_DEV_RAM_SIZE=8192
312CONFIG_BLK_DEV_INITRD=y 569# CONFIG_BLK_DEV_XIP is not set
313CONFIG_INITRAMFS_SOURCE=""
314# CONFIG_CDROM_PKTCDVD is not set 570# CONFIG_CDROM_PKTCDVD is not set
315
316#
317# IO Schedulers
318#
319CONFIG_IOSCHED_NOOP=y
320CONFIG_IOSCHED_AS=y
321CONFIG_IOSCHED_DEADLINE=y
322CONFIG_IOSCHED_CFQ=y
323# CONFIG_ATA_OVER_ETH is not set 571# CONFIG_ATA_OVER_ETH is not set
572# CONFIG_MG_DISK is not set
573# CONFIG_MISC_DEVICES is not set
574CONFIG_HAVE_IDE=y
575CONFIG_IDE=y
324 576
325# 577#
326# ATA/ATAPI/MFM/RLL support 578# Please see Documentation/ide/ide.txt for help/info on IDE drives
327#
328CONFIG_IDE=m
329CONFIG_BLK_DEV_IDE=m
330
331#
332# Please see Documentation/ide.txt for help/info on IDE drives
333# 579#
334# CONFIG_BLK_DEV_IDE_SATA is not set 580# CONFIG_BLK_DEV_IDE_SATA is not set
335CONFIG_BLK_DEV_IDEDISK=m 581CONFIG_IDE_GD=y
336# CONFIG_IDEDISK_MULTI_MODE is not set 582CONFIG_IDE_GD_ATA=y
337# CONFIG_BLK_DEV_IDECS is not set 583# CONFIG_IDE_GD_ATAPI is not set
338CONFIG_BLK_DEV_IDECD=m 584CONFIG_BLK_DEV_IDECS=y
585# CONFIG_BLK_DEV_IDECD is not set
339# CONFIG_BLK_DEV_IDETAPE is not set 586# CONFIG_BLK_DEV_IDETAPE is not set
340# CONFIG_BLK_DEV_IDEFLOPPY is not set
341# CONFIG_IDE_TASK_IOCTL is not set 587# CONFIG_IDE_TASK_IOCTL is not set
588CONFIG_IDE_PROC_FS=y
342 589
343# 590#
344# IDE chipset support/bugfixes 591# IDE chipset support/bugfixes
345# 592#
346CONFIG_IDE_GENERIC=m 593# CONFIG_BLK_DEV_PLATFORM is not set
347# CONFIG_IDE_ARM is not set
348# CONFIG_IDE_CHIPSETS is not set
349# CONFIG_BLK_DEV_IDEDMA is not set 594# CONFIG_BLK_DEV_IDEDMA is not set
350# CONFIG_IDEDMA_AUTO is not set
351# CONFIG_BLK_DEV_HD is not set
352 595
353# 596#
354# SCSI device support 597# SCSI device support
355# 598#
599# CONFIG_RAID_ATTRS is not set
356# CONFIG_SCSI is not set 600# CONFIG_SCSI is not set
357 601# CONFIG_SCSI_DMA is not set
358# 602# CONFIG_SCSI_NETLINK is not set
359# Multi-device support (RAID and LVM) 603# CONFIG_ATA is not set
360#
361# CONFIG_MD is not set 604# CONFIG_MD is not set
362
363#
364# Fusion MPT device support
365#
366
367#
368# IEEE 1394 (FireWire) support
369#
370
371#
372# I2O device support
373#
374
375#
376# Networking support
377#
378CONFIG_NET=y
379
380#
381# Networking options
382#
383# CONFIG_PACKET is not set
384CONFIG_UNIX=y
385# CONFIG_NET_KEY is not set
386CONFIG_INET=y
387# CONFIG_IP_MULTICAST is not set
388# CONFIG_IP_ADVANCED_ROUTER is not set
389# CONFIG_IP_PNP is not set
390# CONFIG_NET_IPIP is not set
391# CONFIG_NET_IPGRE is not set
392# CONFIG_ARPD is not set
393# CONFIG_SYN_COOKIES is not set
394# CONFIG_INET_AH is not set
395# CONFIG_INET_ESP is not set
396# CONFIG_INET_IPCOMP is not set
397# CONFIG_INET_TUNNEL is not set
398# CONFIG_IP_TCPDIAG is not set
399# CONFIG_IP_TCPDIAG_IPV6 is not set
400# CONFIG_IPV6 is not set
401# CONFIG_NETFILTER is not set
402
403#
404# SCTP Configuration (EXPERIMENTAL)
405#
406# CONFIG_IP_SCTP is not set
407# CONFIG_ATM is not set
408# CONFIG_BRIDGE is not set
409# CONFIG_VLAN_8021Q is not set
410# CONFIG_DECNET is not set
411# CONFIG_LLC2 is not set
412# CONFIG_IPX is not set
413# CONFIG_ATALK is not set
414# CONFIG_X25 is not set
415# CONFIG_LAPB is not set
416# CONFIG_NET_DIVERT is not set
417# CONFIG_ECONET is not set
418# CONFIG_WAN_ROUTER is not set
419
420#
421# QoS and/or fair queueing
422#
423# CONFIG_NET_SCHED is not set
424# CONFIG_NET_CLS_ROUTE is not set
425
426#
427# Network testing
428#
429# CONFIG_NET_PKTGEN is not set
430# CONFIG_NETPOLL is not set
431# CONFIG_NET_POLL_CONTROLLER is not set
432# CONFIG_HAMRADIO is not set
433CONFIG_IRDA=m
434
435#
436# IrDA protocols
437#
438CONFIG_IRLAN=m
439CONFIG_IRNET=m
440CONFIG_IRCOMM=m
441# CONFIG_IRDA_ULTRA is not set
442
443#
444# IrDA options
445#
446# CONFIG_IRDA_CACHE_LAST_LSAP is not set
447# CONFIG_IRDA_FAST_RR is not set
448# CONFIG_IRDA_DEBUG is not set
449
450#
451# Infrared-port device drivers
452#
453
454#
455# SIR device drivers
456#
457# CONFIG_IRTTY_SIR is not set
458
459#
460# Dongle support
461#
462
463#
464# Old SIR device drivers
465#
466# CONFIG_IRPORT_SIR is not set
467
468#
469# Old Serial dongle support
470#
471
472#
473# FIR device drivers
474#
475# CONFIG_NSC_FIR is not set
476# CONFIG_WINBOND_FIR is not set
477# CONFIG_SMC_IRCC_FIR is not set
478# CONFIG_ALI_FIR is not set
479CONFIG_SA1100_FIR=m
480# CONFIG_VIA_FIR is not set
481# CONFIG_BT is not set
482CONFIG_NETDEVICES=y 605CONFIG_NETDEVICES=y
483# CONFIG_DUMMY is not set 606# CONFIG_DUMMY is not set
484# CONFIG_BONDING is not set 607# CONFIG_BONDING is not set
608# CONFIG_MACVLAN is not set
485# CONFIG_EQUALIZER is not set 609# CONFIG_EQUALIZER is not set
486# CONFIG_TUN is not set 610# CONFIG_TUN is not set
487 611# CONFIG_VETH is not set
488#
489# ARCnet devices
490#
491# CONFIG_ARCNET is not set 612# CONFIG_ARCNET is not set
492
493#
494# Ethernet (10 or 100Mbit)
495#
496# CONFIG_NET_ETHERNET is not set 613# CONFIG_NET_ETHERNET is not set
497 614# CONFIG_NETDEV_1000 is not set
498# 615# CONFIG_NETDEV_10000 is not set
499# Ethernet (1000 Mbit)
500#
501
502#
503# Ethernet (10000 Mbit)
504#
505
506#
507# Token Ring devices
508#
509# CONFIG_TR is not set 616# CONFIG_TR is not set
617# CONFIG_WLAN is not set
510 618
511# 619#
512# Wireless LAN (non-hamradio) 620# Enable WiMAX (Networking options) to see the WiMAX drivers
513#
514# CONFIG_NET_RADIO is not set
515
516#
517# PCMCIA network device support
518# 621#
519CONFIG_NET_PCMCIA=y 622CONFIG_NET_PCMCIA=y
520# CONFIG_PCMCIA_3C589 is not set 623# CONFIG_PCMCIA_3C589 is not set
@@ -525,10 +628,6 @@ CONFIG_PCMCIA_PCNET=y
525# CONFIG_PCMCIA_SMC91C92 is not set 628# CONFIG_PCMCIA_SMC91C92 is not set
526# CONFIG_PCMCIA_XIRC2PS is not set 629# CONFIG_PCMCIA_XIRC2PS is not set
527# CONFIG_PCMCIA_AXNET is not set 630# CONFIG_PCMCIA_AXNET is not set
528
529#
530# Wan interfaces
531#
532# CONFIG_WAN is not set 631# CONFIG_WAN is not set
533CONFIG_PPP=m 632CONFIG_PPP=m
534# CONFIG_PPP_MULTILINK is not set 633# CONFIG_PPP_MULTILINK is not set
@@ -537,20 +636,23 @@ CONFIG_PPP_ASYNC=m
537# CONFIG_PPP_SYNC_TTY is not set 636# CONFIG_PPP_SYNC_TTY is not set
538CONFIG_PPP_DEFLATE=m 637CONFIG_PPP_DEFLATE=m
539CONFIG_PPP_BSDCOMP=m 638CONFIG_PPP_BSDCOMP=m
639# CONFIG_PPP_MPPE is not set
540# CONFIG_PPPOE is not set 640# CONFIG_PPPOE is not set
641# CONFIG_PPPOL2TP is not set
541# CONFIG_SLIP is not set 642# CONFIG_SLIP is not set
542# CONFIG_SHAPER is not set 643CONFIG_SLHC=m
543# CONFIG_NETCONSOLE is not set 644# CONFIG_NETCONSOLE is not set
544 645# CONFIG_NETPOLL is not set
545# 646# CONFIG_NET_POLL_CONTROLLER is not set
546# ISDN subsystem
547#
548# CONFIG_ISDN is not set 647# CONFIG_ISDN is not set
648# CONFIG_PHONE is not set
549 649
550# 650#
551# Input device support 651# Input device support
552# 652#
553CONFIG_INPUT=y 653CONFIG_INPUT=y
654# CONFIG_INPUT_FF_MEMLESS is not set
655# CONFIG_INPUT_POLLDEV is not set
554 656
555# 657#
556# Userland interfaces 658# Userland interfaces
@@ -560,7 +662,6 @@ CONFIG_INPUT_MOUSEDEV_PSAUX=y
560CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 662CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
561CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 663CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
562# CONFIG_INPUT_JOYDEV is not set 664# CONFIG_INPUT_JOYDEV is not set
563# CONFIG_INPUT_TSDEV is not set
564# CONFIG_INPUT_EVDEV is not set 665# CONFIG_INPUT_EVDEV is not set
565# CONFIG_INPUT_EVBUG is not set 666# CONFIG_INPUT_EVBUG is not set
566 667
@@ -568,47 +669,42 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
568# Input Device Drivers 669# Input Device Drivers
569# 670#
570CONFIG_INPUT_KEYBOARD=y 671CONFIG_INPUT_KEYBOARD=y
571CONFIG_KEYBOARD_ATKBD=y 672# CONFIG_KEYBOARD_ATKBD is not set
572# CONFIG_KEYBOARD_SUNKBD is not set
573# CONFIG_KEYBOARD_LKKBD is not set 673# CONFIG_KEYBOARD_LKKBD is not set
574# CONFIG_KEYBOARD_XTKBD is not set 674CONFIG_KEYBOARD_GPIO=y
675# CONFIG_KEYBOARD_MATRIX is not set
575# CONFIG_KEYBOARD_NEWTON is not set 676# CONFIG_KEYBOARD_NEWTON is not set
576CONFIG_INPUT_MOUSE=y 677# CONFIG_KEYBOARD_OPENCORES is not set
577CONFIG_MOUSE_PS2=y 678# CONFIG_KEYBOARD_STOWAWAY is not set
578# CONFIG_MOUSE_SERIAL is not set 679# CONFIG_KEYBOARD_SUNKBD is not set
579# CONFIG_MOUSE_INPORT is not set 680# CONFIG_KEYBOARD_XTKBD is not set
580# CONFIG_MOUSE_LOGIBM is not set 681# CONFIG_INPUT_MOUSE is not set
581# CONFIG_MOUSE_PC110PAD is not set
582# CONFIG_MOUSE_VSXXXAA is not set
583# CONFIG_INPUT_JOYSTICK is not set 682# CONFIG_INPUT_JOYSTICK is not set
683# CONFIG_INPUT_TABLET is not set
584# CONFIG_INPUT_TOUCHSCREEN is not set 684# CONFIG_INPUT_TOUCHSCREEN is not set
585# CONFIG_INPUT_MISC is not set 685# CONFIG_INPUT_MISC is not set
586 686
587# 687#
588# Hardware I/O ports 688# Hardware I/O ports
589# 689#
590CONFIG_SERIO=y 690# CONFIG_SERIO is not set
591CONFIG_SERIO_SERPORT=y
592CONFIG_SERIO_LIBPS2=y
593# CONFIG_SERIO_RAW is not set
594# CONFIG_GAMEPORT is not set 691# CONFIG_GAMEPORT is not set
595CONFIG_SOUND_GAMEPORT=y
596 692
597# 693#
598# Character devices 694# Character devices
599# 695#
600CONFIG_VT=y 696CONFIG_VT=y
697CONFIG_CONSOLE_TRANSLATIONS=y
601CONFIG_VT_CONSOLE=y 698CONFIG_VT_CONSOLE=y
602CONFIG_HW_CONSOLE=y 699CONFIG_HW_CONSOLE=y
700# CONFIG_VT_HW_CONSOLE_BINDING is not set
701CONFIG_DEVKMEM=y
603# CONFIG_SERIAL_NONSTANDARD is not set 702# CONFIG_SERIAL_NONSTANDARD is not set
604 703
605# 704#
606# Serial drivers 705# Serial drivers
607# 706#
608CONFIG_SERIAL_8250=m 707# CONFIG_SERIAL_8250 is not set
609# CONFIG_SERIAL_8250_CS is not set
610CONFIG_SERIAL_8250_NR_UARTS=4
611# CONFIG_SERIAL_8250_EXTENDED is not set
612 708
613# 709#
614# Non-8250 serial port support 710# Non-8250 serial port support
@@ -618,71 +714,125 @@ CONFIG_SERIAL_SA1100_CONSOLE=y
618CONFIG_SERIAL_CORE=y 714CONFIG_SERIAL_CORE=y
619CONFIG_SERIAL_CORE_CONSOLE=y 715CONFIG_SERIAL_CORE_CONSOLE=y
620CONFIG_UNIX98_PTYS=y 716CONFIG_UNIX98_PTYS=y
717# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
621CONFIG_LEGACY_PTYS=y 718CONFIG_LEGACY_PTYS=y
622CONFIG_LEGACY_PTY_COUNT=256 719CONFIG_LEGACY_PTY_COUNT=256
720# CONFIG_IPMI_HANDLER is not set
721# CONFIG_HW_RANDOM is not set
722# CONFIG_DTLK is not set
723# CONFIG_R3964 is not set
623 724
624# 725#
625# IPMI 726# PCMCIA character devices
626# 727#
627# CONFIG_IPMI_HANDLER is not set 728# CONFIG_SYNCLINK_CS is not set
729# CONFIG_CARDMAN_4000 is not set
730# CONFIG_CARDMAN_4040 is not set
731# CONFIG_IPWIRELESS is not set
732# CONFIG_RAW_DRIVER is not set
733# CONFIG_TCG_TPM is not set
734CONFIG_DEVPORT=y
735# CONFIG_I2C is not set
736# CONFIG_SPI is not set
628 737
629# 738#
630# Watchdog Cards 739# PPS support
631# 740#
632# CONFIG_WATCHDOG is not set 741# CONFIG_PPS is not set
633# CONFIG_NVRAM is not set 742CONFIG_ARCH_REQUIRE_GPIOLIB=y
634# CONFIG_RTC is not set 743CONFIG_GPIOLIB=y
635# CONFIG_DTLK is not set 744# CONFIG_GPIO_SYSFS is not set
636# CONFIG_R3964 is not set
637 745
638# 746#
639# Ftape, the floppy tape device driver 747# Memory mapped GPIO expanders:
640# 748#
641# CONFIG_DRM is not set
642 749
643# 750#
644# PCMCIA character devices 751# I2C GPIO expanders:
645# 752#
646# CONFIG_SYNCLINK_CS is not set
647# CONFIG_RAW_DRIVER is not set
648 753
649# 754#
650# TPM devices 755# PCI GPIO expanders:
651# 756#
652 757
653# 758#
654# I2C support 759# SPI GPIO expanders:
655# 760#
656# CONFIG_I2C is not set
657 761
658# 762#
659# Misc devices 763# AC97 GPIO expanders:
660# 764#
765# CONFIG_W1 is not set
766# CONFIG_POWER_SUPPLY is not set
767# CONFIG_HWMON is not set
768# CONFIG_THERMAL is not set
769# CONFIG_WATCHDOG is not set
770CONFIG_SSB_POSSIBLE=y
661 771
662# 772#
663# Multimedia devices 773# Sonics Silicon Backplane
664# 774#
665# CONFIG_VIDEO_DEV is not set 775# CONFIG_SSB is not set
666 776
667# 777#
668# Digital Video Broadcasting Devices 778# Multifunction device drivers
669# 779#
670# CONFIG_DVB is not set 780# CONFIG_MFD_CORE is not set
781# CONFIG_MFD_SM501 is not set
782# CONFIG_MFD_ASIC3 is not set
783CONFIG_HTC_EGPIO=y
784# CONFIG_HTC_PASIC3 is not set
785# CONFIG_MFD_TMIO is not set
786# CONFIG_MFD_T7L66XB is not set
787# CONFIG_MFD_TC6387XB is not set
788# CONFIG_MFD_TC6393XB is not set
789
790#
791# Multimedia Capabilities Port drivers
792#
793# CONFIG_MCP_SA11X0 is not set
794# CONFIG_REGULATOR is not set
795# CONFIG_MEDIA_SUPPORT is not set
671 796
672# 797#
673# Graphics support 798# Graphics support
674# 799#
800# CONFIG_VGASTATE is not set
801# CONFIG_VIDEO_OUTPUT_CONTROL is not set
675CONFIG_FB=y 802CONFIG_FB=y
803# CONFIG_FIRMWARE_EDID is not set
804# CONFIG_FB_DDC is not set
805# CONFIG_FB_BOOT_VESA_SUPPORT is not set
676CONFIG_FB_CFB_FILLRECT=y 806CONFIG_FB_CFB_FILLRECT=y
677CONFIG_FB_CFB_COPYAREA=y 807CONFIG_FB_CFB_COPYAREA=y
678CONFIG_FB_CFB_IMAGEBLIT=y 808CONFIG_FB_CFB_IMAGEBLIT=y
679CONFIG_FB_SOFT_CURSOR=y 809# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
810# CONFIG_FB_SYS_FILLRECT is not set
811# CONFIG_FB_SYS_COPYAREA is not set
812# CONFIG_FB_SYS_IMAGEBLIT is not set
813# CONFIG_FB_FOREIGN_ENDIAN is not set
814# CONFIG_FB_SYS_FOPS is not set
815# CONFIG_FB_SVGALIB is not set
680# CONFIG_FB_MACMODES is not set 816# CONFIG_FB_MACMODES is not set
817# CONFIG_FB_BACKLIGHT is not set
681# CONFIG_FB_MODE_HELPERS is not set 818# CONFIG_FB_MODE_HELPERS is not set
682# CONFIG_FB_TILEBLITTING is not set 819# CONFIG_FB_TILEBLITTING is not set
820
821#
822# Frame buffer hardware drivers
823#
683CONFIG_FB_SA1100=y 824CONFIG_FB_SA1100=y
684# CONFIG_FB_S1D13XXX is not set 825# CONFIG_FB_S1D13XXX is not set
685# CONFIG_FB_VIRTUAL is not set 826# CONFIG_FB_VIRTUAL is not set
827# CONFIG_FB_METRONOME is not set
828# CONFIG_FB_MB862XX is not set
829# CONFIG_FB_BROADSHEET is not set
830# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
831
832#
833# Display device support
834#
835# CONFIG_DISPLAY_SUPPORT is not set
686 836
687# 837#
688# Console display driver support 838# Console display driver support
@@ -691,65 +841,54 @@ CONFIG_FB_SA1100=y
691# CONFIG_MDA_CONSOLE is not set 841# CONFIG_MDA_CONSOLE is not set
692CONFIG_DUMMY_CONSOLE=y 842CONFIG_DUMMY_CONSOLE=y
693# CONFIG_FRAMEBUFFER_CONSOLE is not set 843# CONFIG_FRAMEBUFFER_CONSOLE is not set
694
695#
696# Logo configuration
697#
698# CONFIG_LOGO is not set 844# CONFIG_LOGO is not set
699# CONFIG_BACKLIGHT_LCD_SUPPORT is not set 845# CONFIG_SOUND is not set
700 846# CONFIG_HID_SUPPORT is not set
701# 847# CONFIG_USB_SUPPORT is not set
702# Sound 848# CONFIG_MMC is not set
703# 849# CONFIG_MEMSTICK is not set
704CONFIG_SOUND=y 850# CONFIG_NEW_LEDS is not set
705 851# CONFIG_ACCESSIBILITY is not set
706# 852CONFIG_RTC_LIB=y
707# Advanced Linux Sound Architecture 853# CONFIG_RTC_CLASS is not set
708# 854# CONFIG_DMADEVICES is not set
709# CONFIG_SND is not set 855# CONFIG_AUXDISPLAY is not set
710 856# CONFIG_UIO is not set
711#
712# Open Sound System
713#
714# CONFIG_SOUND_PRIME is not set
715
716#
717# USB support
718#
719CONFIG_USB_ARCH_HAS_HCD=y
720# CONFIG_USB_ARCH_HAS_OHCI is not set
721# CONFIG_USB is not set
722 857
723# 858#
724# USB Gadget Support 859# TI VLYNQ
725# 860#
726# CONFIG_USB_GADGET is not set 861# CONFIG_STAGING is not set
727
728#
729# MMC/SD Card support
730#
731# CONFIG_MMC is not set
732 862
733# 863#
734# File systems 864# File systems
735# 865#
736CONFIG_EXT2_FS=y 866CONFIG_EXT2_FS=y
737# CONFIG_EXT2_FS_XATTR is not set 867# CONFIG_EXT2_FS_XATTR is not set
868# CONFIG_EXT2_FS_XIP is not set
738# CONFIG_EXT3_FS is not set 869# CONFIG_EXT3_FS is not set
739# CONFIG_JBD is not set 870# CONFIG_EXT4_FS is not set
740# CONFIG_REISERFS_FS is not set 871# CONFIG_REISERFS_FS is not set
741# CONFIG_JFS_FS is not set 872# CONFIG_JFS_FS is not set
742 873# CONFIG_FS_POSIX_ACL is not set
743#
744# XFS support
745#
746# CONFIG_XFS_FS is not set 874# CONFIG_XFS_FS is not set
747# CONFIG_MINIX_FS is not set 875# CONFIG_OCFS2_FS is not set
748# CONFIG_ROMFS_FS is not set 876# CONFIG_BTRFS_FS is not set
749# CONFIG_QUOTA is not set 877# CONFIG_NILFS2_FS is not set
878CONFIG_FILE_LOCKING=y
879CONFIG_FSNOTIFY=y
750CONFIG_DNOTIFY=y 880CONFIG_DNOTIFY=y
881# CONFIG_INOTIFY is not set
882CONFIG_INOTIFY_USER=y
883# CONFIG_QUOTA is not set
751# CONFIG_AUTOFS_FS is not set 884# CONFIG_AUTOFS_FS is not set
752# CONFIG_AUTOFS4_FS is not set 885# CONFIG_AUTOFS4_FS is not set
886# CONFIG_FUSE_FS is not set
887
888#
889# Caches
890#
891# CONFIG_FSCACHE is not set
753 892
754# 893#
755# CD-ROM/DVD Filesystems 894# CD-ROM/DVD Filesystems
@@ -771,16 +910,13 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
771# Pseudo filesystems 910# Pseudo filesystems
772# 911#
773CONFIG_PROC_FS=y 912CONFIG_PROC_FS=y
913CONFIG_PROC_SYSCTL=y
914CONFIG_PROC_PAGE_MONITOR=y
774CONFIG_SYSFS=y 915CONFIG_SYSFS=y
775# CONFIG_DEVFS_FS is not set
776# CONFIG_DEVPTS_FS_XATTR is not set
777# CONFIG_TMPFS is not set 916# CONFIG_TMPFS is not set
778# CONFIG_HUGETLB_PAGE is not set 917# CONFIG_HUGETLB_PAGE is not set
779CONFIG_RAMFS=y 918# CONFIG_CONFIGFS_FS is not set
780 919CONFIG_MISC_FILESYSTEMS=y
781#
782# Miscellaneous filesystems
783#
784# CONFIG_ADFS_FS is not set 920# CONFIG_ADFS_FS is not set
785# CONFIG_AFFS_FS is not set 921# CONFIG_AFFS_FS is not set
786# CONFIG_HFS_FS is not set 922# CONFIG_HFS_FS is not set
@@ -788,34 +924,37 @@ CONFIG_RAMFS=y
788# CONFIG_BEFS_FS is not set 924# CONFIG_BEFS_FS is not set
789# CONFIG_BFS_FS is not set 925# CONFIG_BFS_FS is not set
790# CONFIG_EFS_FS is not set 926# CONFIG_EFS_FS is not set
791# CONFIG_JFFS_FS is not set
792CONFIG_JFFS2_FS=y 927CONFIG_JFFS2_FS=y
793CONFIG_JFFS2_FS_DEBUG=0 928CONFIG_JFFS2_FS_DEBUG=0
794# CONFIG_JFFS2_FS_NAND is not set 929CONFIG_JFFS2_FS_WRITEBUFFER=y
795# CONFIG_JFFS2_FS_NOR_ECC is not set 930# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
931# CONFIG_JFFS2_SUMMARY is not set
932# CONFIG_JFFS2_FS_XATTR is not set
796# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set 933# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
797CONFIG_JFFS2_ZLIB=y 934CONFIG_JFFS2_ZLIB=y
935# CONFIG_JFFS2_LZO is not set
798CONFIG_JFFS2_RTIME=y 936CONFIG_JFFS2_RTIME=y
799# CONFIG_JFFS2_RUBIN is not set 937# CONFIG_JFFS2_RUBIN is not set
800CONFIG_CRAMFS=m 938CONFIG_CRAMFS=m
939# CONFIG_SQUASHFS is not set
801# CONFIG_VXFS_FS is not set 940# CONFIG_VXFS_FS is not set
941# CONFIG_MINIX_FS is not set
942# CONFIG_OMFS_FS is not set
802# CONFIG_HPFS_FS is not set 943# CONFIG_HPFS_FS is not set
803# CONFIG_QNX4FS_FS is not set 944# CONFIG_QNX4FS_FS is not set
945# CONFIG_ROMFS_FS is not set
804# CONFIG_SYSV_FS is not set 946# CONFIG_SYSV_FS is not set
805# CONFIG_UFS_FS is not set 947# CONFIG_UFS_FS is not set
806 948CONFIG_NETWORK_FILESYSTEMS=y
807#
808# Network File Systems
809#
810CONFIG_NFS_FS=y 949CONFIG_NFS_FS=y
811# CONFIG_NFS_V3 is not set 950# CONFIG_NFS_V3 is not set
812# CONFIG_NFS_V4 is not set 951# CONFIG_NFS_V4 is not set
813# CONFIG_NFS_DIRECTIO is not set
814CONFIG_NFSD=m 952CONFIG_NFSD=m
815# CONFIG_NFSD_V3 is not set 953# CONFIG_NFSD_V3 is not set
816CONFIG_NFSD_TCP=y 954# CONFIG_NFSD_V4 is not set
817CONFIG_LOCKD=y 955CONFIG_LOCKD=y
818CONFIG_EXPORTFS=m 956CONFIG_EXPORTFS=m
957CONFIG_NFS_COMMON=y
819CONFIG_SUNRPC=y 958CONFIG_SUNRPC=y
820# CONFIG_RPCSEC_GSS_KRB5 is not set 959# CONFIG_RPCSEC_GSS_KRB5 is not set
821# CONFIG_RPCSEC_GSS_SPKM3 is not set 960# CONFIG_RPCSEC_GSS_SPKM3 is not set
@@ -831,10 +970,6 @@ CONFIG_SMB_FS=m
831# 970#
832# CONFIG_PARTITION_ADVANCED is not set 971# CONFIG_PARTITION_ADVANCED is not set
833CONFIG_MSDOS_PARTITION=y 972CONFIG_MSDOS_PARTITION=y
834
835#
836# Native Language Support
837#
838CONFIG_NLS=y 973CONFIG_NLS=y
839CONFIG_NLS_DEFAULT="iso8859-1" 974CONFIG_NLS_DEFAULT="iso8859-1"
840# CONFIG_NLS_CODEPAGE_437 is not set 975# CONFIG_NLS_CODEPAGE_437 is not set
@@ -875,20 +1010,34 @@ CONFIG_NLS_DEFAULT="iso8859-1"
875# CONFIG_NLS_KOI8_R is not set 1010# CONFIG_NLS_KOI8_R is not set
876# CONFIG_NLS_KOI8_U is not set 1011# CONFIG_NLS_KOI8_U is not set
877# CONFIG_NLS_UTF8 is not set 1012# CONFIG_NLS_UTF8 is not set
878 1013# CONFIG_DLM is not set
879#
880# Profiling support
881#
882# CONFIG_PROFILING is not set
883 1014
884# 1015#
885# Kernel hacking 1016# Kernel hacking
886# 1017#
887# CONFIG_PRINTK_TIME is not set 1018# CONFIG_PRINTK_TIME is not set
1019CONFIG_ENABLE_WARN_DEPRECATED=y
1020CONFIG_ENABLE_MUST_CHECK=y
1021CONFIG_FRAME_WARN=1024
1022# CONFIG_MAGIC_SYSRQ is not set
1023# CONFIG_STRIP_ASM_SYMS is not set
1024# CONFIG_UNUSED_SYMBOLS is not set
1025# CONFIG_DEBUG_FS is not set
1026# CONFIG_HEADERS_CHECK is not set
888# CONFIG_DEBUG_KERNEL is not set 1027# CONFIG_DEBUG_KERNEL is not set
889CONFIG_LOG_BUF_SHIFT=14 1028# CONFIG_SLUB_DEBUG_ON is not set
1029# CONFIG_SLUB_STATS is not set
890CONFIG_DEBUG_BUGVERBOSE=y 1030CONFIG_DEBUG_BUGVERBOSE=y
1031CONFIG_DEBUG_MEMORY_INIT=y
891CONFIG_FRAME_POINTER=y 1032CONFIG_FRAME_POINTER=y
1033# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1034# CONFIG_LATENCYTOP is not set
1035# CONFIG_SYSCTL_SYSCALL_CHECK is not set
1036CONFIG_HAVE_FUNCTION_TRACER=y
1037CONFIG_TRACING_SUPPORT=y
1038# CONFIG_FTRACE is not set
1039# CONFIG_SAMPLES is not set
1040CONFIG_HAVE_ARCH_KGDB=y
892# CONFIG_DEBUG_USER is not set 1041# CONFIG_DEBUG_USER is not set
893 1042
894# 1043#
@@ -896,21 +1045,120 @@ CONFIG_FRAME_POINTER=y
896# 1045#
897# CONFIG_KEYS is not set 1046# CONFIG_KEYS is not set
898# CONFIG_SECURITY is not set 1047# CONFIG_SECURITY is not set
1048# CONFIG_SECURITYFS is not set
1049# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1050CONFIG_CRYPTO=y
1051
1052#
1053# Crypto core or helper
1054#
1055# CONFIG_CRYPTO_FIPS is not set
1056CONFIG_CRYPTO_ALGAPI=m
1057CONFIG_CRYPTO_ALGAPI2=m
1058CONFIG_CRYPTO_RNG=m
1059CONFIG_CRYPTO_RNG2=m
1060# CONFIG_CRYPTO_MANAGER is not set
1061# CONFIG_CRYPTO_MANAGER2 is not set
1062# CONFIG_CRYPTO_GF128MUL is not set
1063# CONFIG_CRYPTO_NULL is not set
1064# CONFIG_CRYPTO_CRYPTD is not set
1065# CONFIG_CRYPTO_AUTHENC is not set
1066# CONFIG_CRYPTO_TEST is not set
1067
1068#
1069# Authenticated Encryption with Associated Data
1070#
1071# CONFIG_CRYPTO_CCM is not set
1072# CONFIG_CRYPTO_GCM is not set
1073# CONFIG_CRYPTO_SEQIV is not set
1074
1075#
1076# Block modes
1077#
1078# CONFIG_CRYPTO_CBC is not set
1079# CONFIG_CRYPTO_CTR is not set
1080# CONFIG_CRYPTO_CTS is not set
1081# CONFIG_CRYPTO_ECB is not set
1082# CONFIG_CRYPTO_LRW is not set
1083# CONFIG_CRYPTO_PCBC is not set
1084# CONFIG_CRYPTO_XTS is not set
1085
1086#
1087# Hash modes
1088#
1089# CONFIG_CRYPTO_HMAC is not set
1090# CONFIG_CRYPTO_XCBC is not set
1091# CONFIG_CRYPTO_VMAC is not set
1092
1093#
1094# Digest
1095#
1096# CONFIG_CRYPTO_CRC32C is not set
1097# CONFIG_CRYPTO_GHASH is not set
1098# CONFIG_CRYPTO_MD4 is not set
1099# CONFIG_CRYPTO_MD5 is not set
1100# CONFIG_CRYPTO_MICHAEL_MIC is not set
1101# CONFIG_CRYPTO_RMD128 is not set
1102# CONFIG_CRYPTO_RMD160 is not set
1103# CONFIG_CRYPTO_RMD256 is not set
1104# CONFIG_CRYPTO_RMD320 is not set
1105# CONFIG_CRYPTO_SHA1 is not set
1106# CONFIG_CRYPTO_SHA256 is not set
1107# CONFIG_CRYPTO_SHA512 is not set
1108# CONFIG_CRYPTO_TGR192 is not set
1109# CONFIG_CRYPTO_WP512 is not set
1110
1111#
1112# Ciphers
1113#
1114CONFIG_CRYPTO_AES=m
1115# CONFIG_CRYPTO_ANUBIS is not set
1116# CONFIG_CRYPTO_ARC4 is not set
1117# CONFIG_CRYPTO_BLOWFISH is not set
1118# CONFIG_CRYPTO_CAMELLIA is not set
1119# CONFIG_CRYPTO_CAST5 is not set
1120# CONFIG_CRYPTO_CAST6 is not set
1121# CONFIG_CRYPTO_DES is not set
1122# CONFIG_CRYPTO_FCRYPT is not set
1123# CONFIG_CRYPTO_KHAZAD is not set
1124# CONFIG_CRYPTO_SALSA20 is not set
1125# CONFIG_CRYPTO_SEED is not set
1126# CONFIG_CRYPTO_SERPENT is not set
1127# CONFIG_CRYPTO_TEA is not set
1128# CONFIG_CRYPTO_TWOFISH is not set
899 1129
900# 1130#
901# Cryptographic options 1131# Compression
902# 1132#
903# CONFIG_CRYPTO is not set 1133# CONFIG_CRYPTO_DEFLATE is not set
1134# CONFIG_CRYPTO_ZLIB is not set
1135# CONFIG_CRYPTO_LZO is not set
904 1136
905# 1137#
906# Hardware crypto devices 1138# Random Number Generation
907# 1139#
1140CONFIG_CRYPTO_ANSI_CPRNG=m
1141CONFIG_CRYPTO_HW=y
1142# CONFIG_BINARY_PRINTF is not set
908 1143
909# 1144#
910# Library routines 1145# Library routines
911# 1146#
1147CONFIG_BITREVERSE=y
1148CONFIG_GENERIC_FIND_LAST_BIT=y
912CONFIG_CRC_CCITT=m 1149CONFIG_CRC_CCITT=m
1150# CONFIG_CRC16 is not set
1151# CONFIG_CRC_T10DIF is not set
1152# CONFIG_CRC_ITU_T is not set
913CONFIG_CRC32=y 1153CONFIG_CRC32=y
1154# CONFIG_CRC7 is not set
914# CONFIG_LIBCRC32C is not set 1155# CONFIG_LIBCRC32C is not set
915CONFIG_ZLIB_INFLATE=y 1156CONFIG_ZLIB_INFLATE=y
916CONFIG_ZLIB_DEFLATE=y 1157CONFIG_ZLIB_DEFLATE=y
1158CONFIG_DECOMPRESS_GZIP=y
1159CONFIG_DECOMPRESS_BZIP2=y
1160CONFIG_DECOMPRESS_LZMA=y
1161CONFIG_HAS_IOMEM=y
1162CONFIG_HAS_IOPORT=y
1163CONFIG_HAS_DMA=y
1164CONFIG_NLATTR=y
diff --git a/arch/arm/configs/htcherald_defconfig b/arch/arm/configs/htcherald_defconfig
new file mode 100644
index 000000000000..338267674075
--- /dev/null
+++ b/arch/arm/configs/htcherald_defconfig
@@ -0,0 +1,1142 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.32-rc6
4# Sat Nov 14 10:56:01 2009
5#
6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y
9CONFIG_GENERIC_TIME=y
10CONFIG_GENERIC_CLOCKEVENTS=y
11CONFIG_GENERIC_HARDIRQS=y
12CONFIG_STACKTRACE_SUPPORT=y
13CONFIG_HAVE_LATENCYTOP_SUPPORT=y
14CONFIG_LOCKDEP_SUPPORT=y
15CONFIG_TRACE_IRQFLAGS_SUPPORT=y
16CONFIG_HARDIRQS_SW_RESEND=y
17CONFIG_GENERIC_IRQ_PROBE=y
18CONFIG_RWSEM_GENERIC_SPINLOCK=y
19CONFIG_ARCH_HAS_CPUFREQ=y
20CONFIG_GENERIC_HWEIGHT=y
21CONFIG_GENERIC_CALIBRATE_DELAY=y
22CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
23CONFIG_VECTORS_BASE=0xffff0000
24CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
25CONFIG_CONSTRUCTORS=y
26
27#
28# General setup
29#
30CONFIG_EXPERIMENTAL=y
31CONFIG_BROKEN_ON_SMP=y
32CONFIG_LOCK_KERNEL=y
33CONFIG_INIT_ENV_ARG_LIMIT=32
34CONFIG_LOCALVERSION=""
35CONFIG_LOCALVERSION_AUTO=y
36CONFIG_SWAP=y
37CONFIG_SYSVIPC=y
38CONFIG_SYSVIPC_SYSCTL=y
39# CONFIG_POSIX_MQUEUE is not set
40# CONFIG_BSD_PROCESS_ACCT is not set
41# CONFIG_TASKSTATS is not set
42# CONFIG_AUDIT is not set
43
44#
45# RCU Subsystem
46#
47CONFIG_TREE_RCU=y
48# CONFIG_TREE_PREEMPT_RCU is not set
49# CONFIG_RCU_TRACE is not set
50CONFIG_RCU_FANOUT=32
51# CONFIG_RCU_FANOUT_EXACT is not set
52# CONFIG_TREE_RCU_TRACE is not set
53# CONFIG_IKCONFIG is not set
54CONFIG_LOG_BUF_SHIFT=14
55# CONFIG_GROUP_SCHED is not set
56# CONFIG_CGROUPS is not set
57# CONFIG_SYSFS_DEPRECATED_V2 is not set
58# CONFIG_RELAY is not set
59CONFIG_NAMESPACES=y
60# CONFIG_UTS_NS is not set
61# CONFIG_IPC_NS is not set
62# CONFIG_USER_NS is not set
63# CONFIG_PID_NS is not set
64# CONFIG_NET_NS is not set
65CONFIG_BLK_DEV_INITRD=y
66CONFIG_INITRAMFS_SOURCE=""
67CONFIG_RD_GZIP=y
68CONFIG_RD_BZIP2=y
69CONFIG_RD_LZMA=y
70CONFIG_CC_OPTIMIZE_FOR_SIZE=y
71CONFIG_SYSCTL=y
72CONFIG_ANON_INODES=y
73# CONFIG_EMBEDDED is not set
74CONFIG_UID16=y
75CONFIG_SYSCTL_SYSCALL=y
76CONFIG_KALLSYMS=y
77# CONFIG_KALLSYMS_EXTRA_PASS is not set
78CONFIG_HOTPLUG=y
79CONFIG_PRINTK=y
80CONFIG_BUG=y
81CONFIG_ELF_CORE=y
82CONFIG_BASE_FULL=y
83CONFIG_FUTEX=y
84CONFIG_EPOLL=y
85CONFIG_SIGNALFD=y
86CONFIG_TIMERFD=y
87CONFIG_EVENTFD=y
88CONFIG_SHMEM=y
89CONFIG_AIO=y
90
91#
92# Kernel Performance Events And Counters
93#
94CONFIG_VM_EVENT_COUNTERS=y
95CONFIG_COMPAT_BRK=y
96CONFIG_SLAB=y
97# CONFIG_SLUB is not set
98# CONFIG_SLOB is not set
99# CONFIG_PROFILING is not set
100CONFIG_HAVE_OPROFILE=y
101# CONFIG_KPROBES is not set
102CONFIG_HAVE_KPROBES=y
103CONFIG_HAVE_KRETPROBES=y
104CONFIG_HAVE_CLK=y
105
106#
107# GCOV-based kernel profiling
108#
109# CONFIG_SLOW_WORK is not set
110CONFIG_HAVE_GENERIC_DMA_COHERENT=y
111CONFIG_SLABINFO=y
112CONFIG_RT_MUTEXES=y
113CONFIG_BASE_SMALL=0
114CONFIG_MODULES=y
115# CONFIG_MODULE_FORCE_LOAD is not set
116CONFIG_MODULE_UNLOAD=y
117# CONFIG_MODULE_FORCE_UNLOAD is not set
118# CONFIG_MODVERSIONS is not set
119# CONFIG_MODULE_SRCVERSION_ALL is not set
120CONFIG_BLOCK=y
121CONFIG_LBDAF=y
122# CONFIG_BLK_DEV_BSG is not set
123# CONFIG_BLK_DEV_INTEGRITY is not set
124
125#
126# IO Schedulers
127#
128CONFIG_IOSCHED_NOOP=y
129CONFIG_IOSCHED_AS=y
130CONFIG_IOSCHED_DEADLINE=y
131CONFIG_IOSCHED_CFQ=y
132# CONFIG_DEFAULT_AS is not set
133# CONFIG_DEFAULT_DEADLINE is not set
134CONFIG_DEFAULT_CFQ=y
135# CONFIG_DEFAULT_NOOP is not set
136CONFIG_DEFAULT_IOSCHED="cfq"
137CONFIG_FREEZER=y
138
139#
140# System Type
141#
142CONFIG_MMU=y
143# CONFIG_ARCH_AAEC2000 is not set
144# CONFIG_ARCH_INTEGRATOR is not set
145# CONFIG_ARCH_REALVIEW is not set
146# CONFIG_ARCH_VERSATILE is not set
147# CONFIG_ARCH_AT91 is not set
148# CONFIG_ARCH_CLPS711X is not set
149# CONFIG_ARCH_GEMINI is not set
150# CONFIG_ARCH_EBSA110 is not set
151# CONFIG_ARCH_EP93XX is not set
152# CONFIG_ARCH_FOOTBRIDGE is not set
153# CONFIG_ARCH_MXC is not set
154# CONFIG_ARCH_STMP3XXX is not set
155# CONFIG_ARCH_NETX is not set
156# CONFIG_ARCH_H720X is not set
157# CONFIG_ARCH_NOMADIK is not set
158# CONFIG_ARCH_IOP13XX is not set
159# CONFIG_ARCH_IOP32X is not set
160# CONFIG_ARCH_IOP33X is not set
161# CONFIG_ARCH_IXP23XX is not set
162# CONFIG_ARCH_IXP2000 is not set
163# CONFIG_ARCH_IXP4XX is not set
164# CONFIG_ARCH_L7200 is not set
165# CONFIG_ARCH_KIRKWOOD is not set
166# CONFIG_ARCH_LOKI is not set
167# CONFIG_ARCH_MV78XX0 is not set
168# CONFIG_ARCH_ORION5X is not set
169# CONFIG_ARCH_MMP is not set
170# CONFIG_ARCH_KS8695 is not set
171# CONFIG_ARCH_NS9XXX is not set
172# CONFIG_ARCH_W90X900 is not set
173# CONFIG_ARCH_PNX4008 is not set
174# CONFIG_ARCH_PXA is not set
175# CONFIG_ARCH_MSM is not set
176# CONFIG_ARCH_RPC is not set
177# CONFIG_ARCH_SA1100 is not set
178# CONFIG_ARCH_S3C2410 is not set
179# CONFIG_ARCH_S3C64XX is not set
180# CONFIG_ARCH_S5PC1XX is not set
181# CONFIG_ARCH_SHARK is not set
182# CONFIG_ARCH_LH7A40X is not set
183# CONFIG_ARCH_U300 is not set
184# CONFIG_ARCH_DAVINCI is not set
185CONFIG_ARCH_OMAP=y
186# CONFIG_ARCH_BCMRING is not set
187
188#
189# TI OMAP Implementations
190#
191CONFIG_ARCH_OMAP_OTG=y
192CONFIG_ARCH_OMAP1=y
193# CONFIG_ARCH_OMAP2 is not set
194# CONFIG_ARCH_OMAP3 is not set
195# CONFIG_ARCH_OMAP4 is not set
196
197#
198# OMAP Feature Selections
199#
200# CONFIG_OMAP_RESET_CLOCKS is not set
201# CONFIG_OMAP_MUX is not set
202CONFIG_OMAP_MCBSP=y
203# CONFIG_OMAP_MBOX_FWK is not set
204CONFIG_OMAP_MPU_TIMER=y
205# CONFIG_OMAP_32K_TIMER is not set
206CONFIG_OMAP_LL_DEBUG_UART1=y
207# CONFIG_OMAP_LL_DEBUG_UART2 is not set
208# CONFIG_OMAP_LL_DEBUG_UART3 is not set
209# CONFIG_OMAP_LL_DEBUG_NONE is not set
210# CONFIG_OMAP_PM_NONE is not set
211CONFIG_OMAP_PM_NOOP=y
212
213#
214# OMAP Core Type
215#
216# CONFIG_ARCH_OMAP730 is not set
217CONFIG_ARCH_OMAP850=y
218# CONFIG_ARCH_OMAP15XX is not set
219# CONFIG_ARCH_OMAP16XX is not set
220
221#
222# OMAP Board Type
223#
224# CONFIG_MACH_OMAP_HTCWIZARD is not set
225CONFIG_MACH_HERALD=y
226
227#
228# OMAP CPU Speed
229#
230# CONFIG_OMAP_CLOCKS_SET_BY_BOOTLOADER is not set
231CONFIG_OMAP_ARM_195MHZ=y
232# CONFIG_OMAP_ARM_182MHZ is not set
233# CONFIG_OMAP_ARM_168MHZ is not set
234# CONFIG_OMAP_ARM_120MHZ is not set
235# CONFIG_OMAP_ARM_60MHZ is not set
236# CONFIG_OMAP_ARM_30MHZ is not set
237
238#
239# Processor Type
240#
241CONFIG_CPU_32=y
242CONFIG_CPU_ARM925T=y
243CONFIG_CPU_ARM926T=y
244CONFIG_CPU_32v4T=y
245CONFIG_CPU_32v5=y
246CONFIG_CPU_ABRT_EV4T=y
247CONFIG_CPU_ABRT_EV5TJ=y
248CONFIG_CPU_PABRT_LEGACY=y
249CONFIG_CPU_CACHE_V4WT=y
250CONFIG_CPU_CACHE_VIVT=y
251CONFIG_CPU_COPY_V4WB=y
252CONFIG_CPU_TLB_V4WBI=y
253CONFIG_CPU_CP15=y
254CONFIG_CPU_CP15_MMU=y
255
256#
257# Processor Features
258#
259CONFIG_ARM_THUMB=y
260# CONFIG_CPU_ICACHE_DISABLE is not set
261# CONFIG_CPU_DCACHE_DISABLE is not set
262CONFIG_CPU_DCACHE_WRITETHROUGH=y
263# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
264CONFIG_ARM_L1_CACHE_SHIFT=5
265CONFIG_COMMON_CLKDEV=y
266
267#
268# Bus support
269#
270# CONFIG_PCI_SYSCALL is not set
271# CONFIG_ARCH_SUPPORTS_MSI is not set
272# CONFIG_PCCARD is not set
273
274#
275# Kernel Features
276#
277# CONFIG_NO_HZ is not set
278# CONFIG_HIGH_RES_TIMERS is not set
279CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
280CONFIG_VMSPLIT_3G=y
281# CONFIG_VMSPLIT_2G is not set
282# CONFIG_VMSPLIT_1G is not set
283CONFIG_PAGE_OFFSET=0xC0000000
284# CONFIG_PREEMPT_NONE is not set
285# CONFIG_PREEMPT_VOLUNTARY is not set
286CONFIG_PREEMPT=y
287CONFIG_HZ=100
288CONFIG_AEABI=y
289CONFIG_OABI_COMPAT=y
290# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
291# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
292# CONFIG_HIGHMEM is not set
293CONFIG_SELECT_MEMORY_MODEL=y
294CONFIG_FLATMEM_MANUAL=y
295# CONFIG_DISCONTIGMEM_MANUAL is not set
296# CONFIG_SPARSEMEM_MANUAL is not set
297CONFIG_FLATMEM=y
298CONFIG_FLAT_NODE_MEM_MAP=y
299CONFIG_PAGEFLAGS_EXTENDED=y
300CONFIG_SPLIT_PTLOCK_CPUS=4096
301# CONFIG_PHYS_ADDR_T_64BIT is not set
302CONFIG_ZONE_DMA_FLAG=0
303CONFIG_VIRT_TO_BUS=y
304CONFIG_HAVE_MLOCK=y
305CONFIG_HAVE_MLOCKED_PAGE_BIT=y
306# CONFIG_KSM is not set
307CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
308CONFIG_LEDS=y
309CONFIG_ALIGNMENT_TRAP=y
310# CONFIG_UACCESS_WITH_MEMCPY is not set
311
312#
313# Boot options
314#
315CONFIG_ZBOOT_ROM_TEXT=0x0
316CONFIG_ZBOOT_ROM_BSS=0x0
317CONFIG_CMDLINE="mem=32M console=ttyS0,115200 ip=dhcp"
318# CONFIG_XIP_KERNEL is not set
319# CONFIG_KEXEC is not set
320
321#
322# CPU Power Management
323#
324# CONFIG_CPU_FREQ is not set
325# CONFIG_CPU_IDLE is not set
326
327#
328# Floating point emulation
329#
330
331#
332# At least one emulation must be selected
333#
334CONFIG_FPE_NWFPE=y
335# CONFIG_FPE_NWFPE_XP is not set
336# CONFIG_FPE_FASTFPE is not set
337# CONFIG_VFP is not set
338
339#
340# Userspace binary formats
341#
342CONFIG_BINFMT_ELF=y
343# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
344CONFIG_HAVE_AOUT=y
345# CONFIG_BINFMT_AOUT is not set
346# CONFIG_BINFMT_MISC is not set
347
348#
349# Power management options
350#
351CONFIG_PM=y
352# CONFIG_PM_DEBUG is not set
353CONFIG_PM_SLEEP=y
354CONFIG_SUSPEND=y
355CONFIG_SUSPEND_FREEZER=y
356# CONFIG_APM_EMULATION is not set
357# CONFIG_PM_RUNTIME is not set
358CONFIG_ARCH_SUSPEND_POSSIBLE=y
359CONFIG_NET=y
360
361#
362# Networking options
363#
364CONFIG_PACKET=y
365# CONFIG_PACKET_MMAP is not set
366CONFIG_UNIX=y
367CONFIG_XFRM=y
368# CONFIG_XFRM_USER is not set
369# CONFIG_XFRM_SUB_POLICY is not set
370# CONFIG_XFRM_MIGRATE is not set
371# CONFIG_XFRM_STATISTICS is not set
372# CONFIG_NET_KEY is not set
373CONFIG_INET=y
374CONFIG_IP_MULTICAST=y
375# CONFIG_IP_ADVANCED_ROUTER is not set
376CONFIG_IP_FIB_HASH=y
377CONFIG_IP_PNP=y
378CONFIG_IP_PNP_DHCP=y
379CONFIG_IP_PNP_BOOTP=y
380# CONFIG_IP_PNP_RARP is not set
381# CONFIG_NET_IPIP is not set
382# CONFIG_NET_IPGRE is not set
383# CONFIG_IP_MROUTE is not set
384# CONFIG_ARPD is not set
385# CONFIG_SYN_COOKIES is not set
386# CONFIG_INET_AH is not set
387# CONFIG_INET_ESP is not set
388# CONFIG_INET_IPCOMP is not set
389# CONFIG_INET_XFRM_TUNNEL is not set
390# CONFIG_INET_TUNNEL is not set
391CONFIG_INET_XFRM_MODE_TRANSPORT=y
392CONFIG_INET_XFRM_MODE_TUNNEL=y
393CONFIG_INET_XFRM_MODE_BEET=y
394CONFIG_INET_LRO=y
395CONFIG_INET_DIAG=y
396CONFIG_INET_TCP_DIAG=y
397# CONFIG_TCP_CONG_ADVANCED is not set
398CONFIG_TCP_CONG_CUBIC=y
399CONFIG_DEFAULT_TCP_CONG="cubic"
400# CONFIG_TCP_MD5SIG is not set
401# CONFIG_IPV6 is not set
402# CONFIG_NETWORK_SECMARK is not set
403# CONFIG_NETFILTER is not set
404# CONFIG_IP_DCCP is not set
405# CONFIG_IP_SCTP is not set
406# CONFIG_RDS is not set
407# CONFIG_TIPC is not set
408# CONFIG_ATM is not set
409# CONFIG_BRIDGE is not set
410# CONFIG_NET_DSA is not set
411# CONFIG_VLAN_8021Q is not set
412# CONFIG_DECNET is not set
413# CONFIG_LLC2 is not set
414# CONFIG_IPX is not set
415# CONFIG_ATALK is not set
416# CONFIG_X25 is not set
417# CONFIG_LAPB is not set
418# CONFIG_ECONET is not set
419# CONFIG_WAN_ROUTER is not set
420# CONFIG_PHONET is not set
421# CONFIG_IEEE802154 is not set
422# CONFIG_NET_SCHED is not set
423# CONFIG_DCB is not set
424
425#
426# Network testing
427#
428# CONFIG_NET_PKTGEN is not set
429# CONFIG_HAMRADIO is not set
430# CONFIG_CAN is not set
431# CONFIG_IRDA is not set
432# CONFIG_BT is not set
433# CONFIG_AF_RXRPC is not set
434CONFIG_WIRELESS=y
435# CONFIG_CFG80211 is not set
436CONFIG_CFG80211_DEFAULT_PS_VALUE=0
437# CONFIG_WIRELESS_OLD_REGULATORY is not set
438# CONFIG_WIRELESS_EXT is not set
439# CONFIG_LIB80211 is not set
440
441#
442# CFG80211 needs to be enabled for MAC80211
443#
444# CONFIG_WIMAX is not set
445# CONFIG_RFKILL is not set
446# CONFIG_NET_9P is not set
447
448#
449# Device Drivers
450#
451
452#
453# Generic Driver Options
454#
455CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
456# CONFIG_DEVTMPFS is not set
457CONFIG_STANDALONE=y
458CONFIG_PREVENT_FIRMWARE_BUILD=y
459CONFIG_FW_LOADER=y
460CONFIG_FIRMWARE_IN_KERNEL=y
461CONFIG_EXTRA_FIRMWARE=""
462# CONFIG_SYS_HYPERVISOR is not set
463# CONFIG_CONNECTOR is not set
464# CONFIG_MTD is not set
465# CONFIG_PARPORT is not set
466CONFIG_BLK_DEV=y
467# CONFIG_BLK_DEV_COW_COMMON is not set
468CONFIG_BLK_DEV_LOOP=y
469# CONFIG_BLK_DEV_CRYPTOLOOP is not set
470# CONFIG_BLK_DEV_NBD is not set
471CONFIG_BLK_DEV_RAM=y
472CONFIG_BLK_DEV_RAM_COUNT=16
473CONFIG_BLK_DEV_RAM_SIZE=8192
474# CONFIG_BLK_DEV_XIP is not set
475# CONFIG_CDROM_PKTCDVD is not set
476# CONFIG_ATA_OVER_ETH is not set
477# CONFIG_MG_DISK is not set
478CONFIG_MISC_DEVICES=y
479# CONFIG_ENCLOSURE_SERVICES is not set
480# CONFIG_C2PORT is not set
481
482#
483# EEPROM support
484#
485# CONFIG_EEPROM_93CX6 is not set
486CONFIG_HAVE_IDE=y
487# CONFIG_IDE is not set
488
489#
490# SCSI device support
491#
492# CONFIG_RAID_ATTRS is not set
493# CONFIG_SCSI is not set
494# CONFIG_SCSI_DMA is not set
495# CONFIG_SCSI_NETLINK is not set
496# CONFIG_ATA is not set
497# CONFIG_MD is not set
498CONFIG_NETDEVICES=y
499# CONFIG_DUMMY is not set
500# CONFIG_BONDING is not set
501# CONFIG_MACVLAN is not set
502# CONFIG_EQUALIZER is not set
503# CONFIG_TUN is not set
504# CONFIG_VETH is not set
505# CONFIG_PHYLIB is not set
506CONFIG_NET_ETHERNET=y
507CONFIG_MII=y
508# CONFIG_AX88796 is not set
509CONFIG_SMC91X=y
510# CONFIG_DM9000 is not set
511# CONFIG_ETHOC is not set
512# CONFIG_SMC911X is not set
513# CONFIG_SMSC911X is not set
514# CONFIG_DNET is not set
515# CONFIG_IBM_NEW_EMAC_ZMII is not set
516# CONFIG_IBM_NEW_EMAC_RGMII is not set
517# CONFIG_IBM_NEW_EMAC_TAH is not set
518# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
519# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
520# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
521# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
522# CONFIG_B44 is not set
523# CONFIG_KS8842 is not set
524# CONFIG_KS8851_MLL is not set
525CONFIG_NETDEV_1000=y
526CONFIG_NETDEV_10000=y
527CONFIG_WLAN=y
528# CONFIG_WLAN_PRE80211 is not set
529# CONFIG_WLAN_80211 is not set
530
531#
532# Enable WiMAX (Networking options) to see the WiMAX drivers
533#
534# CONFIG_WAN is not set
535# CONFIG_PPP is not set
536# CONFIG_SLIP is not set
537# CONFIG_NETCONSOLE is not set
538# CONFIG_NETPOLL is not set
539# CONFIG_NET_POLL_CONTROLLER is not set
540# CONFIG_ISDN is not set
541# CONFIG_PHONE is not set
542
543#
544# Input device support
545#
546CONFIG_INPUT=y
547# CONFIG_INPUT_FF_MEMLESS is not set
548# CONFIG_INPUT_POLLDEV is not set
549
550#
551# Userland interfaces
552#
553CONFIG_INPUT_MOUSEDEV=y
554CONFIG_INPUT_MOUSEDEV_PSAUX=y
555CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
556CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
557# CONFIG_INPUT_JOYDEV is not set
558# CONFIG_INPUT_EVDEV is not set
559# CONFIG_INPUT_EVBUG is not set
560
561#
562# Input Device Drivers
563#
564CONFIG_INPUT_KEYBOARD=y
565# CONFIG_KEYBOARD_ATKBD is not set
566# CONFIG_KEYBOARD_LKKBD is not set
567# CONFIG_KEYBOARD_GPIO is not set
568# CONFIG_KEYBOARD_MATRIX is not set
569# CONFIG_KEYBOARD_NEWTON is not set
570# CONFIG_KEYBOARD_OPENCORES is not set
571# CONFIG_KEYBOARD_STOWAWAY is not set
572# CONFIG_KEYBOARD_SUNKBD is not set
573CONFIG_KEYBOARD_OMAP=y
574# CONFIG_KEYBOARD_XTKBD is not set
575# CONFIG_INPUT_MOUSE is not set
576# CONFIG_INPUT_JOYSTICK is not set
577# CONFIG_INPUT_TABLET is not set
578# CONFIG_INPUT_TOUCHSCREEN is not set
579# CONFIG_INPUT_MISC is not set
580
581#
582# Hardware I/O ports
583#
584CONFIG_SERIO=y
585CONFIG_SERIO_SERPORT=y
586# CONFIG_SERIO_RAW is not set
587# CONFIG_GAMEPORT is not set
588
589#
590# Character devices
591#
592CONFIG_VT=y
593CONFIG_CONSOLE_TRANSLATIONS=y
594CONFIG_VT_CONSOLE=y
595CONFIG_HW_CONSOLE=y
596# CONFIG_VT_HW_CONSOLE_BINDING is not set
597CONFIG_DEVKMEM=y
598# CONFIG_SERIAL_NONSTANDARD is not set
599
600#
601# Serial drivers
602#
603CONFIG_SERIAL_8250=m
604CONFIG_SERIAL_8250_NR_UARTS=4
605CONFIG_SERIAL_8250_RUNTIME_UARTS=4
606# CONFIG_SERIAL_8250_EXTENDED is not set
607
608#
609# Non-8250 serial port support
610#
611CONFIG_SERIAL_CORE=m
612CONFIG_UNIX98_PTYS=y
613# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
614# CONFIG_LEGACY_PTYS is not set
615# CONFIG_IPMI_HANDLER is not set
616CONFIG_HW_RANDOM=m
617# CONFIG_HW_RANDOM_TIMERIOMEM is not set
618# CONFIG_R3964 is not set
619# CONFIG_RAW_DRIVER is not set
620# CONFIG_TCG_TPM is not set
621# CONFIG_I2C is not set
622# CONFIG_SPI is not set
623
624#
625# PPS support
626#
627# CONFIG_PPS is not set
628CONFIG_ARCH_REQUIRE_GPIOLIB=y
629CONFIG_GPIOLIB=y
630# CONFIG_GPIO_SYSFS is not set
631
632#
633# Memory mapped GPIO expanders:
634#
635
636#
637# I2C GPIO expanders:
638#
639
640#
641# PCI GPIO expanders:
642#
643
644#
645# SPI GPIO expanders:
646#
647
648#
649# AC97 GPIO expanders:
650#
651# CONFIG_W1 is not set
652# CONFIG_POWER_SUPPLY is not set
653CONFIG_HWMON=y
654# CONFIG_HWMON_VID is not set
655# CONFIG_HWMON_DEBUG_CHIP is not set
656
657#
658# Native drivers
659#
660# CONFIG_SENSORS_F71805F is not set
661# CONFIG_SENSORS_F71882FG is not set
662# CONFIG_SENSORS_IT87 is not set
663# CONFIG_SENSORS_PC87360 is not set
664# CONFIG_SENSORS_PC87427 is not set
665# CONFIG_SENSORS_SHT15 is not set
666# CONFIG_SENSORS_SMSC47M1 is not set
667# CONFIG_SENSORS_SMSC47B397 is not set
668# CONFIG_SENSORS_VT1211 is not set
669# CONFIG_SENSORS_W83627HF is not set
670# CONFIG_SENSORS_W83627EHF is not set
671# CONFIG_THERMAL is not set
672# CONFIG_WATCHDOG is not set
673CONFIG_SSB_POSSIBLE=y
674
675#
676# Sonics Silicon Backplane
677#
678# CONFIG_SSB is not set
679
680#
681# Multifunction device drivers
682#
683# CONFIG_MFD_CORE is not set
684# CONFIG_MFD_SM501 is not set
685# CONFIG_MFD_ASIC3 is not set
686# CONFIG_HTC_EGPIO is not set
687# CONFIG_HTC_PASIC3 is not set
688# CONFIG_MFD_TMIO is not set
689# CONFIG_MFD_T7L66XB is not set
690# CONFIG_MFD_TC6387XB is not set
691# CONFIG_MFD_TC6393XB is not set
692# CONFIG_REGULATOR is not set
693# CONFIG_MEDIA_SUPPORT is not set
694
695#
696# Graphics support
697#
698# CONFIG_VGASTATE is not set
699CONFIG_VIDEO_OUTPUT_CONTROL=m
700CONFIG_FB=y
701# CONFIG_FIRMWARE_EDID is not set
702# CONFIG_FB_DDC is not set
703# CONFIG_FB_BOOT_VESA_SUPPORT is not set
704CONFIG_FB_CFB_FILLRECT=y
705CONFIG_FB_CFB_COPYAREA=y
706CONFIG_FB_CFB_IMAGEBLIT=y
707# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
708# CONFIG_FB_SYS_FILLRECT is not set
709# CONFIG_FB_SYS_COPYAREA is not set
710# CONFIG_FB_SYS_IMAGEBLIT is not set
711# CONFIG_FB_FOREIGN_ENDIAN is not set
712# CONFIG_FB_SYS_FOPS is not set
713# CONFIG_FB_SVGALIB is not set
714# CONFIG_FB_MACMODES is not set
715# CONFIG_FB_BACKLIGHT is not set
716CONFIG_FB_MODE_HELPERS=y
717# CONFIG_FB_TILEBLITTING is not set
718
719#
720# Frame buffer hardware drivers
721#
722# CONFIG_FB_S1D13XXX is not set
723# CONFIG_FB_VIRTUAL is not set
724# CONFIG_FB_METRONOME is not set
725# CONFIG_FB_MB862XX is not set
726# CONFIG_FB_BROADSHEET is not set
727CONFIG_FB_OMAP=y
728# CONFIG_FB_OMAP_LCDC_EXTERNAL is not set
729# CONFIG_FB_OMAP_BOOTLOADER_INIT is not set
730CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE=2
731# CONFIG_FB_OMAP_DMA_TUNE is not set
732# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
733
734#
735# Display device support
736#
737# CONFIG_DISPLAY_SUPPORT is not set
738
739#
740# Console display driver support
741#
742# CONFIG_VGA_CONSOLE is not set
743CONFIG_DUMMY_CONSOLE=y
744CONFIG_FRAMEBUFFER_CONSOLE=y
745# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
746CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
747CONFIG_FONTS=y
748# CONFIG_FONT_8x8 is not set
749# CONFIG_FONT_8x16 is not set
750# CONFIG_FONT_6x11 is not set
751# CONFIG_FONT_7x14 is not set
752# CONFIG_FONT_PEARL_8x8 is not set
753# CONFIG_FONT_ACORN_8x8 is not set
754CONFIG_FONT_MINI_4x6=y
755# CONFIG_FONT_SUN8x16 is not set
756# CONFIG_FONT_SUN12x22 is not set
757# CONFIG_FONT_10x18 is not set
758# CONFIG_LOGO is not set
759# CONFIG_SOUND is not set
760CONFIG_HID_SUPPORT=y
761CONFIG_HID=y
762# CONFIG_HIDRAW is not set
763# CONFIG_HID_PID is not set
764
765#
766# Special HID drivers
767#
768CONFIG_USB_SUPPORT=y
769CONFIG_USB_ARCH_HAS_HCD=y
770CONFIG_USB_ARCH_HAS_OHCI=y
771# CONFIG_USB_ARCH_HAS_EHCI is not set
772# CONFIG_USB is not set
773# CONFIG_USB_MUSB_HDRC is not set
774# CONFIG_USB_GADGET_MUSB_HDRC is not set
775
776#
777# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
778#
779CONFIG_USB_GADGET=y
780# CONFIG_USB_GADGET_DEBUG_FILES is not set
781CONFIG_USB_GADGET_VBUS_DRAW=2
782CONFIG_USB_GADGET_SELECTED=y
783# CONFIG_USB_GADGET_AT91 is not set
784# CONFIG_USB_GADGET_ATMEL_USBA is not set
785# CONFIG_USB_GADGET_FSL_USB2 is not set
786# CONFIG_USB_GADGET_LH7A40X is not set
787CONFIG_USB_GADGET_OMAP=y
788CONFIG_USB_OMAP=y
789# CONFIG_USB_GADGET_PXA25X is not set
790# CONFIG_USB_GADGET_R8A66597 is not set
791# CONFIG_USB_GADGET_PXA27X is not set
792# CONFIG_USB_GADGET_S3C_HSOTG is not set
793# CONFIG_USB_GADGET_IMX is not set
794# CONFIG_USB_GADGET_S3C2410 is not set
795# CONFIG_USB_GADGET_M66592 is not set
796# CONFIG_USB_GADGET_AMD5536UDC is not set
797# CONFIG_USB_GADGET_FSL_QE is not set
798# CONFIG_USB_GADGET_CI13XXX is not set
799# CONFIG_USB_GADGET_NET2280 is not set
800# CONFIG_USB_GADGET_GOKU is not set
801# CONFIG_USB_GADGET_LANGWELL is not set
802# CONFIG_USB_GADGET_DUMMY_HCD is not set
803# CONFIG_USB_GADGET_DUALSPEED is not set
804# CONFIG_USB_ZERO is not set
805# CONFIG_USB_AUDIO is not set
806CONFIG_USB_ETH=y
807# CONFIG_USB_ETH_RNDIS is not set
808# CONFIG_USB_ETH_EEM is not set
809# CONFIG_USB_GADGETFS is not set
810# CONFIG_USB_FILE_STORAGE is not set
811# CONFIG_USB_G_SERIAL is not set
812# CONFIG_USB_MIDI_GADGET is not set
813# CONFIG_USB_G_PRINTER is not set
814# CONFIG_USB_CDC_COMPOSITE is not set
815
816#
817# OTG and related infrastructure
818#
819CONFIG_USB_OTG_UTILS=y
820# CONFIG_USB_GPIO_VBUS is not set
821# CONFIG_NOP_USB_XCEIV is not set
822CONFIG_MMC=y
823# CONFIG_MMC_DEBUG is not set
824# CONFIG_MMC_UNSAFE_RESUME is not set
825
826#
827# MMC/SD/SDIO Card Drivers
828#
829CONFIG_MMC_BLOCK=y
830CONFIG_MMC_BLOCK_BOUNCE=y
831# CONFIG_SDIO_UART is not set
832# CONFIG_MMC_TEST is not set
833
834#
835# MMC/SD/SDIO Host Controller Drivers
836#
837CONFIG_MMC_SDHCI=y
838CONFIG_MMC_SDHCI_PLTFM=y
839CONFIG_MMC_OMAP=y
840# CONFIG_MMC_AT91 is not set
841# CONFIG_MMC_ATMELMCI is not set
842# CONFIG_MEMSTICK is not set
843# CONFIG_NEW_LEDS is not set
844# CONFIG_ACCESSIBILITY is not set
845CONFIG_RTC_LIB=y
846CONFIG_RTC_CLASS=y
847CONFIG_RTC_HCTOSYS=y
848CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
849# CONFIG_RTC_DEBUG is not set
850
851#
852# RTC interfaces
853#
854CONFIG_RTC_INTF_SYSFS=y
855CONFIG_RTC_INTF_PROC=y
856CONFIG_RTC_INTF_DEV=y
857# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
858# CONFIG_RTC_DRV_TEST is not set
859
860#
861# SPI RTC drivers
862#
863
864#
865# Platform RTC drivers
866#
867# CONFIG_RTC_DRV_CMOS is not set
868# CONFIG_RTC_DRV_DS1286 is not set
869# CONFIG_RTC_DRV_DS1511 is not set
870# CONFIG_RTC_DRV_DS1553 is not set
871# CONFIG_RTC_DRV_DS1742 is not set
872# CONFIG_RTC_DRV_STK17TA8 is not set
873# CONFIG_RTC_DRV_M48T86 is not set
874# CONFIG_RTC_DRV_M48T35 is not set
875# CONFIG_RTC_DRV_M48T59 is not set
876# CONFIG_RTC_DRV_BQ4802 is not set
877# CONFIG_RTC_DRV_V3020 is not set
878
879#
880# on-CPU RTC drivers
881#
882# CONFIG_DMADEVICES is not set
883# CONFIG_AUXDISPLAY is not set
884# CONFIG_UIO is not set
885
886#
887# TI VLYNQ
888#
889# CONFIG_STAGING is not set
890
891#
892# File systems
893#
894CONFIG_EXT2_FS=y
895# CONFIG_EXT2_FS_XATTR is not set
896# CONFIG_EXT2_FS_XIP is not set
897CONFIG_EXT3_FS=y
898# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
899CONFIG_EXT3_FS_XATTR=y
900# CONFIG_EXT3_FS_POSIX_ACL is not set
901# CONFIG_EXT3_FS_SECURITY is not set
902# CONFIG_EXT4_FS is not set
903CONFIG_JBD=y
904CONFIG_FS_MBCACHE=y
905# CONFIG_REISERFS_FS is not set
906# CONFIG_JFS_FS is not set
907# CONFIG_FS_POSIX_ACL is not set
908# CONFIG_XFS_FS is not set
909# CONFIG_GFS2_FS is not set
910# CONFIG_OCFS2_FS is not set
911# CONFIG_BTRFS_FS is not set
912# CONFIG_NILFS2_FS is not set
913CONFIG_FILE_LOCKING=y
914CONFIG_FSNOTIFY=y
915CONFIG_DNOTIFY=y
916CONFIG_INOTIFY=y
917CONFIG_INOTIFY_USER=y
918# CONFIG_QUOTA is not set
919# CONFIG_AUTOFS_FS is not set
920# CONFIG_AUTOFS4_FS is not set
921# CONFIG_FUSE_FS is not set
922
923#
924# Caches
925#
926# CONFIG_FSCACHE is not set
927
928#
929# CD-ROM/DVD Filesystems
930#
931# CONFIG_ISO9660_FS is not set
932# CONFIG_UDF_FS is not set
933
934#
935# DOS/FAT/NT Filesystems
936#
937# CONFIG_MSDOS_FS is not set
938# CONFIG_VFAT_FS is not set
939# CONFIG_NTFS_FS is not set
940
941#
942# Pseudo filesystems
943#
944CONFIG_PROC_FS=y
945CONFIG_PROC_SYSCTL=y
946CONFIG_PROC_PAGE_MONITOR=y
947CONFIG_SYSFS=y
948CONFIG_TMPFS=y
949# CONFIG_TMPFS_POSIX_ACL is not set
950# CONFIG_HUGETLB_PAGE is not set
951# CONFIG_CONFIGFS_FS is not set
952CONFIG_MISC_FILESYSTEMS=y
953# CONFIG_ADFS_FS is not set
954# CONFIG_AFFS_FS is not set
955# CONFIG_HFS_FS is not set
956# CONFIG_HFSPLUS_FS is not set
957# CONFIG_BEFS_FS is not set
958# CONFIG_BFS_FS is not set
959# CONFIG_EFS_FS is not set
960# CONFIG_CRAMFS is not set
961# CONFIG_SQUASHFS is not set
962# CONFIG_VXFS_FS is not set
963# CONFIG_MINIX_FS is not set
964# CONFIG_OMFS_FS is not set
965# CONFIG_HPFS_FS is not set
966# CONFIG_QNX4FS_FS is not set
967# CONFIG_ROMFS_FS is not set
968# CONFIG_SYSV_FS is not set
969# CONFIG_UFS_FS is not set
970CONFIG_NETWORK_FILESYSTEMS=y
971CONFIG_NFS_FS=y
972# CONFIG_NFS_V3 is not set
973# CONFIG_NFS_V4 is not set
974CONFIG_ROOT_NFS=y
975# CONFIG_NFSD is not set
976CONFIG_LOCKD=y
977CONFIG_NFS_COMMON=y
978CONFIG_SUNRPC=y
979# CONFIG_RPCSEC_GSS_KRB5 is not set
980# CONFIG_RPCSEC_GSS_SPKM3 is not set
981# CONFIG_SMB_FS is not set
982# CONFIG_CIFS is not set
983# CONFIG_NCP_FS is not set
984# CONFIG_CODA_FS is not set
985# CONFIG_AFS_FS is not set
986
987#
988# Partition Types
989#
990# CONFIG_PARTITION_ADVANCED is not set
991CONFIG_MSDOS_PARTITION=y
992# CONFIG_NLS is not set
993# CONFIG_DLM is not set
994
995#
996# Kernel hacking
997#
998# CONFIG_PRINTK_TIME is not set
999CONFIG_ENABLE_WARN_DEPRECATED=y
1000CONFIG_ENABLE_MUST_CHECK=y
1001CONFIG_FRAME_WARN=1024
1002# CONFIG_MAGIC_SYSRQ is not set
1003# CONFIG_STRIP_ASM_SYMS is not set
1004# CONFIG_UNUSED_SYMBOLS is not set
1005# CONFIG_DEBUG_FS is not set
1006# CONFIG_HEADERS_CHECK is not set
1007# CONFIG_DEBUG_KERNEL is not set
1008CONFIG_DEBUG_BUGVERBOSE=y
1009CONFIG_DEBUG_MEMORY_INIT=y
1010# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1011# CONFIG_LATENCYTOP is not set
1012# CONFIG_SYSCTL_SYSCALL_CHECK is not set
1013CONFIG_HAVE_FUNCTION_TRACER=y
1014CONFIG_TRACING_SUPPORT=y
1015# CONFIG_FTRACE is not set
1016# CONFIG_SAMPLES is not set
1017CONFIG_HAVE_ARCH_KGDB=y
1018CONFIG_ARM_UNWIND=y
1019# CONFIG_DEBUG_USER is not set
1020
1021#
1022# Security options
1023#
1024# CONFIG_KEYS is not set
1025# CONFIG_SECURITY is not set
1026# CONFIG_SECURITYFS is not set
1027# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1028CONFIG_CRYPTO=y
1029
1030#
1031# Crypto core or helper
1032#
1033CONFIG_CRYPTO_ALGAPI=y
1034CONFIG_CRYPTO_ALGAPI2=y
1035CONFIG_CRYPTO_PCOMP=y
1036# CONFIG_CRYPTO_MANAGER is not set
1037# CONFIG_CRYPTO_MANAGER2 is not set
1038# CONFIG_CRYPTO_GF128MUL is not set
1039# CONFIG_CRYPTO_NULL is not set
1040# CONFIG_CRYPTO_CRYPTD is not set
1041# CONFIG_CRYPTO_AUTHENC is not set
1042# CONFIG_CRYPTO_TEST is not set
1043
1044#
1045# Authenticated Encryption with Associated Data
1046#
1047# CONFIG_CRYPTO_CCM is not set
1048# CONFIG_CRYPTO_GCM is not set
1049# CONFIG_CRYPTO_SEQIV is not set
1050
1051#
1052# Block modes
1053#
1054# CONFIG_CRYPTO_CBC is not set
1055# CONFIG_CRYPTO_CTR is not set
1056# CONFIG_CRYPTO_CTS is not set
1057# CONFIG_CRYPTO_ECB is not set
1058# CONFIG_CRYPTO_LRW is not set
1059# CONFIG_CRYPTO_PCBC is not set
1060# CONFIG_CRYPTO_XTS is not set
1061
1062#
1063# Hash modes
1064#
1065# CONFIG_CRYPTO_HMAC is not set
1066# CONFIG_CRYPTO_XCBC is not set
1067# CONFIG_CRYPTO_VMAC is not set
1068
1069#
1070# Digest
1071#
1072# CONFIG_CRYPTO_CRC32C is not set
1073# CONFIG_CRYPTO_GHASH is not set
1074# CONFIG_CRYPTO_MD4 is not set
1075# CONFIG_CRYPTO_MD5 is not set
1076# CONFIG_CRYPTO_MICHAEL_MIC is not set
1077# CONFIG_CRYPTO_RMD128 is not set
1078# CONFIG_CRYPTO_RMD160 is not set
1079# CONFIG_CRYPTO_RMD256 is not set
1080# CONFIG_CRYPTO_RMD320 is not set
1081# CONFIG_CRYPTO_SHA1 is not set
1082# CONFIG_CRYPTO_SHA256 is not set
1083# CONFIG_CRYPTO_SHA512 is not set
1084# CONFIG_CRYPTO_TGR192 is not set
1085# CONFIG_CRYPTO_WP512 is not set
1086
1087#
1088# Ciphers
1089#
1090# CONFIG_CRYPTO_AES is not set
1091# CONFIG_CRYPTO_ANUBIS is not set
1092# CONFIG_CRYPTO_ARC4 is not set
1093# CONFIG_CRYPTO_BLOWFISH is not set
1094# CONFIG_CRYPTO_CAMELLIA is not set
1095# CONFIG_CRYPTO_CAST5 is not set
1096# CONFIG_CRYPTO_CAST6 is not set
1097# CONFIG_CRYPTO_DES is not set
1098# CONFIG_CRYPTO_FCRYPT is not set
1099# CONFIG_CRYPTO_KHAZAD is not set
1100# CONFIG_CRYPTO_SALSA20 is not set
1101# CONFIG_CRYPTO_SEED is not set
1102# CONFIG_CRYPTO_SERPENT is not set
1103# CONFIG_CRYPTO_TEA is not set
1104# CONFIG_CRYPTO_TWOFISH is not set
1105
1106#
1107# Compression
1108#
1109CONFIG_CRYPTO_DEFLATE=y
1110CONFIG_CRYPTO_ZLIB=y
1111CONFIG_CRYPTO_LZO=y
1112
1113#
1114# Random Number Generation
1115#
1116# CONFIG_CRYPTO_ANSI_CPRNG is not set
1117CONFIG_CRYPTO_HW=y
1118# CONFIG_BINARY_PRINTF is not set
1119
1120#
1121# Library routines
1122#
1123CONFIG_BITREVERSE=y
1124CONFIG_GENERIC_FIND_LAST_BIT=y
1125# CONFIG_CRC_CCITT is not set
1126# CONFIG_CRC16 is not set
1127# CONFIG_CRC_T10DIF is not set
1128# CONFIG_CRC_ITU_T is not set
1129CONFIG_CRC32=y
1130# CONFIG_CRC7 is not set
1131# CONFIG_LIBCRC32C is not set
1132CONFIG_ZLIB_INFLATE=y
1133CONFIG_ZLIB_DEFLATE=y
1134CONFIG_LZO_COMPRESS=y
1135CONFIG_LZO_DECOMPRESS=y
1136CONFIG_DECOMPRESS_GZIP=y
1137CONFIG_DECOMPRESS_BZIP2=y
1138CONFIG_DECOMPRESS_LZMA=y
1139CONFIG_HAS_IOMEM=y
1140CONFIG_HAS_IOPORT=y
1141CONFIG_HAS_DMA=y
1142CONFIG_NLATTR=y
diff --git a/arch/arm/configs/igep0020_defconfig b/arch/arm/configs/igep0020_defconfig
new file mode 100644
index 000000000000..c97f8d0ded48
--- /dev/null
+++ b/arch/arm/configs/igep0020_defconfig
@@ -0,0 +1,1554 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.32-rc6
4# Fri Nov 13 12:01:17 2009
5#
6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y
9CONFIG_GENERIC_TIME=y
10CONFIG_GENERIC_CLOCKEVENTS=y
11CONFIG_GENERIC_HARDIRQS=y
12CONFIG_STACKTRACE_SUPPORT=y
13CONFIG_HAVE_LATENCYTOP_SUPPORT=y
14CONFIG_LOCKDEP_SUPPORT=y
15CONFIG_TRACE_IRQFLAGS_SUPPORT=y
16CONFIG_HARDIRQS_SW_RESEND=y
17CONFIG_GENERIC_IRQ_PROBE=y
18CONFIG_RWSEM_GENERIC_SPINLOCK=y
19CONFIG_ARCH_HAS_CPUFREQ=y
20CONFIG_GENERIC_HWEIGHT=y
21CONFIG_GENERIC_CALIBRATE_DELAY=y
22CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
23CONFIG_VECTORS_BASE=0xffff0000
24CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
25CONFIG_CONSTRUCTORS=y
26
27#
28# General setup
29#
30CONFIG_EXPERIMENTAL=y
31CONFIG_BROKEN_ON_SMP=y
32CONFIG_INIT_ENV_ARG_LIMIT=32
33CONFIG_LOCALVERSION=""
34# CONFIG_LOCALVERSION_AUTO is not set
35CONFIG_SWAP=y
36CONFIG_SYSVIPC=y
37CONFIG_SYSVIPC_SYSCTL=y
38# CONFIG_POSIX_MQUEUE is not set
39CONFIG_BSD_PROCESS_ACCT=y
40# CONFIG_BSD_PROCESS_ACCT_V3 is not set
41# CONFIG_TASKSTATS is not set
42# CONFIG_AUDIT is not set
43
44#
45# RCU Subsystem
46#
47CONFIG_TREE_RCU=y
48# CONFIG_TREE_PREEMPT_RCU is not set
49# CONFIG_RCU_TRACE is not set
50CONFIG_RCU_FANOUT=32
51# CONFIG_RCU_FANOUT_EXACT is not set
52# CONFIG_TREE_RCU_TRACE is not set
53# CONFIG_IKCONFIG is not set
54CONFIG_LOG_BUF_SHIFT=17
55CONFIG_GROUP_SCHED=y
56CONFIG_FAIR_GROUP_SCHED=y
57# CONFIG_RT_GROUP_SCHED is not set
58CONFIG_USER_SCHED=y
59# CONFIG_CGROUP_SCHED is not set
60# CONFIG_CGROUPS is not set
61# CONFIG_SYSFS_DEPRECATED_V2 is not set
62# CONFIG_RELAY is not set
63# CONFIG_NAMESPACES is not set
64CONFIG_BLK_DEV_INITRD=y
65CONFIG_INITRAMFS_SOURCE=""
66CONFIG_RD_GZIP=y
67# CONFIG_RD_BZIP2 is not set
68# CONFIG_RD_LZMA is not set
69CONFIG_CC_OPTIMIZE_FOR_SIZE=y
70CONFIG_SYSCTL=y
71CONFIG_ANON_INODES=y
72CONFIG_EMBEDDED=y
73CONFIG_UID16=y
74# CONFIG_SYSCTL_SYSCALL is not set
75CONFIG_KALLSYMS=y
76# CONFIG_KALLSYMS_ALL is not set
77CONFIG_KALLSYMS_EXTRA_PASS=y
78CONFIG_HOTPLUG=y
79CONFIG_PRINTK=y
80CONFIG_BUG=y
81CONFIG_ELF_CORE=y
82CONFIG_BASE_FULL=y
83CONFIG_FUTEX=y
84CONFIG_EPOLL=y
85CONFIG_SIGNALFD=y
86CONFIG_TIMERFD=y
87CONFIG_EVENTFD=y
88CONFIG_SHMEM=y
89CONFIG_AIO=y
90
91#
92# Kernel Performance Events And Counters
93#
94CONFIG_VM_EVENT_COUNTERS=y
95CONFIG_COMPAT_BRK=y
96CONFIG_SLAB=y
97# CONFIG_SLUB is not set
98# CONFIG_SLOB is not set
99# CONFIG_PROFILING is not set
100CONFIG_HAVE_OPROFILE=y
101# CONFIG_KPROBES is not set
102CONFIG_HAVE_KPROBES=y
103CONFIG_HAVE_KRETPROBES=y
104CONFIG_HAVE_CLK=y
105
106#
107# GCOV-based kernel profiling
108#
109# CONFIG_SLOW_WORK is not set
110CONFIG_HAVE_GENERIC_DMA_COHERENT=y
111CONFIG_SLABINFO=y
112CONFIG_RT_MUTEXES=y
113CONFIG_BASE_SMALL=0
114CONFIG_MODULES=y
115# CONFIG_MODULE_FORCE_LOAD is not set
116CONFIG_MODULE_UNLOAD=y
117# CONFIG_MODULE_FORCE_UNLOAD is not set
118# CONFIG_MODVERSIONS is not set
119# CONFIG_MODULE_SRCVERSION_ALL is not set
120CONFIG_BLOCK=y
121CONFIG_LBDAF=y
122# CONFIG_BLK_DEV_BSG is not set
123# CONFIG_BLK_DEV_INTEGRITY is not set
124
125#
126# IO Schedulers
127#
128CONFIG_IOSCHED_NOOP=y
129CONFIG_IOSCHED_AS=y
130CONFIG_IOSCHED_DEADLINE=y
131CONFIG_IOSCHED_CFQ=y
132CONFIG_DEFAULT_AS=y
133# CONFIG_DEFAULT_DEADLINE is not set
134# CONFIG_DEFAULT_CFQ is not set
135# CONFIG_DEFAULT_NOOP is not set
136CONFIG_DEFAULT_IOSCHED="anticipatory"
137# CONFIG_FREEZER is not set
138
139#
140# System Type
141#
142CONFIG_MMU=y
143# CONFIG_ARCH_AAEC2000 is not set
144# CONFIG_ARCH_INTEGRATOR is not set
145# CONFIG_ARCH_REALVIEW is not set
146# CONFIG_ARCH_VERSATILE is not set
147# CONFIG_ARCH_AT91 is not set
148# CONFIG_ARCH_CLPS711X is not set
149# CONFIG_ARCH_GEMINI is not set
150# CONFIG_ARCH_EBSA110 is not set
151# CONFIG_ARCH_EP93XX is not set
152# CONFIG_ARCH_FOOTBRIDGE is not set
153# CONFIG_ARCH_MXC is not set
154# CONFIG_ARCH_STMP3XXX is not set
155# CONFIG_ARCH_NETX is not set
156# CONFIG_ARCH_H720X is not set
157# CONFIG_ARCH_NOMADIK is not set
158# CONFIG_ARCH_IOP13XX is not set
159# CONFIG_ARCH_IOP32X is not set
160# CONFIG_ARCH_IOP33X is not set
161# CONFIG_ARCH_IXP23XX is not set
162# CONFIG_ARCH_IXP2000 is not set
163# CONFIG_ARCH_IXP4XX is not set
164# CONFIG_ARCH_L7200 is not set
165# CONFIG_ARCH_KIRKWOOD is not set
166# CONFIG_ARCH_LOKI is not set
167# CONFIG_ARCH_MV78XX0 is not set
168# CONFIG_ARCH_ORION5X is not set
169# CONFIG_ARCH_MMP is not set
170# CONFIG_ARCH_KS8695 is not set
171# CONFIG_ARCH_NS9XXX is not set
172# CONFIG_ARCH_W90X900 is not set
173# CONFIG_ARCH_PNX4008 is not set
174# CONFIG_ARCH_PXA is not set
175# CONFIG_ARCH_MSM is not set
176# CONFIG_ARCH_RPC is not set
177# CONFIG_ARCH_SA1100 is not set
178# CONFIG_ARCH_S3C2410 is not set
179# CONFIG_ARCH_S3C64XX is not set
180# CONFIG_ARCH_S5PC1XX is not set
181# CONFIG_ARCH_SHARK is not set
182# CONFIG_ARCH_LH7A40X is not set
183# CONFIG_ARCH_U300 is not set
184# CONFIG_ARCH_DAVINCI is not set
185CONFIG_ARCH_OMAP=y
186# CONFIG_ARCH_BCMRING is not set
187
188#
189# TI OMAP Implementations
190#
191CONFIG_ARCH_OMAP_OTG=y
192# CONFIG_ARCH_OMAP1 is not set
193# CONFIG_ARCH_OMAP2 is not set
194CONFIG_ARCH_OMAP3=y
195# CONFIG_ARCH_OMAP4 is not set
196
197#
198# OMAP Feature Selections
199#
200# CONFIG_OMAP_DEBUG_POWERDOMAIN is not set
201# CONFIG_OMAP_DEBUG_CLOCKDOMAIN is not set
202# CONFIG_OMAP_RESET_CLOCKS is not set
203CONFIG_OMAP_MUX=y
204CONFIG_OMAP_MUX_DEBUG=y
205CONFIG_OMAP_MUX_WARNINGS=y
206CONFIG_OMAP_MCBSP=y
207# CONFIG_OMAP_MBOX_FWK is not set
208# CONFIG_OMAP_MPU_TIMER is not set
209CONFIG_OMAP_32K_TIMER=y
210CONFIG_OMAP_32K_TIMER_HZ=128
211CONFIG_OMAP_DM_TIMER=y
212# CONFIG_OMAP_LL_DEBUG_UART1 is not set
213# CONFIG_OMAP_LL_DEBUG_UART2 is not set
214CONFIG_OMAP_LL_DEBUG_UART3=y
215# CONFIG_OMAP_LL_DEBUG_NONE is not set
216# CONFIG_OMAP_PM_NONE is not set
217CONFIG_OMAP_PM_NOOP=y
218CONFIG_ARCH_OMAP34XX=y
219CONFIG_ARCH_OMAP3430=y
220
221#
222# OMAP Board Type
223#
224# CONFIG_MACH_OMAP3_BEAGLE is not set
225# CONFIG_MACH_OMAP_LDP is not set
226# CONFIG_MACH_OVERO is not set
227# CONFIG_MACH_OMAP3EVM is not set
228# CONFIG_MACH_OMAP3517EVM is not set
229# CONFIG_MACH_OMAP3_PANDORA is not set
230# CONFIG_MACH_OMAP_3430SDP is not set
231# CONFIG_MACH_NOKIA_RX51 is not set
232# CONFIG_MACH_OMAP_ZOOM2 is not set
233# CONFIG_MACH_CM_T35 is not set
234# CONFIG_MACH_OMAP_ZOOM3 is not set
235# CONFIG_MACH_OMAP_3630SDP is not set
236CONFIG_MACH_IGEP0020=y
237
238#
239# Processor Type
240#
241CONFIG_CPU_32=y
242CONFIG_CPU_32v6K=y
243CONFIG_CPU_V7=y
244CONFIG_CPU_32v7=y
245CONFIG_CPU_ABRT_EV7=y
246CONFIG_CPU_PABRT_V7=y
247CONFIG_CPU_CACHE_V7=y
248CONFIG_CPU_CACHE_VIPT=y
249CONFIG_CPU_COPY_V6=y
250CONFIG_CPU_TLB_V7=y
251CONFIG_CPU_HAS_ASID=y
252CONFIG_CPU_CP15=y
253CONFIG_CPU_CP15_MMU=y
254
255#
256# Processor Features
257#
258CONFIG_ARM_THUMB=y
259CONFIG_ARM_THUMBEE=y
260# CONFIG_CPU_ICACHE_DISABLE is not set
261# CONFIG_CPU_DCACHE_DISABLE is not set
262# CONFIG_CPU_BPREDICT_DISABLE is not set
263CONFIG_HAS_TLS_REG=y
264CONFIG_ARM_L1_CACHE_SHIFT=6
265# CONFIG_ARM_ERRATA_430973 is not set
266# CONFIG_ARM_ERRATA_458693 is not set
267# CONFIG_ARM_ERRATA_460075 is not set
268CONFIG_COMMON_CLKDEV=y
269
270#
271# Bus support
272#
273# CONFIG_PCI_SYSCALL is not set
274# CONFIG_ARCH_SUPPORTS_MSI is not set
275# CONFIG_PCCARD is not set
276
277#
278# Kernel Features
279#
280CONFIG_TICK_ONESHOT=y
281CONFIG_NO_HZ=y
282CONFIG_HIGH_RES_TIMERS=y
283CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
284CONFIG_VMSPLIT_3G=y
285# CONFIG_VMSPLIT_2G is not set
286# CONFIG_VMSPLIT_1G is not set
287CONFIG_PAGE_OFFSET=0xC0000000
288CONFIG_PREEMPT_NONE=y
289# CONFIG_PREEMPT_VOLUNTARY is not set
290# CONFIG_PREEMPT is not set
291CONFIG_HZ=128
292# CONFIG_THUMB2_KERNEL is not set
293CONFIG_AEABI=y
294# CONFIG_OABI_COMPAT is not set
295# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
296# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
297# CONFIG_HIGHMEM is not set
298CONFIG_SELECT_MEMORY_MODEL=y
299CONFIG_FLATMEM_MANUAL=y
300# CONFIG_DISCONTIGMEM_MANUAL is not set
301# CONFIG_SPARSEMEM_MANUAL is not set
302CONFIG_FLATMEM=y
303CONFIG_FLAT_NODE_MEM_MAP=y
304CONFIG_PAGEFLAGS_EXTENDED=y
305CONFIG_SPLIT_PTLOCK_CPUS=4
306# CONFIG_PHYS_ADDR_T_64BIT is not set
307CONFIG_ZONE_DMA_FLAG=0
308CONFIG_VIRT_TO_BUS=y
309CONFIG_HAVE_MLOCK=y
310CONFIG_HAVE_MLOCKED_PAGE_BIT=y
311# CONFIG_KSM is not set
312CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
313# CONFIG_LEDS is not set
314CONFIG_ALIGNMENT_TRAP=y
315# CONFIG_UACCESS_WITH_MEMCPY is not set
316
317#
318# Boot options
319#
320CONFIG_ZBOOT_ROM_TEXT=0x0
321CONFIG_ZBOOT_ROM_BSS=0x0
322CONFIG_CMDLINE=""
323# CONFIG_XIP_KERNEL is not set
324# CONFIG_KEXEC is not set
325
326#
327# CPU Power Management
328#
329# CONFIG_CPU_FREQ is not set
330# CONFIG_CPU_IDLE is not set
331
332#
333# Floating point emulation
334#
335
336#
337# At least one emulation must be selected
338#
339CONFIG_VFP=y
340CONFIG_VFPv3=y
341CONFIG_NEON=y
342
343#
344# Userspace binary formats
345#
346CONFIG_BINFMT_ELF=y
347# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
348CONFIG_HAVE_AOUT=y
349# CONFIG_BINFMT_AOUT is not set
350CONFIG_BINFMT_MISC=y
351
352#
353# Power management options
354#
355# CONFIG_PM is not set
356CONFIG_ARCH_SUSPEND_POSSIBLE=y
357CONFIG_NET=y
358
359#
360# Networking options
361#
362CONFIG_PACKET=y
363# CONFIG_PACKET_MMAP is not set
364CONFIG_UNIX=y
365CONFIG_XFRM=y
366CONFIG_XFRM_USER=y
367# CONFIG_XFRM_SUB_POLICY is not set
368CONFIG_XFRM_MIGRATE=y
369# CONFIG_XFRM_STATISTICS is not set
370CONFIG_NET_KEY=y
371CONFIG_NET_KEY_MIGRATE=y
372CONFIG_INET=y
373CONFIG_IP_MULTICAST=y
374# CONFIG_IP_ADVANCED_ROUTER is not set
375CONFIG_IP_FIB_HASH=y
376CONFIG_IP_PNP=y
377CONFIG_IP_PNP_DHCP=y
378CONFIG_IP_PNP_BOOTP=y
379CONFIG_IP_PNP_RARP=y
380# CONFIG_NET_IPIP is not set
381# CONFIG_NET_IPGRE is not set
382# CONFIG_IP_MROUTE is not set
383# CONFIG_ARPD is not set
384# CONFIG_SYN_COOKIES is not set
385# CONFIG_INET_AH is not set
386# CONFIG_INET_ESP is not set
387# CONFIG_INET_IPCOMP is not set
388# CONFIG_INET_XFRM_TUNNEL is not set
389# CONFIG_INET_TUNNEL is not set
390CONFIG_INET_XFRM_MODE_TRANSPORT=y
391CONFIG_INET_XFRM_MODE_TUNNEL=y
392CONFIG_INET_XFRM_MODE_BEET=y
393# CONFIG_INET_LRO is not set
394CONFIG_INET_DIAG=y
395CONFIG_INET_TCP_DIAG=y
396# CONFIG_TCP_CONG_ADVANCED is not set
397CONFIG_TCP_CONG_CUBIC=y
398CONFIG_DEFAULT_TCP_CONG="cubic"
399# CONFIG_TCP_MD5SIG is not set
400# CONFIG_IPV6 is not set
401# CONFIG_NETWORK_SECMARK is not set
402# CONFIG_NETFILTER is not set
403# CONFIG_IP_DCCP is not set
404# CONFIG_IP_SCTP is not set
405# CONFIG_RDS is not set
406# CONFIG_TIPC is not set
407# CONFIG_ATM is not set
408# CONFIG_BRIDGE is not set
409# CONFIG_NET_DSA is not set
410# CONFIG_VLAN_8021Q is not set
411# CONFIG_DECNET is not set
412# CONFIG_LLC2 is not set
413# CONFIG_IPX is not set
414# CONFIG_ATALK is not set
415# CONFIG_X25 is not set
416# CONFIG_LAPB is not set
417# CONFIG_ECONET is not set
418# CONFIG_WAN_ROUTER is not set
419# CONFIG_PHONET is not set
420# CONFIG_IEEE802154 is not set
421# CONFIG_NET_SCHED is not set
422# CONFIG_DCB is not set
423
424#
425# Network testing
426#
427# CONFIG_NET_PKTGEN is not set
428# CONFIG_HAMRADIO is not set
429# CONFIG_CAN is not set
430# CONFIG_IRDA is not set
431CONFIG_BT=m
432CONFIG_BT_L2CAP=m
433CONFIG_BT_SCO=m
434CONFIG_BT_RFCOMM=m
435CONFIG_BT_RFCOMM_TTY=y
436CONFIG_BT_BNEP=m
437CONFIG_BT_BNEP_MC_FILTER=y
438CONFIG_BT_BNEP_PROTO_FILTER=y
439CONFIG_BT_HIDP=m
440
441#
442# Bluetooth device drivers
443#
444CONFIG_BT_HCIBTUSB=m
445# CONFIG_BT_HCIBTSDIO is not set
446CONFIG_BT_HCIUART=m
447CONFIG_BT_HCIUART_H4=y
448CONFIG_BT_HCIUART_BCSP=y
449CONFIG_BT_HCIUART_LL=y
450CONFIG_BT_HCIBCM203X=m
451CONFIG_BT_HCIBPA10X=m
452CONFIG_BT_HCIBFUSB=m
453CONFIG_BT_HCIVHCI=m
454CONFIG_BT_MRVL=m
455CONFIG_BT_MRVL_SDIO=m
456# CONFIG_AF_RXRPC is not set
457CONFIG_WIRELESS=y
458CONFIG_CFG80211=m
459# CONFIG_NL80211_TESTMODE is not set
460# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set
461# CONFIG_CFG80211_REG_DEBUG is not set
462CONFIG_CFG80211_DEFAULT_PS=y
463CONFIG_CFG80211_DEFAULT_PS_VALUE=1
464# CONFIG_WIRELESS_OLD_REGULATORY is not set
465CONFIG_WIRELESS_EXT=y
466CONFIG_WIRELESS_EXT_SYSFS=y
467CONFIG_LIB80211=m
468CONFIG_LIB80211_CRYPT_WEP=m
469CONFIG_LIB80211_CRYPT_CCMP=m
470CONFIG_LIB80211_CRYPT_TKIP=m
471# CONFIG_LIB80211_DEBUG is not set
472CONFIG_MAC80211=m
473# CONFIG_MAC80211_RC_PID is not set
474CONFIG_MAC80211_RC_MINSTREL=y
475# CONFIG_MAC80211_RC_DEFAULT_PID is not set
476CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y
477CONFIG_MAC80211_RC_DEFAULT="minstrel"
478# CONFIG_MAC80211_MESH is not set
479# CONFIG_MAC80211_LEDS is not set
480# CONFIG_MAC80211_DEBUG_MENU is not set
481# CONFIG_WIMAX is not set
482# CONFIG_RFKILL is not set
483# CONFIG_NET_9P is not set
484
485#
486# Device Drivers
487#
488
489#
490# Generic Driver Options
491#
492CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
493# CONFIG_DEVTMPFS is not set
494# CONFIG_STANDALONE is not set
495CONFIG_PREVENT_FIRMWARE_BUILD=y
496CONFIG_FW_LOADER=y
497CONFIG_FIRMWARE_IN_KERNEL=y
498CONFIG_EXTRA_FIRMWARE=""
499# CONFIG_DEBUG_DRIVER is not set
500# CONFIG_DEBUG_DEVRES is not set
501# CONFIG_SYS_HYPERVISOR is not set
502CONFIG_CONNECTOR=y
503CONFIG_PROC_EVENTS=y
504# CONFIG_MTD is not set
505# CONFIG_PARPORT is not set
506CONFIG_BLK_DEV=y
507# CONFIG_BLK_DEV_COW_COMMON is not set
508CONFIG_BLK_DEV_LOOP=y
509# CONFIG_BLK_DEV_CRYPTOLOOP is not set
510# CONFIG_BLK_DEV_NBD is not set
511# CONFIG_BLK_DEV_UB is not set
512CONFIG_BLK_DEV_RAM=y
513CONFIG_BLK_DEV_RAM_COUNT=16
514CONFIG_BLK_DEV_RAM_SIZE=16384
515# CONFIG_BLK_DEV_XIP is not set
516# CONFIG_CDROM_PKTCDVD is not set
517# CONFIG_ATA_OVER_ETH is not set
518# CONFIG_MG_DISK is not set
519# CONFIG_MISC_DEVICES is not set
520CONFIG_EEPROM_93CX6=m
521CONFIG_HAVE_IDE=y
522# CONFIG_IDE is not set
523
524#
525# SCSI device support
526#
527# CONFIG_RAID_ATTRS is not set
528CONFIG_SCSI=y
529CONFIG_SCSI_DMA=y
530# CONFIG_SCSI_TGT is not set
531# CONFIG_SCSI_NETLINK is not set
532CONFIG_SCSI_PROC_FS=y
533
534#
535# SCSI support type (disk, tape, CD-ROM)
536#
537CONFIG_BLK_DEV_SD=y
538# CONFIG_CHR_DEV_ST is not set
539# CONFIG_CHR_DEV_OSST is not set
540# CONFIG_BLK_DEV_SR is not set
541# CONFIG_CHR_DEV_SG is not set
542# CONFIG_CHR_DEV_SCH is not set
543# CONFIG_SCSI_MULTI_LUN is not set
544# CONFIG_SCSI_CONSTANTS is not set
545# CONFIG_SCSI_LOGGING is not set
546# CONFIG_SCSI_SCAN_ASYNC is not set
547CONFIG_SCSI_WAIT_SCAN=m
548
549#
550# SCSI Transports
551#
552# CONFIG_SCSI_SPI_ATTRS is not set
553# CONFIG_SCSI_FC_ATTRS is not set
554# CONFIG_SCSI_ISCSI_ATTRS is not set
555# CONFIG_SCSI_SAS_LIBSAS is not set
556# CONFIG_SCSI_SRP_ATTRS is not set
557CONFIG_SCSI_LOWLEVEL=y
558# CONFIG_ISCSI_TCP is not set
559# CONFIG_LIBFC is not set
560# CONFIG_LIBFCOE is not set
561# CONFIG_SCSI_DEBUG is not set
562# CONFIG_SCSI_DH is not set
563# CONFIG_SCSI_OSD_INITIATOR is not set
564# CONFIG_ATA is not set
565# CONFIG_MD is not set
566CONFIG_NETDEVICES=y
567# CONFIG_DUMMY is not set
568# CONFIG_BONDING is not set
569# CONFIG_MACVLAN is not set
570# CONFIG_EQUALIZER is not set
571# CONFIG_TUN is not set
572# CONFIG_VETH is not set
573CONFIG_PHYLIB=y
574
575#
576# MII PHY device drivers
577#
578# CONFIG_MARVELL_PHY is not set
579# CONFIG_DAVICOM_PHY is not set
580# CONFIG_QSEMI_PHY is not set
581# CONFIG_LXT_PHY is not set
582# CONFIG_CICADA_PHY is not set
583# CONFIG_VITESSE_PHY is not set
584# CONFIG_SMSC_PHY is not set
585# CONFIG_BROADCOM_PHY is not set
586# CONFIG_ICPLUS_PHY is not set
587# CONFIG_REALTEK_PHY is not set
588# CONFIG_NATIONAL_PHY is not set
589# CONFIG_STE10XP is not set
590# CONFIG_LSI_ET1011C_PHY is not set
591# CONFIG_FIXED_PHY is not set
592# CONFIG_MDIO_BITBANG is not set
593CONFIG_NET_ETHERNET=y
594CONFIG_MII=y
595# CONFIG_AX88796 is not set
596# CONFIG_SMC91X is not set
597# CONFIG_DM9000 is not set
598# CONFIG_ENC28J60 is not set
599# CONFIG_ETHOC is not set
600# CONFIG_SMC911X is not set
601CONFIG_SMSC911X=y
602# CONFIG_DNET is not set
603# CONFIG_IBM_NEW_EMAC_ZMII is not set
604# CONFIG_IBM_NEW_EMAC_RGMII is not set
605# CONFIG_IBM_NEW_EMAC_TAH is not set
606# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
607# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
608# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
609# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
610# CONFIG_B44 is not set
611# CONFIG_KS8842 is not set
612# CONFIG_KS8851 is not set
613# CONFIG_KS8851_MLL is not set
614# CONFIG_NETDEV_1000 is not set
615# CONFIG_NETDEV_10000 is not set
616CONFIG_WLAN=y
617# CONFIG_WLAN_PRE80211 is not set
618CONFIG_WLAN_80211=y
619CONFIG_LIBERTAS=m
620CONFIG_LIBERTAS_USB=m
621CONFIG_LIBERTAS_SDIO=m
622# CONFIG_LIBERTAS_SPI is not set
623# CONFIG_LIBERTAS_DEBUG is not set
624# CONFIG_LIBERTAS_THINFIRM is not set
625CONFIG_AT76C50X_USB=m
626CONFIG_USB_ZD1201=m
627CONFIG_USB_NET_RNDIS_WLAN=m
628CONFIG_RTL8187=m
629# CONFIG_MAC80211_HWSIM is not set
630CONFIG_P54_COMMON=m
631CONFIG_P54_USB=m
632CONFIG_P54_SPI=m
633CONFIG_ATH_COMMON=m
634CONFIG_AR9170_USB=m
635CONFIG_HOSTAP=m
636CONFIG_HOSTAP_FIRMWARE=y
637CONFIG_HOSTAP_FIRMWARE_NVRAM=y
638CONFIG_B43=m
639# CONFIG_B43_SDIO is not set
640# CONFIG_B43_PHY_LP is not set
641CONFIG_B43_HWRNG=y
642# CONFIG_B43_DEBUG is not set
643CONFIG_B43LEGACY=m
644CONFIG_B43LEGACY_HWRNG=y
645# CONFIG_B43LEGACY_DEBUG is not set
646CONFIG_B43LEGACY_DMA=y
647CONFIG_B43LEGACY_PIO=y
648CONFIG_B43LEGACY_DMA_AND_PIO_MODE=y
649# CONFIG_B43LEGACY_DMA_MODE is not set
650# CONFIG_B43LEGACY_PIO_MODE is not set
651CONFIG_ZD1211RW=m
652# CONFIG_ZD1211RW_DEBUG is not set
653CONFIG_RT2X00=m
654CONFIG_RT2500USB=m
655CONFIG_RT73USB=m
656CONFIG_RT2800USB=m
657CONFIG_RT2X00_LIB_USB=m
658CONFIG_RT2X00_LIB=m
659CONFIG_RT2X00_LIB_HT=y
660CONFIG_RT2X00_LIB_FIRMWARE=y
661CONFIG_RT2X00_LIB_CRYPTO=y
662# CONFIG_RT2X00_DEBUG is not set
663CONFIG_WL12XX=m
664# CONFIG_WL1251 is not set
665# CONFIG_WL1271 is not set
666# CONFIG_IWM is not set
667
668#
669# Enable WiMAX (Networking options) to see the WiMAX drivers
670#
671
672#
673# USB Network Adapters
674#
675# CONFIG_USB_CATC is not set
676CONFIG_USB_KAWETH=m
677CONFIG_USB_PEGASUS=m
678# CONFIG_USB_RTL8150 is not set
679CONFIG_USB_USBNET=m
680CONFIG_USB_NET_AX8817X=m
681CONFIG_USB_NET_CDCETHER=m
682CONFIG_USB_NET_CDC_EEM=m
683CONFIG_USB_NET_DM9601=m
684CONFIG_USB_NET_SMSC95XX=m
685CONFIG_USB_NET_GL620A=m
686CONFIG_USB_NET_NET1080=m
687CONFIG_USB_NET_PLUSB=m
688CONFIG_USB_NET_MCS7830=m
689CONFIG_USB_NET_RNDIS_HOST=m
690CONFIG_USB_NET_CDC_SUBSET=m
691# CONFIG_USB_ALI_M5632 is not set
692# CONFIG_USB_AN2720 is not set
693CONFIG_USB_BELKIN=y
694CONFIG_USB_ARMLINUX=y
695# CONFIG_USB_EPSON2888 is not set
696# CONFIG_USB_KC2190 is not set
697CONFIG_USB_NET_ZAURUS=m
698# CONFIG_USB_NET_INT51X1 is not set
699# CONFIG_WAN is not set
700# CONFIG_PPP is not set
701# CONFIG_SLIP is not set
702# CONFIG_NETCONSOLE is not set
703# CONFIG_NETPOLL is not set
704# CONFIG_NET_POLL_CONTROLLER is not set
705# CONFIG_ISDN is not set
706# CONFIG_PHONE is not set
707
708#
709# Input device support
710#
711CONFIG_INPUT=y
712# CONFIG_INPUT_FF_MEMLESS is not set
713# CONFIG_INPUT_POLLDEV is not set
714
715#
716# Userland interfaces
717#
718# CONFIG_INPUT_MOUSEDEV is not set
719# CONFIG_INPUT_JOYDEV is not set
720CONFIG_INPUT_EVDEV=y
721# CONFIG_INPUT_EVBUG is not set
722
723#
724# Input Device Drivers
725#
726# CONFIG_INPUT_KEYBOARD is not set
727# CONFIG_INPUT_MOUSE is not set
728# CONFIG_INPUT_JOYSTICK is not set
729# CONFIG_INPUT_TABLET is not set
730# CONFIG_INPUT_TOUCHSCREEN is not set
731# CONFIG_INPUT_MISC is not set
732
733#
734# Hardware I/O ports
735#
736# CONFIG_SERIO is not set
737# CONFIG_GAMEPORT is not set
738
739#
740# Character devices
741#
742CONFIG_VT=y
743CONFIG_CONSOLE_TRANSLATIONS=y
744CONFIG_VT_CONSOLE=y
745CONFIG_HW_CONSOLE=y
746# CONFIG_VT_HW_CONSOLE_BINDING is not set
747CONFIG_DEVKMEM=y
748# CONFIG_SERIAL_NONSTANDARD is not set
749
750#
751# Serial drivers
752#
753CONFIG_SERIAL_8250=y
754CONFIG_SERIAL_8250_CONSOLE=y
755CONFIG_SERIAL_8250_NR_UARTS=32
756CONFIG_SERIAL_8250_RUNTIME_UARTS=4
757CONFIG_SERIAL_8250_EXTENDED=y
758CONFIG_SERIAL_8250_MANY_PORTS=y
759CONFIG_SERIAL_8250_SHARE_IRQ=y
760CONFIG_SERIAL_8250_DETECT_IRQ=y
761CONFIG_SERIAL_8250_RSA=y
762
763#
764# Non-8250 serial port support
765#
766# CONFIG_SERIAL_MAX3100 is not set
767CONFIG_SERIAL_CORE=y
768CONFIG_SERIAL_CORE_CONSOLE=y
769CONFIG_UNIX98_PTYS=y
770# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
771# CONFIG_LEGACY_PTYS is not set
772# CONFIG_IPMI_HANDLER is not set
773CONFIG_HW_RANDOM=y
774# CONFIG_HW_RANDOM_TIMERIOMEM is not set
775# CONFIG_R3964 is not set
776# CONFIG_RAW_DRIVER is not set
777# CONFIG_TCG_TPM is not set
778CONFIG_I2C=y
779CONFIG_I2C_BOARDINFO=y
780CONFIG_I2C_COMPAT=y
781CONFIG_I2C_CHARDEV=y
782CONFIG_I2C_HELPER_AUTO=y
783
784#
785# I2C Hardware Bus support
786#
787
788#
789# I2C system bus drivers (mostly embedded / system-on-chip)
790#
791# CONFIG_I2C_DESIGNWARE is not set
792# CONFIG_I2C_GPIO is not set
793# CONFIG_I2C_OCORES is not set
794CONFIG_I2C_OMAP=y
795# CONFIG_I2C_SIMTEC is not set
796
797#
798# External I2C/SMBus adapter drivers
799#
800# CONFIG_I2C_PARPORT_LIGHT is not set
801# CONFIG_I2C_TAOS_EVM is not set
802# CONFIG_I2C_TINY_USB is not set
803
804#
805# Other I2C/SMBus bus drivers
806#
807# CONFIG_I2C_PCA_PLATFORM is not set
808# CONFIG_I2C_STUB is not set
809
810#
811# Miscellaneous I2C Chip support
812#
813# CONFIG_DS1682 is not set
814# CONFIG_SENSORS_TSL2550 is not set
815# CONFIG_I2C_DEBUG_CORE is not set
816# CONFIG_I2C_DEBUG_ALGO is not set
817# CONFIG_I2C_DEBUG_BUS is not set
818# CONFIG_I2C_DEBUG_CHIP is not set
819CONFIG_SPI=y
820# CONFIG_SPI_DEBUG is not set
821CONFIG_SPI_MASTER=y
822
823#
824# SPI Master Controller Drivers
825#
826# CONFIG_SPI_BITBANG is not set
827# CONFIG_SPI_GPIO is not set
828CONFIG_SPI_OMAP24XX=y
829
830#
831# SPI Protocol Masters
832#
833# CONFIG_SPI_SPIDEV is not set
834# CONFIG_SPI_TLE62X0 is not set
835
836#
837# PPS support
838#
839# CONFIG_PPS is not set
840CONFIG_ARCH_REQUIRE_GPIOLIB=y
841CONFIG_GPIOLIB=y
842# CONFIG_DEBUG_GPIO is not set
843CONFIG_GPIO_SYSFS=y
844
845#
846# Memory mapped GPIO expanders:
847#
848
849#
850# I2C GPIO expanders:
851#
852# CONFIG_GPIO_MAX732X is not set
853# CONFIG_GPIO_PCA953X is not set
854# CONFIG_GPIO_PCF857X is not set
855CONFIG_GPIO_TWL4030=y
856
857#
858# PCI GPIO expanders:
859#
860
861#
862# SPI GPIO expanders:
863#
864# CONFIG_GPIO_MAX7301 is not set
865# CONFIG_GPIO_MCP23S08 is not set
866# CONFIG_GPIO_MC33880 is not set
867
868#
869# AC97 GPIO expanders:
870#
871# CONFIG_W1 is not set
872CONFIG_POWER_SUPPLY=y
873# CONFIG_POWER_SUPPLY_DEBUG is not set
874# CONFIG_PDA_POWER is not set
875# CONFIG_BATTERY_DS2760 is not set
876# CONFIG_BATTERY_DS2782 is not set
877# CONFIG_BATTERY_BQ27x00 is not set
878# CONFIG_BATTERY_MAX17040 is not set
879# CONFIG_HWMON is not set
880# CONFIG_THERMAL is not set
881# CONFIG_WATCHDOG is not set
882CONFIG_SSB_POSSIBLE=y
883
884#
885# Sonics Silicon Backplane
886#
887CONFIG_SSB=m
888CONFIG_SSB_SDIOHOST_POSSIBLE=y
889# CONFIG_SSB_SDIOHOST is not set
890# CONFIG_SSB_SILENT is not set
891# CONFIG_SSB_DEBUG is not set
892
893#
894# Multifunction device drivers
895#
896# CONFIG_MFD_CORE is not set
897# CONFIG_MFD_SM501 is not set
898# CONFIG_MFD_ASIC3 is not set
899# CONFIG_HTC_EGPIO is not set
900# CONFIG_HTC_PASIC3 is not set
901# CONFIG_TPS65010 is not set
902CONFIG_TWL4030_CORE=y
903# CONFIG_TWL4030_POWER is not set
904# CONFIG_MFD_TMIO is not set
905# CONFIG_MFD_T7L66XB is not set
906# CONFIG_MFD_TC6387XB is not set
907# CONFIG_MFD_TC6393XB is not set
908# CONFIG_PMIC_DA903X is not set
909# CONFIG_MFD_WM8400 is not set
910# CONFIG_MFD_WM831X is not set
911# CONFIG_MFD_WM8350_I2C is not set
912# CONFIG_MFD_PCF50633 is not set
913# CONFIG_MFD_MC13783 is not set
914# CONFIG_AB3100_CORE is not set
915# CONFIG_EZX_PCAP is not set
916CONFIG_REGULATOR=y
917# CONFIG_REGULATOR_DEBUG is not set
918# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
919# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
920# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set
921# CONFIG_REGULATOR_BQ24022 is not set
922# CONFIG_REGULATOR_MAX1586 is not set
923CONFIG_REGULATOR_TWL4030=y
924# CONFIG_REGULATOR_LP3971 is not set
925# CONFIG_REGULATOR_TPS65023 is not set
926# CONFIG_REGULATOR_TPS6507X is not set
927# CONFIG_MEDIA_SUPPORT is not set
928
929#
930# Graphics support
931#
932# CONFIG_VGASTATE is not set
933# CONFIG_VIDEO_OUTPUT_CONTROL is not set
934# CONFIG_FB is not set
935# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
936
937#
938# Display device support
939#
940# CONFIG_DISPLAY_SUPPORT is not set
941
942#
943# Console display driver support
944#
945# CONFIG_VGA_CONSOLE is not set
946CONFIG_DUMMY_CONSOLE=y
947# CONFIG_SOUND is not set
948CONFIG_HID_SUPPORT=y
949CONFIG_HID=y
950# CONFIG_HIDRAW is not set
951
952#
953# USB Input Devices
954#
955CONFIG_USB_HID=y
956# CONFIG_HID_PID is not set
957# CONFIG_USB_HIDDEV is not set
958
959#
960# Special HID drivers
961#
962# CONFIG_HID_A4TECH is not set
963# CONFIG_HID_APPLE is not set
964# CONFIG_HID_BELKIN is not set
965# CONFIG_HID_CHERRY is not set
966# CONFIG_HID_CHICONY is not set
967# CONFIG_HID_CYPRESS is not set
968# CONFIG_HID_DRAGONRISE is not set
969# CONFIG_HID_EZKEY is not set
970# CONFIG_HID_KYE is not set
971# CONFIG_HID_GYRATION is not set
972# CONFIG_HID_TWINHAN is not set
973# CONFIG_HID_KENSINGTON is not set
974# CONFIG_HID_LOGITECH is not set
975# CONFIG_HID_MICROSOFT is not set
976# CONFIG_HID_MONTEREY is not set
977# CONFIG_HID_NTRIG is not set
978# CONFIG_HID_PANTHERLORD is not set
979# CONFIG_HID_PETALYNX is not set
980# CONFIG_HID_SAMSUNG is not set
981# CONFIG_HID_SONY is not set
982# CONFIG_HID_SUNPLUS is not set
983# CONFIG_HID_GREENASIA is not set
984# CONFIG_HID_SMARTJOYPLUS is not set
985# CONFIG_HID_TOPSEED is not set
986# CONFIG_HID_THRUSTMASTER is not set
987# CONFIG_HID_WACOM is not set
988# CONFIG_HID_ZEROPLUS is not set
989CONFIG_USB_SUPPORT=y
990CONFIG_USB_ARCH_HAS_HCD=y
991CONFIG_USB_ARCH_HAS_OHCI=y
992# CONFIG_USB_ARCH_HAS_EHCI is not set
993CONFIG_USB=y
994# CONFIG_USB_DEBUG is not set
995CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
996
997#
998# Miscellaneous USB options
999#
1000# CONFIG_USB_DEVICEFS is not set
1001# CONFIG_USB_DEVICE_CLASS is not set
1002# CONFIG_USB_DYNAMIC_MINORS is not set
1003# CONFIG_USB_OTG is not set
1004# CONFIG_USB_OTG_WHITELIST is not set
1005# CONFIG_USB_OTG_BLACKLIST_HUB is not set
1006CONFIG_USB_MON=m
1007# CONFIG_USB_WUSB is not set
1008# CONFIG_USB_WUSB_CBAF is not set
1009
1010#
1011# USB Host Controller Drivers
1012#
1013# CONFIG_USB_C67X00_HCD is not set
1014# CONFIG_USB_OXU210HP_HCD is not set
1015# CONFIG_USB_ISP116X_HCD is not set
1016# CONFIG_USB_ISP1760_HCD is not set
1017# CONFIG_USB_ISP1362_HCD is not set
1018# CONFIG_USB_OHCI_HCD is not set
1019# CONFIG_USB_SL811_HCD is not set
1020# CONFIG_USB_R8A66597_HCD is not set
1021# CONFIG_USB_HWA_HCD is not set
1022CONFIG_USB_MUSB_HDRC=y
1023CONFIG_USB_MUSB_SOC=y
1024
1025#
1026# OMAP 343x high speed USB support
1027#
1028CONFIG_USB_MUSB_HOST=y
1029# CONFIG_USB_MUSB_PERIPHERAL is not set
1030# CONFIG_USB_MUSB_OTG is not set
1031# CONFIG_USB_GADGET_MUSB_HDRC is not set
1032CONFIG_USB_MUSB_HDRC_HCD=y
1033# CONFIG_MUSB_PIO_ONLY is not set
1034CONFIG_USB_INVENTRA_DMA=y
1035# CONFIG_USB_TI_CPPI_DMA is not set
1036# CONFIG_USB_MUSB_DEBUG is not set
1037
1038#
1039# USB Device Class drivers
1040#
1041# CONFIG_USB_ACM is not set
1042# CONFIG_USB_PRINTER is not set
1043# CONFIG_USB_WDM is not set
1044# CONFIG_USB_TMC is not set
1045
1046#
1047# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
1048#
1049
1050#
1051# also be needed; see USB_STORAGE Help for more info
1052#
1053CONFIG_USB_STORAGE=m
1054# CONFIG_USB_STORAGE_DEBUG is not set
1055# CONFIG_USB_STORAGE_DATAFAB is not set
1056# CONFIG_USB_STORAGE_FREECOM is not set
1057# CONFIG_USB_STORAGE_ISD200 is not set
1058# CONFIG_USB_STORAGE_USBAT is not set
1059# CONFIG_USB_STORAGE_SDDR09 is not set
1060# CONFIG_USB_STORAGE_SDDR55 is not set
1061# CONFIG_USB_STORAGE_JUMPSHOT is not set
1062# CONFIG_USB_STORAGE_ALAUDA is not set
1063# CONFIG_USB_STORAGE_ONETOUCH is not set
1064# CONFIG_USB_STORAGE_KARMA is not set
1065# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
1066# CONFIG_USB_LIBUSUAL is not set
1067
1068#
1069# USB Imaging devices
1070#
1071# CONFIG_USB_MDC800 is not set
1072# CONFIG_USB_MICROTEK is not set
1073
1074#
1075# USB port drivers
1076#
1077# CONFIG_USB_SERIAL is not set
1078
1079#
1080# USB Miscellaneous drivers
1081#
1082# CONFIG_USB_EMI62 is not set
1083# CONFIG_USB_EMI26 is not set
1084# CONFIG_USB_ADUTUX is not set
1085# CONFIG_USB_SEVSEG is not set
1086# CONFIG_USB_RIO500 is not set
1087# CONFIG_USB_LEGOTOWER is not set
1088# CONFIG_USB_LCD is not set
1089# CONFIG_USB_BERRY_CHARGE is not set
1090# CONFIG_USB_LED is not set
1091# CONFIG_USB_CYPRESS_CY7C63 is not set
1092# CONFIG_USB_CYTHERM is not set
1093# CONFIG_USB_IDMOUSE is not set
1094# CONFIG_USB_FTDI_ELAN is not set
1095# CONFIG_USB_APPLEDISPLAY is not set
1096# CONFIG_USB_SISUSBVGA is not set
1097# CONFIG_USB_LD is not set
1098# CONFIG_USB_TRANCEVIBRATOR is not set
1099# CONFIG_USB_IOWARRIOR is not set
1100# CONFIG_USB_TEST is not set
1101# CONFIG_USB_ISIGHTFW is not set
1102# CONFIG_USB_VST is not set
1103CONFIG_USB_GADGET=y
1104CONFIG_USB_GADGET_DEBUG=y
1105CONFIG_USB_GADGET_DEBUG_FILES=y
1106CONFIG_USB_GADGET_VBUS_DRAW=2
1107CONFIG_USB_GADGET_SELECTED=y
1108# CONFIG_USB_GADGET_AT91 is not set
1109# CONFIG_USB_GADGET_ATMEL_USBA is not set
1110# CONFIG_USB_GADGET_FSL_USB2 is not set
1111# CONFIG_USB_GADGET_LH7A40X is not set
1112CONFIG_USB_GADGET_OMAP=y
1113CONFIG_USB_OMAP=y
1114# CONFIG_USB_GADGET_PXA25X is not set
1115# CONFIG_USB_GADGET_R8A66597 is not set
1116# CONFIG_USB_GADGET_PXA27X is not set
1117# CONFIG_USB_GADGET_S3C_HSOTG is not set
1118# CONFIG_USB_GADGET_IMX is not set
1119# CONFIG_USB_GADGET_S3C2410 is not set
1120# CONFIG_USB_GADGET_M66592 is not set
1121# CONFIG_USB_GADGET_AMD5536UDC is not set
1122# CONFIG_USB_GADGET_FSL_QE is not set
1123# CONFIG_USB_GADGET_CI13XXX is not set
1124# CONFIG_USB_GADGET_NET2280 is not set
1125# CONFIG_USB_GADGET_GOKU is not set
1126# CONFIG_USB_GADGET_LANGWELL is not set
1127# CONFIG_USB_GADGET_DUMMY_HCD is not set
1128# CONFIG_USB_GADGET_DUALSPEED is not set
1129CONFIG_USB_ZERO=m
1130# CONFIG_USB_AUDIO is not set
1131# CONFIG_USB_ETH is not set
1132# CONFIG_USB_GADGETFS is not set
1133# CONFIG_USB_FILE_STORAGE is not set
1134# CONFIG_USB_G_SERIAL is not set
1135# CONFIG_USB_MIDI_GADGET is not set
1136# CONFIG_USB_G_PRINTER is not set
1137# CONFIG_USB_CDC_COMPOSITE is not set
1138
1139#
1140# OTG and related infrastructure
1141#
1142CONFIG_USB_OTG_UTILS=y
1143# CONFIG_USB_GPIO_VBUS is not set
1144# CONFIG_ISP1301_OMAP is not set
1145CONFIG_TWL4030_USB=y
1146# CONFIG_NOP_USB_XCEIV is not set
1147CONFIG_MMC=y
1148# CONFIG_MMC_DEBUG is not set
1149# CONFIG_MMC_UNSAFE_RESUME is not set
1150
1151#
1152# MMC/SD/SDIO Card Drivers
1153#
1154CONFIG_MMC_BLOCK=y
1155CONFIG_MMC_BLOCK_BOUNCE=y
1156# CONFIG_SDIO_UART is not set
1157# CONFIG_MMC_TEST is not set
1158
1159#
1160# MMC/SD/SDIO Host Controller Drivers
1161#
1162# CONFIG_MMC_SDHCI is not set
1163# CONFIG_MMC_OMAP is not set
1164CONFIG_MMC_OMAP_HS=y
1165# CONFIG_MMC_AT91 is not set
1166# CONFIG_MMC_ATMELMCI is not set
1167# CONFIG_MMC_SPI is not set
1168# CONFIG_MEMSTICK is not set
1169# CONFIG_NEW_LEDS is not set
1170# CONFIG_ACCESSIBILITY is not set
1171CONFIG_RTC_LIB=y
1172# CONFIG_RTC_CLASS is not set
1173# CONFIG_DMADEVICES is not set
1174# CONFIG_AUXDISPLAY is not set
1175# CONFIG_UIO is not set
1176
1177#
1178# TI VLYNQ
1179#
1180# CONFIG_STAGING is not set
1181
1182#
1183# File systems
1184#
1185CONFIG_EXT2_FS=y
1186# CONFIG_EXT2_FS_XATTR is not set
1187# CONFIG_EXT2_FS_XIP is not set
1188CONFIG_EXT3_FS=y
1189# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
1190# CONFIG_EXT3_FS_XATTR is not set
1191# CONFIG_EXT4_FS is not set
1192CONFIG_JBD=y
1193# CONFIG_REISERFS_FS is not set
1194# CONFIG_JFS_FS is not set
1195CONFIG_FS_POSIX_ACL=y
1196# CONFIG_XFS_FS is not set
1197# CONFIG_GFS2_FS is not set
1198# CONFIG_OCFS2_FS is not set
1199# CONFIG_BTRFS_FS is not set
1200# CONFIG_NILFS2_FS is not set
1201CONFIG_FILE_LOCKING=y
1202CONFIG_FSNOTIFY=y
1203CONFIG_DNOTIFY=y
1204CONFIG_INOTIFY=y
1205CONFIG_INOTIFY_USER=y
1206CONFIG_QUOTA=y
1207# CONFIG_QUOTA_NETLINK_INTERFACE is not set
1208CONFIG_PRINT_QUOTA_WARNING=y
1209CONFIG_QUOTA_TREE=y
1210# CONFIG_QFMT_V1 is not set
1211CONFIG_QFMT_V2=y
1212CONFIG_QUOTACTL=y
1213# CONFIG_AUTOFS_FS is not set
1214# CONFIG_AUTOFS4_FS is not set
1215# CONFIG_FUSE_FS is not set
1216
1217#
1218# Caches
1219#
1220# CONFIG_FSCACHE is not set
1221
1222#
1223# CD-ROM/DVD Filesystems
1224#
1225# CONFIG_ISO9660_FS is not set
1226# CONFIG_UDF_FS is not set
1227
1228#
1229# DOS/FAT/NT Filesystems
1230#
1231CONFIG_FAT_FS=y
1232CONFIG_MSDOS_FS=y
1233CONFIG_VFAT_FS=y
1234CONFIG_FAT_DEFAULT_CODEPAGE=437
1235CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1236# CONFIG_NTFS_FS is not set
1237
1238#
1239# Pseudo filesystems
1240#
1241CONFIG_PROC_FS=y
1242CONFIG_PROC_SYSCTL=y
1243CONFIG_PROC_PAGE_MONITOR=y
1244CONFIG_SYSFS=y
1245CONFIG_TMPFS=y
1246# CONFIG_TMPFS_POSIX_ACL is not set
1247# CONFIG_HUGETLB_PAGE is not set
1248# CONFIG_CONFIGFS_FS is not set
1249CONFIG_MISC_FILESYSTEMS=y
1250# CONFIG_ADFS_FS is not set
1251# CONFIG_AFFS_FS is not set
1252# CONFIG_HFS_FS is not set
1253# CONFIG_HFSPLUS_FS is not set
1254# CONFIG_BEFS_FS is not set
1255# CONFIG_BFS_FS is not set
1256# CONFIG_EFS_FS is not set
1257# CONFIG_CRAMFS is not set
1258# CONFIG_SQUASHFS is not set
1259# CONFIG_VXFS_FS is not set
1260# CONFIG_MINIX_FS is not set
1261# CONFIG_OMFS_FS is not set
1262# CONFIG_HPFS_FS is not set
1263# CONFIG_QNX4FS_FS is not set
1264# CONFIG_ROMFS_FS is not set
1265# CONFIG_SYSV_FS is not set
1266# CONFIG_UFS_FS is not set
1267CONFIG_NETWORK_FILESYSTEMS=y
1268CONFIG_NFS_FS=y
1269CONFIG_NFS_V3=y
1270CONFIG_NFS_V3_ACL=y
1271CONFIG_NFS_V4=y
1272# CONFIG_NFS_V4_1 is not set
1273CONFIG_ROOT_NFS=y
1274# CONFIG_NFSD is not set
1275CONFIG_LOCKD=y
1276CONFIG_LOCKD_V4=y
1277CONFIG_NFS_ACL_SUPPORT=y
1278CONFIG_NFS_COMMON=y
1279CONFIG_SUNRPC=y
1280CONFIG_SUNRPC_GSS=y
1281CONFIG_RPCSEC_GSS_KRB5=y
1282# CONFIG_RPCSEC_GSS_SPKM3 is not set
1283# CONFIG_SMB_FS is not set
1284# CONFIG_CIFS is not set
1285# CONFIG_NCP_FS is not set
1286# CONFIG_CODA_FS is not set
1287# CONFIG_AFS_FS is not set
1288
1289#
1290# Partition Types
1291#
1292CONFIG_PARTITION_ADVANCED=y
1293# CONFIG_ACORN_PARTITION is not set
1294# CONFIG_OSF_PARTITION is not set
1295# CONFIG_AMIGA_PARTITION is not set
1296# CONFIG_ATARI_PARTITION is not set
1297# CONFIG_MAC_PARTITION is not set
1298CONFIG_MSDOS_PARTITION=y
1299# CONFIG_BSD_DISKLABEL is not set
1300# CONFIG_MINIX_SUBPARTITION is not set
1301# CONFIG_SOLARIS_X86_PARTITION is not set
1302# CONFIG_UNIXWARE_DISKLABEL is not set
1303# CONFIG_LDM_PARTITION is not set
1304# CONFIG_SGI_PARTITION is not set
1305# CONFIG_ULTRIX_PARTITION is not set
1306# CONFIG_SUN_PARTITION is not set
1307# CONFIG_KARMA_PARTITION is not set
1308# CONFIG_EFI_PARTITION is not set
1309# CONFIG_SYSV68_PARTITION is not set
1310CONFIG_NLS=y
1311CONFIG_NLS_DEFAULT="iso8859-1"
1312CONFIG_NLS_CODEPAGE_437=y
1313# CONFIG_NLS_CODEPAGE_737 is not set
1314# CONFIG_NLS_CODEPAGE_775 is not set
1315# CONFIG_NLS_CODEPAGE_850 is not set
1316# CONFIG_NLS_CODEPAGE_852 is not set
1317# CONFIG_NLS_CODEPAGE_855 is not set
1318# CONFIG_NLS_CODEPAGE_857 is not set
1319# CONFIG_NLS_CODEPAGE_860 is not set
1320# CONFIG_NLS_CODEPAGE_861 is not set
1321# CONFIG_NLS_CODEPAGE_862 is not set
1322# CONFIG_NLS_CODEPAGE_863 is not set
1323# CONFIG_NLS_CODEPAGE_864 is not set
1324# CONFIG_NLS_CODEPAGE_865 is not set
1325# CONFIG_NLS_CODEPAGE_866 is not set
1326# CONFIG_NLS_CODEPAGE_869 is not set
1327# CONFIG_NLS_CODEPAGE_936 is not set
1328# CONFIG_NLS_CODEPAGE_950 is not set
1329# CONFIG_NLS_CODEPAGE_932 is not set
1330# CONFIG_NLS_CODEPAGE_949 is not set
1331# CONFIG_NLS_CODEPAGE_874 is not set
1332# CONFIG_NLS_ISO8859_8 is not set
1333# CONFIG_NLS_CODEPAGE_1250 is not set
1334# CONFIG_NLS_CODEPAGE_1251 is not set
1335# CONFIG_NLS_ASCII is not set
1336CONFIG_NLS_ISO8859_1=y
1337# CONFIG_NLS_ISO8859_2 is not set
1338# CONFIG_NLS_ISO8859_3 is not set
1339# CONFIG_NLS_ISO8859_4 is not set
1340# CONFIG_NLS_ISO8859_5 is not set
1341# CONFIG_NLS_ISO8859_6 is not set
1342# CONFIG_NLS_ISO8859_7 is not set
1343# CONFIG_NLS_ISO8859_9 is not set
1344# CONFIG_NLS_ISO8859_13 is not set
1345# CONFIG_NLS_ISO8859_14 is not set
1346# CONFIG_NLS_ISO8859_15 is not set
1347# CONFIG_NLS_KOI8_R is not set
1348# CONFIG_NLS_KOI8_U is not set
1349# CONFIG_NLS_UTF8 is not set
1350# CONFIG_DLM is not set
1351
1352#
1353# Kernel hacking
1354#
1355CONFIG_PRINTK_TIME=y
1356CONFIG_ENABLE_WARN_DEPRECATED=y
1357CONFIG_ENABLE_MUST_CHECK=y
1358CONFIG_FRAME_WARN=1024
1359CONFIG_MAGIC_SYSRQ=y
1360# CONFIG_STRIP_ASM_SYMS is not set
1361# CONFIG_UNUSED_SYMBOLS is not set
1362# CONFIG_DEBUG_FS is not set
1363# CONFIG_HEADERS_CHECK is not set
1364CONFIG_DEBUG_KERNEL=y
1365# CONFIG_DEBUG_SHIRQ is not set
1366CONFIG_DETECT_SOFTLOCKUP=y
1367# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1368CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
1369CONFIG_DETECT_HUNG_TASK=y
1370# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
1371CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
1372CONFIG_SCHED_DEBUG=y
1373# CONFIG_SCHEDSTATS is not set
1374# CONFIG_TIMER_STATS is not set
1375# CONFIG_DEBUG_OBJECTS is not set
1376# CONFIG_DEBUG_SLAB is not set
1377# CONFIG_DEBUG_KMEMLEAK is not set
1378# CONFIG_DEBUG_RT_MUTEXES is not set
1379# CONFIG_RT_MUTEX_TESTER is not set
1380# CONFIG_DEBUG_SPINLOCK is not set
1381CONFIG_DEBUG_MUTEXES=y
1382# CONFIG_DEBUG_LOCK_ALLOC is not set
1383# CONFIG_PROVE_LOCKING is not set
1384# CONFIG_LOCK_STAT is not set
1385# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1386# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1387# CONFIG_DEBUG_KOBJECT is not set
1388# CONFIG_DEBUG_BUGVERBOSE is not set
1389CONFIG_DEBUG_INFO=y
1390# CONFIG_DEBUG_VM is not set
1391# CONFIG_DEBUG_WRITECOUNT is not set
1392# CONFIG_DEBUG_MEMORY_INIT is not set
1393# CONFIG_DEBUG_LIST is not set
1394# CONFIG_DEBUG_SG is not set
1395# CONFIG_DEBUG_NOTIFIERS is not set
1396# CONFIG_DEBUG_CREDENTIALS is not set
1397# CONFIG_BOOT_PRINTK_DELAY is not set
1398# CONFIG_RCU_TORTURE_TEST is not set
1399# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1400# CONFIG_BACKTRACE_SELF_TEST is not set
1401# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1402# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
1403# CONFIG_FAULT_INJECTION is not set
1404# CONFIG_LATENCYTOP is not set
1405# CONFIG_PAGE_POISONING is not set
1406CONFIG_HAVE_FUNCTION_TRACER=y
1407CONFIG_TRACING_SUPPORT=y
1408CONFIG_FTRACE=y
1409# CONFIG_FUNCTION_TRACER is not set
1410# CONFIG_IRQSOFF_TRACER is not set
1411# CONFIG_SCHED_TRACER is not set
1412# CONFIG_ENABLE_DEFAULT_TRACERS is not set
1413# CONFIG_BOOT_TRACER is not set
1414CONFIG_BRANCH_PROFILE_NONE=y
1415# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1416# CONFIG_PROFILE_ALL_BRANCHES is not set
1417# CONFIG_STACK_TRACER is not set
1418# CONFIG_KMEMTRACE is not set
1419# CONFIG_WORKQUEUE_TRACER is not set
1420# CONFIG_BLK_DEV_IO_TRACE is not set
1421# CONFIG_SAMPLES is not set
1422CONFIG_HAVE_ARCH_KGDB=y
1423# CONFIG_KGDB is not set
1424CONFIG_ARM_UNWIND=y
1425# CONFIG_DEBUG_USER is not set
1426# CONFIG_DEBUG_ERRORS is not set
1427# CONFIG_DEBUG_STACK_USAGE is not set
1428CONFIG_DEBUG_LL=y
1429# CONFIG_DEBUG_ICEDCC is not set
1430
1431#
1432# Security options
1433#
1434# CONFIG_KEYS is not set
1435# CONFIG_SECURITY is not set
1436# CONFIG_SECURITYFS is not set
1437# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1438CONFIG_CRYPTO=y
1439
1440#
1441# Crypto core or helper
1442#
1443CONFIG_CRYPTO_ALGAPI=y
1444CONFIG_CRYPTO_ALGAPI2=y
1445CONFIG_CRYPTO_AEAD2=y
1446CONFIG_CRYPTO_BLKCIPHER=y
1447CONFIG_CRYPTO_BLKCIPHER2=y
1448CONFIG_CRYPTO_HASH=y
1449CONFIG_CRYPTO_HASH2=y
1450CONFIG_CRYPTO_RNG2=y
1451CONFIG_CRYPTO_PCOMP=y
1452CONFIG_CRYPTO_MANAGER=y
1453CONFIG_CRYPTO_MANAGER2=y
1454# CONFIG_CRYPTO_GF128MUL is not set
1455# CONFIG_CRYPTO_NULL is not set
1456CONFIG_CRYPTO_WORKQUEUE=y
1457# CONFIG_CRYPTO_CRYPTD is not set
1458# CONFIG_CRYPTO_AUTHENC is not set
1459# CONFIG_CRYPTO_TEST is not set
1460
1461#
1462# Authenticated Encryption with Associated Data
1463#
1464# CONFIG_CRYPTO_CCM is not set
1465# CONFIG_CRYPTO_GCM is not set
1466# CONFIG_CRYPTO_SEQIV is not set
1467
1468#
1469# Block modes
1470#
1471CONFIG_CRYPTO_CBC=y
1472# CONFIG_CRYPTO_CTR is not set
1473# CONFIG_CRYPTO_CTS is not set
1474CONFIG_CRYPTO_ECB=y
1475# CONFIG_CRYPTO_LRW is not set
1476CONFIG_CRYPTO_PCBC=m
1477# CONFIG_CRYPTO_XTS is not set
1478
1479#
1480# Hash modes
1481#
1482# CONFIG_CRYPTO_HMAC is not set
1483# CONFIG_CRYPTO_XCBC is not set
1484# CONFIG_CRYPTO_VMAC is not set
1485
1486#
1487# Digest
1488#
1489CONFIG_CRYPTO_CRC32C=y
1490# CONFIG_CRYPTO_GHASH is not set
1491# CONFIG_CRYPTO_MD4 is not set
1492CONFIG_CRYPTO_MD5=y
1493CONFIG_CRYPTO_MICHAEL_MIC=m
1494# CONFIG_CRYPTO_RMD128 is not set
1495# CONFIG_CRYPTO_RMD160 is not set
1496# CONFIG_CRYPTO_RMD256 is not set
1497# CONFIG_CRYPTO_RMD320 is not set
1498# CONFIG_CRYPTO_SHA1 is not set
1499# CONFIG_CRYPTO_SHA256 is not set
1500# CONFIG_CRYPTO_SHA512 is not set
1501# CONFIG_CRYPTO_TGR192 is not set
1502# CONFIG_CRYPTO_WP512 is not set
1503
1504#
1505# Ciphers
1506#
1507CONFIG_CRYPTO_AES=y
1508# CONFIG_CRYPTO_ANUBIS is not set
1509CONFIG_CRYPTO_ARC4=y
1510# CONFIG_CRYPTO_BLOWFISH is not set
1511# CONFIG_CRYPTO_CAMELLIA is not set
1512# CONFIG_CRYPTO_CAST5 is not set
1513# CONFIG_CRYPTO_CAST6 is not set
1514CONFIG_CRYPTO_DES=y
1515# CONFIG_CRYPTO_FCRYPT is not set
1516# CONFIG_CRYPTO_KHAZAD is not set
1517# CONFIG_CRYPTO_SALSA20 is not set
1518# CONFIG_CRYPTO_SEED is not set
1519# CONFIG_CRYPTO_SERPENT is not set
1520# CONFIG_CRYPTO_TEA is not set
1521# CONFIG_CRYPTO_TWOFISH is not set
1522
1523#
1524# Compression
1525#
1526# CONFIG_CRYPTO_DEFLATE is not set
1527# CONFIG_CRYPTO_ZLIB is not set
1528# CONFIG_CRYPTO_LZO is not set
1529
1530#
1531# Random Number Generation
1532#
1533# CONFIG_CRYPTO_ANSI_CPRNG is not set
1534CONFIG_CRYPTO_HW=y
1535# CONFIG_BINARY_PRINTF is not set
1536
1537#
1538# Library routines
1539#
1540CONFIG_BITREVERSE=y
1541CONFIG_GENERIC_FIND_LAST_BIT=y
1542CONFIG_CRC_CCITT=y
1543CONFIG_CRC16=m
1544CONFIG_CRC_T10DIF=y
1545CONFIG_CRC_ITU_T=m
1546CONFIG_CRC32=y
1547# CONFIG_CRC7 is not set
1548CONFIG_LIBCRC32C=y
1549CONFIG_ZLIB_INFLATE=y
1550CONFIG_DECOMPRESS_GZIP=y
1551CONFIG_HAS_IOMEM=y
1552CONFIG_HAS_IOPORT=y
1553CONFIG_HAS_DMA=y
1554CONFIG_NLATTR=y
diff --git a/arch/arm/configs/mx3_defconfig b/arch/arm/configs/mx3_defconfig
index a4f9a2a8149c..7734ccab2119 100644
--- a/arch/arm/configs/mx3_defconfig
+++ b/arch/arm/configs/mx3_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.31-rc4 3# Linux kernel version: 2.6.32-rc5
4# Tue Jul 28 14:11:34 2009 4# Sun Nov 1 22:56:24 2009
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_HAVE_PWM=y 7CONFIG_HAVE_PWM=y
@@ -9,7 +9,6 @@ CONFIG_SYS_SUPPORTS_APM_EMULATION=y
9CONFIG_GENERIC_GPIO=y 9CONFIG_GENERIC_GPIO=y
10CONFIG_GENERIC_TIME=y 10CONFIG_GENERIC_TIME=y
11CONFIG_GENERIC_CLOCKEVENTS=y 11CONFIG_GENERIC_CLOCKEVENTS=y
12CONFIG_MMU=y
13CONFIG_GENERIC_HARDIRQS=y 12CONFIG_GENERIC_HARDIRQS=y
14CONFIG_STACKTRACE_SUPPORT=y 13CONFIG_STACKTRACE_SUPPORT=y
15CONFIG_HAVE_LATENCYTOP_SUPPORT=y 14CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -46,11 +45,12 @@ CONFIG_SYSVIPC_SYSCTL=y
46# 45#
47# RCU Subsystem 46# RCU Subsystem
48# 47#
49CONFIG_CLASSIC_RCU=y 48CONFIG_TREE_RCU=y
50# CONFIG_TREE_RCU is not set 49# CONFIG_TREE_PREEMPT_RCU is not set
51# CONFIG_PREEMPT_RCU is not set 50# CONFIG_RCU_TRACE is not set
51CONFIG_RCU_FANOUT=32
52# CONFIG_RCU_FANOUT_EXACT is not set
52# CONFIG_TREE_RCU_TRACE is not set 53# CONFIG_TREE_RCU_TRACE is not set
53# CONFIG_PREEMPT_RCU_TRACE is not set
54CONFIG_IKCONFIG=y 54CONFIG_IKCONFIG=y
55CONFIG_IKCONFIG_PROC=y 55CONFIG_IKCONFIG_PROC=y
56CONFIG_LOG_BUF_SHIFT=14 56CONFIG_LOG_BUF_SHIFT=14
@@ -87,16 +87,14 @@ CONFIG_SHMEM=y
87CONFIG_AIO=y 87CONFIG_AIO=y
88 88
89# 89#
90# Performance Counters 90# Kernel Performance Events And Counters
91# 91#
92CONFIG_VM_EVENT_COUNTERS=y 92CONFIG_VM_EVENT_COUNTERS=y
93# CONFIG_STRIP_ASM_SYMS is not set
94CONFIG_COMPAT_BRK=y 93CONFIG_COMPAT_BRK=y
95CONFIG_SLAB=y 94CONFIG_SLAB=y
96# CONFIG_SLUB is not set 95# CONFIG_SLUB is not set
97# CONFIG_SLOB is not set 96# CONFIG_SLOB is not set
98# CONFIG_PROFILING is not set 97# CONFIG_PROFILING is not set
99# CONFIG_MARKERS is not set
100CONFIG_HAVE_OPROFILE=y 98CONFIG_HAVE_OPROFILE=y
101# CONFIG_KPROBES is not set 99# CONFIG_KPROBES is not set
102CONFIG_HAVE_KPROBES=y 100CONFIG_HAVE_KPROBES=y
@@ -139,6 +137,7 @@ CONFIG_FREEZER=y
139# 137#
140# System Type 138# System Type
141# 139#
140CONFIG_MMU=y
142# CONFIG_ARCH_AAEC2000 is not set 141# CONFIG_ARCH_AAEC2000 is not set
143# CONFIG_ARCH_INTEGRATOR is not set 142# CONFIG_ARCH_INTEGRATOR is not set
144# CONFIG_ARCH_REALVIEW is not set 143# CONFIG_ARCH_REALVIEW is not set
@@ -153,6 +152,7 @@ CONFIG_ARCH_MXC=y
153# CONFIG_ARCH_STMP3XXX is not set 152# CONFIG_ARCH_STMP3XXX is not set
154# CONFIG_ARCH_NETX is not set 153# CONFIG_ARCH_NETX is not set
155# CONFIG_ARCH_H720X is not set 154# CONFIG_ARCH_H720X is not set
155# CONFIG_ARCH_NOMADIK is not set
156# CONFIG_ARCH_IOP13XX is not set 156# CONFIG_ARCH_IOP13XX is not set
157# CONFIG_ARCH_IOP32X is not set 157# CONFIG_ARCH_IOP32X is not set
158# CONFIG_ARCH_IOP33X is not set 158# CONFIG_ARCH_IOP33X is not set
@@ -175,18 +175,22 @@ CONFIG_ARCH_MXC=y
175# CONFIG_ARCH_SA1100 is not set 175# CONFIG_ARCH_SA1100 is not set
176# CONFIG_ARCH_S3C2410 is not set 176# CONFIG_ARCH_S3C2410 is not set
177# CONFIG_ARCH_S3C64XX is not set 177# CONFIG_ARCH_S3C64XX is not set
178# CONFIG_ARCH_S5PC1XX is not set
178# CONFIG_ARCH_SHARK is not set 179# CONFIG_ARCH_SHARK is not set
179# CONFIG_ARCH_LH7A40X is not set 180# CONFIG_ARCH_LH7A40X is not set
180# CONFIG_ARCH_U300 is not set 181# CONFIG_ARCH_U300 is not set
181# CONFIG_ARCH_DAVINCI is not set 182# CONFIG_ARCH_DAVINCI is not set
182# CONFIG_ARCH_OMAP is not set 183# CONFIG_ARCH_OMAP is not set
184# CONFIG_ARCH_BCMRING is not set
183 185
184# 186#
185# Freescale MXC Implementations 187# Freescale MXC Implementations
186# 188#
187# CONFIG_ARCH_MX1 is not set 189# CONFIG_ARCH_MX1 is not set
188# CONFIG_ARCH_MX2 is not set 190# CONFIG_ARCH_MX2 is not set
191# CONFIG_ARCH_MX25 is not set
189CONFIG_ARCH_MX3=y 192CONFIG_ARCH_MX3=y
193# CONFIG_ARCH_MXC91231 is not set
190CONFIG_ARCH_MX31=y 194CONFIG_ARCH_MX31=y
191CONFIG_ARCH_MX35=y 195CONFIG_ARCH_MX35=y
192 196
@@ -205,6 +209,7 @@ CONFIG_MACH_QONG=y
205CONFIG_MACH_PCM043=y 209CONFIG_MACH_PCM043=y
206CONFIG_MACH_ARMADILLO5X0=y 210CONFIG_MACH_ARMADILLO5X0=y
207CONFIG_MACH_MX35_3DS=y 211CONFIG_MACH_MX35_3DS=y
212CONFIG_MACH_KZM_ARM11_01=y
208CONFIG_MXC_IRQ_PRIOR=y 213CONFIG_MXC_IRQ_PRIOR=y
209CONFIG_MXC_PWM=y 214CONFIG_MXC_PWM=y
210CONFIG_ARCH_HAS_RNGA=y 215CONFIG_ARCH_HAS_RNGA=y
@@ -218,7 +223,7 @@ CONFIG_CPU_V6=y
218# CONFIG_CPU_32v6K is not set 223# CONFIG_CPU_32v6K is not set
219CONFIG_CPU_32v6=y 224CONFIG_CPU_32v6=y
220CONFIG_CPU_ABRT_EV6=y 225CONFIG_CPU_ABRT_EV6=y
221CONFIG_CPU_PABRT_NOIFAR=y 226CONFIG_CPU_PABRT_V6=y
222CONFIG_CPU_CACHE_V6=y 227CONFIG_CPU_CACHE_V6=y
223CONFIG_CPU_CACHE_VIPT=y 228CONFIG_CPU_CACHE_VIPT=y
224CONFIG_CPU_COPY_V6=y 229CONFIG_CPU_COPY_V6=y
@@ -236,6 +241,7 @@ CONFIG_ARM_THUMB=y
236# CONFIG_CPU_BPREDICT_DISABLE is not set 241# CONFIG_CPU_BPREDICT_DISABLE is not set
237CONFIG_OUTER_CACHE=y 242CONFIG_OUTER_CACHE=y
238CONFIG_CACHE_L2X0=y 243CONFIG_CACHE_L2X0=y
244CONFIG_ARM_L1_CACHE_SHIFT=5
239# CONFIG_ARM_ERRATA_411920 is not set 245# CONFIG_ARM_ERRATA_411920 is not set
240CONFIG_COMMON_CLKDEV=y 246CONFIG_COMMON_CLKDEV=y
241 247
@@ -257,6 +263,8 @@ CONFIG_VMSPLIT_3G=y
257# CONFIG_VMSPLIT_2G is not set 263# CONFIG_VMSPLIT_2G is not set
258# CONFIG_VMSPLIT_1G is not set 264# CONFIG_VMSPLIT_1G is not set
259CONFIG_PAGE_OFFSET=0xC0000000 265CONFIG_PAGE_OFFSET=0xC0000000
266# CONFIG_PREEMPT_NONE is not set
267# CONFIG_PREEMPT_VOLUNTARY is not set
260CONFIG_PREEMPT=y 268CONFIG_PREEMPT=y
261CONFIG_HZ=100 269CONFIG_HZ=100
262CONFIG_AEABI=y 270CONFIG_AEABI=y
@@ -277,6 +285,7 @@ CONFIG_ZONE_DMA_FLAG=0
277CONFIG_VIRT_TO_BUS=y 285CONFIG_VIRT_TO_BUS=y
278CONFIG_HAVE_MLOCK=y 286CONFIG_HAVE_MLOCK=y
279CONFIG_HAVE_MLOCKED_PAGE_BIT=y 287CONFIG_HAVE_MLOCKED_PAGE_BIT=y
288# CONFIG_KSM is not set
280CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 289CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
281CONFIG_ALIGNMENT_TRAP=y 290CONFIG_ALIGNMENT_TRAP=y
282# CONFIG_UACCESS_WITH_MEMCPY is not set 291# CONFIG_UACCESS_WITH_MEMCPY is not set
@@ -326,6 +335,7 @@ CONFIG_PM_SLEEP=y
326CONFIG_SUSPEND=y 335CONFIG_SUSPEND=y
327CONFIG_SUSPEND_FREEZER=y 336CONFIG_SUSPEND_FREEZER=y
328# CONFIG_APM_EMULATION is not set 337# CONFIG_APM_EMULATION is not set
338# CONFIG_PM_RUNTIME is not set
329CONFIG_ARCH_SUSPEND_POSSIBLE=y 339CONFIG_ARCH_SUSPEND_POSSIBLE=y
330CONFIG_NET=y 340CONFIG_NET=y
331 341
@@ -367,6 +377,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
367# CONFIG_NETFILTER is not set 377# CONFIG_NETFILTER is not set
368# CONFIG_IP_DCCP is not set 378# CONFIG_IP_DCCP is not set
369# CONFIG_IP_SCTP is not set 379# CONFIG_IP_SCTP is not set
380# CONFIG_RDS is not set
370# CONFIG_TIPC is not set 381# CONFIG_TIPC is not set
371# CONFIG_ATM is not set 382# CONFIG_ATM is not set
372# CONFIG_BRIDGE is not set 383# CONFIG_BRIDGE is not set
@@ -407,6 +418,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
407# Generic Driver Options 418# Generic Driver Options
408# 419#
409CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 420CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
421# CONFIG_DEVTMPFS is not set
410CONFIG_STANDALONE=y 422CONFIG_STANDALONE=y
411CONFIG_PREVENT_FIRMWARE_BUILD=y 423CONFIG_PREVENT_FIRMWARE_BUILD=y
412CONFIG_FW_LOADER=m 424CONFIG_FW_LOADER=m
@@ -416,9 +428,9 @@ CONFIG_EXTRA_FIRMWARE=""
416# CONFIG_CONNECTOR is not set 428# CONFIG_CONNECTOR is not set
417CONFIG_MTD=y 429CONFIG_MTD=y
418# CONFIG_MTD_DEBUG is not set 430# CONFIG_MTD_DEBUG is not set
431# CONFIG_MTD_TESTS is not set
419# CONFIG_MTD_CONCAT is not set 432# CONFIG_MTD_CONCAT is not set
420CONFIG_MTD_PARTITIONS=y 433CONFIG_MTD_PARTITIONS=y
421# CONFIG_MTD_TESTS is not set
422# CONFIG_MTD_REDBOOT_PARTS is not set 434# CONFIG_MTD_REDBOOT_PARTS is not set
423CONFIG_MTD_CMDLINE_PARTS=y 435CONFIG_MTD_CMDLINE_PARTS=y
424# CONFIG_MTD_AFS_PARTS is not set 436# CONFIG_MTD_AFS_PARTS is not set
@@ -587,14 +599,12 @@ CONFIG_DNET=y
587# CONFIG_B44 is not set 599# CONFIG_B44 is not set
588# CONFIG_CS89x0 is not set 600# CONFIG_CS89x0 is not set
589# CONFIG_KS8842 is not set 601# CONFIG_KS8842 is not set
602# CONFIG_KS8851_MLL is not set
590CONFIG_FEC=y 603CONFIG_FEC=y
591# CONFIG_FEC2 is not set 604# CONFIG_FEC2 is not set
592# CONFIG_NETDEV_1000 is not set 605# CONFIG_NETDEV_1000 is not set
593# CONFIG_NETDEV_10000 is not set 606# CONFIG_NETDEV_10000 is not set
594 607CONFIG_WLAN=y
595#
596# Wireless LAN
597#
598# CONFIG_WLAN_PRE80211 is not set 608# CONFIG_WLAN_PRE80211 is not set
599# CONFIG_WLAN_80211 is not set 609# CONFIG_WLAN_80211 is not set
600 610
@@ -608,6 +618,7 @@ CONFIG_FEC=y
608# CONFIG_NETPOLL is not set 618# CONFIG_NETPOLL is not set
609# CONFIG_NET_POLL_CONTROLLER is not set 619# CONFIG_NET_POLL_CONTROLLER is not set
610# CONFIG_ISDN is not set 620# CONFIG_ISDN is not set
621# CONFIG_PHONE is not set
611 622
612# 623#
613# Input device support 624# Input device support
@@ -630,7 +641,14 @@ CONFIG_DEVKMEM=y
630# 641#
631# Serial drivers 642# Serial drivers
632# 643#
633# CONFIG_SERIAL_8250 is not set 644CONFIG_SERIAL_8250=m
645CONFIG_SERIAL_8250_NR_UARTS=4
646CONFIG_SERIAL_8250_RUNTIME_UARTS=4
647CONFIG_SERIAL_8250_EXTENDED=y
648# CONFIG_SERIAL_8250_MANY_PORTS is not set
649CONFIG_SERIAL_8250_SHARE_IRQ=y
650# CONFIG_SERIAL_8250_DETECT_IRQ is not set
651# CONFIG_SERIAL_8250_RSA is not set
634 652
635# 653#
636# Non-8250 serial port support 654# Non-8250 serial port support
@@ -649,6 +667,7 @@ CONFIG_UNIX98_PTYS=y
649# CONFIG_TCG_TPM is not set 667# CONFIG_TCG_TPM is not set
650CONFIG_I2C=y 668CONFIG_I2C=y
651CONFIG_I2C_BOARDINFO=y 669CONFIG_I2C_BOARDINFO=y
670CONFIG_I2C_COMPAT=y
652CONFIG_I2C_CHARDEV=y 671CONFIG_I2C_CHARDEV=y
653CONFIG_I2C_HELPER_AUTO=y 672CONFIG_I2C_HELPER_AUTO=y
654 673
@@ -681,15 +700,17 @@ CONFIG_I2C_IMX=y
681# Miscellaneous I2C Chip support 700# Miscellaneous I2C Chip support
682# 701#
683# CONFIG_DS1682 is not set 702# CONFIG_DS1682 is not set
684# CONFIG_SENSORS_PCF8574 is not set
685# CONFIG_PCF8575 is not set
686# CONFIG_SENSORS_PCA9539 is not set
687# CONFIG_SENSORS_TSL2550 is not set 703# CONFIG_SENSORS_TSL2550 is not set
688# CONFIG_I2C_DEBUG_CORE is not set 704# CONFIG_I2C_DEBUG_CORE is not set
689# CONFIG_I2C_DEBUG_ALGO is not set 705# CONFIG_I2C_DEBUG_ALGO is not set
690# CONFIG_I2C_DEBUG_BUS is not set 706# CONFIG_I2C_DEBUG_BUS is not set
691# CONFIG_I2C_DEBUG_CHIP is not set 707# CONFIG_I2C_DEBUG_CHIP is not set
692# CONFIG_SPI is not set 708# CONFIG_SPI is not set
709
710#
711# PPS support
712#
713# CONFIG_PPS is not set
693CONFIG_ARCH_REQUIRE_GPIOLIB=y 714CONFIG_ARCH_REQUIRE_GPIOLIB=y
694CONFIG_GPIOLIB=y 715CONFIG_GPIOLIB=y
695# CONFIG_GPIO_SYSFS is not set 716# CONFIG_GPIO_SYSFS is not set
@@ -712,6 +733,10 @@ CONFIG_GPIOLIB=y
712# 733#
713# SPI GPIO expanders: 734# SPI GPIO expanders:
714# 735#
736
737#
738# AC97 GPIO expanders:
739#
715CONFIG_W1=y 740CONFIG_W1=y
716 741
717# 742#
@@ -734,7 +759,6 @@ CONFIG_W1_SLAVE_THERM=y
734# CONFIG_POWER_SUPPLY is not set 759# CONFIG_POWER_SUPPLY is not set
735# CONFIG_HWMON is not set 760# CONFIG_HWMON is not set
736# CONFIG_THERMAL is not set 761# CONFIG_THERMAL is not set
737# CONFIG_THERMAL_HWMON is not set
738# CONFIG_WATCHDOG is not set 762# CONFIG_WATCHDOG is not set
739CONFIG_SSB_POSSIBLE=y 763CONFIG_SSB_POSSIBLE=y
740 764
@@ -759,12 +783,24 @@ CONFIG_SSB_POSSIBLE=y
759# CONFIG_MFD_TC6393XB is not set 783# CONFIG_MFD_TC6393XB is not set
760# CONFIG_PMIC_DA903X is not set 784# CONFIG_PMIC_DA903X is not set
761# CONFIG_MFD_WM8400 is not set 785# CONFIG_MFD_WM8400 is not set
786# CONFIG_MFD_WM831X is not set
762CONFIG_MFD_WM8350=y 787CONFIG_MFD_WM8350=y
763CONFIG_MFD_WM8350_CONFIG_MODE_0=y 788CONFIG_MFD_WM8350_CONFIG_MODE_0=y
764CONFIG_MFD_WM8352_CONFIG_MODE_0=y 789CONFIG_MFD_WM8352_CONFIG_MODE_0=y
765CONFIG_MFD_WM8350_I2C=y 790CONFIG_MFD_WM8350_I2C=y
766# CONFIG_MFD_PCF50633 is not set 791# CONFIG_MFD_PCF50633 is not set
767# CONFIG_AB3100_CORE is not set 792# CONFIG_AB3100_CORE is not set
793CONFIG_REGULATOR=y
794# CONFIG_REGULATOR_DEBUG is not set
795# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
796# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
797# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set
798# CONFIG_REGULATOR_BQ24022 is not set
799# CONFIG_REGULATOR_MAX1586 is not set
800CONFIG_REGULATOR_WM8350=y
801# CONFIG_REGULATOR_LP3971 is not set
802# CONFIG_REGULATOR_TPS65023 is not set
803# CONFIG_REGULATOR_TPS6507X is not set
768CONFIG_MEDIA_SUPPORT=y 804CONFIG_MEDIA_SUPPORT=y
769 805
770# 806#
@@ -874,10 +910,12 @@ CONFIG_MMC_BLOCK_BOUNCE=y
874# MMC/SD/SDIO Host Controller Drivers 910# MMC/SD/SDIO Host Controller Drivers
875# 911#
876# CONFIG_MMC_SDHCI is not set 912# CONFIG_MMC_SDHCI is not set
913# CONFIG_MMC_AT91 is not set
914# CONFIG_MMC_ATMELMCI is not set
877CONFIG_MMC_MXC=y 915CONFIG_MMC_MXC=y
878# CONFIG_MEMSTICK is not set 916# CONFIG_MEMSTICK is not set
879# CONFIG_ACCESSIBILITY is not set
880# CONFIG_NEW_LEDS is not set 917# CONFIG_NEW_LEDS is not set
918# CONFIG_ACCESSIBILITY is not set
881CONFIG_RTC_LIB=y 919CONFIG_RTC_LIB=y
882# CONFIG_RTC_CLASS is not set 920# CONFIG_RTC_CLASS is not set
883CONFIG_DMADEVICES=y 921CONFIG_DMADEVICES=y
@@ -896,16 +934,11 @@ CONFIG_DMA_ENGINE=y
896# CONFIG_ASYNC_TX_DMA is not set 934# CONFIG_ASYNC_TX_DMA is not set
897# CONFIG_DMATEST is not set 935# CONFIG_DMATEST is not set
898# CONFIG_AUXDISPLAY is not set 936# CONFIG_AUXDISPLAY is not set
899CONFIG_REGULATOR=y
900# CONFIG_REGULATOR_DEBUG is not set
901# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
902# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
903# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set
904# CONFIG_REGULATOR_BQ24022 is not set
905# CONFIG_REGULATOR_MAX1586 is not set
906CONFIG_REGULATOR_WM8350=y
907# CONFIG_REGULATOR_LP3971 is not set
908# CONFIG_UIO is not set 937# CONFIG_UIO is not set
938
939#
940# TI VLYNQ
941#
909# CONFIG_STAGING is not set 942# CONFIG_STAGING is not set
910 943
911# 944#
@@ -921,6 +954,7 @@ CONFIG_REGULATOR_WM8350=y
921# CONFIG_GFS2_FS is not set 954# CONFIG_GFS2_FS is not set
922# CONFIG_OCFS2_FS is not set 955# CONFIG_OCFS2_FS is not set
923# CONFIG_BTRFS_FS is not set 956# CONFIG_BTRFS_FS is not set
957# CONFIG_NILFS2_FS is not set
924CONFIG_FILE_LOCKING=y 958CONFIG_FILE_LOCKING=y
925CONFIG_FSNOTIFY=y 959CONFIG_FSNOTIFY=y
926# CONFIG_DNOTIFY is not set 960# CONFIG_DNOTIFY is not set
@@ -995,7 +1029,6 @@ CONFIG_UBIFS_FS_ZLIB=y
995# CONFIG_ROMFS_FS is not set 1029# CONFIG_ROMFS_FS is not set
996# CONFIG_SYSV_FS is not set 1030# CONFIG_SYSV_FS is not set
997# CONFIG_UFS_FS is not set 1031# CONFIG_UFS_FS is not set
998# CONFIG_NILFS2_FS is not set
999CONFIG_NETWORK_FILESYSTEMS=y 1032CONFIG_NETWORK_FILESYSTEMS=y
1000CONFIG_NFS_FS=y 1033CONFIG_NFS_FS=y
1001CONFIG_NFS_V3=y 1034CONFIG_NFS_V3=y
@@ -1033,6 +1066,7 @@ CONFIG_MSDOS_PARTITION=y
1033# CONFIG_ENABLE_MUST_CHECK is not set 1066# CONFIG_ENABLE_MUST_CHECK is not set
1034CONFIG_FRAME_WARN=1024 1067CONFIG_FRAME_WARN=1024
1035# CONFIG_MAGIC_SYSRQ is not set 1068# CONFIG_MAGIC_SYSRQ is not set
1069# CONFIG_STRIP_ASM_SYMS is not set
1036# CONFIG_UNUSED_SYMBOLS is not set 1070# CONFIG_UNUSED_SYMBOLS is not set
1037# CONFIG_DEBUG_FS is not set 1071# CONFIG_DEBUG_FS is not set
1038# CONFIG_HEADERS_CHECK is not set 1072# CONFIG_HEADERS_CHECK is not set
@@ -1062,7 +1096,6 @@ CONFIG_CRYPTO=y
1062# 1096#
1063# Crypto core or helper 1097# Crypto core or helper
1064# 1098#
1065# CONFIG_CRYPTO_FIPS is not set
1066CONFIG_CRYPTO_ALGAPI=y 1099CONFIG_CRYPTO_ALGAPI=y
1067CONFIG_CRYPTO_ALGAPI2=y 1100CONFIG_CRYPTO_ALGAPI2=y
1068CONFIG_CRYPTO_AEAD2=y 1101CONFIG_CRYPTO_AEAD2=y
@@ -1104,11 +1137,13 @@ CONFIG_CRYPTO_CBC=y
1104# 1137#
1105# CONFIG_CRYPTO_HMAC is not set 1138# CONFIG_CRYPTO_HMAC is not set
1106# CONFIG_CRYPTO_XCBC is not set 1139# CONFIG_CRYPTO_XCBC is not set
1140# CONFIG_CRYPTO_VMAC is not set
1107 1141
1108# 1142#
1109# Digest 1143# Digest
1110# 1144#
1111# CONFIG_CRYPTO_CRC32C is not set 1145# CONFIG_CRYPTO_CRC32C is not set
1146# CONFIG_CRYPTO_GHASH is not set
1112# CONFIG_CRYPTO_MD4 is not set 1147# CONFIG_CRYPTO_MD4 is not set
1113CONFIG_CRYPTO_MD5=y 1148CONFIG_CRYPTO_MD5=y
1114# CONFIG_CRYPTO_MICHAEL_MIC is not set 1149# CONFIG_CRYPTO_MICHAEL_MIC is not set
diff --git a/arch/arm/configs/w90p910_defconfig b/arch/arm/configs/nuc910_defconfig
index 5245655a0ad3..5245655a0ad3 100644
--- a/arch/arm/configs/w90p910_defconfig
+++ b/arch/arm/configs/nuc910_defconfig
diff --git a/arch/arm/configs/nuc950_defconfig b/arch/arm/configs/nuc950_defconfig
new file mode 100644
index 000000000000..df1de9b45ca4
--- /dev/null
+++ b/arch/arm/configs/nuc950_defconfig
@@ -0,0 +1,922 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.32-rc7
4# Tue Nov 17 12:31:33 2009
5#
6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y
9CONFIG_GENERIC_TIME=y
10CONFIG_GENERIC_CLOCKEVENTS=y
11CONFIG_GENERIC_HARDIRQS=y
12CONFIG_STACKTRACE_SUPPORT=y
13CONFIG_HAVE_LATENCYTOP_SUPPORT=y
14CONFIG_LOCKDEP_SUPPORT=y
15CONFIG_TRACE_IRQFLAGS_SUPPORT=y
16CONFIG_HARDIRQS_SW_RESEND=y
17CONFIG_GENERIC_IRQ_PROBE=y
18CONFIG_RWSEM_GENERIC_SPINLOCK=y
19CONFIG_GENERIC_HWEIGHT=y
20CONFIG_GENERIC_CALIBRATE_DELAY=y
21CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
22CONFIG_VECTORS_BASE=0xffff0000
23CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
24CONFIG_CONSTRUCTORS=y
25
26#
27# General setup
28#
29CONFIG_EXPERIMENTAL=y
30CONFIG_BROKEN_ON_SMP=y
31CONFIG_LOCK_KERNEL=y
32CONFIG_INIT_ENV_ARG_LIMIT=32
33CONFIG_LOCALVERSION=""
34# CONFIG_LOCALVERSION_AUTO is not set
35CONFIG_SWAP=y
36CONFIG_SYSVIPC=y
37CONFIG_SYSVIPC_SYSCTL=y
38CONFIG_BSD_PROCESS_ACCT=y
39# CONFIG_BSD_PROCESS_ACCT_V3 is not set
40
41#
42# RCU Subsystem
43#
44CONFIG_TREE_RCU=y
45# CONFIG_TREE_PREEMPT_RCU is not set
46# CONFIG_RCU_TRACE is not set
47CONFIG_RCU_FANOUT=32
48# CONFIG_RCU_FANOUT_EXACT is not set
49# CONFIG_TREE_RCU_TRACE is not set
50# CONFIG_IKCONFIG is not set
51CONFIG_LOG_BUF_SHIFT=17
52# CONFIG_GROUP_SCHED is not set
53# CONFIG_CGROUPS is not set
54CONFIG_SYSFS_DEPRECATED=y
55CONFIG_SYSFS_DEPRECATED_V2=y
56CONFIG_RELAY=y
57CONFIG_NAMESPACES=y
58# CONFIG_UTS_NS is not set
59# CONFIG_IPC_NS is not set
60CONFIG_USER_NS=y
61# CONFIG_PID_NS is not set
62CONFIG_BLK_DEV_INITRD=y
63CONFIG_INITRAMFS_SOURCE=""
64CONFIG_RD_GZIP=y
65CONFIG_RD_BZIP2=y
66CONFIG_RD_LZMA=y
67CONFIG_CC_OPTIMIZE_FOR_SIZE=y
68CONFIG_SYSCTL=y
69CONFIG_ANON_INODES=y
70# CONFIG_EMBEDDED is not set
71CONFIG_UID16=y
72CONFIG_SYSCTL_SYSCALL=y
73CONFIG_KALLSYMS=y
74CONFIG_KALLSYMS_EXTRA_PASS=y
75CONFIG_HOTPLUG=y
76CONFIG_PRINTK=y
77CONFIG_BUG=y
78CONFIG_ELF_CORE=y
79CONFIG_BASE_FULL=y
80CONFIG_FUTEX=y
81CONFIG_EPOLL=y
82CONFIG_SIGNALFD=y
83CONFIG_TIMERFD=y
84CONFIG_EVENTFD=y
85CONFIG_SHMEM=y
86CONFIG_AIO=y
87
88#
89# Kernel Performance Events And Counters
90#
91CONFIG_VM_EVENT_COUNTERS=y
92CONFIG_COMPAT_BRK=y
93CONFIG_SLAB=y
94# CONFIG_SLUB is not set
95# CONFIG_SLOB is not set
96# CONFIG_PROFILING is not set
97CONFIG_HAVE_OPROFILE=y
98CONFIG_HAVE_KPROBES=y
99CONFIG_HAVE_KRETPROBES=y
100CONFIG_HAVE_CLK=y
101
102#
103# GCOV-based kernel profiling
104#
105# CONFIG_GCOV_KERNEL is not set
106# CONFIG_SLOW_WORK is not set
107CONFIG_HAVE_GENERIC_DMA_COHERENT=y
108CONFIG_SLABINFO=y
109CONFIG_RT_MUTEXES=y
110CONFIG_BASE_SMALL=0
111# CONFIG_MODULES is not set
112CONFIG_BLOCK=y
113CONFIG_LBDAF=y
114CONFIG_BLK_DEV_BSG=y
115# CONFIG_BLK_DEV_INTEGRITY is not set
116
117#
118# IO Schedulers
119#
120CONFIG_IOSCHED_NOOP=y
121CONFIG_IOSCHED_AS=y
122CONFIG_IOSCHED_DEADLINE=y
123CONFIG_IOSCHED_CFQ=y
124# CONFIG_DEFAULT_AS is not set
125# CONFIG_DEFAULT_DEADLINE is not set
126CONFIG_DEFAULT_CFQ=y
127# CONFIG_DEFAULT_NOOP is not set
128CONFIG_DEFAULT_IOSCHED="cfq"
129# CONFIG_FREEZER is not set
130
131#
132# System Type
133#
134CONFIG_MMU=y
135# CONFIG_ARCH_AAEC2000 is not set
136# CONFIG_ARCH_INTEGRATOR is not set
137# CONFIG_ARCH_REALVIEW is not set
138# CONFIG_ARCH_VERSATILE is not set
139# CONFIG_ARCH_AT91 is not set
140# CONFIG_ARCH_CLPS711X is not set
141# CONFIG_ARCH_GEMINI is not set
142# CONFIG_ARCH_EBSA110 is not set
143# CONFIG_ARCH_EP93XX is not set
144# CONFIG_ARCH_FOOTBRIDGE is not set
145# CONFIG_ARCH_MXC is not set
146# CONFIG_ARCH_STMP3XXX is not set
147# CONFIG_ARCH_NETX is not set
148# CONFIG_ARCH_H720X is not set
149# CONFIG_ARCH_NOMADIK is not set
150# CONFIG_ARCH_IOP13XX is not set
151# CONFIG_ARCH_IOP32X is not set
152# CONFIG_ARCH_IOP33X is not set
153# CONFIG_ARCH_IXP23XX is not set
154# CONFIG_ARCH_IXP2000 is not set
155# CONFIG_ARCH_IXP4XX is not set
156# CONFIG_ARCH_L7200 is not set
157# CONFIG_ARCH_KIRKWOOD is not set
158# CONFIG_ARCH_LOKI is not set
159# CONFIG_ARCH_MV78XX0 is not set
160# CONFIG_ARCH_ORION5X is not set
161# CONFIG_ARCH_MMP is not set
162# CONFIG_ARCH_KS8695 is not set
163# CONFIG_ARCH_NS9XXX is not set
164CONFIG_ARCH_W90X900=y
165# CONFIG_ARCH_PNX4008 is not set
166# CONFIG_ARCH_PXA is not set
167# CONFIG_ARCH_MSM is not set
168# CONFIG_ARCH_RPC is not set
169# CONFIG_ARCH_SA1100 is not set
170# CONFIG_ARCH_S3C2410 is not set
171# CONFIG_ARCH_S3C64XX is not set
172# CONFIG_ARCH_S5PC1XX is not set
173# CONFIG_ARCH_SHARK is not set
174# CONFIG_ARCH_LH7A40X is not set
175# CONFIG_ARCH_U300 is not set
176# CONFIG_ARCH_DAVINCI is not set
177# CONFIG_ARCH_OMAP is not set
178# CONFIG_ARCH_BCMRING is not set
179CONFIG_CPU_NUC950=y
180
181#
182# W90P910 Machines
183#
184# CONFIG_MACH_W90P910EVB is not set
185
186#
187# NUC950 Machines
188#
189CONFIG_MACH_W90P950EVB=y
190
191#
192# NUC960 Machines
193#
194# CONFIG_MACH_W90N960EVB is not set
195
196#
197# NUC932 Machines
198#
199# CONFIG_MACH_NUC932EVB is not set
200
201#
202# Processor Type
203#
204CONFIG_CPU_32=y
205CONFIG_CPU_ARM926T=y
206CONFIG_CPU_32v5=y
207CONFIG_CPU_ABRT_EV5TJ=y
208CONFIG_CPU_PABRT_LEGACY=y
209CONFIG_CPU_CACHE_VIVT=y
210CONFIG_CPU_COPY_V4WB=y
211CONFIG_CPU_TLB_V4WBI=y
212CONFIG_CPU_CP15=y
213CONFIG_CPU_CP15_MMU=y
214
215#
216# Processor Features
217#
218CONFIG_ARM_THUMB=y
219# CONFIG_CPU_ICACHE_DISABLE is not set
220# CONFIG_CPU_DCACHE_DISABLE is not set
221# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
222# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
223CONFIG_ARM_L1_CACHE_SHIFT=5
224CONFIG_COMMON_CLKDEV=y
225
226#
227# Bus support
228#
229# CONFIG_PCI_SYSCALL is not set
230# CONFIG_ARCH_SUPPORTS_MSI is not set
231# CONFIG_PCCARD is not set
232
233#
234# Kernel Features
235#
236CONFIG_TICK_ONESHOT=y
237CONFIG_NO_HZ=y
238CONFIG_HIGH_RES_TIMERS=y
239CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
240CONFIG_VMSPLIT_3G=y
241# CONFIG_VMSPLIT_2G is not set
242# CONFIG_VMSPLIT_1G is not set
243CONFIG_PAGE_OFFSET=0xC0000000
244# CONFIG_PREEMPT_NONE is not set
245# CONFIG_PREEMPT_VOLUNTARY is not set
246CONFIG_PREEMPT=y
247CONFIG_HZ=100
248CONFIG_AEABI=y
249CONFIG_OABI_COMPAT=y
250# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
251# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
252# CONFIG_HIGHMEM is not set
253CONFIG_SELECT_MEMORY_MODEL=y
254CONFIG_FLATMEM_MANUAL=y
255# CONFIG_DISCONTIGMEM_MANUAL is not set
256# CONFIG_SPARSEMEM_MANUAL is not set
257CONFIG_FLATMEM=y
258CONFIG_FLAT_NODE_MEM_MAP=y
259CONFIG_PAGEFLAGS_EXTENDED=y
260CONFIG_SPLIT_PTLOCK_CPUS=4096
261# CONFIG_PHYS_ADDR_T_64BIT is not set
262CONFIG_ZONE_DMA_FLAG=0
263CONFIG_VIRT_TO_BUS=y
264CONFIG_HAVE_MLOCK=y
265CONFIG_HAVE_MLOCKED_PAGE_BIT=y
266# CONFIG_KSM is not set
267CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
268CONFIG_ALIGNMENT_TRAP=y
269# CONFIG_UACCESS_WITH_MEMCPY is not set
270
271#
272# Boot options
273#
274CONFIG_ZBOOT_ROM_TEXT=0
275CONFIG_ZBOOT_ROM_BSS=0
276CONFIG_CMDLINE="root=/dev/ram0 console=ttyS0,115200n8 rdinit=/sbin/init mem=64M"
277# CONFIG_XIP_KERNEL is not set
278CONFIG_KEXEC=y
279CONFIG_ATAGS_PROC=y
280
281#
282# CPU Power Management
283#
284# CONFIG_CPU_IDLE is not set
285
286#
287# Floating point emulation
288#
289
290#
291# At least one emulation must be selected
292#
293CONFIG_FPE_NWFPE=y
294# CONFIG_FPE_NWFPE_XP is not set
295# CONFIG_FPE_FASTFPE is not set
296# CONFIG_VFP is not set
297
298#
299# Userspace binary formats
300#
301CONFIG_BINFMT_ELF=y
302# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
303CONFIG_HAVE_AOUT=y
304CONFIG_BINFMT_AOUT=y
305CONFIG_BINFMT_MISC=y
306
307#
308# Power management options
309#
310# CONFIG_PM is not set
311CONFIG_ARCH_SUSPEND_POSSIBLE=y
312# CONFIG_NET is not set
313
314#
315# Device Drivers
316#
317
318#
319# Generic Driver Options
320#
321CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
322# CONFIG_DEVTMPFS is not set
323CONFIG_STANDALONE=y
324CONFIG_PREVENT_FIRMWARE_BUILD=y
325CONFIG_FW_LOADER=y
326CONFIG_FIRMWARE_IN_KERNEL=y
327CONFIG_EXTRA_FIRMWARE=""
328# CONFIG_SYS_HYPERVISOR is not set
329CONFIG_MTD=y
330# CONFIG_MTD_DEBUG is not set
331CONFIG_MTD_CONCAT=y
332CONFIG_MTD_PARTITIONS=y
333# CONFIG_MTD_REDBOOT_PARTS is not set
334# CONFIG_MTD_CMDLINE_PARTS is not set
335# CONFIG_MTD_AFS_PARTS is not set
336# CONFIG_MTD_AR7_PARTS is not set
337
338#
339# User Modules And Translation Layers
340#
341CONFIG_MTD_CHAR=y
342CONFIG_MTD_BLKDEVS=y
343CONFIG_MTD_BLOCK=y
344# CONFIG_FTL is not set
345# CONFIG_NFTL is not set
346# CONFIG_INFTL is not set
347# CONFIG_RFD_FTL is not set
348# CONFIG_SSFDC is not set
349# CONFIG_MTD_OOPS is not set
350
351#
352# RAM/ROM/Flash chip drivers
353#
354CONFIG_MTD_CFI=y
355# CONFIG_MTD_JEDECPROBE is not set
356CONFIG_MTD_GEN_PROBE=y
357# CONFIG_MTD_CFI_ADV_OPTIONS is not set
358CONFIG_MTD_MAP_BANK_WIDTH_1=y
359CONFIG_MTD_MAP_BANK_WIDTH_2=y
360CONFIG_MTD_MAP_BANK_WIDTH_4=y
361# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
362# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
363# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
364CONFIG_MTD_CFI_I1=y
365CONFIG_MTD_CFI_I2=y
366# CONFIG_MTD_CFI_I4 is not set
367# CONFIG_MTD_CFI_I8 is not set
368# CONFIG_MTD_CFI_INTELEXT is not set
369CONFIG_MTD_CFI_AMDSTD=y
370# CONFIG_MTD_CFI_STAA is not set
371CONFIG_MTD_CFI_UTIL=y
372# CONFIG_MTD_RAM is not set
373# CONFIG_MTD_ROM is not set
374# CONFIG_MTD_ABSENT is not set
375
376#
377# Mapping drivers for chip access
378#
379# CONFIG_MTD_COMPLEX_MAPPINGS is not set
380CONFIG_MTD_PHYSMAP=y
381# CONFIG_MTD_PHYSMAP_COMPAT is not set
382# CONFIG_MTD_ARM_INTEGRATOR is not set
383# CONFIG_MTD_PLATRAM is not set
384
385#
386# Self-contained MTD device drivers
387#
388# CONFIG_MTD_SLRAM is not set
389# CONFIG_MTD_PHRAM is not set
390# CONFIG_MTD_MTDRAM is not set
391# CONFIG_MTD_BLOCK2MTD is not set
392
393#
394# Disk-On-Chip Device Drivers
395#
396# CONFIG_MTD_DOC2000 is not set
397# CONFIG_MTD_DOC2001 is not set
398# CONFIG_MTD_DOC2001PLUS is not set
399# CONFIG_MTD_NAND is not set
400# CONFIG_MTD_ONENAND is not set
401
402#
403# LPDDR flash memory drivers
404#
405# CONFIG_MTD_LPDDR is not set
406
407#
408# UBI - Unsorted block images
409#
410# CONFIG_MTD_UBI is not set
411# CONFIG_PARPORT is not set
412CONFIG_BLK_DEV=y
413# CONFIG_BLK_DEV_COW_COMMON is not set
414# CONFIG_BLK_DEV_LOOP is not set
415# CONFIG_BLK_DEV_UB is not set
416CONFIG_BLK_DEV_RAM=y
417CONFIG_BLK_DEV_RAM_COUNT=16
418CONFIG_BLK_DEV_RAM_SIZE=16384
419# CONFIG_BLK_DEV_XIP is not set
420# CONFIG_CDROM_PKTCDVD is not set
421# CONFIG_MG_DISK is not set
422# CONFIG_MISC_DEVICES is not set
423CONFIG_HAVE_IDE=y
424# CONFIG_IDE is not set
425
426#
427# SCSI device support
428#
429# CONFIG_RAID_ATTRS is not set
430CONFIG_SCSI=y
431CONFIG_SCSI_DMA=y
432# CONFIG_SCSI_TGT is not set
433# CONFIG_SCSI_NETLINK is not set
434# CONFIG_SCSI_PROC_FS is not set
435
436#
437# SCSI support type (disk, tape, CD-ROM)
438#
439CONFIG_BLK_DEV_SD=y
440# CONFIG_CHR_DEV_ST is not set
441# CONFIG_CHR_DEV_OSST is not set
442# CONFIG_BLK_DEV_SR is not set
443# CONFIG_CHR_DEV_SG is not set
444# CONFIG_CHR_DEV_SCH is not set
445# CONFIG_SCSI_MULTI_LUN is not set
446# CONFIG_SCSI_CONSTANTS is not set
447# CONFIG_SCSI_LOGGING is not set
448# CONFIG_SCSI_SCAN_ASYNC is not set
449
450#
451# SCSI Transports
452#
453# CONFIG_SCSI_SPI_ATTRS is not set
454# CONFIG_SCSI_FC_ATTRS is not set
455# CONFIG_SCSI_SAS_ATTRS is not set
456# CONFIG_SCSI_SAS_LIBSAS is not set
457# CONFIG_SCSI_SRP_ATTRS is not set
458# CONFIG_SCSI_LOWLEVEL is not set
459# CONFIG_SCSI_DH is not set
460# CONFIG_SCSI_OSD_INITIATOR is not set
461# CONFIG_ATA is not set
462# CONFIG_MD is not set
463# CONFIG_PHONE is not set
464
465#
466# Input device support
467#
468CONFIG_INPUT=y
469# CONFIG_INPUT_FF_MEMLESS is not set
470# CONFIG_INPUT_POLLDEV is not set
471
472#
473# Userland interfaces
474#
475CONFIG_INPUT_MOUSEDEV=y
476# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
477CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
478CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
479# CONFIG_INPUT_JOYDEV is not set
480# CONFIG_INPUT_EVDEV is not set
481# CONFIG_INPUT_EVBUG is not set
482
483#
484# Input Device Drivers
485#
486# CONFIG_INPUT_KEYBOARD is not set
487# CONFIG_INPUT_MOUSE is not set
488# CONFIG_INPUT_JOYSTICK is not set
489# CONFIG_INPUT_TABLET is not set
490# CONFIG_INPUT_TOUCHSCREEN is not set
491# CONFIG_INPUT_MISC is not set
492
493#
494# Hardware I/O ports
495#
496# CONFIG_SERIO is not set
497# CONFIG_GAMEPORT is not set
498
499#
500# Character devices
501#
502CONFIG_VT=y
503CONFIG_CONSOLE_TRANSLATIONS=y
504CONFIG_VT_CONSOLE=y
505CONFIG_HW_CONSOLE=y
506# CONFIG_VT_HW_CONSOLE_BINDING is not set
507# CONFIG_DEVKMEM is not set
508# CONFIG_SERIAL_NONSTANDARD is not set
509
510#
511# Serial drivers
512#
513CONFIG_SERIAL_8250=y
514CONFIG_SERIAL_8250_CONSOLE=y
515CONFIG_SERIAL_8250_NR_UARTS=1
516CONFIG_SERIAL_8250_RUNTIME_UARTS=1
517# CONFIG_SERIAL_8250_EXTENDED is not set
518
519#
520# Non-8250 serial port support
521#
522CONFIG_SERIAL_CORE=y
523CONFIG_SERIAL_CORE_CONSOLE=y
524CONFIG_UNIX98_PTYS=y
525# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
526# CONFIG_LEGACY_PTYS is not set
527# CONFIG_IPMI_HANDLER is not set
528# CONFIG_HW_RANDOM is not set
529# CONFIG_R3964 is not set
530# CONFIG_RAW_DRIVER is not set
531# CONFIG_TCG_TPM is not set
532# CONFIG_I2C is not set
533# CONFIG_SPI is not set
534
535#
536# PPS support
537#
538# CONFIG_PPS is not set
539CONFIG_ARCH_REQUIRE_GPIOLIB=y
540CONFIG_GPIOLIB=y
541# CONFIG_GPIO_SYSFS is not set
542
543#
544# Memory mapped GPIO expanders:
545#
546
547#
548# I2C GPIO expanders:
549#
550
551#
552# PCI GPIO expanders:
553#
554
555#
556# SPI GPIO expanders:
557#
558
559#
560# AC97 GPIO expanders:
561#
562# CONFIG_W1 is not set
563# CONFIG_POWER_SUPPLY is not set
564# CONFIG_HWMON is not set
565# CONFIG_THERMAL is not set
566# CONFIG_WATCHDOG is not set
567CONFIG_SSB_POSSIBLE=y
568
569#
570# Sonics Silicon Backplane
571#
572# CONFIG_SSB is not set
573
574#
575# Multifunction device drivers
576#
577# CONFIG_MFD_CORE is not set
578# CONFIG_MFD_SM501 is not set
579# CONFIG_MFD_ASIC3 is not set
580# CONFIG_HTC_EGPIO is not set
581# CONFIG_HTC_PASIC3 is not set
582# CONFIG_MFD_TMIO is not set
583# CONFIG_MFD_T7L66XB is not set
584# CONFIG_MFD_TC6387XB is not set
585# CONFIG_MFD_TC6393XB is not set
586# CONFIG_REGULATOR is not set
587# CONFIG_MEDIA_SUPPORT is not set
588
589#
590# Graphics support
591#
592# CONFIG_VGASTATE is not set
593# CONFIG_VIDEO_OUTPUT_CONTROL is not set
594# CONFIG_FB is not set
595# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
596
597#
598# Display device support
599#
600# CONFIG_DISPLAY_SUPPORT is not set
601
602#
603# Console display driver support
604#
605# CONFIG_VGA_CONSOLE is not set
606CONFIG_DUMMY_CONSOLE=y
607# CONFIG_SOUND is not set
608# CONFIG_HID_SUPPORT is not set
609CONFIG_USB_SUPPORT=y
610CONFIG_USB_ARCH_HAS_HCD=y
611CONFIG_USB_ARCH_HAS_OHCI=y
612CONFIG_USB_ARCH_HAS_EHCI=y
613CONFIG_USB=y
614# CONFIG_USB_DEBUG is not set
615# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
616
617#
618# Miscellaneous USB options
619#
620# CONFIG_USB_DEVICEFS is not set
621CONFIG_USB_DEVICE_CLASS=y
622# CONFIG_USB_DYNAMIC_MINORS is not set
623# CONFIG_USB_OTG is not set
624CONFIG_USB_MON=y
625# CONFIG_USB_WUSB is not set
626# CONFIG_USB_WUSB_CBAF is not set
627
628#
629# USB Host Controller Drivers
630#
631# CONFIG_USB_C67X00_HCD is not set
632# CONFIG_USB_EHCI_HCD is not set
633# CONFIG_USB_OXU210HP_HCD is not set
634# CONFIG_USB_ISP116X_HCD is not set
635# CONFIG_USB_ISP1760_HCD is not set
636# CONFIG_USB_ISP1362_HCD is not set
637# CONFIG_USB_OHCI_HCD is not set
638# CONFIG_USB_SL811_HCD is not set
639# CONFIG_USB_R8A66597_HCD is not set
640# CONFIG_USB_HWA_HCD is not set
641# CONFIG_USB_MUSB_HDRC is not set
642
643#
644# USB Device Class drivers
645#
646# CONFIG_USB_ACM is not set
647# CONFIG_USB_PRINTER is not set
648# CONFIG_USB_WDM is not set
649# CONFIG_USB_TMC is not set
650
651#
652# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
653#
654
655#
656# also be needed; see USB_STORAGE Help for more info
657#
658CONFIG_USB_STORAGE=y
659# CONFIG_USB_STORAGE_DEBUG is not set
660# CONFIG_USB_STORAGE_DATAFAB is not set
661# CONFIG_USB_STORAGE_FREECOM is not set
662# CONFIG_USB_STORAGE_ISD200 is not set
663# CONFIG_USB_STORAGE_USBAT is not set
664# CONFIG_USB_STORAGE_SDDR09 is not set
665# CONFIG_USB_STORAGE_SDDR55 is not set
666# CONFIG_USB_STORAGE_JUMPSHOT is not set
667# CONFIG_USB_STORAGE_ALAUDA is not set
668# CONFIG_USB_STORAGE_ONETOUCH is not set
669# CONFIG_USB_STORAGE_KARMA is not set
670# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
671# CONFIG_USB_LIBUSUAL is not set
672
673#
674# USB Imaging devices
675#
676# CONFIG_USB_MDC800 is not set
677# CONFIG_USB_MICROTEK is not set
678
679#
680# USB port drivers
681#
682# CONFIG_USB_SERIAL is not set
683
684#
685# USB Miscellaneous drivers
686#
687# CONFIG_USB_EMI62 is not set
688# CONFIG_USB_EMI26 is not set
689# CONFIG_USB_ADUTUX is not set
690# CONFIG_USB_SEVSEG is not set
691# CONFIG_USB_RIO500 is not set
692# CONFIG_USB_LEGOTOWER is not set
693# CONFIG_USB_LCD is not set
694# CONFIG_USB_BERRY_CHARGE is not set
695# CONFIG_USB_LED is not set
696# CONFIG_USB_CYPRESS_CY7C63 is not set
697# CONFIG_USB_CYTHERM is not set
698# CONFIG_USB_IDMOUSE is not set
699# CONFIG_USB_FTDI_ELAN is not set
700# CONFIG_USB_APPLEDISPLAY is not set
701# CONFIG_USB_LD is not set
702# CONFIG_USB_TRANCEVIBRATOR is not set
703# CONFIG_USB_IOWARRIOR is not set
704# CONFIG_USB_TEST is not set
705# CONFIG_USB_ISIGHTFW is not set
706# CONFIG_USB_VST is not set
707# CONFIG_USB_GADGET is not set
708
709#
710# OTG and related infrastructure
711#
712# CONFIG_USB_GPIO_VBUS is not set
713# CONFIG_NOP_USB_XCEIV is not set
714# CONFIG_MMC is not set
715# CONFIG_MEMSTICK is not set
716# CONFIG_NEW_LEDS is not set
717# CONFIG_ACCESSIBILITY is not set
718CONFIG_RTC_LIB=y
719# CONFIG_RTC_CLASS is not set
720# CONFIG_DMADEVICES is not set
721# CONFIG_AUXDISPLAY is not set
722# CONFIG_UIO is not set
723
724#
725# TI VLYNQ
726#
727# CONFIG_STAGING is not set
728
729#
730# File systems
731#
732# CONFIG_EXT2_FS is not set
733# CONFIG_EXT3_FS is not set
734# CONFIG_EXT4_FS is not set
735# CONFIG_REISERFS_FS is not set
736# CONFIG_JFS_FS is not set
737CONFIG_FS_POSIX_ACL=y
738# CONFIG_XFS_FS is not set
739# CONFIG_GFS2_FS is not set
740# CONFIG_BTRFS_FS is not set
741# CONFIG_NILFS2_FS is not set
742CONFIG_FILE_LOCKING=y
743CONFIG_FSNOTIFY=y
744# CONFIG_DNOTIFY is not set
745# CONFIG_INOTIFY is not set
746CONFIG_INOTIFY_USER=y
747# CONFIG_QUOTA is not set
748# CONFIG_AUTOFS_FS is not set
749# CONFIG_AUTOFS4_FS is not set
750# CONFIG_FUSE_FS is not set
751CONFIG_GENERIC_ACL=y
752
753#
754# Caches
755#
756# CONFIG_FSCACHE is not set
757
758#
759# CD-ROM/DVD Filesystems
760#
761# CONFIG_ISO9660_FS is not set
762# CONFIG_UDF_FS is not set
763
764#
765# DOS/FAT/NT Filesystems
766#
767# CONFIG_MSDOS_FS is not set
768# CONFIG_VFAT_FS is not set
769# CONFIG_NTFS_FS is not set
770
771#
772# Pseudo filesystems
773#
774CONFIG_PROC_FS=y
775CONFIG_PROC_SYSCTL=y
776CONFIG_PROC_PAGE_MONITOR=y
777CONFIG_SYSFS=y
778CONFIG_TMPFS=y
779CONFIG_TMPFS_POSIX_ACL=y
780# CONFIG_HUGETLB_PAGE is not set
781# CONFIG_CONFIGFS_FS is not set
782CONFIG_MISC_FILESYSTEMS=y
783# CONFIG_ADFS_FS is not set
784# CONFIG_AFFS_FS is not set
785# CONFIG_HFS_FS is not set
786# CONFIG_HFSPLUS_FS is not set
787# CONFIG_BEFS_FS is not set
788# CONFIG_BFS_FS is not set
789# CONFIG_EFS_FS is not set
790# CONFIG_JFFS2_FS is not set
791# CONFIG_CRAMFS is not set
792# CONFIG_SQUASHFS is not set
793# CONFIG_VXFS_FS is not set
794# CONFIG_MINIX_FS is not set
795# CONFIG_OMFS_FS is not set
796# CONFIG_HPFS_FS is not set
797# CONFIG_QNX4FS_FS is not set
798CONFIG_ROMFS_FS=y
799CONFIG_ROMFS_BACKED_BY_BLOCK=y
800# CONFIG_ROMFS_BACKED_BY_MTD is not set
801# CONFIG_ROMFS_BACKED_BY_BOTH is not set
802CONFIG_ROMFS_ON_BLOCK=y
803# CONFIG_SYSV_FS is not set
804# CONFIG_UFS_FS is not set
805
806#
807# Partition Types
808#
809CONFIG_PARTITION_ADVANCED=y
810# CONFIG_ACORN_PARTITION is not set
811# CONFIG_OSF_PARTITION is not set
812# CONFIG_AMIGA_PARTITION is not set
813# CONFIG_ATARI_PARTITION is not set
814# CONFIG_MAC_PARTITION is not set
815CONFIG_MSDOS_PARTITION=y
816# CONFIG_BSD_DISKLABEL is not set
817# CONFIG_MINIX_SUBPARTITION is not set
818# CONFIG_SOLARIS_X86_PARTITION is not set
819# CONFIG_UNIXWARE_DISKLABEL is not set
820# CONFIG_LDM_PARTITION is not set
821# CONFIG_SGI_PARTITION is not set
822# CONFIG_ULTRIX_PARTITION is not set
823# CONFIG_SUN_PARTITION is not set
824# CONFIG_KARMA_PARTITION is not set
825# CONFIG_EFI_PARTITION is not set
826# CONFIG_SYSV68_PARTITION is not set
827CONFIG_NLS=y
828CONFIG_NLS_DEFAULT="iso8859-1"
829CONFIG_NLS_CODEPAGE_437=y
830# CONFIG_NLS_CODEPAGE_737 is not set
831# CONFIG_NLS_CODEPAGE_775 is not set
832# CONFIG_NLS_CODEPAGE_850 is not set
833# CONFIG_NLS_CODEPAGE_852 is not set
834# CONFIG_NLS_CODEPAGE_855 is not set
835# CONFIG_NLS_CODEPAGE_857 is not set
836# CONFIG_NLS_CODEPAGE_860 is not set
837# CONFIG_NLS_CODEPAGE_861 is not set
838# CONFIG_NLS_CODEPAGE_862 is not set
839# CONFIG_NLS_CODEPAGE_863 is not set
840# CONFIG_NLS_CODEPAGE_864 is not set
841# CONFIG_NLS_CODEPAGE_865 is not set
842# CONFIG_NLS_CODEPAGE_866 is not set
843# CONFIG_NLS_CODEPAGE_869 is not set
844# CONFIG_NLS_CODEPAGE_936 is not set
845# CONFIG_NLS_CODEPAGE_950 is not set
846# CONFIG_NLS_CODEPAGE_932 is not set
847# CONFIG_NLS_CODEPAGE_949 is not set
848# CONFIG_NLS_CODEPAGE_874 is not set
849# CONFIG_NLS_ISO8859_8 is not set
850# CONFIG_NLS_CODEPAGE_1250 is not set
851# CONFIG_NLS_CODEPAGE_1251 is not set
852# CONFIG_NLS_ASCII is not set
853CONFIG_NLS_ISO8859_1=y
854# CONFIG_NLS_ISO8859_2 is not set
855# CONFIG_NLS_ISO8859_3 is not set
856# CONFIG_NLS_ISO8859_4 is not set
857# CONFIG_NLS_ISO8859_5 is not set
858# CONFIG_NLS_ISO8859_6 is not set
859# CONFIG_NLS_ISO8859_7 is not set
860# CONFIG_NLS_ISO8859_9 is not set
861# CONFIG_NLS_ISO8859_13 is not set
862# CONFIG_NLS_ISO8859_14 is not set
863# CONFIG_NLS_ISO8859_15 is not set
864# CONFIG_NLS_KOI8_R is not set
865# CONFIG_NLS_KOI8_U is not set
866# CONFIG_NLS_UTF8 is not set
867
868#
869# Kernel hacking
870#
871# CONFIG_PRINTK_TIME is not set
872# CONFIG_ENABLE_WARN_DEPRECATED is not set
873# CONFIG_ENABLE_MUST_CHECK is not set
874CONFIG_FRAME_WARN=1024
875# CONFIG_MAGIC_SYSRQ is not set
876# CONFIG_STRIP_ASM_SYMS is not set
877# CONFIG_UNUSED_SYMBOLS is not set
878CONFIG_DEBUG_FS=y
879# CONFIG_HEADERS_CHECK is not set
880# CONFIG_DEBUG_KERNEL is not set
881CONFIG_DEBUG_BUGVERBOSE=y
882CONFIG_DEBUG_MEMORY_INIT=y
883# CONFIG_RCU_CPU_STALL_DETECTOR is not set
884# CONFIG_LATENCYTOP is not set
885# CONFIG_SYSCTL_SYSCALL_CHECK is not set
886CONFIG_HAVE_FUNCTION_TRACER=y
887CONFIG_TRACING_SUPPORT=y
888# CONFIG_FTRACE is not set
889# CONFIG_DYNAMIC_DEBUG is not set
890# CONFIG_SAMPLES is not set
891CONFIG_HAVE_ARCH_KGDB=y
892CONFIG_ARM_UNWIND=y
893# CONFIG_DEBUG_USER is not set
894
895#
896# Security options
897#
898# CONFIG_KEYS is not set
899# CONFIG_SECURITY is not set
900# CONFIG_SECURITYFS is not set
901# CONFIG_SECURITY_FILE_CAPABILITIES is not set
902# CONFIG_CRYPTO is not set
903# CONFIG_BINARY_PRINTF is not set
904
905#
906# Library routines
907#
908CONFIG_GENERIC_FIND_LAST_BIT=y
909# CONFIG_CRC_CCITT is not set
910# CONFIG_CRC16 is not set
911# CONFIG_CRC_T10DIF is not set
912# CONFIG_CRC_ITU_T is not set
913# CONFIG_CRC32 is not set
914# CONFIG_CRC7 is not set
915# CONFIG_LIBCRC32C is not set
916CONFIG_ZLIB_INFLATE=y
917CONFIG_DECOMPRESS_GZIP=y
918CONFIG_DECOMPRESS_BZIP2=y
919CONFIG_DECOMPRESS_LZMA=y
920CONFIG_HAS_IOMEM=y
921CONFIG_HAS_IOPORT=y
922CONFIG_HAS_DMA=y
diff --git a/arch/arm/configs/nuc960_defconfig b/arch/arm/configs/nuc960_defconfig
new file mode 100644
index 000000000000..4b2cd9eae9bc
--- /dev/null
+++ b/arch/arm/configs/nuc960_defconfig
@@ -0,0 +1,922 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.32-rc7
4# Tue Nov 17 12:20:11 2009
5#
6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y
9CONFIG_GENERIC_TIME=y
10CONFIG_GENERIC_CLOCKEVENTS=y
11CONFIG_GENERIC_HARDIRQS=y
12CONFIG_STACKTRACE_SUPPORT=y
13CONFIG_HAVE_LATENCYTOP_SUPPORT=y
14CONFIG_LOCKDEP_SUPPORT=y
15CONFIG_TRACE_IRQFLAGS_SUPPORT=y
16CONFIG_HARDIRQS_SW_RESEND=y
17CONFIG_GENERIC_IRQ_PROBE=y
18CONFIG_RWSEM_GENERIC_SPINLOCK=y
19CONFIG_GENERIC_HWEIGHT=y
20CONFIG_GENERIC_CALIBRATE_DELAY=y
21CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
22CONFIG_VECTORS_BASE=0xffff0000
23CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
24CONFIG_CONSTRUCTORS=y
25
26#
27# General setup
28#
29CONFIG_EXPERIMENTAL=y
30CONFIG_BROKEN_ON_SMP=y
31CONFIG_LOCK_KERNEL=y
32CONFIG_INIT_ENV_ARG_LIMIT=32
33CONFIG_LOCALVERSION=""
34# CONFIG_LOCALVERSION_AUTO is not set
35CONFIG_SWAP=y
36CONFIG_SYSVIPC=y
37CONFIG_SYSVIPC_SYSCTL=y
38CONFIG_BSD_PROCESS_ACCT=y
39# CONFIG_BSD_PROCESS_ACCT_V3 is not set
40
41#
42# RCU Subsystem
43#
44CONFIG_TREE_RCU=y
45# CONFIG_TREE_PREEMPT_RCU is not set
46# CONFIG_RCU_TRACE is not set
47CONFIG_RCU_FANOUT=32
48# CONFIG_RCU_FANOUT_EXACT is not set
49# CONFIG_TREE_RCU_TRACE is not set
50# CONFIG_IKCONFIG is not set
51CONFIG_LOG_BUF_SHIFT=17
52# CONFIG_GROUP_SCHED is not set
53# CONFIG_CGROUPS is not set
54CONFIG_SYSFS_DEPRECATED=y
55CONFIG_SYSFS_DEPRECATED_V2=y
56CONFIG_RELAY=y
57CONFIG_NAMESPACES=y
58# CONFIG_UTS_NS is not set
59# CONFIG_IPC_NS is not set
60CONFIG_USER_NS=y
61# CONFIG_PID_NS is not set
62CONFIG_BLK_DEV_INITRD=y
63CONFIG_INITRAMFS_SOURCE=""
64CONFIG_RD_GZIP=y
65CONFIG_RD_BZIP2=y
66CONFIG_RD_LZMA=y
67CONFIG_CC_OPTIMIZE_FOR_SIZE=y
68CONFIG_SYSCTL=y
69CONFIG_ANON_INODES=y
70# CONFIG_EMBEDDED is not set
71CONFIG_UID16=y
72CONFIG_SYSCTL_SYSCALL=y
73CONFIG_KALLSYMS=y
74CONFIG_KALLSYMS_EXTRA_PASS=y
75CONFIG_HOTPLUG=y
76CONFIG_PRINTK=y
77CONFIG_BUG=y
78CONFIG_ELF_CORE=y
79CONFIG_BASE_FULL=y
80CONFIG_FUTEX=y
81CONFIG_EPOLL=y
82CONFIG_SIGNALFD=y
83CONFIG_TIMERFD=y
84CONFIG_EVENTFD=y
85CONFIG_SHMEM=y
86CONFIG_AIO=y
87
88#
89# Kernel Performance Events And Counters
90#
91CONFIG_VM_EVENT_COUNTERS=y
92CONFIG_COMPAT_BRK=y
93CONFIG_SLAB=y
94# CONFIG_SLUB is not set
95# CONFIG_SLOB is not set
96# CONFIG_PROFILING is not set
97CONFIG_HAVE_OPROFILE=y
98CONFIG_HAVE_KPROBES=y
99CONFIG_HAVE_KRETPROBES=y
100CONFIG_HAVE_CLK=y
101
102#
103# GCOV-based kernel profiling
104#
105# CONFIG_GCOV_KERNEL is not set
106# CONFIG_SLOW_WORK is not set
107CONFIG_HAVE_GENERIC_DMA_COHERENT=y
108CONFIG_SLABINFO=y
109CONFIG_RT_MUTEXES=y
110CONFIG_BASE_SMALL=0
111# CONFIG_MODULES is not set
112CONFIG_BLOCK=y
113CONFIG_LBDAF=y
114CONFIG_BLK_DEV_BSG=y
115# CONFIG_BLK_DEV_INTEGRITY is not set
116
117#
118# IO Schedulers
119#
120CONFIG_IOSCHED_NOOP=y
121CONFIG_IOSCHED_AS=y
122CONFIG_IOSCHED_DEADLINE=y
123CONFIG_IOSCHED_CFQ=y
124# CONFIG_DEFAULT_AS is not set
125# CONFIG_DEFAULT_DEADLINE is not set
126CONFIG_DEFAULT_CFQ=y
127# CONFIG_DEFAULT_NOOP is not set
128CONFIG_DEFAULT_IOSCHED="cfq"
129# CONFIG_FREEZER is not set
130
131#
132# System Type
133#
134CONFIG_MMU=y
135# CONFIG_ARCH_AAEC2000 is not set
136# CONFIG_ARCH_INTEGRATOR is not set
137# CONFIG_ARCH_REALVIEW is not set
138# CONFIG_ARCH_VERSATILE is not set
139# CONFIG_ARCH_AT91 is not set
140# CONFIG_ARCH_CLPS711X is not set
141# CONFIG_ARCH_GEMINI is not set
142# CONFIG_ARCH_EBSA110 is not set
143# CONFIG_ARCH_EP93XX is not set
144# CONFIG_ARCH_FOOTBRIDGE is not set
145# CONFIG_ARCH_MXC is not set
146# CONFIG_ARCH_STMP3XXX is not set
147# CONFIG_ARCH_NETX is not set
148# CONFIG_ARCH_H720X is not set
149# CONFIG_ARCH_NOMADIK is not set
150# CONFIG_ARCH_IOP13XX is not set
151# CONFIG_ARCH_IOP32X is not set
152# CONFIG_ARCH_IOP33X is not set
153# CONFIG_ARCH_IXP23XX is not set
154# CONFIG_ARCH_IXP2000 is not set
155# CONFIG_ARCH_IXP4XX is not set
156# CONFIG_ARCH_L7200 is not set
157# CONFIG_ARCH_KIRKWOOD is not set
158# CONFIG_ARCH_LOKI is not set
159# CONFIG_ARCH_MV78XX0 is not set
160# CONFIG_ARCH_ORION5X is not set
161# CONFIG_ARCH_MMP is not set
162# CONFIG_ARCH_KS8695 is not set
163# CONFIG_ARCH_NS9XXX is not set
164CONFIG_ARCH_W90X900=y
165# CONFIG_ARCH_PNX4008 is not set
166# CONFIG_ARCH_PXA is not set
167# CONFIG_ARCH_MSM is not set
168# CONFIG_ARCH_RPC is not set
169# CONFIG_ARCH_SA1100 is not set
170# CONFIG_ARCH_S3C2410 is not set
171# CONFIG_ARCH_S3C64XX is not set
172# CONFIG_ARCH_S5PC1XX is not set
173# CONFIG_ARCH_SHARK is not set
174# CONFIG_ARCH_LH7A40X is not set
175# CONFIG_ARCH_U300 is not set
176# CONFIG_ARCH_DAVINCI is not set
177# CONFIG_ARCH_OMAP is not set
178# CONFIG_ARCH_BCMRING is not set
179CONFIG_CPU_NUC960=y
180
181#
182# W90P910 Machines
183#
184# CONFIG_MACH_W90P910EVB is not set
185
186#
187# NUC950 Machines
188#
189# CONFIG_MACH_W90P950EVB is not set
190
191#
192# NUC960 Machines
193#
194CONFIG_MACH_W90N960EVB=y
195
196#
197# NUC932 Machines
198#
199# CONFIG_MACH_NUC932EVB is not set
200
201#
202# Processor Type
203#
204CONFIG_CPU_32=y
205CONFIG_CPU_ARM926T=y
206CONFIG_CPU_32v5=y
207CONFIG_CPU_ABRT_EV5TJ=y
208CONFIG_CPU_PABRT_LEGACY=y
209CONFIG_CPU_CACHE_VIVT=y
210CONFIG_CPU_COPY_V4WB=y
211CONFIG_CPU_TLB_V4WBI=y
212CONFIG_CPU_CP15=y
213CONFIG_CPU_CP15_MMU=y
214
215#
216# Processor Features
217#
218CONFIG_ARM_THUMB=y
219# CONFIG_CPU_ICACHE_DISABLE is not set
220# CONFIG_CPU_DCACHE_DISABLE is not set
221# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
222# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
223CONFIG_ARM_L1_CACHE_SHIFT=5
224CONFIG_COMMON_CLKDEV=y
225
226#
227# Bus support
228#
229# CONFIG_PCI_SYSCALL is not set
230# CONFIG_ARCH_SUPPORTS_MSI is not set
231# CONFIG_PCCARD is not set
232
233#
234# Kernel Features
235#
236CONFIG_TICK_ONESHOT=y
237CONFIG_NO_HZ=y
238CONFIG_HIGH_RES_TIMERS=y
239CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
240CONFIG_VMSPLIT_3G=y
241# CONFIG_VMSPLIT_2G is not set
242# CONFIG_VMSPLIT_1G is not set
243CONFIG_PAGE_OFFSET=0xC0000000
244# CONFIG_PREEMPT_NONE is not set
245# CONFIG_PREEMPT_VOLUNTARY is not set
246CONFIG_PREEMPT=y
247CONFIG_HZ=100
248CONFIG_AEABI=y
249CONFIG_OABI_COMPAT=y
250# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
251# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
252# CONFIG_HIGHMEM is not set
253CONFIG_SELECT_MEMORY_MODEL=y
254CONFIG_FLATMEM_MANUAL=y
255# CONFIG_DISCONTIGMEM_MANUAL is not set
256# CONFIG_SPARSEMEM_MANUAL is not set
257CONFIG_FLATMEM=y
258CONFIG_FLAT_NODE_MEM_MAP=y
259CONFIG_PAGEFLAGS_EXTENDED=y
260CONFIG_SPLIT_PTLOCK_CPUS=4096
261# CONFIG_PHYS_ADDR_T_64BIT is not set
262CONFIG_ZONE_DMA_FLAG=0
263CONFIG_VIRT_TO_BUS=y
264CONFIG_HAVE_MLOCK=y
265CONFIG_HAVE_MLOCKED_PAGE_BIT=y
266# CONFIG_KSM is not set
267CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
268CONFIG_ALIGNMENT_TRAP=y
269# CONFIG_UACCESS_WITH_MEMCPY is not set
270
271#
272# Boot options
273#
274CONFIG_ZBOOT_ROM_TEXT=0
275CONFIG_ZBOOT_ROM_BSS=0
276CONFIG_CMDLINE="root=/dev/ram0 console=ttyS0,115200n8 rdinit=/sbin/init mem=64M"
277# CONFIG_XIP_KERNEL is not set
278CONFIG_KEXEC=y
279CONFIG_ATAGS_PROC=y
280
281#
282# CPU Power Management
283#
284# CONFIG_CPU_IDLE is not set
285
286#
287# Floating point emulation
288#
289
290#
291# At least one emulation must be selected
292#
293CONFIG_FPE_NWFPE=y
294# CONFIG_FPE_NWFPE_XP is not set
295# CONFIG_FPE_FASTFPE is not set
296# CONFIG_VFP is not set
297
298#
299# Userspace binary formats
300#
301CONFIG_BINFMT_ELF=y
302# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
303CONFIG_HAVE_AOUT=y
304CONFIG_BINFMT_AOUT=y
305CONFIG_BINFMT_MISC=y
306
307#
308# Power management options
309#
310# CONFIG_PM is not set
311CONFIG_ARCH_SUSPEND_POSSIBLE=y
312# CONFIG_NET is not set
313
314#
315# Device Drivers
316#
317
318#
319# Generic Driver Options
320#
321CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
322# CONFIG_DEVTMPFS is not set
323CONFIG_STANDALONE=y
324CONFIG_PREVENT_FIRMWARE_BUILD=y
325CONFIG_FW_LOADER=y
326CONFIG_FIRMWARE_IN_KERNEL=y
327CONFIG_EXTRA_FIRMWARE=""
328# CONFIG_SYS_HYPERVISOR is not set
329CONFIG_MTD=y
330# CONFIG_MTD_DEBUG is not set
331CONFIG_MTD_CONCAT=y
332CONFIG_MTD_PARTITIONS=y
333# CONFIG_MTD_REDBOOT_PARTS is not set
334# CONFIG_MTD_CMDLINE_PARTS is not set
335# CONFIG_MTD_AFS_PARTS is not set
336# CONFIG_MTD_AR7_PARTS is not set
337
338#
339# User Modules And Translation Layers
340#
341CONFIG_MTD_CHAR=y
342CONFIG_MTD_BLKDEVS=y
343CONFIG_MTD_BLOCK=y
344# CONFIG_FTL is not set
345# CONFIG_NFTL is not set
346# CONFIG_INFTL is not set
347# CONFIG_RFD_FTL is not set
348# CONFIG_SSFDC is not set
349# CONFIG_MTD_OOPS is not set
350
351#
352# RAM/ROM/Flash chip drivers
353#
354CONFIG_MTD_CFI=y
355# CONFIG_MTD_JEDECPROBE is not set
356CONFIG_MTD_GEN_PROBE=y
357# CONFIG_MTD_CFI_ADV_OPTIONS is not set
358CONFIG_MTD_MAP_BANK_WIDTH_1=y
359CONFIG_MTD_MAP_BANK_WIDTH_2=y
360CONFIG_MTD_MAP_BANK_WIDTH_4=y
361# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
362# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
363# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
364CONFIG_MTD_CFI_I1=y
365CONFIG_MTD_CFI_I2=y
366# CONFIG_MTD_CFI_I4 is not set
367# CONFIG_MTD_CFI_I8 is not set
368# CONFIG_MTD_CFI_INTELEXT is not set
369CONFIG_MTD_CFI_AMDSTD=y
370# CONFIG_MTD_CFI_STAA is not set
371CONFIG_MTD_CFI_UTIL=y
372# CONFIG_MTD_RAM is not set
373# CONFIG_MTD_ROM is not set
374# CONFIG_MTD_ABSENT is not set
375
376#
377# Mapping drivers for chip access
378#
379# CONFIG_MTD_COMPLEX_MAPPINGS is not set
380CONFIG_MTD_PHYSMAP=y
381# CONFIG_MTD_PHYSMAP_COMPAT is not set
382# CONFIG_MTD_ARM_INTEGRATOR is not set
383# CONFIG_MTD_PLATRAM is not set
384
385#
386# Self-contained MTD device drivers
387#
388# CONFIG_MTD_SLRAM is not set
389# CONFIG_MTD_PHRAM is not set
390# CONFIG_MTD_MTDRAM is not set
391# CONFIG_MTD_BLOCK2MTD is not set
392
393#
394# Disk-On-Chip Device Drivers
395#
396# CONFIG_MTD_DOC2000 is not set
397# CONFIG_MTD_DOC2001 is not set
398# CONFIG_MTD_DOC2001PLUS is not set
399# CONFIG_MTD_NAND is not set
400# CONFIG_MTD_ONENAND is not set
401
402#
403# LPDDR flash memory drivers
404#
405# CONFIG_MTD_LPDDR is not set
406
407#
408# UBI - Unsorted block images
409#
410# CONFIG_MTD_UBI is not set
411# CONFIG_PARPORT is not set
412CONFIG_BLK_DEV=y
413# CONFIG_BLK_DEV_COW_COMMON is not set
414# CONFIG_BLK_DEV_LOOP is not set
415# CONFIG_BLK_DEV_UB is not set
416CONFIG_BLK_DEV_RAM=y
417CONFIG_BLK_DEV_RAM_COUNT=16
418CONFIG_BLK_DEV_RAM_SIZE=16384
419# CONFIG_BLK_DEV_XIP is not set
420# CONFIG_CDROM_PKTCDVD is not set
421# CONFIG_MG_DISK is not set
422# CONFIG_MISC_DEVICES is not set
423CONFIG_HAVE_IDE=y
424# CONFIG_IDE is not set
425
426#
427# SCSI device support
428#
429# CONFIG_RAID_ATTRS is not set
430CONFIG_SCSI=y
431CONFIG_SCSI_DMA=y
432# CONFIG_SCSI_TGT is not set
433# CONFIG_SCSI_NETLINK is not set
434# CONFIG_SCSI_PROC_FS is not set
435
436#
437# SCSI support type (disk, tape, CD-ROM)
438#
439CONFIG_BLK_DEV_SD=y
440# CONFIG_CHR_DEV_ST is not set
441# CONFIG_CHR_DEV_OSST is not set
442# CONFIG_BLK_DEV_SR is not set
443# CONFIG_CHR_DEV_SG is not set
444# CONFIG_CHR_DEV_SCH is not set
445# CONFIG_SCSI_MULTI_LUN is not set
446# CONFIG_SCSI_CONSTANTS is not set
447# CONFIG_SCSI_LOGGING is not set
448# CONFIG_SCSI_SCAN_ASYNC is not set
449
450#
451# SCSI Transports
452#
453# CONFIG_SCSI_SPI_ATTRS is not set
454# CONFIG_SCSI_FC_ATTRS is not set
455# CONFIG_SCSI_SAS_ATTRS is not set
456# CONFIG_SCSI_SAS_LIBSAS is not set
457# CONFIG_SCSI_SRP_ATTRS is not set
458# CONFIG_SCSI_LOWLEVEL is not set
459# CONFIG_SCSI_DH is not set
460# CONFIG_SCSI_OSD_INITIATOR is not set
461# CONFIG_ATA is not set
462# CONFIG_MD is not set
463# CONFIG_PHONE is not set
464
465#
466# Input device support
467#
468CONFIG_INPUT=y
469# CONFIG_INPUT_FF_MEMLESS is not set
470# CONFIG_INPUT_POLLDEV is not set
471
472#
473# Userland interfaces
474#
475CONFIG_INPUT_MOUSEDEV=y
476# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
477CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
478CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
479# CONFIG_INPUT_JOYDEV is not set
480# CONFIG_INPUT_EVDEV is not set
481# CONFIG_INPUT_EVBUG is not set
482
483#
484# Input Device Drivers
485#
486# CONFIG_INPUT_KEYBOARD is not set
487# CONFIG_INPUT_MOUSE is not set
488# CONFIG_INPUT_JOYSTICK is not set
489# CONFIG_INPUT_TABLET is not set
490# CONFIG_INPUT_TOUCHSCREEN is not set
491# CONFIG_INPUT_MISC is not set
492
493#
494# Hardware I/O ports
495#
496# CONFIG_SERIO is not set
497# CONFIG_GAMEPORT is not set
498
499#
500# Character devices
501#
502CONFIG_VT=y
503CONFIG_CONSOLE_TRANSLATIONS=y
504CONFIG_VT_CONSOLE=y
505CONFIG_HW_CONSOLE=y
506# CONFIG_VT_HW_CONSOLE_BINDING is not set
507# CONFIG_DEVKMEM is not set
508# CONFIG_SERIAL_NONSTANDARD is not set
509
510#
511# Serial drivers
512#
513CONFIG_SERIAL_8250=y
514CONFIG_SERIAL_8250_CONSOLE=y
515CONFIG_SERIAL_8250_NR_UARTS=1
516CONFIG_SERIAL_8250_RUNTIME_UARTS=1
517# CONFIG_SERIAL_8250_EXTENDED is not set
518
519#
520# Non-8250 serial port support
521#
522CONFIG_SERIAL_CORE=y
523CONFIG_SERIAL_CORE_CONSOLE=y
524CONFIG_UNIX98_PTYS=y
525# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
526# CONFIG_LEGACY_PTYS is not set
527# CONFIG_IPMI_HANDLER is not set
528# CONFIG_HW_RANDOM is not set
529# CONFIG_R3964 is not set
530# CONFIG_RAW_DRIVER is not set
531# CONFIG_TCG_TPM is not set
532# CONFIG_I2C is not set
533# CONFIG_SPI is not set
534
535#
536# PPS support
537#
538# CONFIG_PPS is not set
539CONFIG_ARCH_REQUIRE_GPIOLIB=y
540CONFIG_GPIOLIB=y
541# CONFIG_GPIO_SYSFS is not set
542
543#
544# Memory mapped GPIO expanders:
545#
546
547#
548# I2C GPIO expanders:
549#
550
551#
552# PCI GPIO expanders:
553#
554
555#
556# SPI GPIO expanders:
557#
558
559#
560# AC97 GPIO expanders:
561#
562# CONFIG_W1 is not set
563# CONFIG_POWER_SUPPLY is not set
564# CONFIG_HWMON is not set
565# CONFIG_THERMAL is not set
566# CONFIG_WATCHDOG is not set
567CONFIG_SSB_POSSIBLE=y
568
569#
570# Sonics Silicon Backplane
571#
572# CONFIG_SSB is not set
573
574#
575# Multifunction device drivers
576#
577# CONFIG_MFD_CORE is not set
578# CONFIG_MFD_SM501 is not set
579# CONFIG_MFD_ASIC3 is not set
580# CONFIG_HTC_EGPIO is not set
581# CONFIG_HTC_PASIC3 is not set
582# CONFIG_MFD_TMIO is not set
583# CONFIG_MFD_T7L66XB is not set
584# CONFIG_MFD_TC6387XB is not set
585# CONFIG_MFD_TC6393XB is not set
586# CONFIG_REGULATOR is not set
587# CONFIG_MEDIA_SUPPORT is not set
588
589#
590# Graphics support
591#
592# CONFIG_VGASTATE is not set
593# CONFIG_VIDEO_OUTPUT_CONTROL is not set
594# CONFIG_FB is not set
595# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
596
597#
598# Display device support
599#
600# CONFIG_DISPLAY_SUPPORT is not set
601
602#
603# Console display driver support
604#
605# CONFIG_VGA_CONSOLE is not set
606CONFIG_DUMMY_CONSOLE=y
607# CONFIG_SOUND is not set
608# CONFIG_HID_SUPPORT is not set
609CONFIG_USB_SUPPORT=y
610CONFIG_USB_ARCH_HAS_HCD=y
611CONFIG_USB_ARCH_HAS_OHCI=y
612CONFIG_USB_ARCH_HAS_EHCI=y
613CONFIG_USB=y
614# CONFIG_USB_DEBUG is not set
615# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
616
617#
618# Miscellaneous USB options
619#
620# CONFIG_USB_DEVICEFS is not set
621CONFIG_USB_DEVICE_CLASS=y
622# CONFIG_USB_DYNAMIC_MINORS is not set
623# CONFIG_USB_OTG is not set
624CONFIG_USB_MON=y
625# CONFIG_USB_WUSB is not set
626# CONFIG_USB_WUSB_CBAF is not set
627
628#
629# USB Host Controller Drivers
630#
631# CONFIG_USB_C67X00_HCD is not set
632# CONFIG_USB_EHCI_HCD is not set
633# CONFIG_USB_OXU210HP_HCD is not set
634# CONFIG_USB_ISP116X_HCD is not set
635# CONFIG_USB_ISP1760_HCD is not set
636# CONFIG_USB_ISP1362_HCD is not set
637# CONFIG_USB_OHCI_HCD is not set
638# CONFIG_USB_SL811_HCD is not set
639# CONFIG_USB_R8A66597_HCD is not set
640# CONFIG_USB_HWA_HCD is not set
641# CONFIG_USB_MUSB_HDRC is not set
642
643#
644# USB Device Class drivers
645#
646# CONFIG_USB_ACM is not set
647# CONFIG_USB_PRINTER is not set
648# CONFIG_USB_WDM is not set
649# CONFIG_USB_TMC is not set
650
651#
652# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
653#
654
655#
656# also be needed; see USB_STORAGE Help for more info
657#
658CONFIG_USB_STORAGE=y
659# CONFIG_USB_STORAGE_DEBUG is not set
660# CONFIG_USB_STORAGE_DATAFAB is not set
661# CONFIG_USB_STORAGE_FREECOM is not set
662# CONFIG_USB_STORAGE_ISD200 is not set
663# CONFIG_USB_STORAGE_USBAT is not set
664# CONFIG_USB_STORAGE_SDDR09 is not set
665# CONFIG_USB_STORAGE_SDDR55 is not set
666# CONFIG_USB_STORAGE_JUMPSHOT is not set
667# CONFIG_USB_STORAGE_ALAUDA is not set
668# CONFIG_USB_STORAGE_ONETOUCH is not set
669# CONFIG_USB_STORAGE_KARMA is not set
670# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
671# CONFIG_USB_LIBUSUAL is not set
672
673#
674# USB Imaging devices
675#
676# CONFIG_USB_MDC800 is not set
677# CONFIG_USB_MICROTEK is not set
678
679#
680# USB port drivers
681#
682# CONFIG_USB_SERIAL is not set
683
684#
685# USB Miscellaneous drivers
686#
687# CONFIG_USB_EMI62 is not set
688# CONFIG_USB_EMI26 is not set
689# CONFIG_USB_ADUTUX is not set
690# CONFIG_USB_SEVSEG is not set
691# CONFIG_USB_RIO500 is not set
692# CONFIG_USB_LEGOTOWER is not set
693# CONFIG_USB_LCD is not set
694# CONFIG_USB_BERRY_CHARGE is not set
695# CONFIG_USB_LED is not set
696# CONFIG_USB_CYPRESS_CY7C63 is not set
697# CONFIG_USB_CYTHERM is not set
698# CONFIG_USB_IDMOUSE is not set
699# CONFIG_USB_FTDI_ELAN is not set
700# CONFIG_USB_APPLEDISPLAY is not set
701# CONFIG_USB_LD is not set
702# CONFIG_USB_TRANCEVIBRATOR is not set
703# CONFIG_USB_IOWARRIOR is not set
704# CONFIG_USB_TEST is not set
705# CONFIG_USB_ISIGHTFW is not set
706# CONFIG_USB_VST is not set
707# CONFIG_USB_GADGET is not set
708
709#
710# OTG and related infrastructure
711#
712# CONFIG_USB_GPIO_VBUS is not set
713# CONFIG_NOP_USB_XCEIV is not set
714# CONFIG_MMC is not set
715# CONFIG_MEMSTICK is not set
716# CONFIG_NEW_LEDS is not set
717# CONFIG_ACCESSIBILITY is not set
718CONFIG_RTC_LIB=y
719# CONFIG_RTC_CLASS is not set
720# CONFIG_DMADEVICES is not set
721# CONFIG_AUXDISPLAY is not set
722# CONFIG_UIO is not set
723
724#
725# TI VLYNQ
726#
727# CONFIG_STAGING is not set
728
729#
730# File systems
731#
732# CONFIG_EXT2_FS is not set
733# CONFIG_EXT3_FS is not set
734# CONFIG_EXT4_FS is not set
735# CONFIG_REISERFS_FS is not set
736# CONFIG_JFS_FS is not set
737CONFIG_FS_POSIX_ACL=y
738# CONFIG_XFS_FS is not set
739# CONFIG_GFS2_FS is not set
740# CONFIG_BTRFS_FS is not set
741# CONFIG_NILFS2_FS is not set
742CONFIG_FILE_LOCKING=y
743CONFIG_FSNOTIFY=y
744# CONFIG_DNOTIFY is not set
745# CONFIG_INOTIFY is not set
746CONFIG_INOTIFY_USER=y
747# CONFIG_QUOTA is not set
748# CONFIG_AUTOFS_FS is not set
749# CONFIG_AUTOFS4_FS is not set
750# CONFIG_FUSE_FS is not set
751CONFIG_GENERIC_ACL=y
752
753#
754# Caches
755#
756# CONFIG_FSCACHE is not set
757
758#
759# CD-ROM/DVD Filesystems
760#
761# CONFIG_ISO9660_FS is not set
762# CONFIG_UDF_FS is not set
763
764#
765# DOS/FAT/NT Filesystems
766#
767# CONFIG_MSDOS_FS is not set
768# CONFIG_VFAT_FS is not set
769# CONFIG_NTFS_FS is not set
770
771#
772# Pseudo filesystems
773#
774CONFIG_PROC_FS=y
775CONFIG_PROC_SYSCTL=y
776CONFIG_PROC_PAGE_MONITOR=y
777CONFIG_SYSFS=y
778CONFIG_TMPFS=y
779CONFIG_TMPFS_POSIX_ACL=y
780# CONFIG_HUGETLB_PAGE is not set
781# CONFIG_CONFIGFS_FS is not set
782CONFIG_MISC_FILESYSTEMS=y
783# CONFIG_ADFS_FS is not set
784# CONFIG_AFFS_FS is not set
785# CONFIG_HFS_FS is not set
786# CONFIG_HFSPLUS_FS is not set
787# CONFIG_BEFS_FS is not set
788# CONFIG_BFS_FS is not set
789# CONFIG_EFS_FS is not set
790# CONFIG_JFFS2_FS is not set
791# CONFIG_CRAMFS is not set
792# CONFIG_SQUASHFS is not set
793# CONFIG_VXFS_FS is not set
794# CONFIG_MINIX_FS is not set
795# CONFIG_OMFS_FS is not set
796# CONFIG_HPFS_FS is not set
797# CONFIG_QNX4FS_FS is not set
798CONFIG_ROMFS_FS=y
799CONFIG_ROMFS_BACKED_BY_BLOCK=y
800# CONFIG_ROMFS_BACKED_BY_MTD is not set
801# CONFIG_ROMFS_BACKED_BY_BOTH is not set
802CONFIG_ROMFS_ON_BLOCK=y
803# CONFIG_SYSV_FS is not set
804# CONFIG_UFS_FS is not set
805
806#
807# Partition Types
808#
809CONFIG_PARTITION_ADVANCED=y
810# CONFIG_ACORN_PARTITION is not set
811# CONFIG_OSF_PARTITION is not set
812# CONFIG_AMIGA_PARTITION is not set
813# CONFIG_ATARI_PARTITION is not set
814# CONFIG_MAC_PARTITION is not set
815CONFIG_MSDOS_PARTITION=y
816# CONFIG_BSD_DISKLABEL is not set
817# CONFIG_MINIX_SUBPARTITION is not set
818# CONFIG_SOLARIS_X86_PARTITION is not set
819# CONFIG_UNIXWARE_DISKLABEL is not set
820# CONFIG_LDM_PARTITION is not set
821# CONFIG_SGI_PARTITION is not set
822# CONFIG_ULTRIX_PARTITION is not set
823# CONFIG_SUN_PARTITION is not set
824# CONFIG_KARMA_PARTITION is not set
825# CONFIG_EFI_PARTITION is not set
826# CONFIG_SYSV68_PARTITION is not set
827CONFIG_NLS=y
828CONFIG_NLS_DEFAULT="iso8859-1"
829CONFIG_NLS_CODEPAGE_437=y
830# CONFIG_NLS_CODEPAGE_737 is not set
831# CONFIG_NLS_CODEPAGE_775 is not set
832# CONFIG_NLS_CODEPAGE_850 is not set
833# CONFIG_NLS_CODEPAGE_852 is not set
834# CONFIG_NLS_CODEPAGE_855 is not set
835# CONFIG_NLS_CODEPAGE_857 is not set
836# CONFIG_NLS_CODEPAGE_860 is not set
837# CONFIG_NLS_CODEPAGE_861 is not set
838# CONFIG_NLS_CODEPAGE_862 is not set
839# CONFIG_NLS_CODEPAGE_863 is not set
840# CONFIG_NLS_CODEPAGE_864 is not set
841# CONFIG_NLS_CODEPAGE_865 is not set
842# CONFIG_NLS_CODEPAGE_866 is not set
843# CONFIG_NLS_CODEPAGE_869 is not set
844# CONFIG_NLS_CODEPAGE_936 is not set
845# CONFIG_NLS_CODEPAGE_950 is not set
846# CONFIG_NLS_CODEPAGE_932 is not set
847# CONFIG_NLS_CODEPAGE_949 is not set
848# CONFIG_NLS_CODEPAGE_874 is not set
849# CONFIG_NLS_ISO8859_8 is not set
850# CONFIG_NLS_CODEPAGE_1250 is not set
851# CONFIG_NLS_CODEPAGE_1251 is not set
852# CONFIG_NLS_ASCII is not set
853CONFIG_NLS_ISO8859_1=y
854# CONFIG_NLS_ISO8859_2 is not set
855# CONFIG_NLS_ISO8859_3 is not set
856# CONFIG_NLS_ISO8859_4 is not set
857# CONFIG_NLS_ISO8859_5 is not set
858# CONFIG_NLS_ISO8859_6 is not set
859# CONFIG_NLS_ISO8859_7 is not set
860# CONFIG_NLS_ISO8859_9 is not set
861# CONFIG_NLS_ISO8859_13 is not set
862# CONFIG_NLS_ISO8859_14 is not set
863# CONFIG_NLS_ISO8859_15 is not set
864# CONFIG_NLS_KOI8_R is not set
865# CONFIG_NLS_KOI8_U is not set
866# CONFIG_NLS_UTF8 is not set
867
868#
869# Kernel hacking
870#
871# CONFIG_PRINTK_TIME is not set
872# CONFIG_ENABLE_WARN_DEPRECATED is not set
873# CONFIG_ENABLE_MUST_CHECK is not set
874CONFIG_FRAME_WARN=1024
875# CONFIG_MAGIC_SYSRQ is not set
876# CONFIG_STRIP_ASM_SYMS is not set
877# CONFIG_UNUSED_SYMBOLS is not set
878CONFIG_DEBUG_FS=y
879# CONFIG_HEADERS_CHECK is not set
880# CONFIG_DEBUG_KERNEL is not set
881CONFIG_DEBUG_BUGVERBOSE=y
882CONFIG_DEBUG_MEMORY_INIT=y
883# CONFIG_RCU_CPU_STALL_DETECTOR is not set
884# CONFIG_LATENCYTOP is not set
885# CONFIG_SYSCTL_SYSCALL_CHECK is not set
886CONFIG_HAVE_FUNCTION_TRACER=y
887CONFIG_TRACING_SUPPORT=y
888# CONFIG_FTRACE is not set
889# CONFIG_DYNAMIC_DEBUG is not set
890# CONFIG_SAMPLES is not set
891CONFIG_HAVE_ARCH_KGDB=y
892CONFIG_ARM_UNWIND=y
893# CONFIG_DEBUG_USER is not set
894
895#
896# Security options
897#
898# CONFIG_KEYS is not set
899# CONFIG_SECURITY is not set
900# CONFIG_SECURITYFS is not set
901# CONFIG_SECURITY_FILE_CAPABILITIES is not set
902# CONFIG_CRYPTO is not set
903# CONFIG_BINARY_PRINTF is not set
904
905#
906# Library routines
907#
908CONFIG_GENERIC_FIND_LAST_BIT=y
909# CONFIG_CRC_CCITT is not set
910# CONFIG_CRC16 is not set
911# CONFIG_CRC_T10DIF is not set
912# CONFIG_CRC_ITU_T is not set
913# CONFIG_CRC32 is not set
914# CONFIG_CRC7 is not set
915# CONFIG_LIBCRC32C is not set
916CONFIG_ZLIB_INFLATE=y
917CONFIG_DECOMPRESS_GZIP=y
918CONFIG_DECOMPRESS_BZIP2=y
919CONFIG_DECOMPRESS_LZMA=y
920CONFIG_HAS_IOMEM=y
921CONFIG_HAS_IOPORT=y
922CONFIG_HAS_DMA=y
diff --git a/arch/arm/configs/omap3_beagle_defconfig b/arch/arm/configs/omap3_beagle_defconfig
index b3c8cce0f8fb..9cfae374e041 100644
--- a/arch/arm/configs/omap3_beagle_defconfig
+++ b/arch/arm/configs/omap3_beagle_defconfig
@@ -52,8 +52,8 @@ CONFIG_FAIR_GROUP_SCHED=y
52# CONFIG_RT_GROUP_SCHED is not set 52# CONFIG_RT_GROUP_SCHED is not set
53CONFIG_USER_SCHED=y 53CONFIG_USER_SCHED=y
54# CONFIG_CGROUP_SCHED is not set 54# CONFIG_CGROUP_SCHED is not set
55CONFIG_SYSFS_DEPRECATED=y 55# CONFIG_SYSFS_DEPRECATED=y is not set
56CONFIG_SYSFS_DEPRECATED_V2=y 56# CONFIG_SYSFS_DEPRECATED_V2=y is not set
57# CONFIG_RELAY is not set 57# CONFIG_RELAY is not set
58# CONFIG_NAMESPACES is not set 58# CONFIG_NAMESPACES is not set
59CONFIG_BLK_DEV_INITRD=y 59CONFIG_BLK_DEV_INITRD=y
diff --git a/arch/arm/configs/omap3_defconfig b/arch/arm/configs/omap3_defconfig
new file mode 100644
index 000000000000..2af28eab9060
--- /dev/null
+++ b/arch/arm/configs/omap3_defconfig
@@ -0,0 +1,2119 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.32-rc8
4# Tue Dec 1 14:04:02 2009
5#
6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y
9CONFIG_GENERIC_TIME=y
10CONFIG_GENERIC_CLOCKEVENTS=y
11CONFIG_GENERIC_HARDIRQS=y
12CONFIG_STACKTRACE_SUPPORT=y
13CONFIG_HAVE_LATENCYTOP_SUPPORT=y
14CONFIG_LOCKDEP_SUPPORT=y
15CONFIG_TRACE_IRQFLAGS_SUPPORT=y
16CONFIG_HARDIRQS_SW_RESEND=y
17CONFIG_GENERIC_IRQ_PROBE=y
18CONFIG_RWSEM_GENERIC_SPINLOCK=y
19CONFIG_ARCH_HAS_CPUFREQ=y
20CONFIG_GENERIC_HWEIGHT=y
21CONFIG_GENERIC_CALIBRATE_DELAY=y
22CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
23CONFIG_OPROFILE_ARMV7=y
24CONFIG_VECTORS_BASE=0xffff0000
25CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
26CONFIG_CONSTRUCTORS=y
27
28#
29# General setup
30#
31CONFIG_EXPERIMENTAL=y
32CONFIG_BROKEN_ON_SMP=y
33CONFIG_INIT_ENV_ARG_LIMIT=32
34CONFIG_LOCALVERSION=""
35CONFIG_LOCALVERSION_AUTO=y
36CONFIG_SWAP=y
37CONFIG_SYSVIPC=y
38CONFIG_SYSVIPC_SYSCTL=y
39CONFIG_POSIX_MQUEUE=y
40CONFIG_POSIX_MQUEUE_SYSCTL=y
41CONFIG_BSD_PROCESS_ACCT=y
42# CONFIG_BSD_PROCESS_ACCT_V3 is not set
43# CONFIG_TASKSTATS is not set
44# CONFIG_AUDIT is not set
45
46#
47# RCU Subsystem
48#
49CONFIG_TREE_RCU=y
50# CONFIG_TREE_PREEMPT_RCU is not set
51# CONFIG_RCU_TRACE is not set
52CONFIG_RCU_FANOUT=32
53# CONFIG_RCU_FANOUT_EXACT is not set
54# CONFIG_TREE_RCU_TRACE is not set
55CONFIG_IKCONFIG=y
56CONFIG_IKCONFIG_PROC=y
57CONFIG_LOG_BUF_SHIFT=14
58CONFIG_GROUP_SCHED=y
59CONFIG_FAIR_GROUP_SCHED=y
60# CONFIG_RT_GROUP_SCHED is not set
61CONFIG_USER_SCHED=y
62# CONFIG_CGROUP_SCHED is not set
63# CONFIG_CGROUPS is not set
64# CONFIG_SYSFS_DEPRECATED_V2 is not set
65# CONFIG_RELAY is not set
66# CONFIG_NAMESPACES is not set
67CONFIG_BLK_DEV_INITRD=y
68CONFIG_INITRAMFS_SOURCE=""
69CONFIG_RD_GZIP=y
70# CONFIG_RD_BZIP2 is not set
71# CONFIG_RD_LZMA is not set
72CONFIG_CC_OPTIMIZE_FOR_SIZE=y
73CONFIG_SYSCTL=y
74CONFIG_ANON_INODES=y
75CONFIG_EMBEDDED=y
76CONFIG_UID16=y
77# CONFIG_SYSCTL_SYSCALL is not set
78CONFIG_KALLSYMS=y
79CONFIG_KALLSYMS_ALL=y
80CONFIG_KALLSYMS_EXTRA_PASS=y
81CONFIG_HOTPLUG=y
82CONFIG_PRINTK=y
83CONFIG_BUG=y
84CONFIG_ELF_CORE=y
85CONFIG_BASE_FULL=y
86CONFIG_FUTEX=y
87CONFIG_EPOLL=y
88CONFIG_SIGNALFD=y
89CONFIG_TIMERFD=y
90CONFIG_EVENTFD=y
91CONFIG_SHMEM=y
92CONFIG_AIO=y
93
94#
95# Kernel Performance Events And Counters
96#
97CONFIG_VM_EVENT_COUNTERS=y
98CONFIG_COMPAT_BRK=y
99CONFIG_SLAB=y
100# CONFIG_SLUB is not set
101# CONFIG_SLOB is not set
102CONFIG_PROFILING=y
103CONFIG_TRACEPOINTS=y
104CONFIG_OPROFILE=y
105CONFIG_HAVE_OPROFILE=y
106CONFIG_KPROBES=y
107CONFIG_KRETPROBES=y
108CONFIG_HAVE_KPROBES=y
109CONFIG_HAVE_KRETPROBES=y
110CONFIG_HAVE_CLK=y
111
112#
113# GCOV-based kernel profiling
114#
115# CONFIG_GCOV_KERNEL is not set
116# CONFIG_SLOW_WORK is not set
117CONFIG_HAVE_GENERIC_DMA_COHERENT=y
118CONFIG_SLABINFO=y
119CONFIG_RT_MUTEXES=y
120CONFIG_BASE_SMALL=0
121CONFIG_MODULES=y
122CONFIG_MODULE_FORCE_LOAD=y
123CONFIG_MODULE_UNLOAD=y
124CONFIG_MODULE_FORCE_UNLOAD=y
125CONFIG_MODVERSIONS=y
126CONFIG_MODULE_SRCVERSION_ALL=y
127CONFIG_BLOCK=y
128CONFIG_LBDAF=y
129# CONFIG_BLK_DEV_BSG is not set
130# CONFIG_BLK_DEV_INTEGRITY is not set
131
132#
133# IO Schedulers
134#
135CONFIG_IOSCHED_NOOP=y
136CONFIG_IOSCHED_AS=y
137CONFIG_IOSCHED_DEADLINE=y
138CONFIG_IOSCHED_CFQ=y
139# CONFIG_DEFAULT_AS is not set
140# CONFIG_DEFAULT_DEADLINE is not set
141CONFIG_DEFAULT_CFQ=y
142# CONFIG_DEFAULT_NOOP is not set
143CONFIG_DEFAULT_IOSCHED="cfq"
144CONFIG_FREEZER=y
145
146#
147# System Type
148#
149CONFIG_MMU=y
150# CONFIG_ARCH_AAEC2000 is not set
151# CONFIG_ARCH_INTEGRATOR is not set
152# CONFIG_ARCH_REALVIEW is not set
153# CONFIG_ARCH_VERSATILE is not set
154# CONFIG_ARCH_AT91 is not set
155# CONFIG_ARCH_CLPS711X is not set
156# CONFIG_ARCH_GEMINI is not set
157# CONFIG_ARCH_EBSA110 is not set
158# CONFIG_ARCH_EP93XX is not set
159# CONFIG_ARCH_FOOTBRIDGE is not set
160# CONFIG_ARCH_MXC is not set
161# CONFIG_ARCH_STMP3XXX is not set
162# CONFIG_ARCH_NETX is not set
163# CONFIG_ARCH_H720X is not set
164# CONFIG_ARCH_NOMADIK is not set
165# CONFIG_ARCH_IOP13XX is not set
166# CONFIG_ARCH_IOP32X is not set
167# CONFIG_ARCH_IOP33X is not set
168# CONFIG_ARCH_IXP23XX is not set
169# CONFIG_ARCH_IXP2000 is not set
170# CONFIG_ARCH_IXP4XX is not set
171# CONFIG_ARCH_L7200 is not set
172# CONFIG_ARCH_KIRKWOOD is not set
173# CONFIG_ARCH_LOKI is not set
174# CONFIG_ARCH_MV78XX0 is not set
175# CONFIG_ARCH_ORION5X is not set
176# CONFIG_ARCH_MMP is not set
177# CONFIG_ARCH_KS8695 is not set
178# CONFIG_ARCH_NS9XXX is not set
179# CONFIG_ARCH_W90X900 is not set
180# CONFIG_ARCH_PNX4008 is not set
181# CONFIG_ARCH_PXA is not set
182# CONFIG_ARCH_MSM is not set
183# CONFIG_ARCH_RPC is not set
184# CONFIG_ARCH_SA1100 is not set
185# CONFIG_ARCH_S3C2410 is not set
186# CONFIG_ARCH_S3C64XX is not set
187# CONFIG_ARCH_S5PC1XX is not set
188# CONFIG_ARCH_SHARK is not set
189# CONFIG_ARCH_LH7A40X is not set
190# CONFIG_ARCH_U300 is not set
191# CONFIG_ARCH_DAVINCI is not set
192CONFIG_ARCH_OMAP=y
193# CONFIG_ARCH_BCMRING is not set
194
195#
196# TI OMAP Implementations
197#
198CONFIG_ARCH_OMAP_OTG=y
199# CONFIG_ARCH_OMAP1 is not set
200# CONFIG_ARCH_OMAP2 is not set
201CONFIG_ARCH_OMAP3=y
202# CONFIG_ARCH_OMAP4 is not set
203
204#
205# OMAP Feature Selections
206#
207# CONFIG_OMAP_DEBUG_POWERDOMAIN is not set
208# CONFIG_OMAP_DEBUG_CLOCKDOMAIN is not set
209CONFIG_OMAP_RESET_CLOCKS=y
210CONFIG_OMAP_MUX=y
211CONFIG_OMAP_MUX_DEBUG=y
212CONFIG_OMAP_MUX_WARNINGS=y
213CONFIG_OMAP_MCBSP=y
214# CONFIG_OMAP_MBOX_FWK is not set
215# CONFIG_OMAP_MPU_TIMER is not set
216CONFIG_OMAP_32K_TIMER=y
217CONFIG_OMAP_32K_TIMER_HZ=128
218CONFIG_OMAP_DM_TIMER=y
219# CONFIG_OMAP_LL_DEBUG_UART1 is not set
220# CONFIG_OMAP_LL_DEBUG_UART2 is not set
221# CONFIG_OMAP_LL_DEBUG_UART3 is not set
222CONFIG_OMAP_LL_DEBUG_NONE=y
223# CONFIG_OMAP_PM_NONE is not set
224CONFIG_OMAP_PM_NOOP=y
225CONFIG_ARCH_OMAP34XX=y
226CONFIG_ARCH_OMAP3430=y
227
228#
229# OMAP Board Type
230#
231CONFIG_MACH_OMAP3_BEAGLE=y
232CONFIG_MACH_OMAP_LDP=y
233CONFIG_MACH_OVERO=y
234CONFIG_MACH_OMAP3EVM=y
235CONFIG_MACH_OMAP3517EVM=y
236CONFIG_MACH_OMAP3_PANDORA=y
237CONFIG_MACH_OMAP_3430SDP=y
238CONFIG_MACH_NOKIA_RX51=y
239CONFIG_MACH_OMAP_ZOOM2=y
240CONFIG_MACH_OMAP_ZOOM3=y
241CONFIG_MACH_CM_T35=y
242CONFIG_MACH_IGEP0020=y
243CONFIG_MACH_OMAP_3630SDP=y
244
245#
246# Processor Type
247#
248CONFIG_CPU_32=y
249CONFIG_CPU_32v6K=y
250CONFIG_CPU_V7=y
251CONFIG_CPU_32v7=y
252CONFIG_CPU_ABRT_EV7=y
253CONFIG_CPU_PABRT_V7=y
254CONFIG_CPU_CACHE_V7=y
255CONFIG_CPU_CACHE_VIPT=y
256CONFIG_CPU_COPY_V6=y
257CONFIG_CPU_TLB_V7=y
258CONFIG_CPU_HAS_ASID=y
259CONFIG_CPU_CP15=y
260CONFIG_CPU_CP15_MMU=y
261
262#
263# Processor Features
264#
265CONFIG_ARM_THUMB=y
266CONFIG_ARM_THUMBEE=y
267# CONFIG_CPU_ICACHE_DISABLE is not set
268# CONFIG_CPU_DCACHE_DISABLE is not set
269# CONFIG_CPU_BPREDICT_DISABLE is not set
270CONFIG_HAS_TLS_REG=y
271CONFIG_ARM_L1_CACHE_SHIFT=6
272# CONFIG_ARM_ERRATA_430973 is not set
273# CONFIG_ARM_ERRATA_458693 is not set
274# CONFIG_ARM_ERRATA_460075 is not set
275CONFIG_COMMON_CLKDEV=y
276
277#
278# Bus support
279#
280# CONFIG_PCI_SYSCALL is not set
281# CONFIG_ARCH_SUPPORTS_MSI is not set
282# CONFIG_PCCARD is not set
283
284#
285# Kernel Features
286#
287CONFIG_TICK_ONESHOT=y
288CONFIG_NO_HZ=y
289CONFIG_HIGH_RES_TIMERS=y
290CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
291CONFIG_VMSPLIT_3G=y
292# CONFIG_VMSPLIT_2G is not set
293# CONFIG_VMSPLIT_1G is not set
294CONFIG_PAGE_OFFSET=0xC0000000
295CONFIG_PREEMPT_NONE=y
296# CONFIG_PREEMPT_VOLUNTARY is not set
297# CONFIG_PREEMPT is not set
298CONFIG_HZ=128
299# CONFIG_THUMB2_KERNEL is not set
300CONFIG_AEABI=y
301CONFIG_OABI_COMPAT=y
302# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
303# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
304# CONFIG_HIGHMEM is not set
305CONFIG_SELECT_MEMORY_MODEL=y
306CONFIG_FLATMEM_MANUAL=y
307# CONFIG_DISCONTIGMEM_MANUAL is not set
308# CONFIG_SPARSEMEM_MANUAL is not set
309CONFIG_FLATMEM=y
310CONFIG_FLAT_NODE_MEM_MAP=y
311CONFIG_PAGEFLAGS_EXTENDED=y
312CONFIG_SPLIT_PTLOCK_CPUS=4
313# CONFIG_PHYS_ADDR_T_64BIT is not set
314CONFIG_ZONE_DMA_FLAG=0
315CONFIG_VIRT_TO_BUS=y
316CONFIG_HAVE_MLOCK=y
317CONFIG_HAVE_MLOCKED_PAGE_BIT=y
318# CONFIG_KSM is not set
319CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
320CONFIG_LEDS=y
321CONFIG_ALIGNMENT_TRAP=y
322# CONFIG_UACCESS_WITH_MEMCPY is not set
323
324#
325# Boot options
326#
327CONFIG_ZBOOT_ROM_TEXT=0x0
328CONFIG_ZBOOT_ROM_BSS=0x0
329CONFIG_CMDLINE="root=/dev/nfs nfsroot=192.168.0.1:/home/user/buildroot ip=192.168.0.2:192.168.0.1:192.168.0.1:255.255.255.0:tgt:eth0:off rw console=ttyS2,115200n8"
330# CONFIG_XIP_KERNEL is not set
331CONFIG_KEXEC=y
332CONFIG_ATAGS_PROC=y
333
334#
335# CPU Power Management
336#
337CONFIG_CPU_FREQ=y
338CONFIG_CPU_FREQ_TABLE=y
339# CONFIG_CPU_FREQ_DEBUG is not set
340CONFIG_CPU_FREQ_STAT=y
341CONFIG_CPU_FREQ_STAT_DETAILS=y
342CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
343# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
344# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
345# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
346# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
347CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
348# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
349CONFIG_CPU_FREQ_GOV_USERSPACE=y
350CONFIG_CPU_FREQ_GOV_ONDEMAND=y
351# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
352# CONFIG_CPU_IDLE is not set
353
354#
355# Floating point emulation
356#
357
358#
359# At least one emulation must be selected
360#
361CONFIG_FPE_NWFPE=y
362# CONFIG_FPE_NWFPE_XP is not set
363# CONFIG_FPE_FASTFPE is not set
364CONFIG_VFP=y
365CONFIG_VFPv3=y
366CONFIG_NEON=y
367
368#
369# Userspace binary formats
370#
371CONFIG_BINFMT_ELF=y
372# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
373CONFIG_HAVE_AOUT=y
374# CONFIG_BINFMT_AOUT is not set
375CONFIG_BINFMT_MISC=y
376
377#
378# Power management options
379#
380CONFIG_PM=y
381CONFIG_PM_DEBUG=y
382CONFIG_PM_VERBOSE=y
383CONFIG_CAN_PM_TRACE=y
384CONFIG_PM_SLEEP=y
385CONFIG_SUSPEND=y
386# CONFIG_PM_TEST_SUSPEND is not set
387CONFIG_SUSPEND_FREEZER=y
388# CONFIG_APM_EMULATION is not set
389# CONFIG_PM_RUNTIME is not set
390CONFIG_ARCH_SUSPEND_POSSIBLE=y
391CONFIG_NET=y
392
393#
394# Networking options
395#
396CONFIG_PACKET=y
397CONFIG_PACKET_MMAP=y
398CONFIG_UNIX=y
399CONFIG_XFRM=y
400CONFIG_XFRM_USER=y
401# CONFIG_XFRM_SUB_POLICY is not set
402CONFIG_XFRM_MIGRATE=y
403# CONFIG_XFRM_STATISTICS is not set
404CONFIG_NET_KEY=y
405CONFIG_NET_KEY_MIGRATE=y
406CONFIG_INET=y
407CONFIG_IP_MULTICAST=y
408# CONFIG_IP_ADVANCED_ROUTER is not set
409CONFIG_IP_FIB_HASH=y
410CONFIG_IP_PNP=y
411CONFIG_IP_PNP_DHCP=y
412CONFIG_IP_PNP_BOOTP=y
413CONFIG_IP_PNP_RARP=y
414# CONFIG_NET_IPIP is not set
415# CONFIG_NET_IPGRE is not set
416# CONFIG_IP_MROUTE is not set
417# CONFIG_ARPD is not set
418# CONFIG_SYN_COOKIES is not set
419# CONFIG_INET_AH is not set
420# CONFIG_INET_ESP is not set
421# CONFIG_INET_IPCOMP is not set
422# CONFIG_INET_XFRM_TUNNEL is not set
423# CONFIG_INET_TUNNEL is not set
424CONFIG_INET_XFRM_MODE_TRANSPORT=y
425CONFIG_INET_XFRM_MODE_TUNNEL=y
426CONFIG_INET_XFRM_MODE_BEET=y
427# CONFIG_INET_LRO is not set
428CONFIG_INET_DIAG=y
429CONFIG_INET_TCP_DIAG=y
430# CONFIG_TCP_CONG_ADVANCED is not set
431CONFIG_TCP_CONG_CUBIC=y
432CONFIG_DEFAULT_TCP_CONG="cubic"
433# CONFIG_TCP_MD5SIG is not set
434# CONFIG_IPV6 is not set
435# CONFIG_NETLABEL is not set
436# CONFIG_NETWORK_SECMARK is not set
437CONFIG_NETFILTER=y
438# CONFIG_NETFILTER_DEBUG is not set
439CONFIG_NETFILTER_ADVANCED=y
440
441#
442# Core Netfilter Configuration
443#
444# CONFIG_NETFILTER_NETLINK_QUEUE is not set
445# CONFIG_NETFILTER_NETLINK_LOG is not set
446# CONFIG_NF_CONNTRACK is not set
447# CONFIG_NETFILTER_XTABLES is not set
448# CONFIG_IP_VS is not set
449
450#
451# IP: Netfilter Configuration
452#
453# CONFIG_NF_DEFRAG_IPV4 is not set
454# CONFIG_IP_NF_QUEUE is not set
455# CONFIG_IP_NF_IPTABLES is not set
456# CONFIG_IP_NF_ARPTABLES is not set
457# CONFIG_IP_DCCP is not set
458# CONFIG_IP_SCTP is not set
459# CONFIG_RDS is not set
460# CONFIG_TIPC is not set
461# CONFIG_ATM is not set
462# CONFIG_BRIDGE is not set
463# CONFIG_NET_DSA is not set
464# CONFIG_VLAN_8021Q is not set
465# CONFIG_DECNET is not set
466# CONFIG_LLC2 is not set
467# CONFIG_IPX is not set
468# CONFIG_ATALK is not set
469# CONFIG_X25 is not set
470# CONFIG_LAPB is not set
471# CONFIG_ECONET is not set
472# CONFIG_WAN_ROUTER is not set
473# CONFIG_PHONET is not set
474# CONFIG_IEEE802154 is not set
475# CONFIG_NET_SCHED is not set
476# CONFIG_DCB is not set
477
478#
479# Network testing
480#
481# CONFIG_NET_PKTGEN is not set
482# CONFIG_NET_TCPPROBE is not set
483# CONFIG_NET_DROP_MONITOR is not set
484# CONFIG_HAMRADIO is not set
485# CONFIG_CAN is not set
486# CONFIG_IRDA is not set
487CONFIG_BT=y
488CONFIG_BT_L2CAP=y
489CONFIG_BT_SCO=y
490CONFIG_BT_RFCOMM=y
491CONFIG_BT_RFCOMM_TTY=y
492CONFIG_BT_BNEP=y
493CONFIG_BT_BNEP_MC_FILTER=y
494CONFIG_BT_BNEP_PROTO_FILTER=y
495CONFIG_BT_HIDP=y
496
497#
498# Bluetooth device drivers
499#
500# CONFIG_BT_HCIBTUSB is not set
501# CONFIG_BT_HCIBTSDIO is not set
502CONFIG_BT_HCIUART=y
503CONFIG_BT_HCIUART_H4=y
504CONFIG_BT_HCIUART_BCSP=y
505CONFIG_BT_HCIUART_LL=y
506CONFIG_BT_HCIBCM203X=y
507CONFIG_BT_HCIBPA10X=y
508# CONFIG_BT_HCIBFUSB is not set
509# CONFIG_BT_HCIVHCI is not set
510# CONFIG_BT_MRVL is not set
511# CONFIG_AF_RXRPC is not set
512CONFIG_WIRELESS=y
513CONFIG_CFG80211=y
514# CONFIG_NL80211_TESTMODE is not set
515# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set
516# CONFIG_CFG80211_REG_DEBUG is not set
517CONFIG_CFG80211_DEFAULT_PS=y
518CONFIG_CFG80211_DEFAULT_PS_VALUE=1
519# CONFIG_CFG80211_DEBUGFS is not set
520CONFIG_WIRELESS_OLD_REGULATORY=y
521CONFIG_WIRELESS_EXT=y
522CONFIG_WIRELESS_EXT_SYSFS=y
523CONFIG_LIB80211=y
524# CONFIG_LIB80211_DEBUG is not set
525CONFIG_MAC80211=y
526CONFIG_MAC80211_RC_PID=y
527CONFIG_MAC80211_RC_MINSTREL=y
528CONFIG_MAC80211_RC_DEFAULT_PID=y
529# CONFIG_MAC80211_RC_DEFAULT_MINSTREL is not set
530CONFIG_MAC80211_RC_DEFAULT="pid"
531# CONFIG_MAC80211_MESH is not set
532CONFIG_MAC80211_LEDS=y
533# CONFIG_MAC80211_DEBUGFS is not set
534# CONFIG_MAC80211_DEBUG_MENU is not set
535# CONFIG_WIMAX is not set
536# CONFIG_RFKILL is not set
537# CONFIG_NET_9P is not set
538
539#
540# Device Drivers
541#
542
543#
544# Generic Driver Options
545#
546CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
547# CONFIG_DEVTMPFS is not set
548CONFIG_STANDALONE=y
549CONFIG_PREVENT_FIRMWARE_BUILD=y
550CONFIG_FW_LOADER=y
551CONFIG_FIRMWARE_IN_KERNEL=y
552CONFIG_EXTRA_FIRMWARE=""
553# CONFIG_DEBUG_DRIVER is not set
554# CONFIG_DEBUG_DEVRES is not set
555# CONFIG_SYS_HYPERVISOR is not set
556CONFIG_CONNECTOR=y
557CONFIG_PROC_EVENTS=y
558CONFIG_MTD=y
559# CONFIG_MTD_DEBUG is not set
560# CONFIG_MTD_TESTS is not set
561CONFIG_MTD_CONCAT=y
562CONFIG_MTD_PARTITIONS=y
563# CONFIG_MTD_REDBOOT_PARTS is not set
564CONFIG_MTD_CMDLINE_PARTS=y
565# CONFIG_MTD_AFS_PARTS is not set
566# CONFIG_MTD_AR7_PARTS is not set
567
568#
569# User Modules And Translation Layers
570#
571CONFIG_MTD_CHAR=y
572CONFIG_MTD_BLKDEVS=y
573CONFIG_MTD_BLOCK=y
574# CONFIG_FTL is not set
575# CONFIG_NFTL is not set
576# CONFIG_INFTL is not set
577# CONFIG_RFD_FTL is not set
578# CONFIG_SSFDC is not set
579CONFIG_MTD_OOPS=y
580
581#
582# RAM/ROM/Flash chip drivers
583#
584CONFIG_MTD_CFI=y
585# CONFIG_MTD_JEDECPROBE is not set
586CONFIG_MTD_GEN_PROBE=y
587# CONFIG_MTD_CFI_ADV_OPTIONS is not set
588CONFIG_MTD_MAP_BANK_WIDTH_1=y
589CONFIG_MTD_MAP_BANK_WIDTH_2=y
590CONFIG_MTD_MAP_BANK_WIDTH_4=y
591# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
592# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
593# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
594CONFIG_MTD_CFI_I1=y
595CONFIG_MTD_CFI_I2=y
596# CONFIG_MTD_CFI_I4 is not set
597# CONFIG_MTD_CFI_I8 is not set
598CONFIG_MTD_CFI_INTELEXT=y
599# CONFIG_MTD_CFI_AMDSTD is not set
600# CONFIG_MTD_CFI_STAA is not set
601CONFIG_MTD_CFI_UTIL=y
602# CONFIG_MTD_RAM is not set
603# CONFIG_MTD_ROM is not set
604# CONFIG_MTD_ABSENT is not set
605
606#
607# Mapping drivers for chip access
608#
609# CONFIG_MTD_COMPLEX_MAPPINGS is not set
610# CONFIG_MTD_PHYSMAP is not set
611# CONFIG_MTD_ARM_INTEGRATOR is not set
612CONFIG_MTD_OMAP_NOR=y
613# CONFIG_MTD_PLATRAM is not set
614
615#
616# Self-contained MTD device drivers
617#
618# CONFIG_MTD_DATAFLASH is not set
619# CONFIG_MTD_M25P80 is not set
620# CONFIG_MTD_SST25L is not set
621# CONFIG_MTD_SLRAM is not set
622# CONFIG_MTD_PHRAM is not set
623# CONFIG_MTD_MTDRAM is not set
624# CONFIG_MTD_BLOCK2MTD is not set
625
626#
627# Disk-On-Chip Device Drivers
628#
629# CONFIG_MTD_DOC2000 is not set
630# CONFIG_MTD_DOC2001 is not set
631# CONFIG_MTD_DOC2001PLUS is not set
632CONFIG_MTD_NAND=y
633# CONFIG_MTD_NAND_VERIFY_WRITE is not set
634# CONFIG_MTD_NAND_ECC_SMC is not set
635# CONFIG_MTD_NAND_MUSEUM_IDS is not set
636# CONFIG_MTD_NAND_GPIO is not set
637CONFIG_MTD_NAND_OMAP2=y
638CONFIG_MTD_NAND_OMAP_PREFETCH=y
639# CONFIG_MTD_NAND_OMAP_PREFETCH_DMA is not set
640CONFIG_MTD_NAND_IDS=y
641# CONFIG_MTD_NAND_DISKONCHIP is not set
642# CONFIG_MTD_NAND_NANDSIM is not set
643# CONFIG_MTD_NAND_PLATFORM is not set
644# CONFIG_MTD_ALAUDA is not set
645CONFIG_MTD_ONENAND=y
646CONFIG_MTD_ONENAND_VERIFY_WRITE=y
647# CONFIG_MTD_ONENAND_GENERIC is not set
648CONFIG_MTD_ONENAND_OMAP2=y
649# CONFIG_MTD_ONENAND_OTP is not set
650# CONFIG_MTD_ONENAND_2X_PROGRAM is not set
651# CONFIG_MTD_ONENAND_SIM is not set
652
653#
654# LPDDR flash memory drivers
655#
656# CONFIG_MTD_LPDDR is not set
657
658#
659# UBI - Unsorted block images
660#
661CONFIG_MTD_UBI=y
662CONFIG_MTD_UBI_WL_THRESHOLD=4096
663CONFIG_MTD_UBI_BEB_RESERVE=1
664# CONFIG_MTD_UBI_GLUEBI is not set
665
666#
667# UBI debugging options
668#
669# CONFIG_MTD_UBI_DEBUG is not set
670# CONFIG_PARPORT is not set
671CONFIG_BLK_DEV=y
672# CONFIG_BLK_DEV_COW_COMMON is not set
673CONFIG_BLK_DEV_LOOP=y
674# CONFIG_BLK_DEV_CRYPTOLOOP is not set
675# CONFIG_BLK_DEV_NBD is not set
676# CONFIG_BLK_DEV_UB is not set
677CONFIG_BLK_DEV_RAM=y
678CONFIG_BLK_DEV_RAM_COUNT=16
679CONFIG_BLK_DEV_RAM_SIZE=16384
680# CONFIG_BLK_DEV_XIP is not set
681# CONFIG_CDROM_PKTCDVD is not set
682# CONFIG_ATA_OVER_ETH is not set
683# CONFIG_MG_DISK is not set
684CONFIG_MISC_DEVICES=y
685# CONFIG_ICS932S401 is not set
686# CONFIG_ENCLOSURE_SERVICES is not set
687# CONFIG_ISL29003 is not set
688# CONFIG_C2PORT is not set
689
690#
691# EEPROM support
692#
693# CONFIG_EEPROM_AT24 is not set
694# CONFIG_EEPROM_AT25 is not set
695CONFIG_EEPROM_LEGACY=y
696# CONFIG_EEPROM_MAX6875 is not set
697# CONFIG_EEPROM_93CX6 is not set
698CONFIG_HAVE_IDE=y
699# CONFIG_IDE is not set
700
701#
702# SCSI device support
703#
704# CONFIG_RAID_ATTRS is not set
705CONFIG_SCSI=y
706CONFIG_SCSI_DMA=y
707# CONFIG_SCSI_TGT is not set
708# CONFIG_SCSI_NETLINK is not set
709CONFIG_SCSI_PROC_FS=y
710
711#
712# SCSI support type (disk, tape, CD-ROM)
713#
714CONFIG_BLK_DEV_SD=y
715# CONFIG_CHR_DEV_ST is not set
716# CONFIG_CHR_DEV_OSST is not set
717# CONFIG_BLK_DEV_SR is not set
718# CONFIG_CHR_DEV_SG is not set
719# CONFIG_CHR_DEV_SCH is not set
720CONFIG_SCSI_MULTI_LUN=y
721# CONFIG_SCSI_CONSTANTS is not set
722# CONFIG_SCSI_LOGGING is not set
723CONFIG_SCSI_SCAN_ASYNC=y
724CONFIG_SCSI_WAIT_SCAN=m
725
726#
727# SCSI Transports
728#
729# CONFIG_SCSI_SPI_ATTRS is not set
730# CONFIG_SCSI_FC_ATTRS is not set
731# CONFIG_SCSI_ISCSI_ATTRS is not set
732# CONFIG_SCSI_SAS_LIBSAS is not set
733# CONFIG_SCSI_SRP_ATTRS is not set
734CONFIG_SCSI_LOWLEVEL=y
735# CONFIG_ISCSI_TCP is not set
736# CONFIG_LIBFC is not set
737# CONFIG_LIBFCOE is not set
738# CONFIG_SCSI_DEBUG is not set
739# CONFIG_SCSI_DH is not set
740# CONFIG_SCSI_OSD_INITIATOR is not set
741# CONFIG_ATA is not set
742CONFIG_MD=y
743# CONFIG_BLK_DEV_MD is not set
744# CONFIG_BLK_DEV_DM is not set
745CONFIG_NETDEVICES=y
746# CONFIG_DUMMY is not set
747# CONFIG_BONDING is not set
748# CONFIG_MACVLAN is not set
749# CONFIG_EQUALIZER is not set
750# CONFIG_TUN is not set
751# CONFIG_VETH is not set
752CONFIG_PHYLIB=y
753
754#
755# MII PHY device drivers
756#
757# CONFIG_MARVELL_PHY is not set
758# CONFIG_DAVICOM_PHY is not set
759# CONFIG_QSEMI_PHY is not set
760# CONFIG_LXT_PHY is not set
761# CONFIG_CICADA_PHY is not set
762# CONFIG_VITESSE_PHY is not set
763CONFIG_SMSC_PHY=y
764# CONFIG_BROADCOM_PHY is not set
765# CONFIG_ICPLUS_PHY is not set
766# CONFIG_REALTEK_PHY is not set
767# CONFIG_NATIONAL_PHY is not set
768# CONFIG_STE10XP is not set
769# CONFIG_LSI_ET1011C_PHY is not set
770# CONFIG_FIXED_PHY is not set
771# CONFIG_MDIO_BITBANG is not set
772CONFIG_NET_ETHERNET=y
773CONFIG_MII=y
774# CONFIG_AX88796 is not set
775CONFIG_SMC91X=y
776# CONFIG_DM9000 is not set
777# CONFIG_ENC28J60 is not set
778# CONFIG_ETHOC is not set
779# CONFIG_SMC911X is not set
780CONFIG_SMSC911X=y
781# CONFIG_DNET is not set
782# CONFIG_IBM_NEW_EMAC_ZMII is not set
783# CONFIG_IBM_NEW_EMAC_RGMII is not set
784# CONFIG_IBM_NEW_EMAC_TAH is not set
785# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
786# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
787# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
788# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
789# CONFIG_B44 is not set
790# CONFIG_KS8842 is not set
791# CONFIG_KS8851 is not set
792# CONFIG_KS8851_MLL is not set
793CONFIG_NETDEV_1000=y
794CONFIG_NETDEV_10000=y
795CONFIG_WLAN=y
796# CONFIG_WLAN_PRE80211 is not set
797CONFIG_WLAN_80211=y
798CONFIG_LIBERTAS=y
799CONFIG_LIBERTAS_USB=y
800CONFIG_LIBERTAS_SDIO=y
801# CONFIG_LIBERTAS_SPI is not set
802CONFIG_LIBERTAS_DEBUG=y
803# CONFIG_LIBERTAS_THINFIRM is not set
804# CONFIG_AT76C50X_USB is not set
805# CONFIG_USB_ZD1201 is not set
806# CONFIG_USB_NET_RNDIS_WLAN is not set
807# CONFIG_RTL8187 is not set
808# CONFIG_MAC80211_HWSIM is not set
809# CONFIG_P54_COMMON is not set
810# CONFIG_ATH_COMMON is not set
811# CONFIG_HOSTAP is not set
812# CONFIG_B43 is not set
813# CONFIG_B43LEGACY is not set
814# CONFIG_ZD1211RW is not set
815# CONFIG_RT2X00 is not set
816# CONFIG_WL12XX is not set
817# CONFIG_IWM is not set
818
819#
820# Enable WiMAX (Networking options) to see the WiMAX drivers
821#
822
823#
824# USB Network Adapters
825#
826# CONFIG_USB_CATC is not set
827# CONFIG_USB_KAWETH is not set
828# CONFIG_USB_PEGASUS is not set
829# CONFIG_USB_RTL8150 is not set
830CONFIG_USB_USBNET=y
831CONFIG_USB_NET_AX8817X=y
832CONFIG_USB_NET_CDCETHER=y
833# CONFIG_USB_NET_CDC_EEM is not set
834# CONFIG_USB_NET_DM9601 is not set
835# CONFIG_USB_NET_SMSC95XX is not set
836# CONFIG_USB_NET_GL620A is not set
837CONFIG_USB_NET_NET1080=y
838# CONFIG_USB_NET_PLUSB is not set
839# CONFIG_USB_NET_MCS7830 is not set
840# CONFIG_USB_NET_RNDIS_HOST is not set
841CONFIG_USB_NET_CDC_SUBSET=y
842CONFIG_USB_ALI_M5632=y
843CONFIG_USB_AN2720=y
844CONFIG_USB_BELKIN=y
845CONFIG_USB_ARMLINUX=y
846CONFIG_USB_EPSON2888=y
847CONFIG_USB_KC2190=y
848CONFIG_USB_NET_ZAURUS=y
849# CONFIG_USB_NET_INT51X1 is not set
850# CONFIG_WAN is not set
851# CONFIG_PPP is not set
852# CONFIG_SLIP is not set
853# CONFIG_NETCONSOLE is not set
854# CONFIG_NETPOLL is not set
855# CONFIG_NET_POLL_CONTROLLER is not set
856# CONFIG_ISDN is not set
857# CONFIG_PHONE is not set
858
859#
860# Input device support
861#
862CONFIG_INPUT=y
863# CONFIG_INPUT_FF_MEMLESS is not set
864# CONFIG_INPUT_POLLDEV is not set
865
866#
867# Userland interfaces
868#
869CONFIG_INPUT_MOUSEDEV=y
870CONFIG_INPUT_MOUSEDEV_PSAUX=y
871CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
872CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
873CONFIG_INPUT_JOYDEV=y
874CONFIG_INPUT_EVDEV=y
875# CONFIG_INPUT_EVBUG is not set
876
877#
878# Input Device Drivers
879#
880CONFIG_INPUT_KEYBOARD=y
881# CONFIG_KEYBOARD_ADP5588 is not set
882CONFIG_KEYBOARD_ATKBD=y
883# CONFIG_QT2160 is not set
884# CONFIG_KEYBOARD_LKKBD is not set
885CONFIG_KEYBOARD_GPIO=y
886# CONFIG_KEYBOARD_MATRIX is not set
887# CONFIG_KEYBOARD_LM8323 is not set
888# CONFIG_KEYBOARD_MAX7359 is not set
889# CONFIG_KEYBOARD_NEWTON is not set
890# CONFIG_KEYBOARD_OPENCORES is not set
891# CONFIG_KEYBOARD_STOWAWAY is not set
892# CONFIG_KEYBOARD_SUNKBD is not set
893CONFIG_KEYBOARD_TWL4030=y
894# CONFIG_KEYBOARD_XTKBD is not set
895CONFIG_INPUT_MOUSE=y
896CONFIG_MOUSE_PS2=y
897CONFIG_MOUSE_PS2_ALPS=y
898CONFIG_MOUSE_PS2_LOGIPS2PP=y
899CONFIG_MOUSE_PS2_SYNAPTICS=y
900CONFIG_MOUSE_PS2_TRACKPOINT=y
901# CONFIG_MOUSE_PS2_ELANTECH is not set
902# CONFIG_MOUSE_PS2_SENTELIC is not set
903# CONFIG_MOUSE_PS2_TOUCHKIT is not set
904# CONFIG_MOUSE_SERIAL is not set
905# CONFIG_MOUSE_APPLETOUCH is not set
906# CONFIG_MOUSE_BCM5974 is not set
907# CONFIG_MOUSE_VSXXXAA is not set
908# CONFIG_MOUSE_GPIO is not set
909# CONFIG_MOUSE_SYNAPTICS_I2C is not set
910# CONFIG_INPUT_JOYSTICK is not set
911# CONFIG_INPUT_TABLET is not set
912CONFIG_INPUT_TOUCHSCREEN=y
913CONFIG_TOUCHSCREEN_ADS7846=y
914# CONFIG_TOUCHSCREEN_AD7877 is not set
915# CONFIG_TOUCHSCREEN_AD7879_I2C is not set
916# CONFIG_TOUCHSCREEN_AD7879_SPI is not set
917# CONFIG_TOUCHSCREEN_AD7879 is not set
918# CONFIG_TOUCHSCREEN_EETI is not set
919# CONFIG_TOUCHSCREEN_FUJITSU is not set
920# CONFIG_TOUCHSCREEN_GUNZE is not set
921# CONFIG_TOUCHSCREEN_ELO is not set
922# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
923# CONFIG_TOUCHSCREEN_MCS5000 is not set
924# CONFIG_TOUCHSCREEN_MTOUCH is not set
925# CONFIG_TOUCHSCREEN_INEXIO is not set
926# CONFIG_TOUCHSCREEN_MK712 is not set
927# CONFIG_TOUCHSCREEN_PENMOUNT is not set
928# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
929# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
930# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
931# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
932# CONFIG_TOUCHSCREEN_TSC2007 is not set
933# CONFIG_TOUCHSCREEN_W90X900 is not set
934CONFIG_INPUT_MISC=y
935# CONFIG_INPUT_ATI_REMOTE is not set
936# CONFIG_INPUT_ATI_REMOTE2 is not set
937# CONFIG_INPUT_KEYSPAN_REMOTE is not set
938# CONFIG_INPUT_POWERMATE is not set
939# CONFIG_INPUT_YEALINK is not set
940# CONFIG_INPUT_CM109 is not set
941CONFIG_INPUT_TWL4030_PWRBUTTON=y
942# CONFIG_INPUT_UINPUT is not set
943# CONFIG_INPUT_GPIO_ROTARY_ENCODER is not set
944
945#
946# Hardware I/O ports
947#
948CONFIG_SERIO=y
949CONFIG_SERIO_SERPORT=y
950CONFIG_SERIO_LIBPS2=y
951# CONFIG_SERIO_RAW is not set
952# CONFIG_GAMEPORT is not set
953
954#
955# Character devices
956#
957CONFIG_VT=y
958CONFIG_CONSOLE_TRANSLATIONS=y
959CONFIG_VT_CONSOLE=y
960CONFIG_HW_CONSOLE=y
961CONFIG_VT_HW_CONSOLE_BINDING=y
962CONFIG_DEVKMEM=y
963# CONFIG_SERIAL_NONSTANDARD is not set
964
965#
966# Serial drivers
967#
968CONFIG_SERIAL_8250=y
969CONFIG_SERIAL_8250_CONSOLE=y
970CONFIG_SERIAL_8250_NR_UARTS=32
971CONFIG_SERIAL_8250_RUNTIME_UARTS=4
972CONFIG_SERIAL_8250_EXTENDED=y
973CONFIG_SERIAL_8250_MANY_PORTS=y
974CONFIG_SERIAL_8250_SHARE_IRQ=y
975CONFIG_SERIAL_8250_DETECT_IRQ=y
976CONFIG_SERIAL_8250_RSA=y
977
978#
979# Non-8250 serial port support
980#
981# CONFIG_SERIAL_MAX3100 is not set
982CONFIG_SERIAL_CORE=y
983CONFIG_SERIAL_CORE_CONSOLE=y
984CONFIG_UNIX98_PTYS=y
985# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
986# CONFIG_LEGACY_PTYS is not set
987# CONFIG_IPMI_HANDLER is not set
988CONFIG_HW_RANDOM=y
989# CONFIG_HW_RANDOM_TIMERIOMEM is not set
990# CONFIG_R3964 is not set
991# CONFIG_RAW_DRIVER is not set
992# CONFIG_TCG_TPM is not set
993CONFIG_I2C=y
994CONFIG_I2C_BOARDINFO=y
995CONFIG_I2C_COMPAT=y
996CONFIG_I2C_CHARDEV=y
997CONFIG_I2C_HELPER_AUTO=y
998
999#
1000# I2C Hardware Bus support
1001#
1002
1003#
1004# I2C system bus drivers (mostly embedded / system-on-chip)
1005#
1006# CONFIG_I2C_DESIGNWARE is not set
1007# CONFIG_I2C_GPIO is not set
1008# CONFIG_I2C_OCORES is not set
1009CONFIG_I2C_OMAP=y
1010# CONFIG_I2C_SIMTEC is not set
1011
1012#
1013# External I2C/SMBus adapter drivers
1014#
1015# CONFIG_I2C_PARPORT_LIGHT is not set
1016# CONFIG_I2C_TAOS_EVM is not set
1017# CONFIG_I2C_TINY_USB is not set
1018
1019#
1020# Other I2C/SMBus bus drivers
1021#
1022# CONFIG_I2C_PCA_PLATFORM is not set
1023# CONFIG_I2C_STUB is not set
1024
1025#
1026# Miscellaneous I2C Chip support
1027#
1028# CONFIG_DS1682 is not set
1029# CONFIG_SENSORS_TSL2550 is not set
1030# CONFIG_I2C_DEBUG_CORE is not set
1031# CONFIG_I2C_DEBUG_ALGO is not set
1032# CONFIG_I2C_DEBUG_BUS is not set
1033# CONFIG_I2C_DEBUG_CHIP is not set
1034CONFIG_SPI=y
1035# CONFIG_SPI_DEBUG is not set
1036CONFIG_SPI_MASTER=y
1037
1038#
1039# SPI Master Controller Drivers
1040#
1041# CONFIG_SPI_BITBANG is not set
1042# CONFIG_SPI_GPIO is not set
1043CONFIG_SPI_OMAP24XX=y
1044
1045#
1046# SPI Protocol Masters
1047#
1048# CONFIG_SPI_SPIDEV is not set
1049# CONFIG_SPI_TLE62X0 is not set
1050
1051#
1052# PPS support
1053#
1054# CONFIG_PPS is not set
1055CONFIG_ARCH_REQUIRE_GPIOLIB=y
1056CONFIG_GPIOLIB=y
1057CONFIG_DEBUG_GPIO=y
1058CONFIG_GPIO_SYSFS=y
1059
1060#
1061# Memory mapped GPIO expanders:
1062#
1063
1064#
1065# I2C GPIO expanders:
1066#
1067# CONFIG_GPIO_MAX732X is not set
1068# CONFIG_GPIO_PCA953X is not set
1069# CONFIG_GPIO_PCF857X is not set
1070CONFIG_GPIO_TWL4030=y
1071
1072#
1073# PCI GPIO expanders:
1074#
1075
1076#
1077# SPI GPIO expanders:
1078#
1079# CONFIG_GPIO_MAX7301 is not set
1080# CONFIG_GPIO_MCP23S08 is not set
1081# CONFIG_GPIO_MC33880 is not set
1082
1083#
1084# AC97 GPIO expanders:
1085#
1086CONFIG_W1=y
1087CONFIG_W1_CON=y
1088
1089#
1090# 1-wire Bus Masters
1091#
1092# CONFIG_W1_MASTER_DS2490 is not set
1093# CONFIG_W1_MASTER_DS2482 is not set
1094# CONFIG_W1_MASTER_DS1WM is not set
1095# CONFIG_W1_MASTER_GPIO is not set
1096# CONFIG_HDQ_MASTER_OMAP is not set
1097
1098#
1099# 1-wire Slaves
1100#
1101# CONFIG_W1_SLAVE_THERM is not set
1102# CONFIG_W1_SLAVE_SMEM is not set
1103# CONFIG_W1_SLAVE_DS2431 is not set
1104# CONFIG_W1_SLAVE_DS2433 is not set
1105# CONFIG_W1_SLAVE_DS2760 is not set
1106# CONFIG_W1_SLAVE_BQ27000 is not set
1107CONFIG_POWER_SUPPLY=y
1108# CONFIG_POWER_SUPPLY_DEBUG is not set
1109# CONFIG_PDA_POWER is not set
1110# CONFIG_BATTERY_DS2760 is not set
1111# CONFIG_BATTERY_DS2782 is not set
1112# CONFIG_BATTERY_BQ27x00 is not set
1113# CONFIG_BATTERY_MAX17040 is not set
1114CONFIG_HWMON=y
1115# CONFIG_HWMON_VID is not set
1116# CONFIG_HWMON_DEBUG_CHIP is not set
1117
1118#
1119# Native drivers
1120#
1121# CONFIG_SENSORS_AD7414 is not set
1122# CONFIG_SENSORS_AD7418 is not set
1123# CONFIG_SENSORS_ADCXX is not set
1124# CONFIG_SENSORS_ADM1021 is not set
1125# CONFIG_SENSORS_ADM1025 is not set
1126# CONFIG_SENSORS_ADM1026 is not set
1127# CONFIG_SENSORS_ADM1029 is not set
1128# CONFIG_SENSORS_ADM1031 is not set
1129# CONFIG_SENSORS_ADM9240 is not set
1130# CONFIG_SENSORS_ADT7462 is not set
1131# CONFIG_SENSORS_ADT7470 is not set
1132# CONFIG_SENSORS_ADT7473 is not set
1133# CONFIG_SENSORS_ADT7475 is not set
1134# CONFIG_SENSORS_ATXP1 is not set
1135# CONFIG_SENSORS_DS1621 is not set
1136# CONFIG_SENSORS_F71805F is not set
1137# CONFIG_SENSORS_F71882FG is not set
1138# CONFIG_SENSORS_F75375S is not set
1139# CONFIG_SENSORS_G760A is not set
1140# CONFIG_SENSORS_GL518SM is not set
1141# CONFIG_SENSORS_GL520SM is not set
1142# CONFIG_SENSORS_IT87 is not set
1143# CONFIG_SENSORS_LM63 is not set
1144# CONFIG_SENSORS_LM70 is not set
1145# CONFIG_SENSORS_LM75 is not set
1146# CONFIG_SENSORS_LM77 is not set
1147# CONFIG_SENSORS_LM78 is not set
1148# CONFIG_SENSORS_LM80 is not set
1149# CONFIG_SENSORS_LM83 is not set
1150# CONFIG_SENSORS_LM85 is not set
1151# CONFIG_SENSORS_LM87 is not set
1152# CONFIG_SENSORS_LM90 is not set
1153# CONFIG_SENSORS_LM92 is not set
1154# CONFIG_SENSORS_LM93 is not set
1155# CONFIG_SENSORS_LTC4215 is not set
1156# CONFIG_SENSORS_LTC4245 is not set
1157# CONFIG_SENSORS_LM95241 is not set
1158# CONFIG_SENSORS_MAX1111 is not set
1159# CONFIG_SENSORS_MAX1619 is not set
1160# CONFIG_SENSORS_MAX6650 is not set
1161# CONFIG_SENSORS_PC87360 is not set
1162# CONFIG_SENSORS_PC87427 is not set
1163# CONFIG_SENSORS_PCF8591 is not set
1164# CONFIG_SENSORS_SHT15 is not set
1165# CONFIG_SENSORS_DME1737 is not set
1166# CONFIG_SENSORS_SMSC47M1 is not set
1167# CONFIG_SENSORS_SMSC47M192 is not set
1168# CONFIG_SENSORS_SMSC47B397 is not set
1169# CONFIG_SENSORS_ADS7828 is not set
1170# CONFIG_SENSORS_THMC50 is not set
1171# CONFIG_SENSORS_TMP401 is not set
1172# CONFIG_SENSORS_TMP421 is not set
1173# CONFIG_SENSORS_VT1211 is not set
1174# CONFIG_SENSORS_W83781D is not set
1175# CONFIG_SENSORS_W83791D is not set
1176# CONFIG_SENSORS_W83792D is not set
1177# CONFIG_SENSORS_W83793 is not set
1178# CONFIG_SENSORS_W83L785TS is not set
1179# CONFIG_SENSORS_W83L786NG is not set
1180# CONFIG_SENSORS_W83627HF is not set
1181# CONFIG_SENSORS_W83627EHF is not set
1182# CONFIG_SENSORS_LIS3_SPI is not set
1183# CONFIG_THERMAL is not set
1184CONFIG_WATCHDOG=y
1185CONFIG_WATCHDOG_NOWAYOUT=y
1186
1187#
1188# Watchdog Device Drivers
1189#
1190# CONFIG_SOFT_WATCHDOG is not set
1191CONFIG_OMAP_WATCHDOG=y
1192CONFIG_TWL4030_WATCHDOG=y
1193
1194#
1195# USB-based Watchdog Cards
1196#
1197# CONFIG_USBPCWATCHDOG is not set
1198CONFIG_SSB_POSSIBLE=y
1199
1200#
1201# Sonics Silicon Backplane
1202#
1203# CONFIG_SSB is not set
1204
1205#
1206# Multifunction device drivers
1207#
1208# CONFIG_MFD_CORE is not set
1209# CONFIG_MFD_SM501 is not set
1210# CONFIG_MFD_ASIC3 is not set
1211# CONFIG_HTC_EGPIO is not set
1212# CONFIG_HTC_PASIC3 is not set
1213# CONFIG_TPS65010 is not set
1214CONFIG_TWL4030_CORE=y
1215# CONFIG_TWL4030_POWER is not set
1216# CONFIG_TWL4030_CODEC is not set
1217# CONFIG_MFD_TMIO is not set
1218# CONFIG_MFD_T7L66XB is not set
1219# CONFIG_MFD_TC6387XB is not set
1220# CONFIG_MFD_TC6393XB is not set
1221# CONFIG_PMIC_DA903X is not set
1222# CONFIG_MFD_WM8400 is not set
1223# CONFIG_MFD_WM831X is not set
1224# CONFIG_MFD_WM8350_I2C is not set
1225# CONFIG_MFD_PCF50633 is not set
1226# CONFIG_MFD_MC13783 is not set
1227# CONFIG_AB3100_CORE is not set
1228# CONFIG_EZX_PCAP is not set
1229CONFIG_REGULATOR=y
1230# CONFIG_REGULATOR_DEBUG is not set
1231CONFIG_REGULATOR_FIXED_VOLTAGE=y
1232# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
1233# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set
1234# CONFIG_REGULATOR_BQ24022 is not set
1235# CONFIG_REGULATOR_MAX1586 is not set
1236CONFIG_REGULATOR_TWL4030=y
1237# CONFIG_REGULATOR_LP3971 is not set
1238# CONFIG_REGULATOR_TPS65023 is not set
1239# CONFIG_REGULATOR_TPS6507X is not set
1240# CONFIG_MEDIA_SUPPORT is not set
1241
1242#
1243# Graphics support
1244#
1245# CONFIG_VGASTATE is not set
1246# CONFIG_VIDEO_OUTPUT_CONTROL is not set
1247CONFIG_FB=y
1248CONFIG_FIRMWARE_EDID=y
1249# CONFIG_FB_DDC is not set
1250# CONFIG_FB_BOOT_VESA_SUPPORT is not set
1251CONFIG_FB_CFB_FILLRECT=y
1252CONFIG_FB_CFB_COPYAREA=y
1253CONFIG_FB_CFB_IMAGEBLIT=y
1254# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
1255# CONFIG_FB_SYS_FILLRECT is not set
1256# CONFIG_FB_SYS_COPYAREA is not set
1257# CONFIG_FB_SYS_IMAGEBLIT is not set
1258# CONFIG_FB_FOREIGN_ENDIAN is not set
1259# CONFIG_FB_SYS_FOPS is not set
1260# CONFIG_FB_SVGALIB is not set
1261# CONFIG_FB_MACMODES is not set
1262# CONFIG_FB_BACKLIGHT is not set
1263CONFIG_FB_MODE_HELPERS=y
1264CONFIG_FB_TILEBLITTING=y
1265
1266#
1267# Frame buffer hardware drivers
1268#
1269# CONFIG_FB_UVESA is not set
1270# CONFIG_FB_S1D13XXX is not set
1271# CONFIG_FB_VIRTUAL is not set
1272# CONFIG_FB_METRONOME is not set
1273# CONFIG_FB_MB862XX is not set
1274# CONFIG_FB_BROADSHEET is not set
1275CONFIG_FB_OMAP=y
1276CONFIG_FB_OMAP_LCD_VGA=y
1277# CONFIG_FB_OMAP_031M3R is not set
1278# CONFIG_FB_OMAP_048M3R is not set
1279CONFIG_FB_OMAP_079M3R=y
1280# CONFIG_FB_OMAP_092M9R is not set
1281# CONFIG_FB_OMAP_LCDC_EXTERNAL is not set
1282# CONFIG_FB_OMAP_LCD_MIPID is not set
1283# CONFIG_FB_OMAP_BOOTLOADER_INIT is not set
1284CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE=2
1285CONFIG_BACKLIGHT_LCD_SUPPORT=y
1286CONFIG_LCD_CLASS_DEVICE=y
1287# CONFIG_LCD_LMS283GF05 is not set
1288# CONFIG_LCD_LTV350QV is not set
1289# CONFIG_LCD_ILI9320 is not set
1290# CONFIG_LCD_TDO24M is not set
1291# CONFIG_LCD_VGG2432A4 is not set
1292CONFIG_LCD_PLATFORM=y
1293CONFIG_BACKLIGHT_CLASS_DEVICE=y
1294CONFIG_BACKLIGHT_GENERIC=y
1295
1296#
1297# Display device support
1298#
1299CONFIG_DISPLAY_SUPPORT=y
1300
1301#
1302# Display hardware drivers
1303#
1304
1305#
1306# Console display driver support
1307#
1308# CONFIG_VGA_CONSOLE is not set
1309CONFIG_DUMMY_CONSOLE=y
1310CONFIG_FRAMEBUFFER_CONSOLE=y
1311# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
1312CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
1313CONFIG_FONTS=y
1314CONFIG_FONT_8x8=y
1315CONFIG_FONT_8x16=y
1316# CONFIG_FONT_6x11 is not set
1317# CONFIG_FONT_7x14 is not set
1318# CONFIG_FONT_PEARL_8x8 is not set
1319# CONFIG_FONT_ACORN_8x8 is not set
1320# CONFIG_FONT_MINI_4x6 is not set
1321# CONFIG_FONT_SUN8x16 is not set
1322# CONFIG_FONT_SUN12x22 is not set
1323# CONFIG_FONT_10x18 is not set
1324CONFIG_LOGO=y
1325CONFIG_LOGO_LINUX_MONO=y
1326CONFIG_LOGO_LINUX_VGA16=y
1327CONFIG_LOGO_LINUX_CLUT224=y
1328CONFIG_SOUND=y
1329CONFIG_SOUND_OSS_CORE=y
1330CONFIG_SOUND_OSS_CORE_PRECLAIM=y
1331CONFIG_SND=y
1332CONFIG_SND_TIMER=y
1333CONFIG_SND_PCM=y
1334CONFIG_SND_HWDEP=y
1335CONFIG_SND_RAWMIDI=y
1336CONFIG_SND_JACK=y
1337# CONFIG_SND_SEQUENCER is not set
1338CONFIG_SND_OSSEMUL=y
1339CONFIG_SND_MIXER_OSS=y
1340CONFIG_SND_PCM_OSS=y
1341CONFIG_SND_PCM_OSS_PLUGINS=y
1342# CONFIG_SND_HRTIMER is not set
1343# CONFIG_SND_DYNAMIC_MINORS is not set
1344CONFIG_SND_SUPPORT_OLD_API=y
1345CONFIG_SND_VERBOSE_PROCFS=y
1346CONFIG_SND_VERBOSE_PRINTK=y
1347CONFIG_SND_DEBUG=y
1348# CONFIG_SND_DEBUG_VERBOSE is not set
1349# CONFIG_SND_PCM_XRUN_DEBUG is not set
1350# CONFIG_SND_RAWMIDI_SEQ is not set
1351# CONFIG_SND_OPL3_LIB_SEQ is not set
1352# CONFIG_SND_OPL4_LIB_SEQ is not set
1353# CONFIG_SND_SBAWE_SEQ is not set
1354# CONFIG_SND_EMU10K1_SEQ is not set
1355CONFIG_SND_DRIVERS=y
1356# CONFIG_SND_DUMMY is not set
1357# CONFIG_SND_MTPAV is not set
1358# CONFIG_SND_SERIAL_U16550 is not set
1359# CONFIG_SND_MPU401 is not set
1360CONFIG_SND_ARM=y
1361CONFIG_SND_SPI=y
1362CONFIG_SND_USB=y
1363CONFIG_SND_USB_AUDIO=y
1364# CONFIG_SND_USB_CAIAQ is not set
1365CONFIG_SND_SOC=y
1366CONFIG_SND_OMAP_SOC=y
1367CONFIG_SND_OMAP_SOC_MCBSP=y
1368# CONFIG_SND_OMAP_SOC_OVERO is not set
1369# CONFIG_SND_OMAP_SOC_OMAP3EVM is not set
1370# CONFIG_SND_OMAP_SOC_SDP3430 is not set
1371CONFIG_SND_OMAP_SOC_OMAP3_PANDORA=y
1372# CONFIG_SND_OMAP_SOC_OMAP3_BEAGLE is not set
1373# CONFIG_SND_OMAP_SOC_ZOOM2 is not set
1374CONFIG_SND_SOC_I2C_AND_SPI=y
1375# CONFIG_SND_SOC_ALL_CODECS is not set
1376CONFIG_SND_SOC_TWL4030=y
1377# CONFIG_SOUND_PRIME is not set
1378CONFIG_HID_SUPPORT=y
1379CONFIG_HID=y
1380# CONFIG_HIDRAW is not set
1381
1382#
1383# USB Input Devices
1384#
1385CONFIG_USB_HID=y
1386# CONFIG_HID_PID is not set
1387# CONFIG_USB_HIDDEV is not set
1388
1389#
1390# Special HID drivers
1391#
1392# CONFIG_HID_A4TECH is not set
1393# CONFIG_HID_APPLE is not set
1394# CONFIG_HID_BELKIN is not set
1395# CONFIG_HID_CHERRY is not set
1396# CONFIG_HID_CHICONY is not set
1397# CONFIG_HID_CYPRESS is not set
1398# CONFIG_HID_DRAGONRISE is not set
1399# CONFIG_HID_EZKEY is not set
1400# CONFIG_HID_KYE is not set
1401# CONFIG_HID_GYRATION is not set
1402# CONFIG_HID_TWINHAN is not set
1403# CONFIG_HID_KENSINGTON is not set
1404# CONFIG_HID_LOGITECH is not set
1405# CONFIG_HID_MICROSOFT is not set
1406# CONFIG_HID_MONTEREY is not set
1407# CONFIG_HID_NTRIG is not set
1408# CONFIG_HID_PANTHERLORD is not set
1409# CONFIG_HID_PETALYNX is not set
1410# CONFIG_HID_SAMSUNG is not set
1411# CONFIG_HID_SONY is not set
1412# CONFIG_HID_SUNPLUS is not set
1413# CONFIG_HID_GREENASIA is not set
1414# CONFIG_HID_SMARTJOYPLUS is not set
1415# CONFIG_HID_TOPSEED is not set
1416# CONFIG_HID_THRUSTMASTER is not set
1417# CONFIG_HID_WACOM is not set
1418# CONFIG_HID_ZEROPLUS is not set
1419CONFIG_USB_SUPPORT=y
1420CONFIG_USB_ARCH_HAS_HCD=y
1421CONFIG_USB_ARCH_HAS_OHCI=y
1422# CONFIG_USB_ARCH_HAS_EHCI is not set
1423CONFIG_USB=y
1424CONFIG_USB_DEBUG=y
1425CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
1426
1427#
1428# Miscellaneous USB options
1429#
1430CONFIG_USB_DEVICEFS=y
1431CONFIG_USB_DEVICE_CLASS=y
1432# CONFIG_USB_DYNAMIC_MINORS is not set
1433CONFIG_USB_SUSPEND=y
1434CONFIG_USB_OTG=y
1435# CONFIG_USB_OTG_WHITELIST is not set
1436# CONFIG_USB_OTG_BLACKLIST_HUB is not set
1437CONFIG_USB_MON=y
1438# CONFIG_USB_WUSB is not set
1439# CONFIG_USB_WUSB_CBAF is not set
1440
1441#
1442# USB Host Controller Drivers
1443#
1444# CONFIG_USB_C67X00_HCD is not set
1445# CONFIG_USB_OXU210HP_HCD is not set
1446# CONFIG_USB_ISP116X_HCD is not set
1447# CONFIG_USB_ISP1760_HCD is not set
1448# CONFIG_USB_ISP1362_HCD is not set
1449# CONFIG_USB_OHCI_HCD is not set
1450# CONFIG_USB_SL811_HCD is not set
1451# CONFIG_USB_R8A66597_HCD is not set
1452# CONFIG_USB_HWA_HCD is not set
1453CONFIG_USB_MUSB_HDRC=y
1454CONFIG_USB_MUSB_SOC=y
1455
1456#
1457# OMAP 343x high speed USB support
1458#
1459# CONFIG_USB_MUSB_HOST is not set
1460# CONFIG_USB_MUSB_PERIPHERAL is not set
1461CONFIG_USB_MUSB_OTG=y
1462CONFIG_USB_GADGET_MUSB_HDRC=y
1463CONFIG_USB_MUSB_HDRC_HCD=y
1464# CONFIG_MUSB_PIO_ONLY is not set
1465CONFIG_USB_INVENTRA_DMA=y
1466# CONFIG_USB_TI_CPPI_DMA is not set
1467CONFIG_USB_MUSB_DEBUG=y
1468
1469#
1470# USB Device Class drivers
1471#
1472# CONFIG_USB_ACM is not set
1473# CONFIG_USB_PRINTER is not set
1474CONFIG_USB_WDM=y
1475# CONFIG_USB_TMC is not set
1476
1477#
1478# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
1479#
1480
1481#
1482# also be needed; see USB_STORAGE Help for more info
1483#
1484CONFIG_USB_STORAGE=y
1485# CONFIG_USB_STORAGE_DEBUG is not set
1486# CONFIG_USB_STORAGE_DATAFAB is not set
1487# CONFIG_USB_STORAGE_FREECOM is not set
1488# CONFIG_USB_STORAGE_ISD200 is not set
1489# CONFIG_USB_STORAGE_USBAT is not set
1490# CONFIG_USB_STORAGE_SDDR09 is not set
1491# CONFIG_USB_STORAGE_SDDR55 is not set
1492# CONFIG_USB_STORAGE_JUMPSHOT is not set
1493# CONFIG_USB_STORAGE_ALAUDA is not set
1494# CONFIG_USB_STORAGE_ONETOUCH is not set
1495# CONFIG_USB_STORAGE_KARMA is not set
1496# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
1497CONFIG_USB_LIBUSUAL=y
1498
1499#
1500# USB Imaging devices
1501#
1502# CONFIG_USB_MDC800 is not set
1503# CONFIG_USB_MICROTEK is not set
1504
1505#
1506# USB port drivers
1507#
1508# CONFIG_USB_SERIAL is not set
1509
1510#
1511# USB Miscellaneous drivers
1512#
1513# CONFIG_USB_EMI62 is not set
1514# CONFIG_USB_EMI26 is not set
1515# CONFIG_USB_ADUTUX is not set
1516# CONFIG_USB_SEVSEG is not set
1517# CONFIG_USB_RIO500 is not set
1518# CONFIG_USB_LEGOTOWER is not set
1519# CONFIG_USB_LCD is not set
1520# CONFIG_USB_BERRY_CHARGE is not set
1521# CONFIG_USB_LED is not set
1522# CONFIG_USB_CYPRESS_CY7C63 is not set
1523# CONFIG_USB_CYTHERM is not set
1524# CONFIG_USB_IDMOUSE is not set
1525# CONFIG_USB_FTDI_ELAN is not set
1526# CONFIG_USB_APPLEDISPLAY is not set
1527# CONFIG_USB_SISUSBVGA is not set
1528# CONFIG_USB_LD is not set
1529# CONFIG_USB_TRANCEVIBRATOR is not set
1530# CONFIG_USB_IOWARRIOR is not set
1531CONFIG_USB_TEST=y
1532# CONFIG_USB_ISIGHTFW is not set
1533# CONFIG_USB_VST is not set
1534CONFIG_USB_GADGET=y
1535CONFIG_USB_GADGET_DEBUG=y
1536CONFIG_USB_GADGET_DEBUG_FILES=y
1537CONFIG_USB_GADGET_DEBUG_FS=y
1538CONFIG_USB_GADGET_VBUS_DRAW=2
1539CONFIG_USB_GADGET_SELECTED=y
1540# CONFIG_USB_GADGET_AT91 is not set
1541# CONFIG_USB_GADGET_ATMEL_USBA is not set
1542# CONFIG_USB_GADGET_FSL_USB2 is not set
1543# CONFIG_USB_GADGET_LH7A40X is not set
1544# CONFIG_USB_GADGET_OMAP is not set
1545# CONFIG_USB_GADGET_PXA25X is not set
1546# CONFIG_USB_GADGET_R8A66597 is not set
1547# CONFIG_USB_GADGET_PXA27X is not set
1548# CONFIG_USB_GADGET_S3C_HSOTG is not set
1549# CONFIG_USB_GADGET_IMX is not set
1550# CONFIG_USB_GADGET_S3C2410 is not set
1551# CONFIG_USB_GADGET_M66592 is not set
1552# CONFIG_USB_GADGET_AMD5536UDC is not set
1553# CONFIG_USB_GADGET_FSL_QE is not set
1554# CONFIG_USB_GADGET_CI13XXX is not set
1555# CONFIG_USB_GADGET_NET2280 is not set
1556# CONFIG_USB_GADGET_GOKU is not set
1557# CONFIG_USB_GADGET_LANGWELL is not set
1558# CONFIG_USB_GADGET_DUMMY_HCD is not set
1559CONFIG_USB_GADGET_DUALSPEED=y
1560CONFIG_USB_ZERO=y
1561# CONFIG_USB_ZERO_HNPTEST is not set
1562# CONFIG_USB_AUDIO is not set
1563# CONFIG_USB_ETH is not set
1564# CONFIG_USB_GADGETFS is not set
1565# CONFIG_USB_FILE_STORAGE is not set
1566# CONFIG_USB_G_SERIAL is not set
1567# CONFIG_USB_MIDI_GADGET is not set
1568# CONFIG_USB_G_PRINTER is not set
1569# CONFIG_USB_CDC_COMPOSITE is not set
1570
1571#
1572# OTG and related infrastructure
1573#
1574CONFIG_USB_OTG_UTILS=y
1575# CONFIG_USB_GPIO_VBUS is not set
1576# CONFIG_ISP1301_OMAP is not set
1577CONFIG_TWL4030_USB=y
1578CONFIG_NOP_USB_XCEIV=y
1579CONFIG_MMC=y
1580# CONFIG_MMC_DEBUG is not set
1581CONFIG_MMC_UNSAFE_RESUME=y
1582
1583#
1584# MMC/SD/SDIO Card Drivers
1585#
1586CONFIG_MMC_BLOCK=y
1587CONFIG_MMC_BLOCK_BOUNCE=y
1588CONFIG_SDIO_UART=y
1589# CONFIG_MMC_TEST is not set
1590
1591#
1592# MMC/SD/SDIO Host Controller Drivers
1593#
1594# CONFIG_MMC_SDHCI is not set
1595# CONFIG_MMC_OMAP is not set
1596CONFIG_MMC_OMAP_HS=y
1597# CONFIG_MMC_AT91 is not set
1598# CONFIG_MMC_ATMELMCI is not set
1599# CONFIG_MMC_SPI is not set
1600# CONFIG_MEMSTICK is not set
1601CONFIG_NEW_LEDS=y
1602CONFIG_LEDS_CLASS=y
1603
1604#
1605# LED drivers
1606#
1607# CONFIG_LEDS_PCA9532 is not set
1608CONFIG_LEDS_GPIO=y
1609CONFIG_LEDS_GPIO_PLATFORM=y
1610# CONFIG_LEDS_LP3944 is not set
1611# CONFIG_LEDS_PCA955X is not set
1612# CONFIG_LEDS_DAC124S085 is not set
1613# CONFIG_LEDS_BD2802 is not set
1614
1615#
1616# LED Triggers
1617#
1618CONFIG_LEDS_TRIGGERS=y
1619CONFIG_LEDS_TRIGGER_TIMER=y
1620CONFIG_LEDS_TRIGGER_HEARTBEAT=y
1621# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
1622# CONFIG_LEDS_TRIGGER_GPIO is not set
1623CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
1624
1625#
1626# iptables trigger is under Netfilter config (LED target)
1627#
1628# CONFIG_ACCESSIBILITY is not set
1629CONFIG_RTC_LIB=y
1630CONFIG_RTC_CLASS=y
1631CONFIG_RTC_HCTOSYS=y
1632CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
1633# CONFIG_RTC_DEBUG is not set
1634
1635#
1636# RTC interfaces
1637#
1638CONFIG_RTC_INTF_SYSFS=y
1639CONFIG_RTC_INTF_PROC=y
1640CONFIG_RTC_INTF_DEV=y
1641# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
1642# CONFIG_RTC_DRV_TEST is not set
1643
1644#
1645# I2C RTC drivers
1646#
1647# CONFIG_RTC_DRV_DS1307 is not set
1648# CONFIG_RTC_DRV_DS1374 is not set
1649# CONFIG_RTC_DRV_DS1672 is not set
1650# CONFIG_RTC_DRV_MAX6900 is not set
1651# CONFIG_RTC_DRV_RS5C372 is not set
1652# CONFIG_RTC_DRV_ISL1208 is not set
1653# CONFIG_RTC_DRV_X1205 is not set
1654# CONFIG_RTC_DRV_PCF8563 is not set
1655# CONFIG_RTC_DRV_PCF8583 is not set
1656# CONFIG_RTC_DRV_M41T80 is not set
1657CONFIG_RTC_DRV_TWL4030=y
1658# CONFIG_RTC_DRV_S35390A is not set
1659# CONFIG_RTC_DRV_FM3130 is not set
1660# CONFIG_RTC_DRV_RX8581 is not set
1661# CONFIG_RTC_DRV_RX8025 is not set
1662
1663#
1664# SPI RTC drivers
1665#
1666# CONFIG_RTC_DRV_M41T94 is not set
1667# CONFIG_RTC_DRV_DS1305 is not set
1668# CONFIG_RTC_DRV_DS1390 is not set
1669# CONFIG_RTC_DRV_MAX6902 is not set
1670# CONFIG_RTC_DRV_R9701 is not set
1671# CONFIG_RTC_DRV_RS5C348 is not set
1672# CONFIG_RTC_DRV_DS3234 is not set
1673# CONFIG_RTC_DRV_PCF2123 is not set
1674
1675#
1676# Platform RTC drivers
1677#
1678# CONFIG_RTC_DRV_CMOS is not set
1679# CONFIG_RTC_DRV_DS1286 is not set
1680# CONFIG_RTC_DRV_DS1511 is not set
1681# CONFIG_RTC_DRV_DS1553 is not set
1682# CONFIG_RTC_DRV_DS1742 is not set
1683# CONFIG_RTC_DRV_STK17TA8 is not set
1684# CONFIG_RTC_DRV_M48T86 is not set
1685# CONFIG_RTC_DRV_M48T35 is not set
1686# CONFIG_RTC_DRV_M48T59 is not set
1687# CONFIG_RTC_DRV_BQ4802 is not set
1688# CONFIG_RTC_DRV_V3020 is not set
1689
1690#
1691# on-CPU RTC drivers
1692#
1693# CONFIG_DMADEVICES is not set
1694# CONFIG_AUXDISPLAY is not set
1695# CONFIG_UIO is not set
1696
1697#
1698# TI VLYNQ
1699#
1700# CONFIG_STAGING is not set
1701
1702#
1703# File systems
1704#
1705CONFIG_EXT2_FS=y
1706# CONFIG_EXT2_FS_XATTR is not set
1707# CONFIG_EXT2_FS_XIP is not set
1708CONFIG_EXT3_FS=y
1709# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
1710# CONFIG_EXT3_FS_XATTR is not set
1711# CONFIG_EXT4_FS is not set
1712CONFIG_JBD=y
1713# CONFIG_JBD_DEBUG is not set
1714# CONFIG_REISERFS_FS is not set
1715# CONFIG_JFS_FS is not set
1716CONFIG_FS_POSIX_ACL=y
1717# CONFIG_XFS_FS is not set
1718# CONFIG_GFS2_FS is not set
1719# CONFIG_OCFS2_FS is not set
1720# CONFIG_BTRFS_FS is not set
1721# CONFIG_NILFS2_FS is not set
1722CONFIG_FILE_LOCKING=y
1723CONFIG_FSNOTIFY=y
1724CONFIG_DNOTIFY=y
1725CONFIG_INOTIFY=y
1726CONFIG_INOTIFY_USER=y
1727CONFIG_QUOTA=y
1728# CONFIG_QUOTA_NETLINK_INTERFACE is not set
1729CONFIG_PRINT_QUOTA_WARNING=y
1730CONFIG_QUOTA_TREE=y
1731# CONFIG_QFMT_V1 is not set
1732CONFIG_QFMT_V2=y
1733CONFIG_QUOTACTL=y
1734# CONFIG_AUTOFS_FS is not set
1735# CONFIG_AUTOFS4_FS is not set
1736# CONFIG_FUSE_FS is not set
1737
1738#
1739# Caches
1740#
1741# CONFIG_FSCACHE is not set
1742
1743#
1744# CD-ROM/DVD Filesystems
1745#
1746# CONFIG_ISO9660_FS is not set
1747# CONFIG_UDF_FS is not set
1748
1749#
1750# DOS/FAT/NT Filesystems
1751#
1752CONFIG_FAT_FS=y
1753CONFIG_MSDOS_FS=y
1754CONFIG_VFAT_FS=y
1755CONFIG_FAT_DEFAULT_CODEPAGE=437
1756CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1757# CONFIG_NTFS_FS is not set
1758
1759#
1760# Pseudo filesystems
1761#
1762CONFIG_PROC_FS=y
1763CONFIG_PROC_SYSCTL=y
1764CONFIG_PROC_PAGE_MONITOR=y
1765CONFIG_SYSFS=y
1766CONFIG_TMPFS=y
1767# CONFIG_TMPFS_POSIX_ACL is not set
1768# CONFIG_HUGETLB_PAGE is not set
1769# CONFIG_CONFIGFS_FS is not set
1770CONFIG_MISC_FILESYSTEMS=y
1771# CONFIG_ADFS_FS is not set
1772# CONFIG_AFFS_FS is not set
1773# CONFIG_HFS_FS is not set
1774# CONFIG_HFSPLUS_FS is not set
1775# CONFIG_BEFS_FS is not set
1776# CONFIG_BFS_FS is not set
1777# CONFIG_EFS_FS is not set
1778CONFIG_JFFS2_FS=y
1779CONFIG_JFFS2_FS_DEBUG=0
1780CONFIG_JFFS2_FS_WRITEBUFFER=y
1781# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
1782CONFIG_JFFS2_SUMMARY=y
1783CONFIG_JFFS2_FS_XATTR=y
1784CONFIG_JFFS2_FS_POSIX_ACL=y
1785CONFIG_JFFS2_FS_SECURITY=y
1786CONFIG_JFFS2_COMPRESSION_OPTIONS=y
1787CONFIG_JFFS2_ZLIB=y
1788CONFIG_JFFS2_LZO=y
1789CONFIG_JFFS2_RTIME=y
1790CONFIG_JFFS2_RUBIN=y
1791# CONFIG_JFFS2_CMODE_NONE is not set
1792CONFIG_JFFS2_CMODE_PRIORITY=y
1793# CONFIG_JFFS2_CMODE_SIZE is not set
1794# CONFIG_JFFS2_CMODE_FAVOURLZO is not set
1795CONFIG_UBIFS_FS=y
1796# CONFIG_UBIFS_FS_XATTR is not set
1797# CONFIG_UBIFS_FS_ADVANCED_COMPR is not set
1798CONFIG_UBIFS_FS_LZO=y
1799CONFIG_UBIFS_FS_ZLIB=y
1800# CONFIG_UBIFS_FS_DEBUG is not set
1801CONFIG_CRAMFS=y
1802# CONFIG_SQUASHFS is not set
1803# CONFIG_VXFS_FS is not set
1804# CONFIG_MINIX_FS is not set
1805# CONFIG_OMFS_FS is not set
1806# CONFIG_HPFS_FS is not set
1807# CONFIG_QNX4FS_FS is not set
1808# CONFIG_ROMFS_FS is not set
1809# CONFIG_SYSV_FS is not set
1810# CONFIG_UFS_FS is not set
1811CONFIG_NETWORK_FILESYSTEMS=y
1812CONFIG_NFS_FS=y
1813CONFIG_NFS_V3=y
1814CONFIG_NFS_V3_ACL=y
1815CONFIG_NFS_V4=y
1816# CONFIG_NFS_V4_1 is not set
1817CONFIG_ROOT_NFS=y
1818# CONFIG_NFSD is not set
1819CONFIG_LOCKD=y
1820CONFIG_LOCKD_V4=y
1821CONFIG_NFS_ACL_SUPPORT=y
1822CONFIG_NFS_COMMON=y
1823CONFIG_SUNRPC=y
1824CONFIG_SUNRPC_GSS=y
1825CONFIG_RPCSEC_GSS_KRB5=y
1826# CONFIG_RPCSEC_GSS_SPKM3 is not set
1827# CONFIG_SMB_FS is not set
1828# CONFIG_CIFS is not set
1829# CONFIG_NCP_FS is not set
1830# CONFIG_CODA_FS is not set
1831# CONFIG_AFS_FS is not set
1832
1833#
1834# Partition Types
1835#
1836CONFIG_PARTITION_ADVANCED=y
1837# CONFIG_ACORN_PARTITION is not set
1838# CONFIG_OSF_PARTITION is not set
1839# CONFIG_AMIGA_PARTITION is not set
1840# CONFIG_ATARI_PARTITION is not set
1841# CONFIG_MAC_PARTITION is not set
1842CONFIG_MSDOS_PARTITION=y
1843# CONFIG_BSD_DISKLABEL is not set
1844# CONFIG_MINIX_SUBPARTITION is not set
1845# CONFIG_SOLARIS_X86_PARTITION is not set
1846# CONFIG_UNIXWARE_DISKLABEL is not set
1847# CONFIG_LDM_PARTITION is not set
1848# CONFIG_SGI_PARTITION is not set
1849# CONFIG_ULTRIX_PARTITION is not set
1850# CONFIG_SUN_PARTITION is not set
1851# CONFIG_KARMA_PARTITION is not set
1852# CONFIG_EFI_PARTITION is not set
1853# CONFIG_SYSV68_PARTITION is not set
1854CONFIG_NLS=y
1855CONFIG_NLS_DEFAULT="iso8859-1"
1856CONFIG_NLS_CODEPAGE_437=y
1857# CONFIG_NLS_CODEPAGE_737 is not set
1858# CONFIG_NLS_CODEPAGE_775 is not set
1859# CONFIG_NLS_CODEPAGE_850 is not set
1860# CONFIG_NLS_CODEPAGE_852 is not set
1861# CONFIG_NLS_CODEPAGE_855 is not set
1862# CONFIG_NLS_CODEPAGE_857 is not set
1863# CONFIG_NLS_CODEPAGE_860 is not set
1864# CONFIG_NLS_CODEPAGE_861 is not set
1865# CONFIG_NLS_CODEPAGE_862 is not set
1866# CONFIG_NLS_CODEPAGE_863 is not set
1867# CONFIG_NLS_CODEPAGE_864 is not set
1868# CONFIG_NLS_CODEPAGE_865 is not set
1869# CONFIG_NLS_CODEPAGE_866 is not set
1870# CONFIG_NLS_CODEPAGE_869 is not set
1871# CONFIG_NLS_CODEPAGE_936 is not set
1872# CONFIG_NLS_CODEPAGE_950 is not set
1873# CONFIG_NLS_CODEPAGE_932 is not set
1874# CONFIG_NLS_CODEPAGE_949 is not set
1875# CONFIG_NLS_CODEPAGE_874 is not set
1876# CONFIG_NLS_ISO8859_8 is not set
1877# CONFIG_NLS_CODEPAGE_1250 is not set
1878# CONFIG_NLS_CODEPAGE_1251 is not set
1879# CONFIG_NLS_ASCII is not set
1880CONFIG_NLS_ISO8859_1=y
1881# CONFIG_NLS_ISO8859_2 is not set
1882# CONFIG_NLS_ISO8859_3 is not set
1883# CONFIG_NLS_ISO8859_4 is not set
1884# CONFIG_NLS_ISO8859_5 is not set
1885# CONFIG_NLS_ISO8859_6 is not set
1886# CONFIG_NLS_ISO8859_7 is not set
1887# CONFIG_NLS_ISO8859_9 is not set
1888# CONFIG_NLS_ISO8859_13 is not set
1889# CONFIG_NLS_ISO8859_14 is not set
1890# CONFIG_NLS_ISO8859_15 is not set
1891# CONFIG_NLS_KOI8_R is not set
1892# CONFIG_NLS_KOI8_U is not set
1893# CONFIG_NLS_UTF8 is not set
1894# CONFIG_DLM is not set
1895
1896#
1897# Kernel hacking
1898#
1899CONFIG_PRINTK_TIME=y
1900CONFIG_ENABLE_WARN_DEPRECATED=y
1901CONFIG_ENABLE_MUST_CHECK=y
1902CONFIG_FRAME_WARN=1024
1903CONFIG_MAGIC_SYSRQ=y
1904# CONFIG_STRIP_ASM_SYMS is not set
1905# CONFIG_UNUSED_SYMBOLS is not set
1906CONFIG_DEBUG_FS=y
1907# CONFIG_HEADERS_CHECK is not set
1908CONFIG_DEBUG_KERNEL=y
1909# CONFIG_DEBUG_SHIRQ is not set
1910CONFIG_DETECT_SOFTLOCKUP=y
1911# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1912CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
1913CONFIG_DETECT_HUNG_TASK=y
1914# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
1915CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
1916CONFIG_SCHED_DEBUG=y
1917CONFIG_SCHEDSTATS=y
1918CONFIG_TIMER_STATS=y
1919# CONFIG_DEBUG_OBJECTS is not set
1920# CONFIG_DEBUG_SLAB is not set
1921# CONFIG_DEBUG_KMEMLEAK is not set
1922# CONFIG_DEBUG_RT_MUTEXES is not set
1923# CONFIG_RT_MUTEX_TESTER is not set
1924CONFIG_DEBUG_SPINLOCK=y
1925CONFIG_DEBUG_MUTEXES=y
1926CONFIG_DEBUG_LOCK_ALLOC=y
1927CONFIG_PROVE_LOCKING=y
1928CONFIG_LOCKDEP=y
1929CONFIG_LOCK_STAT=y
1930# CONFIG_DEBUG_LOCKDEP is not set
1931CONFIG_TRACE_IRQFLAGS=y
1932CONFIG_DEBUG_SPINLOCK_SLEEP=y
1933# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1934CONFIG_STACKTRACE=y
1935# CONFIG_DEBUG_KOBJECT is not set
1936# CONFIG_DEBUG_BUGVERBOSE is not set
1937CONFIG_DEBUG_INFO=y
1938# CONFIG_DEBUG_VM is not set
1939# CONFIG_DEBUG_WRITECOUNT is not set
1940# CONFIG_DEBUG_MEMORY_INIT is not set
1941# CONFIG_DEBUG_LIST is not set
1942# CONFIG_DEBUG_SG is not set
1943# CONFIG_DEBUG_NOTIFIERS is not set
1944# CONFIG_DEBUG_CREDENTIALS is not set
1945# CONFIG_BOOT_PRINTK_DELAY is not set
1946# CONFIG_RCU_TORTURE_TEST is not set
1947# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1948# CONFIG_KPROBES_SANITY_TEST is not set
1949# CONFIG_BACKTRACE_SELF_TEST is not set
1950# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1951# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
1952# CONFIG_LKDTM is not set
1953# CONFIG_FAULT_INJECTION is not set
1954# CONFIG_LATENCYTOP is not set
1955# CONFIG_PAGE_POISONING is not set
1956CONFIG_NOP_TRACER=y
1957CONFIG_HAVE_FUNCTION_TRACER=y
1958CONFIG_RING_BUFFER=y
1959CONFIG_EVENT_TRACING=y
1960CONFIG_CONTEXT_SWITCH_TRACER=y
1961CONFIG_RING_BUFFER_ALLOW_SWAP=y
1962CONFIG_TRACING=y
1963CONFIG_TRACING_SUPPORT=y
1964CONFIG_FTRACE=y
1965# CONFIG_FUNCTION_TRACER is not set
1966# CONFIG_IRQSOFF_TRACER is not set
1967# CONFIG_SCHED_TRACER is not set
1968# CONFIG_ENABLE_DEFAULT_TRACERS is not set
1969# CONFIG_BOOT_TRACER is not set
1970CONFIG_BRANCH_PROFILE_NONE=y
1971# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1972# CONFIG_PROFILE_ALL_BRANCHES is not set
1973# CONFIG_STACK_TRACER is not set
1974# CONFIG_KMEMTRACE is not set
1975# CONFIG_WORKQUEUE_TRACER is not set
1976# CONFIG_BLK_DEV_IO_TRACE is not set
1977# CONFIG_RING_BUFFER_BENCHMARK is not set
1978# CONFIG_DYNAMIC_DEBUG is not set
1979# CONFIG_SAMPLES is not set
1980CONFIG_HAVE_ARCH_KGDB=y
1981# CONFIG_KGDB is not set
1982CONFIG_ARM_UNWIND=y
1983# CONFIG_DEBUG_USER is not set
1984# CONFIG_DEBUG_ERRORS is not set
1985# CONFIG_DEBUG_STACK_USAGE is not set
1986CONFIG_DEBUG_LL=y
1987# CONFIG_DEBUG_ICEDCC is not set
1988
1989#
1990# Security options
1991#
1992# CONFIG_KEYS is not set
1993CONFIG_SECURITY=y
1994# CONFIG_SECURITYFS is not set
1995# CONFIG_SECURITY_NETWORK is not set
1996# CONFIG_SECURITY_PATH is not set
1997# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1998# CONFIG_SECURITY_ROOTPLUG is not set
1999# CONFIG_SECURITY_TOMOYO is not set
2000CONFIG_CRYPTO=y
2001
2002#
2003# Crypto core or helper
2004#
2005CONFIG_CRYPTO_ALGAPI=y
2006CONFIG_CRYPTO_ALGAPI2=y
2007CONFIG_CRYPTO_AEAD2=y
2008CONFIG_CRYPTO_BLKCIPHER=y
2009CONFIG_CRYPTO_BLKCIPHER2=y
2010CONFIG_CRYPTO_HASH=y
2011CONFIG_CRYPTO_HASH2=y
2012CONFIG_CRYPTO_RNG2=y
2013CONFIG_CRYPTO_PCOMP=y
2014CONFIG_CRYPTO_MANAGER=y
2015CONFIG_CRYPTO_MANAGER2=y
2016# CONFIG_CRYPTO_GF128MUL is not set
2017# CONFIG_CRYPTO_NULL is not set
2018CONFIG_CRYPTO_WORKQUEUE=y
2019# CONFIG_CRYPTO_CRYPTD is not set
2020# CONFIG_CRYPTO_AUTHENC is not set
2021# CONFIG_CRYPTO_TEST is not set
2022
2023#
2024# Authenticated Encryption with Associated Data
2025#
2026# CONFIG_CRYPTO_CCM is not set
2027# CONFIG_CRYPTO_GCM is not set
2028# CONFIG_CRYPTO_SEQIV is not set
2029
2030#
2031# Block modes
2032#
2033CONFIG_CRYPTO_CBC=y
2034# CONFIG_CRYPTO_CTR is not set
2035# CONFIG_CRYPTO_CTS is not set
2036CONFIG_CRYPTO_ECB=y
2037# CONFIG_CRYPTO_LRW is not set
2038# CONFIG_CRYPTO_PCBC is not set
2039# CONFIG_CRYPTO_XTS is not set
2040
2041#
2042# Hash modes
2043#
2044# CONFIG_CRYPTO_HMAC is not set
2045# CONFIG_CRYPTO_XCBC is not set
2046# CONFIG_CRYPTO_VMAC is not set
2047
2048#
2049# Digest
2050#
2051CONFIG_CRYPTO_CRC32C=y
2052# CONFIG_CRYPTO_GHASH is not set
2053# CONFIG_CRYPTO_MD4 is not set
2054CONFIG_CRYPTO_MD5=y
2055CONFIG_CRYPTO_MICHAEL_MIC=y
2056# CONFIG_CRYPTO_RMD128 is not set
2057# CONFIG_CRYPTO_RMD160 is not set
2058# CONFIG_CRYPTO_RMD256 is not set
2059# CONFIG_CRYPTO_RMD320 is not set
2060# CONFIG_CRYPTO_SHA1 is not set
2061# CONFIG_CRYPTO_SHA256 is not set
2062# CONFIG_CRYPTO_SHA512 is not set
2063# CONFIG_CRYPTO_TGR192 is not set
2064# CONFIG_CRYPTO_WP512 is not set
2065
2066#
2067# Ciphers
2068#
2069CONFIG_CRYPTO_AES=y
2070# CONFIG_CRYPTO_ANUBIS is not set
2071CONFIG_CRYPTO_ARC4=y
2072# CONFIG_CRYPTO_BLOWFISH is not set
2073# CONFIG_CRYPTO_CAMELLIA is not set
2074# CONFIG_CRYPTO_CAST5 is not set
2075# CONFIG_CRYPTO_CAST6 is not set
2076CONFIG_CRYPTO_DES=y
2077# CONFIG_CRYPTO_FCRYPT is not set
2078# CONFIG_CRYPTO_KHAZAD is not set
2079# CONFIG_CRYPTO_SALSA20 is not set
2080# CONFIG_CRYPTO_SEED is not set
2081# CONFIG_CRYPTO_SERPENT is not set
2082# CONFIG_CRYPTO_TEA is not set
2083# CONFIG_CRYPTO_TWOFISH is not set
2084
2085#
2086# Compression
2087#
2088CONFIG_CRYPTO_DEFLATE=y
2089# CONFIG_CRYPTO_ZLIB is not set
2090CONFIG_CRYPTO_LZO=y
2091
2092#
2093# Random Number Generation
2094#
2095# CONFIG_CRYPTO_ANSI_CPRNG is not set
2096CONFIG_CRYPTO_HW=y
2097CONFIG_BINARY_PRINTF=y
2098
2099#
2100# Library routines
2101#
2102CONFIG_BITREVERSE=y
2103CONFIG_GENERIC_FIND_LAST_BIT=y
2104CONFIG_CRC_CCITT=y
2105CONFIG_CRC16=y
2106CONFIG_CRC_T10DIF=y
2107CONFIG_CRC_ITU_T=y
2108CONFIG_CRC32=y
2109CONFIG_CRC7=y
2110CONFIG_LIBCRC32C=y
2111CONFIG_ZLIB_INFLATE=y
2112CONFIG_ZLIB_DEFLATE=y
2113CONFIG_LZO_COMPRESS=y
2114CONFIG_LZO_DECOMPRESS=y
2115CONFIG_DECOMPRESS_GZIP=y
2116CONFIG_HAS_IOMEM=y
2117CONFIG_HAS_IOPORT=y
2118CONFIG_HAS_DMA=y
2119CONFIG_NLATTR=y
diff --git a/arch/arm/configs/omap3_evm_defconfig b/arch/arm/configs/omap3_evm_defconfig
index d5ff4776cd0a..e190fc8b9a7c 100644
--- a/arch/arm/configs/omap3_evm_defconfig
+++ b/arch/arm/configs/omap3_evm_defconfig
@@ -59,8 +59,8 @@ CONFIG_FAIR_GROUP_SCHED=y
59CONFIG_USER_SCHED=y 59CONFIG_USER_SCHED=y
60# CONFIG_CGROUP_SCHED is not set 60# CONFIG_CGROUP_SCHED is not set
61# CONFIG_CGROUPS is not set 61# CONFIG_CGROUPS is not set
62CONFIG_SYSFS_DEPRECATED=y 62# CONFIG_SYSFS_DEPRECATED=y is not set
63CONFIG_SYSFS_DEPRECATED_V2=y 63# CONFIG_SYSFS_DEPRECATED_V2=y is not set
64# CONFIG_RELAY is not set 64# CONFIG_RELAY is not set
65# CONFIG_NAMESPACES is not set 65# CONFIG_NAMESPACES is not set
66CONFIG_BLK_DEV_INITRD=y 66CONFIG_BLK_DEV_INITRD=y
@@ -617,8 +617,8 @@ CONFIG_MII=y
617# CONFIG_DM9000 is not set 617# CONFIG_DM9000 is not set
618# CONFIG_ENC28J60 is not set 618# CONFIG_ENC28J60 is not set
619# CONFIG_ETHOC is not set 619# CONFIG_ETHOC is not set
620CONFIG_SMC911X=y 620# CONFIG_SMC911X is not set
621# CONFIG_SMSC911X is not set 621CONFIG_SMSC911X=y
622# CONFIG_DNET is not set 622# CONFIG_DNET is not set
623# CONFIG_IBM_NEW_EMAC_ZMII is not set 623# CONFIG_IBM_NEW_EMAC_ZMII is not set
624# CONFIG_IBM_NEW_EMAC_RGMII is not set 624# CONFIG_IBM_NEW_EMAC_RGMII is not set
@@ -676,13 +676,19 @@ CONFIG_INPUT_EVDEV=y
676# Input Device Drivers 676# Input Device Drivers
677# 677#
678CONFIG_INPUT_KEYBOARD=y 678CONFIG_INPUT_KEYBOARD=y
679# CONFIG_KEYBOARD_ADP5588 is not set
679# CONFIG_KEYBOARD_ATKBD is not set 680# CONFIG_KEYBOARD_ATKBD is not set
680# CONFIG_KEYBOARD_SUNKBD is not set 681# CONFIG_QT2160 is not set
681# CONFIG_KEYBOARD_LKKBD is not set 682# CONFIG_KEYBOARD_LKKBD is not set
682# CONFIG_KEYBOARD_XTKBD is not set 683# CONFIG_KEYBOARD_GPIO is not set
684# CONFIG_KEYBOARD_MATRIX is not set
685# CONFIG_KEYBOARD_MAX7359 is not set
683# CONFIG_KEYBOARD_NEWTON is not set 686# CONFIG_KEYBOARD_NEWTON is not set
687# CONFIG_KEYBOARD_OPENCORES is not set
684# CONFIG_KEYBOARD_STOWAWAY is not set 688# CONFIG_KEYBOARD_STOWAWAY is not set
685# CONFIG_KEYBOARD_GPIO is not set 689# CONFIG_KEYBOARD_SUNKBD is not set
690CONFIG_KEYBOARD_TWL4030=y
691# CONFIG_KEYBOARD_XTKBD is not set
686# CONFIG_INPUT_MOUSE is not set 692# CONFIG_INPUT_MOUSE is not set
687# CONFIG_INPUT_JOYSTICK is not set 693# CONFIG_INPUT_JOYSTICK is not set
688# CONFIG_INPUT_TABLET is not set 694# CONFIG_INPUT_TABLET is not set
@@ -1126,7 +1132,7 @@ CONFIG_MMC_BLOCK_BOUNCE=y
1126# 1132#
1127# CONFIG_MMC_SDHCI is not set 1133# CONFIG_MMC_SDHCI is not set
1128# CONFIG_MMC_OMAP is not set 1134# CONFIG_MMC_OMAP is not set
1129CONFIG_MMC_OMAP_HS=m 1135CONFIG_MMC_OMAP_HS=y
1130# CONFIG_MMC_SPI is not set 1136# CONFIG_MMC_SPI is not set
1131# CONFIG_MEMSTICK is not set 1137# CONFIG_MEMSTICK is not set
1132# CONFIG_ACCESSIBILITY is not set 1138# CONFIG_ACCESSIBILITY is not set
diff --git a/arch/arm/configs/omap3_pandora_defconfig b/arch/arm/configs/omap3_pandora_defconfig
index 150deafb0a6a..b7a8d9fa49db 100644
--- a/arch/arm/configs/omap3_pandora_defconfig
+++ b/arch/arm/configs/omap3_pandora_defconfig
@@ -51,8 +51,9 @@ CONFIG_FAIR_GROUP_SCHED=y
51# CONFIG_RT_GROUP_SCHED is not set 51# CONFIG_RT_GROUP_SCHED is not set
52CONFIG_USER_SCHED=y 52CONFIG_USER_SCHED=y
53# CONFIG_CGROUP_SCHED is not set 53# CONFIG_CGROUP_SCHED is not set
54CONFIG_SYSFS_DEPRECATED=y 54# CONFIG_SYSFS_DEPRECATED=y is not set
55CONFIG_SYSFS_DEPRECATED_V2=y 55# CONFIG_SYSFS_DEPRECATED_V2=y is not set
56
56# CONFIG_RELAY is not set 57# CONFIG_RELAY is not set
57# CONFIG_NAMESPACES is not set 58# CONFIG_NAMESPACES is not set
58CONFIG_BLK_DEV_INITRD=y 59CONFIG_BLK_DEV_INITRD=y
diff --git a/arch/arm/configs/omap_3430sdp_defconfig b/arch/arm/configs/omap_3430sdp_defconfig
index 5a305f015307..84829587d55a 100644
--- a/arch/arm/configs/omap_3430sdp_defconfig
+++ b/arch/arm/configs/omap_3430sdp_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.30-omap1 3# Linux kernel version: 2.6.31-rc9-omap1
4# Tue Jun 23 10:36:45 2009 4# Tue Sep 15 16:48:34 2009
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y 7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -9,7 +9,6 @@ CONFIG_GENERIC_GPIO=y
9CONFIG_GENERIC_TIME=y 9CONFIG_GENERIC_TIME=y
10CONFIG_GENERIC_CLOCKEVENTS=y 10CONFIG_GENERIC_CLOCKEVENTS=y
11CONFIG_MMU=y 11CONFIG_MMU=y
12# CONFIG_NO_IOPORT is not set
13CONFIG_GENERIC_HARDIRQS=y 12CONFIG_GENERIC_HARDIRQS=y
14CONFIG_STACKTRACE_SUPPORT=y 13CONFIG_STACKTRACE_SUPPORT=y
15CONFIG_HAVE_LATENCYTOP_SUPPORT=y 14CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -18,14 +17,12 @@ CONFIG_TRACE_IRQFLAGS_SUPPORT=y
18CONFIG_HARDIRQS_SW_RESEND=y 17CONFIG_HARDIRQS_SW_RESEND=y
19CONFIG_GENERIC_IRQ_PROBE=y 18CONFIG_GENERIC_IRQ_PROBE=y
20CONFIG_RWSEM_GENERIC_SPINLOCK=y 19CONFIG_RWSEM_GENERIC_SPINLOCK=y
21# CONFIG_ARCH_HAS_ILOG2_U32 is not set
22# CONFIG_ARCH_HAS_ILOG2_U64 is not set
23CONFIG_GENERIC_HWEIGHT=y 20CONFIG_GENERIC_HWEIGHT=y
24CONFIG_GENERIC_CALIBRATE_DELAY=y 21CONFIG_GENERIC_CALIBRATE_DELAY=y
25CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 22CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
26CONFIG_OPROFILE_ARMV7=y
27CONFIG_VECTORS_BASE=0xffff0000 23CONFIG_VECTORS_BASE=0xffff0000
28CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 24CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
25CONFIG_CONSTRUCTORS=y
29 26
30# 27#
31# General setup 28# General setup
@@ -61,12 +58,15 @@ CONFIG_FAIR_GROUP_SCHED=y
61CONFIG_USER_SCHED=y 58CONFIG_USER_SCHED=y
62# CONFIG_CGROUP_SCHED is not set 59# CONFIG_CGROUP_SCHED is not set
63# CONFIG_CGROUPS is not set 60# CONFIG_CGROUPS is not set
64CONFIG_SYSFS_DEPRECATED=y 61# CONFIG_SYSFS_DEPRECATED=y is not set
65CONFIG_SYSFS_DEPRECATED_V2=y 62# CONFIG_SYSFS_DEPRECATED_V2=y is not set
66# CONFIG_RELAY is not set 63# CONFIG_RELAY is not set
67# CONFIG_NAMESPACES is not set 64# CONFIG_NAMESPACES is not set
68CONFIG_BLK_DEV_INITRD=y 65CONFIG_BLK_DEV_INITRD=y
69CONFIG_INITRAMFS_SOURCE="" 66CONFIG_INITRAMFS_SOURCE=""
67CONFIG_RD_GZIP=y
68# CONFIG_RD_BZIP2 is not set
69# CONFIG_RD_LZMA is not set
70CONFIG_CC_OPTIMIZE_FOR_SIZE=y 70CONFIG_CC_OPTIMIZE_FOR_SIZE=y
71CONFIG_SYSCTL=y 71CONFIG_SYSCTL=y
72CONFIG_ANON_INODES=y 72CONFIG_ANON_INODES=y
@@ -79,7 +79,7 @@ CONFIG_KALLSYMS=y
79CONFIG_HOTPLUG=y 79CONFIG_HOTPLUG=y
80CONFIG_PRINTK=y 80CONFIG_PRINTK=y
81CONFIG_BUG=y 81CONFIG_BUG=y
82# CONFIG_ELF_CORE is not set 82CONFIG_ELF_CORE=y
83CONFIG_BASE_FULL=y 83CONFIG_BASE_FULL=y
84CONFIG_FUTEX=y 84CONFIG_FUTEX=y
85CONFIG_EPOLL=y 85CONFIG_EPOLL=y
@@ -88,21 +88,29 @@ CONFIG_TIMERFD=y
88CONFIG_EVENTFD=y 88CONFIG_EVENTFD=y
89CONFIG_SHMEM=y 89CONFIG_SHMEM=y
90CONFIG_AIO=y 90CONFIG_AIO=y
91
92#
93# Performance Counters
94#
91CONFIG_VM_EVENT_COUNTERS=y 95CONFIG_VM_EVENT_COUNTERS=y
92CONFIG_SLUB_DEBUG=y 96# CONFIG_STRIP_ASM_SYMS is not set
93# CONFIG_COMPAT_BRK is not set 97CONFIG_COMPAT_BRK=y
94# CONFIG_SLAB is not set 98CONFIG_SLAB=y
95CONFIG_SLUB=y 99# CONFIG_SLUB is not set
96# CONFIG_SLOB is not set 100# CONFIG_SLOB is not set
97CONFIG_PROFILING=y 101# CONFIG_PROFILING is not set
98CONFIG_TRACEPOINTS=y
99# CONFIG_MARKERS is not set 102# CONFIG_MARKERS is not set
100CONFIG_OPROFILE=y
101CONFIG_HAVE_OPROFILE=y 103CONFIG_HAVE_OPROFILE=y
102# CONFIG_KPROBES is not set 104# CONFIG_KPROBES is not set
103CONFIG_HAVE_KPROBES=y 105CONFIG_HAVE_KPROBES=y
104CONFIG_HAVE_KRETPROBES=y 106CONFIG_HAVE_KRETPROBES=y
105CONFIG_HAVE_CLK=y 107CONFIG_HAVE_CLK=y
108
109#
110# GCOV-based kernel profiling
111#
112# CONFIG_GCOV_KERNEL is not set
113# CONFIG_SLOW_WORK is not set
106CONFIG_HAVE_GENERIC_DMA_COHERENT=y 114CONFIG_HAVE_GENERIC_DMA_COHERENT=y
107CONFIG_SLABINFO=y 115CONFIG_SLABINFO=y
108CONFIG_RT_MUTEXES=y 116CONFIG_RT_MUTEXES=y
@@ -110,12 +118,11 @@ CONFIG_BASE_SMALL=0
110CONFIG_MODULES=y 118CONFIG_MODULES=y
111# CONFIG_MODULE_FORCE_LOAD is not set 119# CONFIG_MODULE_FORCE_LOAD is not set
112CONFIG_MODULE_UNLOAD=y 120CONFIG_MODULE_UNLOAD=y
113CONFIG_MODULE_FORCE_UNLOAD=y 121# CONFIG_MODULE_FORCE_UNLOAD is not set
114CONFIG_MODVERSIONS=y 122CONFIG_MODVERSIONS=y
115CONFIG_MODULE_SRCVERSION_ALL=y 123CONFIG_MODULE_SRCVERSION_ALL=y
116CONFIG_BLOCK=y 124CONFIG_BLOCK=y
117CONFIG_LBD=y 125CONFIG_LBDAF=y
118# CONFIG_BLK_DEV_IO_TRACE is not set
119# CONFIG_BLK_DEV_BSG is not set 126# CONFIG_BLK_DEV_BSG is not set
120# CONFIG_BLK_DEV_INTEGRITY is not set 127# CONFIG_BLK_DEV_INTEGRITY is not set
121 128
@@ -126,11 +133,11 @@ CONFIG_IOSCHED_NOOP=y
126CONFIG_IOSCHED_AS=y 133CONFIG_IOSCHED_AS=y
127CONFIG_IOSCHED_DEADLINE=y 134CONFIG_IOSCHED_DEADLINE=y
128CONFIG_IOSCHED_CFQ=y 135CONFIG_IOSCHED_CFQ=y
129# CONFIG_DEFAULT_AS is not set 136CONFIG_DEFAULT_AS=y
130# CONFIG_DEFAULT_DEADLINE is not set 137# CONFIG_DEFAULT_DEADLINE is not set
131CONFIG_DEFAULT_CFQ=y 138# CONFIG_DEFAULT_CFQ is not set
132# CONFIG_DEFAULT_NOOP is not set 139# CONFIG_DEFAULT_NOOP is not set
133CONFIG_DEFAULT_IOSCHED="cfq" 140CONFIG_DEFAULT_IOSCHED="anticipatory"
134CONFIG_FREEZER=y 141CONFIG_FREEZER=y
135 142
136# 143#
@@ -142,12 +149,14 @@ CONFIG_FREEZER=y
142# CONFIG_ARCH_VERSATILE is not set 149# CONFIG_ARCH_VERSATILE is not set
143# CONFIG_ARCH_AT91 is not set 150# CONFIG_ARCH_AT91 is not set
144# CONFIG_ARCH_CLPS711X is not set 151# CONFIG_ARCH_CLPS711X is not set
152# CONFIG_ARCH_GEMINI is not set
145# CONFIG_ARCH_EBSA110 is not set 153# CONFIG_ARCH_EBSA110 is not set
146# CONFIG_ARCH_EP93XX is not set 154# CONFIG_ARCH_EP93XX is not set
147# CONFIG_ARCH_FOOTBRIDGE is not set 155# CONFIG_ARCH_FOOTBRIDGE is not set
156# CONFIG_ARCH_MXC is not set
157# CONFIG_ARCH_STMP3XXX is not set
148# CONFIG_ARCH_NETX is not set 158# CONFIG_ARCH_NETX is not set
149# CONFIG_ARCH_H720X is not set 159# CONFIG_ARCH_H720X is not set
150# CONFIG_ARCH_IMX is not set
151# CONFIG_ARCH_IOP13XX is not set 160# CONFIG_ARCH_IOP13XX is not set
152# CONFIG_ARCH_IOP32X is not set 161# CONFIG_ARCH_IOP32X is not set
153# CONFIG_ARCH_IOP33X is not set 162# CONFIG_ARCH_IOP33X is not set
@@ -156,24 +165,25 @@ CONFIG_FREEZER=y
156# CONFIG_ARCH_IXP4XX is not set 165# CONFIG_ARCH_IXP4XX is not set
157# CONFIG_ARCH_L7200 is not set 166# CONFIG_ARCH_L7200 is not set
158# CONFIG_ARCH_KIRKWOOD is not set 167# CONFIG_ARCH_KIRKWOOD is not set
159# CONFIG_ARCH_KS8695 is not set
160# CONFIG_ARCH_NS9XXX is not set
161# CONFIG_ARCH_LOKI is not set 168# CONFIG_ARCH_LOKI is not set
162# CONFIG_ARCH_MV78XX0 is not set 169# CONFIG_ARCH_MV78XX0 is not set
163# CONFIG_ARCH_MXC is not set
164# CONFIG_ARCH_ORION5X is not set 170# CONFIG_ARCH_ORION5X is not set
171# CONFIG_ARCH_MMP is not set
172# CONFIG_ARCH_KS8695 is not set
173# CONFIG_ARCH_NS9XXX is not set
174# CONFIG_ARCH_W90X900 is not set
165# CONFIG_ARCH_PNX4008 is not set 175# CONFIG_ARCH_PNX4008 is not set
166# CONFIG_ARCH_PXA is not set 176# CONFIG_ARCH_PXA is not set
177# CONFIG_ARCH_MSM is not set
167# CONFIG_ARCH_RPC is not set 178# CONFIG_ARCH_RPC is not set
168# CONFIG_ARCH_SA1100 is not set 179# CONFIG_ARCH_SA1100 is not set
169# CONFIG_ARCH_S3C2410 is not set 180# CONFIG_ARCH_S3C2410 is not set
170# CONFIG_ARCH_S3C64XX is not set 181# CONFIG_ARCH_S3C64XX is not set
171# CONFIG_ARCH_SHARK is not set 182# CONFIG_ARCH_SHARK is not set
172# CONFIG_ARCH_LH7A40X is not set 183# CONFIG_ARCH_LH7A40X is not set
184# CONFIG_ARCH_U300 is not set
173# CONFIG_ARCH_DAVINCI is not set 185# CONFIG_ARCH_DAVINCI is not set
174CONFIG_ARCH_OMAP=y 186CONFIG_ARCH_OMAP=y
175# CONFIG_ARCH_MSM is not set
176# CONFIG_ARCH_W90X900 is not set
177 187
178# 188#
179# TI OMAP Implementations 189# TI OMAP Implementations
@@ -182,17 +192,19 @@ CONFIG_ARCH_OMAP_OTG=y
182# CONFIG_ARCH_OMAP1 is not set 192# CONFIG_ARCH_OMAP1 is not set
183# CONFIG_ARCH_OMAP2 is not set 193# CONFIG_ARCH_OMAP2 is not set
184CONFIG_ARCH_OMAP3=y 194CONFIG_ARCH_OMAP3=y
195# CONFIG_ARCH_OMAP4 is not set
185 196
186# 197#
187# OMAP Feature Selections 198# OMAP Feature Selections
188# 199#
189# CONFIG_OMAP_DEBUG_POWERDOMAIN is not set 200# CONFIG_OMAP_DEBUG_POWERDOMAIN is not set
190# CONFIG_OMAP_DEBUG_CLOCKDOMAIN is not set 201# CONFIG_OMAP_DEBUG_CLOCKDOMAIN is not set
191# CONFIG_OMAP_RESET_CLOCKS is not set 202CONFIG_OMAP_RESET_CLOCKS=y
192CONFIG_OMAP_MUX=y 203CONFIG_OMAP_MUX=y
193CONFIG_OMAP_MUX_DEBUG=y 204CONFIG_OMAP_MUX_DEBUG=y
194CONFIG_OMAP_MUX_WARNINGS=y 205CONFIG_OMAP_MUX_WARNINGS=y
195CONFIG_OMAP_MCBSP=y 206CONFIG_OMAP_MCBSP=y
207# CONFIG_OMAP_MBOX_FWK is not set
196# CONFIG_OMAP_MPU_TIMER is not set 208# CONFIG_OMAP_MPU_TIMER is not set
197CONFIG_OMAP_32K_TIMER=y 209CONFIG_OMAP_32K_TIMER=y
198CONFIG_OMAP_32K_TIMER_HZ=128 210CONFIG_OMAP_32K_TIMER_HZ=128
@@ -200,7 +212,8 @@ CONFIG_OMAP_DM_TIMER=y
200CONFIG_OMAP_LL_DEBUG_UART1=y 212CONFIG_OMAP_LL_DEBUG_UART1=y
201# CONFIG_OMAP_LL_DEBUG_UART2 is not set 213# CONFIG_OMAP_LL_DEBUG_UART2 is not set
202# CONFIG_OMAP_LL_DEBUG_UART3 is not set 214# CONFIG_OMAP_LL_DEBUG_UART3 is not set
203CONFIG_OMAP_SERIAL_WAKE=y 215# CONFIG_OMAP_PM_NONE is not set
216CONFIG_OMAP_PM_NOOP=y
204CONFIG_ARCH_OMAP34XX=y 217CONFIG_ARCH_OMAP34XX=y
205CONFIG_ARCH_OMAP3430=y 218CONFIG_ARCH_OMAP3430=y
206 219
@@ -210,8 +223,11 @@ CONFIG_ARCH_OMAP3430=y
210# CONFIG_MACH_OMAP3_BEAGLE is not set 223# CONFIG_MACH_OMAP3_BEAGLE is not set
211# CONFIG_MACH_OMAP_LDP is not set 224# CONFIG_MACH_OMAP_LDP is not set
212# CONFIG_MACH_OVERO is not set 225# CONFIG_MACH_OVERO is not set
226# CONFIG_MACH_OMAP3EVM is not set
213# CONFIG_MACH_OMAP3_PANDORA is not set 227# CONFIG_MACH_OMAP3_PANDORA is not set
214CONFIG_MACH_OMAP_3430SDP=y 228CONFIG_MACH_OMAP_3430SDP=y
229# CONFIG_MACH_NOKIA_RX51 is not set
230# CONFIG_MACH_OMAP_ZOOM2 is not set
215 231
216# 232#
217# Processor Type 233# Processor Type
@@ -234,12 +250,15 @@ CONFIG_CPU_CP15_MMU=y
234# Processor Features 250# Processor Features
235# 251#
236CONFIG_ARM_THUMB=y 252CONFIG_ARM_THUMB=y
237CONFIG_ARM_THUMBEE=y 253# CONFIG_ARM_THUMBEE is not set
238# CONFIG_CPU_ICACHE_DISABLE is not set 254# CONFIG_CPU_ICACHE_DISABLE is not set
239# CONFIG_CPU_DCACHE_DISABLE is not set 255# CONFIG_CPU_DCACHE_DISABLE is not set
240# CONFIG_CPU_BPREDICT_DISABLE is not set 256# CONFIG_CPU_BPREDICT_DISABLE is not set
241CONFIG_HAS_TLS_REG=y 257CONFIG_HAS_TLS_REG=y
242# CONFIG_OUTER_CACHE is not set 258# CONFIG_ARM_ERRATA_430973 is not set
259# CONFIG_ARM_ERRATA_458693 is not set
260# CONFIG_ARM_ERRATA_460075 is not set
261CONFIG_COMMON_CLKDEV=y
243 262
244# 263#
245# Bus support 264# Bus support
@@ -262,10 +281,10 @@ CONFIG_PAGE_OFFSET=0xC0000000
262# CONFIG_PREEMPT is not set 281# CONFIG_PREEMPT is not set
263CONFIG_HZ=128 282CONFIG_HZ=128
264CONFIG_AEABI=y 283CONFIG_AEABI=y
265# CONFIG_OABI_COMPAT is not set 284CONFIG_OABI_COMPAT=y
266CONFIG_ARCH_FLATMEM_HAS_HOLES=y
267# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set 285# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
268# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set 286# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
287# CONFIG_HIGHMEM is not set
269CONFIG_SELECT_MEMORY_MODEL=y 288CONFIG_SELECT_MEMORY_MODEL=y
270CONFIG_FLATMEM_MANUAL=y 289CONFIG_FLATMEM_MANUAL=y
271# CONFIG_DISCONTIGMEM_MANUAL is not set 290# CONFIG_DISCONTIGMEM_MANUAL is not set
@@ -277,9 +296,12 @@ CONFIG_SPLIT_PTLOCK_CPUS=4
277# CONFIG_PHYS_ADDR_T_64BIT is not set 296# CONFIG_PHYS_ADDR_T_64BIT is not set
278CONFIG_ZONE_DMA_FLAG=0 297CONFIG_ZONE_DMA_FLAG=0
279CONFIG_VIRT_TO_BUS=y 298CONFIG_VIRT_TO_BUS=y
280CONFIG_UNEVICTABLE_LRU=y 299CONFIG_HAVE_MLOCK=y
281CONFIG_LEDS=y 300CONFIG_HAVE_MLOCKED_PAGE_BIT=y
301CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
302# CONFIG_LEDS is not set
282CONFIG_ALIGNMENT_TRAP=y 303CONFIG_ALIGNMENT_TRAP=y
304# CONFIG_UACCESS_WITH_MEMCPY is not set
283 305
284# 306#
285# Boot options 307# Boot options
@@ -288,8 +310,7 @@ CONFIG_ZBOOT_ROM_TEXT=0x0
288CONFIG_ZBOOT_ROM_BSS=0x0 310CONFIG_ZBOOT_ROM_BSS=0x0
289CONFIG_CMDLINE="console=ttyS2,115200 root=/dev/mmcblk0p3 rootwait debug" 311CONFIG_CMDLINE="console=ttyS2,115200 root=/dev/mmcblk0p3 rootwait debug"
290# CONFIG_XIP_KERNEL is not set 312# CONFIG_XIP_KERNEL is not set
291CONFIG_KEXEC=y 313# CONFIG_KEXEC is not set
292CONFIG_ATAGS_PROC=y
293 314
294# 315#
295# CPU Power Management 316# CPU Power Management
@@ -318,6 +339,9 @@ CONFIG_CPU_FREQ_GOV_ONDEMAND=y
318# 339#
319# At least one emulation must be selected 340# At least one emulation must be selected
320# 341#
342CONFIG_FPE_NWFPE=y
343# CONFIG_FPE_NWFPE_XP is not set
344# CONFIG_FPE_FASTFPE is not set
321CONFIG_VFP=y 345CONFIG_VFP=y
322CONFIG_VFPv3=y 346CONFIG_VFPv3=y
323CONFIG_NEON=y 347CONFIG_NEON=y
@@ -326,8 +350,9 @@ CONFIG_NEON=y
326# Userspace binary formats 350# Userspace binary formats
327# 351#
328CONFIG_BINFMT_ELF=y 352CONFIG_BINFMT_ELF=y
353# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
329CONFIG_HAVE_AOUT=y 354CONFIG_HAVE_AOUT=y
330CONFIG_BINFMT_AOUT=m 355# CONFIG_BINFMT_AOUT is not set
331CONFIG_BINFMT_MISC=y 356CONFIG_BINFMT_MISC=y
332 357
333# 358#
@@ -345,9 +370,8 @@ CONFIG_NET=y
345# 370#
346# Networking options 371# Networking options
347# 372#
348CONFIG_COMPAT_NET_DEV_OPS=y
349CONFIG_PACKET=y 373CONFIG_PACKET=y
350CONFIG_PACKET_MMAP=y 374# CONFIG_PACKET_MMAP is not set
351CONFIG_UNIX=y 375CONFIG_UNIX=y
352CONFIG_XFRM=y 376CONFIG_XFRM=y
353# CONFIG_XFRM_USER is not set 377# CONFIG_XFRM_USER is not set
@@ -372,7 +396,7 @@ CONFIG_IP_PNP_RARP=y
372# CONFIG_INET_ESP is not set 396# CONFIG_INET_ESP is not set
373# CONFIG_INET_IPCOMP is not set 397# CONFIG_INET_IPCOMP is not set
374# CONFIG_INET_XFRM_TUNNEL is not set 398# CONFIG_INET_XFRM_TUNNEL is not set
375CONFIG_INET_TUNNEL=m 399# CONFIG_INET_TUNNEL is not set
376CONFIG_INET_XFRM_MODE_TRANSPORT=y 400CONFIG_INET_XFRM_MODE_TRANSPORT=y
377CONFIG_INET_XFRM_MODE_TUNNEL=y 401CONFIG_INET_XFRM_MODE_TUNNEL=y
378CONFIG_INET_XFRM_MODE_BEET=y 402CONFIG_INET_XFRM_MODE_BEET=y
@@ -383,25 +407,7 @@ CONFIG_INET_TCP_DIAG=y
383CONFIG_TCP_CONG_CUBIC=y 407CONFIG_TCP_CONG_CUBIC=y
384CONFIG_DEFAULT_TCP_CONG="cubic" 408CONFIG_DEFAULT_TCP_CONG="cubic"
385# CONFIG_TCP_MD5SIG is not set 409# CONFIG_TCP_MD5SIG is not set
386CONFIG_IPV6=m 410# CONFIG_IPV6 is not set
387# CONFIG_IPV6_PRIVACY is not set
388# CONFIG_IPV6_ROUTER_PREF is not set
389# CONFIG_IPV6_OPTIMISTIC_DAD is not set
390# CONFIG_INET6_AH is not set
391# CONFIG_INET6_ESP is not set
392# CONFIG_INET6_IPCOMP is not set
393# CONFIG_IPV6_MIP6 is not set
394# CONFIG_INET6_XFRM_TUNNEL is not set
395# CONFIG_INET6_TUNNEL is not set
396CONFIG_INET6_XFRM_MODE_TRANSPORT=m
397CONFIG_INET6_XFRM_MODE_TUNNEL=m
398CONFIG_INET6_XFRM_MODE_BEET=m
399# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
400CONFIG_IPV6_SIT=m
401CONFIG_IPV6_NDISC_NODETYPE=y
402# CONFIG_IPV6_TUNNEL is not set
403# CONFIG_IPV6_MULTIPLE_TABLES is not set
404# CONFIG_IPV6_MROUTE is not set
405# CONFIG_NETWORK_SECMARK is not set 411# CONFIG_NETWORK_SECMARK is not set
406# CONFIG_NETFILTER is not set 412# CONFIG_NETFILTER is not set
407# CONFIG_IP_DCCP is not set 413# CONFIG_IP_DCCP is not set
@@ -419,6 +425,8 @@ CONFIG_IPV6_NDISC_NODETYPE=y
419# CONFIG_LAPB is not set 425# CONFIG_LAPB is not set
420# CONFIG_ECONET is not set 426# CONFIG_ECONET is not set
421# CONFIG_WAN_ROUTER is not set 427# CONFIG_WAN_ROUTER is not set
428# CONFIG_PHONET is not set
429# CONFIG_IEEE802154 is not set
422# CONFIG_NET_SCHED is not set 430# CONFIG_NET_SCHED is not set
423# CONFIG_DCB is not set 431# CONFIG_DCB is not set
424 432
@@ -429,56 +437,9 @@ CONFIG_IPV6_NDISC_NODETYPE=y
429# CONFIG_HAMRADIO is not set 437# CONFIG_HAMRADIO is not set
430# CONFIG_CAN is not set 438# CONFIG_CAN is not set
431# CONFIG_IRDA is not set 439# CONFIG_IRDA is not set
432CONFIG_BT=y 440# CONFIG_BT is not set
433CONFIG_BT_L2CAP=y
434CONFIG_BT_SCO=y
435CONFIG_BT_RFCOMM=y
436CONFIG_BT_RFCOMM_TTY=y
437CONFIG_BT_BNEP=y
438CONFIG_BT_BNEP_MC_FILTER=y
439CONFIG_BT_BNEP_PROTO_FILTER=y
440CONFIG_BT_HIDP=y
441
442#
443# Bluetooth device drivers
444#
445# CONFIG_BT_HCIBTUSB is not set
446# CONFIG_BT_HCIBTSDIO is not set
447CONFIG_BT_HCIUART=y
448CONFIG_BT_HCIUART_H4=y
449CONFIG_BT_HCIUART_BCSP=y
450# CONFIG_BT_HCIUART_LL is not set
451CONFIG_BT_HCIBCM203X=y
452CONFIG_BT_HCIBPA10X=y
453# CONFIG_BT_HCIBFUSB is not set
454# CONFIG_BT_HCIVHCI is not set
455# CONFIG_AF_RXRPC is not set 441# CONFIG_AF_RXRPC is not set
456# CONFIG_PHONET is not set 442# CONFIG_WIRELESS is not set
457CONFIG_WIRELESS=y
458CONFIG_CFG80211=y
459# CONFIG_CFG80211_REG_DEBUG is not set
460CONFIG_NL80211=y
461CONFIG_WIRELESS_OLD_REGULATORY=y
462CONFIG_WIRELESS_EXT=y
463CONFIG_WIRELESS_EXT_SYSFS=y
464CONFIG_LIB80211=y
465CONFIG_LIB80211_CRYPT_WEP=m
466CONFIG_LIB80211_CRYPT_CCMP=m
467CONFIG_LIB80211_CRYPT_TKIP=m
468CONFIG_MAC80211=y
469
470#
471# Rate control algorithm selection
472#
473CONFIG_MAC80211_RC_PID=y
474# CONFIG_MAC80211_RC_MINSTREL is not set
475CONFIG_MAC80211_RC_DEFAULT_PID=y
476# CONFIG_MAC80211_RC_DEFAULT_MINSTREL is not set
477CONFIG_MAC80211_RC_DEFAULT="pid"
478# CONFIG_MAC80211_MESH is not set
479CONFIG_MAC80211_LEDS=y
480# CONFIG_MAC80211_DEBUGFS is not set
481# CONFIG_MAC80211_DEBUG_MENU is not set
482# CONFIG_WIMAX is not set 443# CONFIG_WIMAX is not set
483# CONFIG_RFKILL is not set 444# CONFIG_RFKILL is not set
484# CONFIG_NET_9P is not set 445# CONFIG_NET_9P is not set
@@ -493,9 +454,7 @@ CONFIG_MAC80211_LEDS=y
493CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 454CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
494CONFIG_STANDALONE=y 455CONFIG_STANDALONE=y
495CONFIG_PREVENT_FIRMWARE_BUILD=y 456CONFIG_PREVENT_FIRMWARE_BUILD=y
496CONFIG_FW_LOADER=y 457# CONFIG_FW_LOADER is not set
497CONFIG_FIRMWARE_IN_KERNEL=y
498CONFIG_EXTRA_FIRMWARE=""
499# CONFIG_DEBUG_DRIVER is not set 458# CONFIG_DEBUG_DRIVER is not set
500# CONFIG_DEBUG_DEVRES is not set 459# CONFIG_DEBUG_DEVRES is not set
501# CONFIG_SYS_HYPERVISOR is not set 460# CONFIG_SYS_HYPERVISOR is not set
@@ -506,7 +465,7 @@ CONFIG_MTD_CONCAT=y
506CONFIG_MTD_PARTITIONS=y 465CONFIG_MTD_PARTITIONS=y
507# CONFIG_MTD_TESTS is not set 466# CONFIG_MTD_TESTS is not set
508# CONFIG_MTD_REDBOOT_PARTS is not set 467# CONFIG_MTD_REDBOOT_PARTS is not set
509# CONFIG_MTD_CMDLINE_PARTS is not set 468CONFIG_MTD_CMDLINE_PARTS=y
510# CONFIG_MTD_AFS_PARTS is not set 469# CONFIG_MTD_AFS_PARTS is not set
511# CONFIG_MTD_AR7_PARTS is not set 470# CONFIG_MTD_AR7_PARTS is not set
512 471
@@ -526,8 +485,10 @@ CONFIG_MTD_BLOCK=y
526# 485#
527# RAM/ROM/Flash chip drivers 486# RAM/ROM/Flash chip drivers
528# 487#
529# CONFIG_MTD_CFI is not set 488CONFIG_MTD_CFI=y
530# CONFIG_MTD_JEDECPROBE is not set 489# CONFIG_MTD_JEDECPROBE is not set
490CONFIG_MTD_GEN_PROBE=y
491# CONFIG_MTD_CFI_ADV_OPTIONS is not set
531CONFIG_MTD_MAP_BANK_WIDTH_1=y 492CONFIG_MTD_MAP_BANK_WIDTH_1=y
532CONFIG_MTD_MAP_BANK_WIDTH_2=y 493CONFIG_MTD_MAP_BANK_WIDTH_2=y
533CONFIG_MTD_MAP_BANK_WIDTH_4=y 494CONFIG_MTD_MAP_BANK_WIDTH_4=y
@@ -538,6 +499,10 @@ CONFIG_MTD_CFI_I1=y
538CONFIG_MTD_CFI_I2=y 499CONFIG_MTD_CFI_I2=y
539# CONFIG_MTD_CFI_I4 is not set 500# CONFIG_MTD_CFI_I4 is not set
540# CONFIG_MTD_CFI_I8 is not set 501# CONFIG_MTD_CFI_I8 is not set
502CONFIG_MTD_CFI_INTELEXT=y
503# CONFIG_MTD_CFI_AMDSTD is not set
504# CONFIG_MTD_CFI_STAA is not set
505CONFIG_MTD_CFI_UTIL=y
541# CONFIG_MTD_RAM is not set 506# CONFIG_MTD_RAM is not set
542# CONFIG_MTD_ROM is not set 507# CONFIG_MTD_ROM is not set
543# CONFIG_MTD_ABSENT is not set 508# CONFIG_MTD_ABSENT is not set
@@ -546,6 +511,9 @@ CONFIG_MTD_CFI_I2=y
546# Mapping drivers for chip access 511# Mapping drivers for chip access
547# 512#
548# CONFIG_MTD_COMPLEX_MAPPINGS is not set 513# CONFIG_MTD_COMPLEX_MAPPINGS is not set
514# CONFIG_MTD_PHYSMAP is not set
515# CONFIG_MTD_ARM_INTEGRATOR is not set
516CONFIG_MTD_OMAP_NOR=y
549# CONFIG_MTD_PLATRAM is not set 517# CONFIG_MTD_PLATRAM is not set
550 518
551# 519#
@@ -569,6 +537,7 @@ CONFIG_MTD_NAND=y
569# CONFIG_MTD_NAND_ECC_SMC is not set 537# CONFIG_MTD_NAND_ECC_SMC is not set
570# CONFIG_MTD_NAND_MUSEUM_IDS is not set 538# CONFIG_MTD_NAND_MUSEUM_IDS is not set
571# CONFIG_MTD_NAND_GPIO is not set 539# CONFIG_MTD_NAND_GPIO is not set
540# CONFIG_MTD_NAND_OMAP2 is not set
572CONFIG_MTD_NAND_IDS=y 541CONFIG_MTD_NAND_IDS=y
573# CONFIG_MTD_NAND_DISKONCHIP is not set 542# CONFIG_MTD_NAND_DISKONCHIP is not set
574# CONFIG_MTD_NAND_NANDSIM is not set 543# CONFIG_MTD_NAND_NANDSIM is not set
@@ -589,20 +558,21 @@ CONFIG_MTD_NAND_IDS=y
589CONFIG_BLK_DEV=y 558CONFIG_BLK_DEV=y
590# CONFIG_BLK_DEV_COW_COMMON is not set 559# CONFIG_BLK_DEV_COW_COMMON is not set
591CONFIG_BLK_DEV_LOOP=y 560CONFIG_BLK_DEV_LOOP=y
592CONFIG_BLK_DEV_CRYPTOLOOP=m 561# CONFIG_BLK_DEV_CRYPTOLOOP is not set
593# CONFIG_BLK_DEV_NBD is not set 562# CONFIG_BLK_DEV_NBD is not set
594# CONFIG_BLK_DEV_UB is not set 563# CONFIG_BLK_DEV_UB is not set
595CONFIG_BLK_DEV_RAM=y 564CONFIG_BLK_DEV_RAM=y
596CONFIG_BLK_DEV_RAM_COUNT=16 565CONFIG_BLK_DEV_RAM_COUNT=16
597CONFIG_BLK_DEV_RAM_SIZE=16384 566CONFIG_BLK_DEV_RAM_SIZE=16384
598# CONFIG_BLK_DEV_XIP is not set 567# CONFIG_BLK_DEV_XIP is not set
599CONFIG_CDROM_PKTCDVD=m 568# CONFIG_CDROM_PKTCDVD is not set
600CONFIG_CDROM_PKTCDVD_BUFFERS=8
601# CONFIG_CDROM_PKTCDVD_WCACHE is not set
602# CONFIG_ATA_OVER_ETH is not set 569# CONFIG_ATA_OVER_ETH is not set
570# CONFIG_MG_DISK is not set
603CONFIG_MISC_DEVICES=y 571CONFIG_MISC_DEVICES=y
604# CONFIG_ICS932S401 is not set 572# CONFIG_ICS932S401 is not set
573# CONFIG_OMAP_STI is not set
605# CONFIG_ENCLOSURE_SERVICES is not set 574# CONFIG_ENCLOSURE_SERVICES is not set
575# CONFIG_ISL29003 is not set
606# CONFIG_C2PORT is not set 576# CONFIG_C2PORT is not set
607 577
608# 578#
@@ -611,14 +581,15 @@ CONFIG_MISC_DEVICES=y
611# CONFIG_EEPROM_AT24 is not set 581# CONFIG_EEPROM_AT24 is not set
612# CONFIG_EEPROM_AT25 is not set 582# CONFIG_EEPROM_AT25 is not set
613# CONFIG_EEPROM_LEGACY is not set 583# CONFIG_EEPROM_LEGACY is not set
614CONFIG_EEPROM_93CX6=m 584# CONFIG_EEPROM_MAX6875 is not set
585# CONFIG_EEPROM_93CX6 is not set
615CONFIG_HAVE_IDE=y 586CONFIG_HAVE_IDE=y
616# CONFIG_IDE is not set 587# CONFIG_IDE is not set
617 588
618# 589#
619# SCSI device support 590# SCSI device support
620# 591#
621CONFIG_RAID_ATTRS=m 592# CONFIG_RAID_ATTRS is not set
622CONFIG_SCSI=y 593CONFIG_SCSI=y
623CONFIG_SCSI_DMA=y 594CONFIG_SCSI_DMA=y
624# CONFIG_SCSI_TGT is not set 595# CONFIG_SCSI_TGT is not set
@@ -632,12 +603,8 @@ CONFIG_BLK_DEV_SD=y
632# CONFIG_CHR_DEV_ST is not set 603# CONFIG_CHR_DEV_ST is not set
633# CONFIG_CHR_DEV_OSST is not set 604# CONFIG_CHR_DEV_OSST is not set
634# CONFIG_BLK_DEV_SR is not set 605# CONFIG_BLK_DEV_SR is not set
635CONFIG_CHR_DEV_SG=m 606# CONFIG_CHR_DEV_SG is not set
636# CONFIG_CHR_DEV_SCH is not set 607# CONFIG_CHR_DEV_SCH is not set
637
638#
639# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
640#
641CONFIG_SCSI_MULTI_LUN=y 608CONFIG_SCSI_MULTI_LUN=y
642# CONFIG_SCSI_CONSTANTS is not set 609# CONFIG_SCSI_CONSTANTS is not set
643# CONFIG_SCSI_LOGGING is not set 610# CONFIG_SCSI_LOGGING is not set
@@ -655,34 +622,18 @@ CONFIG_SCSI_WAIT_SCAN=m
655CONFIG_SCSI_LOWLEVEL=y 622CONFIG_SCSI_LOWLEVEL=y
656# CONFIG_ISCSI_TCP is not set 623# CONFIG_ISCSI_TCP is not set
657# CONFIG_LIBFC is not set 624# CONFIG_LIBFC is not set
625# CONFIG_LIBFCOE is not set
658# CONFIG_SCSI_DEBUG is not set 626# CONFIG_SCSI_DEBUG is not set
659# CONFIG_SCSI_DH is not set 627# CONFIG_SCSI_DH is not set
628# CONFIG_SCSI_OSD_INITIATOR is not set
660# CONFIG_ATA is not set 629# CONFIG_ATA is not set
661CONFIG_MD=y 630# CONFIG_MD is not set
662CONFIG_BLK_DEV_MD=m
663CONFIG_MD_LINEAR=m
664CONFIG_MD_RAID0=m
665CONFIG_MD_RAID1=m
666CONFIG_MD_RAID10=m
667CONFIG_MD_RAID456=m
668CONFIG_MD_RAID5_RESHAPE=y
669CONFIG_MD_MULTIPATH=m
670CONFIG_MD_FAULTY=m
671CONFIG_BLK_DEV_DM=m
672# CONFIG_DM_DEBUG is not set
673CONFIG_DM_CRYPT=m
674CONFIG_DM_SNAPSHOT=m
675CONFIG_DM_MIRROR=m
676CONFIG_DM_ZERO=m
677CONFIG_DM_MULTIPATH=m
678CONFIG_DM_DELAY=m
679# CONFIG_DM_UEVENT is not set
680CONFIG_NETDEVICES=y 631CONFIG_NETDEVICES=y
681CONFIG_DUMMY=m 632# CONFIG_DUMMY is not set
682# CONFIG_BONDING is not set 633# CONFIG_BONDING is not set
683# CONFIG_MACVLAN is not set 634# CONFIG_MACVLAN is not set
684# CONFIG_EQUALIZER is not set 635# CONFIG_EQUALIZER is not set
685CONFIG_TUN=m 636# CONFIG_TUN is not set
686# CONFIG_VETH is not set 637# CONFIG_VETH is not set
687CONFIG_PHYLIB=y 638CONFIG_PHYLIB=y
688 639
@@ -695,7 +646,7 @@ CONFIG_PHYLIB=y
695# CONFIG_LXT_PHY is not set 646# CONFIG_LXT_PHY is not set
696# CONFIG_CICADA_PHY is not set 647# CONFIG_CICADA_PHY is not set
697# CONFIG_VITESSE_PHY is not set 648# CONFIG_VITESSE_PHY is not set
698CONFIG_SMSC_PHY=y 649# CONFIG_SMSC_PHY is not set
699# CONFIG_BROADCOM_PHY is not set 650# CONFIG_BROADCOM_PHY is not set
700# CONFIG_ICPLUS_PHY is not set 651# CONFIG_ICPLUS_PHY is not set
701# CONFIG_REALTEK_PHY is not set 652# CONFIG_REALTEK_PHY is not set
@@ -710,8 +661,10 @@ CONFIG_MII=y
710CONFIG_SMC91X=y 661CONFIG_SMC91X=y
711# CONFIG_DM9000 is not set 662# CONFIG_DM9000 is not set
712# CONFIG_ENC28J60 is not set 663# CONFIG_ENC28J60 is not set
713CONFIG_SMC911X=m 664# CONFIG_ETHOC is not set
714CONFIG_SMSC911X=m 665# CONFIG_SMC911X is not set
666# CONFIG_SMSC911X is not set
667# CONFIG_DNET is not set
715# CONFIG_IBM_NEW_EMAC_ZMII is not set 668# CONFIG_IBM_NEW_EMAC_ZMII is not set
716# CONFIG_IBM_NEW_EMAC_RGMII is not set 669# CONFIG_IBM_NEW_EMAC_RGMII is not set
717# CONFIG_IBM_NEW_EMAC_TAH is not set 670# CONFIG_IBM_NEW_EMAC_TAH is not set
@@ -720,33 +673,16 @@ CONFIG_SMSC911X=m
720# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set 673# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
721# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 674# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
722# CONFIG_B44 is not set 675# CONFIG_B44 is not set
723# CONFIG_NETDEV_1000 is not set 676# CONFIG_KS8842 is not set
724# CONFIG_NETDEV_10000 is not set 677# CONFIG_KS8851 is not set
678CONFIG_NETDEV_1000=y
679CONFIG_NETDEV_10000=y
725 680
726# 681#
727# Wireless LAN 682# Wireless LAN
728# 683#
729# CONFIG_WLAN_PRE80211 is not set 684# CONFIG_WLAN_PRE80211 is not set
730CONFIG_WLAN_80211=y 685# CONFIG_WLAN_80211 is not set
731CONFIG_LIBERTAS=y
732CONFIG_LIBERTAS_USB=y
733CONFIG_LIBERTAS_SDIO=y
734CONFIG_LIBERTAS_DEBUG=y
735# CONFIG_LIBERTAS_THINFIRM is not set
736CONFIG_USB_ZD1201=m
737# CONFIG_USB_NET_RNDIS_WLAN is not set
738CONFIG_RTL8187=m
739# CONFIG_MAC80211_HWSIM is not set
740CONFIG_P54_COMMON=m
741CONFIG_P54_USB=m
742# CONFIG_IWLWIFI_LEDS is not set
743CONFIG_HOSTAP=m
744CONFIG_HOSTAP_FIRMWARE=y
745CONFIG_HOSTAP_FIRMWARE_NVRAM=y
746# CONFIG_B43 is not set
747# CONFIG_B43LEGACY is not set
748# CONFIG_ZD1211RW is not set
749# CONFIG_RT2X00 is not set
750 686
751# 687#
752# Enable WiMAX (Networking options) to see the WiMAX drivers 688# Enable WiMAX (Networking options) to see the WiMAX drivers
@@ -755,41 +691,14 @@ CONFIG_HOSTAP_FIRMWARE_NVRAM=y
755# 691#
756# USB Network Adapters 692# USB Network Adapters
757# 693#
758CONFIG_USB_CATC=m 694# CONFIG_USB_CATC is not set
759CONFIG_USB_KAWETH=m 695# CONFIG_USB_KAWETH is not set
760CONFIG_USB_PEGASUS=m 696# CONFIG_USB_PEGASUS is not set
761CONFIG_USB_RTL8150=m 697# CONFIG_USB_RTL8150 is not set
762CONFIG_USB_USBNET=y 698# CONFIG_USB_USBNET is not set
763CONFIG_USB_NET_AX8817X=y
764CONFIG_USB_NET_CDCETHER=y
765CONFIG_USB_NET_DM9601=m
766# CONFIG_USB_NET_SMSC95XX is not set
767CONFIG_USB_NET_GL620A=m
768CONFIG_USB_NET_NET1080=m
769CONFIG_USB_NET_PLUSB=m
770CONFIG_USB_NET_MCS7830=m
771CONFIG_USB_NET_RNDIS_HOST=m
772CONFIG_USB_NET_CDC_SUBSET=m
773CONFIG_USB_ALI_M5632=y
774CONFIG_USB_AN2720=y
775CONFIG_USB_BELKIN=y
776CONFIG_USB_ARMLINUX=y
777CONFIG_USB_EPSON2888=y
778CONFIG_USB_KC2190=y
779CONFIG_USB_NET_ZAURUS=m
780# CONFIG_WAN is not set 699# CONFIG_WAN is not set
781CONFIG_PPP=m 700# CONFIG_PPP is not set
782# CONFIG_PPP_MULTILINK is not set
783# CONFIG_PPP_FILTER is not set
784CONFIG_PPP_ASYNC=m
785CONFIG_PPP_SYNC_TTY=m
786CONFIG_PPP_DEFLATE=m
787CONFIG_PPP_BSDCOMP=m
788CONFIG_PPP_MPPE=m
789CONFIG_PPPOE=m
790# CONFIG_PPPOL2TP is not set
791# CONFIG_SLIP is not set 701# CONFIG_SLIP is not set
792CONFIG_SLHC=m
793# CONFIG_NETCONSOLE is not set 702# CONFIG_NETCONSOLE is not set
794# CONFIG_NETPOLL is not set 703# CONFIG_NETPOLL is not set
795# CONFIG_NET_POLL_CONTROLLER is not set 704# CONFIG_NET_POLL_CONTROLLER is not set
@@ -805,10 +714,7 @@ CONFIG_INPUT=y
805# 714#
806# Userland interfaces 715# Userland interfaces
807# 716#
808CONFIG_INPUT_MOUSEDEV=y 717# CONFIG_INPUT_MOUSEDEV is not set
809CONFIG_INPUT_MOUSEDEV_PSAUX=y
810CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
811CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
812# CONFIG_INPUT_JOYDEV is not set 718# CONFIG_INPUT_JOYDEV is not set
813CONFIG_INPUT_EVDEV=y 719CONFIG_INPUT_EVDEV=y
814# CONFIG_INPUT_EVBUG is not set 720# CONFIG_INPUT_EVBUG is not set
@@ -818,47 +724,54 @@ CONFIG_INPUT_EVDEV=y
818# 724#
819CONFIG_INPUT_KEYBOARD=y 725CONFIG_INPUT_KEYBOARD=y
820# CONFIG_KEYBOARD_ATKBD is not set 726# CONFIG_KEYBOARD_ATKBD is not set
821# CONFIG_KEYBOARD_SUNKBD is not set
822# CONFIG_KEYBOARD_LKKBD is not set 727# CONFIG_KEYBOARD_LKKBD is not set
823# CONFIG_KEYBOARD_XTKBD is not set 728# CONFIG_KEYBOARD_GPIO is not set
729# CONFIG_KEYBOARD_MATRIX is not set
730# CONFIG_KEYBOARD_LM8323 is not set
824# CONFIG_KEYBOARD_NEWTON is not set 731# CONFIG_KEYBOARD_NEWTON is not set
825# CONFIG_KEYBOARD_STOWAWAY is not set 732# CONFIG_KEYBOARD_STOWAWAY is not set
826# CONFIG_KEYBOARD_GPIO is not set 733# CONFIG_KEYBOARD_SUNKBD is not set
827CONFIG_INPUT_MOUSE=y 734# CONFIG_KEYBOARD_XTKBD is not set
828CONFIG_MOUSE_PS2=y 735# CONFIG_INPUT_MOUSE is not set
829CONFIG_MOUSE_PS2_ALPS=y
830CONFIG_MOUSE_PS2_LOGIPS2PP=y
831CONFIG_MOUSE_PS2_SYNAPTICS=y
832CONFIG_MOUSE_PS2_TRACKPOINT=y
833# CONFIG_MOUSE_PS2_ELANTECH is not set
834# CONFIG_MOUSE_PS2_TOUCHKIT is not set
835# CONFIG_MOUSE_SERIAL is not set
836# CONFIG_MOUSE_APPLETOUCH is not set
837# CONFIG_MOUSE_BCM5974 is not set
838# CONFIG_MOUSE_VSXXXAA is not set
839# CONFIG_MOUSE_GPIO is not set
840# CONFIG_INPUT_JOYSTICK is not set 736# CONFIG_INPUT_JOYSTICK is not set
841# CONFIG_INPUT_TABLET is not set 737# CONFIG_INPUT_TABLET is not set
842# CONFIG_INPUT_TOUCHSCREEN is not set 738CONFIG_INPUT_TOUCHSCREEN=y
739CONFIG_TOUCHSCREEN_ADS7846=y
740# CONFIG_TOUCHSCREEN_AD7877 is not set
741# CONFIG_TOUCHSCREEN_AD7879_I2C is not set
742# CONFIG_TOUCHSCREEN_AD7879_SPI is not set
743# CONFIG_TOUCHSCREEN_AD7879 is not set
744# CONFIG_TOUCHSCREEN_EETI is not set
745# CONFIG_TOUCHSCREEN_FUJITSU is not set
746# CONFIG_TOUCHSCREEN_GUNZE is not set
747# CONFIG_TOUCHSCREEN_ELO is not set
748# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
749# CONFIG_TOUCHSCREEN_MTOUCH is not set
750# CONFIG_TOUCHSCREEN_INEXIO is not set
751# CONFIG_TOUCHSCREEN_MK712 is not set
752# CONFIG_TOUCHSCREEN_PENMOUNT is not set
753# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
754# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
755# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
756# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
757# CONFIG_TOUCHSCREEN_TSC2007 is not set
758# CONFIG_TOUCHSCREEN_W90X900 is not set
843# CONFIG_INPUT_MISC is not set 759# CONFIG_INPUT_MISC is not set
844 760
845# 761#
846# Hardware I/O ports 762# Hardware I/O ports
847# 763#
848CONFIG_SERIO=y 764# CONFIG_SERIO is not set
849CONFIG_SERIO_SERPORT=y
850CONFIG_SERIO_LIBPS2=y
851# CONFIG_SERIO_RAW is not set
852# CONFIG_GAMEPORT is not set 765# CONFIG_GAMEPORT is not set
853 766
854# 767#
855# Character devices 768# Character devices
856# 769#
857CONFIG_VT=y 770CONFIG_VT=y
858CONFIG_CONSOLE_TRANSLATIONS=y 771# CONFIG_CONSOLE_TRANSLATIONS is not set
859CONFIG_VT_CONSOLE=y 772CONFIG_VT_CONSOLE=y
860CONFIG_HW_CONSOLE=y 773CONFIG_HW_CONSOLE=y
861CONFIG_VT_HW_CONSOLE_BINDING=y 774# CONFIG_VT_HW_CONSOLE_BINDING is not set
862CONFIG_DEVKMEM=y 775CONFIG_DEVKMEM=y
863# CONFIG_SERIAL_NONSTANDARD is not set 776# CONFIG_SERIAL_NONSTANDARD is not set
864 777
@@ -878,6 +791,7 @@ CONFIG_SERIAL_8250_RSA=y
878# 791#
879# Non-8250 serial port support 792# Non-8250 serial port support
880# 793#
794# CONFIG_SERIAL_MAX3100 is not set
881CONFIG_SERIAL_CORE=y 795CONFIG_SERIAL_CORE=y
882CONFIG_SERIAL_CORE_CONSOLE=y 796CONFIG_SERIAL_CORE_CONSOLE=y
883CONFIG_UNIX98_PTYS=y 797CONFIG_UNIX98_PTYS=y
@@ -885,6 +799,7 @@ CONFIG_UNIX98_PTYS=y
885# CONFIG_LEGACY_PTYS is not set 799# CONFIG_LEGACY_PTYS is not set
886# CONFIG_IPMI_HANDLER is not set 800# CONFIG_IPMI_HANDLER is not set
887CONFIG_HW_RANDOM=y 801CONFIG_HW_RANDOM=y
802# CONFIG_HW_RANDOM_TIMERIOMEM is not set
888# CONFIG_R3964 is not set 803# CONFIG_R3964 is not set
889# CONFIG_RAW_DRIVER is not set 804# CONFIG_RAW_DRIVER is not set
890# CONFIG_TCG_TPM is not set 805# CONFIG_TCG_TPM is not set
@@ -900,6 +815,7 @@ CONFIG_I2C_HELPER_AUTO=y
900# 815#
901# I2C system bus drivers (mostly embedded / system-on-chip) 816# I2C system bus drivers (mostly embedded / system-on-chip)
902# 817#
818# CONFIG_I2C_DESIGNWARE is not set
903# CONFIG_I2C_GPIO is not set 819# CONFIG_I2C_GPIO is not set
904# CONFIG_I2C_OCORES is not set 820# CONFIG_I2C_OCORES is not set
905CONFIG_I2C_OMAP=y 821CONFIG_I2C_OMAP=y
@@ -925,8 +841,6 @@ CONFIG_I2C_OMAP=y
925# CONFIG_SENSORS_PCF8574 is not set 841# CONFIG_SENSORS_PCF8574 is not set
926# CONFIG_PCF8575 is not set 842# CONFIG_PCF8575 is not set
927# CONFIG_SENSORS_PCA9539 is not set 843# CONFIG_SENSORS_PCA9539 is not set
928# CONFIG_SENSORS_PCF8591 is not set
929# CONFIG_SENSORS_MAX6875 is not set
930# CONFIG_SENSORS_TSL2550 is not set 844# CONFIG_SENSORS_TSL2550 is not set
931# CONFIG_I2C_DEBUG_CORE is not set 845# CONFIG_I2C_DEBUG_CORE is not set
932# CONFIG_I2C_DEBUG_ALGO is not set 846# CONFIG_I2C_DEBUG_ALGO is not set
@@ -975,68 +889,8 @@ CONFIG_GPIO_TWL4030=y
975# CONFIG_GPIO_MAX7301 is not set 889# CONFIG_GPIO_MAX7301 is not set
976# CONFIG_GPIO_MCP23S08 is not set 890# CONFIG_GPIO_MCP23S08 is not set
977# CONFIG_W1 is not set 891# CONFIG_W1 is not set
978CONFIG_POWER_SUPPLY=m 892# CONFIG_POWER_SUPPLY is not set
979# CONFIG_POWER_SUPPLY_DEBUG is not set 893# CONFIG_HWMON is not set
980# CONFIG_PDA_POWER is not set
981# CONFIG_BATTERY_DS2760 is not set
982# CONFIG_BATTERY_BQ27x00 is not set
983CONFIG_HWMON=y
984# CONFIG_HWMON_VID is not set
985# CONFIG_SENSORS_AD7414 is not set
986# CONFIG_SENSORS_AD7418 is not set
987# CONFIG_SENSORS_ADCXX is not set
988# CONFIG_SENSORS_ADM1021 is not set
989# CONFIG_SENSORS_ADM1025 is not set
990# CONFIG_SENSORS_ADM1026 is not set
991# CONFIG_SENSORS_ADM1029 is not set
992# CONFIG_SENSORS_ADM1031 is not set
993# CONFIG_SENSORS_ADM9240 is not set
994# CONFIG_SENSORS_ADT7462 is not set
995# CONFIG_SENSORS_ADT7470 is not set
996# CONFIG_SENSORS_ADT7473 is not set
997# CONFIG_SENSORS_ADT7475 is not set
998# CONFIG_SENSORS_ATXP1 is not set
999# CONFIG_SENSORS_DS1621 is not set
1000# CONFIG_SENSORS_F71805F is not set
1001# CONFIG_SENSORS_F71882FG is not set
1002# CONFIG_SENSORS_F75375S is not set
1003# CONFIG_SENSORS_GL518SM is not set
1004# CONFIG_SENSORS_GL520SM is not set
1005# CONFIG_SENSORS_IT87 is not set
1006# CONFIG_SENSORS_LM63 is not set
1007# CONFIG_SENSORS_LM70 is not set
1008# CONFIG_SENSORS_LM75 is not set
1009# CONFIG_SENSORS_LM77 is not set
1010# CONFIG_SENSORS_LM78 is not set
1011# CONFIG_SENSORS_LM80 is not set
1012# CONFIG_SENSORS_LM83 is not set
1013# CONFIG_SENSORS_LM85 is not set
1014# CONFIG_SENSORS_LM87 is not set
1015# CONFIG_SENSORS_LM90 is not set
1016# CONFIG_SENSORS_LM92 is not set
1017# CONFIG_SENSORS_LM93 is not set
1018# CONFIG_SENSORS_LTC4245 is not set
1019# CONFIG_SENSORS_MAX1111 is not set
1020# CONFIG_SENSORS_MAX1619 is not set
1021# CONFIG_SENSORS_MAX6650 is not set
1022# CONFIG_SENSORS_PC87360 is not set
1023# CONFIG_SENSORS_PC87427 is not set
1024# CONFIG_SENSORS_DME1737 is not set
1025# CONFIG_SENSORS_SMSC47M1 is not set
1026# CONFIG_SENSORS_SMSC47M192 is not set
1027# CONFIG_SENSORS_SMSC47B397 is not set
1028# CONFIG_SENSORS_ADS7828 is not set
1029# CONFIG_SENSORS_THMC50 is not set
1030# CONFIG_SENSORS_VT1211 is not set
1031# CONFIG_SENSORS_W83781D is not set
1032# CONFIG_SENSORS_W83791D is not set
1033# CONFIG_SENSORS_W83792D is not set
1034# CONFIG_SENSORS_W83793 is not set
1035# CONFIG_SENSORS_W83L785TS is not set
1036# CONFIG_SENSORS_W83L786NG is not set
1037# CONFIG_SENSORS_W83627HF is not set
1038# CONFIG_SENSORS_W83627EHF is not set
1039# CONFIG_HWMON_DEBUG_CHIP is not set
1040# CONFIG_THERMAL is not set 894# CONFIG_THERMAL is not set
1041# CONFIG_THERMAL_HWMON is not set 895# CONFIG_THERMAL_HWMON is not set
1042CONFIG_WATCHDOG=y 896CONFIG_WATCHDOG=y
@@ -1046,7 +900,8 @@ CONFIG_WATCHDOG_NOWAYOUT=y
1046# Watchdog Device Drivers 900# Watchdog Device Drivers
1047# 901#
1048# CONFIG_SOFT_WATCHDOG is not set 902# CONFIG_SOFT_WATCHDOG is not set
1049# CONFIG_OMAP_WATCHDOG is not set 903CONFIG_OMAP_WATCHDOG=y
904CONFIG_TWL4030_WATCHDOG=y
1050 905
1051# 906#
1052# USB-based Watchdog Cards 907# USB-based Watchdog Cards
@@ -1077,237 +932,9 @@ CONFIG_TWL4030_CORE=y
1077# CONFIG_MFD_WM8400 is not set 932# CONFIG_MFD_WM8400 is not set
1078# CONFIG_MFD_WM8350_I2C is not set 933# CONFIG_MFD_WM8350_I2C is not set
1079# CONFIG_MFD_PCF50633 is not set 934# CONFIG_MFD_PCF50633 is not set
1080 935# CONFIG_AB3100_CORE is not set
1081# 936# CONFIG_EZX_PCAP is not set
1082# Multimedia devices 937# CONFIG_MEDIA_SUPPORT is not set
1083#
1084
1085#
1086# Multimedia core support
1087#
1088CONFIG_VIDEO_DEV=m
1089CONFIG_VIDEO_V4L2_COMMON=m
1090CONFIG_VIDEO_ALLOW_V4L1=y
1091CONFIG_VIDEO_V4L1_COMPAT=y
1092CONFIG_DVB_CORE=m
1093CONFIG_VIDEO_MEDIA=m
1094
1095#
1096# Multimedia drivers
1097#
1098CONFIG_MEDIA_ATTACH=y
1099CONFIG_MEDIA_TUNER=m
1100# CONFIG_MEDIA_TUNER_CUSTOMIZE is not set
1101CONFIG_MEDIA_TUNER_SIMPLE=m
1102CONFIG_MEDIA_TUNER_TDA8290=m
1103CONFIG_MEDIA_TUNER_TDA827X=m
1104CONFIG_MEDIA_TUNER_TDA18271=m
1105CONFIG_MEDIA_TUNER_TDA9887=m
1106CONFIG_MEDIA_TUNER_TEA5761=m
1107CONFIG_MEDIA_TUNER_TEA5767=m
1108CONFIG_MEDIA_TUNER_MT20XX=m
1109CONFIG_MEDIA_TUNER_MT2060=m
1110CONFIG_MEDIA_TUNER_MT2266=m
1111CONFIG_MEDIA_TUNER_QT1010=m
1112CONFIG_MEDIA_TUNER_XC2028=m
1113CONFIG_MEDIA_TUNER_XC5000=m
1114CONFIG_MEDIA_TUNER_MXL5005S=m
1115CONFIG_VIDEO_V4L2=m
1116CONFIG_VIDEO_V4L1=m
1117CONFIG_VIDEO_TVEEPROM=m
1118CONFIG_VIDEO_TUNER=m
1119CONFIG_VIDEO_CAPTURE_DRIVERS=y
1120# CONFIG_VIDEO_ADV_DEBUG is not set
1121# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
1122CONFIG_VIDEO_HELPER_CHIPS_AUTO=y
1123CONFIG_VIDEO_MSP3400=m
1124CONFIG_VIDEO_CS53L32A=m
1125CONFIG_VIDEO_WM8775=m
1126CONFIG_VIDEO_SAA711X=m
1127CONFIG_VIDEO_CX25840=m
1128CONFIG_VIDEO_CX2341X=m
1129# CONFIG_VIDEO_VIVI is not set
1130# CONFIG_VIDEO_CPIA is not set
1131# CONFIG_VIDEO_CPIA2 is not set
1132# CONFIG_VIDEO_SAA5246A is not set
1133# CONFIG_VIDEO_SAA5249 is not set
1134# CONFIG_VIDEO_AU0828 is not set
1135# CONFIG_SOC_CAMERA is not set
1136CONFIG_V4L_USB_DRIVERS=y
1137CONFIG_USB_VIDEO_CLASS=m
1138CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y
1139# CONFIG_USB_GSPCA is not set
1140CONFIG_VIDEO_PVRUSB2=m
1141CONFIG_VIDEO_PVRUSB2_SYSFS=y
1142CONFIG_VIDEO_PVRUSB2_DVB=y
1143# CONFIG_VIDEO_PVRUSB2_DEBUGIFC is not set
1144# CONFIG_VIDEO_EM28XX is not set
1145CONFIG_VIDEO_USBVISION=m
1146CONFIG_VIDEO_USBVIDEO=m
1147CONFIG_USB_VICAM=m
1148CONFIG_USB_IBMCAM=m
1149CONFIG_USB_KONICAWC=m
1150CONFIG_USB_QUICKCAM_MESSENGER=m
1151# CONFIG_USB_ET61X251 is not set
1152CONFIG_VIDEO_OVCAMCHIP=m
1153CONFIG_USB_W9968CF=m
1154CONFIG_USB_OV511=m
1155CONFIG_USB_SE401=m
1156CONFIG_USB_SN9C102=m
1157CONFIG_USB_STV680=m
1158# CONFIG_USB_ZC0301 is not set
1159CONFIG_USB_PWC=m
1160# CONFIG_USB_PWC_DEBUG is not set
1161CONFIG_USB_ZR364XX=m
1162# CONFIG_USB_STKWEBCAM is not set
1163# CONFIG_USB_S2255 is not set
1164CONFIG_RADIO_ADAPTERS=y
1165# CONFIG_USB_DSBR is not set
1166# CONFIG_USB_SI470X is not set
1167# CONFIG_USB_MR800 is not set
1168# CONFIG_RADIO_TEA5764 is not set
1169# CONFIG_DVB_DYNAMIC_MINORS is not set
1170CONFIG_DVB_CAPTURE_DRIVERS=y
1171# CONFIG_TTPCI_EEPROM is not set
1172
1173#
1174# Supported USB Adapters
1175#
1176CONFIG_DVB_USB=m
1177# CONFIG_DVB_USB_DEBUG is not set
1178CONFIG_DVB_USB_A800=m
1179CONFIG_DVB_USB_DIBUSB_MB=m
1180# CONFIG_DVB_USB_DIBUSB_MB_FAULTY is not set
1181CONFIG_DVB_USB_DIBUSB_MC=m
1182CONFIG_DVB_USB_DIB0700=m
1183CONFIG_DVB_USB_UMT_010=m
1184CONFIG_DVB_USB_CXUSB=m
1185CONFIG_DVB_USB_M920X=m
1186CONFIG_DVB_USB_GL861=m
1187CONFIG_DVB_USB_AU6610=m
1188CONFIG_DVB_USB_DIGITV=m
1189CONFIG_DVB_USB_VP7045=m
1190CONFIG_DVB_USB_VP702X=m
1191CONFIG_DVB_USB_GP8PSK=m
1192CONFIG_DVB_USB_NOVA_T_USB2=m
1193CONFIG_DVB_USB_TTUSB2=m
1194CONFIG_DVB_USB_DTT200U=m
1195CONFIG_DVB_USB_OPERA1=m
1196CONFIG_DVB_USB_AF9005=m
1197CONFIG_DVB_USB_AF9005_REMOTE=m
1198# CONFIG_DVB_USB_DW2102 is not set
1199# CONFIG_DVB_USB_CINERGY_T2 is not set
1200# CONFIG_DVB_USB_ANYSEE is not set
1201# CONFIG_DVB_USB_DTV5100 is not set
1202# CONFIG_DVB_USB_AF9015 is not set
1203# CONFIG_DVB_SIANO_SMS1XXX is not set
1204
1205#
1206# Supported FlexCopII (B2C2) Adapters
1207#
1208# CONFIG_DVB_B2C2_FLEXCOP is not set
1209
1210#
1211# Supported DVB Frontends
1212#
1213
1214#
1215# Customise DVB Frontends
1216#
1217# CONFIG_DVB_FE_CUSTOMISE is not set
1218
1219#
1220# Multistandard (satellite) frontends
1221#
1222# CONFIG_DVB_STB0899 is not set
1223# CONFIG_DVB_STB6100 is not set
1224
1225#
1226# DVB-S (satellite) frontends
1227#
1228CONFIG_DVB_CX24110=m
1229CONFIG_DVB_CX24123=m
1230CONFIG_DVB_MT312=m
1231CONFIG_DVB_S5H1420=m
1232# CONFIG_DVB_STV0288 is not set
1233# CONFIG_DVB_STB6000 is not set
1234CONFIG_DVB_STV0299=m
1235CONFIG_DVB_TDA8083=m
1236CONFIG_DVB_TDA10086=m
1237# CONFIG_DVB_TDA8261 is not set
1238CONFIG_DVB_VES1X93=m
1239CONFIG_DVB_TUNER_ITD1000=m
1240# CONFIG_DVB_TUNER_CX24113 is not set
1241CONFIG_DVB_TDA826X=m
1242CONFIG_DVB_TUA6100=m
1243# CONFIG_DVB_CX24116 is not set
1244# CONFIG_DVB_SI21XX is not set
1245
1246#
1247# DVB-T (terrestrial) frontends
1248#
1249CONFIG_DVB_SP8870=m
1250CONFIG_DVB_SP887X=m
1251CONFIG_DVB_CX22700=m
1252CONFIG_DVB_CX22702=m
1253# CONFIG_DVB_DRX397XD is not set
1254CONFIG_DVB_L64781=m
1255CONFIG_DVB_TDA1004X=m
1256CONFIG_DVB_NXT6000=m
1257CONFIG_DVB_MT352=m
1258CONFIG_DVB_ZL10353=m
1259CONFIG_DVB_DIB3000MB=m
1260CONFIG_DVB_DIB3000MC=m
1261CONFIG_DVB_DIB7000M=m
1262CONFIG_DVB_DIB7000P=m
1263CONFIG_DVB_TDA10048=m
1264
1265#
1266# DVB-C (cable) frontends
1267#
1268CONFIG_DVB_VES1820=m
1269CONFIG_DVB_TDA10021=m
1270CONFIG_DVB_TDA10023=m
1271CONFIG_DVB_STV0297=m
1272
1273#
1274# ATSC (North American/Korean Terrestrial/Cable DTV) frontends
1275#
1276CONFIG_DVB_NXT200X=m
1277# CONFIG_DVB_OR51211 is not set
1278# CONFIG_DVB_OR51132 is not set
1279CONFIG_DVB_BCM3510=m
1280CONFIG_DVB_LGDT330X=m
1281# CONFIG_DVB_LGDT3304 is not set
1282CONFIG_DVB_S5H1409=m
1283CONFIG_DVB_AU8522=m
1284CONFIG_DVB_S5H1411=m
1285
1286#
1287# ISDB-T (terrestrial) frontends
1288#
1289# CONFIG_DVB_S921 is not set
1290
1291#
1292# Digital terrestrial only tuners/PLL
1293#
1294CONFIG_DVB_PLL=m
1295CONFIG_DVB_TUNER_DIB0070=m
1296
1297#
1298# SEC control devices for DVB-S
1299#
1300CONFIG_DVB_LNBP21=m
1301# CONFIG_DVB_ISL6405 is not set
1302CONFIG_DVB_ISL6421=m
1303# CONFIG_DVB_LGS8GL5 is not set
1304
1305#
1306# Tools to develop new frontends
1307#
1308# CONFIG_DVB_DUMMY_FE is not set
1309# CONFIG_DVB_AF9013 is not set
1310# CONFIG_DAB is not set
1311 938
1312# 939#
1313# Graphics support 940# Graphics support
@@ -1366,53 +993,10 @@ CONFIG_LOGO=y
1366CONFIG_LOGO_LINUX_MONO=y 993CONFIG_LOGO_LINUX_MONO=y
1367CONFIG_LOGO_LINUX_VGA16=y 994CONFIG_LOGO_LINUX_VGA16=y
1368CONFIG_LOGO_LINUX_CLUT224=y 995CONFIG_LOGO_LINUX_CLUT224=y
1369CONFIG_SOUND=y 996# CONFIG_SOUND is not set
1370CONFIG_SOUND_OSS_CORE=y
1371CONFIG_SND=y
1372CONFIG_SND_TIMER=y
1373CONFIG_SND_PCM=y
1374CONFIG_SND_HWDEP=y
1375CONFIG_SND_RAWMIDI=y
1376CONFIG_SND_SEQUENCER=m
1377# CONFIG_SND_SEQ_DUMMY is not set
1378CONFIG_SND_OSSEMUL=y
1379CONFIG_SND_MIXER_OSS=y
1380CONFIG_SND_PCM_OSS=y
1381CONFIG_SND_PCM_OSS_PLUGINS=y
1382CONFIG_SND_SEQUENCER_OSS=y
1383# CONFIG_SND_HRTIMER is not set
1384# CONFIG_SND_DYNAMIC_MINORS is not set
1385CONFIG_SND_SUPPORT_OLD_API=y
1386CONFIG_SND_VERBOSE_PROCFS=y
1387CONFIG_SND_VERBOSE_PRINTK=y
1388CONFIG_SND_DEBUG=y
1389# CONFIG_SND_DEBUG_VERBOSE is not set
1390# CONFIG_SND_PCM_XRUN_DEBUG is not set
1391CONFIG_SND_DRIVERS=y
1392# CONFIG_SND_DUMMY is not set
1393# CONFIG_SND_VIRMIDI is not set
1394# CONFIG_SND_MTPAV is not set
1395# CONFIG_SND_SERIAL_U16550 is not set
1396# CONFIG_SND_MPU401 is not set
1397CONFIG_SND_ARM=y
1398CONFIG_SND_SPI=y
1399CONFIG_SND_USB=y
1400CONFIG_SND_USB_AUDIO=y
1401CONFIG_SND_USB_CAIAQ=m
1402CONFIG_SND_USB_CAIAQ_INPUT=y
1403CONFIG_SND_SOC=y
1404CONFIG_SND_OMAP_SOC=y
1405CONFIG_SND_OMAP_SOC_MCBSP=y
1406# CONFIG_SND_OMAP_SOC_OVERO is not set
1407CONFIG_SND_OMAP_SOC_SDP3430=y
1408# CONFIG_SND_OMAP_SOC_OMAP3_PANDORA is not set
1409CONFIG_SND_SOC_I2C_AND_SPI=y
1410# CONFIG_SND_SOC_ALL_CODECS is not set
1411CONFIG_SND_SOC_TWL4030=y
1412# CONFIG_SOUND_PRIME is not set
1413CONFIG_HID_SUPPORT=y 997CONFIG_HID_SUPPORT=y
1414CONFIG_HID=y 998CONFIG_HID=y
1415CONFIG_HID_DEBUG=y 999# CONFIG_HID_DEBUG is not set
1416# CONFIG_HIDRAW is not set 1000# CONFIG_HIDRAW is not set
1417 1001
1418# 1002#
@@ -1425,35 +1009,35 @@ CONFIG_USB_HID=y
1425# 1009#
1426# Special HID drivers 1010# Special HID drivers
1427# 1011#
1428CONFIG_HID_COMPAT=y 1012# CONFIG_HID_A4TECH is not set
1429CONFIG_HID_A4TECH=y 1013# CONFIG_HID_APPLE is not set
1430CONFIG_HID_APPLE=y 1014# CONFIG_HID_BELKIN is not set
1431CONFIG_HID_BELKIN=y 1015# CONFIG_HID_CHERRY is not set
1432CONFIG_HID_CHERRY=y 1016# CONFIG_HID_CHICONY is not set
1433CONFIG_HID_CHICONY=y 1017# CONFIG_HID_CYPRESS is not set
1434CONFIG_HID_CYPRESS=y 1018# CONFIG_HID_DRAGONRISE is not set
1435CONFIG_HID_EZKEY=y 1019# CONFIG_HID_EZKEY is not set
1436CONFIG_HID_GYRATION=y 1020# CONFIG_HID_KYE is not set
1437CONFIG_HID_LOGITECH=y 1021# CONFIG_HID_GYRATION is not set
1438# CONFIG_LOGITECH_FF is not set 1022# CONFIG_HID_KENSINGTON is not set
1439# CONFIG_LOGIRUMBLEPAD2_FF is not set 1023# CONFIG_HID_LOGITECH is not set
1440CONFIG_HID_MICROSOFT=y 1024# CONFIG_HID_MICROSOFT is not set
1441CONFIG_HID_MONTEREY=y 1025# CONFIG_HID_MONTEREY is not set
1442# CONFIG_HID_NTRIG is not set 1026# CONFIG_HID_NTRIG is not set
1443CONFIG_HID_PANTHERLORD=y 1027# CONFIG_HID_PANTHERLORD is not set
1444# CONFIG_PANTHERLORD_FF is not set 1028# CONFIG_HID_PETALYNX is not set
1445CONFIG_HID_PETALYNX=y 1029# CONFIG_HID_SAMSUNG is not set
1446CONFIG_HID_SAMSUNG=y 1030# CONFIG_HID_SONY is not set
1447CONFIG_HID_SONY=y 1031# CONFIG_HID_SUNPLUS is not set
1448CONFIG_HID_SUNPLUS=y 1032# CONFIG_HID_GREENASIA is not set
1449# CONFIG_GREENASIA_FF is not set 1033# CONFIG_HID_SMARTJOYPLUS is not set
1450# CONFIG_HID_TOPSEED is not set 1034# CONFIG_HID_TOPSEED is not set
1451# CONFIG_THRUSTMASTER_FF is not set 1035# CONFIG_HID_THRUSTMASTER is not set
1452# CONFIG_ZEROPLUS_FF is not set 1036# CONFIG_HID_ZEROPLUS is not set
1453CONFIG_USB_SUPPORT=y 1037CONFIG_USB_SUPPORT=y
1454CONFIG_USB_ARCH_HAS_HCD=y 1038CONFIG_USB_ARCH_HAS_HCD=y
1455CONFIG_USB_ARCH_HAS_OHCI=y 1039CONFIG_USB_ARCH_HAS_OHCI=y
1456# CONFIG_USB_ARCH_HAS_EHCI is not set 1040CONFIG_USB_ARCH_HAS_EHCI=y
1457CONFIG_USB=y 1041CONFIG_USB=y
1458CONFIG_USB_DEBUG=y 1042CONFIG_USB_DEBUG=y
1459CONFIG_USB_ANNOUNCE_NEW_DEVICES=y 1043CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
@@ -1461,9 +1045,9 @@ CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
1461# 1045#
1462# Miscellaneous USB options 1046# Miscellaneous USB options
1463# 1047#
1464CONFIG_USB_DEVICEFS=y 1048# CONFIG_USB_DEVICEFS is not set
1465CONFIG_USB_DEVICE_CLASS=y 1049# CONFIG_USB_DEVICE_CLASS is not set
1466CONFIG_USB_DYNAMIC_MINORS=y 1050# CONFIG_USB_DYNAMIC_MINORS is not set
1467CONFIG_USB_SUSPEND=y 1051CONFIG_USB_SUSPEND=y
1468CONFIG_USB_OTG=y 1052CONFIG_USB_OTG=y
1469# CONFIG_USB_OTG_WHITELIST is not set 1053# CONFIG_USB_OTG_WHITELIST is not set
@@ -1476,8 +1060,12 @@ CONFIG_USB_MON=y
1476# USB Host Controller Drivers 1060# USB Host Controller Drivers
1477# 1061#
1478# CONFIG_USB_C67X00_HCD is not set 1062# CONFIG_USB_C67X00_HCD is not set
1063CONFIG_USB_EHCI_HCD=m
1064# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
1065# CONFIG_USB_EHCI_TT_NEWSCHED is not set
1479# CONFIG_USB_OXU210HP_HCD is not set 1066# CONFIG_USB_OXU210HP_HCD is not set
1480# CONFIG_USB_ISP116X_HCD is not set 1067# CONFIG_USB_ISP116X_HCD is not set
1068# CONFIG_USB_ISP1760_HCD is not set
1481# CONFIG_USB_OHCI_HCD is not set 1069# CONFIG_USB_OHCI_HCD is not set
1482# CONFIG_USB_SL811_HCD is not set 1070# CONFIG_USB_SL811_HCD is not set
1483# CONFIG_USB_R8A66597_HCD is not set 1071# CONFIG_USB_R8A66597_HCD is not set
@@ -1493,23 +1081,25 @@ CONFIG_USB_MUSB_SOC=y
1493CONFIG_USB_MUSB_OTG=y 1081CONFIG_USB_MUSB_OTG=y
1494CONFIG_USB_GADGET_MUSB_HDRC=y 1082CONFIG_USB_GADGET_MUSB_HDRC=y
1495CONFIG_USB_MUSB_HDRC_HCD=y 1083CONFIG_USB_MUSB_HDRC_HCD=y
1496CONFIG_MUSB_PIO_ONLY=y 1084# CONFIG_MUSB_PIO_ONLY is not set
1085CONFIG_USB_INVENTRA_DMA=y
1086# CONFIG_USB_TI_CPPI_DMA is not set
1497# CONFIG_USB_MUSB_DEBUG is not set 1087# CONFIG_USB_MUSB_DEBUG is not set
1498 1088
1499# 1089#
1500# USB Device Class drivers 1090# USB Device Class drivers
1501# 1091#
1502# CONFIG_USB_ACM is not set 1092# CONFIG_USB_ACM is not set
1503CONFIG_USB_PRINTER=y 1093# CONFIG_USB_PRINTER is not set
1504CONFIG_USB_WDM=y 1094# CONFIG_USB_WDM is not set
1505# CONFIG_USB_TMC is not set 1095# CONFIG_USB_TMC is not set
1506 1096
1507# 1097#
1508# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed; 1098# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
1509# 1099#
1510 1100
1511# 1101#
1512# see USB_STORAGE Help for more information 1102# also be needed; see USB_STORAGE Help for more info
1513# 1103#
1514CONFIG_USB_STORAGE=y 1104CONFIG_USB_STORAGE=y
1515# CONFIG_USB_STORAGE_DEBUG is not set 1105# CONFIG_USB_STORAGE_DEBUG is not set
@@ -1551,14 +1141,14 @@ CONFIG_USB_STORAGE=y
1551# CONFIG_USB_LED is not set 1141# CONFIG_USB_LED is not set
1552# CONFIG_USB_CYPRESS_CY7C63 is not set 1142# CONFIG_USB_CYPRESS_CY7C63 is not set
1553# CONFIG_USB_CYTHERM is not set 1143# CONFIG_USB_CYTHERM is not set
1554# CONFIG_USB_PHIDGET is not set
1555# CONFIG_USB_IDMOUSE is not set 1144# CONFIG_USB_IDMOUSE is not set
1556# CONFIG_USB_FTDI_ELAN is not set 1145# CONFIG_USB_FTDI_ELAN is not set
1557# CONFIG_USB_APPLEDISPLAY is not set 1146# CONFIG_USB_APPLEDISPLAY is not set
1147# CONFIG_USB_SISUSBVGA is not set
1558# CONFIG_USB_LD is not set 1148# CONFIG_USB_LD is not set
1559# CONFIG_USB_TRANCEVIBRATOR is not set 1149# CONFIG_USB_TRANCEVIBRATOR is not set
1560# CONFIG_USB_IOWARRIOR is not set 1150# CONFIG_USB_IOWARRIOR is not set
1561# CONFIG_USB_TEST is not set 1151CONFIG_USB_TEST=y
1562# CONFIG_USB_ISIGHTFW is not set 1152# CONFIG_USB_ISIGHTFW is not set
1563# CONFIG_USB_VST is not set 1153# CONFIG_USB_VST is not set
1564CONFIG_USB_GADGET=y 1154CONFIG_USB_GADGET=y
@@ -1574,25 +1164,29 @@ CONFIG_USB_GADGET_SELECTED=y
1574# CONFIG_USB_GADGET_OMAP is not set 1164# CONFIG_USB_GADGET_OMAP is not set
1575# CONFIG_USB_GADGET_PXA25X is not set 1165# CONFIG_USB_GADGET_PXA25X is not set
1576# CONFIG_USB_GADGET_PXA27X is not set 1166# CONFIG_USB_GADGET_PXA27X is not set
1577# CONFIG_USB_GADGET_S3C2410 is not set 1167# CONFIG_USB_GADGET_S3C_HSOTG is not set
1578# CONFIG_USB_GADGET_IMX is not set 1168# CONFIG_USB_GADGET_IMX is not set
1169# CONFIG_USB_GADGET_S3C2410 is not set
1579# CONFIG_USB_GADGET_M66592 is not set 1170# CONFIG_USB_GADGET_M66592 is not set
1580# CONFIG_USB_GADGET_AMD5536UDC is not set 1171# CONFIG_USB_GADGET_AMD5536UDC is not set
1581# CONFIG_USB_GADGET_FSL_QE is not set 1172# CONFIG_USB_GADGET_FSL_QE is not set
1582# CONFIG_USB_GADGET_CI13XXX is not set 1173# CONFIG_USB_GADGET_CI13XXX is not set
1583# CONFIG_USB_GADGET_NET2280 is not set 1174# CONFIG_USB_GADGET_NET2280 is not set
1584# CONFIG_USB_GADGET_GOKU is not set 1175# CONFIG_USB_GADGET_GOKU is not set
1176# CONFIG_USB_GADGET_LANGWELL is not set
1585# CONFIG_USB_GADGET_DUMMY_HCD is not set 1177# CONFIG_USB_GADGET_DUMMY_HCD is not set
1586CONFIG_USB_GADGET_DUALSPEED=y 1178CONFIG_USB_GADGET_DUALSPEED=y
1587# CONFIG_USB_ZERO is not set 1179# CONFIG_USB_ZERO is not set
1588CONFIG_USB_ETH=y 1180# CONFIG_USB_AUDIO is not set
1181CONFIG_USB_ETH=m
1589CONFIG_USB_ETH_RNDIS=y 1182CONFIG_USB_ETH_RNDIS=y
1590# CONFIG_USB_GADGETFS is not set 1183CONFIG_USB_GADGETFS=m
1591# CONFIG_USB_FILE_STORAGE is not set 1184CONFIG_USB_FILE_STORAGE=m
1592# CONFIG_USB_G_SERIAL is not set 1185# CONFIG_USB_FILE_STORAGE_TEST is not set
1186CONFIG_USB_G_SERIAL=m
1593# CONFIG_USB_MIDI_GADGET is not set 1187# CONFIG_USB_MIDI_GADGET is not set
1594# CONFIG_USB_G_PRINTER is not set 1188# CONFIG_USB_G_PRINTER is not set
1595# CONFIG_USB_CDC_COMPOSITE is not set 1189CONFIG_USB_CDC_COMPOSITE=m
1596 1190
1597# 1191#
1598# OTG and related infrastructure 1192# OTG and related infrastructure
@@ -1601,6 +1195,7 @@ CONFIG_USB_OTG_UTILS=y
1601# CONFIG_USB_GPIO_VBUS is not set 1195# CONFIG_USB_GPIO_VBUS is not set
1602# CONFIG_ISP1301_OMAP is not set 1196# CONFIG_ISP1301_OMAP is not set
1603CONFIG_TWL4030_USB=y 1197CONFIG_TWL4030_USB=y
1198# CONFIG_NOP_USB_XCEIV is not set
1604CONFIG_MMC=y 1199CONFIG_MMC=y
1605# CONFIG_MMC_DEBUG is not set 1200# CONFIG_MMC_DEBUG is not set
1606CONFIG_MMC_UNSAFE_RESUME=y 1201CONFIG_MMC_UNSAFE_RESUME=y
@@ -1617,7 +1212,6 @@ CONFIG_SDIO_UART=y
1617# MMC/SD/SDIO Host Controller Drivers 1212# MMC/SD/SDIO Host Controller Drivers
1618# 1213#
1619# CONFIG_MMC_SDHCI is not set 1214# CONFIG_MMC_SDHCI is not set
1620# CONFIG_MMC_OMAP is not set
1621CONFIG_MMC_OMAP_HS=y 1215CONFIG_MMC_OMAP_HS=y
1622# CONFIG_MMC_SPI is not set 1216# CONFIG_MMC_SPI is not set
1623# CONFIG_MEMSTICK is not set 1217# CONFIG_MEMSTICK is not set
@@ -1628,9 +1222,16 @@ CONFIG_LEDS_CLASS=y
1628# 1222#
1629# LED drivers 1223# LED drivers
1630# 1224#
1225# CONFIG_LEDS_OMAP_DEBUG is not set
1226# CONFIG_LEDS_OMAP is not set
1227# CONFIG_LEDS_OMAP_PWM is not set
1631# CONFIG_LEDS_PCA9532 is not set 1228# CONFIG_LEDS_PCA9532 is not set
1632CONFIG_LEDS_GPIO=y 1229CONFIG_LEDS_GPIO=y
1230CONFIG_LEDS_GPIO_PLATFORM=y
1231# CONFIG_LEDS_LP3944 is not set
1633# CONFIG_LEDS_PCA955X is not set 1232# CONFIG_LEDS_PCA955X is not set
1233# CONFIG_LEDS_DAC124S085 is not set
1234# CONFIG_LEDS_BD2802 is not set
1634 1235
1635# 1236#
1636# LED Triggers 1237# LED Triggers
@@ -1639,7 +1240,12 @@ CONFIG_LEDS_TRIGGERS=y
1639CONFIG_LEDS_TRIGGER_TIMER=y 1240CONFIG_LEDS_TRIGGER_TIMER=y
1640CONFIG_LEDS_TRIGGER_HEARTBEAT=y 1241CONFIG_LEDS_TRIGGER_HEARTBEAT=y
1641# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set 1242# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
1243# CONFIG_LEDS_TRIGGER_GPIO is not set
1642# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set 1244# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set
1245
1246#
1247# iptables trigger is under Netfilter config (LED target)
1248#
1643CONFIG_RTC_LIB=y 1249CONFIG_RTC_LIB=y
1644CONFIG_RTC_CLASS=y 1250CONFIG_RTC_CLASS=y
1645CONFIG_RTC_HCTOSYS=y 1251CONFIG_RTC_HCTOSYS=y
@@ -1672,6 +1278,7 @@ CONFIG_RTC_DRV_TWL4030=y
1672# CONFIG_RTC_DRV_S35390A is not set 1278# CONFIG_RTC_DRV_S35390A is not set
1673# CONFIG_RTC_DRV_FM3130 is not set 1279# CONFIG_RTC_DRV_FM3130 is not set
1674# CONFIG_RTC_DRV_RX8581 is not set 1280# CONFIG_RTC_DRV_RX8581 is not set
1281# CONFIG_RTC_DRV_RX8025 is not set
1675 1282
1676# 1283#
1677# SPI RTC drivers 1284# SPI RTC drivers
@@ -1703,6 +1310,7 @@ CONFIG_RTC_DRV_TWL4030=y
1703# on-CPU RTC drivers 1310# on-CPU RTC drivers
1704# 1311#
1705# CONFIG_DMADEVICES is not set 1312# CONFIG_DMADEVICES is not set
1313# CONFIG_AUXDISPLAY is not set
1706CONFIG_REGULATOR=y 1314CONFIG_REGULATOR=y
1707# CONFIG_REGULATOR_DEBUG is not set 1315# CONFIG_REGULATOR_DEBUG is not set
1708# CONFIG_REGULATOR_FIXED_VOLTAGE is not set 1316# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
@@ -1711,32 +1319,36 @@ CONFIG_REGULATOR=y
1711# CONFIG_REGULATOR_BQ24022 is not set 1319# CONFIG_REGULATOR_BQ24022 is not set
1712# CONFIG_REGULATOR_MAX1586 is not set 1320# CONFIG_REGULATOR_MAX1586 is not set
1713CONFIG_REGULATOR_TWL4030=y 1321CONFIG_REGULATOR_TWL4030=y
1322# CONFIG_REGULATOR_LP3971 is not set
1714# CONFIG_UIO is not set 1323# CONFIG_UIO is not set
1715# CONFIG_STAGING is not set 1324# CONFIG_STAGING is not set
1716 1325
1717# 1326#
1327# CBUS support
1328#
1329# CONFIG_CBUS is not set
1330
1331#
1718# File systems 1332# File systems
1719# 1333#
1720CONFIG_EXT2_FS=y 1334CONFIG_EXT2_FS=y
1721# CONFIG_EXT2_FS_XATTR is not set 1335# CONFIG_EXT2_FS_XATTR is not set
1722# CONFIG_EXT2_FS_XIP is not set 1336# CONFIG_EXT2_FS_XIP is not set
1723CONFIG_EXT3_FS=y 1337CONFIG_EXT3_FS=y
1338# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
1724# CONFIG_EXT3_FS_XATTR is not set 1339# CONFIG_EXT3_FS_XATTR is not set
1725# CONFIG_EXT4_FS is not set 1340# CONFIG_EXT4_FS is not set
1726CONFIG_JBD=y 1341CONFIG_JBD=y
1727# CONFIG_JBD_DEBUG is not set 1342# CONFIG_JBD_DEBUG is not set
1728# CONFIG_REISERFS_FS is not set 1343# CONFIG_REISERFS_FS is not set
1729# CONFIG_JFS_FS is not set 1344# CONFIG_JFS_FS is not set
1730CONFIG_FS_POSIX_ACL=y 1345# CONFIG_FS_POSIX_ACL is not set
1731CONFIG_FILE_LOCKING=y 1346# CONFIG_XFS_FS is not set
1732CONFIG_XFS_FS=m
1733# CONFIG_XFS_QUOTA is not set
1734# CONFIG_XFS_POSIX_ACL is not set
1735# CONFIG_XFS_RT is not set
1736# CONFIG_XFS_DEBUG is not set
1737# CONFIG_GFS2_FS is not set 1347# CONFIG_GFS2_FS is not set
1738# CONFIG_OCFS2_FS is not set 1348# CONFIG_OCFS2_FS is not set
1739# CONFIG_BTRFS_FS is not set 1349# CONFIG_BTRFS_FS is not set
1350CONFIG_FILE_LOCKING=y
1351CONFIG_FSNOTIFY=y
1740CONFIG_DNOTIFY=y 1352CONFIG_DNOTIFY=y
1741CONFIG_INOTIFY=y 1353CONFIG_INOTIFY=y
1742CONFIG_INOTIFY_USER=y 1354CONFIG_INOTIFY_USER=y
@@ -1749,16 +1361,18 @@ CONFIG_QFMT_V2=y
1749CONFIG_QUOTACTL=y 1361CONFIG_QUOTACTL=y
1750# CONFIG_AUTOFS_FS is not set 1362# CONFIG_AUTOFS_FS is not set
1751# CONFIG_AUTOFS4_FS is not set 1363# CONFIG_AUTOFS4_FS is not set
1752CONFIG_FUSE_FS=m 1364# CONFIG_FUSE_FS is not set
1365
1366#
1367# Caches
1368#
1369# CONFIG_FSCACHE is not set
1753 1370
1754# 1371#
1755# CD-ROM/DVD Filesystems 1372# CD-ROM/DVD Filesystems
1756# 1373#
1757CONFIG_ISO9660_FS=m 1374# CONFIG_ISO9660_FS is not set
1758CONFIG_JOLIET=y 1375# CONFIG_UDF_FS is not set
1759CONFIG_ZISOFS=y
1760CONFIG_UDF_FS=m
1761CONFIG_UDF_NLS=y
1762 1376
1763# 1377#
1764# DOS/FAT/NT Filesystems 1378# DOS/FAT/NT Filesystems
@@ -1793,15 +1407,13 @@ CONFIG_JFFS2_FS=y
1793CONFIG_JFFS2_FS_DEBUG=0 1407CONFIG_JFFS2_FS_DEBUG=0
1794CONFIG_JFFS2_FS_WRITEBUFFER=y 1408CONFIG_JFFS2_FS_WRITEBUFFER=y
1795# CONFIG_JFFS2_FS_WBUF_VERIFY is not set 1409# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
1796CONFIG_JFFS2_SUMMARY=y 1410# CONFIG_JFFS2_SUMMARY is not set
1797CONFIG_JFFS2_FS_XATTR=y 1411# CONFIG_JFFS2_FS_XATTR is not set
1798CONFIG_JFFS2_FS_POSIX_ACL=y
1799CONFIG_JFFS2_FS_SECURITY=y
1800CONFIG_JFFS2_COMPRESSION_OPTIONS=y 1412CONFIG_JFFS2_COMPRESSION_OPTIONS=y
1801CONFIG_JFFS2_ZLIB=y 1413CONFIG_JFFS2_ZLIB=y
1802CONFIG_JFFS2_LZO=y 1414# CONFIG_JFFS2_LZO is not set
1803CONFIG_JFFS2_RTIME=y 1415CONFIG_JFFS2_RTIME=y
1804CONFIG_JFFS2_RUBIN=y 1416# CONFIG_JFFS2_RUBIN is not set
1805# CONFIG_JFFS2_CMODE_NONE is not set 1417# CONFIG_JFFS2_CMODE_NONE is not set
1806CONFIG_JFFS2_CMODE_PRIORITY=y 1418CONFIG_JFFS2_CMODE_PRIORITY=y
1807# CONFIG_JFFS2_CMODE_SIZE is not set 1419# CONFIG_JFFS2_CMODE_SIZE is not set
@@ -1816,20 +1428,20 @@ CONFIG_JFFS2_CMODE_PRIORITY=y
1816# CONFIG_ROMFS_FS is not set 1428# CONFIG_ROMFS_FS is not set
1817# CONFIG_SYSV_FS is not set 1429# CONFIG_SYSV_FS is not set
1818# CONFIG_UFS_FS is not set 1430# CONFIG_UFS_FS is not set
1431# CONFIG_NILFS2_FS is not set
1819CONFIG_NETWORK_FILESYSTEMS=y 1432CONFIG_NETWORK_FILESYSTEMS=y
1820CONFIG_NFS_FS=y 1433CONFIG_NFS_FS=y
1821CONFIG_NFS_V3=y 1434CONFIG_NFS_V3=y
1822# CONFIG_NFS_V3_ACL is not set 1435# CONFIG_NFS_V3_ACL is not set
1823CONFIG_NFS_V4=y 1436CONFIG_NFS_V4=y
1437# CONFIG_NFS_V4_1 is not set
1824CONFIG_ROOT_NFS=y 1438CONFIG_ROOT_NFS=y
1825# CONFIG_NFSD is not set 1439# CONFIG_NFSD is not set
1826CONFIG_LOCKD=y 1440CONFIG_LOCKD=y
1827CONFIG_LOCKD_V4=y 1441CONFIG_LOCKD_V4=y
1828CONFIG_EXPORTFS=m
1829CONFIG_NFS_COMMON=y 1442CONFIG_NFS_COMMON=y
1830CONFIG_SUNRPC=y 1443CONFIG_SUNRPC=y
1831CONFIG_SUNRPC_GSS=y 1444CONFIG_SUNRPC_GSS=y
1832# CONFIG_SUNRPC_REGISTER_V4 is not set
1833CONFIG_RPCSEC_GSS_KRB5=y 1445CONFIG_RPCSEC_GSS_KRB5=y
1834# CONFIG_RPCSEC_GSS_SPKM3 is not set 1446# CONFIG_RPCSEC_GSS_SPKM3 is not set
1835# CONFIG_SMB_FS is not set 1447# CONFIG_SMB_FS is not set
@@ -1917,12 +1529,15 @@ CONFIG_DEBUG_KERNEL=y
1917CONFIG_DETECT_SOFTLOCKUP=y 1529CONFIG_DETECT_SOFTLOCKUP=y
1918# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set 1530# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1919CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 1531CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
1532CONFIG_DETECT_HUNG_TASK=y
1533# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
1534CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
1920CONFIG_SCHED_DEBUG=y 1535CONFIG_SCHED_DEBUG=y
1921CONFIG_SCHEDSTATS=y 1536# CONFIG_SCHEDSTATS is not set
1922CONFIG_TIMER_STATS=y 1537# CONFIG_TIMER_STATS is not set
1923# CONFIG_DEBUG_OBJECTS is not set 1538# CONFIG_DEBUG_OBJECTS is not set
1924# CONFIG_SLUB_DEBUG_ON is not set 1539# CONFIG_DEBUG_SLAB is not set
1925# CONFIG_SLUB_STATS is not set 1540# CONFIG_DEBUG_KMEMLEAK is not set
1926# CONFIG_DEBUG_RT_MUTEXES is not set 1541# CONFIG_DEBUG_RT_MUTEXES is not set
1927# CONFIG_RT_MUTEX_TESTER is not set 1542# CONFIG_RT_MUTEX_TESTER is not set
1928# CONFIG_DEBUG_SPINLOCK is not set 1543# CONFIG_DEBUG_SPINLOCK is not set
@@ -1932,10 +1547,9 @@ CONFIG_DEBUG_MUTEXES=y
1932# CONFIG_LOCK_STAT is not set 1547# CONFIG_LOCK_STAT is not set
1933# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1548# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1934# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1549# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1935CONFIG_STACKTRACE=y
1936# CONFIG_DEBUG_KOBJECT is not set 1550# CONFIG_DEBUG_KOBJECT is not set
1937# CONFIG_DEBUG_BUGVERBOSE is not set 1551# CONFIG_DEBUG_BUGVERBOSE is not set
1938# CONFIG_DEBUG_INFO is not set 1552CONFIG_DEBUG_INFO=y
1939# CONFIG_DEBUG_VM is not set 1553# CONFIG_DEBUG_VM is not set
1940# CONFIG_DEBUG_WRITECOUNT is not set 1554# CONFIG_DEBUG_WRITECOUNT is not set
1941# CONFIG_DEBUG_MEMORY_INIT is not set 1555# CONFIG_DEBUG_MEMORY_INIT is not set
@@ -1950,30 +1564,20 @@ CONFIG_FRAME_POINTER=y
1950# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 1564# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1951# CONFIG_FAULT_INJECTION is not set 1565# CONFIG_FAULT_INJECTION is not set
1952# CONFIG_LATENCYTOP is not set 1566# CONFIG_LATENCYTOP is not set
1953CONFIG_NOP_TRACER=y 1567# CONFIG_PAGE_POISONING is not set
1954CONFIG_HAVE_FUNCTION_TRACER=y 1568CONFIG_HAVE_FUNCTION_TRACER=y
1955CONFIG_RING_BUFFER=y 1569CONFIG_TRACING_SUPPORT=y
1956CONFIG_TRACING=y 1570# CONFIG_FTRACE is not set
1957 1571# CONFIG_DYNAMIC_DEBUG is not set
1958#
1959# Tracers
1960#
1961# CONFIG_FUNCTION_TRACER is not set
1962# CONFIG_IRQSOFF_TRACER is not set
1963# CONFIG_SCHED_TRACER is not set
1964# CONFIG_CONTEXT_SWITCH_TRACER is not set
1965# CONFIG_BOOT_TRACER is not set
1966# CONFIG_TRACE_BRANCH_PROFILING is not set
1967# CONFIG_STACK_TRACER is not set
1968# CONFIG_FTRACE_STARTUP_TEST is not set
1969# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
1970# CONFIG_SAMPLES is not set 1572# CONFIG_SAMPLES is not set
1971CONFIG_HAVE_ARCH_KGDB=y 1573CONFIG_HAVE_ARCH_KGDB=y
1972# CONFIG_KGDB is not set 1574# CONFIG_KGDB is not set
1575# CONFIG_ARM_UNWIND is not set
1973# CONFIG_DEBUG_USER is not set 1576# CONFIG_DEBUG_USER is not set
1974# CONFIG_DEBUG_ERRORS is not set 1577# CONFIG_DEBUG_ERRORS is not set
1975# CONFIG_DEBUG_STACK_USAGE is not set 1578# CONFIG_DEBUG_STACK_USAGE is not set
1976# CONFIG_DEBUG_LL is not set 1579CONFIG_DEBUG_LL=y
1580# CONFIG_DEBUG_ICEDCC is not set
1977 1581
1978# 1582#
1979# Security options 1583# Security options
@@ -1982,10 +1586,6 @@ CONFIG_HAVE_ARCH_KGDB=y
1982# CONFIG_SECURITY is not set 1586# CONFIG_SECURITY is not set
1983# CONFIG_SECURITYFS is not set 1587# CONFIG_SECURITYFS is not set
1984# CONFIG_SECURITY_FILE_CAPABILITIES is not set 1588# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1985CONFIG_XOR_BLOCKS=m
1986CONFIG_ASYNC_CORE=m
1987CONFIG_ASYNC_MEMCPY=m
1988CONFIG_ASYNC_XOR=m
1989CONFIG_CRYPTO=y 1589CONFIG_CRYPTO=y
1990 1590
1991# 1591#
@@ -2000,13 +1600,15 @@ CONFIG_CRYPTO_BLKCIPHER2=y
2000CONFIG_CRYPTO_HASH=y 1600CONFIG_CRYPTO_HASH=y
2001CONFIG_CRYPTO_HASH2=y 1601CONFIG_CRYPTO_HASH2=y
2002CONFIG_CRYPTO_RNG2=y 1602CONFIG_CRYPTO_RNG2=y
1603CONFIG_CRYPTO_PCOMP=y
2003CONFIG_CRYPTO_MANAGER=y 1604CONFIG_CRYPTO_MANAGER=y
2004CONFIG_CRYPTO_MANAGER2=y 1605CONFIG_CRYPTO_MANAGER2=y
2005CONFIG_CRYPTO_GF128MUL=m 1606# CONFIG_CRYPTO_GF128MUL is not set
2006CONFIG_CRYPTO_NULL=m 1607# CONFIG_CRYPTO_NULL is not set
2007CONFIG_CRYPTO_CRYPTD=m 1608CONFIG_CRYPTO_WORKQUEUE=y
1609# CONFIG_CRYPTO_CRYPTD is not set
2008# CONFIG_CRYPTO_AUTHENC is not set 1610# CONFIG_CRYPTO_AUTHENC is not set
2009CONFIG_CRYPTO_TEST=m 1611# CONFIG_CRYPTO_TEST is not set
2010 1612
2011# 1613#
2012# Authenticated Encryption with Associated Data 1614# Authenticated Encryption with Associated Data
@@ -2021,58 +1623,58 @@ CONFIG_CRYPTO_TEST=m
2021CONFIG_CRYPTO_CBC=y 1623CONFIG_CRYPTO_CBC=y
2022# CONFIG_CRYPTO_CTR is not set 1624# CONFIG_CRYPTO_CTR is not set
2023# CONFIG_CRYPTO_CTS is not set 1625# CONFIG_CRYPTO_CTS is not set
2024CONFIG_CRYPTO_ECB=y 1626CONFIG_CRYPTO_ECB=m
2025CONFIG_CRYPTO_LRW=m 1627# CONFIG_CRYPTO_LRW is not set
2026CONFIG_CRYPTO_PCBC=m 1628CONFIG_CRYPTO_PCBC=m
2027# CONFIG_CRYPTO_XTS is not set 1629# CONFIG_CRYPTO_XTS is not set
2028 1630
2029# 1631#
2030# Hash modes 1632# Hash modes
2031# 1633#
2032CONFIG_CRYPTO_HMAC=m 1634# CONFIG_CRYPTO_HMAC is not set
2033CONFIG_CRYPTO_XCBC=m 1635# CONFIG_CRYPTO_XCBC is not set
2034 1636
2035# 1637#
2036# Digest 1638# Digest
2037# 1639#
2038CONFIG_CRYPTO_CRC32C=y 1640CONFIG_CRYPTO_CRC32C=y
2039CONFIG_CRYPTO_MD4=m 1641# CONFIG_CRYPTO_MD4 is not set
2040CONFIG_CRYPTO_MD5=y 1642CONFIG_CRYPTO_MD5=y
2041CONFIG_CRYPTO_MICHAEL_MIC=y 1643# CONFIG_CRYPTO_MICHAEL_MIC is not set
2042# CONFIG_CRYPTO_RMD128 is not set 1644# CONFIG_CRYPTO_RMD128 is not set
2043# CONFIG_CRYPTO_RMD160 is not set 1645# CONFIG_CRYPTO_RMD160 is not set
2044# CONFIG_CRYPTO_RMD256 is not set 1646# CONFIG_CRYPTO_RMD256 is not set
2045# CONFIG_CRYPTO_RMD320 is not set 1647# CONFIG_CRYPTO_RMD320 is not set
2046CONFIG_CRYPTO_SHA1=m 1648# CONFIG_CRYPTO_SHA1 is not set
2047CONFIG_CRYPTO_SHA256=m 1649# CONFIG_CRYPTO_SHA256 is not set
2048CONFIG_CRYPTO_SHA512=m 1650# CONFIG_CRYPTO_SHA512 is not set
2049CONFIG_CRYPTO_TGR192=m 1651# CONFIG_CRYPTO_TGR192 is not set
2050CONFIG_CRYPTO_WP512=m 1652# CONFIG_CRYPTO_WP512 is not set
2051 1653
2052# 1654#
2053# Ciphers 1655# Ciphers
2054# 1656#
2055CONFIG_CRYPTO_AES=y 1657# CONFIG_CRYPTO_AES is not set
2056CONFIG_CRYPTO_ANUBIS=m 1658# CONFIG_CRYPTO_ANUBIS is not set
2057CONFIG_CRYPTO_ARC4=y 1659# CONFIG_CRYPTO_ARC4 is not set
2058CONFIG_CRYPTO_BLOWFISH=m 1660# CONFIG_CRYPTO_BLOWFISH is not set
2059CONFIG_CRYPTO_CAMELLIA=m 1661# CONFIG_CRYPTO_CAMELLIA is not set
2060CONFIG_CRYPTO_CAST5=m 1662# CONFIG_CRYPTO_CAST5 is not set
2061CONFIG_CRYPTO_CAST6=m 1663# CONFIG_CRYPTO_CAST6 is not set
2062CONFIG_CRYPTO_DES=y 1664CONFIG_CRYPTO_DES=y
2063CONFIG_CRYPTO_FCRYPT=m 1665# CONFIG_CRYPTO_FCRYPT is not set
2064CONFIG_CRYPTO_KHAZAD=m 1666# CONFIG_CRYPTO_KHAZAD is not set
2065# CONFIG_CRYPTO_SALSA20 is not set 1667# CONFIG_CRYPTO_SALSA20 is not set
2066# CONFIG_CRYPTO_SEED is not set 1668# CONFIG_CRYPTO_SEED is not set
2067CONFIG_CRYPTO_SERPENT=m 1669# CONFIG_CRYPTO_SERPENT is not set
2068CONFIG_CRYPTO_TEA=m 1670# CONFIG_CRYPTO_TEA is not set
2069CONFIG_CRYPTO_TWOFISH=m 1671# CONFIG_CRYPTO_TWOFISH is not set
2070CONFIG_CRYPTO_TWOFISH_COMMON=m
2071 1672
2072# 1673#
2073# Compression 1674# Compression
2074# 1675#
2075CONFIG_CRYPTO_DEFLATE=m 1676# CONFIG_CRYPTO_DEFLATE is not set
1677# CONFIG_CRYPTO_ZLIB is not set
2076# CONFIG_CRYPTO_LZO is not set 1678# CONFIG_CRYPTO_LZO is not set
2077 1679
2078# 1680#
@@ -2080,6 +1682,7 @@ CONFIG_CRYPTO_DEFLATE=m
2080# 1682#
2081# CONFIG_CRYPTO_ANSI_CPRNG is not set 1683# CONFIG_CRYPTO_ANSI_CPRNG is not set
2082CONFIG_CRYPTO_HW=y 1684CONFIG_CRYPTO_HW=y
1685# CONFIG_BINARY_PRINTF is not set
2083 1686
2084# 1687#
2085# Library routines 1688# Library routines
@@ -2087,17 +1690,16 @@ CONFIG_CRYPTO_HW=y
2087CONFIG_BITREVERSE=y 1690CONFIG_BITREVERSE=y
2088CONFIG_GENERIC_FIND_LAST_BIT=y 1691CONFIG_GENERIC_FIND_LAST_BIT=y
2089CONFIG_CRC_CCITT=y 1692CONFIG_CRC_CCITT=y
2090CONFIG_CRC16=m 1693# CONFIG_CRC16 is not set
2091CONFIG_CRC_T10DIF=y 1694# CONFIG_CRC_T10DIF is not set
2092CONFIG_CRC_ITU_T=y 1695# CONFIG_CRC_ITU_T is not set
2093CONFIG_CRC32=y 1696CONFIG_CRC32=y
2094CONFIG_CRC7=y 1697# CONFIG_CRC7 is not set
2095CONFIG_LIBCRC32C=y 1698CONFIG_LIBCRC32C=y
2096CONFIG_ZLIB_INFLATE=y 1699CONFIG_ZLIB_INFLATE=y
2097CONFIG_ZLIB_DEFLATE=y 1700CONFIG_ZLIB_DEFLATE=y
2098CONFIG_LZO_COMPRESS=y 1701CONFIG_DECOMPRESS_GZIP=y
2099CONFIG_LZO_DECOMPRESS=y
2100CONFIG_PLIST=y
2101CONFIG_HAS_IOMEM=y 1702CONFIG_HAS_IOMEM=y
2102CONFIG_HAS_IOPORT=y 1703CONFIG_HAS_IOPORT=y
2103CONFIG_HAS_DMA=y 1704CONFIG_HAS_DMA=y
1705CONFIG_NLATTR=y
diff --git a/arch/arm/configs/omap_3630sdp_defconfig b/arch/arm/configs/omap_3630sdp_defconfig
new file mode 100644
index 000000000000..e836c8a00148
--- /dev/null
+++ b/arch/arm/configs/omap_3630sdp_defconfig
@@ -0,0 +1,1611 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.32-rc6
4# Thu Nov 12 12:21:37 2009
5#
6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y
9CONFIG_GENERIC_TIME=y
10CONFIG_GENERIC_CLOCKEVENTS=y
11CONFIG_GENERIC_HARDIRQS=y
12CONFIG_STACKTRACE_SUPPORT=y
13CONFIG_HAVE_LATENCYTOP_SUPPORT=y
14CONFIG_LOCKDEP_SUPPORT=y
15CONFIG_TRACE_IRQFLAGS_SUPPORT=y
16CONFIG_HARDIRQS_SW_RESEND=y
17CONFIG_GENERIC_IRQ_PROBE=y
18CONFIG_RWSEM_GENERIC_SPINLOCK=y
19CONFIG_ARCH_HAS_CPUFREQ=y
20CONFIG_GENERIC_HWEIGHT=y
21CONFIG_GENERIC_CALIBRATE_DELAY=y
22CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
23CONFIG_VECTORS_BASE=0xffff0000
24CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
25CONFIG_CONSTRUCTORS=y
26
27#
28# General setup
29#
30CONFIG_EXPERIMENTAL=y
31CONFIG_BROKEN_ON_SMP=y
32CONFIG_INIT_ENV_ARG_LIMIT=32
33CONFIG_LOCALVERSION=""
34CONFIG_LOCALVERSION_AUTO=y
35CONFIG_SWAP=y
36CONFIG_SYSVIPC=y
37CONFIG_SYSVIPC_SYSCTL=y
38# CONFIG_POSIX_MQUEUE is not set
39CONFIG_BSD_PROCESS_ACCT=y
40# CONFIG_BSD_PROCESS_ACCT_V3 is not set
41# CONFIG_TASKSTATS is not set
42# CONFIG_AUDIT is not set
43
44#
45# RCU Subsystem
46#
47CONFIG_TREE_RCU=y
48# CONFIG_TREE_PREEMPT_RCU is not set
49# CONFIG_RCU_TRACE is not set
50CONFIG_RCU_FANOUT=32
51# CONFIG_RCU_FANOUT_EXACT is not set
52# CONFIG_TREE_RCU_TRACE is not set
53# CONFIG_IKCONFIG is not set
54CONFIG_LOG_BUF_SHIFT=14
55CONFIG_GROUP_SCHED=y
56CONFIG_FAIR_GROUP_SCHED=y
57# CONFIG_RT_GROUP_SCHED is not set
58CONFIG_USER_SCHED=y
59# CONFIG_CGROUP_SCHED is not set
60# CONFIG_CGROUPS is not set
61# CONFIG_SYSFS_DEPRECATED_V2 is not set
62# CONFIG_RELAY is not set
63# CONFIG_NAMESPACES is not set
64CONFIG_BLK_DEV_INITRD=y
65CONFIG_INITRAMFS_SOURCE=""
66CONFIG_RD_GZIP=y
67# CONFIG_RD_BZIP2 is not set
68# CONFIG_RD_LZMA is not set
69CONFIG_CC_OPTIMIZE_FOR_SIZE=y
70CONFIG_SYSCTL=y
71CONFIG_ANON_INODES=y
72CONFIG_EMBEDDED=y
73CONFIG_UID16=y
74# CONFIG_SYSCTL_SYSCALL is not set
75CONFIG_KALLSYMS=y
76# CONFIG_KALLSYMS_ALL is not set
77CONFIG_KALLSYMS_EXTRA_PASS=y
78CONFIG_HOTPLUG=y
79CONFIG_PRINTK=y
80CONFIG_BUG=y
81CONFIG_ELF_CORE=y
82CONFIG_BASE_FULL=y
83CONFIG_FUTEX=y
84CONFIG_EPOLL=y
85CONFIG_SIGNALFD=y
86CONFIG_TIMERFD=y
87CONFIG_EVENTFD=y
88CONFIG_SHMEM=y
89CONFIG_AIO=y
90
91#
92# Kernel Performance Events And Counters
93#
94CONFIG_VM_EVENT_COUNTERS=y
95CONFIG_COMPAT_BRK=y
96CONFIG_SLAB=y
97# CONFIG_SLUB is not set
98# CONFIG_SLOB is not set
99# CONFIG_PROFILING is not set
100CONFIG_HAVE_OPROFILE=y
101# CONFIG_KPROBES is not set
102CONFIG_HAVE_KPROBES=y
103CONFIG_HAVE_KRETPROBES=y
104CONFIG_HAVE_CLK=y
105
106#
107# GCOV-based kernel profiling
108#
109# CONFIG_SLOW_WORK is not set
110CONFIG_HAVE_GENERIC_DMA_COHERENT=y
111CONFIG_SLABINFO=y
112CONFIG_RT_MUTEXES=y
113CONFIG_BASE_SMALL=0
114CONFIG_MODULES=y
115# CONFIG_MODULE_FORCE_LOAD is not set
116CONFIG_MODULE_UNLOAD=y
117# CONFIG_MODULE_FORCE_UNLOAD is not set
118CONFIG_MODVERSIONS=y
119CONFIG_MODULE_SRCVERSION_ALL=y
120CONFIG_BLOCK=y
121CONFIG_LBDAF=y
122# CONFIG_BLK_DEV_BSG is not set
123# CONFIG_BLK_DEV_INTEGRITY is not set
124
125#
126# IO Schedulers
127#
128CONFIG_IOSCHED_NOOP=y
129CONFIG_IOSCHED_AS=y
130CONFIG_IOSCHED_DEADLINE=y
131CONFIG_IOSCHED_CFQ=y
132CONFIG_DEFAULT_AS=y
133# CONFIG_DEFAULT_DEADLINE is not set
134# CONFIG_DEFAULT_CFQ is not set
135# CONFIG_DEFAULT_NOOP is not set
136CONFIG_DEFAULT_IOSCHED="anticipatory"
137CONFIG_FREEZER=y
138
139#
140# System Type
141#
142CONFIG_MMU=y
143# CONFIG_ARCH_AAEC2000 is not set
144# CONFIG_ARCH_INTEGRATOR is not set
145# CONFIG_ARCH_REALVIEW is not set
146# CONFIG_ARCH_VERSATILE is not set
147# CONFIG_ARCH_AT91 is not set
148# CONFIG_ARCH_CLPS711X is not set
149# CONFIG_ARCH_GEMINI is not set
150# CONFIG_ARCH_EBSA110 is not set
151# CONFIG_ARCH_EP93XX is not set
152# CONFIG_ARCH_FOOTBRIDGE is not set
153# CONFIG_ARCH_MXC is not set
154# CONFIG_ARCH_STMP3XXX is not set
155# CONFIG_ARCH_NETX is not set
156# CONFIG_ARCH_H720X is not set
157# CONFIG_ARCH_NOMADIK is not set
158# CONFIG_ARCH_IOP13XX is not set
159# CONFIG_ARCH_IOP32X is not set
160# CONFIG_ARCH_IOP33X is not set
161# CONFIG_ARCH_IXP23XX is not set
162# CONFIG_ARCH_IXP2000 is not set
163# CONFIG_ARCH_IXP4XX is not set
164# CONFIG_ARCH_L7200 is not set
165# CONFIG_ARCH_KIRKWOOD is not set
166# CONFIG_ARCH_LOKI is not set
167# CONFIG_ARCH_MV78XX0 is not set
168# CONFIG_ARCH_ORION5X is not set
169# CONFIG_ARCH_MMP is not set
170# CONFIG_ARCH_KS8695 is not set
171# CONFIG_ARCH_NS9XXX is not set
172# CONFIG_ARCH_W90X900 is not set
173# CONFIG_ARCH_PNX4008 is not set
174# CONFIG_ARCH_PXA is not set
175# CONFIG_ARCH_MSM is not set
176# CONFIG_ARCH_RPC is not set
177# CONFIG_ARCH_SA1100 is not set
178# CONFIG_ARCH_S3C2410 is not set
179# CONFIG_ARCH_S3C64XX is not set
180# CONFIG_ARCH_S5PC1XX is not set
181# CONFIG_ARCH_SHARK is not set
182# CONFIG_ARCH_LH7A40X is not set
183# CONFIG_ARCH_U300 is not set
184# CONFIG_ARCH_DAVINCI is not set
185CONFIG_ARCH_OMAP=y
186# CONFIG_ARCH_BCMRING is not set
187
188#
189# TI OMAP Implementations
190#
191CONFIG_ARCH_OMAP_OTG=y
192# CONFIG_ARCH_OMAP1 is not set
193# CONFIG_ARCH_OMAP2 is not set
194CONFIG_ARCH_OMAP3=y
195# CONFIG_ARCH_OMAP4 is not set
196
197#
198# OMAP Feature Selections
199#
200# CONFIG_OMAP_DEBUG_POWERDOMAIN is not set
201# CONFIG_OMAP_DEBUG_CLOCKDOMAIN is not set
202# CONFIG_OMAP_RESET_CLOCKS is not set
203CONFIG_OMAP_MUX=y
204CONFIG_OMAP_MUX_DEBUG=y
205CONFIG_OMAP_MUX_WARNINGS=y
206CONFIG_OMAP_MCBSP=y
207# CONFIG_OMAP_MBOX_FWK is not set
208# CONFIG_OMAP_MPU_TIMER is not set
209CONFIG_OMAP_32K_TIMER=y
210CONFIG_OMAP_32K_TIMER_HZ=128
211CONFIG_OMAP_DM_TIMER=y
212CONFIG_OMAP_LL_DEBUG_UART1=y
213# CONFIG_OMAP_LL_DEBUG_UART2 is not set
214# CONFIG_OMAP_LL_DEBUG_UART3 is not set
215# CONFIG_OMAP_LL_DEBUG_NONE is not set
216# CONFIG_OMAP_PM_NONE is not set
217CONFIG_OMAP_PM_NOOP=y
218CONFIG_ARCH_OMAP34XX=y
219CONFIG_ARCH_OMAP3430=y
220
221#
222# OMAP Board Type
223#
224# CONFIG_MACH_OMAP3_BEAGLE is not set
225# CONFIG_MACH_OMAP_LDP is not set
226# CONFIG_MACH_OVERO is not set
227# CONFIG_MACH_OMAP3EVM is not set
228# CONFIG_MACH_OMAP3_PANDORA is not set
229# CONFIG_MACH_OMAP_3430SDP is not set
230# CONFIG_MACH_NOKIA_RX51 is not set
231# CONFIG_MACH_OMAP_ZOOM2 is not set
232# CONFIG_MACH_CM_T35 is not set
233# CONFIG_MACH_OMAP_ZOOM3 is not set
234CONFIG_MACH_OMAP_3630SDP=y
235
236#
237# Processor Type
238#
239CONFIG_CPU_32=y
240CONFIG_CPU_32v6K=y
241CONFIG_CPU_V7=y
242CONFIG_CPU_32v7=y
243CONFIG_CPU_ABRT_EV7=y
244CONFIG_CPU_PABRT_V7=y
245CONFIG_CPU_CACHE_V7=y
246CONFIG_CPU_CACHE_VIPT=y
247CONFIG_CPU_COPY_V6=y
248CONFIG_CPU_TLB_V7=y
249CONFIG_CPU_HAS_ASID=y
250CONFIG_CPU_CP15=y
251CONFIG_CPU_CP15_MMU=y
252
253#
254# Processor Features
255#
256CONFIG_ARM_THUMB=y
257# CONFIG_ARM_THUMBEE is not set
258# CONFIG_CPU_ICACHE_DISABLE is not set
259# CONFIG_CPU_DCACHE_DISABLE is not set
260# CONFIG_CPU_BPREDICT_DISABLE is not set
261CONFIG_HAS_TLS_REG=y
262CONFIG_ARM_L1_CACHE_SHIFT=6
263# CONFIG_ARM_ERRATA_430973 is not set
264# CONFIG_ARM_ERRATA_458693 is not set
265# CONFIG_ARM_ERRATA_460075 is not set
266CONFIG_COMMON_CLKDEV=y
267
268#
269# Bus support
270#
271# CONFIG_PCI_SYSCALL is not set
272# CONFIG_ARCH_SUPPORTS_MSI is not set
273# CONFIG_PCCARD is not set
274
275#
276# Kernel Features
277#
278CONFIG_TICK_ONESHOT=y
279CONFIG_NO_HZ=y
280CONFIG_HIGH_RES_TIMERS=y
281CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
282CONFIG_VMSPLIT_3G=y
283# CONFIG_VMSPLIT_2G is not set
284# CONFIG_VMSPLIT_1G is not set
285CONFIG_PAGE_OFFSET=0xC0000000
286CONFIG_PREEMPT_NONE=y
287# CONFIG_PREEMPT_VOLUNTARY is not set
288# CONFIG_PREEMPT is not set
289CONFIG_HZ=128
290# CONFIG_THUMB2_KERNEL is not set
291CONFIG_AEABI=y
292CONFIG_OABI_COMPAT=y
293# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
294# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
295# CONFIG_HIGHMEM is not set
296CONFIG_SELECT_MEMORY_MODEL=y
297CONFIG_FLATMEM_MANUAL=y
298# CONFIG_DISCONTIGMEM_MANUAL is not set
299# CONFIG_SPARSEMEM_MANUAL is not set
300CONFIG_FLATMEM=y
301CONFIG_FLAT_NODE_MEM_MAP=y
302CONFIG_PAGEFLAGS_EXTENDED=y
303CONFIG_SPLIT_PTLOCK_CPUS=4
304# CONFIG_PHYS_ADDR_T_64BIT is not set
305CONFIG_ZONE_DMA_FLAG=0
306CONFIG_VIRT_TO_BUS=y
307CONFIG_HAVE_MLOCK=y
308CONFIG_HAVE_MLOCKED_PAGE_BIT=y
309# CONFIG_KSM is not set
310CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
311# CONFIG_LEDS is not set
312CONFIG_ALIGNMENT_TRAP=y
313# CONFIG_UACCESS_WITH_MEMCPY is not set
314
315#
316# Boot options
317#
318CONFIG_ZBOOT_ROM_TEXT=0x0
319CONFIG_ZBOOT_ROM_BSS=0x0
320CONFIG_CMDLINE="root=/dev/nfs nfsroot=192.168.0.1:/home/user/buildroot ip=192.168.0.2:192.168.0.1:192.168.0.1:255.255.255.0:tgt:eth0:off rw console=ttyS2,115200n8"
321# CONFIG_XIP_KERNEL is not set
322# CONFIG_KEXEC is not set
323
324#
325# CPU Power Management
326#
327# CONFIG_CPU_FREQ is not set
328# CONFIG_CPU_IDLE is not set
329
330#
331# Floating point emulation
332#
333
334#
335# At least one emulation must be selected
336#
337CONFIG_FPE_NWFPE=y
338# CONFIG_FPE_NWFPE_XP is not set
339# CONFIG_FPE_FASTFPE is not set
340CONFIG_VFP=y
341CONFIG_VFPv3=y
342# CONFIG_NEON is not set
343
344#
345# Userspace binary formats
346#
347CONFIG_BINFMT_ELF=y
348# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
349CONFIG_HAVE_AOUT=y
350# CONFIG_BINFMT_AOUT is not set
351CONFIG_BINFMT_MISC=y
352
353#
354# Power management options
355#
356CONFIG_PM=y
357CONFIG_PM_DEBUG=y
358CONFIG_PM_VERBOSE=y
359CONFIG_CAN_PM_TRACE=y
360CONFIG_PM_SLEEP=y
361CONFIG_SUSPEND=y
362# CONFIG_PM_TEST_SUSPEND is not set
363CONFIG_SUSPEND_FREEZER=y
364# CONFIG_APM_EMULATION is not set
365# CONFIG_PM_RUNTIME is not set
366CONFIG_ARCH_SUSPEND_POSSIBLE=y
367CONFIG_NET=y
368
369#
370# Networking options
371#
372CONFIG_PACKET=y
373# CONFIG_PACKET_MMAP is not set
374CONFIG_UNIX=y
375CONFIG_XFRM=y
376CONFIG_XFRM_USER=y
377# CONFIG_XFRM_SUB_POLICY is not set
378CONFIG_XFRM_MIGRATE=y
379# CONFIG_XFRM_STATISTICS is not set
380CONFIG_NET_KEY=y
381CONFIG_NET_KEY_MIGRATE=y
382CONFIG_INET=y
383CONFIG_IP_MULTICAST=y
384# CONFIG_IP_ADVANCED_ROUTER is not set
385CONFIG_IP_FIB_HASH=y
386CONFIG_IP_PNP=y
387CONFIG_IP_PNP_DHCP=y
388CONFIG_IP_PNP_BOOTP=y
389CONFIG_IP_PNP_RARP=y
390# CONFIG_NET_IPIP is not set
391# CONFIG_NET_IPGRE is not set
392# CONFIG_IP_MROUTE is not set
393# CONFIG_ARPD is not set
394# CONFIG_SYN_COOKIES is not set
395# CONFIG_INET_AH is not set
396# CONFIG_INET_ESP is not set
397# CONFIG_INET_IPCOMP is not set
398# CONFIG_INET_XFRM_TUNNEL is not set
399# CONFIG_INET_TUNNEL is not set
400CONFIG_INET_XFRM_MODE_TRANSPORT=y
401CONFIG_INET_XFRM_MODE_TUNNEL=y
402CONFIG_INET_XFRM_MODE_BEET=y
403# CONFIG_INET_LRO is not set
404CONFIG_INET_DIAG=y
405CONFIG_INET_TCP_DIAG=y
406# CONFIG_TCP_CONG_ADVANCED is not set
407CONFIG_TCP_CONG_CUBIC=y
408CONFIG_DEFAULT_TCP_CONG="cubic"
409# CONFIG_TCP_MD5SIG is not set
410# CONFIG_IPV6 is not set
411# CONFIG_NETWORK_SECMARK is not set
412# CONFIG_NETFILTER is not set
413# CONFIG_IP_DCCP is not set
414# CONFIG_IP_SCTP is not set
415# CONFIG_RDS is not set
416# CONFIG_TIPC is not set
417# CONFIG_ATM is not set
418# CONFIG_BRIDGE is not set
419# CONFIG_NET_DSA is not set
420# CONFIG_VLAN_8021Q is not set
421# CONFIG_DECNET is not set
422# CONFIG_LLC2 is not set
423# CONFIG_IPX is not set
424# CONFIG_ATALK is not set
425# CONFIG_X25 is not set
426# CONFIG_LAPB is not set
427# CONFIG_ECONET is not set
428# CONFIG_WAN_ROUTER is not set
429# CONFIG_PHONET is not set
430# CONFIG_IEEE802154 is not set
431# CONFIG_NET_SCHED is not set
432# CONFIG_DCB is not set
433
434#
435# Network testing
436#
437# CONFIG_NET_PKTGEN is not set
438# CONFIG_HAMRADIO is not set
439# CONFIG_CAN is not set
440# CONFIG_IRDA is not set
441# CONFIG_BT is not set
442# CONFIG_AF_RXRPC is not set
443# CONFIG_WIRELESS is not set
444# CONFIG_WIMAX is not set
445# CONFIG_RFKILL is not set
446# CONFIG_NET_9P is not set
447
448#
449# Device Drivers
450#
451
452#
453# Generic Driver Options
454#
455CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
456# CONFIG_DEVTMPFS is not set
457CONFIG_STANDALONE=y
458CONFIG_PREVENT_FIRMWARE_BUILD=y
459# CONFIG_FW_LOADER is not set
460# CONFIG_DEBUG_DRIVER is not set
461# CONFIG_DEBUG_DEVRES is not set
462# CONFIG_SYS_HYPERVISOR is not set
463CONFIG_CONNECTOR=y
464CONFIG_PROC_EVENTS=y
465# CONFIG_MTD is not set
466# CONFIG_PARPORT is not set
467CONFIG_BLK_DEV=y
468# CONFIG_BLK_DEV_COW_COMMON is not set
469CONFIG_BLK_DEV_LOOP=y
470# CONFIG_BLK_DEV_CRYPTOLOOP is not set
471# CONFIG_BLK_DEV_NBD is not set
472# CONFIG_BLK_DEV_UB is not set
473CONFIG_BLK_DEV_RAM=y
474CONFIG_BLK_DEV_RAM_COUNT=16
475CONFIG_BLK_DEV_RAM_SIZE=16384
476# CONFIG_BLK_DEV_XIP is not set
477# CONFIG_CDROM_PKTCDVD is not set
478# CONFIG_ATA_OVER_ETH is not set
479# CONFIG_MG_DISK is not set
480CONFIG_MISC_DEVICES=y
481# CONFIG_ICS932S401 is not set
482# CONFIG_ENCLOSURE_SERVICES is not set
483# CONFIG_ISL29003 is not set
484# CONFIG_C2PORT is not set
485
486#
487# EEPROM support
488#
489# CONFIG_EEPROM_AT24 is not set
490# CONFIG_EEPROM_AT25 is not set
491# CONFIG_EEPROM_LEGACY is not set
492# CONFIG_EEPROM_MAX6875 is not set
493# CONFIG_EEPROM_93CX6 is not set
494CONFIG_HAVE_IDE=y
495# CONFIG_IDE is not set
496
497#
498# SCSI device support
499#
500# CONFIG_RAID_ATTRS is not set
501CONFIG_SCSI=y
502CONFIG_SCSI_DMA=y
503# CONFIG_SCSI_TGT is not set
504# CONFIG_SCSI_NETLINK is not set
505CONFIG_SCSI_PROC_FS=y
506
507#
508# SCSI support type (disk, tape, CD-ROM)
509#
510CONFIG_BLK_DEV_SD=y
511# CONFIG_CHR_DEV_ST is not set
512# CONFIG_CHR_DEV_OSST is not set
513# CONFIG_BLK_DEV_SR is not set
514# CONFIG_CHR_DEV_SG is not set
515# CONFIG_CHR_DEV_SCH is not set
516# CONFIG_SCSI_MULTI_LUN is not set
517# CONFIG_SCSI_CONSTANTS is not set
518# CONFIG_SCSI_LOGGING is not set
519# CONFIG_SCSI_SCAN_ASYNC is not set
520CONFIG_SCSI_WAIT_SCAN=m
521
522#
523# SCSI Transports
524#
525# CONFIG_SCSI_SPI_ATTRS is not set
526# CONFIG_SCSI_FC_ATTRS is not set
527# CONFIG_SCSI_ISCSI_ATTRS is not set
528# CONFIG_SCSI_SAS_LIBSAS is not set
529# CONFIG_SCSI_SRP_ATTRS is not set
530CONFIG_SCSI_LOWLEVEL=y
531# CONFIG_ISCSI_TCP is not set
532# CONFIG_LIBFC is not set
533# CONFIG_LIBFCOE is not set
534# CONFIG_SCSI_DEBUG is not set
535# CONFIG_SCSI_DH is not set
536# CONFIG_SCSI_OSD_INITIATOR is not set
537# CONFIG_ATA is not set
538# CONFIG_MD is not set
539CONFIG_NETDEVICES=y
540# CONFIG_DUMMY is not set
541# CONFIG_BONDING is not set
542# CONFIG_MACVLAN is not set
543# CONFIG_EQUALIZER is not set
544# CONFIG_TUN is not set
545# CONFIG_VETH is not set
546CONFIG_PHYLIB=y
547
548#
549# MII PHY device drivers
550#
551# CONFIG_MARVELL_PHY is not set
552# CONFIG_DAVICOM_PHY is not set
553# CONFIG_QSEMI_PHY is not set
554# CONFIG_LXT_PHY is not set
555# CONFIG_CICADA_PHY is not set
556# CONFIG_VITESSE_PHY is not set
557CONFIG_SMSC_PHY=y
558# CONFIG_BROADCOM_PHY is not set
559# CONFIG_ICPLUS_PHY is not set
560# CONFIG_REALTEK_PHY is not set
561# CONFIG_NATIONAL_PHY is not set
562# CONFIG_STE10XP is not set
563# CONFIG_LSI_ET1011C_PHY is not set
564# CONFIG_FIXED_PHY is not set
565# CONFIG_MDIO_BITBANG is not set
566CONFIG_NET_ETHERNET=y
567CONFIG_MII=y
568# CONFIG_AX88796 is not set
569CONFIG_SMC91X=y
570# CONFIG_DM9000 is not set
571# CONFIG_ENC28J60 is not set
572# CONFIG_ETHOC is not set
573# CONFIG_SMC911X is not set
574# CONFIG_SMSC911X is not set
575# CONFIG_DNET is not set
576# CONFIG_IBM_NEW_EMAC_ZMII is not set
577# CONFIG_IBM_NEW_EMAC_RGMII is not set
578# CONFIG_IBM_NEW_EMAC_TAH is not set
579# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
580# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
581# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
582# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
583# CONFIG_B44 is not set
584# CONFIG_KS8842 is not set
585# CONFIG_KS8851 is not set
586# CONFIG_KS8851_MLL is not set
587CONFIG_NETDEV_1000=y
588CONFIG_NETDEV_10000=y
589CONFIG_WLAN=y
590# CONFIG_WLAN_PRE80211 is not set
591# CONFIG_WLAN_80211 is not set
592
593#
594# Enable WiMAX (Networking options) to see the WiMAX drivers
595#
596
597#
598# USB Network Adapters
599#
600# CONFIG_USB_CATC is not set
601# CONFIG_USB_KAWETH is not set
602# CONFIG_USB_PEGASUS is not set
603# CONFIG_USB_RTL8150 is not set
604# CONFIG_USB_USBNET is not set
605# CONFIG_WAN is not set
606# CONFIG_PPP is not set
607# CONFIG_SLIP is not set
608# CONFIG_NETCONSOLE is not set
609# CONFIG_NETPOLL is not set
610# CONFIG_NET_POLL_CONTROLLER is not set
611# CONFIG_ISDN is not set
612# CONFIG_PHONE is not set
613
614#
615# Input device support
616#
617CONFIG_INPUT=y
618# CONFIG_INPUT_FF_MEMLESS is not set
619# CONFIG_INPUT_POLLDEV is not set
620
621#
622# Userland interfaces
623#
624# CONFIG_INPUT_MOUSEDEV is not set
625# CONFIG_INPUT_JOYDEV is not set
626CONFIG_INPUT_EVDEV=y
627# CONFIG_INPUT_EVBUG is not set
628
629#
630# Input Device Drivers
631#
632# CONFIG_INPUT_KEYBOARD is not set
633# CONFIG_INPUT_MOUSE is not set
634# CONFIG_INPUT_JOYSTICK is not set
635# CONFIG_INPUT_TABLET is not set
636CONFIG_INPUT_TOUCHSCREEN=y
637CONFIG_TOUCHSCREEN_ADS7846=y
638# CONFIG_TOUCHSCREEN_AD7877 is not set
639# CONFIG_TOUCHSCREEN_AD7879_I2C is not set
640# CONFIG_TOUCHSCREEN_AD7879_SPI is not set
641# CONFIG_TOUCHSCREEN_AD7879 is not set
642# CONFIG_TOUCHSCREEN_EETI is not set
643# CONFIG_TOUCHSCREEN_FUJITSU is not set
644# CONFIG_TOUCHSCREEN_GUNZE is not set
645# CONFIG_TOUCHSCREEN_ELO is not set
646# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
647# CONFIG_TOUCHSCREEN_MCS5000 is not set
648# CONFIG_TOUCHSCREEN_MTOUCH is not set
649# CONFIG_TOUCHSCREEN_INEXIO is not set
650# CONFIG_TOUCHSCREEN_MK712 is not set
651# CONFIG_TOUCHSCREEN_PENMOUNT is not set
652# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
653# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
654# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
655# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
656# CONFIG_TOUCHSCREEN_TSC2007 is not set
657# CONFIG_TOUCHSCREEN_W90X900 is not set
658# CONFIG_INPUT_MISC is not set
659
660#
661# Hardware I/O ports
662#
663# CONFIG_SERIO is not set
664# CONFIG_GAMEPORT is not set
665
666#
667# Character devices
668#
669CONFIG_VT=y
670CONFIG_CONSOLE_TRANSLATIONS=y
671CONFIG_VT_CONSOLE=y
672CONFIG_HW_CONSOLE=y
673# CONFIG_VT_HW_CONSOLE_BINDING is not set
674CONFIG_DEVKMEM=y
675# CONFIG_SERIAL_NONSTANDARD is not set
676
677#
678# Serial drivers
679#
680CONFIG_SERIAL_8250=y
681CONFIG_SERIAL_8250_CONSOLE=y
682CONFIG_SERIAL_8250_NR_UARTS=32
683CONFIG_SERIAL_8250_RUNTIME_UARTS=4
684CONFIG_SERIAL_8250_EXTENDED=y
685CONFIG_SERIAL_8250_MANY_PORTS=y
686CONFIG_SERIAL_8250_SHARE_IRQ=y
687CONFIG_SERIAL_8250_DETECT_IRQ=y
688CONFIG_SERIAL_8250_RSA=y
689
690#
691# Non-8250 serial port support
692#
693# CONFIG_SERIAL_MAX3100 is not set
694CONFIG_SERIAL_CORE=y
695CONFIG_SERIAL_CORE_CONSOLE=y
696CONFIG_UNIX98_PTYS=y
697# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
698# CONFIG_LEGACY_PTYS is not set
699# CONFIG_IPMI_HANDLER is not set
700CONFIG_HW_RANDOM=y
701# CONFIG_HW_RANDOM_TIMERIOMEM is not set
702# CONFIG_R3964 is not set
703# CONFIG_RAW_DRIVER is not set
704# CONFIG_TCG_TPM is not set
705CONFIG_I2C=y
706CONFIG_I2C_BOARDINFO=y
707CONFIG_I2C_COMPAT=y
708CONFIG_I2C_CHARDEV=y
709CONFIG_I2C_HELPER_AUTO=y
710
711#
712# I2C Hardware Bus support
713#
714
715#
716# I2C system bus drivers (mostly embedded / system-on-chip)
717#
718# CONFIG_I2C_DESIGNWARE is not set
719# CONFIG_I2C_GPIO is not set
720# CONFIG_I2C_OCORES is not set
721CONFIG_I2C_OMAP=y
722# CONFIG_I2C_SIMTEC is not set
723
724#
725# External I2C/SMBus adapter drivers
726#
727# CONFIG_I2C_PARPORT_LIGHT is not set
728# CONFIG_I2C_TAOS_EVM is not set
729# CONFIG_I2C_TINY_USB is not set
730
731#
732# Other I2C/SMBus bus drivers
733#
734# CONFIG_I2C_PCA_PLATFORM is not set
735# CONFIG_I2C_STUB is not set
736
737#
738# Miscellaneous I2C Chip support
739#
740# CONFIG_DS1682 is not set
741# CONFIG_SENSORS_TSL2550 is not set
742# CONFIG_I2C_DEBUG_CORE is not set
743# CONFIG_I2C_DEBUG_ALGO is not set
744# CONFIG_I2C_DEBUG_BUS is not set
745# CONFIG_I2C_DEBUG_CHIP is not set
746CONFIG_SPI=y
747# CONFIG_SPI_DEBUG is not set
748CONFIG_SPI_MASTER=y
749
750#
751# SPI Master Controller Drivers
752#
753# CONFIG_SPI_BITBANG is not set
754# CONFIG_SPI_GPIO is not set
755CONFIG_SPI_OMAP24XX=y
756
757#
758# SPI Protocol Masters
759#
760# CONFIG_SPI_SPIDEV is not set
761# CONFIG_SPI_TLE62X0 is not set
762
763#
764# PPS support
765#
766# CONFIG_PPS is not set
767CONFIG_ARCH_REQUIRE_GPIOLIB=y
768CONFIG_GPIOLIB=y
769# CONFIG_DEBUG_GPIO is not set
770# CONFIG_GPIO_SYSFS is not set
771
772#
773# Memory mapped GPIO expanders:
774#
775
776#
777# I2C GPIO expanders:
778#
779# CONFIG_GPIO_MAX732X is not set
780# CONFIG_GPIO_PCA953X is not set
781# CONFIG_GPIO_PCF857X is not set
782CONFIG_GPIO_TWL4030=y
783
784#
785# PCI GPIO expanders:
786#
787
788#
789# SPI GPIO expanders:
790#
791# CONFIG_GPIO_MAX7301 is not set
792# CONFIG_GPIO_MCP23S08 is not set
793# CONFIG_GPIO_MC33880 is not set
794
795#
796# AC97 GPIO expanders:
797#
798CONFIG_W1=y
799CONFIG_W1_CON=y
800
801#
802# 1-wire Bus Masters
803#
804# CONFIG_W1_MASTER_DS2490 is not set
805# CONFIG_W1_MASTER_DS2482 is not set
806# CONFIG_W1_MASTER_DS1WM is not set
807# CONFIG_W1_MASTER_GPIO is not set
808# CONFIG_HDQ_MASTER_OMAP is not set
809
810#
811# 1-wire Slaves
812#
813# CONFIG_W1_SLAVE_THERM is not set
814# CONFIG_W1_SLAVE_SMEM is not set
815# CONFIG_W1_SLAVE_DS2431 is not set
816# CONFIG_W1_SLAVE_DS2433 is not set
817# CONFIG_W1_SLAVE_DS2760 is not set
818# CONFIG_W1_SLAVE_BQ27000 is not set
819CONFIG_POWER_SUPPLY=y
820# CONFIG_POWER_SUPPLY_DEBUG is not set
821# CONFIG_PDA_POWER is not set
822# CONFIG_BATTERY_DS2760 is not set
823# CONFIG_BATTERY_DS2782 is not set
824# CONFIG_BATTERY_BQ27x00 is not set
825# CONFIG_BATTERY_MAX17040 is not set
826# CONFIG_HWMON is not set
827# CONFIG_THERMAL is not set
828CONFIG_WATCHDOG=y
829CONFIG_WATCHDOG_NOWAYOUT=y
830
831#
832# Watchdog Device Drivers
833#
834# CONFIG_SOFT_WATCHDOG is not set
835# CONFIG_OMAP_WATCHDOG is not set
836# CONFIG_TWL4030_WATCHDOG is not set
837
838#
839# USB-based Watchdog Cards
840#
841# CONFIG_USBPCWATCHDOG is not set
842CONFIG_SSB_POSSIBLE=y
843
844#
845# Sonics Silicon Backplane
846#
847# CONFIG_SSB is not set
848
849#
850# Multifunction device drivers
851#
852# CONFIG_MFD_CORE is not set
853# CONFIG_MFD_SM501 is not set
854# CONFIG_MFD_ASIC3 is not set
855# CONFIG_HTC_EGPIO is not set
856# CONFIG_HTC_PASIC3 is not set
857# CONFIG_TPS65010 is not set
858CONFIG_TWL4030_CORE=y
859# CONFIG_TWL4030_POWER is not set
860# CONFIG_MFD_TMIO is not set
861# CONFIG_MFD_T7L66XB is not set
862# CONFIG_MFD_TC6387XB is not set
863# CONFIG_MFD_TC6393XB is not set
864# CONFIG_PMIC_DA903X is not set
865# CONFIG_MFD_WM8400 is not set
866# CONFIG_MFD_WM831X is not set
867# CONFIG_MFD_WM8350_I2C is not set
868# CONFIG_MFD_PCF50633 is not set
869# CONFIG_MFD_MC13783 is not set
870# CONFIG_AB3100_CORE is not set
871# CONFIG_EZX_PCAP is not set
872CONFIG_REGULATOR=y
873# CONFIG_REGULATOR_DEBUG is not set
874# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
875# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
876# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set
877# CONFIG_REGULATOR_BQ24022 is not set
878# CONFIG_REGULATOR_MAX1586 is not set
879CONFIG_REGULATOR_TWL4030=y
880# CONFIG_REGULATOR_LP3971 is not set
881# CONFIG_REGULATOR_TPS65023 is not set
882# CONFIG_REGULATOR_TPS6507X is not set
883# CONFIG_MEDIA_SUPPORT is not set
884
885#
886# Graphics support
887#
888# CONFIG_VGASTATE is not set
889CONFIG_VIDEO_OUTPUT_CONTROL=m
890# CONFIG_FB is not set
891# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
892
893#
894# Display device support
895#
896# CONFIG_DISPLAY_SUPPORT is not set
897
898#
899# Console display driver support
900#
901# CONFIG_VGA_CONSOLE is not set
902CONFIG_DUMMY_CONSOLE=y
903CONFIG_SOUND=y
904# CONFIG_SOUND_OSS_CORE is not set
905CONFIG_SND=y
906CONFIG_SND_TIMER=m
907CONFIG_SND_PCM=m
908# CONFIG_SND_SEQUENCER is not set
909# CONFIG_SND_MIXER_OSS is not set
910# CONFIG_SND_PCM_OSS is not set
911# CONFIG_SND_HRTIMER is not set
912# CONFIG_SND_DYNAMIC_MINORS is not set
913CONFIG_SND_SUPPORT_OLD_API=y
914CONFIG_SND_VERBOSE_PROCFS=y
915# CONFIG_SND_VERBOSE_PRINTK is not set
916# CONFIG_SND_DEBUG is not set
917# CONFIG_SND_RAWMIDI_SEQ is not set
918# CONFIG_SND_OPL3_LIB_SEQ is not set
919# CONFIG_SND_OPL4_LIB_SEQ is not set
920# CONFIG_SND_SBAWE_SEQ is not set
921# CONFIG_SND_EMU10K1_SEQ is not set
922CONFIG_SND_DRIVERS=y
923# CONFIG_SND_DUMMY is not set
924# CONFIG_SND_MTPAV is not set
925# CONFIG_SND_SERIAL_U16550 is not set
926# CONFIG_SND_MPU401 is not set
927CONFIG_SND_ARM=y
928CONFIG_SND_SPI=y
929CONFIG_SND_USB=y
930# CONFIG_SND_USB_AUDIO is not set
931# CONFIG_SND_USB_CAIAQ is not set
932# CONFIG_SND_SOC is not set
933# CONFIG_SOUND_PRIME is not set
934CONFIG_HID_SUPPORT=y
935CONFIG_HID=y
936# CONFIG_HIDRAW is not set
937
938#
939# USB Input Devices
940#
941CONFIG_USB_HID=y
942# CONFIG_HID_PID is not set
943# CONFIG_USB_HIDDEV is not set
944
945#
946# Special HID drivers
947#
948# CONFIG_HID_A4TECH is not set
949# CONFIG_HID_APPLE is not set
950# CONFIG_HID_BELKIN is not set
951# CONFIG_HID_CHERRY is not set
952# CONFIG_HID_CHICONY is not set
953# CONFIG_HID_CYPRESS is not set
954# CONFIG_HID_DRAGONRISE is not set
955# CONFIG_HID_EZKEY is not set
956# CONFIG_HID_KYE is not set
957# CONFIG_HID_GYRATION is not set
958# CONFIG_HID_TWINHAN is not set
959# CONFIG_HID_KENSINGTON is not set
960# CONFIG_HID_LOGITECH is not set
961# CONFIG_HID_MICROSOFT is not set
962# CONFIG_HID_MONTEREY is not set
963# CONFIG_HID_NTRIG is not set
964# CONFIG_HID_PANTHERLORD is not set
965# CONFIG_HID_PETALYNX is not set
966# CONFIG_HID_SAMSUNG is not set
967# CONFIG_HID_SONY is not set
968# CONFIG_HID_SUNPLUS is not set
969# CONFIG_HID_GREENASIA is not set
970# CONFIG_HID_SMARTJOYPLUS is not set
971# CONFIG_HID_TOPSEED is not set
972# CONFIG_HID_THRUSTMASTER is not set
973# CONFIG_HID_ZEROPLUS is not set
974CONFIG_USB_SUPPORT=y
975CONFIG_USB_ARCH_HAS_HCD=y
976CONFIG_USB_ARCH_HAS_OHCI=y
977CONFIG_USB_ARCH_HAS_EHCI=y
978CONFIG_USB=y
979CONFIG_USB_DEBUG=y
980CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
981
982#
983# Miscellaneous USB options
984#
985CONFIG_USB_DEVICEFS=y
986# CONFIG_USB_DEVICE_CLASS is not set
987# CONFIG_USB_DYNAMIC_MINORS is not set
988CONFIG_USB_SUSPEND=y
989CONFIG_USB_OTG=y
990# CONFIG_USB_OTG_WHITELIST is not set
991# CONFIG_USB_OTG_BLACKLIST_HUB is not set
992CONFIG_USB_MON=y
993# CONFIG_USB_WUSB is not set
994# CONFIG_USB_WUSB_CBAF is not set
995
996#
997# USB Host Controller Drivers
998#
999# CONFIG_USB_C67X00_HCD is not set
1000# CONFIG_USB_EHCI_HCD is not set
1001# CONFIG_USB_OXU210HP_HCD is not set
1002# CONFIG_USB_ISP116X_HCD is not set
1003# CONFIG_USB_ISP1760_HCD is not set
1004# CONFIG_USB_ISP1362_HCD is not set
1005# CONFIG_USB_OHCI_HCD is not set
1006# CONFIG_USB_SL811_HCD is not set
1007# CONFIG_USB_R8A66597_HCD is not set
1008# CONFIG_USB_HWA_HCD is not set
1009CONFIG_USB_MUSB_HDRC=y
1010CONFIG_USB_MUSB_SOC=y
1011
1012#
1013# OMAP 343x high speed USB support
1014#
1015# CONFIG_USB_MUSB_HOST is not set
1016# CONFIG_USB_MUSB_PERIPHERAL is not set
1017CONFIG_USB_MUSB_OTG=y
1018CONFIG_USB_GADGET_MUSB_HDRC=y
1019CONFIG_USB_MUSB_HDRC_HCD=y
1020# CONFIG_MUSB_PIO_ONLY is not set
1021CONFIG_USB_INVENTRA_DMA=y
1022# CONFIG_USB_TI_CPPI_DMA is not set
1023CONFIG_USB_MUSB_DEBUG=y
1024
1025#
1026# USB Device Class drivers
1027#
1028# CONFIG_USB_ACM is not set
1029# CONFIG_USB_PRINTER is not set
1030# CONFIG_USB_WDM is not set
1031# CONFIG_USB_TMC is not set
1032
1033#
1034# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
1035#
1036
1037#
1038# also be needed; see USB_STORAGE Help for more info
1039#
1040CONFIG_USB_STORAGE=y
1041# CONFIG_USB_STORAGE_DEBUG is not set
1042# CONFIG_USB_STORAGE_DATAFAB is not set
1043# CONFIG_USB_STORAGE_FREECOM is not set
1044# CONFIG_USB_STORAGE_ISD200 is not set
1045# CONFIG_USB_STORAGE_USBAT is not set
1046# CONFIG_USB_STORAGE_SDDR09 is not set
1047# CONFIG_USB_STORAGE_SDDR55 is not set
1048# CONFIG_USB_STORAGE_JUMPSHOT is not set
1049# CONFIG_USB_STORAGE_ALAUDA is not set
1050# CONFIG_USB_STORAGE_ONETOUCH is not set
1051# CONFIG_USB_STORAGE_KARMA is not set
1052# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
1053# CONFIG_USB_LIBUSUAL is not set
1054
1055#
1056# USB Imaging devices
1057#
1058# CONFIG_USB_MDC800 is not set
1059# CONFIG_USB_MICROTEK is not set
1060
1061#
1062# USB port drivers
1063#
1064# CONFIG_USB_SERIAL is not set
1065
1066#
1067# USB Miscellaneous drivers
1068#
1069# CONFIG_USB_EMI62 is not set
1070# CONFIG_USB_EMI26 is not set
1071# CONFIG_USB_ADUTUX is not set
1072# CONFIG_USB_SEVSEG is not set
1073# CONFIG_USB_RIO500 is not set
1074# CONFIG_USB_LEGOTOWER is not set
1075# CONFIG_USB_LCD is not set
1076# CONFIG_USB_BERRY_CHARGE is not set
1077# CONFIG_USB_LED is not set
1078# CONFIG_USB_CYPRESS_CY7C63 is not set
1079# CONFIG_USB_CYTHERM is not set
1080# CONFIG_USB_IDMOUSE is not set
1081# CONFIG_USB_FTDI_ELAN is not set
1082# CONFIG_USB_APPLEDISPLAY is not set
1083# CONFIG_USB_SISUSBVGA is not set
1084# CONFIG_USB_LD is not set
1085# CONFIG_USB_TRANCEVIBRATOR is not set
1086# CONFIG_USB_IOWARRIOR is not set
1087CONFIG_USB_TEST=m
1088# CONFIG_USB_ISIGHTFW is not set
1089# CONFIG_USB_VST is not set
1090CONFIG_USB_GADGET=m
1091CONFIG_USB_GADGET_DEBUG=y
1092CONFIG_USB_GADGET_DEBUG_FILES=y
1093CONFIG_USB_GADGET_VBUS_DRAW=2
1094CONFIG_USB_GADGET_SELECTED=y
1095# CONFIG_USB_GADGET_AT91 is not set
1096# CONFIG_USB_GADGET_ATMEL_USBA is not set
1097# CONFIG_USB_GADGET_FSL_USB2 is not set
1098# CONFIG_USB_GADGET_LH7A40X is not set
1099# CONFIG_USB_GADGET_OMAP is not set
1100# CONFIG_USB_GADGET_PXA25X is not set
1101# CONFIG_USB_GADGET_R8A66597 is not set
1102# CONFIG_USB_GADGET_PXA27X is not set
1103# CONFIG_USB_GADGET_S3C_HSOTG is not set
1104# CONFIG_USB_GADGET_IMX is not set
1105# CONFIG_USB_GADGET_S3C2410 is not set
1106# CONFIG_USB_GADGET_M66592 is not set
1107# CONFIG_USB_GADGET_AMD5536UDC is not set
1108# CONFIG_USB_GADGET_FSL_QE is not set
1109# CONFIG_USB_GADGET_CI13XXX is not set
1110# CONFIG_USB_GADGET_NET2280 is not set
1111# CONFIG_USB_GADGET_GOKU is not set
1112# CONFIG_USB_GADGET_LANGWELL is not set
1113# CONFIG_USB_GADGET_DUMMY_HCD is not set
1114CONFIG_USB_GADGET_DUALSPEED=y
1115CONFIG_USB_ZERO=m
1116# CONFIG_USB_ZERO_HNPTEST is not set
1117CONFIG_USB_AUDIO=m
1118CONFIG_USB_ETH=m
1119CONFIG_USB_ETH_RNDIS=y
1120# CONFIG_USB_ETH_EEM is not set
1121CONFIG_USB_GADGETFS=m
1122CONFIG_USB_FILE_STORAGE=m
1123# CONFIG_USB_FILE_STORAGE_TEST is not set
1124CONFIG_USB_G_SERIAL=m
1125# CONFIG_USB_MIDI_GADGET is not set
1126# CONFIG_USB_G_PRINTER is not set
1127CONFIG_USB_CDC_COMPOSITE=m
1128
1129#
1130# OTG and related infrastructure
1131#
1132CONFIG_USB_OTG_UTILS=y
1133# CONFIG_USB_GPIO_VBUS is not set
1134# CONFIG_ISP1301_OMAP is not set
1135CONFIG_TWL4030_USB=y
1136# CONFIG_NOP_USB_XCEIV is not set
1137CONFIG_MMC=y
1138# CONFIG_MMC_DEBUG is not set
1139# CONFIG_MMC_UNSAFE_RESUME is not set
1140
1141#
1142# MMC/SD/SDIO Card Drivers
1143#
1144CONFIG_MMC_BLOCK=y
1145CONFIG_MMC_BLOCK_BOUNCE=y
1146# CONFIG_SDIO_UART is not set
1147# CONFIG_MMC_TEST is not set
1148
1149#
1150# MMC/SD/SDIO Host Controller Drivers
1151#
1152# CONFIG_MMC_SDHCI is not set
1153# CONFIG_MMC_OMAP is not set
1154CONFIG_MMC_OMAP_HS=y
1155# CONFIG_MMC_AT91 is not set
1156# CONFIG_MMC_ATMELMCI is not set
1157# CONFIG_MMC_SPI is not set
1158# CONFIG_MEMSTICK is not set
1159# CONFIG_NEW_LEDS is not set
1160# CONFIG_ACCESSIBILITY is not set
1161CONFIG_RTC_LIB=y
1162CONFIG_RTC_CLASS=y
1163CONFIG_RTC_HCTOSYS=y
1164CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
1165# CONFIG_RTC_DEBUG is not set
1166
1167#
1168# RTC interfaces
1169#
1170CONFIG_RTC_INTF_SYSFS=y
1171CONFIG_RTC_INTF_PROC=y
1172CONFIG_RTC_INTF_DEV=y
1173# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
1174# CONFIG_RTC_DRV_TEST is not set
1175
1176#
1177# I2C RTC drivers
1178#
1179# CONFIG_RTC_DRV_DS1307 is not set
1180# CONFIG_RTC_DRV_DS1374 is not set
1181# CONFIG_RTC_DRV_DS1672 is not set
1182# CONFIG_RTC_DRV_MAX6900 is not set
1183# CONFIG_RTC_DRV_RS5C372 is not set
1184# CONFIG_RTC_DRV_ISL1208 is not set
1185# CONFIG_RTC_DRV_X1205 is not set
1186# CONFIG_RTC_DRV_PCF8563 is not set
1187# CONFIG_RTC_DRV_PCF8583 is not set
1188# CONFIG_RTC_DRV_M41T80 is not set
1189# CONFIG_RTC_DRV_TWL4030 is not set
1190# CONFIG_RTC_DRV_S35390A is not set
1191# CONFIG_RTC_DRV_FM3130 is not set
1192# CONFIG_RTC_DRV_RX8581 is not set
1193# CONFIG_RTC_DRV_RX8025 is not set
1194
1195#
1196# SPI RTC drivers
1197#
1198# CONFIG_RTC_DRV_M41T94 is not set
1199# CONFIG_RTC_DRV_DS1305 is not set
1200# CONFIG_RTC_DRV_DS1390 is not set
1201# CONFIG_RTC_DRV_MAX6902 is not set
1202# CONFIG_RTC_DRV_R9701 is not set
1203# CONFIG_RTC_DRV_RS5C348 is not set
1204# CONFIG_RTC_DRV_DS3234 is not set
1205# CONFIG_RTC_DRV_PCF2123 is not set
1206
1207#
1208# Platform RTC drivers
1209#
1210# CONFIG_RTC_DRV_CMOS is not set
1211# CONFIG_RTC_DRV_DS1286 is not set
1212# CONFIG_RTC_DRV_DS1511 is not set
1213# CONFIG_RTC_DRV_DS1553 is not set
1214# CONFIG_RTC_DRV_DS1742 is not set
1215# CONFIG_RTC_DRV_STK17TA8 is not set
1216# CONFIG_RTC_DRV_M48T86 is not set
1217# CONFIG_RTC_DRV_M48T35 is not set
1218# CONFIG_RTC_DRV_M48T59 is not set
1219# CONFIG_RTC_DRV_BQ4802 is not set
1220# CONFIG_RTC_DRV_V3020 is not set
1221
1222#
1223# on-CPU RTC drivers
1224#
1225# CONFIG_DMADEVICES is not set
1226# CONFIG_AUXDISPLAY is not set
1227# CONFIG_UIO is not set
1228
1229#
1230# TI VLYNQ
1231#
1232# CONFIG_STAGING is not set
1233
1234#
1235# CBUS support
1236#
1237# CONFIG_CBUS is not set
1238
1239#
1240# File systems
1241#
1242CONFIG_EXT2_FS=y
1243# CONFIG_EXT2_FS_XATTR is not set
1244# CONFIG_EXT2_FS_XIP is not set
1245CONFIG_EXT3_FS=y
1246# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
1247# CONFIG_EXT3_FS_XATTR is not set
1248# CONFIG_EXT4_FS is not set
1249CONFIG_JBD=y
1250# CONFIG_REISERFS_FS is not set
1251# CONFIG_JFS_FS is not set
1252CONFIG_FS_POSIX_ACL=y
1253# CONFIG_XFS_FS is not set
1254# CONFIG_GFS2_FS is not set
1255# CONFIG_OCFS2_FS is not set
1256# CONFIG_BTRFS_FS is not set
1257# CONFIG_NILFS2_FS is not set
1258CONFIG_FILE_LOCKING=y
1259CONFIG_FSNOTIFY=y
1260CONFIG_DNOTIFY=y
1261CONFIG_INOTIFY=y
1262CONFIG_INOTIFY_USER=y
1263CONFIG_QUOTA=y
1264# CONFIG_QUOTA_NETLINK_INTERFACE is not set
1265CONFIG_PRINT_QUOTA_WARNING=y
1266CONFIG_QUOTA_TREE=y
1267# CONFIG_QFMT_V1 is not set
1268CONFIG_QFMT_V2=y
1269CONFIG_QUOTACTL=y
1270# CONFIG_AUTOFS_FS is not set
1271# CONFIG_AUTOFS4_FS is not set
1272# CONFIG_FUSE_FS is not set
1273
1274#
1275# Caches
1276#
1277# CONFIG_FSCACHE is not set
1278
1279#
1280# CD-ROM/DVD Filesystems
1281#
1282# CONFIG_ISO9660_FS is not set
1283# CONFIG_UDF_FS is not set
1284
1285#
1286# DOS/FAT/NT Filesystems
1287#
1288CONFIG_FAT_FS=y
1289CONFIG_MSDOS_FS=y
1290CONFIG_VFAT_FS=y
1291CONFIG_FAT_DEFAULT_CODEPAGE=437
1292CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1293# CONFIG_NTFS_FS is not set
1294
1295#
1296# Pseudo filesystems
1297#
1298CONFIG_PROC_FS=y
1299CONFIG_PROC_SYSCTL=y
1300CONFIG_PROC_PAGE_MONITOR=y
1301CONFIG_SYSFS=y
1302CONFIG_TMPFS=y
1303# CONFIG_TMPFS_POSIX_ACL is not set
1304# CONFIG_HUGETLB_PAGE is not set
1305# CONFIG_CONFIGFS_FS is not set
1306CONFIG_MISC_FILESYSTEMS=y
1307# CONFIG_ADFS_FS is not set
1308# CONFIG_AFFS_FS is not set
1309# CONFIG_HFS_FS is not set
1310# CONFIG_HFSPLUS_FS is not set
1311# CONFIG_BEFS_FS is not set
1312# CONFIG_BFS_FS is not set
1313# CONFIG_EFS_FS is not set
1314# CONFIG_CRAMFS is not set
1315# CONFIG_SQUASHFS is not set
1316# CONFIG_VXFS_FS is not set
1317# CONFIG_MINIX_FS is not set
1318# CONFIG_OMFS_FS is not set
1319# CONFIG_HPFS_FS is not set
1320# CONFIG_QNX4FS_FS is not set
1321# CONFIG_ROMFS_FS is not set
1322# CONFIG_SYSV_FS is not set
1323# CONFIG_UFS_FS is not set
1324CONFIG_NETWORK_FILESYSTEMS=y
1325CONFIG_NFS_FS=y
1326CONFIG_NFS_V3=y
1327CONFIG_NFS_V3_ACL=y
1328CONFIG_NFS_V4=y
1329# CONFIG_NFS_V4_1 is not set
1330CONFIG_ROOT_NFS=y
1331# CONFIG_NFSD is not set
1332CONFIG_LOCKD=y
1333CONFIG_LOCKD_V4=y
1334CONFIG_NFS_ACL_SUPPORT=y
1335CONFIG_NFS_COMMON=y
1336CONFIG_SUNRPC=y
1337CONFIG_SUNRPC_GSS=y
1338CONFIG_RPCSEC_GSS_KRB5=y
1339# CONFIG_RPCSEC_GSS_SPKM3 is not set
1340# CONFIG_SMB_FS is not set
1341# CONFIG_CIFS is not set
1342# CONFIG_NCP_FS is not set
1343# CONFIG_CODA_FS is not set
1344# CONFIG_AFS_FS is not set
1345
1346#
1347# Partition Types
1348#
1349CONFIG_PARTITION_ADVANCED=y
1350# CONFIG_ACORN_PARTITION is not set
1351# CONFIG_OSF_PARTITION is not set
1352# CONFIG_AMIGA_PARTITION is not set
1353# CONFIG_ATARI_PARTITION is not set
1354# CONFIG_MAC_PARTITION is not set
1355CONFIG_MSDOS_PARTITION=y
1356# CONFIG_BSD_DISKLABEL is not set
1357# CONFIG_MINIX_SUBPARTITION is not set
1358# CONFIG_SOLARIS_X86_PARTITION is not set
1359# CONFIG_UNIXWARE_DISKLABEL is not set
1360# CONFIG_LDM_PARTITION is not set
1361# CONFIG_SGI_PARTITION is not set
1362# CONFIG_ULTRIX_PARTITION is not set
1363# CONFIG_SUN_PARTITION is not set
1364# CONFIG_KARMA_PARTITION is not set
1365# CONFIG_EFI_PARTITION is not set
1366# CONFIG_SYSV68_PARTITION is not set
1367CONFIG_NLS=y
1368CONFIG_NLS_DEFAULT="iso8859-1"
1369CONFIG_NLS_CODEPAGE_437=y
1370# CONFIG_NLS_CODEPAGE_737 is not set
1371# CONFIG_NLS_CODEPAGE_775 is not set
1372# CONFIG_NLS_CODEPAGE_850 is not set
1373# CONFIG_NLS_CODEPAGE_852 is not set
1374# CONFIG_NLS_CODEPAGE_855 is not set
1375# CONFIG_NLS_CODEPAGE_857 is not set
1376# CONFIG_NLS_CODEPAGE_860 is not set
1377# CONFIG_NLS_CODEPAGE_861 is not set
1378# CONFIG_NLS_CODEPAGE_862 is not set
1379# CONFIG_NLS_CODEPAGE_863 is not set
1380# CONFIG_NLS_CODEPAGE_864 is not set
1381# CONFIG_NLS_CODEPAGE_865 is not set
1382# CONFIG_NLS_CODEPAGE_866 is not set
1383# CONFIG_NLS_CODEPAGE_869 is not set
1384# CONFIG_NLS_CODEPAGE_936 is not set
1385# CONFIG_NLS_CODEPAGE_950 is not set
1386# CONFIG_NLS_CODEPAGE_932 is not set
1387# CONFIG_NLS_CODEPAGE_949 is not set
1388# CONFIG_NLS_CODEPAGE_874 is not set
1389# CONFIG_NLS_ISO8859_8 is not set
1390# CONFIG_NLS_CODEPAGE_1250 is not set
1391# CONFIG_NLS_CODEPAGE_1251 is not set
1392# CONFIG_NLS_ASCII is not set
1393CONFIG_NLS_ISO8859_1=y
1394# CONFIG_NLS_ISO8859_2 is not set
1395# CONFIG_NLS_ISO8859_3 is not set
1396# CONFIG_NLS_ISO8859_4 is not set
1397# CONFIG_NLS_ISO8859_5 is not set
1398# CONFIG_NLS_ISO8859_6 is not set
1399# CONFIG_NLS_ISO8859_7 is not set
1400# CONFIG_NLS_ISO8859_9 is not set
1401# CONFIG_NLS_ISO8859_13 is not set
1402# CONFIG_NLS_ISO8859_14 is not set
1403# CONFIG_NLS_ISO8859_15 is not set
1404# CONFIG_NLS_KOI8_R is not set
1405# CONFIG_NLS_KOI8_U is not set
1406# CONFIG_NLS_UTF8 is not set
1407# CONFIG_DLM is not set
1408
1409#
1410# Kernel hacking
1411#
1412# CONFIG_PRINTK_TIME is not set
1413CONFIG_ENABLE_WARN_DEPRECATED=y
1414CONFIG_ENABLE_MUST_CHECK=y
1415CONFIG_FRAME_WARN=1024
1416CONFIG_MAGIC_SYSRQ=y
1417# CONFIG_STRIP_ASM_SYMS is not set
1418# CONFIG_UNUSED_SYMBOLS is not set
1419# CONFIG_DEBUG_FS is not set
1420# CONFIG_HEADERS_CHECK is not set
1421CONFIG_DEBUG_KERNEL=y
1422# CONFIG_DEBUG_SHIRQ is not set
1423CONFIG_DETECT_SOFTLOCKUP=y
1424# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1425CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
1426CONFIG_DETECT_HUNG_TASK=y
1427# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
1428CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
1429CONFIG_SCHED_DEBUG=y
1430# CONFIG_SCHEDSTATS is not set
1431# CONFIG_TIMER_STATS is not set
1432# CONFIG_DEBUG_OBJECTS is not set
1433# CONFIG_DEBUG_SLAB is not set
1434# CONFIG_DEBUG_KMEMLEAK is not set
1435# CONFIG_DEBUG_RT_MUTEXES is not set
1436# CONFIG_RT_MUTEX_TESTER is not set
1437# CONFIG_DEBUG_SPINLOCK is not set
1438CONFIG_DEBUG_MUTEXES=y
1439# CONFIG_DEBUG_LOCK_ALLOC is not set
1440# CONFIG_PROVE_LOCKING is not set
1441# CONFIG_LOCK_STAT is not set
1442# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1443# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1444# CONFIG_DEBUG_KOBJECT is not set
1445# CONFIG_DEBUG_BUGVERBOSE is not set
1446CONFIG_DEBUG_INFO=y
1447# CONFIG_DEBUG_VM is not set
1448# CONFIG_DEBUG_WRITECOUNT is not set
1449# CONFIG_DEBUG_MEMORY_INIT is not set
1450# CONFIG_DEBUG_LIST is not set
1451# CONFIG_DEBUG_SG is not set
1452# CONFIG_DEBUG_NOTIFIERS is not set
1453# CONFIG_DEBUG_CREDENTIALS is not set
1454# CONFIG_BOOT_PRINTK_DELAY is not set
1455# CONFIG_RCU_TORTURE_TEST is not set
1456# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1457# CONFIG_BACKTRACE_SELF_TEST is not set
1458# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1459# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
1460# CONFIG_FAULT_INJECTION is not set
1461# CONFIG_LATENCYTOP is not set
1462# CONFIG_PAGE_POISONING is not set
1463CONFIG_HAVE_FUNCTION_TRACER=y
1464CONFIG_TRACING_SUPPORT=y
1465CONFIG_FTRACE=y
1466# CONFIG_FUNCTION_TRACER is not set
1467# CONFIG_IRQSOFF_TRACER is not set
1468# CONFIG_SCHED_TRACER is not set
1469# CONFIG_ENABLE_DEFAULT_TRACERS is not set
1470# CONFIG_BOOT_TRACER is not set
1471CONFIG_BRANCH_PROFILE_NONE=y
1472# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1473# CONFIG_PROFILE_ALL_BRANCHES is not set
1474# CONFIG_STACK_TRACER is not set
1475# CONFIG_KMEMTRACE is not set
1476# CONFIG_WORKQUEUE_TRACER is not set
1477# CONFIG_BLK_DEV_IO_TRACE is not set
1478# CONFIG_SAMPLES is not set
1479CONFIG_HAVE_ARCH_KGDB=y
1480# CONFIG_KGDB is not set
1481CONFIG_ARM_UNWIND=y
1482# CONFIG_DEBUG_USER is not set
1483# CONFIG_DEBUG_ERRORS is not set
1484# CONFIG_DEBUG_STACK_USAGE is not set
1485CONFIG_DEBUG_LL=y
1486# CONFIG_DEBUG_ICEDCC is not set
1487
1488#
1489# Security options
1490#
1491# CONFIG_KEYS is not set
1492# CONFIG_SECURITY is not set
1493# CONFIG_SECURITYFS is not set
1494# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1495CONFIG_CRYPTO=y
1496
1497#
1498# Crypto core or helper
1499#
1500CONFIG_CRYPTO_ALGAPI=y
1501CONFIG_CRYPTO_ALGAPI2=y
1502CONFIG_CRYPTO_AEAD2=y
1503CONFIG_CRYPTO_BLKCIPHER=y
1504CONFIG_CRYPTO_BLKCIPHER2=y
1505CONFIG_CRYPTO_HASH=y
1506CONFIG_CRYPTO_HASH2=y
1507CONFIG_CRYPTO_RNG2=y
1508CONFIG_CRYPTO_PCOMP=y
1509CONFIG_CRYPTO_MANAGER=y
1510CONFIG_CRYPTO_MANAGER2=y
1511# CONFIG_CRYPTO_GF128MUL is not set
1512# CONFIG_CRYPTO_NULL is not set
1513CONFIG_CRYPTO_WORKQUEUE=y
1514# CONFIG_CRYPTO_CRYPTD is not set
1515# CONFIG_CRYPTO_AUTHENC is not set
1516# CONFIG_CRYPTO_TEST is not set
1517
1518#
1519# Authenticated Encryption with Associated Data
1520#
1521# CONFIG_CRYPTO_CCM is not set
1522# CONFIG_CRYPTO_GCM is not set
1523# CONFIG_CRYPTO_SEQIV is not set
1524
1525#
1526# Block modes
1527#
1528CONFIG_CRYPTO_CBC=y
1529# CONFIG_CRYPTO_CTR is not set
1530# CONFIG_CRYPTO_CTS is not set
1531CONFIG_CRYPTO_ECB=m
1532# CONFIG_CRYPTO_LRW is not set
1533CONFIG_CRYPTO_PCBC=m
1534# CONFIG_CRYPTO_XTS is not set
1535
1536#
1537# Hash modes
1538#
1539# CONFIG_CRYPTO_HMAC is not set
1540# CONFIG_CRYPTO_XCBC is not set
1541# CONFIG_CRYPTO_VMAC is not set
1542
1543#
1544# Digest
1545#
1546CONFIG_CRYPTO_CRC32C=y
1547# CONFIG_CRYPTO_GHASH is not set
1548# CONFIG_CRYPTO_MD4 is not set
1549CONFIG_CRYPTO_MD5=y
1550# CONFIG_CRYPTO_MICHAEL_MIC is not set
1551# CONFIG_CRYPTO_RMD128 is not set
1552# CONFIG_CRYPTO_RMD160 is not set
1553# CONFIG_CRYPTO_RMD256 is not set
1554# CONFIG_CRYPTO_RMD320 is not set
1555# CONFIG_CRYPTO_SHA1 is not set
1556# CONFIG_CRYPTO_SHA256 is not set
1557# CONFIG_CRYPTO_SHA512 is not set
1558# CONFIG_CRYPTO_TGR192 is not set
1559# CONFIG_CRYPTO_WP512 is not set
1560
1561#
1562# Ciphers
1563#
1564# CONFIG_CRYPTO_AES is not set
1565# CONFIG_CRYPTO_ANUBIS is not set
1566# CONFIG_CRYPTO_ARC4 is not set
1567# CONFIG_CRYPTO_BLOWFISH is not set
1568# CONFIG_CRYPTO_CAMELLIA is not set
1569# CONFIG_CRYPTO_CAST5 is not set
1570# CONFIG_CRYPTO_CAST6 is not set
1571CONFIG_CRYPTO_DES=y
1572# CONFIG_CRYPTO_FCRYPT is not set
1573# CONFIG_CRYPTO_KHAZAD is not set
1574# CONFIG_CRYPTO_SALSA20 is not set
1575# CONFIG_CRYPTO_SEED is not set
1576# CONFIG_CRYPTO_SERPENT is not set
1577# CONFIG_CRYPTO_TEA is not set
1578# CONFIG_CRYPTO_TWOFISH is not set
1579
1580#
1581# Compression
1582#
1583# CONFIG_CRYPTO_DEFLATE is not set
1584# CONFIG_CRYPTO_ZLIB is not set
1585# CONFIG_CRYPTO_LZO is not set
1586
1587#
1588# Random Number Generation
1589#
1590# CONFIG_CRYPTO_ANSI_CPRNG is not set
1591CONFIG_CRYPTO_HW=y
1592# CONFIG_BINARY_PRINTF is not set
1593
1594#
1595# Library routines
1596#
1597CONFIG_BITREVERSE=y
1598CONFIG_GENERIC_FIND_LAST_BIT=y
1599CONFIG_CRC_CCITT=y
1600# CONFIG_CRC16 is not set
1601CONFIG_CRC_T10DIF=y
1602# CONFIG_CRC_ITU_T is not set
1603CONFIG_CRC32=y
1604# CONFIG_CRC7 is not set
1605CONFIG_LIBCRC32C=y
1606CONFIG_ZLIB_INFLATE=y
1607CONFIG_DECOMPRESS_GZIP=y
1608CONFIG_HAS_IOMEM=y
1609CONFIG_HAS_IOPORT=y
1610CONFIG_HAS_DMA=y
1611CONFIG_NLATTR=y
diff --git a/arch/arm/configs/omap_4430sdp_defconfig b/arch/arm/configs/omap_4430sdp_defconfig
index 23e43ea4efa1..a464ca332a23 100644
--- a/arch/arm/configs/omap_4430sdp_defconfig
+++ b/arch/arm/configs/omap_4430sdp_defconfig
@@ -52,8 +52,8 @@ CONFIG_FAIR_GROUP_SCHED=y
52CONFIG_USER_SCHED=y 52CONFIG_USER_SCHED=y
53# CONFIG_CGROUP_SCHED is not set 53# CONFIG_CGROUP_SCHED is not set
54# CONFIG_CGROUPS is not set 54# CONFIG_CGROUPS is not set
55CONFIG_SYSFS_DEPRECATED=y 55# CONFIG_SYSFS_DEPRECATED=y is not set
56CONFIG_SYSFS_DEPRECATED_V2=y 56# CONFIG_SYSFS_DEPRECATED_V2=y is not set
57# CONFIG_RELAY is not set 57# CONFIG_RELAY is not set
58# CONFIG_NAMESPACES is not set 58# CONFIG_NAMESPACES is not set
59CONFIG_BLK_DEV_INITRD=y 59CONFIG_BLK_DEV_INITRD=y
diff --git a/arch/arm/configs/omap_ldp_defconfig b/arch/arm/configs/omap_ldp_defconfig
index b9c48919a68c..9139532c3be7 100644
--- a/arch/arm/configs/omap_ldp_defconfig
+++ b/arch/arm/configs/omap_ldp_defconfig
@@ -49,8 +49,8 @@ CONFIG_FAIR_GROUP_SCHED=y
49# CONFIG_RT_GROUP_SCHED is not set 49# CONFIG_RT_GROUP_SCHED is not set
50CONFIG_USER_SCHED=y 50CONFIG_USER_SCHED=y
51# CONFIG_CGROUP_SCHED is not set 51# CONFIG_CGROUP_SCHED is not set
52CONFIG_SYSFS_DEPRECATED=y 52# CONFIG_SYSFS_DEPRECATED=y is not set
53CONFIG_SYSFS_DEPRECATED_V2=y 53# CONFIG_SYSFS_DEPRECATED_V2=y is not set
54# CONFIG_RELAY is not set 54# CONFIG_RELAY is not set
55# CONFIG_NAMESPACES is not set 55# CONFIG_NAMESPACES is not set
56CONFIG_BLK_DEV_INITRD=y 56CONFIG_BLK_DEV_INITRD=y
diff --git a/arch/arm/configs/omap_zoom2_defconfig b/arch/arm/configs/omap_zoom2_defconfig
index f1739fae7ed4..eef93627fb13 100644
--- a/arch/arm/configs/omap_zoom2_defconfig
+++ b/arch/arm/configs/omap_zoom2_defconfig
@@ -59,8 +59,8 @@ CONFIG_FAIR_GROUP_SCHED=y
59CONFIG_USER_SCHED=y 59CONFIG_USER_SCHED=y
60# CONFIG_CGROUP_SCHED is not set 60# CONFIG_CGROUP_SCHED is not set
61# CONFIG_CGROUPS is not set 61# CONFIG_CGROUPS is not set
62CONFIG_SYSFS_DEPRECATED=y 62# CONFIG_SYSFS_DEPRECATED=y is not set
63CONFIG_SYSFS_DEPRECATED_V2=y 63# CONFIG_SYSFS_DEPRECATED_V2=y is not set
64# CONFIG_RELAY is not set 64# CONFIG_RELAY is not set
65# CONFIG_NAMESPACES is not set 65# CONFIG_NAMESPACES is not set
66CONFIG_BLK_DEV_INITRD=y 66CONFIG_BLK_DEV_INITRD=y
@@ -202,7 +202,8 @@ CONFIG_OMAP_32K_TIMER_HZ=128
202CONFIG_OMAP_DM_TIMER=y 202CONFIG_OMAP_DM_TIMER=y
203# CONFIG_OMAP_LL_DEBUG_UART1 is not set 203# CONFIG_OMAP_LL_DEBUG_UART1 is not set
204# CONFIG_OMAP_LL_DEBUG_UART2 is not set 204# CONFIG_OMAP_LL_DEBUG_UART2 is not set
205CONFIG_OMAP_LL_DEBUG_UART3=y 205# CONFIG_OMAP_LL_DEBUG_UART3 is not set
206CONFIG_OMAP_LL_DEBUG_NONE=y
206CONFIG_ARCH_OMAP34XX=y 207CONFIG_ARCH_OMAP34XX=y
207CONFIG_ARCH_OMAP3430=y 208CONFIG_ARCH_OMAP3430=y
208 209
diff --git a/arch/arm/configs/omap_zoom3_defconfig b/arch/arm/configs/omap_zoom3_defconfig
new file mode 100644
index 000000000000..f0e7d0f85582
--- /dev/null
+++ b/arch/arm/configs/omap_zoom3_defconfig
@@ -0,0 +1,1610 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.32-rc6
4# Thu Nov 12 13:04:07 2009
5#
6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y
9CONFIG_GENERIC_TIME=y
10CONFIG_GENERIC_CLOCKEVENTS=y
11CONFIG_GENERIC_HARDIRQS=y
12CONFIG_STACKTRACE_SUPPORT=y
13CONFIG_HAVE_LATENCYTOP_SUPPORT=y
14CONFIG_LOCKDEP_SUPPORT=y
15CONFIG_TRACE_IRQFLAGS_SUPPORT=y
16CONFIG_HARDIRQS_SW_RESEND=y
17CONFIG_GENERIC_IRQ_PROBE=y
18CONFIG_RWSEM_GENERIC_SPINLOCK=y
19CONFIG_ARCH_HAS_CPUFREQ=y
20CONFIG_GENERIC_HWEIGHT=y
21CONFIG_GENERIC_CALIBRATE_DELAY=y
22CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
23CONFIG_VECTORS_BASE=0xffff0000
24CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
25CONFIG_CONSTRUCTORS=y
26
27#
28# General setup
29#
30CONFIG_EXPERIMENTAL=y
31CONFIG_BROKEN_ON_SMP=y
32CONFIG_INIT_ENV_ARG_LIMIT=32
33CONFIG_LOCALVERSION=""
34CONFIG_LOCALVERSION_AUTO=y
35CONFIG_SWAP=y
36CONFIG_SYSVIPC=y
37CONFIG_SYSVIPC_SYSCTL=y
38# CONFIG_POSIX_MQUEUE is not set
39CONFIG_BSD_PROCESS_ACCT=y
40# CONFIG_BSD_PROCESS_ACCT_V3 is not set
41# CONFIG_TASKSTATS is not set
42# CONFIG_AUDIT is not set
43
44#
45# RCU Subsystem
46#
47CONFIG_TREE_RCU=y
48# CONFIG_TREE_PREEMPT_RCU is not set
49# CONFIG_RCU_TRACE is not set
50CONFIG_RCU_FANOUT=32
51# CONFIG_RCU_FANOUT_EXACT is not set
52# CONFIG_TREE_RCU_TRACE is not set
53# CONFIG_IKCONFIG is not set
54CONFIG_LOG_BUF_SHIFT=14
55CONFIG_GROUP_SCHED=y
56CONFIG_FAIR_GROUP_SCHED=y
57# CONFIG_RT_GROUP_SCHED is not set
58CONFIG_USER_SCHED=y
59# CONFIG_CGROUP_SCHED is not set
60# CONFIG_CGROUPS is not set
61# CONFIG_SYSFS_DEPRECATED_V2 is not set
62# CONFIG_RELAY is not set
63# CONFIG_NAMESPACES is not set
64CONFIG_BLK_DEV_INITRD=y
65CONFIG_INITRAMFS_SOURCE=""
66CONFIG_RD_GZIP=y
67# CONFIG_RD_BZIP2 is not set
68# CONFIG_RD_LZMA is not set
69CONFIG_CC_OPTIMIZE_FOR_SIZE=y
70CONFIG_SYSCTL=y
71CONFIG_ANON_INODES=y
72CONFIG_EMBEDDED=y
73CONFIG_UID16=y
74# CONFIG_SYSCTL_SYSCALL is not set
75CONFIG_KALLSYMS=y
76# CONFIG_KALLSYMS_ALL is not set
77CONFIG_KALLSYMS_EXTRA_PASS=y
78CONFIG_HOTPLUG=y
79CONFIG_PRINTK=y
80CONFIG_BUG=y
81CONFIG_ELF_CORE=y
82CONFIG_BASE_FULL=y
83CONFIG_FUTEX=y
84CONFIG_EPOLL=y
85CONFIG_SIGNALFD=y
86CONFIG_TIMERFD=y
87CONFIG_EVENTFD=y
88CONFIG_SHMEM=y
89CONFIG_AIO=y
90
91#
92# Kernel Performance Events And Counters
93#
94CONFIG_VM_EVENT_COUNTERS=y
95CONFIG_COMPAT_BRK=y
96CONFIG_SLAB=y
97# CONFIG_SLUB is not set
98# CONFIG_SLOB is not set
99# CONFIG_PROFILING is not set
100CONFIG_HAVE_OPROFILE=y
101# CONFIG_KPROBES is not set
102CONFIG_HAVE_KPROBES=y
103CONFIG_HAVE_KRETPROBES=y
104CONFIG_HAVE_CLK=y
105
106#
107# GCOV-based kernel profiling
108#
109# CONFIG_SLOW_WORK is not set
110CONFIG_HAVE_GENERIC_DMA_COHERENT=y
111CONFIG_SLABINFO=y
112CONFIG_RT_MUTEXES=y
113CONFIG_BASE_SMALL=0
114CONFIG_MODULES=y
115# CONFIG_MODULE_FORCE_LOAD is not set
116CONFIG_MODULE_UNLOAD=y
117# CONFIG_MODULE_FORCE_UNLOAD is not set
118CONFIG_MODVERSIONS=y
119CONFIG_MODULE_SRCVERSION_ALL=y
120CONFIG_BLOCK=y
121CONFIG_LBDAF=y
122# CONFIG_BLK_DEV_BSG is not set
123# CONFIG_BLK_DEV_INTEGRITY is not set
124
125#
126# IO Schedulers
127#
128CONFIG_IOSCHED_NOOP=y
129CONFIG_IOSCHED_AS=y
130CONFIG_IOSCHED_DEADLINE=y
131CONFIG_IOSCHED_CFQ=y
132CONFIG_DEFAULT_AS=y
133# CONFIG_DEFAULT_DEADLINE is not set
134# CONFIG_DEFAULT_CFQ is not set
135# CONFIG_DEFAULT_NOOP is not set
136CONFIG_DEFAULT_IOSCHED="anticipatory"
137CONFIG_FREEZER=y
138
139#
140# System Type
141#
142CONFIG_MMU=y
143# CONFIG_ARCH_AAEC2000 is not set
144# CONFIG_ARCH_INTEGRATOR is not set
145# CONFIG_ARCH_REALVIEW is not set
146# CONFIG_ARCH_VERSATILE is not set
147# CONFIG_ARCH_AT91 is not set
148# CONFIG_ARCH_CLPS711X is not set
149# CONFIG_ARCH_GEMINI is not set
150# CONFIG_ARCH_EBSA110 is not set
151# CONFIG_ARCH_EP93XX is not set
152# CONFIG_ARCH_FOOTBRIDGE is not set
153# CONFIG_ARCH_MXC is not set
154# CONFIG_ARCH_STMP3XXX is not set
155# CONFIG_ARCH_NETX is not set
156# CONFIG_ARCH_H720X is not set
157# CONFIG_ARCH_NOMADIK is not set
158# CONFIG_ARCH_IOP13XX is not set
159# CONFIG_ARCH_IOP32X is not set
160# CONFIG_ARCH_IOP33X is not set
161# CONFIG_ARCH_IXP23XX is not set
162# CONFIG_ARCH_IXP2000 is not set
163# CONFIG_ARCH_IXP4XX is not set
164# CONFIG_ARCH_L7200 is not set
165# CONFIG_ARCH_KIRKWOOD is not set
166# CONFIG_ARCH_LOKI is not set
167# CONFIG_ARCH_MV78XX0 is not set
168# CONFIG_ARCH_ORION5X is not set
169# CONFIG_ARCH_MMP is not set
170# CONFIG_ARCH_KS8695 is not set
171# CONFIG_ARCH_NS9XXX is not set
172# CONFIG_ARCH_W90X900 is not set
173# CONFIG_ARCH_PNX4008 is not set
174# CONFIG_ARCH_PXA is not set
175# CONFIG_ARCH_MSM is not set
176# CONFIG_ARCH_RPC is not set
177# CONFIG_ARCH_SA1100 is not set
178# CONFIG_ARCH_S3C2410 is not set
179# CONFIG_ARCH_S3C64XX is not set
180# CONFIG_ARCH_S5PC1XX is not set
181# CONFIG_ARCH_SHARK is not set
182# CONFIG_ARCH_LH7A40X is not set
183# CONFIG_ARCH_U300 is not set
184# CONFIG_ARCH_DAVINCI is not set
185CONFIG_ARCH_OMAP=y
186# CONFIG_ARCH_BCMRING is not set
187
188#
189# TI OMAP Implementations
190#
191CONFIG_ARCH_OMAP_OTG=y
192# CONFIG_ARCH_OMAP1 is not set
193# CONFIG_ARCH_OMAP2 is not set
194CONFIG_ARCH_OMAP3=y
195# CONFIG_ARCH_OMAP4 is not set
196
197#
198# OMAP Feature Selections
199#
200# CONFIG_OMAP_DEBUG_POWERDOMAIN is not set
201# CONFIG_OMAP_DEBUG_CLOCKDOMAIN is not set
202# CONFIG_OMAP_RESET_CLOCKS is not set
203CONFIG_OMAP_MUX=y
204CONFIG_OMAP_MUX_DEBUG=y
205CONFIG_OMAP_MUX_WARNINGS=y
206CONFIG_OMAP_MCBSP=y
207# CONFIG_OMAP_MBOX_FWK is not set
208# CONFIG_OMAP_MPU_TIMER is not set
209CONFIG_OMAP_32K_TIMER=y
210CONFIG_OMAP_32K_TIMER_HZ=128
211CONFIG_OMAP_DM_TIMER=y
212# CONFIG_OMAP_LL_DEBUG_UART1 is not set
213# CONFIG_OMAP_LL_DEBUG_UART2 is not set
214# CONFIG_OMAP_LL_DEBUG_UART3 is not set
215CONFIG_OMAP_LL_DEBUG_NONE=y
216# CONFIG_OMAP_PM_NONE is not set
217CONFIG_OMAP_PM_NOOP=y
218CONFIG_ARCH_OMAP34XX=y
219CONFIG_ARCH_OMAP3430=y
220
221#
222# OMAP Board Type
223#
224# CONFIG_MACH_OMAP3_BEAGLE is not set
225# CONFIG_MACH_OMAP_LDP is not set
226# CONFIG_MACH_OVERO is not set
227# CONFIG_MACH_OMAP3EVM is not set
228# CONFIG_MACH_OMAP3_PANDORA is not set
229# CONFIG_MACH_OMAP_3430SDP is not set
230# CONFIG_MACH_NOKIA_RX51 is not set
231# CONFIG_MACH_OMAP_ZOOM2 is not set
232# CONFIG_MACH_CM_T35 is not set
233CONFIG_MACH_OMAP_ZOOM3=y
234# CONFIG_MACH_OMAP_3630SDP is not set
235
236#
237# Processor Type
238#
239CONFIG_CPU_32=y
240CONFIG_CPU_32v6K=y
241CONFIG_CPU_V7=y
242CONFIG_CPU_32v7=y
243CONFIG_CPU_ABRT_EV7=y
244CONFIG_CPU_PABRT_V7=y
245CONFIG_CPU_CACHE_V7=y
246CONFIG_CPU_CACHE_VIPT=y
247CONFIG_CPU_COPY_V6=y
248CONFIG_CPU_TLB_V7=y
249CONFIG_CPU_HAS_ASID=y
250CONFIG_CPU_CP15=y
251CONFIG_CPU_CP15_MMU=y
252
253#
254# Processor Features
255#
256CONFIG_ARM_THUMB=y
257# CONFIG_ARM_THUMBEE is not set
258# CONFIG_CPU_ICACHE_DISABLE is not set
259# CONFIG_CPU_DCACHE_DISABLE is not set
260# CONFIG_CPU_BPREDICT_DISABLE is not set
261CONFIG_HAS_TLS_REG=y
262CONFIG_ARM_L1_CACHE_SHIFT=6
263# CONFIG_ARM_ERRATA_430973 is not set
264# CONFIG_ARM_ERRATA_458693 is not set
265# CONFIG_ARM_ERRATA_460075 is not set
266CONFIG_COMMON_CLKDEV=y
267
268#
269# Bus support
270#
271# CONFIG_PCI_SYSCALL is not set
272# CONFIG_ARCH_SUPPORTS_MSI is not set
273# CONFIG_PCCARD is not set
274
275#
276# Kernel Features
277#
278CONFIG_TICK_ONESHOT=y
279CONFIG_NO_HZ=y
280CONFIG_HIGH_RES_TIMERS=y
281CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
282CONFIG_VMSPLIT_3G=y
283# CONFIG_VMSPLIT_2G is not set
284# CONFIG_VMSPLIT_1G is not set
285CONFIG_PAGE_OFFSET=0xC0000000
286CONFIG_PREEMPT_NONE=y
287# CONFIG_PREEMPT_VOLUNTARY is not set
288# CONFIG_PREEMPT is not set
289CONFIG_HZ=128
290# CONFIG_THUMB2_KERNEL is not set
291CONFIG_AEABI=y
292CONFIG_OABI_COMPAT=y
293# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
294# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
295# CONFIG_HIGHMEM is not set
296CONFIG_SELECT_MEMORY_MODEL=y
297CONFIG_FLATMEM_MANUAL=y
298# CONFIG_DISCONTIGMEM_MANUAL is not set
299# CONFIG_SPARSEMEM_MANUAL is not set
300CONFIG_FLATMEM=y
301CONFIG_FLAT_NODE_MEM_MAP=y
302CONFIG_PAGEFLAGS_EXTENDED=y
303CONFIG_SPLIT_PTLOCK_CPUS=4
304# CONFIG_PHYS_ADDR_T_64BIT is not set
305CONFIG_ZONE_DMA_FLAG=0
306CONFIG_VIRT_TO_BUS=y
307CONFIG_HAVE_MLOCK=y
308CONFIG_HAVE_MLOCKED_PAGE_BIT=y
309# CONFIG_KSM is not set
310CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
311# CONFIG_LEDS is not set
312CONFIG_ALIGNMENT_TRAP=y
313# CONFIG_UACCESS_WITH_MEMCPY is not set
314
315#
316# Boot options
317#
318CONFIG_ZBOOT_ROM_TEXT=0x0
319CONFIG_ZBOOT_ROM_BSS=0x0
320CONFIG_CMDLINE="root=/dev/nfs nfsroot=192.168.0.1:/home/user/buildroot ip=192.168.0.2:192.168.0.1:192.168.0.1:255.255.255.0:tgt:eth0:off rw console=ttyS2,115200n8"
321# CONFIG_XIP_KERNEL is not set
322# CONFIG_KEXEC is not set
323
324#
325# CPU Power Management
326#
327# CONFIG_CPU_FREQ is not set
328# CONFIG_CPU_IDLE is not set
329
330#
331# Floating point emulation
332#
333
334#
335# At least one emulation must be selected
336#
337CONFIG_FPE_NWFPE=y
338# CONFIG_FPE_NWFPE_XP is not set
339# CONFIG_FPE_FASTFPE is not set
340CONFIG_VFP=y
341CONFIG_VFPv3=y
342# CONFIG_NEON is not set
343
344#
345# Userspace binary formats
346#
347CONFIG_BINFMT_ELF=y
348# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
349CONFIG_HAVE_AOUT=y
350# CONFIG_BINFMT_AOUT is not set
351CONFIG_BINFMT_MISC=y
352
353#
354# Power management options
355#
356CONFIG_PM=y
357CONFIG_PM_DEBUG=y
358CONFIG_PM_VERBOSE=y
359CONFIG_CAN_PM_TRACE=y
360CONFIG_PM_SLEEP=y
361CONFIG_SUSPEND=y
362# CONFIG_PM_TEST_SUSPEND is not set
363CONFIG_SUSPEND_FREEZER=y
364# CONFIG_APM_EMULATION is not set
365# CONFIG_PM_RUNTIME is not set
366CONFIG_ARCH_SUSPEND_POSSIBLE=y
367CONFIG_NET=y
368
369#
370# Networking options
371#
372CONFIG_PACKET=y
373# CONFIG_PACKET_MMAP is not set
374CONFIG_UNIX=y
375CONFIG_XFRM=y
376CONFIG_XFRM_USER=y
377# CONFIG_XFRM_SUB_POLICY is not set
378CONFIG_XFRM_MIGRATE=y
379# CONFIG_XFRM_STATISTICS is not set
380CONFIG_NET_KEY=y
381CONFIG_NET_KEY_MIGRATE=y
382CONFIG_INET=y
383CONFIG_IP_MULTICAST=y
384# CONFIG_IP_ADVANCED_ROUTER is not set
385CONFIG_IP_FIB_HASH=y
386CONFIG_IP_PNP=y
387CONFIG_IP_PNP_DHCP=y
388CONFIG_IP_PNP_BOOTP=y
389CONFIG_IP_PNP_RARP=y
390# CONFIG_NET_IPIP is not set
391# CONFIG_NET_IPGRE is not set
392# CONFIG_IP_MROUTE is not set
393# CONFIG_ARPD is not set
394# CONFIG_SYN_COOKIES is not set
395# CONFIG_INET_AH is not set
396# CONFIG_INET_ESP is not set
397# CONFIG_INET_IPCOMP is not set
398# CONFIG_INET_XFRM_TUNNEL is not set
399# CONFIG_INET_TUNNEL is not set
400CONFIG_INET_XFRM_MODE_TRANSPORT=y
401CONFIG_INET_XFRM_MODE_TUNNEL=y
402CONFIG_INET_XFRM_MODE_BEET=y
403# CONFIG_INET_LRO is not set
404CONFIG_INET_DIAG=y
405CONFIG_INET_TCP_DIAG=y
406# CONFIG_TCP_CONG_ADVANCED is not set
407CONFIG_TCP_CONG_CUBIC=y
408CONFIG_DEFAULT_TCP_CONG="cubic"
409# CONFIG_TCP_MD5SIG is not set
410# CONFIG_IPV6 is not set
411# CONFIG_NETWORK_SECMARK is not set
412# CONFIG_NETFILTER is not set
413# CONFIG_IP_DCCP is not set
414# CONFIG_IP_SCTP is not set
415# CONFIG_RDS is not set
416# CONFIG_TIPC is not set
417# CONFIG_ATM is not set
418# CONFIG_BRIDGE is not set
419# CONFIG_NET_DSA is not set
420# CONFIG_VLAN_8021Q is not set
421# CONFIG_DECNET is not set
422# CONFIG_LLC2 is not set
423# CONFIG_IPX is not set
424# CONFIG_ATALK is not set
425# CONFIG_X25 is not set
426# CONFIG_LAPB is not set
427# CONFIG_ECONET is not set
428# CONFIG_WAN_ROUTER is not set
429# CONFIG_PHONET is not set
430# CONFIG_IEEE802154 is not set
431# CONFIG_NET_SCHED is not set
432# CONFIG_DCB is not set
433
434#
435# Network testing
436#
437# CONFIG_NET_PKTGEN is not set
438# CONFIG_HAMRADIO is not set
439# CONFIG_CAN is not set
440# CONFIG_IRDA is not set
441# CONFIG_BT is not set
442# CONFIG_AF_RXRPC is not set
443# CONFIG_WIRELESS is not set
444# CONFIG_WIMAX is not set
445# CONFIG_RFKILL is not set
446# CONFIG_NET_9P is not set
447
448#
449# Device Drivers
450#
451
452#
453# Generic Driver Options
454#
455CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
456# CONFIG_DEVTMPFS is not set
457CONFIG_STANDALONE=y
458CONFIG_PREVENT_FIRMWARE_BUILD=y
459# CONFIG_FW_LOADER is not set
460# CONFIG_DEBUG_DRIVER is not set
461# CONFIG_DEBUG_DEVRES is not set
462# CONFIG_SYS_HYPERVISOR is not set
463CONFIG_CONNECTOR=y
464CONFIG_PROC_EVENTS=y
465# CONFIG_MTD is not set
466# CONFIG_PARPORT is not set
467CONFIG_BLK_DEV=y
468# CONFIG_BLK_DEV_COW_COMMON is not set
469CONFIG_BLK_DEV_LOOP=y
470# CONFIG_BLK_DEV_CRYPTOLOOP is not set
471# CONFIG_BLK_DEV_NBD is not set
472# CONFIG_BLK_DEV_UB is not set
473CONFIG_BLK_DEV_RAM=y
474CONFIG_BLK_DEV_RAM_COUNT=16
475CONFIG_BLK_DEV_RAM_SIZE=16384
476# CONFIG_BLK_DEV_XIP is not set
477# CONFIG_CDROM_PKTCDVD is not set
478# CONFIG_ATA_OVER_ETH is not set
479# CONFIG_MG_DISK is not set
480CONFIG_MISC_DEVICES=y
481# CONFIG_ICS932S401 is not set
482# CONFIG_ENCLOSURE_SERVICES is not set
483# CONFIG_ISL29003 is not set
484# CONFIG_C2PORT is not set
485
486#
487# EEPROM support
488#
489# CONFIG_EEPROM_AT24 is not set
490# CONFIG_EEPROM_AT25 is not set
491# CONFIG_EEPROM_LEGACY is not set
492# CONFIG_EEPROM_MAX6875 is not set
493# CONFIG_EEPROM_93CX6 is not set
494CONFIG_HAVE_IDE=y
495# CONFIG_IDE is not set
496
497#
498# SCSI device support
499#
500# CONFIG_RAID_ATTRS is not set
501CONFIG_SCSI=y
502CONFIG_SCSI_DMA=y
503# CONFIG_SCSI_TGT is not set
504# CONFIG_SCSI_NETLINK is not set
505CONFIG_SCSI_PROC_FS=y
506
507#
508# SCSI support type (disk, tape, CD-ROM)
509#
510CONFIG_BLK_DEV_SD=y
511# CONFIG_CHR_DEV_ST is not set
512# CONFIG_CHR_DEV_OSST is not set
513# CONFIG_BLK_DEV_SR is not set
514# CONFIG_CHR_DEV_SG is not set
515# CONFIG_CHR_DEV_SCH is not set
516# CONFIG_SCSI_MULTI_LUN is not set
517# CONFIG_SCSI_CONSTANTS is not set
518# CONFIG_SCSI_LOGGING is not set
519# CONFIG_SCSI_SCAN_ASYNC is not set
520CONFIG_SCSI_WAIT_SCAN=m
521
522#
523# SCSI Transports
524#
525# CONFIG_SCSI_SPI_ATTRS is not set
526# CONFIG_SCSI_FC_ATTRS is not set
527# CONFIG_SCSI_ISCSI_ATTRS is not set
528# CONFIG_SCSI_SAS_LIBSAS is not set
529# CONFIG_SCSI_SRP_ATTRS is not set
530CONFIG_SCSI_LOWLEVEL=y
531# CONFIG_ISCSI_TCP is not set
532# CONFIG_LIBFC is not set
533# CONFIG_LIBFCOE is not set
534# CONFIG_SCSI_DEBUG is not set
535# CONFIG_SCSI_DH is not set
536# CONFIG_SCSI_OSD_INITIATOR is not set
537# CONFIG_ATA is not set
538# CONFIG_MD is not set
539CONFIG_NETDEVICES=y
540# CONFIG_DUMMY is not set
541# CONFIG_BONDING is not set
542# CONFIG_MACVLAN is not set
543# CONFIG_EQUALIZER is not set
544# CONFIG_TUN is not set
545# CONFIG_VETH is not set
546CONFIG_PHYLIB=y
547
548#
549# MII PHY device drivers
550#
551# CONFIG_MARVELL_PHY is not set
552# CONFIG_DAVICOM_PHY is not set
553# CONFIG_QSEMI_PHY is not set
554# CONFIG_LXT_PHY is not set
555# CONFIG_CICADA_PHY is not set
556# CONFIG_VITESSE_PHY is not set
557CONFIG_SMSC_PHY=y
558# CONFIG_BROADCOM_PHY is not set
559# CONFIG_ICPLUS_PHY is not set
560# CONFIG_REALTEK_PHY is not set
561# CONFIG_NATIONAL_PHY is not set
562# CONFIG_STE10XP is not set
563# CONFIG_LSI_ET1011C_PHY is not set
564# CONFIG_FIXED_PHY is not set
565# CONFIG_MDIO_BITBANG is not set
566CONFIG_NET_ETHERNET=y
567CONFIG_MII=y
568# CONFIG_AX88796 is not set
569# CONFIG_SMC91X is not set
570# CONFIG_DM9000 is not set
571# CONFIG_ENC28J60 is not set
572# CONFIG_ETHOC is not set
573# CONFIG_SMC911X is not set
574CONFIG_SMSC911X=y
575# CONFIG_DNET is not set
576# CONFIG_IBM_NEW_EMAC_ZMII is not set
577# CONFIG_IBM_NEW_EMAC_RGMII is not set
578# CONFIG_IBM_NEW_EMAC_TAH is not set
579# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
580# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
581# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
582# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
583# CONFIG_B44 is not set
584# CONFIG_KS8842 is not set
585# CONFIG_KS8851 is not set
586# CONFIG_KS8851_MLL is not set
587CONFIG_NETDEV_1000=y
588CONFIG_NETDEV_10000=y
589CONFIG_WLAN=y
590# CONFIG_WLAN_PRE80211 is not set
591# CONFIG_WLAN_80211 is not set
592
593#
594# Enable WiMAX (Networking options) to see the WiMAX drivers
595#
596
597#
598# USB Network Adapters
599#
600# CONFIG_USB_CATC is not set
601# CONFIG_USB_KAWETH is not set
602# CONFIG_USB_PEGASUS is not set
603# CONFIG_USB_RTL8150 is not set
604# CONFIG_USB_USBNET is not set
605# CONFIG_WAN is not set
606# CONFIG_PPP is not set
607# CONFIG_SLIP is not set
608# CONFIG_NETCONSOLE is not set
609# CONFIG_NETPOLL is not set
610# CONFIG_NET_POLL_CONTROLLER is not set
611# CONFIG_ISDN is not set
612# CONFIG_PHONE is not set
613
614#
615# Input device support
616#
617CONFIG_INPUT=y
618# CONFIG_INPUT_FF_MEMLESS is not set
619# CONFIG_INPUT_POLLDEV is not set
620
621#
622# Userland interfaces
623#
624# CONFIG_INPUT_MOUSEDEV is not set
625# CONFIG_INPUT_JOYDEV is not set
626CONFIG_INPUT_EVDEV=y
627# CONFIG_INPUT_EVBUG is not set
628
629#
630# Input Device Drivers
631#
632# CONFIG_INPUT_KEYBOARD is not set
633# CONFIG_INPUT_MOUSE is not set
634# CONFIG_INPUT_JOYSTICK is not set
635# CONFIG_INPUT_TABLET is not set
636CONFIG_INPUT_TOUCHSCREEN=y
637CONFIG_TOUCHSCREEN_ADS7846=y
638# CONFIG_TOUCHSCREEN_AD7877 is not set
639# CONFIG_TOUCHSCREEN_AD7879_I2C is not set
640# CONFIG_TOUCHSCREEN_AD7879_SPI is not set
641# CONFIG_TOUCHSCREEN_AD7879 is not set
642# CONFIG_TOUCHSCREEN_EETI is not set
643# CONFIG_TOUCHSCREEN_FUJITSU is not set
644# CONFIG_TOUCHSCREEN_GUNZE is not set
645# CONFIG_TOUCHSCREEN_ELO is not set
646# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
647# CONFIG_TOUCHSCREEN_MCS5000 is not set
648# CONFIG_TOUCHSCREEN_MTOUCH is not set
649# CONFIG_TOUCHSCREEN_INEXIO is not set
650# CONFIG_TOUCHSCREEN_MK712 is not set
651# CONFIG_TOUCHSCREEN_PENMOUNT is not set
652# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
653# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
654# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
655# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
656# CONFIG_TOUCHSCREEN_TSC2007 is not set
657# CONFIG_TOUCHSCREEN_W90X900 is not set
658# CONFIG_INPUT_MISC is not set
659
660#
661# Hardware I/O ports
662#
663# CONFIG_SERIO is not set
664# CONFIG_GAMEPORT is not set
665
666#
667# Character devices
668#
669CONFIG_VT=y
670CONFIG_CONSOLE_TRANSLATIONS=y
671CONFIG_VT_CONSOLE=y
672CONFIG_HW_CONSOLE=y
673# CONFIG_VT_HW_CONSOLE_BINDING is not set
674CONFIG_DEVKMEM=y
675# CONFIG_SERIAL_NONSTANDARD is not set
676
677#
678# Serial drivers
679#
680CONFIG_SERIAL_8250=y
681CONFIG_SERIAL_8250_CONSOLE=y
682CONFIG_SERIAL_8250_NR_UARTS=32
683CONFIG_SERIAL_8250_RUNTIME_UARTS=4
684CONFIG_SERIAL_8250_EXTENDED=y
685CONFIG_SERIAL_8250_MANY_PORTS=y
686CONFIG_SERIAL_8250_SHARE_IRQ=y
687CONFIG_SERIAL_8250_DETECT_IRQ=y
688CONFIG_SERIAL_8250_RSA=y
689
690#
691# Non-8250 serial port support
692#
693# CONFIG_SERIAL_MAX3100 is not set
694CONFIG_SERIAL_CORE=y
695CONFIG_SERIAL_CORE_CONSOLE=y
696CONFIG_UNIX98_PTYS=y
697# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
698# CONFIG_LEGACY_PTYS is not set
699# CONFIG_IPMI_HANDLER is not set
700CONFIG_HW_RANDOM=y
701# CONFIG_HW_RANDOM_TIMERIOMEM is not set
702# CONFIG_R3964 is not set
703# CONFIG_RAW_DRIVER is not set
704# CONFIG_TCG_TPM is not set
705CONFIG_I2C=y
706CONFIG_I2C_BOARDINFO=y
707CONFIG_I2C_COMPAT=y
708CONFIG_I2C_CHARDEV=y
709CONFIG_I2C_HELPER_AUTO=y
710
711#
712# I2C Hardware Bus support
713#
714
715#
716# I2C system bus drivers (mostly embedded / system-on-chip)
717#
718# CONFIG_I2C_DESIGNWARE is not set
719# CONFIG_I2C_GPIO is not set
720# CONFIG_I2C_OCORES is not set
721CONFIG_I2C_OMAP=y
722# CONFIG_I2C_SIMTEC is not set
723
724#
725# External I2C/SMBus adapter drivers
726#
727# CONFIG_I2C_PARPORT_LIGHT is not set
728# CONFIG_I2C_TAOS_EVM is not set
729# CONFIG_I2C_TINY_USB is not set
730
731#
732# Other I2C/SMBus bus drivers
733#
734# CONFIG_I2C_PCA_PLATFORM is not set
735# CONFIG_I2C_STUB is not set
736
737#
738# Miscellaneous I2C Chip support
739#
740# CONFIG_DS1682 is not set
741# CONFIG_SENSORS_TSL2550 is not set
742# CONFIG_I2C_DEBUG_CORE is not set
743# CONFIG_I2C_DEBUG_ALGO is not set
744# CONFIG_I2C_DEBUG_BUS is not set
745# CONFIG_I2C_DEBUG_CHIP is not set
746CONFIG_SPI=y
747# CONFIG_SPI_DEBUG is not set
748CONFIG_SPI_MASTER=y
749
750#
751# SPI Master Controller Drivers
752#
753# CONFIG_SPI_BITBANG is not set
754# CONFIG_SPI_GPIO is not set
755CONFIG_SPI_OMAP24XX=y
756
757#
758# SPI Protocol Masters
759#
760# CONFIG_SPI_SPIDEV is not set
761# CONFIG_SPI_TLE62X0 is not set
762
763#
764# PPS support
765#
766# CONFIG_PPS is not set
767CONFIG_ARCH_REQUIRE_GPIOLIB=y
768CONFIG_GPIOLIB=y
769# CONFIG_DEBUG_GPIO is not set
770# CONFIG_GPIO_SYSFS is not set
771
772#
773# Memory mapped GPIO expanders:
774#
775
776#
777# I2C GPIO expanders:
778#
779# CONFIG_GPIO_MAX732X is not set
780# CONFIG_GPIO_PCA953X is not set
781# CONFIG_GPIO_PCF857X is not set
782CONFIG_GPIO_TWL4030=y
783
784#
785# PCI GPIO expanders:
786#
787
788#
789# SPI GPIO expanders:
790#
791# CONFIG_GPIO_MAX7301 is not set
792# CONFIG_GPIO_MCP23S08 is not set
793# CONFIG_GPIO_MC33880 is not set
794
795#
796# AC97 GPIO expanders:
797#
798CONFIG_W1=y
799CONFIG_W1_CON=y
800
801#
802# 1-wire Bus Masters
803#
804# CONFIG_W1_MASTER_DS2490 is not set
805# CONFIG_W1_MASTER_DS2482 is not set
806# CONFIG_W1_MASTER_DS1WM is not set
807# CONFIG_W1_MASTER_GPIO is not set
808# CONFIG_HDQ_MASTER_OMAP is not set
809
810#
811# 1-wire Slaves
812#
813# CONFIG_W1_SLAVE_THERM is not set
814# CONFIG_W1_SLAVE_SMEM is not set
815# CONFIG_W1_SLAVE_DS2431 is not set
816# CONFIG_W1_SLAVE_DS2433 is not set
817# CONFIG_W1_SLAVE_DS2760 is not set
818# CONFIG_W1_SLAVE_BQ27000 is not set
819CONFIG_POWER_SUPPLY=y
820# CONFIG_POWER_SUPPLY_DEBUG is not set
821# CONFIG_PDA_POWER is not set
822# CONFIG_BATTERY_DS2760 is not set
823# CONFIG_BATTERY_DS2782 is not set
824# CONFIG_BATTERY_BQ27x00 is not set
825# CONFIG_BATTERY_MAX17040 is not set
826# CONFIG_HWMON is not set
827# CONFIG_THERMAL is not set
828CONFIG_WATCHDOG=y
829CONFIG_WATCHDOG_NOWAYOUT=y
830
831#
832# Watchdog Device Drivers
833#
834# CONFIG_SOFT_WATCHDOG is not set
835# CONFIG_OMAP_WATCHDOG is not set
836# CONFIG_TWL4030_WATCHDOG is not set
837
838#
839# USB-based Watchdog Cards
840#
841# CONFIG_USBPCWATCHDOG is not set
842CONFIG_SSB_POSSIBLE=y
843
844#
845# Sonics Silicon Backplane
846#
847# CONFIG_SSB is not set
848
849#
850# Multifunction device drivers
851#
852# CONFIG_MFD_CORE is not set
853# CONFIG_MFD_SM501 is not set
854# CONFIG_MFD_ASIC3 is not set
855# CONFIG_HTC_EGPIO is not set
856# CONFIG_HTC_PASIC3 is not set
857# CONFIG_TPS65010 is not set
858CONFIG_TWL4030_CORE=y
859# CONFIG_TWL4030_POWER is not set
860# CONFIG_MFD_TMIO is not set
861# CONFIG_MFD_T7L66XB is not set
862# CONFIG_MFD_TC6387XB is not set
863# CONFIG_MFD_TC6393XB is not set
864# CONFIG_PMIC_DA903X is not set
865# CONFIG_MFD_WM8400 is not set
866# CONFIG_MFD_WM831X is not set
867# CONFIG_MFD_WM8350_I2C is not set
868# CONFIG_MFD_PCF50633 is not set
869# CONFIG_MFD_MC13783 is not set
870# CONFIG_AB3100_CORE is not set
871# CONFIG_EZX_PCAP is not set
872CONFIG_REGULATOR=y
873# CONFIG_REGULATOR_DEBUG is not set
874# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
875# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
876# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set
877# CONFIG_REGULATOR_BQ24022 is not set
878# CONFIG_REGULATOR_MAX1586 is not set
879CONFIG_REGULATOR_TWL4030=y
880# CONFIG_REGULATOR_LP3971 is not set
881# CONFIG_REGULATOR_TPS65023 is not set
882# CONFIG_REGULATOR_TPS6507X is not set
883# CONFIG_MEDIA_SUPPORT is not set
884
885#
886# Graphics support
887#
888# CONFIG_VGASTATE is not set
889CONFIG_VIDEO_OUTPUT_CONTROL=m
890# CONFIG_FB is not set
891# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
892
893#
894# Display device support
895#
896# CONFIG_DISPLAY_SUPPORT is not set
897
898#
899# Console display driver support
900#
901# CONFIG_VGA_CONSOLE is not set
902CONFIG_DUMMY_CONSOLE=y
903CONFIG_SOUND=y
904# CONFIG_SOUND_OSS_CORE is not set
905CONFIG_SND=y
906CONFIG_SND_TIMER=m
907CONFIG_SND_PCM=m
908# CONFIG_SND_SEQUENCER is not set
909# CONFIG_SND_MIXER_OSS is not set
910# CONFIG_SND_PCM_OSS is not set
911# CONFIG_SND_HRTIMER is not set
912# CONFIG_SND_DYNAMIC_MINORS is not set
913CONFIG_SND_SUPPORT_OLD_API=y
914CONFIG_SND_VERBOSE_PROCFS=y
915# CONFIG_SND_VERBOSE_PRINTK is not set
916# CONFIG_SND_DEBUG is not set
917# CONFIG_SND_RAWMIDI_SEQ is not set
918# CONFIG_SND_OPL3_LIB_SEQ is not set
919# CONFIG_SND_OPL4_LIB_SEQ is not set
920# CONFIG_SND_SBAWE_SEQ is not set
921# CONFIG_SND_EMU10K1_SEQ is not set
922CONFIG_SND_DRIVERS=y
923# CONFIG_SND_DUMMY is not set
924# CONFIG_SND_MTPAV is not set
925# CONFIG_SND_SERIAL_U16550 is not set
926# CONFIG_SND_MPU401 is not set
927CONFIG_SND_ARM=y
928CONFIG_SND_SPI=y
929CONFIG_SND_USB=y
930# CONFIG_SND_USB_AUDIO is not set
931# CONFIG_SND_USB_CAIAQ is not set
932# CONFIG_SND_SOC is not set
933# CONFIG_SOUND_PRIME is not set
934CONFIG_HID_SUPPORT=y
935CONFIG_HID=y
936# CONFIG_HIDRAW is not set
937
938#
939# USB Input Devices
940#
941CONFIG_USB_HID=y
942# CONFIG_HID_PID is not set
943# CONFIG_USB_HIDDEV is not set
944
945#
946# Special HID drivers
947#
948# CONFIG_HID_A4TECH is not set
949# CONFIG_HID_APPLE is not set
950# CONFIG_HID_BELKIN is not set
951# CONFIG_HID_CHERRY is not set
952# CONFIG_HID_CHICONY is not set
953# CONFIG_HID_CYPRESS is not set
954# CONFIG_HID_DRAGONRISE is not set
955# CONFIG_HID_EZKEY is not set
956# CONFIG_HID_KYE is not set
957# CONFIG_HID_GYRATION is not set
958# CONFIG_HID_TWINHAN is not set
959# CONFIG_HID_KENSINGTON is not set
960# CONFIG_HID_LOGITECH is not set
961# CONFIG_HID_MICROSOFT is not set
962# CONFIG_HID_MONTEREY is not set
963# CONFIG_HID_NTRIG is not set
964# CONFIG_HID_PANTHERLORD is not set
965# CONFIG_HID_PETALYNX is not set
966# CONFIG_HID_SAMSUNG is not set
967# CONFIG_HID_SONY is not set
968# CONFIG_HID_SUNPLUS is not set
969# CONFIG_HID_GREENASIA is not set
970# CONFIG_HID_SMARTJOYPLUS is not set
971# CONFIG_HID_TOPSEED is not set
972# CONFIG_HID_THRUSTMASTER is not set
973# CONFIG_HID_ZEROPLUS is not set
974CONFIG_USB_SUPPORT=y
975CONFIG_USB_ARCH_HAS_HCD=y
976CONFIG_USB_ARCH_HAS_OHCI=y
977CONFIG_USB_ARCH_HAS_EHCI=y
978CONFIG_USB=y
979CONFIG_USB_DEBUG=y
980CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
981
982#
983# Miscellaneous USB options
984#
985CONFIG_USB_DEVICEFS=y
986# CONFIG_USB_DEVICE_CLASS is not set
987# CONFIG_USB_DYNAMIC_MINORS is not set
988CONFIG_USB_SUSPEND=y
989CONFIG_USB_OTG=y
990# CONFIG_USB_OTG_WHITELIST is not set
991# CONFIG_USB_OTG_BLACKLIST_HUB is not set
992CONFIG_USB_MON=y
993# CONFIG_USB_WUSB is not set
994# CONFIG_USB_WUSB_CBAF is not set
995
996#
997# USB Host Controller Drivers
998#
999# CONFIG_USB_C67X00_HCD is not set
1000# CONFIG_USB_EHCI_HCD is not set
1001# CONFIG_USB_OXU210HP_HCD is not set
1002# CONFIG_USB_ISP116X_HCD is not set
1003# CONFIG_USB_ISP1760_HCD is not set
1004# CONFIG_USB_ISP1362_HCD is not set
1005# CONFIG_USB_OHCI_HCD is not set
1006# CONFIG_USB_SL811_HCD is not set
1007# CONFIG_USB_R8A66597_HCD is not set
1008# CONFIG_USB_HWA_HCD is not set
1009CONFIG_USB_MUSB_HDRC=y
1010CONFIG_USB_MUSB_SOC=y
1011
1012#
1013# OMAP 343x high speed USB support
1014#
1015# CONFIG_USB_MUSB_HOST is not set
1016# CONFIG_USB_MUSB_PERIPHERAL is not set
1017CONFIG_USB_MUSB_OTG=y
1018CONFIG_USB_GADGET_MUSB_HDRC=y
1019CONFIG_USB_MUSB_HDRC_HCD=y
1020# CONFIG_MUSB_PIO_ONLY is not set
1021CONFIG_USB_INVENTRA_DMA=y
1022# CONFIG_USB_TI_CPPI_DMA is not set
1023CONFIG_USB_MUSB_DEBUG=y
1024
1025#
1026# USB Device Class drivers
1027#
1028# CONFIG_USB_ACM is not set
1029# CONFIG_USB_PRINTER is not set
1030# CONFIG_USB_WDM is not set
1031# CONFIG_USB_TMC is not set
1032
1033#
1034# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
1035#
1036
1037#
1038# also be needed; see USB_STORAGE Help for more info
1039#
1040CONFIG_USB_STORAGE=y
1041# CONFIG_USB_STORAGE_DEBUG is not set
1042# CONFIG_USB_STORAGE_DATAFAB is not set
1043# CONFIG_USB_STORAGE_FREECOM is not set
1044# CONFIG_USB_STORAGE_ISD200 is not set
1045# CONFIG_USB_STORAGE_USBAT is not set
1046# CONFIG_USB_STORAGE_SDDR09 is not set
1047# CONFIG_USB_STORAGE_SDDR55 is not set
1048# CONFIG_USB_STORAGE_JUMPSHOT is not set
1049# CONFIG_USB_STORAGE_ALAUDA is not set
1050# CONFIG_USB_STORAGE_ONETOUCH is not set
1051# CONFIG_USB_STORAGE_KARMA is not set
1052# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
1053# CONFIG_USB_LIBUSUAL is not set
1054
1055#
1056# USB Imaging devices
1057#
1058# CONFIG_USB_MDC800 is not set
1059# CONFIG_USB_MICROTEK is not set
1060
1061#
1062# USB port drivers
1063#
1064# CONFIG_USB_SERIAL is not set
1065
1066#
1067# USB Miscellaneous drivers
1068#
1069# CONFIG_USB_EMI62 is not set
1070# CONFIG_USB_EMI26 is not set
1071# CONFIG_USB_ADUTUX is not set
1072# CONFIG_USB_SEVSEG is not set
1073# CONFIG_USB_RIO500 is not set
1074# CONFIG_USB_LEGOTOWER is not set
1075# CONFIG_USB_LCD is not set
1076# CONFIG_USB_BERRY_CHARGE is not set
1077# CONFIG_USB_LED is not set
1078# CONFIG_USB_CYPRESS_CY7C63 is not set
1079# CONFIG_USB_CYTHERM is not set
1080# CONFIG_USB_IDMOUSE is not set
1081# CONFIG_USB_FTDI_ELAN is not set
1082# CONFIG_USB_APPLEDISPLAY is not set
1083# CONFIG_USB_SISUSBVGA is not set
1084# CONFIG_USB_LD is not set
1085# CONFIG_USB_TRANCEVIBRATOR is not set
1086# CONFIG_USB_IOWARRIOR is not set
1087CONFIG_USB_TEST=m
1088# CONFIG_USB_ISIGHTFW is not set
1089# CONFIG_USB_VST is not set
1090CONFIG_USB_GADGET=m
1091CONFIG_USB_GADGET_DEBUG=y
1092CONFIG_USB_GADGET_DEBUG_FILES=y
1093CONFIG_USB_GADGET_VBUS_DRAW=2
1094CONFIG_USB_GADGET_SELECTED=y
1095# CONFIG_USB_GADGET_AT91 is not set
1096# CONFIG_USB_GADGET_ATMEL_USBA is not set
1097# CONFIG_USB_GADGET_FSL_USB2 is not set
1098# CONFIG_USB_GADGET_LH7A40X is not set
1099# CONFIG_USB_GADGET_OMAP is not set
1100# CONFIG_USB_GADGET_PXA25X is not set
1101# CONFIG_USB_GADGET_R8A66597 is not set
1102# CONFIG_USB_GADGET_PXA27X is not set
1103# CONFIG_USB_GADGET_S3C_HSOTG is not set
1104# CONFIG_USB_GADGET_IMX is not set
1105# CONFIG_USB_GADGET_S3C2410 is not set
1106# CONFIG_USB_GADGET_M66592 is not set
1107# CONFIG_USB_GADGET_AMD5536UDC is not set
1108# CONFIG_USB_GADGET_FSL_QE is not set
1109# CONFIG_USB_GADGET_CI13XXX is not set
1110# CONFIG_USB_GADGET_NET2280 is not set
1111# CONFIG_USB_GADGET_GOKU is not set
1112# CONFIG_USB_GADGET_LANGWELL is not set
1113# CONFIG_USB_GADGET_DUMMY_HCD is not set
1114CONFIG_USB_GADGET_DUALSPEED=y
1115CONFIG_USB_ZERO=m
1116# CONFIG_USB_ZERO_HNPTEST is not set
1117CONFIG_USB_AUDIO=m
1118CONFIG_USB_ETH=m
1119CONFIG_USB_ETH_RNDIS=y
1120# CONFIG_USB_ETH_EEM is not set
1121CONFIG_USB_GADGETFS=m
1122CONFIG_USB_FILE_STORAGE=m
1123# CONFIG_USB_FILE_STORAGE_TEST is not set
1124CONFIG_USB_G_SERIAL=m
1125# CONFIG_USB_MIDI_GADGET is not set
1126# CONFIG_USB_G_PRINTER is not set
1127CONFIG_USB_CDC_COMPOSITE=m
1128
1129#
1130# OTG and related infrastructure
1131#
1132CONFIG_USB_OTG_UTILS=y
1133# CONFIG_USB_GPIO_VBUS is not set
1134# CONFIG_ISP1301_OMAP is not set
1135CONFIG_TWL4030_USB=y
1136# CONFIG_NOP_USB_XCEIV is not set
1137CONFIG_MMC=y
1138# CONFIG_MMC_DEBUG is not set
1139# CONFIG_MMC_UNSAFE_RESUME is not set
1140
1141#
1142# MMC/SD/SDIO Card Drivers
1143#
1144CONFIG_MMC_BLOCK=y
1145CONFIG_MMC_BLOCK_BOUNCE=y
1146# CONFIG_SDIO_UART is not set
1147# CONFIG_MMC_TEST is not set
1148
1149#
1150# MMC/SD/SDIO Host Controller Drivers
1151#
1152# CONFIG_MMC_SDHCI is not set
1153# CONFIG_MMC_OMAP is not set
1154CONFIG_MMC_OMAP_HS=y
1155# CONFIG_MMC_AT91 is not set
1156# CONFIG_MMC_ATMELMCI is not set
1157# CONFIG_MMC_SPI is not set
1158# CONFIG_MEMSTICK is not set
1159# CONFIG_NEW_LEDS is not set
1160# CONFIG_ACCESSIBILITY is not set
1161CONFIG_RTC_LIB=y
1162CONFIG_RTC_CLASS=y
1163CONFIG_RTC_HCTOSYS=y
1164CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
1165# CONFIG_RTC_DEBUG is not set
1166
1167#
1168# RTC interfaces
1169#
1170CONFIG_RTC_INTF_SYSFS=y
1171CONFIG_RTC_INTF_PROC=y
1172CONFIG_RTC_INTF_DEV=y
1173# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
1174# CONFIG_RTC_DRV_TEST is not set
1175
1176#
1177# I2C RTC drivers
1178#
1179# CONFIG_RTC_DRV_DS1307 is not set
1180# CONFIG_RTC_DRV_DS1374 is not set
1181# CONFIG_RTC_DRV_DS1672 is not set
1182# CONFIG_RTC_DRV_MAX6900 is not set
1183# CONFIG_RTC_DRV_RS5C372 is not set
1184# CONFIG_RTC_DRV_ISL1208 is not set
1185# CONFIG_RTC_DRV_X1205 is not set
1186# CONFIG_RTC_DRV_PCF8563 is not set
1187# CONFIG_RTC_DRV_PCF8583 is not set
1188# CONFIG_RTC_DRV_M41T80 is not set
1189# CONFIG_RTC_DRV_TWL4030 is not set
1190# CONFIG_RTC_DRV_S35390A is not set
1191# CONFIG_RTC_DRV_FM3130 is not set
1192# CONFIG_RTC_DRV_RX8581 is not set
1193# CONFIG_RTC_DRV_RX8025 is not set
1194
1195#
1196# SPI RTC drivers
1197#
1198# CONFIG_RTC_DRV_M41T94 is not set
1199# CONFIG_RTC_DRV_DS1305 is not set
1200# CONFIG_RTC_DRV_DS1390 is not set
1201# CONFIG_RTC_DRV_MAX6902 is not set
1202# CONFIG_RTC_DRV_R9701 is not set
1203# CONFIG_RTC_DRV_RS5C348 is not set
1204# CONFIG_RTC_DRV_DS3234 is not set
1205# CONFIG_RTC_DRV_PCF2123 is not set
1206
1207#
1208# Platform RTC drivers
1209#
1210# CONFIG_RTC_DRV_CMOS is not set
1211# CONFIG_RTC_DRV_DS1286 is not set
1212# CONFIG_RTC_DRV_DS1511 is not set
1213# CONFIG_RTC_DRV_DS1553 is not set
1214# CONFIG_RTC_DRV_DS1742 is not set
1215# CONFIG_RTC_DRV_STK17TA8 is not set
1216# CONFIG_RTC_DRV_M48T86 is not set
1217# CONFIG_RTC_DRV_M48T35 is not set
1218# CONFIG_RTC_DRV_M48T59 is not set
1219# CONFIG_RTC_DRV_BQ4802 is not set
1220# CONFIG_RTC_DRV_V3020 is not set
1221
1222#
1223# on-CPU RTC drivers
1224#
1225# CONFIG_DMADEVICES is not set
1226# CONFIG_AUXDISPLAY is not set
1227# CONFIG_UIO is not set
1228
1229#
1230# TI VLYNQ
1231#
1232# CONFIG_STAGING is not set
1233
1234#
1235# CBUS support
1236#
1237# CONFIG_CBUS is not set
1238
1239#
1240# File systems
1241#
1242CONFIG_EXT2_FS=y
1243# CONFIG_EXT2_FS_XATTR is not set
1244# CONFIG_EXT2_FS_XIP is not set
1245CONFIG_EXT3_FS=y
1246# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
1247# CONFIG_EXT3_FS_XATTR is not set
1248# CONFIG_EXT4_FS is not set
1249CONFIG_JBD=y
1250# CONFIG_REISERFS_FS is not set
1251# CONFIG_JFS_FS is not set
1252CONFIG_FS_POSIX_ACL=y
1253# CONFIG_XFS_FS is not set
1254# CONFIG_GFS2_FS is not set
1255# CONFIG_OCFS2_FS is not set
1256# CONFIG_BTRFS_FS is not set
1257# CONFIG_NILFS2_FS is not set
1258CONFIG_FILE_LOCKING=y
1259CONFIG_FSNOTIFY=y
1260CONFIG_DNOTIFY=y
1261CONFIG_INOTIFY=y
1262CONFIG_INOTIFY_USER=y
1263CONFIG_QUOTA=y
1264# CONFIG_QUOTA_NETLINK_INTERFACE is not set
1265CONFIG_PRINT_QUOTA_WARNING=y
1266CONFIG_QUOTA_TREE=y
1267# CONFIG_QFMT_V1 is not set
1268CONFIG_QFMT_V2=y
1269CONFIG_QUOTACTL=y
1270# CONFIG_AUTOFS_FS is not set
1271# CONFIG_AUTOFS4_FS is not set
1272# CONFIG_FUSE_FS is not set
1273
1274#
1275# Caches
1276#
1277# CONFIG_FSCACHE is not set
1278
1279#
1280# CD-ROM/DVD Filesystems
1281#
1282# CONFIG_ISO9660_FS is not set
1283# CONFIG_UDF_FS is not set
1284
1285#
1286# DOS/FAT/NT Filesystems
1287#
1288CONFIG_FAT_FS=y
1289CONFIG_MSDOS_FS=y
1290CONFIG_VFAT_FS=y
1291CONFIG_FAT_DEFAULT_CODEPAGE=437
1292CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1293# CONFIG_NTFS_FS is not set
1294
1295#
1296# Pseudo filesystems
1297#
1298CONFIG_PROC_FS=y
1299CONFIG_PROC_SYSCTL=y
1300CONFIG_PROC_PAGE_MONITOR=y
1301CONFIG_SYSFS=y
1302CONFIG_TMPFS=y
1303# CONFIG_TMPFS_POSIX_ACL is not set
1304# CONFIG_HUGETLB_PAGE is not set
1305# CONFIG_CONFIGFS_FS is not set
1306CONFIG_MISC_FILESYSTEMS=y
1307# CONFIG_ADFS_FS is not set
1308# CONFIG_AFFS_FS is not set
1309# CONFIG_HFS_FS is not set
1310# CONFIG_HFSPLUS_FS is not set
1311# CONFIG_BEFS_FS is not set
1312# CONFIG_BFS_FS is not set
1313# CONFIG_EFS_FS is not set
1314# CONFIG_CRAMFS is not set
1315# CONFIG_SQUASHFS is not set
1316# CONFIG_VXFS_FS is not set
1317# CONFIG_MINIX_FS is not set
1318# CONFIG_OMFS_FS is not set
1319# CONFIG_HPFS_FS is not set
1320# CONFIG_QNX4FS_FS is not set
1321# CONFIG_ROMFS_FS is not set
1322# CONFIG_SYSV_FS is not set
1323# CONFIG_UFS_FS is not set
1324CONFIG_NETWORK_FILESYSTEMS=y
1325CONFIG_NFS_FS=y
1326CONFIG_NFS_V3=y
1327CONFIG_NFS_V3_ACL=y
1328CONFIG_NFS_V4=y
1329# CONFIG_NFS_V4_1 is not set
1330CONFIG_ROOT_NFS=y
1331# CONFIG_NFSD is not set
1332CONFIG_LOCKD=y
1333CONFIG_LOCKD_V4=y
1334CONFIG_NFS_ACL_SUPPORT=y
1335CONFIG_NFS_COMMON=y
1336CONFIG_SUNRPC=y
1337CONFIG_SUNRPC_GSS=y
1338CONFIG_RPCSEC_GSS_KRB5=y
1339# CONFIG_RPCSEC_GSS_SPKM3 is not set
1340# CONFIG_SMB_FS is not set
1341# CONFIG_CIFS is not set
1342# CONFIG_NCP_FS is not set
1343# CONFIG_CODA_FS is not set
1344# CONFIG_AFS_FS is not set
1345
1346#
1347# Partition Types
1348#
1349CONFIG_PARTITION_ADVANCED=y
1350# CONFIG_ACORN_PARTITION is not set
1351# CONFIG_OSF_PARTITION is not set
1352# CONFIG_AMIGA_PARTITION is not set
1353# CONFIG_ATARI_PARTITION is not set
1354# CONFIG_MAC_PARTITION is not set
1355CONFIG_MSDOS_PARTITION=y
1356# CONFIG_BSD_DISKLABEL is not set
1357# CONFIG_MINIX_SUBPARTITION is not set
1358# CONFIG_SOLARIS_X86_PARTITION is not set
1359# CONFIG_UNIXWARE_DISKLABEL is not set
1360# CONFIG_LDM_PARTITION is not set
1361# CONFIG_SGI_PARTITION is not set
1362# CONFIG_ULTRIX_PARTITION is not set
1363# CONFIG_SUN_PARTITION is not set
1364# CONFIG_KARMA_PARTITION is not set
1365# CONFIG_EFI_PARTITION is not set
1366# CONFIG_SYSV68_PARTITION is not set
1367CONFIG_NLS=y
1368CONFIG_NLS_DEFAULT="iso8859-1"
1369CONFIG_NLS_CODEPAGE_437=y
1370# CONFIG_NLS_CODEPAGE_737 is not set
1371# CONFIG_NLS_CODEPAGE_775 is not set
1372# CONFIG_NLS_CODEPAGE_850 is not set
1373# CONFIG_NLS_CODEPAGE_852 is not set
1374# CONFIG_NLS_CODEPAGE_855 is not set
1375# CONFIG_NLS_CODEPAGE_857 is not set
1376# CONFIG_NLS_CODEPAGE_860 is not set
1377# CONFIG_NLS_CODEPAGE_861 is not set
1378# CONFIG_NLS_CODEPAGE_862 is not set
1379# CONFIG_NLS_CODEPAGE_863 is not set
1380# CONFIG_NLS_CODEPAGE_864 is not set
1381# CONFIG_NLS_CODEPAGE_865 is not set
1382# CONFIG_NLS_CODEPAGE_866 is not set
1383# CONFIG_NLS_CODEPAGE_869 is not set
1384# CONFIG_NLS_CODEPAGE_936 is not set
1385# CONFIG_NLS_CODEPAGE_950 is not set
1386# CONFIG_NLS_CODEPAGE_932 is not set
1387# CONFIG_NLS_CODEPAGE_949 is not set
1388# CONFIG_NLS_CODEPAGE_874 is not set
1389# CONFIG_NLS_ISO8859_8 is not set
1390# CONFIG_NLS_CODEPAGE_1250 is not set
1391# CONFIG_NLS_CODEPAGE_1251 is not set
1392# CONFIG_NLS_ASCII is not set
1393CONFIG_NLS_ISO8859_1=y
1394# CONFIG_NLS_ISO8859_2 is not set
1395# CONFIG_NLS_ISO8859_3 is not set
1396# CONFIG_NLS_ISO8859_4 is not set
1397# CONFIG_NLS_ISO8859_5 is not set
1398# CONFIG_NLS_ISO8859_6 is not set
1399# CONFIG_NLS_ISO8859_7 is not set
1400# CONFIG_NLS_ISO8859_9 is not set
1401# CONFIG_NLS_ISO8859_13 is not set
1402# CONFIG_NLS_ISO8859_14 is not set
1403# CONFIG_NLS_ISO8859_15 is not set
1404# CONFIG_NLS_KOI8_R is not set
1405# CONFIG_NLS_KOI8_U is not set
1406# CONFIG_NLS_UTF8 is not set
1407# CONFIG_DLM is not set
1408
1409#
1410# Kernel hacking
1411#
1412# CONFIG_PRINTK_TIME is not set
1413CONFIG_ENABLE_WARN_DEPRECATED=y
1414CONFIG_ENABLE_MUST_CHECK=y
1415CONFIG_FRAME_WARN=1024
1416CONFIG_MAGIC_SYSRQ=y
1417# CONFIG_STRIP_ASM_SYMS is not set
1418# CONFIG_UNUSED_SYMBOLS is not set
1419# CONFIG_DEBUG_FS is not set
1420# CONFIG_HEADERS_CHECK is not set
1421CONFIG_DEBUG_KERNEL=y
1422# CONFIG_DEBUG_SHIRQ is not set
1423CONFIG_DETECT_SOFTLOCKUP=y
1424# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1425CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
1426CONFIG_DETECT_HUNG_TASK=y
1427# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
1428CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
1429CONFIG_SCHED_DEBUG=y
1430# CONFIG_SCHEDSTATS is not set
1431# CONFIG_TIMER_STATS is not set
1432# CONFIG_DEBUG_OBJECTS is not set
1433# CONFIG_DEBUG_SLAB is not set
1434# CONFIG_DEBUG_KMEMLEAK is not set
1435# CONFIG_DEBUG_RT_MUTEXES is not set
1436# CONFIG_RT_MUTEX_TESTER is not set
1437# CONFIG_DEBUG_SPINLOCK is not set
1438CONFIG_DEBUG_MUTEXES=y
1439# CONFIG_DEBUG_LOCK_ALLOC is not set
1440# CONFIG_PROVE_LOCKING is not set
1441# CONFIG_LOCK_STAT is not set
1442# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1443# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1444# CONFIG_DEBUG_KOBJECT is not set
1445# CONFIG_DEBUG_BUGVERBOSE is not set
1446CONFIG_DEBUG_INFO=y
1447# CONFIG_DEBUG_VM is not set
1448# CONFIG_DEBUG_WRITECOUNT is not set
1449# CONFIG_DEBUG_MEMORY_INIT is not set
1450# CONFIG_DEBUG_LIST is not set
1451# CONFIG_DEBUG_SG is not set
1452# CONFIG_DEBUG_NOTIFIERS is not set
1453# CONFIG_DEBUG_CREDENTIALS is not set
1454# CONFIG_BOOT_PRINTK_DELAY is not set
1455# CONFIG_RCU_TORTURE_TEST is not set
1456# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1457# CONFIG_BACKTRACE_SELF_TEST is not set
1458# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1459# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
1460# CONFIG_FAULT_INJECTION is not set
1461# CONFIG_LATENCYTOP is not set
1462# CONFIG_PAGE_POISONING is not set
1463CONFIG_HAVE_FUNCTION_TRACER=y
1464CONFIG_TRACING_SUPPORT=y
1465CONFIG_FTRACE=y
1466# CONFIG_FUNCTION_TRACER is not set
1467# CONFIG_IRQSOFF_TRACER is not set
1468# CONFIG_SCHED_TRACER is not set
1469# CONFIG_ENABLE_DEFAULT_TRACERS is not set
1470# CONFIG_BOOT_TRACER is not set
1471CONFIG_BRANCH_PROFILE_NONE=y
1472# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1473# CONFIG_PROFILE_ALL_BRANCHES is not set
1474# CONFIG_STACK_TRACER is not set
1475# CONFIG_KMEMTRACE is not set
1476# CONFIG_WORKQUEUE_TRACER is not set
1477# CONFIG_BLK_DEV_IO_TRACE is not set
1478# CONFIG_SAMPLES is not set
1479CONFIG_HAVE_ARCH_KGDB=y
1480# CONFIG_KGDB is not set
1481CONFIG_ARM_UNWIND=y
1482# CONFIG_DEBUG_USER is not set
1483# CONFIG_DEBUG_ERRORS is not set
1484# CONFIG_DEBUG_STACK_USAGE is not set
1485# CONFIG_DEBUG_LL is not set
1486
1487#
1488# Security options
1489#
1490# CONFIG_KEYS is not set
1491# CONFIG_SECURITY is not set
1492# CONFIG_SECURITYFS is not set
1493# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1494CONFIG_CRYPTO=y
1495
1496#
1497# Crypto core or helper
1498#
1499CONFIG_CRYPTO_ALGAPI=y
1500CONFIG_CRYPTO_ALGAPI2=y
1501CONFIG_CRYPTO_AEAD2=y
1502CONFIG_CRYPTO_BLKCIPHER=y
1503CONFIG_CRYPTO_BLKCIPHER2=y
1504CONFIG_CRYPTO_HASH=y
1505CONFIG_CRYPTO_HASH2=y
1506CONFIG_CRYPTO_RNG2=y
1507CONFIG_CRYPTO_PCOMP=y
1508CONFIG_CRYPTO_MANAGER=y
1509CONFIG_CRYPTO_MANAGER2=y
1510# CONFIG_CRYPTO_GF128MUL is not set
1511# CONFIG_CRYPTO_NULL is not set
1512CONFIG_CRYPTO_WORKQUEUE=y
1513# CONFIG_CRYPTO_CRYPTD is not set
1514# CONFIG_CRYPTO_AUTHENC is not set
1515# CONFIG_CRYPTO_TEST is not set
1516
1517#
1518# Authenticated Encryption with Associated Data
1519#
1520# CONFIG_CRYPTO_CCM is not set
1521# CONFIG_CRYPTO_GCM is not set
1522# CONFIG_CRYPTO_SEQIV is not set
1523
1524#
1525# Block modes
1526#
1527CONFIG_CRYPTO_CBC=y
1528# CONFIG_CRYPTO_CTR is not set
1529# CONFIG_CRYPTO_CTS is not set
1530CONFIG_CRYPTO_ECB=m
1531# CONFIG_CRYPTO_LRW is not set
1532CONFIG_CRYPTO_PCBC=m
1533# CONFIG_CRYPTO_XTS is not set
1534
1535#
1536# Hash modes
1537#
1538# CONFIG_CRYPTO_HMAC is not set
1539# CONFIG_CRYPTO_XCBC is not set
1540# CONFIG_CRYPTO_VMAC is not set
1541
1542#
1543# Digest
1544#
1545CONFIG_CRYPTO_CRC32C=y
1546# CONFIG_CRYPTO_GHASH is not set
1547# CONFIG_CRYPTO_MD4 is not set
1548CONFIG_CRYPTO_MD5=y
1549# CONFIG_CRYPTO_MICHAEL_MIC is not set
1550# CONFIG_CRYPTO_RMD128 is not set
1551# CONFIG_CRYPTO_RMD160 is not set
1552# CONFIG_CRYPTO_RMD256 is not set
1553# CONFIG_CRYPTO_RMD320 is not set
1554# CONFIG_CRYPTO_SHA1 is not set
1555# CONFIG_CRYPTO_SHA256 is not set
1556# CONFIG_CRYPTO_SHA512 is not set
1557# CONFIG_CRYPTO_TGR192 is not set
1558# CONFIG_CRYPTO_WP512 is not set
1559
1560#
1561# Ciphers
1562#
1563# CONFIG_CRYPTO_AES is not set
1564# CONFIG_CRYPTO_ANUBIS is not set
1565# CONFIG_CRYPTO_ARC4 is not set
1566# CONFIG_CRYPTO_BLOWFISH is not set
1567# CONFIG_CRYPTO_CAMELLIA is not set
1568# CONFIG_CRYPTO_CAST5 is not set
1569# CONFIG_CRYPTO_CAST6 is not set
1570CONFIG_CRYPTO_DES=y
1571# CONFIG_CRYPTO_FCRYPT is not set
1572# CONFIG_CRYPTO_KHAZAD is not set
1573# CONFIG_CRYPTO_SALSA20 is not set
1574# CONFIG_CRYPTO_SEED is not set
1575# CONFIG_CRYPTO_SERPENT is not set
1576# CONFIG_CRYPTO_TEA is not set
1577# CONFIG_CRYPTO_TWOFISH is not set
1578
1579#
1580# Compression
1581#
1582# CONFIG_CRYPTO_DEFLATE is not set
1583# CONFIG_CRYPTO_ZLIB is not set
1584# CONFIG_CRYPTO_LZO is not set
1585
1586#
1587# Random Number Generation
1588#
1589# CONFIG_CRYPTO_ANSI_CPRNG is not set
1590CONFIG_CRYPTO_HW=y
1591# CONFIG_BINARY_PRINTF is not set
1592
1593#
1594# Library routines
1595#
1596CONFIG_BITREVERSE=y
1597CONFIG_GENERIC_FIND_LAST_BIT=y
1598CONFIG_CRC_CCITT=y
1599# CONFIG_CRC16 is not set
1600CONFIG_CRC_T10DIF=y
1601# CONFIG_CRC_ITU_T is not set
1602CONFIG_CRC32=y
1603# CONFIG_CRC7 is not set
1604CONFIG_LIBCRC32C=y
1605CONFIG_ZLIB_INFLATE=y
1606CONFIG_DECOMPRESS_GZIP=y
1607CONFIG_HAS_IOMEM=y
1608CONFIG_HAS_IOPORT=y
1609CONFIG_HAS_DMA=y
1610CONFIG_NLATTR=y
diff --git a/arch/arm/configs/overo_defconfig b/arch/arm/configs/overo_defconfig
index a57f9e4124fa..b3ea2c4c0f91 100644
--- a/arch/arm/configs/overo_defconfig
+++ b/arch/arm/configs/overo_defconfig
@@ -54,8 +54,8 @@ CONFIG_FAIR_GROUP_SCHED=y
54# CONFIG_RT_GROUP_SCHED is not set 54# CONFIG_RT_GROUP_SCHED is not set
55CONFIG_USER_SCHED=y 55CONFIG_USER_SCHED=y
56# CONFIG_CGROUP_SCHED is not set 56# CONFIG_CGROUP_SCHED is not set
57CONFIG_SYSFS_DEPRECATED=y 57# CONFIG_SYSFS_DEPRECATED=y is not set
58CONFIG_SYSFS_DEPRECATED_V2=y 58# CONFIG_SYSFS_DEPRECATED_V2=y is not set
59# CONFIG_RELAY is not set 59# CONFIG_RELAY is not set
60# CONFIG_NAMESPACES is not set 60# CONFIG_NAMESPACES is not set
61CONFIG_BLK_DEV_INITRD=y 61CONFIG_BLK_DEV_INITRD=y
diff --git a/arch/arm/configs/rx51_defconfig b/arch/arm/configs/rx51_defconfig
index e7e31332c62a..155973426025 100644
--- a/arch/arm/configs/rx51_defconfig
+++ b/arch/arm/configs/rx51_defconfig
@@ -784,7 +784,7 @@ CONFIG_INPUT_KEYBOARD=y
784# CONFIG_KEYBOARD_XTKBD is not set 784# CONFIG_KEYBOARD_XTKBD is not set
785# CONFIG_KEYBOARD_NEWTON is not set 785# CONFIG_KEYBOARD_NEWTON is not set
786# CONFIG_KEYBOARD_STOWAWAY is not set 786# CONFIG_KEYBOARD_STOWAWAY is not set
787# CONFIG_KEYBOARD_GPIO is not set 787CONFIG_KEYBOARD_GPIO=m
788# CONFIG_INPUT_MOUSE is not set 788# CONFIG_INPUT_MOUSE is not set
789# CONFIG_INPUT_JOYSTICK is not set 789# CONFIG_INPUT_JOYSTICK is not set
790# CONFIG_INPUT_TABLET is not set 790# CONFIG_INPUT_TABLET is not set
diff --git a/arch/arm/configs/u8500_defconfig b/arch/arm/configs/u8500_defconfig
new file mode 100644
index 000000000000..15fde22ce3f3
--- /dev/null
+++ b/arch/arm/configs/u8500_defconfig
@@ -0,0 +1,680 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.32-rc8
4# Mon Nov 30 11:11:29 2009
5#
6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_TIME=y
9CONFIG_GENERIC_CLOCKEVENTS=y
10CONFIG_GENERIC_HARDIRQS=y
11CONFIG_STACKTRACE_SUPPORT=y
12CONFIG_LOCKDEP_SUPPORT=y
13CONFIG_TRACE_IRQFLAGS_SUPPORT=y
14CONFIG_HARDIRQS_SW_RESEND=y
15CONFIG_GENERIC_IRQ_PROBE=y
16CONFIG_GENERIC_LOCKBREAK=y
17CONFIG_RWSEM_GENERIC_SPINLOCK=y
18CONFIG_GENERIC_HWEIGHT=y
19CONFIG_GENERIC_CALIBRATE_DELAY=y
20CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
21CONFIG_VECTORS_BASE=0xffff0000
22CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
23CONFIG_CONSTRUCTORS=y
24
25#
26# General setup
27#
28CONFIG_EXPERIMENTAL=y
29CONFIG_LOCK_KERNEL=y
30CONFIG_INIT_ENV_ARG_LIMIT=32
31CONFIG_LOCALVERSION=""
32CONFIG_LOCALVERSION_AUTO=y
33# CONFIG_SWAP is not set
34CONFIG_SYSVIPC=y
35CONFIG_SYSVIPC_SYSCTL=y
36# CONFIG_BSD_PROCESS_ACCT is not set
37
38#
39# RCU Subsystem
40#
41CONFIG_TREE_RCU=y
42# CONFIG_TREE_PREEMPT_RCU is not set
43# CONFIG_RCU_TRACE is not set
44CONFIG_RCU_FANOUT=32
45# CONFIG_RCU_FANOUT_EXACT is not set
46# CONFIG_TREE_RCU_TRACE is not set
47# CONFIG_IKCONFIG is not set
48CONFIG_LOG_BUF_SHIFT=17
49CONFIG_GROUP_SCHED=y
50CONFIG_FAIR_GROUP_SCHED=y
51CONFIG_RT_GROUP_SCHED=y
52CONFIG_USER_SCHED=y
53# CONFIG_CGROUP_SCHED is not set
54# CONFIG_CGROUPS is not set
55CONFIG_SYSFS_DEPRECATED=y
56CONFIG_SYSFS_DEPRECATED_V2=y
57# CONFIG_RELAY is not set
58CONFIG_NAMESPACES=y
59# CONFIG_UTS_NS is not set
60# CONFIG_IPC_NS is not set
61# CONFIG_USER_NS is not set
62# CONFIG_PID_NS is not set
63CONFIG_BLK_DEV_INITRD=y
64CONFIG_INITRAMFS_SOURCE=""
65CONFIG_RD_GZIP=y
66CONFIG_RD_BZIP2=y
67CONFIG_RD_LZMA=y
68CONFIG_CC_OPTIMIZE_FOR_SIZE=y
69CONFIG_SYSCTL=y
70CONFIG_ANON_INODES=y
71# CONFIG_EMBEDDED is not set
72CONFIG_UID16=y
73CONFIG_SYSCTL_SYSCALL=y
74CONFIG_KALLSYMS=y
75CONFIG_KALLSYMS_ALL=y
76# CONFIG_KALLSYMS_EXTRA_PASS is not set
77CONFIG_HOTPLUG=y
78CONFIG_PRINTK=y
79CONFIG_BUG=y
80CONFIG_ELF_CORE=y
81CONFIG_BASE_FULL=y
82CONFIG_FUTEX=y
83CONFIG_EPOLL=y
84CONFIG_SIGNALFD=y
85CONFIG_TIMERFD=y
86CONFIG_EVENTFD=y
87CONFIG_SHMEM=y
88CONFIG_AIO=y
89
90#
91# Kernel Performance Events And Counters
92#
93CONFIG_VM_EVENT_COUNTERS=y
94CONFIG_SLUB_DEBUG=y
95CONFIG_COMPAT_BRK=y
96# CONFIG_SLAB is not set
97CONFIG_SLUB=y
98# CONFIG_SLOB is not set
99# CONFIG_PROFILING is not set
100CONFIG_HAVE_OPROFILE=y
101# CONFIG_KPROBES is not set
102CONFIG_HAVE_KPROBES=y
103CONFIG_HAVE_KRETPROBES=y
104CONFIG_USE_GENERIC_SMP_HELPERS=y
105
106#
107# GCOV-based kernel profiling
108#
109# CONFIG_SLOW_WORK is not set
110CONFIG_HAVE_GENERIC_DMA_COHERENT=y
111CONFIG_SLABINFO=y
112CONFIG_RT_MUTEXES=y
113CONFIG_BASE_SMALL=0
114CONFIG_MODULES=y
115# CONFIG_MODULE_FORCE_LOAD is not set
116CONFIG_MODULE_UNLOAD=y
117# CONFIG_MODULE_FORCE_UNLOAD is not set
118# CONFIG_MODVERSIONS is not set
119# CONFIG_MODULE_SRCVERSION_ALL is not set
120CONFIG_STOP_MACHINE=y
121CONFIG_BLOCK=y
122# CONFIG_LBDAF is not set
123# CONFIG_BLK_DEV_BSG is not set
124# CONFIG_BLK_DEV_INTEGRITY is not set
125
126#
127# IO Schedulers
128#
129CONFIG_IOSCHED_NOOP=y
130CONFIG_IOSCHED_AS=y
131CONFIG_IOSCHED_DEADLINE=y
132CONFIG_IOSCHED_CFQ=y
133# CONFIG_DEFAULT_AS is not set
134# CONFIG_DEFAULT_DEADLINE is not set
135CONFIG_DEFAULT_CFQ=y
136# CONFIG_DEFAULT_NOOP is not set
137CONFIG_DEFAULT_IOSCHED="cfq"
138# CONFIG_FREEZER is not set
139
140#
141# System Type
142#
143CONFIG_MMU=y
144# CONFIG_ARCH_AAEC2000 is not set
145# CONFIG_ARCH_INTEGRATOR is not set
146# CONFIG_ARCH_REALVIEW is not set
147# CONFIG_ARCH_VERSATILE is not set
148# CONFIG_ARCH_AT91 is not set
149# CONFIG_ARCH_CLPS711X is not set
150# CONFIG_ARCH_GEMINI is not set
151# CONFIG_ARCH_EBSA110 is not set
152# CONFIG_ARCH_EP93XX is not set
153# CONFIG_ARCH_FOOTBRIDGE is not set
154# CONFIG_ARCH_MXC is not set
155# CONFIG_ARCH_STMP3XXX is not set
156# CONFIG_ARCH_NETX is not set
157# CONFIG_ARCH_H720X is not set
158# CONFIG_ARCH_NOMADIK is not set
159# CONFIG_ARCH_IOP13XX is not set
160# CONFIG_ARCH_IOP32X is not set
161# CONFIG_ARCH_IOP33X is not set
162# CONFIG_ARCH_IXP23XX is not set
163# CONFIG_ARCH_IXP2000 is not set
164# CONFIG_ARCH_IXP4XX is not set
165# CONFIG_ARCH_L7200 is not set
166# CONFIG_ARCH_KIRKWOOD is not set
167# CONFIG_ARCH_LOKI is not set
168# CONFIG_ARCH_MV78XX0 is not set
169# CONFIG_ARCH_ORION5X is not set
170# CONFIG_ARCH_MMP is not set
171# CONFIG_ARCH_KS8695 is not set
172# CONFIG_ARCH_NS9XXX is not set
173# CONFIG_ARCH_W90X900 is not set
174# CONFIG_ARCH_PNX4008 is not set
175# CONFIG_ARCH_PXA is not set
176# CONFIG_ARCH_MSM is not set
177# CONFIG_ARCH_RPC is not set
178# CONFIG_ARCH_SA1100 is not set
179# CONFIG_ARCH_S3C2410 is not set
180# CONFIG_ARCH_S3C64XX is not set
181# CONFIG_ARCH_S5PC1XX is not set
182# CONFIG_ARCH_SHARK is not set
183# CONFIG_ARCH_LH7A40X is not set
184# CONFIG_ARCH_U300 is not set
185# CONFIG_ARCH_DAVINCI is not set
186# CONFIG_ARCH_OMAP is not set
187# CONFIG_ARCH_BCMRING is not set
188CONFIG_ARCH_U8500=y
189CONFIG_PLAT_NOMADIK=y
190CONFIG_HAS_MTU=y
191
192#
193# ST-Ericsson platform type
194#
195
196#
197# ST-Ericsson Multicore Mobile Platforms
198#
199CONFIG_MACH_U8500_MOP=y
200
201#
202# Processor Type
203#
204CONFIG_CPU_32=y
205CONFIG_CPU_32v6K=y
206CONFIG_CPU_V7=y
207CONFIG_CPU_32v7=y
208CONFIG_CPU_ABRT_EV7=y
209CONFIG_CPU_PABRT_V7=y
210CONFIG_CPU_CACHE_V7=y
211CONFIG_CPU_CACHE_VIPT=y
212CONFIG_CPU_COPY_V6=y
213CONFIG_CPU_TLB_V7=y
214CONFIG_CPU_HAS_ASID=y
215CONFIG_CPU_CP15=y
216CONFIG_CPU_CP15_MMU=y
217
218#
219# Processor Features
220#
221CONFIG_ARM_THUMB=y
222# CONFIG_ARM_THUMBEE is not set
223# CONFIG_CPU_ICACHE_DISABLE is not set
224# CONFIG_CPU_DCACHE_DISABLE is not set
225# CONFIG_CPU_BPREDICT_DISABLE is not set
226CONFIG_HAS_TLS_REG=y
227CONFIG_ARM_L1_CACHE_SHIFT=5
228# CONFIG_ARM_ERRATA_430973 is not set
229# CONFIG_ARM_ERRATA_458693 is not set
230# CONFIG_ARM_ERRATA_460075 is not set
231CONFIG_ARM_GIC=y
232CONFIG_COMMON_CLKDEV=y
233
234#
235# Bus support
236#
237CONFIG_ARM_AMBA=y
238# CONFIG_PCI_SYSCALL is not set
239# CONFIG_ARCH_SUPPORTS_MSI is not set
240# CONFIG_PCCARD is not set
241
242#
243# Kernel Features
244#
245# CONFIG_NO_HZ is not set
246# CONFIG_HIGH_RES_TIMERS is not set
247CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
248CONFIG_SMP=y
249CONFIG_HAVE_ARM_SCU=y
250CONFIG_HAVE_ARM_TWD=y
251CONFIG_VMSPLIT_3G=y
252# CONFIG_VMSPLIT_2G is not set
253# CONFIG_VMSPLIT_1G is not set
254CONFIG_PAGE_OFFSET=0xC0000000
255CONFIG_NR_CPUS=2
256# CONFIG_HOTPLUG_CPU is not set
257CONFIG_LOCAL_TIMERS=y
258# CONFIG_PREEMPT_NONE is not set
259# CONFIG_PREEMPT_VOLUNTARY is not set
260CONFIG_PREEMPT=y
261CONFIG_HZ=100
262# CONFIG_THUMB2_KERNEL is not set
263CONFIG_AEABI=y
264CONFIG_OABI_COMPAT=y
265# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
266# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
267# CONFIG_HIGHMEM is not set
268CONFIG_SELECT_MEMORY_MODEL=y
269CONFIG_FLATMEM_MANUAL=y
270# CONFIG_DISCONTIGMEM_MANUAL is not set
271# CONFIG_SPARSEMEM_MANUAL is not set
272CONFIG_FLATMEM=y
273CONFIG_FLAT_NODE_MEM_MAP=y
274CONFIG_PAGEFLAGS_EXTENDED=y
275CONFIG_SPLIT_PTLOCK_CPUS=4
276# CONFIG_PHYS_ADDR_T_64BIT is not set
277CONFIG_ZONE_DMA_FLAG=0
278CONFIG_VIRT_TO_BUS=y
279CONFIG_HAVE_MLOCK=y
280CONFIG_HAVE_MLOCKED_PAGE_BIT=y
281# CONFIG_KSM is not set
282CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
283CONFIG_ALIGNMENT_TRAP=y
284# CONFIG_UACCESS_WITH_MEMCPY is not set
285
286#
287# Boot options
288#
289CONFIG_ZBOOT_ROM_TEXT=0
290CONFIG_ZBOOT_ROM_BSS=0
291CONFIG_CMDLINE="root=/dev/ram0 console=ttyAMA2,115200n8"
292# CONFIG_XIP_KERNEL is not set
293# CONFIG_KEXEC is not set
294
295#
296# CPU Power Management
297#
298# CONFIG_CPU_IDLE is not set
299
300#
301# Floating point emulation
302#
303
304#
305# At least one emulation must be selected
306#
307# CONFIG_FPE_NWFPE is not set
308# CONFIG_FPE_FASTFPE is not set
309CONFIG_VFP=y
310CONFIG_VFPv3=y
311CONFIG_NEON=y
312
313#
314# Userspace binary formats
315#
316CONFIG_BINFMT_ELF=y
317# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
318CONFIG_HAVE_AOUT=y
319# CONFIG_BINFMT_AOUT is not set
320# CONFIG_BINFMT_MISC is not set
321
322#
323# Power management options
324#
325# CONFIG_PM is not set
326CONFIG_ARCH_SUSPEND_POSSIBLE=y
327# CONFIG_NET is not set
328
329#
330# Device Drivers
331#
332
333#
334# Generic Driver Options
335#
336CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
337# CONFIG_DEVTMPFS is not set
338CONFIG_STANDALONE=y
339CONFIG_PREVENT_FIRMWARE_BUILD=y
340CONFIG_FW_LOADER=y
341CONFIG_FIRMWARE_IN_KERNEL=y
342CONFIG_EXTRA_FIRMWARE=""
343# CONFIG_DEBUG_DRIVER is not set
344# CONFIG_DEBUG_DEVRES is not set
345# CONFIG_SYS_HYPERVISOR is not set
346# CONFIG_MTD is not set
347# CONFIG_PARPORT is not set
348CONFIG_BLK_DEV=y
349# CONFIG_BLK_DEV_COW_COMMON is not set
350# CONFIG_BLK_DEV_LOOP is not set
351CONFIG_BLK_DEV_RAM=y
352CONFIG_BLK_DEV_RAM_COUNT=16
353CONFIG_BLK_DEV_RAM_SIZE=65536
354# CONFIG_BLK_DEV_XIP is not set
355# CONFIG_CDROM_PKTCDVD is not set
356# CONFIG_MISC_DEVICES is not set
357CONFIG_HAVE_IDE=y
358# CONFIG_IDE is not set
359
360#
361# SCSI device support
362#
363# CONFIG_RAID_ATTRS is not set
364# CONFIG_SCSI is not set
365# CONFIG_SCSI_DMA is not set
366# CONFIG_SCSI_NETLINK is not set
367# CONFIG_ATA is not set
368# CONFIG_MD is not set
369# CONFIG_PHONE is not set
370
371#
372# Input device support
373#
374CONFIG_INPUT=y
375# CONFIG_INPUT_FF_MEMLESS is not set
376# CONFIG_INPUT_POLLDEV is not set
377
378#
379# Userland interfaces
380#
381CONFIG_INPUT_MOUSEDEV=y
382# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
383CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
384CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
385# CONFIG_INPUT_JOYDEV is not set
386CONFIG_INPUT_EVDEV=y
387# CONFIG_INPUT_EVBUG is not set
388
389#
390# Input Device Drivers
391#
392# CONFIG_INPUT_KEYBOARD is not set
393# CONFIG_INPUT_MOUSE is not set
394# CONFIG_INPUT_JOYSTICK is not set
395# CONFIG_INPUT_TABLET is not set
396# CONFIG_INPUT_TOUCHSCREEN is not set
397# CONFIG_INPUT_MISC is not set
398
399#
400# Hardware I/O ports
401#
402# CONFIG_SERIO is not set
403# CONFIG_GAMEPORT is not set
404
405#
406# Character devices
407#
408CONFIG_VT=y
409CONFIG_CONSOLE_TRANSLATIONS=y
410CONFIG_VT_CONSOLE=y
411CONFIG_HW_CONSOLE=y
412CONFIG_VT_HW_CONSOLE_BINDING=y
413CONFIG_DEVKMEM=y
414# CONFIG_SERIAL_NONSTANDARD is not set
415
416#
417# Serial drivers
418#
419# CONFIG_SERIAL_8250 is not set
420
421#
422# Non-8250 serial port support
423#
424# CONFIG_SERIAL_AMBA_PL010 is not set
425CONFIG_SERIAL_AMBA_PL011=y
426CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
427# CONFIG_SERIAL_MAX3100 is not set
428CONFIG_SERIAL_CORE=y
429CONFIG_SERIAL_CORE_CONSOLE=y
430CONFIG_UNIX98_PTYS=y
431# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
432# CONFIG_LEGACY_PTYS is not set
433# CONFIG_IPMI_HANDLER is not set
434# CONFIG_HW_RANDOM is not set
435# CONFIG_R3964 is not set
436# CONFIG_RAW_DRIVER is not set
437# CONFIG_TCG_TPM is not set
438# CONFIG_I2C is not set
439CONFIG_SPI=y
440# CONFIG_SPI_DEBUG is not set
441CONFIG_SPI_MASTER=y
442
443#
444# SPI Master Controller Drivers
445#
446# CONFIG_SPI_BITBANG is not set
447CONFIG_SPI_PL022=y
448
449#
450# SPI Protocol Masters
451#
452# CONFIG_SPI_SPIDEV is not set
453# CONFIG_SPI_TLE62X0 is not set
454
455#
456# PPS support
457#
458# CONFIG_PPS is not set
459# CONFIG_W1 is not set
460# CONFIG_POWER_SUPPLY is not set
461# CONFIG_HWMON is not set
462# CONFIG_THERMAL is not set
463# CONFIG_WATCHDOG is not set
464CONFIG_SSB_POSSIBLE=y
465
466#
467# Sonics Silicon Backplane
468#
469# CONFIG_SSB is not set
470
471#
472# Multifunction device drivers
473#
474# CONFIG_MFD_CORE is not set
475# CONFIG_MFD_SM501 is not set
476# CONFIG_HTC_PASIC3 is not set
477# CONFIG_MFD_TMIO is not set
478# CONFIG_MFD_MC13783 is not set
479# CONFIG_EZX_PCAP is not set
480# CONFIG_REGULATOR is not set
481# CONFIG_MEDIA_SUPPORT is not set
482
483#
484# Graphics support
485#
486# CONFIG_VGASTATE is not set
487# CONFIG_VIDEO_OUTPUT_CONTROL is not set
488# CONFIG_FB is not set
489# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
490
491#
492# Display device support
493#
494# CONFIG_DISPLAY_SUPPORT is not set
495
496#
497# Console display driver support
498#
499# CONFIG_VGA_CONSOLE is not set
500CONFIG_DUMMY_CONSOLE=y
501# CONFIG_SOUND is not set
502# CONFIG_HID_SUPPORT is not set
503# CONFIG_USB_SUPPORT is not set
504# CONFIG_MMC is not set
505# CONFIG_MEMSTICK is not set
506# CONFIG_NEW_LEDS is not set
507# CONFIG_ACCESSIBILITY is not set
508CONFIG_RTC_LIB=y
509# CONFIG_RTC_CLASS is not set
510# CONFIG_DMADEVICES is not set
511# CONFIG_AUXDISPLAY is not set
512# CONFIG_UIO is not set
513
514#
515# TI VLYNQ
516#
517# CONFIG_STAGING is not set
518
519#
520# File systems
521#
522CONFIG_EXT2_FS=y
523CONFIG_EXT2_FS_XATTR=y
524CONFIG_EXT2_FS_POSIX_ACL=y
525CONFIG_EXT2_FS_SECURITY=y
526# CONFIG_EXT2_FS_XIP is not set
527# CONFIG_EXT3_FS is not set
528# CONFIG_EXT4_FS is not set
529CONFIG_FS_MBCACHE=y
530# CONFIG_REISERFS_FS is not set
531# CONFIG_JFS_FS is not set
532CONFIG_FS_POSIX_ACL=y
533# CONFIG_XFS_FS is not set
534# CONFIG_BTRFS_FS is not set
535# CONFIG_NILFS2_FS is not set
536CONFIG_FILE_LOCKING=y
537CONFIG_FSNOTIFY=y
538CONFIG_DNOTIFY=y
539CONFIG_INOTIFY=y
540CONFIG_INOTIFY_USER=y
541# CONFIG_QUOTA is not set
542# CONFIG_AUTOFS_FS is not set
543# CONFIG_AUTOFS4_FS is not set
544# CONFIG_FUSE_FS is not set
545CONFIG_GENERIC_ACL=y
546
547#
548# Caches
549#
550# CONFIG_FSCACHE is not set
551
552#
553# CD-ROM/DVD Filesystems
554#
555# CONFIG_ISO9660_FS is not set
556# CONFIG_UDF_FS is not set
557
558#
559# DOS/FAT/NT Filesystems
560#
561# CONFIG_MSDOS_FS is not set
562# CONFIG_VFAT_FS is not set
563# CONFIG_NTFS_FS is not set
564
565#
566# Pseudo filesystems
567#
568CONFIG_PROC_FS=y
569CONFIG_PROC_SYSCTL=y
570CONFIG_PROC_PAGE_MONITOR=y
571CONFIG_SYSFS=y
572CONFIG_TMPFS=y
573CONFIG_TMPFS_POSIX_ACL=y
574# CONFIG_HUGETLB_PAGE is not set
575CONFIG_CONFIGFS_FS=m
576# CONFIG_MISC_FILESYSTEMS is not set
577
578#
579# Partition Types
580#
581# CONFIG_PARTITION_ADVANCED is not set
582CONFIG_MSDOS_PARTITION=y
583# CONFIG_NLS is not set
584
585#
586# Kernel hacking
587#
588# CONFIG_PRINTK_TIME is not set
589CONFIG_ENABLE_WARN_DEPRECATED=y
590CONFIG_ENABLE_MUST_CHECK=y
591CONFIG_FRAME_WARN=1024
592CONFIG_MAGIC_SYSRQ=y
593# CONFIG_STRIP_ASM_SYMS is not set
594# CONFIG_UNUSED_SYMBOLS is not set
595# CONFIG_DEBUG_FS is not set
596# CONFIG_HEADERS_CHECK is not set
597CONFIG_DEBUG_KERNEL=y
598# CONFIG_DEBUG_SHIRQ is not set
599CONFIG_DETECT_SOFTLOCKUP=y
600# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
601CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
602CONFIG_DETECT_HUNG_TASK=y
603# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
604CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
605# CONFIG_SCHED_DEBUG is not set
606# CONFIG_SCHEDSTATS is not set
607# CONFIG_TIMER_STATS is not set
608# CONFIG_DEBUG_OBJECTS is not set
609# CONFIG_SLUB_DEBUG_ON is not set
610# CONFIG_SLUB_STATS is not set
611# CONFIG_DEBUG_KMEMLEAK is not set
612# CONFIG_DEBUG_PREEMPT is not set
613# CONFIG_DEBUG_RT_MUTEXES is not set
614# CONFIG_RT_MUTEX_TESTER is not set
615# CONFIG_DEBUG_SPINLOCK is not set
616# CONFIG_DEBUG_MUTEXES is not set
617# CONFIG_DEBUG_LOCK_ALLOC is not set
618# CONFIG_PROVE_LOCKING is not set
619# CONFIG_LOCK_STAT is not set
620# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
621# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
622# CONFIG_DEBUG_KOBJECT is not set
623CONFIG_DEBUG_BUGVERBOSE=y
624CONFIG_DEBUG_INFO=y
625# CONFIG_DEBUG_VM is not set
626# CONFIG_DEBUG_WRITECOUNT is not set
627CONFIG_DEBUG_MEMORY_INIT=y
628# CONFIG_DEBUG_LIST is not set
629# CONFIG_DEBUG_SG is not set
630# CONFIG_DEBUG_NOTIFIERS is not set
631# CONFIG_DEBUG_CREDENTIALS is not set
632# CONFIG_BOOT_PRINTK_DELAY is not set
633# CONFIG_RCU_TORTURE_TEST is not set
634# CONFIG_RCU_CPU_STALL_DETECTOR is not set
635# CONFIG_BACKTRACE_SELF_TEST is not set
636# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
637# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
638# CONFIG_FAULT_INJECTION is not set
639# CONFIG_SYSCTL_SYSCALL_CHECK is not set
640# CONFIG_PAGE_POISONING is not set
641CONFIG_HAVE_FUNCTION_TRACER=y
642CONFIG_TRACING_SUPPORT=y
643# CONFIG_FTRACE is not set
644# CONFIG_SAMPLES is not set
645CONFIG_HAVE_ARCH_KGDB=y
646# CONFIG_KGDB is not set
647CONFIG_ARM_UNWIND=y
648CONFIG_DEBUG_USER=y
649CONFIG_DEBUG_ERRORS=y
650# CONFIG_DEBUG_STACK_USAGE is not set
651# CONFIG_DEBUG_LL is not set
652
653#
654# Security options
655#
656# CONFIG_KEYS is not set
657# CONFIG_SECURITY is not set
658# CONFIG_SECURITYFS is not set
659# CONFIG_SECURITY_FILE_CAPABILITIES is not set
660# CONFIG_CRYPTO is not set
661# CONFIG_BINARY_PRINTF is not set
662
663#
664# Library routines
665#
666CONFIG_GENERIC_FIND_LAST_BIT=y
667# CONFIG_CRC_CCITT is not set
668# CONFIG_CRC16 is not set
669CONFIG_CRC_T10DIF=m
670# CONFIG_CRC_ITU_T is not set
671# CONFIG_CRC32 is not set
672# CONFIG_CRC7 is not set
673# CONFIG_LIBCRC32C is not set
674CONFIG_ZLIB_INFLATE=y
675CONFIG_DECOMPRESS_GZIP=y
676CONFIG_DECOMPRESS_BZIP2=y
677CONFIG_DECOMPRESS_LZMA=y
678CONFIG_HAS_IOMEM=y
679CONFIG_HAS_IOPORT=y
680CONFIG_HAS_DMA=y
diff --git a/arch/arm/include/asm/cacheflush.h b/arch/arm/include/asm/cacheflush.h
index 3d0cdd21b882..73eceb87e588 100644
--- a/arch/arm/include/asm/cacheflush.h
+++ b/arch/arm/include/asm/cacheflush.h
@@ -331,15 +331,15 @@ static inline void outer_flush_range(unsigned long start, unsigned long end)
331 * Convert calls to our calling convention. 331 * Convert calls to our calling convention.
332 */ 332 */
333#define flush_cache_all() __cpuc_flush_kern_all() 333#define flush_cache_all() __cpuc_flush_kern_all()
334#ifndef CONFIG_CPU_CACHE_VIPT 334
335static inline void flush_cache_mm(struct mm_struct *mm) 335static inline void vivt_flush_cache_mm(struct mm_struct *mm)
336{ 336{
337 if (cpumask_test_cpu(smp_processor_id(), mm_cpumask(mm))) 337 if (cpumask_test_cpu(smp_processor_id(), mm_cpumask(mm)))
338 __cpuc_flush_user_all(); 338 __cpuc_flush_user_all();
339} 339}
340 340
341static inline void 341static inline void
342flush_cache_range(struct vm_area_struct *vma, unsigned long start, unsigned long end) 342vivt_flush_cache_range(struct vm_area_struct *vma, unsigned long start, unsigned long end)
343{ 343{
344 if (cpumask_test_cpu(smp_processor_id(), mm_cpumask(vma->vm_mm))) 344 if (cpumask_test_cpu(smp_processor_id(), mm_cpumask(vma->vm_mm)))
345 __cpuc_flush_user_range(start & PAGE_MASK, PAGE_ALIGN(end), 345 __cpuc_flush_user_range(start & PAGE_MASK, PAGE_ALIGN(end),
@@ -347,7 +347,7 @@ flush_cache_range(struct vm_area_struct *vma, unsigned long start, unsigned long
347} 347}
348 348
349static inline void 349static inline void
350flush_cache_page(struct vm_area_struct *vma, unsigned long user_addr, unsigned long pfn) 350vivt_flush_cache_page(struct vm_area_struct *vma, unsigned long user_addr, unsigned long pfn)
351{ 351{
352 if (cpumask_test_cpu(smp_processor_id(), mm_cpumask(vma->vm_mm))) { 352 if (cpumask_test_cpu(smp_processor_id(), mm_cpumask(vma->vm_mm))) {
353 unsigned long addr = user_addr & PAGE_MASK; 353 unsigned long addr = user_addr & PAGE_MASK;
@@ -356,7 +356,7 @@ flush_cache_page(struct vm_area_struct *vma, unsigned long user_addr, unsigned l
356} 356}
357 357
358static inline void 358static inline void
359flush_ptrace_access(struct vm_area_struct *vma, struct page *page, 359vivt_flush_ptrace_access(struct vm_area_struct *vma, struct page *page,
360 unsigned long uaddr, void *kaddr, 360 unsigned long uaddr, void *kaddr,
361 unsigned long len, int write) 361 unsigned long len, int write)
362{ 362{
@@ -365,6 +365,16 @@ flush_ptrace_access(struct vm_area_struct *vma, struct page *page,
365 __cpuc_coherent_kern_range(addr, addr + len); 365 __cpuc_coherent_kern_range(addr, addr + len);
366 } 366 }
367} 367}
368
369#ifndef CONFIG_CPU_CACHE_VIPT
370#define flush_cache_mm(mm) \
371 vivt_flush_cache_mm(mm)
372#define flush_cache_range(vma,start,end) \
373 vivt_flush_cache_range(vma,start,end)
374#define flush_cache_page(vma,addr,pfn) \
375 vivt_flush_cache_page(vma,addr,pfn)
376#define flush_ptrace_access(vma,page,ua,ka,len,write) \
377 vivt_flush_ptrace_access(vma,page,ua,ka,len,write)
368#else 378#else
369extern void flush_cache_mm(struct mm_struct *mm); 379extern void flush_cache_mm(struct mm_struct *mm);
370extern void flush_cache_range(struct vm_area_struct *vma, unsigned long start, unsigned long end); 380extern void flush_cache_range(struct vm_area_struct *vma, unsigned long start, unsigned long end);
@@ -408,10 +418,9 @@ extern void flush_ptrace_access(struct vm_area_struct *vma, struct page *page,
408 * about to change to user space. This is the same method as used on SPARC64. 418 * about to change to user space. This is the same method as used on SPARC64.
409 * See update_mmu_cache for the user space part. 419 * See update_mmu_cache for the user space part.
410 */ 420 */
421#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1
411extern void flush_dcache_page(struct page *); 422extern void flush_dcache_page(struct page *);
412 423
413extern void __flush_dcache_page(struct address_space *mapping, struct page *page);
414
415static inline void __flush_icache_all(void) 424static inline void __flush_icache_all(void)
416{ 425{
417#ifdef CONFIG_ARM_ERRATA_411920 426#ifdef CONFIG_ARM_ERRATA_411920
diff --git a/arch/arm/include/asm/dma-mapping.h b/arch/arm/include/asm/dma-mapping.h
index ff46dfa68a97..a96300bf83fd 100644
--- a/arch/arm/include/asm/dma-mapping.h
+++ b/arch/arm/include/asm/dma-mapping.h
@@ -15,20 +15,15 @@
15 * must not be used by drivers. 15 * must not be used by drivers.
16 */ 16 */
17#ifndef __arch_page_to_dma 17#ifndef __arch_page_to_dma
18
19#if !defined(CONFIG_HIGHMEM)
20static inline dma_addr_t page_to_dma(struct device *dev, struct page *page) 18static inline dma_addr_t page_to_dma(struct device *dev, struct page *page)
21{ 19{
22 return (dma_addr_t)__virt_to_bus((unsigned long)page_address(page)); 20 return (dma_addr_t)__pfn_to_bus(page_to_pfn(page));
23} 21}
24#elif defined(__pfn_to_bus) 22
25static inline dma_addr_t page_to_dma(struct device *dev, struct page *page) 23static inline struct page *dma_to_page(struct device *dev, dma_addr_t addr)
26{ 24{
27 return (dma_addr_t)__pfn_to_bus(page_to_pfn(page)); 25 return pfn_to_page(__bus_to_pfn(addr));
28} 26}
29#else
30#error "this machine class needs to define __arch_page_to_dma to use HIGHMEM"
31#endif
32 27
33static inline void *dma_to_virt(struct device *dev, dma_addr_t addr) 28static inline void *dma_to_virt(struct device *dev, dma_addr_t addr)
34{ 29{
@@ -45,6 +40,11 @@ static inline dma_addr_t page_to_dma(struct device *dev, struct page *page)
45 return __arch_page_to_dma(dev, page); 40 return __arch_page_to_dma(dev, page);
46} 41}
47 42
43static inline struct page *dma_to_page(struct device *dev, dma_addr_t addr)
44{
45 return __arch_dma_to_page(dev, addr);
46}
47
48static inline void *dma_to_virt(struct device *dev, dma_addr_t addr) 48static inline void *dma_to_virt(struct device *dev, dma_addr_t addr)
49{ 49{
50 return __arch_dma_to_virt(dev, addr); 50 return __arch_dma_to_virt(dev, addr);
@@ -257,9 +257,11 @@ extern int dma_needs_bounce(struct device*, dma_addr_t, size_t);
257 */ 257 */
258extern dma_addr_t dma_map_single(struct device *, void *, size_t, 258extern dma_addr_t dma_map_single(struct device *, void *, size_t,
259 enum dma_data_direction); 259 enum dma_data_direction);
260extern void dma_unmap_single(struct device *, dma_addr_t, size_t,
261 enum dma_data_direction);
260extern dma_addr_t dma_map_page(struct device *, struct page *, 262extern dma_addr_t dma_map_page(struct device *, struct page *,
261 unsigned long, size_t, enum dma_data_direction); 263 unsigned long, size_t, enum dma_data_direction);
262extern void dma_unmap_single(struct device *, dma_addr_t, size_t, 264extern void dma_unmap_page(struct device *, dma_addr_t, size_t,
263 enum dma_data_direction); 265 enum dma_data_direction);
264 266
265/* 267/*
@@ -352,7 +354,6 @@ static inline void dma_unmap_single(struct device *dev, dma_addr_t handle,
352{ 354{
353 /* nothing to do */ 355 /* nothing to do */
354} 356}
355#endif /* CONFIG_DMABOUNCE */
356 357
357/** 358/**
358 * dma_unmap_page - unmap a buffer previously mapped through dma_map_page() 359 * dma_unmap_page - unmap a buffer previously mapped through dma_map_page()
@@ -371,8 +372,9 @@ static inline void dma_unmap_single(struct device *dev, dma_addr_t handle,
371static inline void dma_unmap_page(struct device *dev, dma_addr_t handle, 372static inline void dma_unmap_page(struct device *dev, dma_addr_t handle,
372 size_t size, enum dma_data_direction dir) 373 size_t size, enum dma_data_direction dir)
373{ 374{
374 dma_unmap_single(dev, handle, size, dir); 375 /* nothing to do */
375} 376}
377#endif /* CONFIG_DMABOUNCE */
376 378
377/** 379/**
378 * dma_sync_single_range_for_cpu 380 * dma_sync_single_range_for_cpu
diff --git a/arch/arm/include/asm/hardware/cache-tauros2.h b/arch/arm/include/asm/hardware/cache-tauros2.h
new file mode 100644
index 000000000000..538f17ca905b
--- /dev/null
+++ b/arch/arm/include/asm/hardware/cache-tauros2.h
@@ -0,0 +1,11 @@
1/*
2 * arch/arm/include/asm/hardware/cache-tauros2.h
3 *
4 * Copyright (C) 2008 Marvell Semiconductor
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
11extern void __init tauros2_init(void);
diff --git a/arch/arm/include/asm/hardware/coresight.h b/arch/arm/include/asm/hardware/coresight.h
new file mode 100644
index 000000000000..f82b25d4f73e
--- /dev/null
+++ b/arch/arm/include/asm/hardware/coresight.h
@@ -0,0 +1,165 @@
1/*
2 * linux/arch/arm/include/asm/hardware/coresight.h
3 *
4 * CoreSight components' registers
5 *
6 * Copyright (C) 2009 Nokia Corporation.
7 * Alexander Shishkin
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 version 2 as
11 * published by the Free Software Foundation.
12 */
13
14#ifndef __ASM_HARDWARE_CORESIGHT_H
15#define __ASM_HARDWARE_CORESIGHT_H
16
17#define TRACER_ACCESSED_BIT 0
18#define TRACER_RUNNING_BIT 1
19#define TRACER_CYCLE_ACC_BIT 2
20#define TRACER_ACCESSED BIT(TRACER_ACCESSED_BIT)
21#define TRACER_RUNNING BIT(TRACER_RUNNING_BIT)
22#define TRACER_CYCLE_ACC BIT(TRACER_CYCLE_ACC_BIT)
23
24struct tracectx {
25 unsigned int etb_bufsz;
26 void __iomem *etb_regs;
27 void __iomem *etm_regs;
28 unsigned long flags;
29 int ncmppairs;
30 int etm_portsz;
31 struct device *dev;
32 struct clk *emu_clk;
33 struct mutex mutex;
34};
35
36#define TRACER_TIMEOUT 10000
37
38#define etm_writel(t, v, x) \
39 (__raw_writel((v), (t)->etm_regs + (x)))
40#define etm_readl(t, x) (__raw_readl((t)->etm_regs + (x)))
41
42/* CoreSight Management Registers */
43#define CSMR_LOCKACCESS 0xfb0
44#define CSMR_LOCKSTATUS 0xfb4
45#define CSMR_AUTHSTATUS 0xfb8
46#define CSMR_DEVID 0xfc8
47#define CSMR_DEVTYPE 0xfcc
48/* CoreSight Component Registers */
49#define CSCR_CLASS 0xff4
50
51#define CSCR_PRSR 0x314
52
53#define UNLOCK_MAGIC 0xc5acce55
54
55/* ETM control register, "ETM Architecture", 3.3.1 */
56#define ETMR_CTRL 0
57#define ETMCTRL_POWERDOWN 1
58#define ETMCTRL_PROGRAM (1 << 10)
59#define ETMCTRL_PORTSEL (1 << 11)
60#define ETMCTRL_DO_CONTEXTID (3 << 14)
61#define ETMCTRL_PORTMASK1 (7 << 4)
62#define ETMCTRL_PORTMASK2 (1 << 21)
63#define ETMCTRL_PORTMASK (ETMCTRL_PORTMASK1 | ETMCTRL_PORTMASK2)
64#define ETMCTRL_PORTSIZE(x) ((((x) & 7) << 4) | (!!((x) & 8)) << 21)
65#define ETMCTRL_DO_CPRT (1 << 1)
66#define ETMCTRL_DATAMASK (3 << 2)
67#define ETMCTRL_DATA_DO_DATA (1 << 2)
68#define ETMCTRL_DATA_DO_ADDR (1 << 3)
69#define ETMCTRL_DATA_DO_BOTH (ETMCTRL_DATA_DO_DATA | ETMCTRL_DATA_DO_ADDR)
70#define ETMCTRL_BRANCH_OUTPUT (1 << 8)
71#define ETMCTRL_CYCLEACCURATE (1 << 12)
72
73/* ETM configuration code register */
74#define ETMR_CONFCODE (0x04)
75
76/* ETM trace start/stop resource control register */
77#define ETMR_TRACESSCTRL (0x18)
78
79/* ETM trigger event register */
80#define ETMR_TRIGEVT (0x08)
81
82/* address access type register bits, "ETM architecture",
83 * table 3-27 */
84/* - access type */
85#define ETMAAT_IFETCH 0
86#define ETMAAT_IEXEC 1
87#define ETMAAT_IEXECPASS 2
88#define ETMAAT_IEXECFAIL 3
89#define ETMAAT_DLOADSTORE 4
90#define ETMAAT_DLOAD 5
91#define ETMAAT_DSTORE 6
92/* - comparison access size */
93#define ETMAAT_JAVA (0 << 3)
94#define ETMAAT_THUMB (1 << 3)
95#define ETMAAT_ARM (3 << 3)
96/* - data value comparison control */
97#define ETMAAT_NOVALCMP (0 << 5)
98#define ETMAAT_VALMATCH (1 << 5)
99#define ETMAAT_VALNOMATCH (3 << 5)
100/* - exact match */
101#define ETMAAT_EXACTMATCH (1 << 7)
102/* - context id comparator control */
103#define ETMAAT_IGNCONTEXTID (0 << 8)
104#define ETMAAT_VALUE1 (1 << 8)
105#define ETMAAT_VALUE2 (2 << 8)
106#define ETMAAT_VALUE3 (3 << 8)
107/* - security level control */
108#define ETMAAT_IGNSECURITY (0 << 10)
109#define ETMAAT_NSONLY (1 << 10)
110#define ETMAAT_SONLY (2 << 10)
111
112#define ETMR_COMP_VAL(x) (0x40 + (x) * 4)
113#define ETMR_COMP_ACC_TYPE(x) (0x80 + (x) * 4)
114
115/* ETM status register, "ETM Architecture", 3.3.2 */
116#define ETMR_STATUS (0x10)
117#define ETMST_OVERFLOW (1 << 0)
118#define ETMST_PROGBIT (1 << 1)
119#define ETMST_STARTSTOP (1 << 2)
120#define ETMST_TRIGGER (1 << 3)
121
122#define etm_progbit(t) (etm_readl((t), ETMR_STATUS) & ETMST_PROGBIT)
123#define etm_started(t) (etm_readl((t), ETMR_STATUS) & ETMST_STARTSTOP)
124#define etm_triggered(t) (etm_readl((t), ETMR_STATUS) & ETMST_TRIGGER)
125
126#define ETMR_TRACEENCTRL2 0x1c
127#define ETMR_TRACEENCTRL 0x24
128#define ETMTE_INCLEXCL (1 << 24)
129#define ETMR_TRACEENEVT 0x20
130#define ETMCTRL_OPTS (ETMCTRL_DO_CPRT | \
131 ETMCTRL_DATA_DO_ADDR | \
132 ETMCTRL_BRANCH_OUTPUT | \
133 ETMCTRL_DO_CONTEXTID)
134
135/* ETB registers, "CoreSight Components TRM", 9.3 */
136#define ETBR_DEPTH 0x04
137#define ETBR_STATUS 0x0c
138#define ETBR_READMEM 0x10
139#define ETBR_READADDR 0x14
140#define ETBR_WRITEADDR 0x18
141#define ETBR_TRIGGERCOUNT 0x1c
142#define ETBR_CTRL 0x20
143#define ETBR_FORMATTERCTRL 0x304
144#define ETBFF_ENFTC 1
145#define ETBFF_ENFCONT (1 << 1)
146#define ETBFF_FONFLIN (1 << 4)
147#define ETBFF_MANUAL_FLUSH (1 << 6)
148#define ETBFF_TRIGIN (1 << 8)
149#define ETBFF_TRIGEVT (1 << 9)
150#define ETBFF_TRIGFL (1 << 10)
151
152#define etb_writel(t, v, x) \
153 (__raw_writel((v), (t)->etb_regs + (x)))
154#define etb_readl(t, x) (__raw_readl((t)->etb_regs + (x)))
155
156#define etm_lock(t) do { etm_writel((t), 0, CSMR_LOCKACCESS); } while (0)
157#define etm_unlock(t) \
158 do { etm_writel((t), UNLOCK_MAGIC, CSMR_LOCKACCESS); } while (0)
159
160#define etb_lock(t) do { etb_writel((t), 0, CSMR_LOCKACCESS); } while (0)
161#define etb_unlock(t) \
162 do { etb_writel((t), UNLOCK_MAGIC, CSMR_LOCKACCESS); } while (0)
163
164#endif /* __ASM_HARDWARE_CORESIGHT_H */
165
diff --git a/arch/arm/include/asm/hardware/iop3xx.h b/arch/arm/include/asm/hardware/iop3xx.h
index 8d60ad267e3a..5daea2961d48 100644
--- a/arch/arm/include/asm/hardware/iop3xx.h
+++ b/arch/arm/include/asm/hardware/iop3xx.h
@@ -234,7 +234,13 @@ extern int iop3xx_get_init_atu(void);
234void iop3xx_map_io(void); 234void iop3xx_map_io(void);
235void iop_init_cp6_handler(void); 235void iop_init_cp6_handler(void);
236void iop_init_time(unsigned long tickrate); 236void iop_init_time(unsigned long tickrate);
237unsigned long iop_gettimeoffset(void); 237
238static inline u32 read_tmr0(void)
239{
240 u32 val;
241 asm volatile("mrc p6, 0, %0, c0, c1, 0" : "=r" (val));
242 return val;
243}
238 244
239static inline void write_tmr0(u32 val) 245static inline void write_tmr0(u32 val)
240{ 246{
@@ -253,6 +259,11 @@ static inline u32 read_tcr0(void)
253 return val; 259 return val;
254} 260}
255 261
262static inline void write_tcr0(u32 val)
263{
264 asm volatile("mcr p6, 0, %0, c2, c1, 0" : : "r" (val));
265}
266
256static inline u32 read_tcr1(void) 267static inline u32 read_tcr1(void)
257{ 268{
258 u32 val; 269 u32 val;
@@ -260,6 +271,11 @@ static inline u32 read_tcr1(void)
260 return val; 271 return val;
261} 272}
262 273
274static inline void write_tcr1(u32 val)
275{
276 asm volatile("mcr p6, 0, %0, c3, c1, 0" : : "r" (val));
277}
278
263static inline void write_trr0(u32 val) 279static inline void write_trr0(u32 val)
264{ 280{
265 asm volatile("mcr p6, 0, %0, c4, c1, 0" : : "r" (val)); 281 asm volatile("mcr p6, 0, %0, c4, c1, 0" : : "r" (val));
diff --git a/arch/arm/include/asm/kmap_types.h b/arch/arm/include/asm/kmap_types.h
index d16ec97ec9a9..c019949a5189 100644
--- a/arch/arm/include/asm/kmap_types.h
+++ b/arch/arm/include/asm/kmap_types.h
@@ -22,4 +22,10 @@ enum km_type {
22 KM_TYPE_NR 22 KM_TYPE_NR
23}; 23};
24 24
25#ifdef CONFIG_DEBUG_HIGHMEM
26#define KM_NMI (-1)
27#define KM_NMI_PTE (-1)
28#define KM_IRQ_PTE (-1)
29#endif
30
25#endif 31#endif
diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h
index cefedf062138..5421d82a2572 100644
--- a/arch/arm/include/asm/memory.h
+++ b/arch/arm/include/asm/memory.h
@@ -125,8 +125,10 @@
125 * private definitions which should NOT be used outside memory.h 125 * private definitions which should NOT be used outside memory.h
126 * files. Use virt_to_phys/phys_to_virt/__pa/__va instead. 126 * files. Use virt_to_phys/phys_to_virt/__pa/__va instead.
127 */ 127 */
128#ifndef __virt_to_phys
128#define __virt_to_phys(x) ((x) - PAGE_OFFSET + PHYS_OFFSET) 129#define __virt_to_phys(x) ((x) - PAGE_OFFSET + PHYS_OFFSET)
129#define __phys_to_virt(x) ((x) - PHYS_OFFSET + PAGE_OFFSET) 130#define __phys_to_virt(x) ((x) - PHYS_OFFSET + PAGE_OFFSET)
131#endif
130 132
131/* 133/*
132 * Convert a physical address to a Page Frame Number and back 134 * Convert a physical address to a Page Frame Number and back
@@ -134,6 +136,12 @@
134#define __phys_to_pfn(paddr) ((paddr) >> PAGE_SHIFT) 136#define __phys_to_pfn(paddr) ((paddr) >> PAGE_SHIFT)
135#define __pfn_to_phys(pfn) ((pfn) << PAGE_SHIFT) 137#define __pfn_to_phys(pfn) ((pfn) << PAGE_SHIFT)
136 138
139/*
140 * Convert a page to/from a physical address
141 */
142#define page_to_phys(page) (__pfn_to_phys(page_to_pfn(page)))
143#define phys_to_page(phys) (pfn_to_page(__phys_to_pfn(phys)))
144
137#ifndef __ASSEMBLY__ 145#ifndef __ASSEMBLY__
138 146
139/* 147/*
@@ -194,7 +202,8 @@ static inline void *phys_to_virt(unsigned long x)
194#ifndef __virt_to_bus 202#ifndef __virt_to_bus
195#define __virt_to_bus __virt_to_phys 203#define __virt_to_bus __virt_to_phys
196#define __bus_to_virt __phys_to_virt 204#define __bus_to_virt __phys_to_virt
197#define __pfn_to_bus(x) ((x) << PAGE_SHIFT) 205#define __pfn_to_bus(x) __pfn_to_phys(x)
206#define __bus_to_pfn(x) __phys_to_pfn(x)
198#endif 207#endif
199 208
200static inline __deprecated unsigned long virt_to_bus(void *x) 209static inline __deprecated unsigned long virt_to_bus(void *x)
@@ -293,11 +302,6 @@ static inline __deprecated void *bus_to_virt(unsigned long x)
293#endif /* !CONFIG_DISCONTIGMEM */ 302#endif /* !CONFIG_DISCONTIGMEM */
294 303
295/* 304/*
296 * For BIO. "will die". Kill me when bio_to_phys() and bvec_to_phys() die.
297 */
298#define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)
299
300/*
301 * Optional coherency support. Currently used only by selected 305 * Optional coherency support. Currently used only by selected
302 * Intel XSC3-based systems. 306 * Intel XSC3-based systems.
303 */ 307 */
diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h
index 201ccaa11f61..11397687f42c 100644
--- a/arch/arm/include/asm/pgtable.h
+++ b/arch/arm/include/asm/pgtable.h
@@ -304,13 +304,23 @@ PTE_BIT_FUNC(mkyoung, |= L_PTE_YOUNG);
304 304
305static inline pte_t pte_mkspecial(pte_t pte) { return pte; } 305static inline pte_t pte_mkspecial(pte_t pte) { return pte; }
306 306
307#define __pgprot_modify(prot,mask,bits) \
308 __pgprot((pgprot_val(prot) & ~(mask)) | (bits))
309
307/* 310/*
308 * Mark the prot value as uncacheable and unbufferable. 311 * Mark the prot value as uncacheable and unbufferable.
309 */ 312 */
310#define pgprot_noncached(prot) \ 313#define pgprot_noncached(prot) \
311 __pgprot((pgprot_val(prot) & ~L_PTE_MT_MASK) | L_PTE_MT_UNCACHED) 314 __pgprot_modify(prot, L_PTE_MT_MASK, L_PTE_MT_UNCACHED)
312#define pgprot_writecombine(prot) \ 315#define pgprot_writecombine(prot) \
313 __pgprot((pgprot_val(prot) & ~L_PTE_MT_MASK) | L_PTE_MT_BUFFERABLE) 316 __pgprot_modify(prot, L_PTE_MT_MASK, L_PTE_MT_BUFFERABLE)
317#if __LINUX_ARM_ARCH__ >= 7
318#define pgprot_dmacoherent(prot) \
319 __pgprot_modify(prot, L_PTE_MT_MASK|L_PTE_EXEC, L_PTE_MT_BUFFERABLE)
320#else
321#define pgprot_dmacoherent(prot) \
322 __pgprot_modify(prot, L_PTE_MT_MASK|L_PTE_EXEC, L_PTE_MT_UNCACHED)
323#endif
314 324
315#define pmd_none(pmd) (!pmd_val(pmd)) 325#define pmd_none(pmd) (!pmd_val(pmd))
316#define pmd_present(pmd) (pmd_val(pmd)) 326#define pmd_present(pmd) (pmd_val(pmd))
diff --git a/arch/arm/include/asm/socket.h b/arch/arm/include/asm/socket.h
index 92ac61d294fd..90ffd04b8e74 100644
--- a/arch/arm/include/asm/socket.h
+++ b/arch/arm/include/asm/socket.h
@@ -60,4 +60,6 @@
60#define SO_PROTOCOL 38 60#define SO_PROTOCOL 38
61#define SO_DOMAIN 39 61#define SO_DOMAIN 39
62 62
63#define SO_RXQ_OVFL 40
64
63#endif /* _ASM_SOCKET_H */ 65#endif /* _ASM_SOCKET_H */
diff --git a/arch/arm/include/asm/swab.h b/arch/arm/include/asm/swab.h
index ca2bf2f6d6ea..9997ad20eff1 100644
--- a/arch/arm/include/asm/swab.h
+++ b/arch/arm/include/asm/swab.h
@@ -22,6 +22,24 @@
22# define __SWAB_64_THRU_32__ 22# define __SWAB_64_THRU_32__
23#endif 23#endif
24 24
25#if defined(__KERNEL__) && __LINUX_ARM_ARCH__ >= 6
26
27static inline __attribute_const__ __u16 __arch_swab16(__u16 x)
28{
29 __asm__ ("rev16 %0, %1" : "=r" (x) : "r" (x));
30 return x;
31}
32#define __arch_swab16 __arch_swab16
33
34static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
35{
36 __asm__ ("rev %0, %1" : "=r" (x) : "r" (x));
37 return x;
38}
39#define __arch_swab32 __arch_swab32
40
41#else
42
25static inline __attribute_const__ __u32 __arch_swab32(__u32 x) 43static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
26{ 44{
27 __u32 t; 45 __u32 t;
@@ -48,3 +66,4 @@ static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
48 66
49#endif 67#endif
50 68
69#endif
diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h
index d65b2f5bf41f..058e7e90881d 100644
--- a/arch/arm/include/asm/system.h
+++ b/arch/arm/include/asm/system.h
@@ -138,21 +138,26 @@ extern unsigned int user_debug;
138#define dmb() __asm__ __volatile__ ("" : : : "memory") 138#define dmb() __asm__ __volatile__ ("" : : : "memory")
139#endif 139#endif
140 140
141#ifndef CONFIG_SMP 141#if __LINUX_ARM_ARCH__ >= 7 || defined(CONFIG_SMP)
142#define mb() dmb()
143#define rmb() dmb()
144#define wmb() dmb()
145#else
142#define mb() do { if (arch_is_coherent()) dmb(); else barrier(); } while (0) 146#define mb() do { if (arch_is_coherent()) dmb(); else barrier(); } while (0)
143#define rmb() do { if (arch_is_coherent()) dmb(); else barrier(); } while (0) 147#define rmb() do { if (arch_is_coherent()) dmb(); else barrier(); } while (0)
144#define wmb() do { if (arch_is_coherent()) dmb(); else barrier(); } while (0) 148#define wmb() do { if (arch_is_coherent()) dmb(); else barrier(); } while (0)
149#endif
150
151#ifndef CONFIG_SMP
145#define smp_mb() barrier() 152#define smp_mb() barrier()
146#define smp_rmb() barrier() 153#define smp_rmb() barrier()
147#define smp_wmb() barrier() 154#define smp_wmb() barrier()
148#else 155#else
149#define mb() dmb() 156#define smp_mb() mb()
150#define rmb() dmb() 157#define smp_rmb() rmb()
151#define wmb() dmb() 158#define smp_wmb() wmb()
152#define smp_mb() dmb()
153#define smp_rmb() dmb()
154#define smp_wmb() dmb()
155#endif 159#endif
160
156#define read_barrier_depends() do { } while(0) 161#define read_barrier_depends() do { } while(0)
157#define smp_read_barrier_depends() do { } while(0) 162#define smp_read_barrier_depends() do { } while(0)
158 163
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
index 79087dd6d869..e7ccf7e697ce 100644
--- a/arch/arm/kernel/Makefile
+++ b/arch/arm/kernel/Makefile
@@ -17,6 +17,8 @@ obj-y := compat.o elf.o entry-armv.o entry-common.o irq.o \
17 process.o ptrace.o return_address.o setup.o signal.o \ 17 process.o ptrace.o return_address.o setup.o signal.o \
18 sys_arm.o stacktrace.o time.o traps.o 18 sys_arm.o stacktrace.o time.o traps.o
19 19
20obj-$(CONFIG_OC_ETM) += etm.o
21
20obj-$(CONFIG_ISA_DMA_API) += dma.o 22obj-$(CONFIG_ISA_DMA_API) += dma.o
21obj-$(CONFIG_ARCH_ACORN) += ecard.o 23obj-$(CONFIG_ARCH_ACORN) += ecard.o
22obj-$(CONFIG_FIQ) += fiq.o 24obj-$(CONFIG_FIQ) += fiq.o
diff --git a/arch/arm/kernel/calls.S b/arch/arm/kernel/calls.S
index fafce1b5c69f..f58c1156e779 100644
--- a/arch/arm/kernel/calls.S
+++ b/arch/arm/kernel/calls.S
@@ -374,6 +374,7 @@
374 CALL(sys_pwritev) 374 CALL(sys_pwritev)
375 CALL(sys_rt_tgsigqueueinfo) 375 CALL(sys_rt_tgsigqueueinfo)
376 CALL(sys_perf_event_open) 376 CALL(sys_perf_event_open)
377/* 365 */ CALL(sys_recvmmsg)
377#ifndef syscalls_counted 378#ifndef syscalls_counted
378.equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls 379.equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls
379#define syscalls_counted 380#define syscalls_counted
diff --git a/arch/arm/kernel/etm.c b/arch/arm/kernel/etm.c
new file mode 100644
index 000000000000..827753966301
--- /dev/null
+++ b/arch/arm/kernel/etm.c
@@ -0,0 +1,641 @@
1/*
2 * linux/arch/arm/kernel/etm.c
3 *
4 * Driver for ARM's Embedded Trace Macrocell and Embedded Trace Buffer.
5 *
6 * Copyright (C) 2009 Nokia Corporation.
7 * Alexander Shishkin
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 version 2 as
11 * published by the Free Software Foundation.
12 */
13
14#include <linux/kernel.h>
15#include <linux/init.h>
16#include <linux/types.h>
17#include <linux/io.h>
18#include <linux/sysrq.h>
19#include <linux/device.h>
20#include <linux/clk.h>
21#include <linux/amba/bus.h>
22#include <linux/fs.h>
23#include <linux/uaccess.h>
24#include <linux/miscdevice.h>
25#include <linux/vmalloc.h>
26#include <linux/mutex.h>
27#include <asm/hardware/coresight.h>
28#include <asm/sections.h>
29
30MODULE_LICENSE("GPL");
31MODULE_AUTHOR("Alexander Shishkin");
32
33static struct tracectx tracer;
34
35static inline bool trace_isrunning(struct tracectx *t)
36{
37 return !!(t->flags & TRACER_RUNNING);
38}
39
40static int etm_setup_address_range(struct tracectx *t, int n,
41 unsigned long start, unsigned long end, int exclude, int data)
42{
43 u32 flags = ETMAAT_ARM | ETMAAT_IGNCONTEXTID | ETMAAT_NSONLY | \
44 ETMAAT_NOVALCMP;
45
46 if (n < 1 || n > t->ncmppairs)
47 return -EINVAL;
48
49 /* comparators and ranges are numbered starting with 1 as opposed
50 * to bits in a word */
51 n--;
52
53 if (data)
54 flags |= ETMAAT_DLOADSTORE;
55 else
56 flags |= ETMAAT_IEXEC;
57
58 /* first comparator for the range */
59 etm_writel(t, flags, ETMR_COMP_ACC_TYPE(n * 2));
60 etm_writel(t, start, ETMR_COMP_VAL(n * 2));
61
62 /* second comparator is right next to it */
63 etm_writel(t, flags, ETMR_COMP_ACC_TYPE(n * 2 + 1));
64 etm_writel(t, end, ETMR_COMP_VAL(n * 2 + 1));
65
66 flags = exclude ? ETMTE_INCLEXCL : 0;
67 etm_writel(t, flags | (1 << n), ETMR_TRACEENCTRL);
68
69 return 0;
70}
71
72static int trace_start(struct tracectx *t)
73{
74 u32 v;
75 unsigned long timeout = TRACER_TIMEOUT;
76
77 etb_unlock(t);
78
79 etb_writel(t, 0, ETBR_FORMATTERCTRL);
80 etb_writel(t, 1, ETBR_CTRL);
81
82 etb_lock(t);
83
84 /* configure etm */
85 v = ETMCTRL_OPTS | ETMCTRL_PROGRAM | ETMCTRL_PORTSIZE(t->etm_portsz);
86
87 if (t->flags & TRACER_CYCLE_ACC)
88 v |= ETMCTRL_CYCLEACCURATE;
89
90 etm_unlock(t);
91
92 etm_writel(t, v, ETMR_CTRL);
93
94 while (!(etm_readl(t, ETMR_CTRL) & ETMCTRL_PROGRAM) && --timeout)
95 ;
96 if (!timeout) {
97 dev_dbg(t->dev, "Waiting for progbit to assert timed out\n");
98 etm_lock(t);
99 return -EFAULT;
100 }
101
102 etm_setup_address_range(t, 1, (unsigned long)_stext,
103 (unsigned long)_etext, 0, 0);
104 etm_writel(t, 0, ETMR_TRACEENCTRL2);
105 etm_writel(t, 0, ETMR_TRACESSCTRL);
106 etm_writel(t, 0x6f, ETMR_TRACEENEVT);
107
108 v &= ~ETMCTRL_PROGRAM;
109 v |= ETMCTRL_PORTSEL;
110
111 etm_writel(t, v, ETMR_CTRL);
112
113 timeout = TRACER_TIMEOUT;
114 while (etm_readl(t, ETMR_CTRL) & ETMCTRL_PROGRAM && --timeout)
115 ;
116 if (!timeout) {
117 dev_dbg(t->dev, "Waiting for progbit to deassert timed out\n");
118 etm_lock(t);
119 return -EFAULT;
120 }
121
122 etm_lock(t);
123
124 t->flags |= TRACER_RUNNING;
125
126 return 0;
127}
128
129static int trace_stop(struct tracectx *t)
130{
131 unsigned long timeout = TRACER_TIMEOUT;
132
133 etm_unlock(t);
134
135 etm_writel(t, 0x440, ETMR_CTRL);
136 while (!(etm_readl(t, ETMR_CTRL) & ETMCTRL_PROGRAM) && --timeout)
137 ;
138 if (!timeout) {
139 dev_dbg(t->dev, "Waiting for progbit to assert timed out\n");
140 etm_lock(t);
141 return -EFAULT;
142 }
143
144 etm_lock(t);
145
146 etb_unlock(t);
147 etb_writel(t, ETBFF_MANUAL_FLUSH, ETBR_FORMATTERCTRL);
148
149 timeout = TRACER_TIMEOUT;
150 while (etb_readl(t, ETBR_FORMATTERCTRL) &
151 ETBFF_MANUAL_FLUSH && --timeout)
152 ;
153 if (!timeout) {
154 dev_dbg(t->dev, "Waiting for formatter flush to commence "
155 "timed out\n");
156 etb_lock(t);
157 return -EFAULT;
158 }
159
160 etb_writel(t, 0, ETBR_CTRL);
161
162 etb_lock(t);
163
164 t->flags &= ~TRACER_RUNNING;
165
166 return 0;
167}
168
169static int etb_getdatalen(struct tracectx *t)
170{
171 u32 v;
172 int rp, wp;
173
174 v = etb_readl(t, ETBR_STATUS);
175
176 if (v & 1)
177 return t->etb_bufsz;
178
179 rp = etb_readl(t, ETBR_READADDR);
180 wp = etb_readl(t, ETBR_WRITEADDR);
181
182 if (rp > wp) {
183 etb_writel(t, 0, ETBR_READADDR);
184 etb_writel(t, 0, ETBR_WRITEADDR);
185
186 return 0;
187 }
188
189 return wp - rp;
190}
191
192/* sysrq+v will always stop the running trace and leave it at that */
193static void etm_dump(void)
194{
195 struct tracectx *t = &tracer;
196 u32 first = 0;
197 int length;
198
199 if (!t->etb_regs) {
200 printk(KERN_INFO "No tracing hardware found\n");
201 return;
202 }
203
204 if (trace_isrunning(t))
205 trace_stop(t);
206
207 etb_unlock(t);
208
209 length = etb_getdatalen(t);
210
211 if (length == t->etb_bufsz)
212 first = etb_readl(t, ETBR_WRITEADDR);
213
214 etb_writel(t, first, ETBR_READADDR);
215
216 printk(KERN_INFO "Trace buffer contents length: %d\n", length);
217 printk(KERN_INFO "--- ETB buffer begin ---\n");
218 for (; length; length--)
219 printk("%08x", cpu_to_be32(etb_readl(t, ETBR_READMEM)));
220 printk(KERN_INFO "\n--- ETB buffer end ---\n");
221
222 /* deassert the overflow bit */
223 etb_writel(t, 1, ETBR_CTRL);
224 etb_writel(t, 0, ETBR_CTRL);
225
226 etb_writel(t, 0, ETBR_TRIGGERCOUNT);
227 etb_writel(t, 0, ETBR_READADDR);
228 etb_writel(t, 0, ETBR_WRITEADDR);
229
230 etb_lock(t);
231}
232
233static void sysrq_etm_dump(int key, struct tty_struct *tty)
234{
235 dev_dbg(tracer.dev, "Dumping ETB buffer\n");
236 etm_dump();
237}
238
239static struct sysrq_key_op sysrq_etm_op = {
240 .handler = sysrq_etm_dump,
241 .help_msg = "ETM buffer dump",
242 .action_msg = "etm",
243};
244
245static int etb_open(struct inode *inode, struct file *file)
246{
247 if (!tracer.etb_regs)
248 return -ENODEV;
249
250 file->private_data = &tracer;
251
252 return nonseekable_open(inode, file);
253}
254
255static ssize_t etb_read(struct file *file, char __user *data,
256 size_t len, loff_t *ppos)
257{
258 int total, i;
259 long length;
260 struct tracectx *t = file->private_data;
261 u32 first = 0;
262 u32 *buf;
263
264 mutex_lock(&t->mutex);
265
266 if (trace_isrunning(t)) {
267 length = 0;
268 goto out;
269 }
270
271 etb_unlock(t);
272
273 total = etb_getdatalen(t);
274 if (total == t->etb_bufsz)
275 first = etb_readl(t, ETBR_WRITEADDR);
276
277 etb_writel(t, first, ETBR_READADDR);
278
279 length = min(total * 4, (int)len);
280 buf = vmalloc(length);
281
282 dev_dbg(t->dev, "ETB buffer length: %d\n", total);
283 dev_dbg(t->dev, "ETB status reg: %x\n", etb_readl(t, ETBR_STATUS));
284 for (i = 0; i < length / 4; i++)
285 buf[i] = etb_readl(t, ETBR_READMEM);
286
287 /* the only way to deassert overflow bit in ETB status is this */
288 etb_writel(t, 1, ETBR_CTRL);
289 etb_writel(t, 0, ETBR_CTRL);
290
291 etb_writel(t, 0, ETBR_WRITEADDR);
292 etb_writel(t, 0, ETBR_READADDR);
293 etb_writel(t, 0, ETBR_TRIGGERCOUNT);
294
295 etb_lock(t);
296
297 length -= copy_to_user(data, buf, length);
298 vfree(buf);
299
300out:
301 mutex_unlock(&t->mutex);
302
303 return length;
304}
305
306static int etb_release(struct inode *inode, struct file *file)
307{
308 /* there's nothing to do here, actually */
309 return 0;
310}
311
312static const struct file_operations etb_fops = {
313 .owner = THIS_MODULE,
314 .read = etb_read,
315 .open = etb_open,
316 .release = etb_release,
317};
318
319static struct miscdevice etb_miscdev = {
320 .name = "tracebuf",
321 .minor = 0,
322 .fops = &etb_fops,
323};
324
325static int __init etb_probe(struct amba_device *dev, struct amba_id *id)
326{
327 struct tracectx *t = &tracer;
328 int ret = 0;
329
330 ret = amba_request_regions(dev, NULL);
331 if (ret)
332 goto out;
333
334 t->etb_regs = ioremap_nocache(dev->res.start, resource_size(&dev->res));
335 if (!t->etb_regs) {
336 ret = -ENOMEM;
337 goto out_release;
338 }
339
340 amba_set_drvdata(dev, t);
341
342 etb_miscdev.parent = &dev->dev;
343
344 ret = misc_register(&etb_miscdev);
345 if (ret)
346 goto out_unmap;
347
348 t->emu_clk = clk_get(&dev->dev, "emu_src_ck");
349 if (IS_ERR(t->emu_clk)) {
350 dev_dbg(&dev->dev, "Failed to obtain emu_src_ck.\n");
351 return -EFAULT;
352 }
353
354 clk_enable(t->emu_clk);
355
356 etb_unlock(t);
357 t->etb_bufsz = etb_readl(t, ETBR_DEPTH);
358 dev_dbg(&dev->dev, "Size: %x\n", t->etb_bufsz);
359
360 /* make sure trace capture is disabled */
361 etb_writel(t, 0, ETBR_CTRL);
362 etb_writel(t, 0x1000, ETBR_FORMATTERCTRL);
363 etb_lock(t);
364
365 dev_dbg(&dev->dev, "ETB AMBA driver initialized.\n");
366
367out:
368 return ret;
369
370out_unmap:
371 amba_set_drvdata(dev, NULL);
372 iounmap(t->etb_regs);
373
374out_release:
375 amba_release_regions(dev);
376
377 return ret;
378}
379
380static int etb_remove(struct amba_device *dev)
381{
382 struct tracectx *t = amba_get_drvdata(dev);
383
384 amba_set_drvdata(dev, NULL);
385
386 iounmap(t->etb_regs);
387 t->etb_regs = NULL;
388
389 clk_disable(t->emu_clk);
390 clk_put(t->emu_clk);
391
392 amba_release_regions(dev);
393
394 return 0;
395}
396
397static struct amba_id etb_ids[] = {
398 {
399 .id = 0x0003b907,
400 .mask = 0x0007ffff,
401 },
402 { 0, 0 },
403};
404
405static struct amba_driver etb_driver = {
406 .drv = {
407 .name = "etb",
408 .owner = THIS_MODULE,
409 },
410 .probe = etb_probe,
411 .remove = etb_remove,
412 .id_table = etb_ids,
413};
414
415/* use a sysfs file "trace_running" to start/stop tracing */
416static ssize_t trace_running_show(struct kobject *kobj,
417 struct kobj_attribute *attr,
418 char *buf)
419{
420 return sprintf(buf, "%x\n", trace_isrunning(&tracer));
421}
422
423static ssize_t trace_running_store(struct kobject *kobj,
424 struct kobj_attribute *attr,
425 const char *buf, size_t n)
426{
427 unsigned int value;
428 int ret;
429
430 if (sscanf(buf, "%u", &value) != 1)
431 return -EINVAL;
432
433 mutex_lock(&tracer.mutex);
434 ret = value ? trace_start(&tracer) : trace_stop(&tracer);
435 mutex_unlock(&tracer.mutex);
436
437 return ret ? : n;
438}
439
440static struct kobj_attribute trace_running_attr =
441 __ATTR(trace_running, 0644, trace_running_show, trace_running_store);
442
443static ssize_t trace_info_show(struct kobject *kobj,
444 struct kobj_attribute *attr,
445 char *buf)
446{
447 u32 etb_wa, etb_ra, etb_st, etb_fc, etm_ctrl, etm_st;
448 int datalen;
449
450 etb_unlock(&tracer);
451 datalen = etb_getdatalen(&tracer);
452 etb_wa = etb_readl(&tracer, ETBR_WRITEADDR);
453 etb_ra = etb_readl(&tracer, ETBR_READADDR);
454 etb_st = etb_readl(&tracer, ETBR_STATUS);
455 etb_fc = etb_readl(&tracer, ETBR_FORMATTERCTRL);
456 etb_lock(&tracer);
457
458 etm_unlock(&tracer);
459 etm_ctrl = etm_readl(&tracer, ETMR_CTRL);
460 etm_st = etm_readl(&tracer, ETMR_STATUS);
461 etm_lock(&tracer);
462
463 return sprintf(buf, "Trace buffer len: %d\nComparator pairs: %d\n"
464 "ETBR_WRITEADDR:\t%08x\n"
465 "ETBR_READADDR:\t%08x\n"
466 "ETBR_STATUS:\t%08x\n"
467 "ETBR_FORMATTERCTRL:\t%08x\n"
468 "ETMR_CTRL:\t%08x\n"
469 "ETMR_STATUS:\t%08x\n",
470 datalen,
471 tracer.ncmppairs,
472 etb_wa,
473 etb_ra,
474 etb_st,
475 etb_fc,
476 etm_ctrl,
477 etm_st
478 );
479}
480
481static struct kobj_attribute trace_info_attr =
482 __ATTR(trace_info, 0444, trace_info_show, NULL);
483
484static ssize_t trace_mode_show(struct kobject *kobj,
485 struct kobj_attribute *attr,
486 char *buf)
487{
488 return sprintf(buf, "%d %d\n",
489 !!(tracer.flags & TRACER_CYCLE_ACC),
490 tracer.etm_portsz);
491}
492
493static ssize_t trace_mode_store(struct kobject *kobj,
494 struct kobj_attribute *attr,
495 const char *buf, size_t n)
496{
497 unsigned int cycacc, portsz;
498
499 if (sscanf(buf, "%u %u", &cycacc, &portsz) != 2)
500 return -EINVAL;
501
502 mutex_lock(&tracer.mutex);
503 if (cycacc)
504 tracer.flags |= TRACER_CYCLE_ACC;
505 else
506 tracer.flags &= ~TRACER_CYCLE_ACC;
507
508 tracer.etm_portsz = portsz & 0x0f;
509 mutex_unlock(&tracer.mutex);
510
511 return n;
512}
513
514static struct kobj_attribute trace_mode_attr =
515 __ATTR(trace_mode, 0644, trace_mode_show, trace_mode_store);
516
517static int __init etm_probe(struct amba_device *dev, struct amba_id *id)
518{
519 struct tracectx *t = &tracer;
520 int ret = 0;
521
522 if (t->etm_regs) {
523 dev_dbg(&dev->dev, "ETM already initialized\n");
524 ret = -EBUSY;
525 goto out;
526 }
527
528 ret = amba_request_regions(dev, NULL);
529 if (ret)
530 goto out;
531
532 t->etm_regs = ioremap_nocache(dev->res.start, resource_size(&dev->res));
533 if (!t->etm_regs) {
534 ret = -ENOMEM;
535 goto out_release;
536 }
537
538 amba_set_drvdata(dev, t);
539
540 mutex_init(&t->mutex);
541 t->dev = &dev->dev;
542 t->flags = TRACER_CYCLE_ACC;
543 t->etm_portsz = 1;
544
545 etm_unlock(t);
546 ret = etm_readl(t, CSCR_PRSR);
547
548 t->ncmppairs = etm_readl(t, ETMR_CONFCODE) & 0xf;
549 etm_writel(t, 0x440, ETMR_CTRL);
550 etm_lock(t);
551
552 ret = sysfs_create_file(&dev->dev.kobj,
553 &trace_running_attr.attr);
554 if (ret)
555 goto out_unmap;
556
557 /* failing to create any of these two is not fatal */
558 ret = sysfs_create_file(&dev->dev.kobj, &trace_info_attr.attr);
559 if (ret)
560 dev_dbg(&dev->dev, "Failed to create trace_info in sysfs\n");
561
562 ret = sysfs_create_file(&dev->dev.kobj, &trace_mode_attr.attr);
563 if (ret)
564 dev_dbg(&dev->dev, "Failed to create trace_mode in sysfs\n");
565
566 dev_dbg(t->dev, "ETM AMBA driver initialized.\n");
567
568out:
569 return ret;
570
571out_unmap:
572 amba_set_drvdata(dev, NULL);
573 iounmap(t->etm_regs);
574
575out_release:
576 amba_release_regions(dev);
577
578 return ret;
579}
580
581static int etm_remove(struct amba_device *dev)
582{
583 struct tracectx *t = amba_get_drvdata(dev);
584
585 amba_set_drvdata(dev, NULL);
586
587 iounmap(t->etm_regs);
588 t->etm_regs = NULL;
589
590 amba_release_regions(dev);
591
592 sysfs_remove_file(&dev->dev.kobj, &trace_running_attr.attr);
593 sysfs_remove_file(&dev->dev.kobj, &trace_info_attr.attr);
594 sysfs_remove_file(&dev->dev.kobj, &trace_mode_attr.attr);
595
596 return 0;
597}
598
599static struct amba_id etm_ids[] = {
600 {
601 .id = 0x0003b921,
602 .mask = 0x0007ffff,
603 },
604 { 0, 0 },
605};
606
607static struct amba_driver etm_driver = {
608 .drv = {
609 .name = "etm",
610 .owner = THIS_MODULE,
611 },
612 .probe = etm_probe,
613 .remove = etm_remove,
614 .id_table = etm_ids,
615};
616
617static int __init etm_init(void)
618{
619 int retval;
620
621 retval = amba_driver_register(&etb_driver);
622 if (retval) {
623 printk(KERN_ERR "Failed to register etb\n");
624 return retval;
625 }
626
627 retval = amba_driver_register(&etm_driver);
628 if (retval) {
629 amba_driver_unregister(&etb_driver);
630 printk(KERN_ERR "Failed to probe etm\n");
631 return retval;
632 }
633
634 /* not being able to install this handler is not fatal */
635 (void)register_sysrq_key('v', &sysrq_etm_op);
636
637 return 0;
638}
639
640device_initcall(etm_init);
641
diff --git a/arch/arm/kernel/head-nommu.S b/arch/arm/kernel/head-nommu.S
index e5dfc2895e24..573b803dc6bf 100644
--- a/arch/arm/kernel/head-nommu.S
+++ b/arch/arm/kernel/head-nommu.S
@@ -32,7 +32,7 @@
32 * numbers for r1. 32 * numbers for r1.
33 * 33 *
34 */ 34 */
35 .section ".text.head", "ax" 35 __HEAD
36ENTRY(stext) 36ENTRY(stext)
37 setmode PSR_F_BIT | PSR_I_BIT | SVC_MODE, r9 @ ensure svc mode 37 setmode PSR_F_BIT | PSR_I_BIT | SVC_MODE, r9 @ ensure svc mode
38 @ and irqs disabled 38 @ and irqs disabled
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
index 38ccbe1d3b2c..eb62bf947212 100644
--- a/arch/arm/kernel/head.S
+++ b/arch/arm/kernel/head.S
@@ -74,7 +74,7 @@
74 * crap here - that's what the boot loader (or in extreme, well justified 74 * crap here - that's what the boot loader (or in extreme, well justified
75 * circumstances, zImage) is for. 75 * circumstances, zImage) is for.
76 */ 76 */
77 .section ".text.head", "ax" 77 __HEAD
78ENTRY(stext) 78ENTRY(stext)
79 setmode PSR_F_BIT | PSR_I_BIT | SVC_MODE, r9 @ ensure svc mode 79 setmode PSR_F_BIT | PSR_I_BIT | SVC_MODE, r9 @ ensure svc mode
80 @ and irqs disabled 80 @ and irqs disabled
diff --git a/arch/arm/kernel/isa.c b/arch/arm/kernel/isa.c
index 8ac9b8424007..346485910732 100644
--- a/arch/arm/kernel/isa.c
+++ b/arch/arm/kernel/isa.c
@@ -22,47 +22,42 @@ static unsigned int isa_membase, isa_portbase, isa_portshift;
22 22
23static ctl_table ctl_isa_vars[4] = { 23static ctl_table ctl_isa_vars[4] = {
24 { 24 {
25 .ctl_name = BUS_ISA_MEM_BASE,
26 .procname = "membase", 25 .procname = "membase",
27 .data = &isa_membase, 26 .data = &isa_membase,
28 .maxlen = sizeof(isa_membase), 27 .maxlen = sizeof(isa_membase),
29 .mode = 0444, 28 .mode = 0444,
30 .proc_handler = &proc_dointvec, 29 .proc_handler = proc_dointvec,
31 }, { 30 }, {
32 .ctl_name = BUS_ISA_PORT_BASE,
33 .procname = "portbase", 31 .procname = "portbase",
34 .data = &isa_portbase, 32 .data = &isa_portbase,
35 .maxlen = sizeof(isa_portbase), 33 .maxlen = sizeof(isa_portbase),
36 .mode = 0444, 34 .mode = 0444,
37 .proc_handler = &proc_dointvec, 35 .proc_handler = proc_dointvec,
38 }, { 36 }, {
39 .ctl_name = BUS_ISA_PORT_SHIFT,
40 .procname = "portshift", 37 .procname = "portshift",
41 .data = &isa_portshift, 38 .data = &isa_portshift,
42 .maxlen = sizeof(isa_portshift), 39 .maxlen = sizeof(isa_portshift),
43 .mode = 0444, 40 .mode = 0444,
44 .proc_handler = &proc_dointvec, 41 .proc_handler = proc_dointvec,
45 }, {0} 42 }, {}
46}; 43};
47 44
48static struct ctl_table_header *isa_sysctl_header; 45static struct ctl_table_header *isa_sysctl_header;
49 46
50static ctl_table ctl_isa[2] = { 47static ctl_table ctl_isa[2] = {
51 { 48 {
52 .ctl_name = CTL_BUS_ISA,
53 .procname = "isa", 49 .procname = "isa",
54 .mode = 0555, 50 .mode = 0555,
55 .child = ctl_isa_vars, 51 .child = ctl_isa_vars,
56 }, {0} 52 }, {}
57}; 53};
58 54
59static ctl_table ctl_bus[2] = { 55static ctl_table ctl_bus[2] = {
60 { 56 {
61 .ctl_name = CTL_BUS,
62 .procname = "bus", 57 .procname = "bus",
63 .mode = 0555, 58 .mode = 0555,
64 .child = ctl_isa, 59 .child = ctl_isa,
65 }, {0} 60 }, {}
66}; 61};
67 62
68void __init 63void __init
diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c
index 2a573d4fea24..e7714f367eb8 100644
--- a/arch/arm/kernel/signal.c
+++ b/arch/arm/kernel/signal.c
@@ -662,8 +662,12 @@ static void do_signal(struct pt_regs *regs, int syscall)
662 regs->ARM_sp -= 4; 662 regs->ARM_sp -= 4;
663 usp = (u32 __user *)regs->ARM_sp; 663 usp = (u32 __user *)regs->ARM_sp;
664 664
665 put_user(regs->ARM_pc, usp); 665 if (put_user(regs->ARM_pc, usp) == 0) {
666 regs->ARM_pc = KERN_RESTART_CODE; 666 regs->ARM_pc = KERN_RESTART_CODE;
667 } else {
668 regs->ARM_sp += 4;
669 force_sigsegv(0, current);
670 }
667#endif 671#endif
668 } 672 }
669 } 673 }
diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S
index aecf87dfbaec..71151bd87a36 100644
--- a/arch/arm/kernel/vmlinux.lds.S
+++ b/arch/arm/kernel/vmlinux.lds.S
@@ -24,13 +24,11 @@ SECTIONS
24#else 24#else
25 . = PAGE_OFFSET + TEXT_OFFSET; 25 . = PAGE_OFFSET + TEXT_OFFSET;
26#endif 26#endif
27 .text.head : {
28 _stext = .;
29 _sinittext = .;
30 *(.text.head)
31 }
32 27
33 .init : { /* Init code and data */ 28 .init : { /* Init code and data */
29 _stext = .;
30 _sinittext = .;
31 HEAD_TEXT
34 INIT_TEXT 32 INIT_TEXT
35 _einittext = .; 33 _einittext = .;
36 __proc_info_begin = .; 34 __proc_info_begin = .;
@@ -42,43 +40,31 @@ SECTIONS
42 __tagtable_begin = .; 40 __tagtable_begin = .;
43 *(.taglist.init) 41 *(.taglist.init)
44 __tagtable_end = .; 42 __tagtable_end = .;
45 . = ALIGN(16); 43
46 __setup_start = .; 44 INIT_SETUP(16)
47 *(.init.setup) 45
48 __setup_end = .;
49 __early_begin = .; 46 __early_begin = .;
50 *(.early_param.init) 47 *(.early_param.init)
51 __early_end = .; 48 __early_end = .;
52 __initcall_start = .; 49
53 INITCALLS 50 INIT_CALLS
54 __initcall_end = .; 51 CON_INITCALL
55 __con_initcall_start = .; 52 SECURITY_INITCALL
56 *(.con_initcall.init) 53 INIT_RAM_FS
57 __con_initcall_end = .; 54
58 __security_initcall_start = .;
59 *(.security_initcall.init)
60 __security_initcall_end = .;
61#ifdef CONFIG_BLK_DEV_INITRD
62 . = ALIGN(32);
63 __initramfs_start = .;
64 usr/built-in.o(.init.ramfs)
65 __initramfs_end = .;
66#endif
67 . = ALIGN(PAGE_SIZE);
68 __per_cpu_load = .;
69 __per_cpu_start = .;
70 *(.data.percpu.page_aligned)
71 *(.data.percpu)
72 *(.data.percpu.shared_aligned)
73 __per_cpu_end = .;
74#ifndef CONFIG_XIP_KERNEL 55#ifndef CONFIG_XIP_KERNEL
75 __init_begin = _stext; 56 __init_begin = _stext;
76 INIT_DATA 57 INIT_DATA
77 . = ALIGN(PAGE_SIZE);
78 __init_end = .;
79#endif 58#endif
80 } 59 }
81 60
61 PERCPU(PAGE_SIZE)
62
63#ifndef CONFIG_XIP_KERNEL
64 . = ALIGN(PAGE_SIZE);
65 __init_end = .;
66#endif
67
82 /DISCARD/ : { /* Exit code and data */ 68 /DISCARD/ : { /* Exit code and data */
83 EXIT_TEXT 69 EXIT_TEXT
84 EXIT_DATA 70 EXIT_DATA
@@ -157,7 +143,7 @@ SECTIONS
157 * first, the init task union, aligned 143 * first, the init task union, aligned
158 * to an 8192 byte boundary. 144 * to an 8192 byte boundary.
159 */ 145 */
160 *(.data.init_task) 146 INIT_TASK_DATA(THREAD_SIZE)
161 147
162#ifdef CONFIG_XIP_KERNEL 148#ifdef CONFIG_XIP_KERNEL
163 . = ALIGN(PAGE_SIZE); 149 . = ALIGN(PAGE_SIZE);
@@ -167,17 +153,8 @@ SECTIONS
167 __init_end = .; 153 __init_end = .;
168#endif 154#endif
169 155
170 . = ALIGN(PAGE_SIZE); 156 NOSAVE_DATA
171 __nosave_begin = .; 157 CACHELINE_ALIGNED_DATA(32)
172 *(.data.nosave)
173 . = ALIGN(PAGE_SIZE);
174 __nosave_end = .;
175
176 /*
177 * then the cacheline aligned data
178 */
179 . = ALIGN(32);
180 *(.data.cacheline_aligned)
181 158
182 /* 159 /*
183 * The exception fixup table (might need resorting at runtime) 160 * The exception fixup table (might need resorting at runtime)
@@ -256,20 +233,10 @@ SECTIONS
256 } 233 }
257#endif 234#endif
258 235
259 .bss : { 236 BSS_SECTION(0, 0, 0)
260 __bss_start = .; /* BSS */ 237 _end = .;
261 *(.bss) 238
262 *(COMMON) 239 STABS_DEBUG
263 __bss_stop = .;
264 _end = .;
265 }
266 /* Stabs debugging sections. */
267 .stab 0 : { *(.stab) }
268 .stabstr 0 : { *(.stabstr) }
269 .stab.excl 0 : { *(.stab.excl) }
270 .stab.exclstr 0 : { *(.stab.exclstr) }
271 .stab.index 0 : { *(.stab.index) }
272 .stab.indexstr 0 : { *(.stab.indexstr) }
273 .comment 0 : { *(.comment) } 240 .comment 0 : { *(.comment) }
274} 241}
275 242
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index 2fd88437348b..0b2ee953f164 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -1,5 +1,20 @@
1if ARCH_AT91 1if ARCH_AT91
2 2
3config HAVE_AT91_DATAFLASH_CARD
4 bool
5
6config HAVE_NAND_ATMEL_BUSWIDTH_16
7 bool
8
9config HAVE_AT91_USART3
10 bool
11
12config HAVE_AT91_USART4
13 bool
14
15config HAVE_AT91_USART5
16 bool
17
3menu "Atmel AT91 System-on-Chip" 18menu "Atmel AT91 System-on-Chip"
4 19
5choice 20choice
@@ -10,54 +25,69 @@ config ARCH_AT91RM9200
10 select CPU_ARM920T 25 select CPU_ARM920T
11 select GENERIC_TIME 26 select GENERIC_TIME
12 select GENERIC_CLOCKEVENTS 27 select GENERIC_CLOCKEVENTS
28 select HAVE_AT91_USART3
13 29
14config ARCH_AT91SAM9260 30config ARCH_AT91SAM9260
15 bool "AT91SAM9260 or AT91SAM9XE" 31 bool "AT91SAM9260 or AT91SAM9XE"
16 select CPU_ARM926T 32 select CPU_ARM926T
17 select GENERIC_TIME 33 select GENERIC_TIME
18 select GENERIC_CLOCKEVENTS 34 select GENERIC_CLOCKEVENTS
35 select HAVE_AT91_USART3
36 select HAVE_AT91_USART4
37 select HAVE_AT91_USART5
19 38
20config ARCH_AT91SAM9261 39config ARCH_AT91SAM9261
21 bool "AT91SAM9261" 40 bool "AT91SAM9261"
22 select CPU_ARM926T 41 select CPU_ARM926T
23 select GENERIC_TIME 42 select GENERIC_TIME
24 select GENERIC_CLOCKEVENTS 43 select GENERIC_CLOCKEVENTS
44 select HAVE_FB_ATMEL
25 45
26config ARCH_AT91SAM9G10 46config ARCH_AT91SAM9G10
27 bool "AT91SAM9G10" 47 bool "AT91SAM9G10"
28 select CPU_ARM926T 48 select CPU_ARM926T
29 select GENERIC_TIME 49 select GENERIC_TIME
30 select GENERIC_CLOCKEVENTS 50 select GENERIC_CLOCKEVENTS
51 select HAVE_FB_ATMEL
31 52
32config ARCH_AT91SAM9263 53config ARCH_AT91SAM9263
33 bool "AT91SAM9263" 54 bool "AT91SAM9263"
34 select CPU_ARM926T 55 select CPU_ARM926T
35 select GENERIC_TIME 56 select GENERIC_TIME
36 select GENERIC_CLOCKEVENTS 57 select GENERIC_CLOCKEVENTS
58 select HAVE_FB_ATMEL
37 59
38config ARCH_AT91SAM9RL 60config ARCH_AT91SAM9RL
39 bool "AT91SAM9RL" 61 bool "AT91SAM9RL"
40 select CPU_ARM926T 62 select CPU_ARM926T
41 select GENERIC_TIME 63 select GENERIC_TIME
42 select GENERIC_CLOCKEVENTS 64 select GENERIC_CLOCKEVENTS
65 select HAVE_AT91_USART3
66 select HAVE_FB_ATMEL
43 67
44config ARCH_AT91SAM9G20 68config ARCH_AT91SAM9G20
45 bool "AT91SAM9G20" 69 bool "AT91SAM9G20"
46 select CPU_ARM926T 70 select CPU_ARM926T
47 select GENERIC_TIME 71 select GENERIC_TIME
48 select GENERIC_CLOCKEVENTS 72 select GENERIC_CLOCKEVENTS
73 select HAVE_AT91_USART3
74 select HAVE_AT91_USART4
75 select HAVE_AT91_USART5
49 76
50config ARCH_AT91SAM9G45 77config ARCH_AT91SAM9G45
51 bool "AT91SAM9G45" 78 bool "AT91SAM9G45"
52 select CPU_ARM926T 79 select CPU_ARM926T
53 select GENERIC_TIME 80 select GENERIC_TIME
54 select GENERIC_CLOCKEVENTS 81 select GENERIC_CLOCKEVENTS
82 select HAVE_AT91_USART3
83 select HAVE_FB_ATMEL
55 84
56config ARCH_AT91CAP9 85config ARCH_AT91CAP9
57 bool "AT91CAP9" 86 bool "AT91CAP9"
58 select CPU_ARM926T 87 select CPU_ARM926T
59 select GENERIC_TIME 88 select GENERIC_TIME
60 select GENERIC_CLOCKEVENTS 89 select GENERIC_CLOCKEVENTS
90 select HAVE_FB_ATMEL
61 91
62config ARCH_AT91X40 92config ARCH_AT91X40
63 bool "AT91x40" 93 bool "AT91x40"
@@ -76,93 +106,88 @@ comment "AT91RM9200 Board Type"
76 106
77config MACH_ONEARM 107config MACH_ONEARM
78 bool "Ajeco 1ARM Single Board Computer" 108 bool "Ajeco 1ARM Single Board Computer"
79 depends on ARCH_AT91RM9200
80 help 109 help
81 Select this if you are using Ajeco's 1ARM Single Board Computer. 110 Select this if you are using Ajeco's 1ARM Single Board Computer.
82 <http://www.ajeco.fi/products.htm> 111 <http://www.ajeco.fi/products.htm>
83 112
84config ARCH_AT91RM9200DK 113config ARCH_AT91RM9200DK
85 bool "Atmel AT91RM9200-DK Development board" 114 bool "Atmel AT91RM9200-DK Development board"
86 depends on ARCH_AT91RM9200 115 select HAVE_AT91_DATAFLASH_CARD
87 help 116 help
88 Select this if you are using Atmel's AT91RM9200-DK Development board. 117 Select this if you are using Atmel's AT91RM9200-DK Development board.
89 (Discontinued) 118 (Discontinued)
90 119
91config MACH_AT91RM9200EK 120config MACH_AT91RM9200EK
92 bool "Atmel AT91RM9200-EK Evaluation Kit" 121 bool "Atmel AT91RM9200-EK Evaluation Kit"
93 depends on ARCH_AT91RM9200 122 select HAVE_AT91_DATAFLASH_CARD
94 help 123 help
95 Select this if you are using Atmel's AT91RM9200-EK Evaluation Kit. 124 Select this if you are using Atmel's AT91RM9200-EK Evaluation Kit.
96 <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3507> 125 <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3507>
97 126
98config MACH_CSB337 127config MACH_CSB337
99 bool "Cogent CSB337" 128 bool "Cogent CSB337"
100 depends on ARCH_AT91RM9200
101 help 129 help
102 Select this if you are using Cogent's CSB337 board. 130 Select this if you are using Cogent's CSB337 board.
103 <http://www.cogcomp.com/csb_csb337.htm> 131 <http://www.cogcomp.com/csb_csb337.htm>
104 132
105config MACH_CSB637 133config MACH_CSB637
106 bool "Cogent CSB637" 134 bool "Cogent CSB637"
107 depends on ARCH_AT91RM9200
108 help 135 help
109 Select this if you are using Cogent's CSB637 board. 136 Select this if you are using Cogent's CSB637 board.
110 <http://www.cogcomp.com/csb_csb637.htm> 137 <http://www.cogcomp.com/csb_csb637.htm>
111 138
112config MACH_CARMEVA 139config MACH_CARMEVA
113 bool "Conitec ARM&EVA" 140 bool "Conitec ARM&EVA"
114 depends on ARCH_AT91RM9200
115 help 141 help
116 Select this if you are using Conitec's AT91RM9200-MCU-Module. 142 Select this if you are using Conitec's AT91RM9200-MCU-Module.
117 <http://www.conitec.net/english/linuxboard.htm> 143 <http://www.conitec.net/english/linuxboard.htm>
118 144
119config MACH_ATEB9200 145config MACH_ATEB9200
120 bool "Embest ATEB9200" 146 bool "Embest ATEB9200"
121 depends on ARCH_AT91RM9200
122 help 147 help
123 Select this if you are using Embest's ATEB9200 board. 148 Select this if you are using Embest's ATEB9200 board.
124 <http://www.embedinfo.com/english/product/ATEB9200.asp> 149 <http://www.embedinfo.com/english/product/ATEB9200.asp>
125 150
126config MACH_KB9200 151config MACH_KB9200
127 bool "KwikByte KB920x" 152 bool "KwikByte KB920x"
128 depends on ARCH_AT91RM9200
129 help 153 help
130 Select this if you are using KwikByte's KB920x board. 154 Select this if you are using KwikByte's KB920x board.
131 <http://kwikbyte.com/KB9202_description_new.htm> 155 <http://kwikbyte.com/KB9202_description_new.htm>
132 156
133config MACH_PICOTUX2XX 157config MACH_PICOTUX2XX
134 bool "picotux 200" 158 bool "picotux 200"
135 depends on ARCH_AT91RM9200
136 help 159 help
137 Select this if you are using a picotux 200. 160 Select this if you are using a picotux 200.
138 <http://www.picotux.com/> 161 <http://www.picotux.com/>
139 162
140config MACH_KAFA 163config MACH_KAFA
141 bool "Sperry-Sun KAFA board" 164 bool "Sperry-Sun KAFA board"
142 depends on ARCH_AT91RM9200
143 help 165 help
144 Select this if you are using Sperry-Sun's KAFA board. 166 Select this if you are using Sperry-Sun's KAFA board.
145 167
146config MACH_ECBAT91 168config MACH_ECBAT91
147 bool "emQbit ECB_AT91 SBC" 169 bool "emQbit ECB_AT91 SBC"
148 depends on ARCH_AT91RM9200 170 select HAVE_AT91_DATAFLASH_CARD
149 help 171 help
150 Select this if you are using emQbit's ECB_AT91 board. 172 Select this if you are using emQbit's ECB_AT91 board.
151 <http://wiki.emqbit.com/free-ecb-at91> 173 <http://wiki.emqbit.com/free-ecb-at91>
152 174
153config MACH_YL9200 175config MACH_YL9200
154 bool "ucDragon YL-9200" 176 bool "ucDragon YL-9200"
155 depends on ARCH_AT91RM9200
156 help 177 help
157 Select this if you are using the ucDragon YL-9200 board. 178 Select this if you are using the ucDragon YL-9200 board.
158 179
159config MACH_CPUAT91 180config MACH_CPUAT91
160 bool "Eukrea CPUAT91" 181 bool "Eukrea CPUAT91"
161 depends on ARCH_AT91RM9200
162 help 182 help
163 Select this if you are using the Eukrea Electromatique's 183 Select this if you are using the Eukrea Electromatique's
164 CPUAT91 board <http://www.eukrea.com/>. 184 CPUAT91 board <http://www.eukrea.com/>.
165 185
186config MACH_ECO920
187 bool "eco920"
188 help
189 Select this if you are using the eco920 board
190
166endif 191endif
167 192
168# ---------------------------------------------------------- 193# ----------------------------------------------------------
@@ -173,7 +198,6 @@ comment "AT91SAM9260 Variants"
173 198
174config ARCH_AT91SAM9260_SAM9XE 199config ARCH_AT91SAM9260_SAM9XE
175 bool "AT91SAM9XE" 200 bool "AT91SAM9XE"
176 depends on ARCH_AT91SAM9260
177 help 201 help
178 Select this if you are using Atmel's AT91SAM9XE System-on-Chip. 202 Select this if you are using Atmel's AT91SAM9XE System-on-Chip.
179 They are basically AT91SAM9260s with various sizes of embedded Flash. 203 They are basically AT91SAM9260s with various sizes of embedded Flash.
@@ -182,28 +206,27 @@ comment "AT91SAM9260 / AT91SAM9XE Board Type"
182 206
183config MACH_AT91SAM9260EK 207config MACH_AT91SAM9260EK
184 bool "Atmel AT91SAM9260-EK / AT91SAM9XE Evaluation Kit" 208 bool "Atmel AT91SAM9260-EK / AT91SAM9XE Evaluation Kit"
185 depends on ARCH_AT91SAM9260 209 select HAVE_AT91_DATAFLASH_CARD
210 select HAVE_NAND_ATMEL_BUSWIDTH_16
186 help 211 help
187 Select this if you are using Atmel's AT91SAM9260-EK or AT91SAM9XE Evaluation Kit 212 Select this if you are using Atmel's AT91SAM9260-EK or AT91SAM9XE Evaluation Kit
188 <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3933> 213 <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3933>
189 214
190config MACH_CAM60 215config MACH_CAM60
191 bool "KwikByte KB9260 (CAM60) board" 216 bool "KwikByte KB9260 (CAM60) board"
192 depends on ARCH_AT91SAM9260
193 help 217 help
194 Select this if you are using KwikByte's KB9260 (CAM60) board based on the Atmel AT91SAM9260. 218 Select this if you are using KwikByte's KB9260 (CAM60) board based on the Atmel AT91SAM9260.
195 <http://www.kwikbyte.com/KB9260.html> 219 <http://www.kwikbyte.com/KB9260.html>
196 220
197config MACH_SAM9_L9260 221config MACH_SAM9_L9260
198 bool "Olimex SAM9-L9260 board" 222 bool "Olimex SAM9-L9260 board"
199 depends on ARCH_AT91SAM9260 223 select HAVE_AT91_DATAFLASH_CARD
200 help 224 help
201 Select this if you are using Olimex's SAM9-L9260 board based on the Atmel AT91SAM9260. 225 Select this if you are using Olimex's SAM9-L9260 board based on the Atmel AT91SAM9260.
202 <http://www.olimex.com/dev/sam9-L9260.html> 226 <http://www.olimex.com/dev/sam9-L9260.html>
203 227
204config MACH_AFEB9260 228config MACH_AFEB9260
205 bool "Custom afeb9260 board v1" 229 bool "Custom afeb9260 board v1"
206 depends on ARCH_AT91SAM9260
207 help 230 help
208 Select this if you are using custom afeb9260 board based on 231 Select this if you are using custom afeb9260 board based on
209 open hardware design. Select this for revision 1 of the board. 232 open hardware design. Select this for revision 1 of the board.
@@ -212,21 +235,18 @@ config MACH_AFEB9260
212 235
213config MACH_USB_A9260 236config MACH_USB_A9260
214 bool "CALAO USB-A9260" 237 bool "CALAO USB-A9260"
215 depends on ARCH_AT91SAM9260
216 help 238 help
217 Select this if you are using a Calao Systems USB-A9260. 239 Select this if you are using a Calao Systems USB-A9260.
218 <http://www.calao-systems.com> 240 <http://www.calao-systems.com>
219 241
220config MACH_QIL_A9260 242config MACH_QIL_A9260
221 bool "CALAO QIL-A9260 board" 243 bool "CALAO QIL-A9260 board"
222 depends on ARCH_AT91SAM9260
223 help 244 help
224 Select this if you are using a Calao Systems QIL-A9260 Board. 245 Select this if you are using a Calao Systems QIL-A9260 Board.
225 <http://www.calao-systems.com> 246 <http://www.calao-systems.com>
226 247
227config MACH_CPU9260 248config MACH_CPU9260
228 bool "Eukrea CPU9260 board" 249 bool "Eukrea CPU9260 board"
229 depends on ARCH_AT91SAM9260
230 help 250 help
231 Select this if you are using a Eukrea Electromatique's 251 Select this if you are using a Eukrea Electromatique's
232 CPU9260 Board <http://www.eukrea.com/> 252 CPU9260 Board <http://www.eukrea.com/>
@@ -241,7 +261,8 @@ comment "AT91SAM9261 Board Type"
241 261
242config MACH_AT91SAM9261EK 262config MACH_AT91SAM9261EK
243 bool "Atmel AT91SAM9261-EK Evaluation Kit" 263 bool "Atmel AT91SAM9261-EK Evaluation Kit"
244 depends on ARCH_AT91SAM9261 264 select HAVE_AT91_DATAFLASH_CARD
265 select HAVE_NAND_ATMEL_BUSWIDTH_16
245 help 266 help
246 Select this if you are using Atmel's AT91SAM9261-EK Evaluation Kit. 267 Select this if you are using Atmel's AT91SAM9261-EK Evaluation Kit.
247 <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3820> 268 <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3820>
@@ -256,7 +277,8 @@ comment "AT91SAM9G10 Board Type"
256 277
257config MACH_AT91SAM9G10EK 278config MACH_AT91SAM9G10EK
258 bool "Atmel AT91SAM9G10-EK Evaluation Kit" 279 bool "Atmel AT91SAM9G10-EK Evaluation Kit"
259 depends on ARCH_AT91SAM9G10 280 select HAVE_AT91_DATAFLASH_CARD
281 select HAVE_NAND_ATMEL_BUSWIDTH_16
260 help 282 help
261 Select this if you are using Atmel's AT91SAM9G10-EK Evaluation Kit. 283 Select this if you are using Atmel's AT91SAM9G10-EK Evaluation Kit.
262 <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4588> 284 <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4588>
@@ -271,21 +293,21 @@ comment "AT91SAM9263 Board Type"
271 293
272config MACH_AT91SAM9263EK 294config MACH_AT91SAM9263EK
273 bool "Atmel AT91SAM9263-EK Evaluation Kit" 295 bool "Atmel AT91SAM9263-EK Evaluation Kit"
274 depends on ARCH_AT91SAM9263 296 select HAVE_AT91_DATAFLASH_CARD
297 select HAVE_NAND_ATMEL_BUSWIDTH_16
275 help 298 help
276 Select this if you are using Atmel's AT91SAM9263-EK Evaluation Kit. 299 Select this if you are using Atmel's AT91SAM9263-EK Evaluation Kit.
277 <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4057> 300 <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4057>
278 301
279config MACH_USB_A9263 302config MACH_USB_A9263
280 bool "CALAO USB-A9263" 303 bool "CALAO USB-A9263"
281 depends on ARCH_AT91SAM9263
282 help 304 help
283 Select this if you are using a Calao Systems USB-A9263. 305 Select this if you are using a Calao Systems USB-A9263.
284 <http://www.calao-systems.com> 306 <http://www.calao-systems.com>
285 307
286config MACH_NEOCORE926 308config MACH_NEOCORE926
287 bool "Adeneo NEOCORE926" 309 bool "Adeneo NEOCORE926"
288 depends on ARCH_AT91SAM9263 310 select HAVE_AT91_DATAFLASH_CARD
289 help 311 help
290 Select this if you are using the Adeneo Neocore 926 board. 312 Select this if you are using the Adeneo Neocore 926 board.
291 313
@@ -299,7 +321,6 @@ comment "AT91SAM9RL Board Type"
299 321
300config MACH_AT91SAM9RLEK 322config MACH_AT91SAM9RLEK
301 bool "Atmel AT91SAM9RL-EK Evaluation Kit" 323 bool "Atmel AT91SAM9RL-EK Evaluation Kit"
302 depends on ARCH_AT91SAM9RL
303 help 324 help
304 Select this if you are using Atmel's AT91SAM9RL-EK Evaluation Kit. 325 Select this if you are using Atmel's AT91SAM9RL-EK Evaluation Kit.
305 326
@@ -313,14 +334,15 @@ comment "AT91SAM9G20 Board Type"
313 334
314config MACH_AT91SAM9G20EK 335config MACH_AT91SAM9G20EK
315 bool "Atmel AT91SAM9G20-EK Evaluation Kit" 336 bool "Atmel AT91SAM9G20-EK Evaluation Kit"
316 depends on ARCH_AT91SAM9G20 337 select HAVE_AT91_DATAFLASH_CARD
338 select HAVE_NAND_ATMEL_BUSWIDTH_16
317 help 339 help
318 Select this if you are using Atmel's AT91SAM9G20-EK Evaluation Kit 340 Select this if you are using Atmel's AT91SAM9G20-EK Evaluation Kit
319 that embeds only one SD/MMC slot. 341 that embeds only one SD/MMC slot.
320 342
321config MACH_AT91SAM9G20EK_2MMC 343config MACH_AT91SAM9G20EK_2MMC
322 bool "Atmel AT91SAM9G20-EK Evaluation Kit with 2 SD/MMC Slots" 344 bool "Atmel AT91SAM9G20-EK Evaluation Kit with 2 SD/MMC Slots"
323 depends on ARCH_AT91SAM9G20 345 select HAVE_NAND_ATMEL_BUSWIDTH_16
324 help 346 help
325 Select this if you are using an Atmel AT91SAM9G20-EK Evaluation Kit 347 Select this if you are using an Atmel AT91SAM9G20-EK Evaluation Kit
326 with 2 SD/MMC Slots. This is the case for AT91SAM9G20-EK rev. C and 348 with 2 SD/MMC Slots. This is the case for AT91SAM9G20-EK rev. C and
@@ -328,7 +350,6 @@ config MACH_AT91SAM9G20EK_2MMC
328 350
329config MACH_CPU9G20 351config MACH_CPU9G20
330 bool "Eukrea CPU9G20 board" 352 bool "Eukrea CPU9G20 board"
331 depends on ARCH_AT91SAM9G20
332 help 353 help
333 Select this if you are using a Eukrea Electromatique's 354 Select this if you are using a Eukrea Electromatique's
334 CPU9G20 Board <http://www.eukrea.com/> 355 CPU9G20 Board <http://www.eukrea.com/>
@@ -343,7 +364,7 @@ comment "AT91SAM9G45 Board Type"
343 364
344config MACH_AT91SAM9G45EKES 365config MACH_AT91SAM9G45EKES
345 bool "Atmel AT91SAM9G45-EKES Evaluation Kit" 366 bool "Atmel AT91SAM9G45-EKES Evaluation Kit"
346 depends on ARCH_AT91SAM9G45 367 select HAVE_NAND_ATMEL_BUSWIDTH_16
347 help 368 help
348 Select this if you are using Atmel's AT91SAM9G45-EKES Evaluation Kit. 369 Select this if you are using Atmel's AT91SAM9G45-EKES Evaluation Kit.
349 "ES" at the end of the name means that this board is an 370 "ES" at the end of the name means that this board is an
@@ -359,7 +380,8 @@ comment "AT91CAP9 Board Type"
359 380
360config MACH_AT91CAP9ADK 381config MACH_AT91CAP9ADK
361 bool "Atmel AT91CAP9A-DK Evaluation Kit" 382 bool "Atmel AT91CAP9A-DK Evaluation Kit"
362 depends on ARCH_AT91CAP9 383 select HAVE_AT91_DATAFLASH_CARD
384 select HAVE_NAND_ATMEL_BUSWIDTH_16
363 help 385 help
364 Select this if you are using Atmel's AT91CAP9A-DK Evaluation Kit. 386 Select this if you are using Atmel's AT91CAP9A-DK Evaluation Kit.
365 <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4138> 387 <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4138>
@@ -388,13 +410,13 @@ comment "AT91 Board Options"
388 410
389config MTD_AT91_DATAFLASH_CARD 411config MTD_AT91_DATAFLASH_CARD
390 bool "Enable DataFlash Card support" 412 bool "Enable DataFlash Card support"
391 depends on (ARCH_AT91RM9200DK || MACH_AT91RM9200EK || MACH_AT91SAM9260EK || MACH_AT91SAM9261EK || MACH_AT91SAM9G10EK || MACH_AT91SAM9263EK || MACH_AT91SAM9G20EK || MACH_ECBAT91 || MACH_SAM9_L9260 || MACH_AT91CAP9ADK || MACH_NEOCORE926) 413 depends on HAVE_AT91_DATAFLASH_CARD
392 help 414 help
393 Enable support for the DataFlash card. 415 Enable support for the DataFlash card.
394 416
395config MTD_NAND_ATMEL_BUSWIDTH_16 417config MTD_NAND_ATMEL_BUSWIDTH_16
396 bool "Enable 16-bit data bus interface to NAND flash" 418 bool "Enable 16-bit data bus interface to NAND flash"
397 depends on (MACH_AT91SAM9260EK || MACH_AT91SAM9261EK || MACH_AT91SAM9G10EK || MACH_AT91SAM9263EK || MACH_AT91SAM9G20EK || MACH_AT91SAM9G20EK_2MMC || MACH_AT91SAM9G45EKES || MACH_AT91CAP9ADK) 419 depends on HAVE_NAND_ATMEL_BUSWIDTH_16
398 help 420 help
399 On AT91SAM926x boards both types of NAND flash can be present 421 On AT91SAM926x boards both types of NAND flash can be present
400 (8 and 16 bit data bus width). 422 (8 and 16 bit data bus width).
@@ -456,15 +478,15 @@ config AT91_EARLY_USART2
456 478
457config AT91_EARLY_USART3 479config AT91_EARLY_USART3
458 bool "USART3" 480 bool "USART3"
459 depends on (ARCH_AT91RM9200 || ARCH_AT91SAM9RL || ARCH_AT91SAM9260 || ARCH_AT91SAM9G20 || ARCH_AT91SAM9G45) 481 depends on HAVE_AT91_USART3
460 482
461config AT91_EARLY_USART4 483config AT91_EARLY_USART4
462 bool "USART4" 484 bool "USART4"
463 depends on ARCH_AT91SAM9260 || ARCH_AT91SAM9G20 485 depends on HAVE_AT91_USART4
464 486
465config AT91_EARLY_USART5 487config AT91_EARLY_USART5
466 bool "USART5" 488 bool "USART5"
467 depends on ARCH_AT91SAM9260 || ARCH_AT91SAM9G20 489 depends on HAVE_AT91_USART5
468 490
469endchoice 491endchoice
470 492
diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
index ada440aab0c5..709fbad4a3ee 100644
--- a/arch/arm/mach-at91/Makefile
+++ b/arch/arm/mach-at91/Makefile
@@ -35,6 +35,7 @@ obj-$(CONFIG_MACH_PICOTUX2XX) += board-picotux200.o
35obj-$(CONFIG_MACH_ECBAT91) += board-ecbat91.o 35obj-$(CONFIG_MACH_ECBAT91) += board-ecbat91.o
36obj-$(CONFIG_MACH_YL9200) += board-yl-9200.o 36obj-$(CONFIG_MACH_YL9200) += board-yl-9200.o
37obj-$(CONFIG_MACH_CPUAT91) += board-cpuat91.o 37obj-$(CONFIG_MACH_CPUAT91) += board-cpuat91.o
38obj-$(CONFIG_MACH_ECO920) += board-eco920.o
38 39
39# AT91SAM9260 board-specific support 40# AT91SAM9260 board-specific support
40obj-$(CONFIG_MACH_AT91SAM9260EK) += board-sam9260ek.o 41obj-$(CONFIG_MACH_AT91SAM9260EK) += board-sam9260ek.o
@@ -77,6 +78,7 @@ obj-y += leds.o
77# Power Management 78# Power Management
78obj-$(CONFIG_PM) += pm.o 79obj-$(CONFIG_PM) += pm.o
79obj-$(CONFIG_AT91_SLOW_CLOCK) += pm_slowclock.o 80obj-$(CONFIG_AT91_SLOW_CLOCK) += pm_slowclock.o
81obj-$(CONFIG_CPU_IDLE) += cpuidle.o
80 82
81ifeq ($(CONFIG_PM_DEBUG),y) 83ifeq ($(CONFIG_PM_DEBUG),y)
82CFLAGS_pm.o += -DDEBUG 84CFLAGS_pm.o += -DDEBUG
diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c
index 332b784050b2..a57af3e99c7c 100644
--- a/arch/arm/mach-at91/at91sam9g45_devices.c
+++ b/arch/arm/mach-at91/at91sam9g45_devices.c
@@ -131,6 +131,62 @@ void __init at91_add_device_usbh_ohci(struct at91_usbh_data *data) {}
131 131
132 132
133/* -------------------------------------------------------------------- 133/* --------------------------------------------------------------------
134 * USB Host HS (EHCI)
135 * Needs an OHCI host for low and full speed management
136 * -------------------------------------------------------------------- */
137
138#if defined(CONFIG_USB_EHCI_HCD) || defined(CONFIG_USB_EHCI_HCD_MODULE)
139static u64 ehci_dmamask = DMA_BIT_MASK(32);
140static struct at91_usbh_data usbh_ehci_data;
141
142static struct resource usbh_ehci_resources[] = {
143 [0] = {
144 .start = AT91SAM9G45_EHCI_BASE,
145 .end = AT91SAM9G45_EHCI_BASE + SZ_1M - 1,
146 .flags = IORESOURCE_MEM,
147 },
148 [1] = {
149 .start = AT91SAM9G45_ID_UHPHS,
150 .end = AT91SAM9G45_ID_UHPHS,
151 .flags = IORESOURCE_IRQ,
152 },
153};
154
155static struct platform_device at91_usbh_ehci_device = {
156 .name = "atmel-ehci",
157 .id = -1,
158 .dev = {
159 .dma_mask = &ehci_dmamask,
160 .coherent_dma_mask = DMA_BIT_MASK(32),
161 .platform_data = &usbh_ehci_data,
162 },
163 .resource = usbh_ehci_resources,
164 .num_resources = ARRAY_SIZE(usbh_ehci_resources),
165};
166
167void __init at91_add_device_usbh_ehci(struct at91_usbh_data *data)
168{
169 int i;
170
171 if (!data)
172 return;
173
174 /* Enable VBus control for UHP ports */
175 for (i = 0; i < data->ports; i++) {
176 if (data->vbus_pin[i])
177 at91_set_gpio_output(data->vbus_pin[i], 0);
178 }
179
180 usbh_ehci_data = *data;
181 at91_clock_associate("uhphs_clk", &at91_usbh_ehci_device.dev, "ehci_clk");
182 platform_device_register(&at91_usbh_ehci_device);
183}
184#else
185void __init at91_add_device_usbh_ehci(struct at91_usbh_data *data) {}
186#endif
187
188
189/* --------------------------------------------------------------------
134 * USB HS Device (Gadget) 190 * USB HS Device (Gadget)
135 * -------------------------------------------------------------------- */ 191 * -------------------------------------------------------------------- */
136 192
diff --git a/arch/arm/mach-at91/board-eco920.c b/arch/arm/mach-at91/board-eco920.c
new file mode 100644
index 000000000000..295a96609e71
--- /dev/null
+++ b/arch/arm/mach-at91/board-eco920.c
@@ -0,0 +1,158 @@
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
15 */
16
17#include <linux/init.h>
18#include <linux/platform_device.h>
19#include <linux/mtd/physmap.h>
20#include <linux/gpio.h>
21
22#include <asm/mach-types.h>
23
24#include <asm/mach/arch.h>
25#include <asm/mach/map.h>
26
27#include <mach/board.h>
28#include <mach/at91rm9200_mc.h>
29#include "generic.h"
30
31static void __init eco920_map_io(void)
32{
33 at91rm9200_initialize(18432000, AT91RM9200_PQFP);
34
35 /* Setup the LEDs */
36 at91_init_leds(AT91_PIN_PB0, AT91_PIN_PB1);
37
38 /* DBGU on ttyS0. (Rx & Tx only */
39 at91_register_uart(0, 0, 0);
40
41 /* set serial console to ttyS0 (ie, DBGU) */
42 at91_set_serial_console(0);
43}
44
45static void __init eco920_init_irq(void)
46{
47 at91rm9200_init_interrupts(NULL);
48}
49
50static struct at91_eth_data __initdata eco920_eth_data = {
51 .phy_irq_pin = AT91_PIN_PC2,
52 .is_rmii = 1,
53};
54
55static struct at91_usbh_data __initdata eco920_usbh_data = {
56 .ports = 1,
57};
58
59static struct at91_udc_data __initdata eco920_udc_data = {
60 .vbus_pin = AT91_PIN_PB12,
61 .pullup_pin = AT91_PIN_PB13,
62};
63
64static struct at91_mmc_data __initdata eco920_mmc_data = {
65 .slot_b = 0,
66 .wire4 = 0,
67};
68
69static struct physmap_flash_data eco920_flash_data = {
70 .width = 2,
71};
72
73static struct resource eco920_flash_resource = {
74 .start = 0x11000000,
75 .end = 0x11ffffff,
76 .flags = IORESOURCE_MEM,
77};
78
79static struct platform_device eco920_flash = {
80 .name = "physmap-flash",
81 .id = 0,
82 .dev = {
83 .platform_data = &eco920_flash_data,
84 },
85 .resource = &eco920_flash_resource,
86 .num_resources = 1,
87};
88
89static struct resource at91_beeper_resources[] = {
90 [0] = {
91 .start = AT91RM9200_BASE_TC3,
92 .end = AT91RM9200_BASE_TC3 + 0x39,
93 .flags = IORESOURCE_MEM,
94 },
95};
96
97static struct platform_device at91_beeper = {
98 .name = "at91_beeper",
99 .id = 0,
100 .resource = at91_beeper_resources,
101 .num_resources = ARRAY_SIZE(at91_beeper_resources),
102};
103
104static struct spi_board_info eco920_spi_devices[] = {
105 { /* CAN controller */
106 .modalias = "tlv5638",
107 .chip_select = 3,
108 .max_speed_hz = 20 * 1000 * 1000,
109 .mode = SPI_CPHA,
110 },
111};
112
113static void __init eco920_board_init(void)
114{
115 at91_add_device_serial();
116 at91_add_device_eth(&eco920_eth_data);
117 at91_add_device_usbh(&eco920_usbh_data);
118 at91_add_device_udc(&eco920_udc_data);
119
120 at91_add_device_mmc(0, &eco920_mmc_data);
121 platform_device_register(&eco920_flash);
122
123 at91_sys_write(AT91_SMC_CSR(7), AT91_SMC_RWHOLD_(1)
124 | AT91_SMC_RWSETUP_(1)
125 | AT91_SMC_DBW_8
126 | AT91_SMC_WSEN
127 | AT91_SMC_NWS_(15));
128
129 at91_set_A_periph(AT91_PIN_PC6, 1);
130
131 at91_set_gpio_input(AT91_PIN_PA23, 0);
132 at91_set_deglitch(AT91_PIN_PA23, 1);
133
134/* Initialization of the Static Memory Controller for Chip Select 3 */
135 at91_sys_write(AT91_SMC_CSR(3),
136 AT91_SMC_DBW_16 | /* 16 bit */
137 AT91_SMC_WSEN |
138 AT91_SMC_NWS_(5) | /* wait states */
139 AT91_SMC_TDF_(1) /* float time */
140 );
141
142 at91_clock_associate("tc3_clk", &at91_beeper.dev, "at91_beeper");
143 at91_set_B_periph(AT91_PIN_PB6, 0);
144 platform_device_register(&at91_beeper);
145
146 at91_add_device_spi(eco920_spi_devices, ARRAY_SIZE(eco920_spi_devices));
147}
148
149MACHINE_START(ECO920, "eco920")
150 /* Maintainer: Sascha Hauer */
151 .phys_io = AT91_BASE_SYS,
152 .io_pg_offst = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
153 .boot_params = AT91_SDRAM_BASE + 0x100,
154 .timer = &at91rm9200_timer,
155 .map_io = eco920_map_io,
156 .init_irq = eco920_init_irq,
157 .init_machine = eco920_board_init,
158MACHINE_END
diff --git a/arch/arm/mach-at91/board-sam9m10g45ek.c b/arch/arm/mach-at91/board-sam9m10g45ek.c
index 64c3843f323d..1cf4d8681078 100644
--- a/arch/arm/mach-at91/board-sam9m10g45ek.c
+++ b/arch/arm/mach-at91/board-sam9m10g45ek.c
@@ -366,6 +366,7 @@ static void __init ek_board_init(void)
366 at91_add_device_serial(); 366 at91_add_device_serial();
367 /* USB HS Host */ 367 /* USB HS Host */
368 at91_add_device_usbh_ohci(&ek_usbh_hs_data); 368 at91_add_device_usbh_ohci(&ek_usbh_hs_data);
369 at91_add_device_usbh_ehci(&ek_usbh_hs_data);
369 /* USB HS Device */ 370 /* USB HS Device */
370 at91_add_device_usba(&ek_usba_udc_data); 371 at91_add_device_usba(&ek_usba_udc_data);
371 /* SPI */ 372 /* SPI */
diff --git a/arch/arm/mach-at91/cpuidle.c b/arch/arm/mach-at91/cpuidle.c
new file mode 100644
index 000000000000..1cfeac1483d6
--- /dev/null
+++ b/arch/arm/mach-at91/cpuidle.c
@@ -0,0 +1,94 @@
1/*
2 * based on arch/arm/mach-kirkwood/cpuidle.c
3 *
4 * CPU idle support for AT91 SoC
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 * The cpu idle uses wait-for-interrupt and RAM self refresh in order
11 * to implement two idle states -
12 * #1 wait-for-interrupt
13 * #2 wait-for-interrupt and RAM self refresh
14 */
15
16#include <linux/kernel.h>
17#include <linux/init.h>
18#include <linux/platform_device.h>
19#include <linux/cpuidle.h>
20#include <asm/proc-fns.h>
21#include <linux/io.h>
22
23#include "pm.h"
24
25#define AT91_MAX_STATES 2
26
27static DEFINE_PER_CPU(struct cpuidle_device, at91_cpuidle_device);
28
29static struct cpuidle_driver at91_idle_driver = {
30 .name = "at91_idle",
31 .owner = THIS_MODULE,
32};
33
34/* Actual code that puts the SoC in different idle states */
35static int at91_enter_idle(struct cpuidle_device *dev,
36 struct cpuidle_state *state)
37{
38 struct timeval before, after;
39 int idle_time;
40 u32 saved_lpr;
41
42 local_irq_disable();
43 do_gettimeofday(&before);
44 if (state == &dev->states[0])
45 /* Wait for interrupt state */
46 cpu_do_idle();
47 else if (state == &dev->states[1]) {
48 asm("b 1f; .align 5; 1:");
49 asm("mcr p15, 0, r0, c7, c10, 4"); /* drain write buffer */
50 saved_lpr = sdram_selfrefresh_enable();
51 cpu_do_idle();
52 sdram_selfrefresh_disable(saved_lpr);
53 }
54 do_gettimeofday(&after);
55 local_irq_enable();
56 idle_time = (after.tv_sec - before.tv_sec) * USEC_PER_SEC +
57 (after.tv_usec - before.tv_usec);
58 return idle_time;
59}
60
61/* Initialize CPU idle by registering the idle states */
62static int at91_init_cpuidle(void)
63{
64 struct cpuidle_device *device;
65
66 cpuidle_register_driver(&at91_idle_driver);
67
68 device = &per_cpu(at91_cpuidle_device, smp_processor_id());
69 device->state_count = AT91_MAX_STATES;
70
71 /* Wait for interrupt state */
72 device->states[0].enter = at91_enter_idle;
73 device->states[0].exit_latency = 1;
74 device->states[0].target_residency = 10000;
75 device->states[0].flags = CPUIDLE_FLAG_TIME_VALID;
76 strcpy(device->states[0].name, "WFI");
77 strcpy(device->states[0].desc, "Wait for interrupt");
78
79 /* Wait for interrupt and RAM self refresh state */
80 device->states[1].enter = at91_enter_idle;
81 device->states[1].exit_latency = 10;
82 device->states[1].target_residency = 10000;
83 device->states[1].flags = CPUIDLE_FLAG_TIME_VALID;
84 strcpy(device->states[1].name, "RAM_SR");
85 strcpy(device->states[1].desc, "WFI and RAM Self Refresh");
86
87 if (cpuidle_register_device(device)) {
88 printk(KERN_ERR "at91_init_cpuidle: Failed registering\n");
89 return -EIO;
90 }
91 return 0;
92}
93
94device_initcall(at91_init_cpuidle);
diff --git a/arch/arm/mach-at91/include/mach/board.h b/arch/arm/mach-at91/include/mach/board.h
index 2f4fcedc02ba..2295d80dd893 100644
--- a/arch/arm/mach-at91/include/mach/board.h
+++ b/arch/arm/mach-at91/include/mach/board.h
@@ -98,6 +98,7 @@ struct at91_usbh_data {
98}; 98};
99extern void __init at91_add_device_usbh(struct at91_usbh_data *data); 99extern void __init at91_add_device_usbh(struct at91_usbh_data *data);
100extern void __init at91_add_device_usbh_ohci(struct at91_usbh_data *data); 100extern void __init at91_add_device_usbh_ohci(struct at91_usbh_data *data);
101extern void __init at91_add_device_usbh_ehci(struct at91_usbh_data *data);
101 102
102 /* NAND / SmartMedia */ 103 /* NAND / SmartMedia */
103struct atmel_nand_data { 104struct atmel_nand_data {
diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
index 4028724d490d..615668986480 100644
--- a/arch/arm/mach-at91/pm.c
+++ b/arch/arm/mach-at91/pm.c
@@ -29,62 +29,7 @@
29#include <mach/cpu.h> 29#include <mach/cpu.h>
30 30
31#include "generic.h" 31#include "generic.h"
32 32#include "pm.h"
33#ifdef CONFIG_ARCH_AT91RM9200
34#include <mach/at91rm9200_mc.h>
35
36/*
37 * The AT91RM9200 goes into self-refresh mode with this command, and will
38 * terminate self-refresh automatically on the next SDRAM access.
39 */
40#define sdram_selfrefresh_enable() at91_sys_write(AT91_SDRAMC_SRR, 1)
41#define sdram_selfrefresh_disable() do {} while (0)
42
43#elif defined(CONFIG_ARCH_AT91CAP9)
44#include <mach/at91cap9_ddrsdr.h>
45
46static u32 saved_lpr;
47
48static inline void sdram_selfrefresh_enable(void)
49{
50 u32 lpr;
51
52 saved_lpr = at91_sys_read(AT91_DDRSDRC_LPR);
53
54 lpr = saved_lpr & ~AT91_DDRSDRC_LPCB;
55 at91_sys_write(AT91_DDRSDRC_LPR, lpr | AT91_DDRSDRC_LPCB_SELF_REFRESH);
56}
57
58#define sdram_selfrefresh_disable() at91_sys_write(AT91_DDRSDRC_LPR, saved_lpr)
59
60#else
61#include <mach/at91sam9_sdramc.h>
62
63#ifdef CONFIG_ARCH_AT91SAM9263
64/*
65 * FIXME either or both the SDRAM controllers (EB0, EB1) might be in use;
66 * handle those cases both here and in the Suspend-To-RAM support.
67 */
68#define AT91_SDRAMC AT91_SDRAMC0
69#warning Assuming EB1 SDRAM controller is *NOT* used
70#endif
71
72static u32 saved_lpr;
73
74static inline void sdram_selfrefresh_enable(void)
75{
76 u32 lpr;
77
78 saved_lpr = at91_sys_read(AT91_SDRAMC_LPR);
79
80 lpr = saved_lpr & ~AT91_SDRAMC_LPCB;
81 at91_sys_write(AT91_SDRAMC_LPR, lpr | AT91_SDRAMC_LPCB_SELF_REFRESH);
82}
83
84#define sdram_selfrefresh_disable() at91_sys_write(AT91_SDRAMC_LPR, saved_lpr)
85
86#endif
87
88 33
89/* 34/*
90 * Show the reason for the previous system reset. 35 * Show the reason for the previous system reset.
@@ -260,6 +205,7 @@ extern u32 at91_slow_clock_sz;
260 205
261static int at91_pm_enter(suspend_state_t state) 206static int at91_pm_enter(suspend_state_t state)
262{ 207{
208 u32 saved_lpr;
263 at91_gpio_suspend(); 209 at91_gpio_suspend();
264 at91_irq_suspend(); 210 at91_irq_suspend();
265 211
@@ -315,9 +261,9 @@ static int at91_pm_enter(suspend_state_t state)
315 */ 261 */
316 asm("b 1f; .align 5; 1:"); 262 asm("b 1f; .align 5; 1:");
317 asm("mcr p15, 0, r0, c7, c10, 4"); /* drain write buffer */ 263 asm("mcr p15, 0, r0, c7, c10, 4"); /* drain write buffer */
318 sdram_selfrefresh_enable(); 264 saved_lpr = sdram_selfrefresh_enable();
319 asm("mcr p15, 0, r0, c7, c0, 4"); /* wait for interrupt */ 265 asm("mcr p15, 0, r0, c7, c0, 4"); /* wait for interrupt */
320 sdram_selfrefresh_disable(); 266 sdram_selfrefresh_disable(saved_lpr);
321 break; 267 break;
322 268
323 case PM_SUSPEND_ON: 269 case PM_SUSPEND_ON:
diff --git a/arch/arm/mach-at91/pm.h b/arch/arm/mach-at91/pm.h
new file mode 100644
index 000000000000..08322c44df1a
--- /dev/null
+++ b/arch/arm/mach-at91/pm.h
@@ -0,0 +1,67 @@
1#ifdef CONFIG_ARCH_AT91RM9200
2#include <mach/at91rm9200_mc.h>
3
4/*
5 * The AT91RM9200 goes into self-refresh mode with this command, and will
6 * terminate self-refresh automatically on the next SDRAM access.
7 *
8 * Self-refresh mode is exited as soon as a memory access is made, but we don't
9 * know for sure when that happens. However, we need to restore the low-power
10 * mode if it was enabled before going idle. Restoring low-power mode while
11 * still in self-refresh is "not recommended", but seems to work.
12 */
13
14static inline u32 sdram_selfrefresh_enable(void)
15{
16 u32 saved_lpr = at91_sys_read(AT91_SDRAMC_LPR);
17
18 at91_sys_write(AT91_SDRAMC_LPR, 0);
19 at91_sys_write(AT91_SDRAMC_SRR, 1);
20 return saved_lpr;
21}
22
23#define sdram_selfrefresh_disable(saved_lpr) at91_sys_write(AT91_SDRAMC_LPR, saved_lpr)
24
25#elif defined(CONFIG_ARCH_AT91CAP9)
26#include <mach/at91cap9_ddrsdr.h>
27
28
29static inline u32 sdram_selfrefresh_enable(void)
30{
31 u32 saved_lpr, lpr;
32
33 saved_lpr = at91_sys_read(AT91_DDRSDRC_LPR);
34
35 lpr = saved_lpr & ~AT91_DDRSDRC_LPCB;
36 at91_sys_write(AT91_DDRSDRC_LPR, lpr | AT91_DDRSDRC_LPCB_SELF_REFRESH);
37 return saved_lpr;
38}
39
40#define sdram_selfrefresh_disable(saved_lpr) at91_sys_write(AT91_DDRSDRC_LPR, saved_lpr)
41
42#else
43#include <mach/at91sam9_sdramc.h>
44
45#ifdef CONFIG_ARCH_AT91SAM9263
46/*
47 * 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.
49 */
50#define AT91_SDRAMC AT91_SDRAMC0
51#warning Assuming EB1 SDRAM controller is *NOT* used
52#endif
53
54static inline u32 sdram_selfrefresh_enable(void)
55{
56 u32 saved_lpr, lpr;
57
58 saved_lpr = at91_sys_read(AT91_SDRAMC_LPR);
59
60 lpr = saved_lpr & ~AT91_SDRAMC_LPCB;
61 at91_sys_write(AT91_SDRAMC_LPR, lpr | AT91_SDRAMC_LPCB_SELF_REFRESH);
62 return saved_lpr;
63}
64
65#define sdram_selfrefresh_disable(saved_lpr) at91_sys_write(AT91_SDRAMC_LPR, saved_lpr)
66
67#endif
diff --git a/arch/arm/mach-bcmring/arch.c b/arch/arm/mach-bcmring/arch.c
index 0da693b0f7e1..fbe6fa02c882 100644
--- a/arch/arm/mach-bcmring/arch.c
+++ b/arch/arm/mach-bcmring/arch.c
@@ -47,10 +47,6 @@ HW_DECLARE_SPINLOCK(gpio)
47 EXPORT_SYMBOL(bcmring_gpio_reg_lock); 47 EXPORT_SYMBOL(bcmring_gpio_reg_lock);
48#endif 48#endif
49 49
50/* FIXME: temporary solution */
51#define BCM_SYSCTL_REBOOT_WARM 1
52#define CTL_BCM_REBOOT 112
53
54/* sysctl */ 50/* sysctl */
55int bcmring_arch_warm_reboot; /* do a warm reboot on hard reset */ 51int bcmring_arch_warm_reboot; /* do a warm reboot on hard reset */
56 52
@@ -58,18 +54,16 @@ static struct ctl_table_header *bcmring_sysctl_header;
58 54
59static struct ctl_table bcmring_sysctl_warm_reboot[] = { 55static struct ctl_table bcmring_sysctl_warm_reboot[] = {
60 { 56 {
61 .ctl_name = BCM_SYSCTL_REBOOT_WARM,
62 .procname = "warm", 57 .procname = "warm",
63 .data = &bcmring_arch_warm_reboot, 58 .data = &bcmring_arch_warm_reboot,
64 .maxlen = sizeof(int), 59 .maxlen = sizeof(int),
65 .mode = 0644, 60 .mode = 0644,
66 .proc_handler = &proc_dointvec}, 61 .proc_handler = proc_dointvec},
67 {} 62 {}
68}; 63};
69 64
70static struct ctl_table bcmring_sysctl_reboot[] = { 65static struct ctl_table bcmring_sysctl_reboot[] = {
71 { 66 {
72 .ctl_name = CTL_BCM_REBOOT,
73 .procname = "reboot", 67 .procname = "reboot",
74 .mode = 0555, 68 .mode = 0555,
75 .child = bcmring_sysctl_warm_reboot}, 69 .child = bcmring_sysctl_warm_reboot},
diff --git a/arch/arm/mach-bcmring/include/mach/io.h b/arch/arm/mach-bcmring/include/mach/io.h
index 4db0eff90357..dae5e9b166ea 100644
--- a/arch/arm/mach-bcmring/include/mach/io.h
+++ b/arch/arm/mach-bcmring/include/mach/io.h
@@ -23,34 +23,11 @@
23 23
24#define IO_SPACE_LIMIT 0xffffffff 24#define IO_SPACE_LIMIT 0xffffffff
25 25
26#define __io(a) ((void __iomem *)HW_IO_PHYS_TO_VIRT(a)) 26/*
27 27 * We don't actually have real ISA nor PCI buses, but there is so many
28/* Do not enable mem_pci for a big endian arm architecture or unexpected byteswaps will */ 28 * drivers out there that might just work if we fake them...
29/* happen in readw/writew etc. */ 29 */
30 30#define __io(a) __typesafe_io(a)
31#define readb(c) __raw_readb(c) 31#define __mem_pci(a) (a)
32#define readw(c) __raw_readw(c)
33#define readl(c) __raw_readl(c)
34#define readb_relaxed(addr) readb(addr)
35#define readw_relaxed(addr) readw(addr)
36#define readl_relaxed(addr) readl(addr)
37
38#define readsb(p, d, l) __raw_readsb(p, d, l)
39#define readsw(p, d, l) __raw_readsw(p, d, l)
40#define readsl(p, d, l) __raw_readsl(p, d, l)
41
42#define writeb(v, c) __raw_writeb(v, c)
43#define writew(v, c) __raw_writew(v, c)
44#define writel(v, c) __raw_writel(v, c)
45
46#define writesb(p, d, l) __raw_writesb(p, d, l)
47#define writesw(p, d, l) __raw_writesw(p, d, l)
48#define writesl(p, d, l) __raw_writesl(p, d, l)
49
50#define memset_io(c, v, l) _memset_io((c), (v), (l))
51#define memcpy_fromio(a, c, l) _memcpy_fromio((a), (c), (l))
52#define memcpy_toio(c, a, l) _memcpy_toio((c), (a), (l))
53
54#define eth_io_copy_and_sum(s, c, l, b) eth_copy_and_sum((s), (c), (l), (b))
55 32
56#endif 33#endif
diff --git a/arch/arm/mach-davinci/Kconfig b/arch/arm/mach-davinci/Kconfig
index 40866c643f13..033bfede6b67 100644
--- a/arch/arm/mach-davinci/Kconfig
+++ b/arch/arm/mach-davinci/Kconfig
@@ -32,11 +32,13 @@ config ARCH_DAVINCI_DA830
32 bool "DA830/OMAP-L137 based system" 32 bool "DA830/OMAP-L137 based system"
33 select CP_INTC 33 select CP_INTC
34 select ARCH_DAVINCI_DA8XX 34 select ARCH_DAVINCI_DA8XX
35 select CPU_DCACHE_WRITETHROUGH # needed on silicon revs 1.0, 1.1
35 36
36config ARCH_DAVINCI_DA850 37config ARCH_DAVINCI_DA850
37 bool "DA850/OMAP-L138 based system" 38 bool "DA850/OMAP-L138 based system"
38 select CP_INTC 39 select CP_INTC
39 select ARCH_DAVINCI_DA8XX 40 select ARCH_DAVINCI_DA8XX
41 select ARCH_HAS_CPUFREQ
40 42
41config ARCH_DAVINCI_DA8XX 43config ARCH_DAVINCI_DA8XX
42 bool 44 bool
@@ -63,6 +65,13 @@ config MACH_SFFSDR
63 Say Y here to select the Lyrtech Small Form Factor 65 Say Y here to select the Lyrtech Small Form Factor
64 Software Defined Radio (SFFSDR) board. 66 Software Defined Radio (SFFSDR) board.
65 67
68config MACH_NEUROS_OSD2
69 bool "Neuros OSD2 Open Television Set Top Box"
70 depends on ARCH_DAVINCI_DM644x
71 help
72 Configure this option to specify the whether the board used
73 for development is a Neuros OSD2 Open Set Top Box.
74
66config MACH_DAVINCI_DM355_EVM 75config MACH_DAVINCI_DM355_EVM
67 bool "TI DM355 EVM" 76 bool "TI DM355 EVM"
68 default ARCH_DAVINCI_DM355 77 default ARCH_DAVINCI_DM355
@@ -98,16 +107,66 @@ config MACH_DAVINCI_DA830_EVM
98 bool "TI DA830/OMAP-L137 Reference Platform" 107 bool "TI DA830/OMAP-L137 Reference Platform"
99 default ARCH_DAVINCI_DA830 108 default ARCH_DAVINCI_DA830
100 depends on ARCH_DAVINCI_DA830 109 depends on ARCH_DAVINCI_DA830
110 select GPIO_PCF857X
101 help 111 help
102 Say Y here to select the TI DA830/OMAP-L137 Evaluation Module. 112 Say Y here to select the TI DA830/OMAP-L137 Evaluation Module.
103 113
114choice
115 prompt "Select DA830/OMAP-L137 UI board peripheral"
116 depends on MACH_DAVINCI_DA830_EVM
117 help
118 The presence of UI card on the DA830/OMAP-L137 EVM is detected
119 automatically based on successful probe of the I2C based GPIO
120 expander on that board. This option selected in this menu has
121 an effect only in case of a successful UI card detection.
122
123config DA830_UI_LCD
124 bool "LCD"
125 help
126 Say Y here to use the LCD as a framebuffer or simple character
127 display.
128
129config DA830_UI_NAND
130 bool "NAND flash"
131 help
132 Say Y here to use the NAND flash. Do not forget to setup
133 the switch correctly.
134endchoice
135
104config MACH_DAVINCI_DA850_EVM 136config MACH_DAVINCI_DA850_EVM
105 bool "TI DA850/OMAP-L138 Reference Platform" 137 bool "TI DA850/OMAP-L138 Reference Platform"
106 default ARCH_DAVINCI_DA850 138 default ARCH_DAVINCI_DA850
107 depends on ARCH_DAVINCI_DA850 139 depends on ARCH_DAVINCI_DA850
140 select GPIO_PCA953X
108 help 141 help
109 Say Y here to select the TI DA850/OMAP-L138 Evaluation Module. 142 Say Y here to select the TI DA850/OMAP-L138 Evaluation Module.
110 143
144choice
145 prompt "Select peripherals connected to expander on UI board"
146 depends on MACH_DAVINCI_DA850_EVM
147 help
148 The presence of User Interface (UI) card on the DA850/OMAP-L138
149 EVM is detected automatically based on successful probe of the I2C
150 based GPIO expander on that card. This option selected in this
151 menu has an effect only in case of a successful UI card detection.
152
153config DA850_UI_NONE
154 bool "No peripheral is enabled"
155 help
156 Say Y if you do not want to enable any of the peripherals connected
157 to TCA6416 expander on DA850/OMAP-L138 EVM UI card
158
159config DA850_UI_RMII
160 bool "RMII Ethernet PHY"
161 help
162 Say Y if you want to use the RMII PHY on the DA850/OMAP-L138 EVM.
163 This PHY is found on the UI daughter card that is supplied with
164 the EVM.
165 NOTE: Please take care while choosing this option, MII PHY will
166 not be functional if RMII mode is selected.
167
168endchoice
169
111config DAVINCI_MUX 170config DAVINCI_MUX
112 bool "DAVINCI multiplexing support" 171 bool "DAVINCI multiplexing support"
113 depends on ARCH_DAVINCI 172 depends on ARCH_DAVINCI
diff --git a/arch/arm/mach-davinci/Makefile b/arch/arm/mach-davinci/Makefile
index 2e11e847313b..eeb9230d8844 100644
--- a/arch/arm/mach-davinci/Makefile
+++ b/arch/arm/mach-davinci/Makefile
@@ -23,9 +23,14 @@ obj-$(CONFIG_CP_INTC) += cp_intc.o
23# Board specific 23# Board specific
24obj-$(CONFIG_MACH_DAVINCI_EVM) += board-dm644x-evm.o 24obj-$(CONFIG_MACH_DAVINCI_EVM) += board-dm644x-evm.o
25obj-$(CONFIG_MACH_SFFSDR) += board-sffsdr.o 25obj-$(CONFIG_MACH_SFFSDR) += board-sffsdr.o
26obj-$(CONFIG_MACH_NEUROS_OSD2) += board-neuros-osd2.o
26obj-$(CONFIG_MACH_DAVINCI_DM355_EVM) += board-dm355-evm.o 27obj-$(CONFIG_MACH_DAVINCI_DM355_EVM) += board-dm355-evm.o
27obj-$(CONFIG_MACH_DM355_LEOPARD) += board-dm355-leopard.o 28obj-$(CONFIG_MACH_DM355_LEOPARD) += board-dm355-leopard.o
28obj-$(CONFIG_MACH_DAVINCI_DM6467_EVM) += board-dm646x-evm.o 29obj-$(CONFIG_MACH_DAVINCI_DM6467_EVM) += board-dm646x-evm.o
29obj-$(CONFIG_MACH_DAVINCI_DM365_EVM) += board-dm365-evm.o 30obj-$(CONFIG_MACH_DAVINCI_DM365_EVM) += board-dm365-evm.o
30obj-$(CONFIG_MACH_DAVINCI_DA830_EVM) += board-da830-evm.o 31obj-$(CONFIG_MACH_DAVINCI_DA830_EVM) += board-da830-evm.o
31obj-$(CONFIG_MACH_DAVINCI_DA850_EVM) += board-da850-evm.o 32obj-$(CONFIG_MACH_DAVINCI_DA850_EVM) += board-da850-evm.o
33
34# Power Management
35obj-$(CONFIG_CPU_FREQ) += cpufreq.o
36obj-$(CONFIG_CPU_IDLE) += cpuidle.o
diff --git a/arch/arm/mach-davinci/board-da830-evm.c b/arch/arm/mach-davinci/board-da830-evm.c
index bfbb63936f33..31dc9901e556 100644
--- a/arch/arm/mach-davinci/board-da830-evm.c
+++ b/arch/arm/mach-davinci/board-da830-evm.c
@@ -10,51 +10,194 @@
10 * or implied. 10 * or implied.
11 */ 11 */
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <linux/module.h>
14#include <linux/init.h> 13#include <linux/init.h>
15#include <linux/console.h> 14#include <linux/console.h>
15#include <linux/interrupt.h>
16#include <linux/gpio.h>
17#include <linux/platform_device.h>
16#include <linux/i2c.h> 18#include <linux/i2c.h>
19#include <linux/i2c/pcf857x.h>
17#include <linux/i2c/at24.h> 20#include <linux/i2c/at24.h>
21#include <linux/mtd/mtd.h>
22#include <linux/mtd/partitions.h>
18 23
19#include <asm/mach-types.h> 24#include <asm/mach-types.h>
20#include <asm/mach/arch.h> 25#include <asm/mach/arch.h>
21 26
22#include <mach/common.h>
23#include <mach/irqs.h>
24#include <mach/cp_intc.h> 27#include <mach/cp_intc.h>
28#include <mach/mux.h>
29#include <mach/nand.h>
25#include <mach/da8xx.h> 30#include <mach/da8xx.h>
26#include <mach/asp.h> 31#include <mach/usb.h>
27 32
28#define DA830_EVM_PHY_MASK 0x0 33#define DA830_EVM_PHY_MASK 0x0
29#define DA830_EVM_MDIO_FREQUENCY 2200000 /* PHY bus frequency */ 34#define DA830_EVM_MDIO_FREQUENCY 2200000 /* PHY bus frequency */
30 35
31static struct at24_platform_data da830_evm_i2c_eeprom_info = { 36#define DA830_EMIF25_ASYNC_DATA_CE3_BASE 0x62000000
32 .byte_len = SZ_256K / 8, 37#define DA830_EMIF25_CONTROL_BASE 0x68000000
33 .page_size = 64,
34 .flags = AT24_FLAG_ADDR16,
35 .setup = davinci_get_mac_addr,
36 .context = (void *)0x7f00,
37};
38 38
39static struct i2c_board_info __initdata da830_evm_i2c_devices[] = { 39/*
40 { 40 * USB1 VBUS is controlled by GPIO1[15], over-current is reported on GPIO2[4].
41 I2C_BOARD_INFO("24c256", 0x50), 41 */
42 .platform_data = &da830_evm_i2c_eeprom_info, 42#define ON_BD_USB_DRV GPIO_TO_PIN(1, 15)
43 }, 43#define ON_BD_USB_OVC GPIO_TO_PIN(2, 4)
44 { 44
45 I2C_BOARD_INFO("tlv320aic3x", 0x18), 45static const short da830_evm_usb11_pins[] = {
46 } 46 DA830_GPIO1_15, DA830_GPIO2_4,
47 -1
47}; 48};
48 49
49static struct davinci_i2c_platform_data da830_evm_i2c_0_pdata = { 50static da8xx_ocic_handler_t da830_evm_usb_ocic_handler;
50 .bus_freq = 100, /* kHz */ 51
51 .bus_delay = 0, /* usec */ 52static int da830_evm_usb_set_power(unsigned port, int on)
53{
54 gpio_set_value(ON_BD_USB_DRV, on);
55 return 0;
56}
57
58static int da830_evm_usb_get_power(unsigned port)
59{
60 return gpio_get_value(ON_BD_USB_DRV);
61}
62
63static int da830_evm_usb_get_oci(unsigned port)
64{
65 return !gpio_get_value(ON_BD_USB_OVC);
66}
67
68static irqreturn_t da830_evm_usb_ocic_irq(int, void *);
69
70static int da830_evm_usb_ocic_notify(da8xx_ocic_handler_t handler)
71{
72 int irq = gpio_to_irq(ON_BD_USB_OVC);
73 int error = 0;
74
75 if (handler != NULL) {
76 da830_evm_usb_ocic_handler = handler;
77
78 error = request_irq(irq, da830_evm_usb_ocic_irq, IRQF_DISABLED |
79 IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
80 "OHCI over-current indicator", NULL);
81 if (error)
82 printk(KERN_ERR "%s: could not request IRQ to watch "
83 "over-current indicator changes\n", __func__);
84 } else
85 free_irq(irq, NULL);
86
87 return error;
88}
89
90static struct da8xx_ohci_root_hub da830_evm_usb11_pdata = {
91 .set_power = da830_evm_usb_set_power,
92 .get_power = da830_evm_usb_get_power,
93 .get_oci = da830_evm_usb_get_oci,
94 .ocic_notify = da830_evm_usb_ocic_notify,
95
96 /* TPS2065 switch @ 5V */
97 .potpgt = (3 + 1) / 2, /* 3 ms max */
52}; 98};
53 99
100static irqreturn_t da830_evm_usb_ocic_irq(int irq, void *dev_id)
101{
102 da830_evm_usb_ocic_handler(&da830_evm_usb11_pdata, 1);
103 return IRQ_HANDLED;
104}
105
106static __init void da830_evm_usb_init(void)
107{
108 u32 cfgchip2;
109 int ret;
110
111 /*
112 * Set up USB clock/mode in the CFGCHIP2 register.
113 * FYI: CFGCHIP2 is 0x0000ef00 initially.
114 */
115 cfgchip2 = __raw_readl(DA8XX_SYSCFG_VIRT(DA8XX_CFGCHIP2_REG));
116
117 /* USB2.0 PHY reference clock is 24 MHz */
118 cfgchip2 &= ~CFGCHIP2_REFFREQ;
119 cfgchip2 |= CFGCHIP2_REFFREQ_24MHZ;
120
121 /*
122 * Select internal reference clock for USB 2.0 PHY
123 * and use it as a clock source for USB 1.1 PHY
124 * (this is the default setting anyway).
125 */
126 cfgchip2 &= ~CFGCHIP2_USB1PHYCLKMUX;
127 cfgchip2 |= CFGCHIP2_USB2PHYCLKMUX;
128
129 /*
130 * We have to override VBUS/ID signals when MUSB is configured into the
131 * host-only mode -- ID pin will float if no cable is connected, so the
132 * controller won't be able to drive VBUS thinking that it's a B-device.
133 * Otherwise, we want to use the OTG mode and enable VBUS comparators.
134 */
135 cfgchip2 &= ~CFGCHIP2_OTGMODE;
136#ifdef CONFIG_USB_MUSB_HOST
137 cfgchip2 |= CFGCHIP2_FORCE_HOST;
138#else
139 cfgchip2 |= CFGCHIP2_SESENDEN | CFGCHIP2_VBDTCTEN;
140#endif
141
142 __raw_writel(cfgchip2, DA8XX_SYSCFG_VIRT(DA8XX_CFGCHIP2_REG));
143
144 /* USB_REFCLKIN is not used. */
145 ret = davinci_cfg_reg(DA830_USB0_DRVVBUS);
146 if (ret)
147 pr_warning("%s: USB 2.0 PinMux setup failed: %d\n",
148 __func__, ret);
149 else {
150 /*
151 * TPS2065 switch @ 5V supplies 1 A (sustains 1.5 A),
152 * with the power on to power good time of 3 ms.
153 */
154 ret = da8xx_register_usb20(1000, 3);
155 if (ret)
156 pr_warning("%s: USB 2.0 registration failed: %d\n",
157 __func__, ret);
158 }
159
160 ret = da8xx_pinmux_setup(da830_evm_usb11_pins);
161 if (ret) {
162 pr_warning("%s: USB 1.1 PinMux setup failed: %d\n",
163 __func__, ret);
164 return;
165 }
166
167 ret = gpio_request(ON_BD_USB_DRV, "ON_BD_USB_DRV");
168 if (ret) {
169 printk(KERN_ERR "%s: failed to request GPIO for USB 1.1 port "
170 "power control: %d\n", __func__, ret);
171 return;
172 }
173 gpio_direction_output(ON_BD_USB_DRV, 0);
174
175 ret = gpio_request(ON_BD_USB_OVC, "ON_BD_USB_OVC");
176 if (ret) {
177 printk(KERN_ERR "%s: failed to request GPIO for USB 1.1 port "
178 "over-current indicator: %d\n", __func__, ret);
179 return;
180 }
181 gpio_direction_input(ON_BD_USB_OVC);
182
183 ret = da8xx_register_usb11(&da830_evm_usb11_pdata);
184 if (ret)
185 pr_warning("%s: USB 1.1 registration failed: %d\n",
186 __func__, ret);
187}
188
54static struct davinci_uart_config da830_evm_uart_config __initdata = { 189static struct davinci_uart_config da830_evm_uart_config __initdata = {
55 .enabled_uarts = 0x7, 190 .enabled_uarts = 0x7,
56}; 191};
57 192
193static const short da830_evm_mcasp1_pins[] = {
194 DA830_AHCLKX1, DA830_ACLKX1, DA830_AFSX1, DA830_AHCLKR1, DA830_AFSR1,
195 DA830_AMUTE1, DA830_AXR1_0, DA830_AXR1_1, DA830_AXR1_2, DA830_AXR1_5,
196 DA830_ACLKR1, DA830_AXR1_6, DA830_AXR1_7, DA830_AXR1_8, DA830_AXR1_10,
197 DA830_AXR1_11,
198 -1
199};
200
58static u8 da830_iis_serializer_direction[] = { 201static u8 da830_iis_serializer_direction[] = {
59 RX_MODE, INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, 202 RX_MODE, INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE,
60 INACTIVE_MODE, TX_MODE, INACTIVE_MODE, INACTIVE_MODE, 203 INACTIVE_MODE, TX_MODE, INACTIVE_MODE, INACTIVE_MODE,
@@ -74,6 +217,271 @@ static struct snd_platform_data da830_evm_snd_data = {
74 .rxnumevt = 1, 217 .rxnumevt = 1,
75}; 218};
76 219
220/*
221 * GPIO2[1] is used as MMC_SD_WP and GPIO2[2] as MMC_SD_INS.
222 */
223static const short da830_evm_mmc_sd_pins[] = {
224 DA830_MMCSD_DAT_0, DA830_MMCSD_DAT_1, DA830_MMCSD_DAT_2,
225 DA830_MMCSD_DAT_3, DA830_MMCSD_DAT_4, DA830_MMCSD_DAT_5,
226 DA830_MMCSD_DAT_6, DA830_MMCSD_DAT_7, DA830_MMCSD_CLK,
227 DA830_MMCSD_CMD, DA830_GPIO2_1, DA830_GPIO2_2,
228 -1
229};
230
231#define DA830_MMCSD_WP_PIN GPIO_TO_PIN(2, 1)
232
233static int da830_evm_mmc_get_ro(int index)
234{
235 return gpio_get_value(DA830_MMCSD_WP_PIN);
236}
237
238static struct davinci_mmc_config da830_evm_mmc_config = {
239 .get_ro = da830_evm_mmc_get_ro,
240 .wires = 4,
241 .max_freq = 50000000,
242 .caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED,
243 .version = MMC_CTLR_VERSION_2,
244};
245
246static inline void da830_evm_init_mmc(void)
247{
248 int ret;
249
250 ret = da8xx_pinmux_setup(da830_evm_mmc_sd_pins);
251 if (ret) {
252 pr_warning("da830_evm_init: mmc/sd mux setup failed: %d\n",
253 ret);
254 return;
255 }
256
257 ret = gpio_request(DA830_MMCSD_WP_PIN, "MMC WP");
258 if (ret) {
259 pr_warning("da830_evm_init: can not open GPIO %d\n",
260 DA830_MMCSD_WP_PIN);
261 return;
262 }
263 gpio_direction_input(DA830_MMCSD_WP_PIN);
264
265 ret = da8xx_register_mmcsd0(&da830_evm_mmc_config);
266 if (ret) {
267 pr_warning("da830_evm_init: mmc/sd registration failed: %d\n",
268 ret);
269 gpio_free(DA830_MMCSD_WP_PIN);
270 }
271}
272
273/*
274 * UI board NAND/NOR flashes only use 8-bit data bus.
275 */
276static const short da830_evm_emif25_pins[] = {
277 DA830_EMA_D_0, DA830_EMA_D_1, DA830_EMA_D_2, DA830_EMA_D_3,
278 DA830_EMA_D_4, DA830_EMA_D_5, DA830_EMA_D_6, DA830_EMA_D_7,
279 DA830_EMA_A_0, DA830_EMA_A_1, DA830_EMA_A_2, DA830_EMA_A_3,
280 DA830_EMA_A_4, DA830_EMA_A_5, DA830_EMA_A_6, DA830_EMA_A_7,
281 DA830_EMA_A_8, DA830_EMA_A_9, DA830_EMA_A_10, DA830_EMA_A_11,
282 DA830_EMA_A_12, DA830_EMA_BA_0, DA830_EMA_BA_1, DA830_NEMA_WE,
283 DA830_NEMA_CS_2, DA830_NEMA_CS_3, DA830_NEMA_OE, DA830_EMA_WAIT_0,
284 -1
285};
286
287#if defined(CONFIG_MMC_DAVINCI) || defined(CONFIG_MMC_DAVINCI_MODULE)
288#define HAS_MMC 1
289#else
290#define HAS_MMC 0
291#endif
292
293#ifdef CONFIG_DA830_UI_NAND
294static struct mtd_partition da830_evm_nand_partitions[] = {
295 /* bootloader (U-Boot, etc) in first sector */
296 [0] = {
297 .name = "bootloader",
298 .offset = 0,
299 .size = SZ_128K,
300 .mask_flags = MTD_WRITEABLE, /* force read-only */
301 },
302 /* bootloader params in the next sector */
303 [1] = {
304 .name = "params",
305 .offset = MTDPART_OFS_APPEND,
306 .size = SZ_128K,
307 .mask_flags = MTD_WRITEABLE, /* force read-only */
308 },
309 /* kernel */
310 [2] = {
311 .name = "kernel",
312 .offset = MTDPART_OFS_APPEND,
313 .size = SZ_2M,
314 .mask_flags = 0,
315 },
316 /* file system */
317 [3] = {
318 .name = "filesystem",
319 .offset = MTDPART_OFS_APPEND,
320 .size = MTDPART_SIZ_FULL,
321 .mask_flags = 0,
322 }
323};
324
325/* flash bbt decriptors */
326static uint8_t da830_evm_nand_bbt_pattern[] = { 'B', 'b', 't', '0' };
327static uint8_t da830_evm_nand_mirror_pattern[] = { '1', 't', 'b', 'B' };
328
329static struct nand_bbt_descr da830_evm_nand_bbt_main_descr = {
330 .options = NAND_BBT_LASTBLOCK | NAND_BBT_CREATE |
331 NAND_BBT_WRITE | NAND_BBT_2BIT |
332 NAND_BBT_VERSION | NAND_BBT_PERCHIP,
333 .offs = 2,
334 .len = 4,
335 .veroffs = 16,
336 .maxblocks = 4,
337 .pattern = da830_evm_nand_bbt_pattern
338};
339
340static struct nand_bbt_descr da830_evm_nand_bbt_mirror_descr = {
341 .options = NAND_BBT_LASTBLOCK | NAND_BBT_CREATE |
342 NAND_BBT_WRITE | NAND_BBT_2BIT |
343 NAND_BBT_VERSION | NAND_BBT_PERCHIP,
344 .offs = 2,
345 .len = 4,
346 .veroffs = 16,
347 .maxblocks = 4,
348 .pattern = da830_evm_nand_mirror_pattern
349};
350
351static struct davinci_nand_pdata da830_evm_nand_pdata = {
352 .parts = da830_evm_nand_partitions,
353 .nr_parts = ARRAY_SIZE(da830_evm_nand_partitions),
354 .ecc_mode = NAND_ECC_HW,
355 .ecc_bits = 4,
356 .options = NAND_USE_FLASH_BBT,
357 .bbt_td = &da830_evm_nand_bbt_main_descr,
358 .bbt_md = &da830_evm_nand_bbt_mirror_descr,
359};
360
361static struct resource da830_evm_nand_resources[] = {
362 [0] = { /* First memory resource is NAND I/O window */
363 .start = DA830_EMIF25_ASYNC_DATA_CE3_BASE,
364 .end = DA830_EMIF25_ASYNC_DATA_CE3_BASE + PAGE_SIZE - 1,
365 .flags = IORESOURCE_MEM,
366 },
367 [1] = { /* Second memory resource is AEMIF control registers */
368 .start = DA830_EMIF25_CONTROL_BASE,
369 .end = DA830_EMIF25_CONTROL_BASE + SZ_32K - 1,
370 .flags = IORESOURCE_MEM,
371 },
372};
373
374static struct platform_device da830_evm_nand_device = {
375 .name = "davinci_nand",
376 .id = 1,
377 .dev = {
378 .platform_data = &da830_evm_nand_pdata,
379 },
380 .num_resources = ARRAY_SIZE(da830_evm_nand_resources),
381 .resource = da830_evm_nand_resources,
382};
383
384static inline void da830_evm_init_nand(int mux_mode)
385{
386 int ret;
387
388 if (HAS_MMC) {
389 pr_warning("WARNING: both MMC/SD and NAND are "
390 "enabled, but they share AEMIF pins.\n"
391 "\tDisable MMC/SD for NAND support.\n");
392 return;
393 }
394
395 ret = da8xx_pinmux_setup(da830_evm_emif25_pins);
396 if (ret)
397 pr_warning("da830_evm_init: emif25 mux setup failed: %d\n",
398 ret);
399
400 ret = platform_device_register(&da830_evm_nand_device);
401 if (ret)
402 pr_warning("da830_evm_init: NAND device not registered.\n");
403
404 gpio_direction_output(mux_mode, 1);
405}
406#else
407static inline void da830_evm_init_nand(int mux_mode) { }
408#endif
409
410#ifdef CONFIG_DA830_UI_LCD
411static inline void da830_evm_init_lcdc(int mux_mode)
412{
413 int ret;
414
415 ret = da8xx_pinmux_setup(da830_lcdcntl_pins);
416 if (ret)
417 pr_warning("da830_evm_init: lcdcntl mux setup failed: %d\n",
418 ret);
419
420 ret = da8xx_register_lcdc(&sharp_lcd035q3dg01_pdata);
421 if (ret)
422 pr_warning("da830_evm_init: lcd setup failed: %d\n", ret);
423
424 gpio_direction_output(mux_mode, 0);
425}
426#else
427static inline void da830_evm_init_lcdc(int mux_mode) { }
428#endif
429
430static struct at24_platform_data da830_evm_i2c_eeprom_info = {
431 .byte_len = SZ_256K / 8,
432 .page_size = 64,
433 .flags = AT24_FLAG_ADDR16,
434 .setup = davinci_get_mac_addr,
435 .context = (void *)0x7f00,
436};
437
438static int __init da830_evm_ui_expander_setup(struct i2c_client *client,
439 int gpio, unsigned ngpio, void *context)
440{
441 gpio_request(gpio + 6, "UI MUX_MODE");
442
443 /* Drive mux mode low to match the default without UI card */
444 gpio_direction_output(gpio + 6, 0);
445
446 da830_evm_init_lcdc(gpio + 6);
447
448 da830_evm_init_nand(gpio + 6);
449
450 return 0;
451}
452
453static int da830_evm_ui_expander_teardown(struct i2c_client *client, int gpio,
454 unsigned ngpio, void *context)
455{
456 gpio_free(gpio + 6);
457 return 0;
458}
459
460static struct pcf857x_platform_data __initdata da830_evm_ui_expander_info = {
461 .gpio_base = DAVINCI_N_GPIO,
462 .setup = da830_evm_ui_expander_setup,
463 .teardown = da830_evm_ui_expander_teardown,
464};
465
466static struct i2c_board_info __initdata da830_evm_i2c_devices[] = {
467 {
468 I2C_BOARD_INFO("24c256", 0x50),
469 .platform_data = &da830_evm_i2c_eeprom_info,
470 },
471 {
472 I2C_BOARD_INFO("tlv320aic3x", 0x18),
473 },
474 {
475 I2C_BOARD_INFO("pcf8574", 0x3f),
476 .platform_data = &da830_evm_ui_expander_info,
477 },
478};
479
480static struct davinci_i2c_platform_data da830_evm_i2c_0_pdata = {
481 .bus_freq = 100, /* kHz */
482 .bus_delay = 0, /* usec */
483};
484
77static __init void da830_evm_init(void) 485static __init void da830_evm_init(void)
78{ 486{
79 struct davinci_soc_info *soc_info = &davinci_soc_info; 487 struct davinci_soc_info *soc_info = &davinci_soc_info;
@@ -94,6 +502,8 @@ static __init void da830_evm_init(void)
94 pr_warning("da830_evm_init: i2c0 registration failed: %d\n", 502 pr_warning("da830_evm_init: i2c0 registration failed: %d\n",
95 ret); 503 ret);
96 504
505 da830_evm_usb_init();
506
97 soc_info->emac_pdata->phy_mask = DA830_EVM_PHY_MASK; 507 soc_info->emac_pdata->phy_mask = DA830_EVM_PHY_MASK;
98 soc_info->emac_pdata->mdio_max_freq = DA830_EVM_MDIO_FREQUENCY; 508 soc_info->emac_pdata->mdio_max_freq = DA830_EVM_MDIO_FREQUENCY;
99 soc_info->emac_pdata->rmii_en = 1; 509 soc_info->emac_pdata->rmii_en = 1;
@@ -117,12 +527,18 @@ static __init void da830_evm_init(void)
117 i2c_register_board_info(1, da830_evm_i2c_devices, 527 i2c_register_board_info(1, da830_evm_i2c_devices,
118 ARRAY_SIZE(da830_evm_i2c_devices)); 528 ARRAY_SIZE(da830_evm_i2c_devices));
119 529
120 ret = da8xx_pinmux_setup(da830_mcasp1_pins); 530 ret = da8xx_pinmux_setup(da830_evm_mcasp1_pins);
121 if (ret) 531 if (ret)
122 pr_warning("da830_evm_init: mcasp1 mux setup failed: %d\n", 532 pr_warning("da830_evm_init: mcasp1 mux setup failed: %d\n",
123 ret); 533 ret);
124 534
125 da8xx_init_mcasp(1, &da830_evm_snd_data); 535 da8xx_register_mcasp(1, &da830_evm_snd_data);
536
537 da830_evm_init_mmc();
538
539 ret = da8xx_register_rtc();
540 if (ret)
541 pr_warning("da830_evm_init: rtc setup failed: %d\n", ret);
126} 542}
127 543
128#ifdef CONFIG_SERIAL_8250_CONSOLE 544#ifdef CONFIG_SERIAL_8250_CONSOLE
@@ -146,7 +562,7 @@ static void __init da830_evm_map_io(void)
146 da830_init(); 562 da830_init();
147} 563}
148 564
149MACHINE_START(DAVINCI_DA830_EVM, "DaVinci DA830/OMAP L137 EVM") 565MACHINE_START(DAVINCI_DA830_EVM, "DaVinci DA830/OMAP-L137 EVM")
150 .phys_io = IO_PHYS, 566 .phys_io = IO_PHYS,
151 .io_pg_offst = (__IO_ADDRESS(IO_PHYS) >> 18) & 0xfffc, 567 .io_pg_offst = (__IO_ADDRESS(IO_PHYS) >> 18) & 0xfffc,
152 .boot_params = (DA8XX_DDR_BASE + 0x100), 568 .boot_params = (DA8XX_DDR_BASE + 0x100),
diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
index c759d72494e0..62b98bffc158 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -12,36 +12,38 @@
12 * or implied. 12 * or implied.
13 */ 13 */
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/module.h>
16#include <linux/init.h> 15#include <linux/init.h>
17#include <linux/console.h> 16#include <linux/console.h>
18#include <linux/i2c.h> 17#include <linux/i2c.h>
19#include <linux/i2c/at24.h> 18#include <linux/i2c/at24.h>
19#include <linux/i2c/pca953x.h>
20#include <linux/gpio.h> 20#include <linux/gpio.h>
21#include <linux/platform_device.h> 21#include <linux/platform_device.h>
22#include <linux/mtd/mtd.h> 22#include <linux/mtd/mtd.h>
23#include <linux/mtd/nand.h> 23#include <linux/mtd/nand.h>
24#include <linux/mtd/partitions.h> 24#include <linux/mtd/partitions.h>
25#include <linux/mtd/physmap.h> 25#include <linux/mtd/physmap.h>
26#include <linux/regulator/machine.h>
26 27
27#include <asm/mach-types.h> 28#include <asm/mach-types.h>
28#include <asm/mach/arch.h> 29#include <asm/mach/arch.h>
29 30
30#include <mach/common.h>
31#include <mach/irqs.h>
32#include <mach/cp_intc.h> 31#include <mach/cp_intc.h>
33#include <mach/da8xx.h> 32#include <mach/da8xx.h>
34#include <mach/nand.h> 33#include <mach/nand.h>
34#include <mach/mux.h>
35 35
36#define DA850_EVM_PHY_MASK 0x1 36#define DA850_EVM_PHY_MASK 0x1
37#define DA850_EVM_MDIO_FREQUENCY 2200000 /* PHY bus frequency */ 37#define DA850_EVM_MDIO_FREQUENCY 2200000 /* PHY bus frequency */
38 38
39#define DA850_LCD_PWR_PIN GPIO_TO_PIN(2, 8)
39#define DA850_LCD_BL_PIN GPIO_TO_PIN(2, 15) 40#define DA850_LCD_BL_PIN GPIO_TO_PIN(2, 15)
40#define DA850_LCD_PWR_PIN GPIO_TO_PIN(8, 10)
41 41
42#define DA850_MMCSD_CD_PIN GPIO_TO_PIN(4, 0) 42#define DA850_MMCSD_CD_PIN GPIO_TO_PIN(4, 0)
43#define DA850_MMCSD_WP_PIN GPIO_TO_PIN(4, 1) 43#define DA850_MMCSD_WP_PIN GPIO_TO_PIN(4, 1)
44 44
45#define DA850_MII_MDIO_CLKEN_PIN GPIO_TO_PIN(2, 6)
46
45static struct mtd_partition da850_evm_norflash_partition[] = { 47static struct mtd_partition da850_evm_norflash_partition[] = {
46 { 48 {
47 .name = "NOR filesystem", 49 .name = "NOR filesystem",
@@ -143,10 +145,149 @@ static struct platform_device da850_evm_nandflash_device = {
143 .resource = da850_evm_nandflash_resource, 145 .resource = da850_evm_nandflash_resource,
144}; 146};
145 147
148static struct platform_device *da850_evm_devices[] __initdata = {
149 &da850_evm_nandflash_device,
150 &da850_evm_norflash_device,
151};
152
153#define DA8XX_AEMIF_CE2CFG_OFFSET 0x10
154#define DA8XX_AEMIF_ASIZE_16BIT 0x1
155
156static void __init da850_evm_init_nor(void)
157{
158 void __iomem *aemif_addr;
159
160 aemif_addr = ioremap(DA8XX_AEMIF_CTL_BASE, SZ_32K);
161
162 /* Configure data bus width of CS2 to 16 bit */
163 writel(readl(aemif_addr + DA8XX_AEMIF_CE2CFG_OFFSET) |
164 DA8XX_AEMIF_ASIZE_16BIT,
165 aemif_addr + DA8XX_AEMIF_CE2CFG_OFFSET);
166
167 iounmap(aemif_addr);
168}
169
170static u32 ui_card_detected;
171
172#if defined(CONFIG_MMC_DAVINCI) || \
173 defined(CONFIG_MMC_DAVINCI_MODULE)
174#define HAS_MMC 1
175#else
176#define HAS_MMC 0
177#endif
178
179static __init void da850_evm_setup_nor_nand(void)
180{
181 int ret = 0;
182
183 if (ui_card_detected & !HAS_MMC) {
184 ret = da8xx_pinmux_setup(da850_nand_pins);
185 if (ret)
186 pr_warning("da850_evm_init: nand mux setup failed: "
187 "%d\n", ret);
188
189 ret = da8xx_pinmux_setup(da850_nor_pins);
190 if (ret)
191 pr_warning("da850_evm_init: nor mux setup failed: %d\n",
192 ret);
193
194 da850_evm_init_nor();
195
196 platform_add_devices(da850_evm_devices,
197 ARRAY_SIZE(da850_evm_devices));
198 }
199}
200
201#ifdef CONFIG_DA850_UI_RMII
202static inline void da850_evm_setup_emac_rmii(int rmii_sel)
203{
204 struct davinci_soc_info *soc_info = &davinci_soc_info;
205
206 soc_info->emac_pdata->rmii_en = 1;
207 gpio_set_value(rmii_sel, 0);
208}
209#else
210static inline void da850_evm_setup_emac_rmii(int rmii_sel) { }
211#endif
212
213static int da850_evm_ui_expander_setup(struct i2c_client *client, unsigned gpio,
214 unsigned ngpio, void *c)
215{
216 int sel_a, sel_b, sel_c, ret;
217
218 sel_a = gpio + 7;
219 sel_b = gpio + 6;
220 sel_c = gpio + 5;
221
222 ret = gpio_request(sel_a, "sel_a");
223 if (ret) {
224 pr_warning("Cannot open UI expander pin %d\n", sel_a);
225 goto exp_setup_sela_fail;
226 }
227
228 ret = gpio_request(sel_b, "sel_b");
229 if (ret) {
230 pr_warning("Cannot open UI expander pin %d\n", sel_b);
231 goto exp_setup_selb_fail;
232 }
233
234 ret = gpio_request(sel_c, "sel_c");
235 if (ret) {
236 pr_warning("Cannot open UI expander pin %d\n", sel_c);
237 goto exp_setup_selc_fail;
238 }
239
240 /* deselect all functionalities */
241 gpio_direction_output(sel_a, 1);
242 gpio_direction_output(sel_b, 1);
243 gpio_direction_output(sel_c, 1);
244
245 ui_card_detected = 1;
246 pr_info("DA850/OMAP-L138 EVM UI card detected\n");
247
248 da850_evm_setup_nor_nand();
249
250 da850_evm_setup_emac_rmii(sel_a);
251
252 return 0;
253
254exp_setup_selc_fail:
255 gpio_free(sel_b);
256exp_setup_selb_fail:
257 gpio_free(sel_a);
258exp_setup_sela_fail:
259 return ret;
260}
261
262static int da850_evm_ui_expander_teardown(struct i2c_client *client,
263 unsigned gpio, unsigned ngpio, void *c)
264{
265 /* deselect all functionalities */
266 gpio_set_value(gpio + 5, 1);
267 gpio_set_value(gpio + 6, 1);
268 gpio_set_value(gpio + 7, 1);
269
270 gpio_free(gpio + 5);
271 gpio_free(gpio + 6);
272 gpio_free(gpio + 7);
273
274 return 0;
275}
276
277static struct pca953x_platform_data da850_evm_ui_expander_info = {
278 .gpio_base = DAVINCI_N_GPIO,
279 .setup = da850_evm_ui_expander_setup,
280 .teardown = da850_evm_ui_expander_teardown,
281};
282
146static struct i2c_board_info __initdata da850_evm_i2c_devices[] = { 283static struct i2c_board_info __initdata da850_evm_i2c_devices[] = {
147 { 284 {
148 I2C_BOARD_INFO("tlv320aic3x", 0x18), 285 I2C_BOARD_INFO("tlv320aic3x", 0x18),
149 } 286 },
287 {
288 I2C_BOARD_INFO("tca6416", 0x20),
289 .platform_data = &da850_evm_ui_expander_info,
290 },
150}; 291};
151 292
152static struct davinci_i2c_platform_data da850_evm_i2c_0_pdata = { 293static struct davinci_i2c_platform_data da850_evm_i2c_0_pdata = {
@@ -158,11 +299,6 @@ static struct davinci_uart_config da850_evm_uart_config __initdata = {
158 .enabled_uarts = 0x7, 299 .enabled_uarts = 0x7,
159}; 300};
160 301
161static struct platform_device *da850_evm_devices[] __initdata = {
162 &da850_evm_nandflash_device,
163 &da850_evm_norflash_device,
164};
165
166/* davinci da850 evm audio machine driver */ 302/* davinci da850 evm audio machine driver */
167static u8 da850_iis_serializer_direction[] = { 303static u8 da850_iis_serializer_direction[] = {
168 INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, 304 INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE,
@@ -198,6 +334,8 @@ static struct davinci_mmc_config da850_mmc_config = {
198 .get_ro = da850_evm_mmc_get_ro, 334 .get_ro = da850_evm_mmc_get_ro,
199 .get_cd = da850_evm_mmc_get_cd, 335 .get_cd = da850_evm_mmc_get_cd,
200 .wires = 4, 336 .wires = 4,
337 .max_freq = 50000000,
338 .caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED,
201 .version = MMC_CTLR_VERSION_2, 339 .version = MMC_CTLR_VERSION_2,
202}; 340};
203 341
@@ -233,56 +371,227 @@ static int da850_lcd_hw_init(void)
233 return 0; 371 return 0;
234} 372}
235 373
236#define DA8XX_AEMIF_CE2CFG_OFFSET 0x10 374/* TPS65070 voltage regulator support */
237#define DA8XX_AEMIF_ASIZE_16BIT 0x1
238 375
239static void __init da850_evm_init_nor(void) 376/* 3.3V */
240{ 377struct regulator_consumer_supply tps65070_dcdc1_consumers[] = {
241 void __iomem *aemif_addr; 378 {
379 .supply = "usb0_vdda33",
380 },
381 {
382 .supply = "usb1_vdda33",
383 },
384};
242 385
243 aemif_addr = ioremap(DA8XX_AEMIF_CTL_BASE, SZ_32K); 386/* 3.3V or 1.8V */
387struct regulator_consumer_supply tps65070_dcdc2_consumers[] = {
388 {
389 .supply = "dvdd3318_a",
390 },
391 {
392 .supply = "dvdd3318_b",
393 },
394 {
395 .supply = "dvdd3318_c",
396 },
397};
244 398
245 /* Configure data bus width of CS2 to 16 bit */ 399/* 1.2V */
246 writel(readl(aemif_addr + DA8XX_AEMIF_CE2CFG_OFFSET) | 400struct regulator_consumer_supply tps65070_dcdc3_consumers[] = {
247 DA8XX_AEMIF_ASIZE_16BIT, 401 {
248 aemif_addr + DA8XX_AEMIF_CE2CFG_OFFSET); 402 .supply = "cvdd",
403 },
404};
249 405
250 iounmap(aemif_addr); 406/* 1.8V LDO */
251} 407struct regulator_consumer_supply tps65070_ldo1_consumers[] = {
408 {
409 .supply = "sata_vddr",
410 },
411 {
412 .supply = "usb0_vdda18",
413 },
414 {
415 .supply = "usb1_vdda18",
416 },
417 {
418 .supply = "ddr_dvdd18",
419 },
420};
252 421
253#if defined(CONFIG_MTD_PHYSMAP) || \ 422/* 1.2V LDO */
254 defined(CONFIG_MTD_PHYSMAP_MODULE) 423struct regulator_consumer_supply tps65070_ldo2_consumers[] = {
255#define HAS_NOR 1 424 {
256#else 425 .supply = "sata_vdd",
257#define HAS_NOR 0 426 },
258#endif 427 {
428 .supply = "pll0_vdda",
429 },
430 {
431 .supply = "pll1_vdda",
432 },
433 {
434 .supply = "usbs_cvdd",
435 },
436 {
437 .supply = "vddarnwa1",
438 },
439};
259 440
260#if defined(CONFIG_MMC_DAVINCI) || \ 441struct regulator_init_data tps65070_regulator_data[] = {
261 defined(CONFIG_MMC_DAVINCI_MODULE) 442 /* dcdc1 */
262#define HAS_MMC 1 443 {
263#else 444 .constraints = {
264#define HAS_MMC 0 445 .min_uV = 3150000,
265#endif 446 .max_uV = 3450000,
447 .valid_ops_mask = (REGULATOR_CHANGE_VOLTAGE |
448 REGULATOR_CHANGE_STATUS),
449 .boot_on = 1,
450 },
451 .num_consumer_supplies = ARRAY_SIZE(tps65070_dcdc1_consumers),
452 .consumer_supplies = tps65070_dcdc1_consumers,
453 },
266 454
267static __init void da850_evm_init(void) 455 /* dcdc2 */
456 {
457 .constraints = {
458 .min_uV = 1710000,
459 .max_uV = 3450000,
460 .valid_ops_mask = (REGULATOR_CHANGE_VOLTAGE |
461 REGULATOR_CHANGE_STATUS),
462 .boot_on = 1,
463 },
464 .num_consumer_supplies = ARRAY_SIZE(tps65070_dcdc2_consumers),
465 .consumer_supplies = tps65070_dcdc2_consumers,
466 },
467
468 /* dcdc3 */
469 {
470 .constraints = {
471 .min_uV = 950000,
472 .max_uV = 1320000,
473 .valid_ops_mask = (REGULATOR_CHANGE_VOLTAGE |
474 REGULATOR_CHANGE_STATUS),
475 .boot_on = 1,
476 },
477 .num_consumer_supplies = ARRAY_SIZE(tps65070_dcdc3_consumers),
478 .consumer_supplies = tps65070_dcdc3_consumers,
479 },
480
481 /* ldo1 */
482 {
483 .constraints = {
484 .min_uV = 1710000,
485 .max_uV = 1890000,
486 .valid_ops_mask = (REGULATOR_CHANGE_VOLTAGE |
487 REGULATOR_CHANGE_STATUS),
488 .boot_on = 1,
489 },
490 .num_consumer_supplies = ARRAY_SIZE(tps65070_ldo1_consumers),
491 .consumer_supplies = tps65070_ldo1_consumers,
492 },
493
494 /* ldo2 */
495 {
496 .constraints = {
497 .min_uV = 1140000,
498 .max_uV = 1320000,
499 .valid_ops_mask = (REGULATOR_CHANGE_VOLTAGE |
500 REGULATOR_CHANGE_STATUS),
501 .boot_on = 1,
502 },
503 .num_consumer_supplies = ARRAY_SIZE(tps65070_ldo2_consumers),
504 .consumer_supplies = tps65070_ldo2_consumers,
505 },
506};
507
508static struct i2c_board_info __initdata da850evm_tps65070_info[] = {
509 {
510 I2C_BOARD_INFO("tps6507x", 0x48),
511 .platform_data = &tps65070_regulator_data[0],
512 },
513};
514
515static int __init pmic_tps65070_init(void)
268{ 516{
269 struct davinci_soc_info *soc_info = &davinci_soc_info; 517 return i2c_register_board_info(1, da850evm_tps65070_info,
518 ARRAY_SIZE(da850evm_tps65070_info));
519}
520
521static const short da850_evm_lcdc_pins[] = {
522 DA850_GPIO2_8, DA850_GPIO2_15,
523 -1
524};
525
526static int __init da850_evm_config_emac(void)
527{
528 void __iomem *cfg_chip3_base;
270 int ret; 529 int ret;
530 u32 val;
531 struct davinci_soc_info *soc_info = &davinci_soc_info;
532 u8 rmii_en = soc_info->emac_pdata->rmii_en;
533
534 if (!machine_is_davinci_da850_evm())
535 return 0;
536
537 cfg_chip3_base = DA8XX_SYSCFG_VIRT(DA8XX_CFGCHIP3_REG);
538
539 val = __raw_readl(cfg_chip3_base);
540
541 if (rmii_en) {
542 val |= BIT(8);
543 ret = da8xx_pinmux_setup(da850_rmii_pins);
544 pr_info("EMAC: RMII PHY configured, MII PHY will not be"
545 " functional\n");
546 } else {
547 val &= ~BIT(8);
548 ret = da8xx_pinmux_setup(da850_cpgmac_pins);
549 pr_info("EMAC: MII PHY configured, RMII PHY will not be"
550 " functional\n");
551 }
271 552
272 ret = da8xx_pinmux_setup(da850_nand_pins);
273 if (ret) 553 if (ret)
274 pr_warning("da850_evm_init: nand mux setup failed: %d\n", 554 pr_warning("da850_evm_init: cpgmac/rmii mux setup failed: %d\n",
275 ret); 555 ret);
276 556
277 ret = da8xx_pinmux_setup(da850_nor_pins); 557 /* configure the CFGCHIP3 register for RMII or MII */
558 __raw_writel(val, cfg_chip3_base);
559
560 ret = davinci_cfg_reg(DA850_GPIO2_6);
278 if (ret) 561 if (ret)
279 pr_warning("da850_evm_init: nor mux setup failed: %d\n", 562 pr_warning("da850_evm_init:GPIO(2,6) mux setup "
563 "failed\n");
564
565 ret = gpio_request(DA850_MII_MDIO_CLKEN_PIN, "mdio_clk_en");
566 if (ret) {
567 pr_warning("Cannot open GPIO %d\n",
568 DA850_MII_MDIO_CLKEN_PIN);
569 return ret;
570 }
571
572 /* Enable/Disable MII MDIO clock */
573 gpio_direction_output(DA850_MII_MDIO_CLKEN_PIN, rmii_en);
574
575 soc_info->emac_pdata->phy_mask = DA850_EVM_PHY_MASK;
576 soc_info->emac_pdata->mdio_max_freq = DA850_EVM_MDIO_FREQUENCY;
577
578 ret = da8xx_register_emac();
579 if (ret)
580 pr_warning("da850_evm_init: emac registration failed: %d\n",
280 ret); 581 ret);
281 582
282 da850_evm_init_nor(); 583 return 0;
584}
585device_initcall(da850_evm_config_emac);
586
587static __init void da850_evm_init(void)
588{
589 int ret;
283 590
284 platform_add_devices(da850_evm_devices, 591 ret = pmic_tps65070_init();
285 ARRAY_SIZE(da850_evm_devices)); 592 if (ret)
593 pr_warning("da850_evm_init: TPS65070 PMIC init failed: %d\n",
594 ret);
286 595
287 ret = da8xx_register_edma(); 596 ret = da8xx_register_edma();
288 if (ret) 597 if (ret)
@@ -299,19 +608,6 @@ static __init void da850_evm_init(void)
299 pr_warning("da850_evm_init: i2c0 registration failed: %d\n", 608 pr_warning("da850_evm_init: i2c0 registration failed: %d\n",
300 ret); 609 ret);
301 610
302 soc_info->emac_pdata->phy_mask = DA850_EVM_PHY_MASK;
303 soc_info->emac_pdata->mdio_max_freq = DA850_EVM_MDIO_FREQUENCY;
304 soc_info->emac_pdata->rmii_en = 0;
305
306 ret = da8xx_pinmux_setup(da850_cpgmac_pins);
307 if (ret)
308 pr_warning("da850_evm_init: cpgmac mux setup failed: %d\n",
309 ret);
310
311 ret = da8xx_register_emac();
312 if (ret)
313 pr_warning("da850_evm_init: emac registration failed: %d\n",
314 ret);
315 611
316 ret = da8xx_register_watchdog(); 612 ret = da8xx_register_watchdog();
317 if (ret) 613 if (ret)
@@ -319,11 +615,6 @@ static __init void da850_evm_init(void)
319 ret); 615 ret);
320 616
321 if (HAS_MMC) { 617 if (HAS_MMC) {
322 if (HAS_NOR)
323 pr_warning("WARNING: both NOR Flash and MMC/SD are "
324 "enabled, but they share AEMIF pins.\n"
325 "\tDisable one of them.\n");
326
327 ret = da8xx_pinmux_setup(da850_mmcsd0_pins); 618 ret = da8xx_pinmux_setup(da850_mmcsd0_pins);
328 if (ret) 619 if (ret)
329 pr_warning("da850_evm_init: mmcsd0 mux setup failed:" 620 pr_warning("da850_evm_init: mmcsd0 mux setup failed:"
@@ -365,22 +656,42 @@ static __init void da850_evm_init(void)
365 pr_warning("da850_evm_init: mcasp mux setup failed: %d\n", 656 pr_warning("da850_evm_init: mcasp mux setup failed: %d\n",
366 ret); 657 ret);
367 658
368 da8xx_init_mcasp(0, &da850_evm_snd_data); 659 da8xx_register_mcasp(0, &da850_evm_snd_data);
369 660
370 ret = da8xx_pinmux_setup(da850_lcdcntl_pins); 661 ret = da8xx_pinmux_setup(da850_lcdcntl_pins);
371 if (ret) 662 if (ret)
372 pr_warning("da850_evm_init: lcdcntl mux setup failed: %d\n", 663 pr_warning("da850_evm_init: lcdcntl mux setup failed: %d\n",
373 ret); 664 ret);
374 665
666 /* Handle board specific muxing for LCD here */
667 ret = da8xx_pinmux_setup(da850_evm_lcdc_pins);
668 if (ret)
669 pr_warning("da850_evm_init: evm specific lcd mux setup "
670 "failed: %d\n", ret);
671
375 ret = da850_lcd_hw_init(); 672 ret = da850_lcd_hw_init();
376 if (ret) 673 if (ret)
377 pr_warning("da850_evm_init: lcd initialization failed: %d\n", 674 pr_warning("da850_evm_init: lcd initialization failed: %d\n",
378 ret); 675 ret);
379 676
380 ret = da8xx_register_lcdc(); 677 ret = da8xx_register_lcdc(&sharp_lk043t1dg01_pdata);
381 if (ret) 678 if (ret)
382 pr_warning("da850_evm_init: lcdc registration failed: %d\n", 679 pr_warning("da850_evm_init: lcdc registration failed: %d\n",
383 ret); 680 ret);
681
682 ret = da8xx_register_rtc();
683 if (ret)
684 pr_warning("da850_evm_init: rtc setup failed: %d\n", ret);
685
686 ret = da850_register_cpufreq();
687 if (ret)
688 pr_warning("da850_evm_init: cpufreq registration failed: %d\n",
689 ret);
690
691 ret = da8xx_register_cpuidle();
692 if (ret)
693 pr_warning("da850_evm_init: cpuidle registration failed: %d\n",
694 ret);
384} 695}
385 696
386#ifdef CONFIG_SERIAL_8250_CONSOLE 697#ifdef CONFIG_SERIAL_8250_CONSOLE
diff --git a/arch/arm/mach-davinci/board-dm355-evm.c b/arch/arm/mach-davinci/board-dm355-evm.c
index 77e806798822..a9b650dcc172 100644
--- a/arch/arm/mach-davinci/board-dm355-evm.c
+++ b/arch/arm/mach-davinci/board-dm355-evm.c
@@ -9,15 +9,13 @@
9 * or implied. 9 * or implied.
10 */ 10 */
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/module.h>
13#include <linux/init.h> 12#include <linux/init.h>
14#include <linux/dma-mapping.h> 13#include <linux/err.h>
15#include <linux/platform_device.h> 14#include <linux/platform_device.h>
16#include <linux/mtd/mtd.h> 15#include <linux/mtd/mtd.h>
17#include <linux/mtd/partitions.h> 16#include <linux/mtd/partitions.h>
18#include <linux/mtd/nand.h> 17#include <linux/mtd/nand.h>
19#include <linux/i2c.h> 18#include <linux/i2c.h>
20#include <linux/io.h>
21#include <linux/gpio.h> 19#include <linux/gpio.h>
22#include <linux/clk.h> 20#include <linux/clk.h>
23#include <linux/videodev2.h> 21#include <linux/videodev2.h>
@@ -25,20 +23,15 @@
25#include <linux/spi/spi.h> 23#include <linux/spi/spi.h>
26#include <linux/spi/eeprom.h> 24#include <linux/spi/eeprom.h>
27 25
28#include <asm/setup.h>
29#include <asm/mach-types.h> 26#include <asm/mach-types.h>
30#include <asm/mach/arch.h> 27#include <asm/mach/arch.h>
31#include <asm/mach/map.h>
32#include <asm/mach/flash.h>
33 28
34#include <mach/hardware.h>
35#include <mach/dm355.h> 29#include <mach/dm355.h>
36#include <mach/psc.h>
37#include <mach/common.h>
38#include <mach/i2c.h> 30#include <mach/i2c.h>
39#include <mach/serial.h> 31#include <mach/serial.h>
40#include <mach/nand.h> 32#include <mach/nand.h>
41#include <mach/mmc.h> 33#include <mach/mmc.h>
34#include <mach/usb.h>
42 35
43#define DAVINCI_ASYNC_EMIF_CONTROL_BASE 0x01e10000 36#define DAVINCI_ASYNC_EMIF_CONTROL_BASE 0x01e10000
44#define DAVINCI_ASYNC_EMIF_DATA_CE0_BASE 0x02000000 37#define DAVINCI_ASYNC_EMIF_DATA_CE0_BASE 0x02000000
@@ -86,8 +79,9 @@ static struct davinci_nand_pdata davinci_nand_data = {
86 .mask_chipsel = BIT(14), 79 .mask_chipsel = BIT(14),
87 .parts = davinci_nand_partitions, 80 .parts = davinci_nand_partitions,
88 .nr_parts = ARRAY_SIZE(davinci_nand_partitions), 81 .nr_parts = ARRAY_SIZE(davinci_nand_partitions),
89 .ecc_mode = NAND_ECC_HW_SYNDROME, 82 .ecc_mode = NAND_ECC_HW,
90 .options = NAND_USE_FLASH_BBT, 83 .options = NAND_USE_FLASH_BBT,
84 .ecc_bits = 4,
91}; 85};
92 86
93static struct resource davinci_nand_resources[] = { 87static struct resource davinci_nand_resources[] = {
@@ -344,7 +338,7 @@ static __init void dm355_evm_init(void)
344 gpio_request(2, "usb_id_toggle"); 338 gpio_request(2, "usb_id_toggle");
345 gpio_direction_output(2, USB_ID_VALUE); 339 gpio_direction_output(2, USB_ID_VALUE);
346 /* irlml6401 switches over 1A in under 8 msec */ 340 /* irlml6401 switches over 1A in under 8 msec */
347 setup_usb(500, 8); 341 davinci_setup_usb(1000, 8);
348 342
349 davinci_setup_mmc(0, &dm355evm_mmc_config); 343 davinci_setup_mmc(0, &dm355evm_mmc_config);
350 davinci_setup_mmc(1, &dm355evm_mmc_config); 344 davinci_setup_mmc(1, &dm355evm_mmc_config);
diff --git a/arch/arm/mach-davinci/board-dm355-leopard.c b/arch/arm/mach-davinci/board-dm355-leopard.c
index 84ad5d161a87..21f32eb41e8c 100644
--- a/arch/arm/mach-davinci/board-dm355-leopard.c
+++ b/arch/arm/mach-davinci/board-dm355-leopard.c
@@ -8,34 +8,27 @@
8 * warranty of any kind, whether express or implied. 8 * warranty of any kind, whether express or implied.
9 */ 9 */
10#include <linux/kernel.h> 10#include <linux/kernel.h>
11#include <linux/module.h>
12#include <linux/init.h> 11#include <linux/init.h>
13#include <linux/dma-mapping.h> 12#include <linux/err.h>
14#include <linux/platform_device.h> 13#include <linux/platform_device.h>
15#include <linux/mtd/mtd.h> 14#include <linux/mtd/mtd.h>
16#include <linux/mtd/partitions.h> 15#include <linux/mtd/partitions.h>
17#include <linux/mtd/nand.h> 16#include <linux/mtd/nand.h>
18#include <linux/i2c.h> 17#include <linux/i2c.h>
19#include <linux/io.h>
20#include <linux/gpio.h> 18#include <linux/gpio.h>
21#include <linux/clk.h> 19#include <linux/clk.h>
22#include <linux/spi/spi.h> 20#include <linux/spi/spi.h>
23#include <linux/spi/eeprom.h> 21#include <linux/spi/eeprom.h>
24 22
25#include <asm/setup.h>
26#include <asm/mach-types.h> 23#include <asm/mach-types.h>
27#include <asm/mach/arch.h> 24#include <asm/mach/arch.h>
28#include <asm/mach/map.h>
29#include <asm/mach/flash.h>
30 25
31#include <mach/hardware.h>
32#include <mach/dm355.h> 26#include <mach/dm355.h>
33#include <mach/psc.h>
34#include <mach/common.h>
35#include <mach/i2c.h> 27#include <mach/i2c.h>
36#include <mach/serial.h> 28#include <mach/serial.h>
37#include <mach/nand.h> 29#include <mach/nand.h>
38#include <mach/mmc.h> 30#include <mach/mmc.h>
31#include <mach/usb.h>
39 32
40#define DAVINCI_ASYNC_EMIF_CONTROL_BASE 0x01e10000 33#define DAVINCI_ASYNC_EMIF_CONTROL_BASE 0x01e10000
41#define DAVINCI_ASYNC_EMIF_DATA_CE0_BASE 0x02000000 34#define DAVINCI_ASYNC_EMIF_DATA_CE0_BASE 0x02000000
@@ -270,7 +263,7 @@ static __init void dm355_leopard_init(void)
270 gpio_request(2, "usb_id_toggle"); 263 gpio_request(2, "usb_id_toggle");
271 gpio_direction_output(2, USB_ID_VALUE); 264 gpio_direction_output(2, USB_ID_VALUE);
272 /* irlml6401 switches over 1A in under 8 msec */ 265 /* irlml6401 switches over 1A in under 8 msec */
273 setup_usb(500, 8); 266 davinci_setup_usb(1000, 8);
274 267
275 davinci_setup_mmc(0, &dm355leopard_mmc_config); 268 davinci_setup_mmc(0, &dm355leopard_mmc_config);
276 davinci_setup_mmc(1, &dm355leopard_mmc_config); 269 davinci_setup_mmc(1, &dm355leopard_mmc_config);
diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c
index 52dd8046b305..289fe1b7d25a 100644
--- a/arch/arm/mach-davinci/board-dm365-evm.c
+++ b/arch/arm/mach-davinci/board-dm365-evm.c
@@ -13,9 +13,8 @@
13 * GNU General Public License for more details. 13 * GNU General Public License for more details.
14 */ 14 */
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/module.h>
17#include <linux/init.h> 16#include <linux/init.h>
18#include <linux/dma-mapping.h> 17#include <linux/err.h>
19#include <linux/i2c.h> 18#include <linux/i2c.h>
20#include <linux/io.h> 19#include <linux/io.h>
21#include <linux/clk.h> 20#include <linux/clk.h>
@@ -24,20 +23,19 @@
24#include <linux/mtd/mtd.h> 23#include <linux/mtd/mtd.h>
25#include <linux/mtd/partitions.h> 24#include <linux/mtd/partitions.h>
26#include <linux/mtd/nand.h> 25#include <linux/mtd/nand.h>
27#include <asm/setup.h> 26#include <linux/input.h>
27
28#include <asm/mach-types.h> 28#include <asm/mach-types.h>
29#include <asm/mach/arch.h> 29#include <asm/mach/arch.h>
30#include <asm/mach/map.h> 30
31#include <mach/mux.h> 31#include <mach/mux.h>
32#include <mach/hardware.h>
33#include <mach/dm365.h> 32#include <mach/dm365.h>
34#include <mach/psc.h>
35#include <mach/common.h> 33#include <mach/common.h>
36#include <mach/i2c.h> 34#include <mach/i2c.h>
37#include <mach/serial.h> 35#include <mach/serial.h>
38#include <mach/mmc.h> 36#include <mach/mmc.h>
39#include <mach/nand.h> 37#include <mach/nand.h>
40 38#include <mach/keyscan.h>
41 39
42static inline int have_imager(void) 40static inline int have_imager(void)
43{ 41{
@@ -144,6 +142,7 @@ static struct davinci_nand_pdata davinci_nand_data = {
144 .nr_parts = ARRAY_SIZE(davinci_nand_partitions), 142 .nr_parts = ARRAY_SIZE(davinci_nand_partitions),
145 .ecc_mode = NAND_ECC_HW, 143 .ecc_mode = NAND_ECC_HW,
146 .options = NAND_USE_FLASH_BBT, 144 .options = NAND_USE_FLASH_BBT,
145 .ecc_bits = 4,
147}; 146};
148 147
149static struct resource davinci_nand_resources[] = { 148static struct resource davinci_nand_resources[] = {
@@ -176,11 +175,16 @@ static struct at24_platform_data eeprom_info = {
176 .context = (void *)0x7f00, 175 .context = (void *)0x7f00,
177}; 176};
178 177
178static struct snd_platform_data dm365_evm_snd_data;
179
179static struct i2c_board_info i2c_info[] = { 180static struct i2c_board_info i2c_info[] = {
180 { 181 {
181 I2C_BOARD_INFO("24c256", 0x50), 182 I2C_BOARD_INFO("24c256", 0x50),
182 .platform_data = &eeprom_info, 183 .platform_data = &eeprom_info,
183 }, 184 },
185 {
186 I2C_BOARD_INFO("tlv320aic3x", 0x18),
187 },
184}; 188};
185 189
186static struct davinci_i2c_platform_data i2c_pdata = { 190static struct davinci_i2c_platform_data i2c_pdata = {
@@ -188,6 +192,38 @@ static struct davinci_i2c_platform_data i2c_pdata = {
188 .bus_delay = 0 /* usec */, 192 .bus_delay = 0 /* usec */,
189}; 193};
190 194
195#ifdef CONFIG_KEYBOARD_DAVINCI
196static unsigned short dm365evm_keymap[] = {
197 KEY_KP2,
198 KEY_LEFT,
199 KEY_EXIT,
200 KEY_DOWN,
201 KEY_ENTER,
202 KEY_UP,
203 KEY_KP1,
204 KEY_RIGHT,
205 KEY_MENU,
206 KEY_RECORD,
207 KEY_REWIND,
208 KEY_KPMINUS,
209 KEY_STOP,
210 KEY_FASTFORWARD,
211 KEY_KPPLUS,
212 KEY_PLAYPAUSE,
213 0
214};
215
216static struct davinci_ks_platform_data dm365evm_ks_data = {
217 .keymap = dm365evm_keymap,
218 .keymapsize = ARRAY_SIZE(dm365evm_keymap),
219 .rep = 1,
220 /* Scan period = strobe + interval */
221 .strobe = 0x5,
222 .interval = 0x2,
223 .matrix_type = DAVINCI_KEYSCAN_MATRIX_4X4,
224};
225#endif
226
191static int cpld_mmc_get_cd(int module) 227static int cpld_mmc_get_cd(int module)
192{ 228{
193 if (!cpld) 229 if (!cpld)
@@ -472,6 +508,13 @@ static __init void dm365_evm_init(void)
472 508
473 /* maybe setup mmc1/etc ... _after_ mmc0 */ 509 /* maybe setup mmc1/etc ... _after_ mmc0 */
474 evm_init_cpld(); 510 evm_init_cpld();
511
512 dm365_init_asp(&dm365_evm_snd_data);
513 dm365_init_rtc();
514
515#ifdef CONFIG_KEYBOARD_DAVINCI
516 dm365_init_ks(&dm365evm_ks_data);
517#endif
475} 518}
476 519
477static __init void dm365_evm_irq_init(void) 520static __init void dm365_evm_irq_init(void)
diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c
index 1213a0087ad4..fd0398bc6db3 100644
--- a/arch/arm/mach-davinci/board-dm644x-evm.c
+++ b/arch/arm/mach-davinci/board-dm644x-evm.c
@@ -9,45 +9,34 @@
9 * or implied. 9 * or implied.
10 */ 10 */
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/module.h>
13#include <linux/init.h> 12#include <linux/init.h>
14#include <linux/dma-mapping.h> 13#include <linux/dma-mapping.h>
15#include <linux/platform_device.h> 14#include <linux/platform_device.h>
16#include <linux/gpio.h> 15#include <linux/gpio.h>
17#include <linux/leds.h>
18#include <linux/memory.h>
19
20#include <linux/i2c.h> 16#include <linux/i2c.h>
21#include <linux/i2c/pcf857x.h> 17#include <linux/i2c/pcf857x.h>
22#include <linux/i2c/at24.h> 18#include <linux/i2c/at24.h>
23#include <linux/etherdevice.h>
24#include <linux/mtd/mtd.h> 19#include <linux/mtd/mtd.h>
25#include <linux/mtd/nand.h> 20#include <linux/mtd/nand.h>
26#include <linux/mtd/partitions.h> 21#include <linux/mtd/partitions.h>
27#include <linux/mtd/physmap.h> 22#include <linux/mtd/physmap.h>
28#include <linux/io.h>
29#include <linux/phy.h> 23#include <linux/phy.h>
30#include <linux/clk.h> 24#include <linux/clk.h>
31#include <linux/videodev2.h> 25#include <linux/videodev2.h>
32 26
33#include <media/tvp514x.h> 27#include <media/tvp514x.h>
34 28
35#include <asm/setup.h>
36#include <asm/mach-types.h> 29#include <asm/mach-types.h>
37
38#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
39#include <asm/mach/map.h>
40#include <asm/mach/flash.h>
41 31
42#include <mach/dm644x.h> 32#include <mach/dm644x.h>
43#include <mach/common.h> 33#include <mach/common.h>
44#include <mach/i2c.h> 34#include <mach/i2c.h>
45#include <mach/serial.h> 35#include <mach/serial.h>
46#include <mach/mux.h> 36#include <mach/mux.h>
47#include <mach/psc.h>
48#include <mach/nand.h> 37#include <mach/nand.h>
49#include <mach/mmc.h> 38#include <mach/mmc.h>
50#include <mach/emac.h> 39#include <mach/usb.h>
51 40
52#define DM644X_EVM_PHY_MASK (0x2) 41#define DM644X_EVM_PHY_MASK (0x2)
53#define DM644X_EVM_MDIO_FREQUENCY (2200000) /* PHY bus frequency */ 42#define DM644X_EVM_MDIO_FREQUENCY (2200000) /* PHY bus frequency */
@@ -477,7 +466,7 @@ evm_u35_setup(struct i2c_client *client, int gpio, unsigned ngpio, void *c)
477 /* irlml6401 switches over 1A, in under 8 msec; 466 /* irlml6401 switches over 1A, in under 8 msec;
478 * now it can be managed by nDRV_VBUS ... 467 * now it can be managed by nDRV_VBUS ...
479 */ 468 */
480 setup_usb(500, 8); 469 davinci_setup_usb(1000, 8);
481 470
482 return 0; 471 return 0;
483} 472}
diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c
index 24e0e13b1492..8d0b0e01c59b 100644
--- a/arch/arm/mach-davinci/board-dm646x-evm.c
+++ b/arch/arm/mach-davinci/board-dm646x-evm.c
@@ -17,38 +17,28 @@
17 **************************************************************************/ 17 **************************************************************************/
18 18
19#include <linux/kernel.h> 19#include <linux/kernel.h>
20#include <linux/module.h>
21#include <linux/init.h> 20#include <linux/init.h>
22#include <linux/fs.h>
23#include <linux/major.h>
24#include <linux/root_dev.h>
25#include <linux/dma-mapping.h>
26#include <linux/serial.h>
27#include <linux/serial_8250.h>
28#include <linux/leds.h> 21#include <linux/leds.h>
29#include <linux/gpio.h> 22#include <linux/gpio.h>
30#include <linux/io.h>
31#include <linux/platform_device.h> 23#include <linux/platform_device.h>
32#include <linux/i2c.h> 24#include <linux/i2c.h>
33#include <linux/i2c/at24.h> 25#include <linux/i2c/at24.h>
34#include <linux/i2c/pcf857x.h> 26#include <linux/i2c/pcf857x.h>
35#include <linux/etherdevice.h>
36 27
37#include <media/tvp514x.h> 28#include <media/tvp514x.h>
38 29
39#include <asm/setup.h> 30#include <linux/mtd/mtd.h>
31#include <linux/mtd/nand.h>
32#include <linux/mtd/partitions.h>
33
40#include <asm/mach-types.h> 34#include <asm/mach-types.h>
41#include <asm/mach/arch.h> 35#include <asm/mach/arch.h>
42#include <asm/mach/map.h>
43#include <asm/mach/flash.h>
44 36
45#include <mach/dm646x.h> 37#include <mach/dm646x.h>
46#include <mach/common.h> 38#include <mach/common.h>
47#include <mach/psc.h>
48#include <mach/serial.h> 39#include <mach/serial.h>
49#include <mach/i2c.h> 40#include <mach/i2c.h>
50#include <mach/mmc.h> 41#include <mach/nand.h>
51#include <mach/emac.h>
52 42
53#if defined(CONFIG_BLK_DEV_PALMCHIP_BK3710) || \ 43#if defined(CONFIG_BLK_DEV_PALMCHIP_BK3710) || \
54 defined(CONFIG_BLK_DEV_PALMCHIP_BK3710_MODULE) 44 defined(CONFIG_BLK_DEV_PALMCHIP_BK3710_MODULE)
@@ -57,6 +47,11 @@
57#define HAS_ATA 0 47#define HAS_ATA 0
58#endif 48#endif
59 49
50#define DAVINCI_ASYNC_EMIF_CONTROL_BASE 0x20008000
51#define DAVINCI_ASYNC_EMIF_DATA_CE0_BASE 0x42000000
52
53#define NAND_BLOCK_SIZE SZ_128K
54
60/* CPLD Register 0 bits to control ATA */ 55/* CPLD Register 0 bits to control ATA */
61#define DM646X_EVM_ATA_RST BIT(0) 56#define DM646X_EVM_ATA_RST BIT(0)
62#define DM646X_EVM_ATA_PWD BIT(1) 57#define DM646X_EVM_ATA_PWD BIT(1)
@@ -92,6 +87,63 @@ static struct davinci_uart_config uart_config __initdata = {
92 .enabled_uarts = (1 << 0), 87 .enabled_uarts = (1 << 0),
93}; 88};
94 89
90/* Note: We are setting first partition as 'bootloader' constituting UBL, U-Boot
91 * and U-Boot environment this avoids dependency on any particular combination
92 * of UBL, U-Boot or flashing tools etc.
93 */
94static struct mtd_partition davinci_nand_partitions[] = {
95 {
96 /* UBL, U-Boot with environment */
97 .name = "bootloader",
98 .offset = MTDPART_OFS_APPEND,
99 .size = 16 * NAND_BLOCK_SIZE,
100 .mask_flags = MTD_WRITEABLE, /* force read-only */
101 }, {
102 .name = "kernel",
103 .offset = MTDPART_OFS_APPEND,
104 .size = SZ_4M,
105 .mask_flags = 0,
106 }, {
107 .name = "filesystem",
108 .offset = MTDPART_OFS_APPEND,
109 .size = MTDPART_SIZ_FULL,
110 .mask_flags = 0,
111 }
112};
113
114static struct davinci_nand_pdata davinci_nand_data = {
115 .mask_cle = 0x80000,
116 .mask_ale = 0x40000,
117 .parts = davinci_nand_partitions,
118 .nr_parts = ARRAY_SIZE(davinci_nand_partitions),
119 .ecc_mode = NAND_ECC_HW,
120 .options = 0,
121};
122
123static struct resource davinci_nand_resources[] = {
124 {
125 .start = DAVINCI_ASYNC_EMIF_DATA_CE0_BASE,
126 .end = DAVINCI_ASYNC_EMIF_DATA_CE0_BASE + SZ_32M - 1,
127 .flags = IORESOURCE_MEM,
128 }, {
129 .start = DAVINCI_ASYNC_EMIF_CONTROL_BASE,
130 .end = DAVINCI_ASYNC_EMIF_CONTROL_BASE + SZ_4K - 1,
131 .flags = IORESOURCE_MEM,
132 },
133};
134
135static struct platform_device davinci_nand_device = {
136 .name = "davinci_nand",
137 .id = 0,
138
139 .num_resources = ARRAY_SIZE(davinci_nand_resources),
140 .resource = davinci_nand_resources,
141
142 .dev = {
143 .platform_data = &davinci_nand_data,
144 },
145};
146
95/* CPLD Register 0 Client: used for I/O Control */ 147/* CPLD Register 0 Client: used for I/O Control */
96static int cpld_reg0_probe(struct i2c_client *client, 148static int cpld_reg0_probe(struct i2c_client *client,
97 const struct i2c_device_id *id) 149 const struct i2c_device_id *id)
@@ -142,7 +194,7 @@ static struct gpio_led evm_leds[] = {
142 { .name = "DS4", .active_low = 1, }, 194 { .name = "DS4", .active_low = 1, },
143}; 195};
144 196
145static __initconst struct gpio_led_platform_data evm_led_data = { 197static const struct gpio_led_platform_data evm_led_data = {
146 .num_leds = ARRAY_SIZE(evm_leds), 198 .num_leds = ARRAY_SIZE(evm_leds),
147 .leds = evm_leds, 199 .leds = evm_leds,
148}; 200};
@@ -647,6 +699,8 @@ static __init void evm_init(void)
647 dm646x_init_mcasp0(&dm646x_evm_snd_data[0]); 699 dm646x_init_mcasp0(&dm646x_evm_snd_data[0]);
648 dm646x_init_mcasp1(&dm646x_evm_snd_data[1]); 700 dm646x_init_mcasp1(&dm646x_evm_snd_data[1]);
649 701
702 platform_device_register(&davinci_nand_device);
703
650 if (HAS_ATA) 704 if (HAS_ATA)
651 dm646x_init_ide(); 705 dm646x_init_ide();
652 706
diff --git a/arch/arm/mach-davinci/board-neuros-osd2.c b/arch/arm/mach-davinci/board-neuros-osd2.c
new file mode 100644
index 000000000000..bd9ca079b69d
--- /dev/null
+++ b/arch/arm/mach-davinci/board-neuros-osd2.c
@@ -0,0 +1,323 @@
1/*
2 * Neuros Technologies OSD2 board support
3 *
4 * Modified from original 644X-EVM board support.
5 * 2008 (c) Neuros Technology, LLC.
6 * 2009 (c) Jorge Luis Zapata Muga <jorgeluis.zapata@gmail.com>
7 * 2009 (c) Andrey A. Porodko <Andrey.Porodko@gmail.com>
8 *
9 * The Neuros OSD 2.0 is the hardware component of the Neuros Open
10 * Internet Television Platform. Hardware is very close to TI
11 * DM644X-EVM board. It has:
12 * DM6446M02 module with 256MB NAND, 256MB RAM, TLV320AIC32 AIC,
13 * USB, Ethernet, SD/MMC, UART, THS8200, TVP7000 for video.
14 * Additionaly realtime clock, IR remote control receiver,
15 * IR Blaster based on MSP430 (firmware although is different
16 * from used in DM644X-EVM), internal ATA-6 3.5” HDD drive
17 * with PATA interface, two muxed red-green leds.
18 *
19 * For more information please refer to
20 * http://wiki.neurostechnology.com/index.php/OSD_2.0_HD
21 *
22 * This file is licensed under the terms of the GNU General Public
23 * License version 2. This program is licensed "as is" without any
24 * warranty of any kind, whether express or implied.
25 */
26#include <linux/platform_device.h>
27#include <linux/gpio.h>
28#include <linux/mtd/partitions.h>
29
30#include <asm/mach-types.h>
31#include <asm/mach/arch.h>
32
33#include <mach/dm644x.h>
34#include <mach/i2c.h>
35#include <mach/serial.h>
36#include <mach/mux.h>
37#include <mach/nand.h>
38#include <mach/mmc.h>
39#include <mach/usb.h>
40
41#define NEUROS_OSD2_PHY_MASK 0x2
42#define NEUROS_OSD2_MDIO_FREQUENCY 2200000 /* PHY bus frequency */
43
44#define DAVINCI_CFC_ATA_BASE 0x01C66000
45
46#define DAVINCI_ASYNC_EMIF_CONTROL_BASE 0x01e00000
47#define DAVINCI_ASYNC_EMIF_DATA_CE0_BASE 0x02000000
48
49#define LXT971_PHY_ID 0x001378e2
50#define LXT971_PHY_MASK 0xfffffff0
51
52#define NTOSD2_AUDIOSOC_I2C_ADDR 0x18
53#define NTOSD2_MSP430_I2C_ADDR 0x59
54#define NTOSD2_MSP430_IRQ 2
55
56/* Neuros OSD2 has a Samsung 256 MByte NAND flash (Dev ID of 0xAA,
57 * 2048 blocks in the device, 64 pages per block, 2048 bytes per
58 * page.
59 */
60
61#define NAND_BLOCK_SIZE SZ_128K
62
63struct mtd_partition davinci_ntosd2_nandflash_partition[] = {
64 {
65 /* UBL (a few copies) plus U-Boot */
66 .name = "bootloader",
67 .offset = 0,
68 .size = 15 * NAND_BLOCK_SIZE,
69 .mask_flags = MTD_WRITEABLE, /* force read-only */
70 }, {
71 /* U-Boot environment */
72 .name = "params",
73 .offset = MTDPART_OFS_APPEND,
74 .size = 1 * NAND_BLOCK_SIZE,
75 .mask_flags = 0,
76 }, {
77 /* Kernel */
78 .name = "kernel",
79 .offset = MTDPART_OFS_APPEND,
80 .size = SZ_4M,
81 .mask_flags = 0,
82 }, {
83 /* File System */
84 .name = "filesystem",
85 .offset = MTDPART_OFS_APPEND,
86 .size = MTDPART_SIZ_FULL,
87 .mask_flags = 0,
88 }
89 /* A few blocks at end hold a flash Bad Block Table. */
90};
91
92static struct davinci_nand_pdata davinci_ntosd2_nandflash_data = {
93 .parts = davinci_ntosd2_nandflash_partition,
94 .nr_parts = ARRAY_SIZE(davinci_ntosd2_nandflash_partition),
95 .ecc_mode = NAND_ECC_HW,
96 .options = NAND_USE_FLASH_BBT,
97};
98
99static struct resource davinci_ntosd2_nandflash_resource[] = {
100 {
101 .start = DAVINCI_ASYNC_EMIF_DATA_CE0_BASE,
102 .end = DAVINCI_ASYNC_EMIF_DATA_CE0_BASE + SZ_16M - 1,
103 .flags = IORESOURCE_MEM,
104 }, {
105 .start = DAVINCI_ASYNC_EMIF_CONTROL_BASE,
106 .end = DAVINCI_ASYNC_EMIF_CONTROL_BASE + SZ_4K - 1,
107 .flags = IORESOURCE_MEM,
108 },
109};
110
111static struct platform_device davinci_ntosd2_nandflash_device = {
112 .name = "davinci_nand",
113 .id = 0,
114 .dev = {
115 .platform_data = &davinci_ntosd2_nandflash_data,
116 },
117 .num_resources = ARRAY_SIZE(davinci_ntosd2_nandflash_resource),
118 .resource = davinci_ntosd2_nandflash_resource,
119};
120
121static u64 davinci_fb_dma_mask = DMA_BIT_MASK(32);
122
123static struct platform_device davinci_fb_device = {
124 .name = "davincifb",
125 .id = -1,
126 .dev = {
127 .dma_mask = &davinci_fb_dma_mask,
128 .coherent_dma_mask = DMA_BIT_MASK(32),
129 },
130 .num_resources = 0,
131};
132
133static struct resource ide_resources[] = {
134 {
135 .start = DAVINCI_CFC_ATA_BASE,
136 .end = DAVINCI_CFC_ATA_BASE + 0x7ff,
137 .flags = IORESOURCE_MEM,
138 },
139 {
140 .start = IRQ_IDE,
141 .end = IRQ_IDE,
142 .flags = IORESOURCE_IRQ,
143 },
144};
145
146static u64 ide_dma_mask = DMA_BIT_MASK(32);
147
148static struct platform_device ide_dev = {
149 .name = "palm_bk3710",
150 .id = -1,
151 .resource = ide_resources,
152 .num_resources = ARRAY_SIZE(ide_resources),
153 .dev = {
154 .dma_mask = &ide_dma_mask,
155 .coherent_dma_mask = DMA_BIT_MASK(32),
156 },
157};
158
159static struct snd_platform_data dm644x_ntosd2_snd_data;
160
161static struct gpio_led ntosd2_leds[] = {
162 { .name = "led1_green", .gpio = GPIO(10), },
163 { .name = "led1_red", .gpio = GPIO(11), },
164 { .name = "led2_green", .gpio = GPIO(12), },
165 { .name = "led2_red", .gpio = GPIO(13), },
166};
167
168static struct gpio_led_platform_data ntosd2_leds_data = {
169 .num_leds = ARRAY_SIZE(ntosd2_leds),
170 .leds = ntosd2_leds,
171};
172
173static struct platform_device ntosd2_leds_dev = {
174 .name = "leds-gpio",
175 .id = -1,
176 .dev = {
177 .platform_data = &ntosd2_leds_data,
178 },
179};
180
181
182static struct platform_device *davinci_ntosd2_devices[] __initdata = {
183 &davinci_fb_device,
184 &ntosd2_leds_dev,
185};
186
187static struct davinci_uart_config uart_config __initdata = {
188 .enabled_uarts = (1 << 0),
189};
190
191static void __init davinci_ntosd2_map_io(void)
192{
193 dm644x_init();
194}
195
196/*
197 I2C initialization
198*/
199static struct davinci_i2c_platform_data ntosd2_i2c_pdata = {
200 .bus_freq = 20 /* kHz */,
201 .bus_delay = 100 /* usec */,
202};
203
204static struct i2c_board_info __initdata ntosd2_i2c_info[] = {
205};
206
207static int ntosd2_init_i2c(void)
208{
209 int status;
210
211 davinci_init_i2c(&ntosd2_i2c_pdata);
212 status = gpio_request(NTOSD2_MSP430_IRQ, ntosd2_i2c_info[0].type);
213 if (status == 0) {
214 status = gpio_direction_input(NTOSD2_MSP430_IRQ);
215 if (status == 0) {
216 status = gpio_to_irq(NTOSD2_MSP430_IRQ);
217 if (status > 0) {
218 ntosd2_i2c_info[0].irq = status;
219 i2c_register_board_info(1,
220 ntosd2_i2c_info,
221 ARRAY_SIZE(ntosd2_i2c_info));
222 }
223 }
224 }
225 return status;
226}
227
228static struct davinci_mmc_config davinci_ntosd2_mmc_config = {
229 .wires = 4,
230 .version = MMC_CTLR_VERSION_1
231};
232
233
234#if defined(CONFIG_BLK_DEV_PALMCHIP_BK3710) || \
235 defined(CONFIG_BLK_DEV_PALMCHIP_BK3710_MODULE)
236#define HAS_ATA 1
237#else
238#define HAS_ATA 0
239#endif
240
241#if defined(CONFIG_MTD_NAND_DAVINCI) || \
242 defined(CONFIG_MTD_NAND_DAVINCI_MODULE)
243#define HAS_NAND 1
244#else
245#define HAS_NAND 0
246#endif
247
248static __init void davinci_ntosd2_init(void)
249{
250 struct clk *aemif_clk;
251 struct davinci_soc_info *soc_info = &davinci_soc_info;
252 int status;
253
254 aemif_clk = clk_get(NULL, "aemif");
255 clk_enable(aemif_clk);
256
257 if (HAS_ATA) {
258 if (HAS_NAND)
259 pr_warning("WARNING: both IDE and Flash are "
260 "enabled, but they share AEMIF pins.\n"
261 "\tDisable IDE for NAND/NOR support.\n");
262 davinci_cfg_reg(DM644X_HPIEN_DISABLE);
263 davinci_cfg_reg(DM644X_ATAEN);
264 davinci_cfg_reg(DM644X_HDIREN);
265 platform_device_register(&ide_dev);
266 } else if (HAS_NAND) {
267 davinci_cfg_reg(DM644X_HPIEN_DISABLE);
268 davinci_cfg_reg(DM644X_ATAEN_DISABLE);
269
270 /* only one device will be jumpered and detected */
271 if (HAS_NAND)
272 platform_device_register(
273 &davinci_ntosd2_nandflash_device);
274 }
275
276 platform_add_devices(davinci_ntosd2_devices,
277 ARRAY_SIZE(davinci_ntosd2_devices));
278
279 /* Initialize I2C interface specific for this board */
280 status = ntosd2_init_i2c();
281 if (status < 0)
282 pr_warning("davinci_ntosd2_init: msp430 irq setup failed:"
283 " %d\n", status);
284
285 davinci_serial_init(&uart_config);
286 dm644x_init_asp(&dm644x_ntosd2_snd_data);
287
288 soc_info->emac_pdata->phy_mask = NEUROS_OSD2_PHY_MASK;
289 soc_info->emac_pdata->mdio_max_freq = NEUROS_OSD2_MDIO_FREQUENCY;
290
291 davinci_setup_usb(1000, 8);
292 /*
293 * Mux the pins to be GPIOs, VLYNQEN is already done at startup.
294 * The AEAWx are five new AEAW pins that can be muxed by separately.
295 * They are a bitmask for GPIO management. According TI
296 * documentation (http://www.ti.com/lit/gpn/tms320dm6446) to employ
297 * gpio(10,11,12,13) for leds any combination of bits works except
298 * four last. So we are to reset all five.
299 */
300 davinci_cfg_reg(DM644X_AEAW0);
301 davinci_cfg_reg(DM644X_AEAW1);
302 davinci_cfg_reg(DM644X_AEAW2);
303 davinci_cfg_reg(DM644X_AEAW3);
304 davinci_cfg_reg(DM644X_AEAW4);
305
306 davinci_setup_mmc(0, &davinci_ntosd2_mmc_config);
307}
308
309static __init void davinci_ntosd2_irq_init(void)
310{
311 davinci_irq_init();
312}
313
314MACHINE_START(NEUROS_OSD2, "Neuros OSD2")
315 /* Maintainer: Neuros Technologies <neuros@groups.google.com> */
316 .phys_io = IO_PHYS,
317 .io_pg_offst = (__IO_ADDRESS(IO_PHYS) >> 18) & 0xfffc,
318 .boot_params = (DAVINCI_DDR_BASE + 0x100),
319 .map_io = davinci_ntosd2_map_io,
320 .init_irq = davinci_ntosd2_irq_init,
321 .timer = &davinci_timer,
322 .init_machine = davinci_ntosd2_init,
323MACHINE_END
diff --git a/arch/arm/mach-davinci/board-sffsdr.c b/arch/arm/mach-davinci/board-sffsdr.c
index 7acdfd8ac071..08d373bfcc8a 100644
--- a/arch/arm/mach-davinci/board-sffsdr.c
+++ b/arch/arm/mach-davinci/board-sffsdr.c
@@ -23,35 +23,24 @@
23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 */ 24 */
25 25
26#include <linux/kernel.h>
27#include <linux/module.h>
28#include <linux/init.h> 26#include <linux/init.h>
29#include <linux/dma-mapping.h>
30#include <linux/platform_device.h> 27#include <linux/platform_device.h>
31#include <linux/gpio.h>
32
33#include <linux/i2c.h> 28#include <linux/i2c.h>
34#include <linux/i2c/at24.h> 29#include <linux/i2c/at24.h>
35#include <linux/etherdevice.h>
36#include <linux/mtd/mtd.h> 30#include <linux/mtd/mtd.h>
37#include <linux/mtd/nand.h> 31#include <linux/mtd/nand.h>
38#include <linux/mtd/partitions.h> 32#include <linux/mtd/partitions.h>
39#include <linux/mtd/physmap.h>
40#include <linux/io.h>
41 33
42#include <asm/setup.h>
43#include <asm/mach-types.h> 34#include <asm/mach-types.h>
44
45#include <asm/mach/arch.h> 35#include <asm/mach/arch.h>
46#include <asm/mach/map.h>
47#include <asm/mach/flash.h> 36#include <asm/mach/flash.h>
48 37
49#include <mach/dm644x.h> 38#include <mach/dm644x.h>
50#include <mach/common.h> 39#include <mach/common.h>
51#include <mach/i2c.h> 40#include <mach/i2c.h>
52#include <mach/serial.h> 41#include <mach/serial.h>
53#include <mach/psc.h>
54#include <mach/mux.h> 42#include <mach/mux.h>
43#include <mach/usb.h>
55 44
56#define SFFSDR_PHY_MASK (0x2) 45#define SFFSDR_PHY_MASK (0x2)
57#define SFFSDR_MDIO_FREQUENCY (2200000) /* PHY bus frequency */ 46#define SFFSDR_MDIO_FREQUENCY (2200000) /* PHY bus frequency */
@@ -107,11 +96,6 @@ static struct platform_device davinci_sffsdr_nandflash_device = {
107 .resource = davinci_sffsdr_nandflash_resource, 96 .resource = davinci_sffsdr_nandflash_resource,
108}; 97};
109 98
110static struct emac_platform_data sffsdr_emac_pdata = {
111 .phy_mask = SFFSDR_PHY_MASK,
112 .mdio_max_freq = SFFSDR_MDIO_FREQUENCY,
113};
114
115static struct at24_platform_data eeprom_info = { 99static struct at24_platform_data eeprom_info = {
116 .byte_len = (64*1024) / 8, 100 .byte_len = (64*1024) / 8,
117 .page_size = 32, 101 .page_size = 32,
@@ -164,7 +148,7 @@ static __init void davinci_sffsdr_init(void)
164 davinci_serial_init(&uart_config); 148 davinci_serial_init(&uart_config);
165 soc_info->emac_pdata->phy_mask = SFFSDR_PHY_MASK; 149 soc_info->emac_pdata->phy_mask = SFFSDR_PHY_MASK;
166 soc_info->emac_pdata->mdio_max_freq = SFFSDR_MDIO_FREQUENCY; 150 soc_info->emac_pdata->mdio_max_freq = SFFSDR_MDIO_FREQUENCY;
167 setup_usb(0, 0); /* We support only peripheral mode. */ 151 davinci_setup_usb(0, 0); /* We support only peripheral mode. */
168 152
169 /* mux VLYNQ pins */ 153 /* mux VLYNQ pins */
170 davinci_cfg_reg(DM644X_VLYNQEN); 154 davinci_cfg_reg(DM644X_VLYNQEN);
diff --git a/arch/arm/mach-davinci/clock.c b/arch/arm/mach-davinci/clock.c
index 83d54d50b5ea..baece65cb9c0 100644
--- a/arch/arm/mach-davinci/clock.c
+++ b/arch/arm/mach-davinci/clock.c
@@ -17,8 +17,8 @@
17#include <linux/clk.h> 17#include <linux/clk.h>
18#include <linux/err.h> 18#include <linux/err.h>
19#include <linux/mutex.h> 19#include <linux/mutex.h>
20#include <linux/platform_device.h>
21#include <linux/io.h> 20#include <linux/io.h>
21#include <linux/delay.h>
22 22
23#include <mach/hardware.h> 23#include <mach/hardware.h>
24 24
@@ -42,8 +42,7 @@ static void __clk_enable(struct clk *clk)
42 if (clk->parent) 42 if (clk->parent)
43 __clk_enable(clk->parent); 43 __clk_enable(clk->parent);
44 if (clk->usecount++ == 0 && (clk->flags & CLK_PSC)) 44 if (clk->usecount++ == 0 && (clk->flags & CLK_PSC))
45 davinci_psc_config(psc_domain(clk), clk->psc_ctlr, 45 davinci_psc_config(psc_domain(clk), clk->gpsc, clk->lpsc, 1);
46 clk->lpsc, 1);
47} 46}
48 47
49static void __clk_disable(struct clk *clk) 48static void __clk_disable(struct clk *clk)
@@ -51,8 +50,7 @@ static void __clk_disable(struct clk *clk)
51 if (WARN_ON(clk->usecount == 0)) 50 if (WARN_ON(clk->usecount == 0))
52 return; 51 return;
53 if (--clk->usecount == 0 && !(clk->flags & CLK_PLL)) 52 if (--clk->usecount == 0 && !(clk->flags & CLK_PLL))
54 davinci_psc_config(psc_domain(clk), clk->psc_ctlr, 53 davinci_psc_config(psc_domain(clk), clk->gpsc, clk->lpsc, 0);
55 clk->lpsc, 0);
56 if (clk->parent) 54 if (clk->parent)
57 __clk_disable(clk->parent); 55 __clk_disable(clk->parent);
58} 56}
@@ -99,20 +97,74 @@ long clk_round_rate(struct clk *clk, unsigned long rate)
99 if (clk == NULL || IS_ERR(clk)) 97 if (clk == NULL || IS_ERR(clk))
100 return -EINVAL; 98 return -EINVAL;
101 99
100 if (clk->round_rate)
101 return clk->round_rate(clk, rate);
102
102 return clk->rate; 103 return clk->rate;
103} 104}
104EXPORT_SYMBOL(clk_round_rate); 105EXPORT_SYMBOL(clk_round_rate);
105 106
107/* Propagate rate to children */
108static void propagate_rate(struct clk *root)
109{
110 struct clk *clk;
111
112 list_for_each_entry(clk, &root->children, childnode) {
113 if (clk->recalc)
114 clk->rate = clk->recalc(clk);
115 propagate_rate(clk);
116 }
117}
118
106int clk_set_rate(struct clk *clk, unsigned long rate) 119int clk_set_rate(struct clk *clk, unsigned long rate)
107{ 120{
121 unsigned long flags;
122 int ret = -EINVAL;
123
108 if (clk == NULL || IS_ERR(clk)) 124 if (clk == NULL || IS_ERR(clk))
109 return -EINVAL; 125 return ret;
110 126
111 /* changing the clk rate is not supported */ 127 spin_lock_irqsave(&clockfw_lock, flags);
112 return -EINVAL; 128 if (clk->set_rate)
129 ret = clk->set_rate(clk, rate);
130 if (ret == 0) {
131 if (clk->recalc)
132 clk->rate = clk->recalc(clk);
133 propagate_rate(clk);
134 }
135 spin_unlock_irqrestore(&clockfw_lock, flags);
136
137 return ret;
113} 138}
114EXPORT_SYMBOL(clk_set_rate); 139EXPORT_SYMBOL(clk_set_rate);
115 140
141int clk_set_parent(struct clk *clk, struct clk *parent)
142{
143 unsigned long flags;
144
145 if (clk == NULL || IS_ERR(clk))
146 return -EINVAL;
147
148 /* Cannot change parent on enabled clock */
149 if (WARN_ON(clk->usecount))
150 return -EINVAL;
151
152 mutex_lock(&clocks_mutex);
153 clk->parent = parent;
154 list_del_init(&clk->childnode);
155 list_add(&clk->childnode, &clk->parent->children);
156 mutex_unlock(&clocks_mutex);
157
158 spin_lock_irqsave(&clockfw_lock, flags);
159 if (clk->recalc)
160 clk->rate = clk->recalc(clk);
161 propagate_rate(clk);
162 spin_unlock_irqrestore(&clockfw_lock, flags);
163
164 return 0;
165}
166EXPORT_SYMBOL(clk_set_parent);
167
116int clk_register(struct clk *clk) 168int clk_register(struct clk *clk)
117{ 169{
118 if (clk == NULL || IS_ERR(clk)) 170 if (clk == NULL || IS_ERR(clk))
@@ -123,16 +175,24 @@ int clk_register(struct clk *clk)
123 clk->name, clk->parent->name)) 175 clk->name, clk->parent->name))
124 return -EINVAL; 176 return -EINVAL;
125 177
178 INIT_LIST_HEAD(&clk->children);
179
126 mutex_lock(&clocks_mutex); 180 mutex_lock(&clocks_mutex);
127 list_add_tail(&clk->node, &clocks); 181 list_add_tail(&clk->node, &clocks);
182 if (clk->parent)
183 list_add_tail(&clk->childnode, &clk->parent->children);
128 mutex_unlock(&clocks_mutex); 184 mutex_unlock(&clocks_mutex);
129 185
130 /* If rate is already set, use it */ 186 /* If rate is already set, use it */
131 if (clk->rate) 187 if (clk->rate)
132 return 0; 188 return 0;
133 189
190 /* Else, see if there is a way to calculate it */
191 if (clk->recalc)
192 clk->rate = clk->recalc(clk);
193
134 /* Otherwise, default to parent rate */ 194 /* Otherwise, default to parent rate */
135 if (clk->parent) 195 else if (clk->parent)
136 clk->rate = clk->parent->rate; 196 clk->rate = clk->parent->rate;
137 197
138 return 0; 198 return 0;
@@ -146,6 +206,7 @@ void clk_unregister(struct clk *clk)
146 206
147 mutex_lock(&clocks_mutex); 207 mutex_lock(&clocks_mutex);
148 list_del(&clk->node); 208 list_del(&clk->node);
209 list_del(&clk->childnode);
149 mutex_unlock(&clocks_mutex); 210 mutex_unlock(&clocks_mutex);
150} 211}
151EXPORT_SYMBOL(clk_unregister); 212EXPORT_SYMBOL(clk_unregister);
@@ -166,11 +227,11 @@ static int __init clk_disable_unused(void)
166 continue; 227 continue;
167 228
168 /* ignore if in Disabled or SwRstDisable states */ 229 /* ignore if in Disabled or SwRstDisable states */
169 if (!davinci_psc_is_clk_active(ck->psc_ctlr, ck->lpsc)) 230 if (!davinci_psc_is_clk_active(ck->gpsc, ck->lpsc))
170 continue; 231 continue;
171 232
172 pr_info("Clocks: disable unused %s\n", ck->name); 233 pr_info("Clocks: disable unused %s\n", ck->name);
173 davinci_psc_config(psc_domain(ck), ck->psc_ctlr, ck->lpsc, 0); 234 davinci_psc_config(psc_domain(ck), ck->gpsc, ck->lpsc, 0);
174 } 235 }
175 spin_unlock_irq(&clockfw_lock); 236 spin_unlock_irq(&clockfw_lock);
176 237
@@ -179,50 +240,62 @@ static int __init clk_disable_unused(void)
179late_initcall(clk_disable_unused); 240late_initcall(clk_disable_unused);
180#endif 241#endif
181 242
182static void clk_sysclk_recalc(struct clk *clk) 243static unsigned long clk_sysclk_recalc(struct clk *clk)
183{ 244{
184 u32 v, plldiv; 245 u32 v, plldiv;
185 struct pll_data *pll; 246 struct pll_data *pll;
247 unsigned long rate = clk->rate;
186 248
187 /* If this is the PLL base clock, no more calculations needed */ 249 /* If this is the PLL base clock, no more calculations needed */
188 if (clk->pll_data) 250 if (clk->pll_data)
189 return; 251 return rate;
190 252
191 if (WARN_ON(!clk->parent)) 253 if (WARN_ON(!clk->parent))
192 return; 254 return rate;
193 255
194 clk->rate = clk->parent->rate; 256 rate = clk->parent->rate;
195 257
196 /* Otherwise, the parent must be a PLL */ 258 /* Otherwise, the parent must be a PLL */
197 if (WARN_ON(!clk->parent->pll_data)) 259 if (WARN_ON(!clk->parent->pll_data))
198 return; 260 return rate;
199 261
200 pll = clk->parent->pll_data; 262 pll = clk->parent->pll_data;
201 263
202 /* If pre-PLL, source clock is before the multiplier and divider(s) */ 264 /* If pre-PLL, source clock is before the multiplier and divider(s) */
203 if (clk->flags & PRE_PLL) 265 if (clk->flags & PRE_PLL)
204 clk->rate = pll->input_rate; 266 rate = pll->input_rate;
205 267
206 if (!clk->div_reg) 268 if (!clk->div_reg)
207 return; 269 return rate;
208 270
209 v = __raw_readl(pll->base + clk->div_reg); 271 v = __raw_readl(pll->base + clk->div_reg);
210 if (v & PLLDIV_EN) { 272 if (v & PLLDIV_EN) {
211 plldiv = (v & PLLDIV_RATIO_MASK) + 1; 273 plldiv = (v & PLLDIV_RATIO_MASK) + 1;
212 if (plldiv) 274 if (plldiv)
213 clk->rate /= plldiv; 275 rate /= plldiv;
214 } 276 }
277
278 return rate;
279}
280
281static unsigned long clk_leafclk_recalc(struct clk *clk)
282{
283 if (WARN_ON(!clk->parent))
284 return clk->rate;
285
286 return clk->parent->rate;
215} 287}
216 288
217static void __init clk_pll_init(struct clk *clk) 289static unsigned long clk_pllclk_recalc(struct clk *clk)
218{ 290{
219 u32 ctrl, mult = 1, prediv = 1, postdiv = 1; 291 u32 ctrl, mult = 1, prediv = 1, postdiv = 1;
220 u8 bypass; 292 u8 bypass;
221 struct pll_data *pll = clk->pll_data; 293 struct pll_data *pll = clk->pll_data;
294 unsigned long rate = clk->rate;
222 295
223 pll->base = IO_ADDRESS(pll->phys_base); 296 pll->base = IO_ADDRESS(pll->phys_base);
224 ctrl = __raw_readl(pll->base + PLLCTL); 297 ctrl = __raw_readl(pll->base + PLLCTL);
225 clk->rate = pll->input_rate = clk->parent->rate; 298 rate = pll->input_rate = clk->parent->rate;
226 299
227 if (ctrl & PLLCTL_PLLEN) { 300 if (ctrl & PLLCTL_PLLEN) {
228 bypass = 0; 301 bypass = 0;
@@ -255,9 +328,9 @@ static void __init clk_pll_init(struct clk *clk)
255 } 328 }
256 329
257 if (!bypass) { 330 if (!bypass) {
258 clk->rate /= prediv; 331 rate /= prediv;
259 clk->rate *= mult; 332 rate *= mult;
260 clk->rate /= postdiv; 333 rate /= postdiv;
261 } 334 }
262 335
263 pr_debug("PLL%d: input = %lu MHz [ ", 336 pr_debug("PLL%d: input = %lu MHz [ ",
@@ -270,8 +343,90 @@ static void __init clk_pll_init(struct clk *clk)
270 pr_debug("* %d ", mult); 343 pr_debug("* %d ", mult);
271 if (postdiv > 1) 344 if (postdiv > 1)
272 pr_debug("/ %d ", postdiv); 345 pr_debug("/ %d ", postdiv);
273 pr_debug("] --> %lu MHz output.\n", clk->rate / 1000000); 346 pr_debug("] --> %lu MHz output.\n", rate / 1000000);
347
348 return rate;
349}
350
351/**
352 * davinci_set_pllrate - set the output rate of a given PLL.
353 *
354 * Note: Currently tested to work with OMAP-L138 only.
355 *
356 * @pll: pll whose rate needs to be changed.
357 * @prediv: The pre divider value. Passing 0 disables the pre-divider.
358 * @pllm: The multiplier value. Passing 0 leads to multiply-by-one.
359 * @postdiv: The post divider value. Passing 0 disables the post-divider.
360 */
361int davinci_set_pllrate(struct pll_data *pll, unsigned int prediv,
362 unsigned int mult, unsigned int postdiv)
363{
364 u32 ctrl;
365 unsigned int locktime;
366
367 if (pll->base == NULL)
368 return -EINVAL;
369
370 /*
371 * PLL lock time required per OMAP-L138 datasheet is
372 * (2000 * prediv)/sqrt(pllm) OSCIN cycles. We approximate sqrt(pllm)
373 * as 4 and OSCIN cycle as 25 MHz.
374 */
375 if (prediv) {
376 locktime = ((2000 * prediv) / 100);
377 prediv = (prediv - 1) | PLLDIV_EN;
378 } else {
379 locktime = 20;
380 }
381 if (postdiv)
382 postdiv = (postdiv - 1) | PLLDIV_EN;
383 if (mult)
384 mult = mult - 1;
385
386 ctrl = __raw_readl(pll->base + PLLCTL);
387
388 /* Switch the PLL to bypass mode */
389 ctrl &= ~(PLLCTL_PLLENSRC | PLLCTL_PLLEN);
390 __raw_writel(ctrl, pll->base + PLLCTL);
391
392 /*
393 * Wait for 4 OSCIN/CLKIN cycles to ensure that the PLLC has switched
394 * to bypass mode. Delay of 1us ensures we are good for all > 4MHz
395 * OSCIN/CLKIN inputs. Typically the input is ~25MHz.
396 */
397 udelay(1);
398
399 /* Reset and enable PLL */
400 ctrl &= ~(PLLCTL_PLLRST | PLLCTL_PLLDIS);
401 __raw_writel(ctrl, pll->base + PLLCTL);
402
403 if (pll->flags & PLL_HAS_PREDIV)
404 __raw_writel(prediv, pll->base + PREDIV);
405
406 __raw_writel(mult, pll->base + PLLM);
407
408 if (pll->flags & PLL_HAS_POSTDIV)
409 __raw_writel(postdiv, pll->base + POSTDIV);
410
411 /*
412 * Wait for PLL to reset properly, OMAP-L138 datasheet says
413 * 'min' time = 125ns
414 */
415 udelay(1);
416
417 /* Bring PLL out of reset */
418 ctrl |= PLLCTL_PLLRST;
419 __raw_writel(ctrl, pll->base + PLLCTL);
420
421 udelay(locktime);
422
423 /* Remove PLL from bypass mode */
424 ctrl |= PLLCTL_PLLEN;
425 __raw_writel(ctrl, pll->base + PLLCTL);
426
427 return 0;
274} 428}
429EXPORT_SYMBOL(davinci_set_pllrate);
275 430
276int __init davinci_clk_init(struct davinci_clk *clocks) 431int __init davinci_clk_init(struct davinci_clk *clocks)
277 { 432 {
@@ -281,12 +436,23 @@ int __init davinci_clk_init(struct davinci_clk *clocks)
281 for (c = clocks; c->lk.clk; c++) { 436 for (c = clocks; c->lk.clk; c++) {
282 clk = c->lk.clk; 437 clk = c->lk.clk;
283 438
284 if (clk->pll_data) 439 if (!clk->recalc) {
285 clk_pll_init(clk); 440
441 /* Check if clock is a PLL */
442 if (clk->pll_data)
443 clk->recalc = clk_pllclk_recalc;
444
445 /* Else, if it is a PLL-derived clock */
446 else if (clk->flags & CLK_PLL)
447 clk->recalc = clk_sysclk_recalc;
448
449 /* Otherwise, it is a leaf clock (PSC clock) */
450 else if (clk->parent)
451 clk->recalc = clk_leafclk_recalc;
452 }
286 453
287 /* Calculate rates for PLL-derived clocks */ 454 if (clk->recalc)
288 else if (clk->flags & CLK_PLL) 455 clk->rate = clk->recalc(clk);
289 clk_sysclk_recalc(clk);
290 456
291 if (clk->lpsc) 457 if (clk->lpsc)
292 clk->flags |= CLK_PSC; 458 clk->flags |= CLK_PSC;
@@ -352,9 +518,8 @@ dump_clock(struct seq_file *s, unsigned nest, struct clk *parent)
352 /* REVISIT show device associations too */ 518 /* REVISIT show device associations too */
353 519
354 /* cost is now small, but not linear... */ 520 /* cost is now small, but not linear... */
355 list_for_each_entry(clk, &clocks, node) { 521 list_for_each_entry(clk, &parent->children, childnode) {
356 if (clk->parent == parent) 522 dump_clock(s, nest + NEST_DELTA, clk);
357 dump_clock(s, nest + NEST_DELTA, clk);
358 } 523 }
359} 524}
360 525
diff --git a/arch/arm/mach-davinci/clock.h b/arch/arm/mach-davinci/clock.h
index 27233cb4a2fb..c92d77a3008d 100644
--- a/arch/arm/mach-davinci/clock.h
+++ b/arch/arm/mach-davinci/clock.h
@@ -22,6 +22,10 @@
22/* PLL/Reset register offsets */ 22/* PLL/Reset register offsets */
23#define PLLCTL 0x100 23#define PLLCTL 0x100
24#define PLLCTL_PLLEN BIT(0) 24#define PLLCTL_PLLEN BIT(0)
25#define PLLCTL_PLLPWRDN BIT(1)
26#define PLLCTL_PLLRST BIT(3)
27#define PLLCTL_PLLDIS BIT(4)
28#define PLLCTL_PLLENSRC BIT(5)
25#define PLLCTL_CLKMODE BIT(8) 29#define PLLCTL_CLKMODE BIT(8)
26 30
27#define PLLM 0x110 31#define PLLM 0x110
@@ -65,15 +69,20 @@ struct clk {
65 const char *name; 69 const char *name;
66 unsigned long rate; 70 unsigned long rate;
67 u8 usecount; 71 u8 usecount;
68 u8 flags;
69 u8 lpsc; 72 u8 lpsc;
70 u8 psc_ctlr; 73 u8 gpsc;
74 u32 flags;
71 struct clk *parent; 75 struct clk *parent;
76 struct list_head children; /* list of children */
77 struct list_head childnode; /* parent's child list node */
72 struct pll_data *pll_data; 78 struct pll_data *pll_data;
73 u32 div_reg; 79 u32 div_reg;
80 unsigned long (*recalc) (struct clk *);
81 int (*set_rate) (struct clk *clk, unsigned long rate);
82 int (*round_rate) (struct clk *clk, unsigned long rate);
74}; 83};
75 84
76/* Clock flags */ 85/* Clock flags: SoC-specific flags start at BIT(16) */
77#define ALWAYS_ENABLED BIT(1) 86#define ALWAYS_ENABLED BIT(1)
78#define CLK_PSC BIT(2) 87#define CLK_PSC BIT(2)
79#define PSC_DSP BIT(3) /* PSC uses DSP domain, not ARM */ 88#define PSC_DSP BIT(3) /* PSC uses DSP domain, not ARM */
@@ -94,6 +103,8 @@ struct davinci_clk {
94 } 103 }
95 104
96int davinci_clk_init(struct davinci_clk *clocks); 105int davinci_clk_init(struct davinci_clk *clocks);
106int davinci_set_pllrate(struct pll_data *pll, unsigned int prediv,
107 unsigned int mult, unsigned int postdiv);
97 108
98extern struct platform_device davinci_wdt_device; 109extern struct platform_device davinci_wdt_device;
99 110
diff --git a/arch/arm/mach-davinci/common.c b/arch/arm/mach-davinci/common.c
index 61ede19c6b54..c2de94cde56a 100644
--- a/arch/arm/mach-davinci/common.c
+++ b/arch/arm/mach-davinci/common.c
@@ -86,6 +86,8 @@ void __init davinci_common_init(struct davinci_soc_info *soc_info)
86 dip = davinci_get_id(davinci_soc_info.jtag_id); 86 dip = davinci_get_id(davinci_soc_info.jtag_id);
87 if (!dip) { 87 if (!dip) {
88 ret = -EINVAL; 88 ret = -EINVAL;
89 pr_err("Unknown DaVinci JTAG ID 0x%x\n",
90 davinci_soc_info.jtag_id);
89 goto err; 91 goto err;
90 } 92 }
91 93
@@ -104,5 +106,5 @@ void __init davinci_common_init(struct davinci_soc_info *soc_info)
104 return; 106 return;
105 107
106err: 108err:
107 pr_err("davinci_common_init: SoC Initialization failed\n"); 109 panic("davinci_common_init: SoC Initialization failed\n");
108} 110}
diff --git a/arch/arm/mach-davinci/cp_intc.c b/arch/arm/mach-davinci/cp_intc.c
index 96c8e97a7deb..52b287cf3a42 100644
--- a/arch/arm/mach-davinci/cp_intc.c
+++ b/arch/arm/mach-davinci/cp_intc.c
@@ -10,9 +10,6 @@
10 */ 10 */
11 11
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/sched.h>
14#include <linux/interrupt.h>
15#include <linux/kernel.h>
16#include <linux/irq.h> 13#include <linux/irq.h>
17#include <linux/io.h> 14#include <linux/io.h>
18 15
diff --git a/arch/arm/mach-davinci/cpufreq.c b/arch/arm/mach-davinci/cpufreq.c
new file mode 100644
index 000000000000..d3fa6de1e20f
--- /dev/null
+++ b/arch/arm/mach-davinci/cpufreq.c
@@ -0,0 +1,226 @@
1/*
2 * CPU frequency scaling for DaVinci
3 *
4 * Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/
5 *
6 * Based on linux/arch/arm/plat-omap/cpu-omap.c. Original Copyright follows:
7 *
8 * Copyright (C) 2005 Nokia Corporation
9 * Written by Tony Lindgren <tony@atomide.com>
10 *
11 * Based on cpu-sa1110.c, Copyright (C) 2001 Russell King
12 *
13 * Copyright (C) 2007-2008 Texas Instruments, Inc.
14 * Updated to support OMAP3
15 * Rajendra Nayak <rnayak@ti.com>
16 *
17 * This program is free software; you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License version 2 as
19 * published by the Free Software Foundation.
20 */
21#include <linux/types.h>
22#include <linux/cpufreq.h>
23#include <linux/init.h>
24#include <linux/err.h>
25#include <linux/clk.h>
26#include <linux/platform_device.h>
27
28#include <mach/hardware.h>
29#include <mach/cpufreq.h>
30#include <mach/common.h>
31
32#include "clock.h"
33
34struct davinci_cpufreq {
35 struct device *dev;
36 struct clk *armclk;
37};
38static struct davinci_cpufreq cpufreq;
39
40static int davinci_verify_speed(struct cpufreq_policy *policy)
41{
42 struct davinci_cpufreq_config *pdata = cpufreq.dev->platform_data;
43 struct cpufreq_frequency_table *freq_table = pdata->freq_table;
44 struct clk *armclk = cpufreq.armclk;
45
46 if (freq_table)
47 return cpufreq_frequency_table_verify(policy, freq_table);
48
49 if (policy->cpu)
50 return -EINVAL;
51
52 cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq,
53 policy->cpuinfo.max_freq);
54
55 policy->min = clk_round_rate(armclk, policy->min * 1000) / 1000;
56 policy->max = clk_round_rate(armclk, policy->max * 1000) / 1000;
57 cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq,
58 policy->cpuinfo.max_freq);
59 return 0;
60}
61
62static unsigned int davinci_getspeed(unsigned int cpu)
63{
64 if (cpu)
65 return 0;
66
67 return clk_get_rate(cpufreq.armclk) / 1000;
68}
69
70static int davinci_target(struct cpufreq_policy *policy,
71 unsigned int target_freq, unsigned int relation)
72{
73 int ret = 0;
74 unsigned int idx;
75 struct cpufreq_freqs freqs;
76 struct davinci_cpufreq_config *pdata = cpufreq.dev->platform_data;
77 struct clk *armclk = cpufreq.armclk;
78
79 /*
80 * Ensure desired rate is within allowed range. Some govenors
81 * (ondemand) will just pass target_freq=0 to get the minimum.
82 */
83 if (target_freq < policy->cpuinfo.min_freq)
84 target_freq = policy->cpuinfo.min_freq;
85 if (target_freq > policy->cpuinfo.max_freq)
86 target_freq = policy->cpuinfo.max_freq;
87
88 freqs.old = davinci_getspeed(0);
89 freqs.new = clk_round_rate(armclk, target_freq * 1000) / 1000;
90 freqs.cpu = 0;
91
92 if (freqs.old == freqs.new)
93 return ret;
94
95 cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER,
96 dev_driver_string(cpufreq.dev),
97 "transition: %u --> %u\n", freqs.old, freqs.new);
98
99 ret = cpufreq_frequency_table_target(policy, pdata->freq_table,
100 freqs.new, relation, &idx);
101 if (ret)
102 return -EINVAL;
103
104 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
105
106 /* if moving to higher frequency, up the voltage beforehand */
107 if (pdata->set_voltage && freqs.new > freqs.old)
108 pdata->set_voltage(idx);
109
110 ret = clk_set_rate(armclk, idx);
111
112 /* if moving to lower freq, lower the voltage after lowering freq */
113 if (pdata->set_voltage && freqs.new < freqs.old)
114 pdata->set_voltage(idx);
115
116 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
117
118 return ret;
119}
120
121static int __init davinci_cpu_init(struct cpufreq_policy *policy)
122{
123 int result = 0;
124 struct davinci_cpufreq_config *pdata = cpufreq.dev->platform_data;
125 struct cpufreq_frequency_table *freq_table = pdata->freq_table;
126
127 if (policy->cpu != 0)
128 return -EINVAL;
129
130 /* Finish platform specific initialization */
131 if (pdata->init) {
132 result = pdata->init();
133 if (result)
134 return result;
135 }
136
137 policy->cur = policy->min = policy->max = davinci_getspeed(0);
138
139 if (freq_table) {
140 result = cpufreq_frequency_table_cpuinfo(policy, freq_table);
141 if (!result)
142 cpufreq_frequency_table_get_attr(freq_table,
143 policy->cpu);
144 } else {
145 policy->cpuinfo.min_freq = policy->min;
146 policy->cpuinfo.max_freq = policy->max;
147 }
148
149 policy->min = policy->cpuinfo.min_freq;
150 policy->max = policy->cpuinfo.max_freq;
151 policy->cur = davinci_getspeed(0);
152
153 /*
154 * Time measurement across the target() function yields ~1500-1800us
155 * time taken with no drivers on notification list.
156 * Setting the latency to 2000 us to accomodate addition of drivers
157 * to pre/post change notification list.
158 */
159 policy->cpuinfo.transition_latency = 2000 * 1000;
160 return 0;
161}
162
163static int davinci_cpu_exit(struct cpufreq_policy *policy)
164{
165 cpufreq_frequency_table_put_attr(policy->cpu);
166 return 0;
167}
168
169static struct freq_attr *davinci_cpufreq_attr[] = {
170 &cpufreq_freq_attr_scaling_available_freqs,
171 NULL,
172};
173
174static struct cpufreq_driver davinci_driver = {
175 .flags = CPUFREQ_STICKY,
176 .verify = davinci_verify_speed,
177 .target = davinci_target,
178 .get = davinci_getspeed,
179 .init = davinci_cpu_init,
180 .exit = davinci_cpu_exit,
181 .name = "davinci",
182 .attr = davinci_cpufreq_attr,
183};
184
185static int __init davinci_cpufreq_probe(struct platform_device *pdev)
186{
187 struct davinci_cpufreq_config *pdata = pdev->dev.platform_data;
188
189 if (!pdata)
190 return -EINVAL;
191 if (!pdata->freq_table)
192 return -EINVAL;
193
194 cpufreq.dev = &pdev->dev;
195
196 cpufreq.armclk = clk_get(NULL, "arm");
197 if (IS_ERR(cpufreq.armclk)) {
198 dev_err(cpufreq.dev, "Unable to get ARM clock\n");
199 return PTR_ERR(cpufreq.armclk);
200 }
201
202 return cpufreq_register_driver(&davinci_driver);
203}
204
205static int __exit davinci_cpufreq_remove(struct platform_device *pdev)
206{
207 clk_put(cpufreq.armclk);
208
209 return cpufreq_unregister_driver(&davinci_driver);
210}
211
212static struct platform_driver davinci_cpufreq_driver = {
213 .driver = {
214 .name = "cpufreq-davinci",
215 .owner = THIS_MODULE,
216 },
217 .remove = __exit_p(davinci_cpufreq_remove),
218};
219
220static int __init davinci_cpufreq_init(void)
221{
222 return platform_driver_probe(&davinci_cpufreq_driver,
223 davinci_cpufreq_probe);
224}
225late_initcall(davinci_cpufreq_init);
226
diff --git a/arch/arm/mach-davinci/cpuidle.c b/arch/arm/mach-davinci/cpuidle.c
new file mode 100644
index 000000000000..97a90f36fc92
--- /dev/null
+++ b/arch/arm/mach-davinci/cpuidle.c
@@ -0,0 +1,197 @@
1/*
2 * CPU idle for DaVinci SoCs
3 *
4 * Copyright (C) 2009 Texas Instruments Incorporated. http://www.ti.com/
5 *
6 * Derived from Marvell Kirkwood CPU idle code
7 * (arch/arm/mach-kirkwood/cpuidle.c)
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 version 2 as
11 * published by the Free Software Foundation.
12 */
13
14#include <linux/kernel.h>
15#include <linux/init.h>
16#include <linux/platform_device.h>
17#include <linux/cpuidle.h>
18#include <linux/io.h>
19#include <asm/proc-fns.h>
20
21#include <mach/cpuidle.h>
22
23#define DAVINCI_CPUIDLE_MAX_STATES 2
24
25struct davinci_ops {
26 void (*enter) (u32 flags);
27 void (*exit) (u32 flags);
28 u32 flags;
29};
30
31/* fields in davinci_ops.flags */
32#define DAVINCI_CPUIDLE_FLAGS_DDR2_PWDN BIT(0)
33
34static struct cpuidle_driver davinci_idle_driver = {
35 .name = "cpuidle-davinci",
36 .owner = THIS_MODULE,
37};
38
39static DEFINE_PER_CPU(struct cpuidle_device, davinci_cpuidle_device);
40static void __iomem *ddr2_reg_base;
41
42#define DDR2_SDRCR_OFFSET 0xc
43#define DDR2_SRPD_BIT BIT(23)
44#define DDR2_LPMODEN_BIT BIT(31)
45
46static void davinci_save_ddr_power(int enter, bool pdown)
47{
48 u32 val;
49
50 val = __raw_readl(ddr2_reg_base + DDR2_SDRCR_OFFSET);
51
52 if (enter) {
53 if (pdown)
54 val |= DDR2_SRPD_BIT;
55 else
56 val &= ~DDR2_SRPD_BIT;
57 val |= DDR2_LPMODEN_BIT;
58 } else {
59 val &= ~(DDR2_SRPD_BIT | DDR2_LPMODEN_BIT);
60 }
61
62 __raw_writel(val, ddr2_reg_base + DDR2_SDRCR_OFFSET);
63}
64
65static void davinci_c2state_enter(u32 flags)
66{
67 davinci_save_ddr_power(1, !!(flags & DAVINCI_CPUIDLE_FLAGS_DDR2_PWDN));
68}
69
70static void davinci_c2state_exit(u32 flags)
71{
72 davinci_save_ddr_power(0, !!(flags & DAVINCI_CPUIDLE_FLAGS_DDR2_PWDN));
73}
74
75static struct davinci_ops davinci_states[DAVINCI_CPUIDLE_MAX_STATES] = {
76 [1] = {
77 .enter = davinci_c2state_enter,
78 .exit = davinci_c2state_exit,
79 },
80};
81
82/* Actual code that puts the SoC in different idle states */
83static int davinci_enter_idle(struct cpuidle_device *dev,
84 struct cpuidle_state *state)
85{
86 struct davinci_ops *ops = cpuidle_get_statedata(state);
87 struct timeval before, after;
88 int idle_time;
89
90 local_irq_disable();
91 do_gettimeofday(&before);
92
93 if (ops && ops->enter)
94 ops->enter(ops->flags);
95 /* Wait for interrupt state */
96 cpu_do_idle();
97 if (ops && ops->exit)
98 ops->exit(ops->flags);
99
100 do_gettimeofday(&after);
101 local_irq_enable();
102 idle_time = (after.tv_sec - before.tv_sec) * USEC_PER_SEC +
103 (after.tv_usec - before.tv_usec);
104 return idle_time;
105}
106
107static int __init davinci_cpuidle_probe(struct platform_device *pdev)
108{
109 int ret;
110 struct cpuidle_device *device;
111 struct davinci_cpuidle_config *pdata = pdev->dev.platform_data;
112 struct resource *ddr2_regs;
113 resource_size_t len;
114
115 device = &per_cpu(davinci_cpuidle_device, smp_processor_id());
116
117 if (!pdata) {
118 dev_err(&pdev->dev, "cannot get platform data\n");
119 return -ENOENT;
120 }
121
122 ddr2_regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
123 if (!ddr2_regs) {
124 dev_err(&pdev->dev, "cannot get DDR2 controller register base");
125 return -ENODEV;
126 }
127
128 len = resource_size(ddr2_regs);
129
130 ddr2_regs = request_mem_region(ddr2_regs->start, len, ddr2_regs->name);
131 if (!ddr2_regs)
132 return -EBUSY;
133
134 ddr2_reg_base = ioremap(ddr2_regs->start, len);
135 if (!ddr2_reg_base) {
136 ret = -ENOMEM;
137 goto ioremap_fail;
138 }
139
140 ret = cpuidle_register_driver(&davinci_idle_driver);
141 if (ret) {
142 dev_err(&pdev->dev, "failed to register driver\n");
143 goto driver_register_fail;
144 }
145
146 /* Wait for interrupt state */
147 device->states[0].enter = davinci_enter_idle;
148 device->states[0].exit_latency = 1;
149 device->states[0].target_residency = 10000;
150 device->states[0].flags = CPUIDLE_FLAG_TIME_VALID;
151 strcpy(device->states[0].name, "WFI");
152 strcpy(device->states[0].desc, "Wait for interrupt");
153
154 /* Wait for interrupt and DDR self refresh state */
155 device->states[1].enter = davinci_enter_idle;
156 device->states[1].exit_latency = 10;
157 device->states[1].target_residency = 10000;
158 device->states[1].flags = CPUIDLE_FLAG_TIME_VALID;
159 strcpy(device->states[1].name, "DDR SR");
160 strcpy(device->states[1].desc, "WFI and DDR Self Refresh");
161 if (pdata->ddr2_pdown)
162 davinci_states[1].flags |= DAVINCI_CPUIDLE_FLAGS_DDR2_PWDN;
163 cpuidle_set_statedata(&device->states[1], &davinci_states[1]);
164
165 device->state_count = DAVINCI_CPUIDLE_MAX_STATES;
166
167 ret = cpuidle_register_device(device);
168 if (ret) {
169 dev_err(&pdev->dev, "failed to register device\n");
170 goto device_register_fail;
171 }
172
173 return 0;
174
175device_register_fail:
176 cpuidle_unregister_driver(&davinci_idle_driver);
177driver_register_fail:
178 iounmap(ddr2_reg_base);
179ioremap_fail:
180 release_mem_region(ddr2_regs->start, len);
181 return ret;
182}
183
184static struct platform_driver davinci_cpuidle_driver = {
185 .driver = {
186 .name = "cpuidle-davinci",
187 .owner = THIS_MODULE,
188 },
189};
190
191static int __init davinci_cpuidle_init(void)
192{
193 return platform_driver_probe(&davinci_cpuidle_driver,
194 davinci_cpuidle_probe);
195}
196device_initcall(davinci_cpuidle_init);
197
diff --git a/arch/arm/mach-davinci/da830.c b/arch/arm/mach-davinci/da830.c
index 19b2748357fc..b22b5cf04250 100644
--- a/arch/arm/mach-davinci/da830.c
+++ b/arch/arm/mach-davinci/da830.c
@@ -8,22 +8,17 @@
8 * is licensed "as is" without any warranty of any kind, whether express 8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied. 9 * or implied.
10 */ 10 */
11#include <linux/kernel.h>
12#include <linux/init.h> 11#include <linux/init.h>
13#include <linux/clk.h> 12#include <linux/clk.h>
14#include <linux/platform_device.h>
15 13
16#include <asm/mach/map.h> 14#include <asm/mach/map.h>
17 15
18#include <mach/clock.h>
19#include <mach/psc.h> 16#include <mach/psc.h>
20#include <mach/mux.h>
21#include <mach/irqs.h> 17#include <mach/irqs.h>
22#include <mach/cputype.h> 18#include <mach/cputype.h>
23#include <mach/common.h> 19#include <mach/common.h>
24#include <mach/time.h> 20#include <mach/time.h>
25#include <mach/da8xx.h> 21#include <mach/da8xx.h>
26#include <mach/asp.h>
27 22
28#include "clock.h" 23#include "clock.h"
29#include "mux.h" 24#include "mux.h"
@@ -193,14 +188,14 @@ static struct clk uart1_clk = {
193 .name = "uart1", 188 .name = "uart1",
194 .parent = &pll0_sysclk2, 189 .parent = &pll0_sysclk2,
195 .lpsc = DA8XX_LPSC1_UART1, 190 .lpsc = DA8XX_LPSC1_UART1,
196 .psc_ctlr = 1, 191 .gpsc = 1,
197}; 192};
198 193
199static struct clk uart2_clk = { 194static struct clk uart2_clk = {
200 .name = "uart2", 195 .name = "uart2",
201 .parent = &pll0_sysclk2, 196 .parent = &pll0_sysclk2,
202 .lpsc = DA8XX_LPSC1_UART2, 197 .lpsc = DA8XX_LPSC1_UART2,
203 .psc_ctlr = 1, 198 .gpsc = 1,
204}; 199};
205 200
206static struct clk spi0_clk = { 201static struct clk spi0_clk = {
@@ -213,98 +208,98 @@ static struct clk spi1_clk = {
213 .name = "spi1", 208 .name = "spi1",
214 .parent = &pll0_sysclk2, 209 .parent = &pll0_sysclk2,
215 .lpsc = DA8XX_LPSC1_SPI1, 210 .lpsc = DA8XX_LPSC1_SPI1,
216 .psc_ctlr = 1, 211 .gpsc = 1,
217}; 212};
218 213
219static struct clk ecap0_clk = { 214static struct clk ecap0_clk = {
220 .name = "ecap0", 215 .name = "ecap0",
221 .parent = &pll0_sysclk2, 216 .parent = &pll0_sysclk2,
222 .lpsc = DA8XX_LPSC1_ECAP, 217 .lpsc = DA8XX_LPSC1_ECAP,
223 .psc_ctlr = 1, 218 .gpsc = 1,
224}; 219};
225 220
226static struct clk ecap1_clk = { 221static struct clk ecap1_clk = {
227 .name = "ecap1", 222 .name = "ecap1",
228 .parent = &pll0_sysclk2, 223 .parent = &pll0_sysclk2,
229 .lpsc = DA8XX_LPSC1_ECAP, 224 .lpsc = DA8XX_LPSC1_ECAP,
230 .psc_ctlr = 1, 225 .gpsc = 1,
231}; 226};
232 227
233static struct clk ecap2_clk = { 228static struct clk ecap2_clk = {
234 .name = "ecap2", 229 .name = "ecap2",
235 .parent = &pll0_sysclk2, 230 .parent = &pll0_sysclk2,
236 .lpsc = DA8XX_LPSC1_ECAP, 231 .lpsc = DA8XX_LPSC1_ECAP,
237 .psc_ctlr = 1, 232 .gpsc = 1,
238}; 233};
239 234
240static struct clk pwm0_clk = { 235static struct clk pwm0_clk = {
241 .name = "pwm0", 236 .name = "pwm0",
242 .parent = &pll0_sysclk2, 237 .parent = &pll0_sysclk2,
243 .lpsc = DA8XX_LPSC1_PWM, 238 .lpsc = DA8XX_LPSC1_PWM,
244 .psc_ctlr = 1, 239 .gpsc = 1,
245}; 240};
246 241
247static struct clk pwm1_clk = { 242static struct clk pwm1_clk = {
248 .name = "pwm1", 243 .name = "pwm1",
249 .parent = &pll0_sysclk2, 244 .parent = &pll0_sysclk2,
250 .lpsc = DA8XX_LPSC1_PWM, 245 .lpsc = DA8XX_LPSC1_PWM,
251 .psc_ctlr = 1, 246 .gpsc = 1,
252}; 247};
253 248
254static struct clk pwm2_clk = { 249static struct clk pwm2_clk = {
255 .name = "pwm2", 250 .name = "pwm2",
256 .parent = &pll0_sysclk2, 251 .parent = &pll0_sysclk2,
257 .lpsc = DA8XX_LPSC1_PWM, 252 .lpsc = DA8XX_LPSC1_PWM,
258 .psc_ctlr = 1, 253 .gpsc = 1,
259}; 254};
260 255
261static struct clk eqep0_clk = { 256static struct clk eqep0_clk = {
262 .name = "eqep0", 257 .name = "eqep0",
263 .parent = &pll0_sysclk2, 258 .parent = &pll0_sysclk2,
264 .lpsc = DA830_LPSC1_EQEP, 259 .lpsc = DA830_LPSC1_EQEP,
265 .psc_ctlr = 1, 260 .gpsc = 1,
266}; 261};
267 262
268static struct clk eqep1_clk = { 263static struct clk eqep1_clk = {
269 .name = "eqep1", 264 .name = "eqep1",
270 .parent = &pll0_sysclk2, 265 .parent = &pll0_sysclk2,
271 .lpsc = DA830_LPSC1_EQEP, 266 .lpsc = DA830_LPSC1_EQEP,
272 .psc_ctlr = 1, 267 .gpsc = 1,
273}; 268};
274 269
275static struct clk lcdc_clk = { 270static struct clk lcdc_clk = {
276 .name = "lcdc", 271 .name = "lcdc",
277 .parent = &pll0_sysclk2, 272 .parent = &pll0_sysclk2,
278 .lpsc = DA8XX_LPSC1_LCDC, 273 .lpsc = DA8XX_LPSC1_LCDC,
279 .psc_ctlr = 1, 274 .gpsc = 1,
280}; 275};
281 276
282static struct clk mcasp0_clk = { 277static struct clk mcasp0_clk = {
283 .name = "mcasp0", 278 .name = "mcasp0",
284 .parent = &pll0_sysclk2, 279 .parent = &pll0_sysclk2,
285 .lpsc = DA8XX_LPSC1_McASP0, 280 .lpsc = DA8XX_LPSC1_McASP0,
286 .psc_ctlr = 1, 281 .gpsc = 1,
287}; 282};
288 283
289static struct clk mcasp1_clk = { 284static struct clk mcasp1_clk = {
290 .name = "mcasp1", 285 .name = "mcasp1",
291 .parent = &pll0_sysclk2, 286 .parent = &pll0_sysclk2,
292 .lpsc = DA830_LPSC1_McASP1, 287 .lpsc = DA830_LPSC1_McASP1,
293 .psc_ctlr = 1, 288 .gpsc = 1,
294}; 289};
295 290
296static struct clk mcasp2_clk = { 291static struct clk mcasp2_clk = {
297 .name = "mcasp2", 292 .name = "mcasp2",
298 .parent = &pll0_sysclk2, 293 .parent = &pll0_sysclk2,
299 .lpsc = DA830_LPSC1_McASP2, 294 .lpsc = DA830_LPSC1_McASP2,
300 .psc_ctlr = 1, 295 .gpsc = 1,
301}; 296};
302 297
303static struct clk usb20_clk = { 298static struct clk usb20_clk = {
304 .name = "usb20", 299 .name = "usb20",
305 .parent = &pll0_sysclk2, 300 .parent = &pll0_sysclk2,
306 .lpsc = DA8XX_LPSC1_USB20, 301 .lpsc = DA8XX_LPSC1_USB20,
307 .psc_ctlr = 1, 302 .gpsc = 1,
308}; 303};
309 304
310static struct clk aemif_clk = { 305static struct clk aemif_clk = {
@@ -332,36 +327,36 @@ static struct clk emac_clk = {
332 .name = "emac", 327 .name = "emac",
333 .parent = &pll0_sysclk4, 328 .parent = &pll0_sysclk4,
334 .lpsc = DA8XX_LPSC1_CPGMAC, 329 .lpsc = DA8XX_LPSC1_CPGMAC,
335 .psc_ctlr = 1, 330 .gpsc = 1,
336}; 331};
337 332
338static struct clk gpio_clk = { 333static struct clk gpio_clk = {
339 .name = "gpio", 334 .name = "gpio",
340 .parent = &pll0_sysclk4, 335 .parent = &pll0_sysclk4,
341 .lpsc = DA8XX_LPSC1_GPIO, 336 .lpsc = DA8XX_LPSC1_GPIO,
342 .psc_ctlr = 1, 337 .gpsc = 1,
343}; 338};
344 339
345static struct clk i2c1_clk = { 340static struct clk i2c1_clk = {
346 .name = "i2c1", 341 .name = "i2c1",
347 .parent = &pll0_sysclk4, 342 .parent = &pll0_sysclk4,
348 .lpsc = DA8XX_LPSC1_I2C, 343 .lpsc = DA8XX_LPSC1_I2C,
349 .psc_ctlr = 1, 344 .gpsc = 1,
350}; 345};
351 346
352static struct clk usb11_clk = { 347static struct clk usb11_clk = {
353 .name = "usb11", 348 .name = "usb11",
354 .parent = &pll0_sysclk4, 349 .parent = &pll0_sysclk4,
355 .lpsc = DA8XX_LPSC1_USB11, 350 .lpsc = DA8XX_LPSC1_USB11,
356 .psc_ctlr = 1, 351 .gpsc = 1,
357}; 352};
358 353
359static struct clk emif3_clk = { 354static struct clk emif3_clk = {
360 .name = "emif3", 355 .name = "emif3",
361 .parent = &pll0_sysclk5, 356 .parent = &pll0_sysclk5,
362 .lpsc = DA8XX_LPSC1_EMIF3C, 357 .lpsc = DA8XX_LPSC1_EMIF3C,
358 .gpsc = 1,
363 .flags = ALWAYS_ENABLED, 359 .flags = ALWAYS_ENABLED,
364 .psc_ctlr = 1,
365}; 360};
366 361
367static struct clk arm_clk = { 362static struct clk arm_clk = {
@@ -411,7 +406,7 @@ static struct davinci_clk da830_clks[] = {
411 CLK(NULL, "pwm2", &pwm2_clk), 406 CLK(NULL, "pwm2", &pwm2_clk),
412 CLK("eqep.0", NULL, &eqep0_clk), 407 CLK("eqep.0", NULL, &eqep0_clk),
413 CLK("eqep.1", NULL, &eqep1_clk), 408 CLK("eqep.1", NULL, &eqep1_clk),
414 CLK("da830_lcdc", NULL, &lcdc_clk), 409 CLK("da8xx_lcdc.0", NULL, &lcdc_clk),
415 CLK("davinci-mcasp.0", NULL, &mcasp0_clk), 410 CLK("davinci-mcasp.0", NULL, &mcasp0_clk),
416 CLK("davinci-mcasp.1", NULL, &mcasp1_clk), 411 CLK("davinci-mcasp.1", NULL, &mcasp1_clk),
417 CLK("davinci-mcasp.2", NULL, &mcasp2_clk), 412 CLK("davinci-mcasp.2", NULL, &mcasp2_clk),
@@ -1143,7 +1138,21 @@ static struct davinci_id da830_ids[] = {
1143 .part_no = 0xb7df, 1138 .part_no = 0xb7df,
1144 .manufacturer = 0x017, /* 0x02f >> 1 */ 1139 .manufacturer = 0x017, /* 0x02f >> 1 */
1145 .cpu_id = DAVINCI_CPU_ID_DA830, 1140 .cpu_id = DAVINCI_CPU_ID_DA830,
1146 .name = "da830/omap l137", 1141 .name = "da830/omap-l137 rev1.0",
1142 },
1143 {
1144 .variant = 0x8,
1145 .part_no = 0xb7df,
1146 .manufacturer = 0x017,
1147 .cpu_id = DAVINCI_CPU_ID_DA830,
1148 .name = "da830/omap-l137 rev1.1",
1149 },
1150 {
1151 .variant = 0x9,
1152 .part_no = 0xb7df,
1153 .manufacturer = 0x017,
1154 .cpu_id = DAVINCI_CPU_ID_DA830,
1155 .name = "da830/omap-l137 rev2.0",
1147 }, 1156 },
1148}; 1157};
1149 1158
@@ -1178,13 +1187,11 @@ static struct davinci_timer_info da830_timer_info = {
1178static struct davinci_soc_info davinci_soc_info_da830 = { 1187static struct davinci_soc_info davinci_soc_info_da830 = {
1179 .io_desc = da830_io_desc, 1188 .io_desc = da830_io_desc,
1180 .io_desc_num = ARRAY_SIZE(da830_io_desc), 1189 .io_desc_num = ARRAY_SIZE(da830_io_desc),
1181 .jtag_id_base = IO_ADDRESS(DA8XX_JTAG_ID_REG),
1182 .ids = da830_ids, 1190 .ids = da830_ids,
1183 .ids_num = ARRAY_SIZE(da830_ids), 1191 .ids_num = ARRAY_SIZE(da830_ids),
1184 .cpu_clks = da830_clks, 1192 .cpu_clks = da830_clks,
1185 .psc_bases = da830_psc_bases, 1193 .psc_bases = da830_psc_bases,
1186 .psc_bases_num = ARRAY_SIZE(da830_psc_bases), 1194 .psc_bases_num = ARRAY_SIZE(da830_psc_bases),
1187 .pinmux_base = IO_ADDRESS(DA8XX_BOOT_CFG_BASE + 0x120),
1188 .pinmux_pins = da830_pins, 1195 .pinmux_pins = da830_pins,
1189 .pinmux_pins_num = ARRAY_SIZE(da830_pins), 1196 .pinmux_pins_num = ARRAY_SIZE(da830_pins),
1190 .intc_base = (void __iomem *)DA8XX_CP_INTC_VIRT, 1197 .intc_base = (void __iomem *)DA8XX_CP_INTC_VIRT,
@@ -1201,5 +1208,13 @@ static struct davinci_soc_info davinci_soc_info_da830 = {
1201 1208
1202void __init da830_init(void) 1209void __init da830_init(void)
1203{ 1210{
1211 da8xx_syscfg_base = ioremap(DA8XX_SYSCFG_BASE, SZ_4K);
1212 if (WARN(!da8xx_syscfg_base, "Unable to map syscfg module"))
1213 return;
1214
1215 davinci_soc_info_da830.jtag_id_base =
1216 DA8XX_SYSCFG_VIRT(DA8XX_JTAG_ID_REG);
1217 davinci_soc_info_da830.pinmux_base = DA8XX_SYSCFG_VIRT(0x120);
1218
1204 davinci_common_init(&davinci_soc_info_da830); 1219 davinci_common_init(&davinci_soc_info_da830);
1205} 1220}
diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c
index 192d719a47df..717806c6cef9 100644
--- a/arch/arm/mach-davinci/da850.c
+++ b/arch/arm/mach-davinci/da850.c
@@ -11,31 +11,41 @@
11 * is licensed "as is" without any warranty of any kind, whether express 11 * is licensed "as is" without any warranty of any kind, whether express
12 * or implied. 12 * or implied.
13 */ 13 */
14#include <linux/kernel.h>
15#include <linux/init.h> 14#include <linux/init.h>
16#include <linux/clk.h> 15#include <linux/clk.h>
17#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17#include <linux/cpufreq.h>
18#include <linux/regulator/consumer.h>
18 19
19#include <asm/mach/map.h> 20#include <asm/mach/map.h>
20 21
21#include <mach/clock.h>
22#include <mach/psc.h> 22#include <mach/psc.h>
23#include <mach/mux.h>
24#include <mach/irqs.h> 23#include <mach/irqs.h>
25#include <mach/cputype.h> 24#include <mach/cputype.h>
26#include <mach/common.h> 25#include <mach/common.h>
27#include <mach/time.h> 26#include <mach/time.h>
28#include <mach/da8xx.h> 27#include <mach/da8xx.h>
28#include <mach/cpufreq.h>
29 29
30#include "clock.h" 30#include "clock.h"
31#include "mux.h" 31#include "mux.h"
32 32
33/* SoC specific clock flags */
34#define DA850_CLK_ASYNC3 BIT(16)
35
33#define DA850_PLL1_BASE 0x01e1a000 36#define DA850_PLL1_BASE 0x01e1a000
34#define DA850_TIMER64P2_BASE 0x01f0c000 37#define DA850_TIMER64P2_BASE 0x01f0c000
35#define DA850_TIMER64P3_BASE 0x01f0d000 38#define DA850_TIMER64P3_BASE 0x01f0d000
36 39
37#define DA850_REF_FREQ 24000000 40#define DA850_REF_FREQ 24000000
38 41
42#define CFGCHIP3_ASYNC3_CLKSRC BIT(4)
43#define CFGCHIP0_PLL_MASTER_LOCK BIT(4)
44
45static int da850_set_armrate(struct clk *clk, unsigned long rate);
46static int da850_round_armrate(struct clk *clk, unsigned long rate);
47static int da850_set_pll0rate(struct clk *clk, unsigned long armrate);
48
39static struct pll_data pll0_data = { 49static struct pll_data pll0_data = {
40 .num = 1, 50 .num = 1,
41 .phys_base = DA8XX_PLL0_BASE, 51 .phys_base = DA8XX_PLL0_BASE,
@@ -52,6 +62,7 @@ static struct clk pll0_clk = {
52 .parent = &ref_clk, 62 .parent = &ref_clk,
53 .pll_data = &pll0_data, 63 .pll_data = &pll0_data,
54 .flags = CLK_PLL, 64 .flags = CLK_PLL,
65 .set_rate = da850_set_pll0rate,
55}; 66};
56 67
57static struct clk pll0_aux_clk = { 68static struct clk pll0_aux_clk = {
@@ -210,16 +221,16 @@ static struct clk tpcc1_clk = {
210 .name = "tpcc1", 221 .name = "tpcc1",
211 .parent = &pll0_sysclk2, 222 .parent = &pll0_sysclk2,
212 .lpsc = DA850_LPSC1_TPCC1, 223 .lpsc = DA850_LPSC1_TPCC1,
224 .gpsc = 1,
213 .flags = CLK_PSC | ALWAYS_ENABLED, 225 .flags = CLK_PSC | ALWAYS_ENABLED,
214 .psc_ctlr = 1,
215}; 226};
216 227
217static struct clk tptc2_clk = { 228static struct clk tptc2_clk = {
218 .name = "tptc2", 229 .name = "tptc2",
219 .parent = &pll0_sysclk2, 230 .parent = &pll0_sysclk2,
220 .lpsc = DA850_LPSC1_TPTC2, 231 .lpsc = DA850_LPSC1_TPTC2,
232 .gpsc = 1,
221 .flags = ALWAYS_ENABLED, 233 .flags = ALWAYS_ENABLED,
222 .psc_ctlr = 1,
223}; 234};
224 235
225static struct clk uart0_clk = { 236static struct clk uart0_clk = {
@@ -232,14 +243,16 @@ static struct clk uart1_clk = {
232 .name = "uart1", 243 .name = "uart1",
233 .parent = &pll0_sysclk2, 244 .parent = &pll0_sysclk2,
234 .lpsc = DA8XX_LPSC1_UART1, 245 .lpsc = DA8XX_LPSC1_UART1,
235 .psc_ctlr = 1, 246 .gpsc = 1,
247 .flags = DA850_CLK_ASYNC3,
236}; 248};
237 249
238static struct clk uart2_clk = { 250static struct clk uart2_clk = {
239 .name = "uart2", 251 .name = "uart2",
240 .parent = &pll0_sysclk2, 252 .parent = &pll0_sysclk2,
241 .lpsc = DA8XX_LPSC1_UART2, 253 .lpsc = DA8XX_LPSC1_UART2,
242 .psc_ctlr = 1, 254 .gpsc = 1,
255 .flags = DA850_CLK_ASYNC3,
243}; 256};
244 257
245static struct clk aintc_clk = { 258static struct clk aintc_clk = {
@@ -253,22 +266,22 @@ static struct clk gpio_clk = {
253 .name = "gpio", 266 .name = "gpio",
254 .parent = &pll0_sysclk4, 267 .parent = &pll0_sysclk4,
255 .lpsc = DA8XX_LPSC1_GPIO, 268 .lpsc = DA8XX_LPSC1_GPIO,
256 .psc_ctlr = 1, 269 .gpsc = 1,
257}; 270};
258 271
259static struct clk i2c1_clk = { 272static struct clk i2c1_clk = {
260 .name = "i2c1", 273 .name = "i2c1",
261 .parent = &pll0_sysclk4, 274 .parent = &pll0_sysclk4,
262 .lpsc = DA8XX_LPSC1_I2C, 275 .lpsc = DA8XX_LPSC1_I2C,
263 .psc_ctlr = 1, 276 .gpsc = 1,
264}; 277};
265 278
266static struct clk emif3_clk = { 279static struct clk emif3_clk = {
267 .name = "emif3", 280 .name = "emif3",
268 .parent = &pll0_sysclk5, 281 .parent = &pll0_sysclk5,
269 .lpsc = DA8XX_LPSC1_EMIF3C, 282 .lpsc = DA8XX_LPSC1_EMIF3C,
283 .gpsc = 1,
270 .flags = ALWAYS_ENABLED, 284 .flags = ALWAYS_ENABLED,
271 .psc_ctlr = 1,
272}; 285};
273 286
274static struct clk arm_clk = { 287static struct clk arm_clk = {
@@ -276,6 +289,8 @@ static struct clk arm_clk = {
276 .parent = &pll0_sysclk6, 289 .parent = &pll0_sysclk6,
277 .lpsc = DA8XX_LPSC0_ARM, 290 .lpsc = DA8XX_LPSC0_ARM,
278 .flags = ALWAYS_ENABLED, 291 .flags = ALWAYS_ENABLED,
292 .set_rate = da850_set_armrate,
293 .round_rate = da850_round_armrate,
279}; 294};
280 295
281static struct clk rmii_clk = { 296static struct clk rmii_clk = {
@@ -287,21 +302,22 @@ static struct clk emac_clk = {
287 .name = "emac", 302 .name = "emac",
288 .parent = &pll0_sysclk4, 303 .parent = &pll0_sysclk4,
289 .lpsc = DA8XX_LPSC1_CPGMAC, 304 .lpsc = DA8XX_LPSC1_CPGMAC,
290 .psc_ctlr = 1, 305 .gpsc = 1,
291}; 306};
292 307
293static struct clk mcasp_clk = { 308static struct clk mcasp_clk = {
294 .name = "mcasp", 309 .name = "mcasp",
295 .parent = &pll0_sysclk2, 310 .parent = &pll0_sysclk2,
296 .lpsc = DA8XX_LPSC1_McASP0, 311 .lpsc = DA8XX_LPSC1_McASP0,
297 .psc_ctlr = 1, 312 .gpsc = 1,
313 .flags = DA850_CLK_ASYNC3,
298}; 314};
299 315
300static struct clk lcdc_clk = { 316static struct clk lcdc_clk = {
301 .name = "lcdc", 317 .name = "lcdc",
302 .parent = &pll0_sysclk2, 318 .parent = &pll0_sysclk2,
303 .lpsc = DA8XX_LPSC1_LCDC, 319 .lpsc = DA8XX_LPSC1_LCDC,
304 .psc_ctlr = 1, 320 .gpsc = 1,
305}; 321};
306 322
307static struct clk mmcsd_clk = { 323static struct clk mmcsd_clk = {
@@ -404,6 +420,14 @@ static const struct mux_config da850_pins[] = {
404 MUX_CFG(DA850, MII_RXD_0, 3, 28, 15, 8, false) 420 MUX_CFG(DA850, MII_RXD_0, 3, 28, 15, 8, false)
405 MUX_CFG(DA850, MDIO_CLK, 4, 0, 15, 8, false) 421 MUX_CFG(DA850, MDIO_CLK, 4, 0, 15, 8, false)
406 MUX_CFG(DA850, MDIO_D, 4, 4, 15, 8, false) 422 MUX_CFG(DA850, MDIO_D, 4, 4, 15, 8, false)
423 MUX_CFG(DA850, RMII_TXD_0, 14, 12, 15, 8, false)
424 MUX_CFG(DA850, RMII_TXD_1, 14, 8, 15, 8, false)
425 MUX_CFG(DA850, RMII_TXEN, 14, 16, 15, 8, false)
426 MUX_CFG(DA850, RMII_CRS_DV, 15, 4, 15, 8, false)
427 MUX_CFG(DA850, RMII_RXD_0, 14, 24, 15, 8, false)
428 MUX_CFG(DA850, RMII_RXD_1, 14, 20, 15, 8, false)
429 MUX_CFG(DA850, RMII_RXER, 14, 28, 15, 8, false)
430 MUX_CFG(DA850, RMII_MHZ_50_CLK, 15, 0, 15, 0, false)
407 /* McASP function */ 431 /* McASP function */
408 MUX_CFG(DA850, ACLKR, 0, 0, 15, 1, false) 432 MUX_CFG(DA850, ACLKR, 0, 0, 15, 1, false)
409 MUX_CFG(DA850, ACLKX, 0, 4, 15, 1, false) 433 MUX_CFG(DA850, ACLKX, 0, 4, 15, 1, false)
@@ -506,8 +530,9 @@ static const struct mux_config da850_pins[] = {
506 MUX_CFG(DA850, EMA_WAIT_1, 6, 24, 15, 1, false) 530 MUX_CFG(DA850, EMA_WAIT_1, 6, 24, 15, 1, false)
507 MUX_CFG(DA850, NEMA_CS_2, 7, 0, 15, 1, false) 531 MUX_CFG(DA850, NEMA_CS_2, 7, 0, 15, 1, false)
508 /* GPIO function */ 532 /* GPIO function */
533 MUX_CFG(DA850, GPIO2_6, 6, 4, 15, 8, false)
534 MUX_CFG(DA850, GPIO2_8, 5, 28, 15, 8, false)
509 MUX_CFG(DA850, GPIO2_15, 5, 0, 15, 8, false) 535 MUX_CFG(DA850, GPIO2_15, 5, 0, 15, 8, false)
510 MUX_CFG(DA850, GPIO8_10, 18, 28, 15, 8, false)
511 MUX_CFG(DA850, GPIO4_0, 10, 28, 15, 8, false) 536 MUX_CFG(DA850, GPIO4_0, 10, 28, 15, 8, false)
512 MUX_CFG(DA850, GPIO4_1, 10, 24, 15, 8, false) 537 MUX_CFG(DA850, GPIO4_1, 10, 24, 15, 8, false)
513#endif 538#endif
@@ -547,6 +572,14 @@ const short da850_cpgmac_pins[] __initdata = {
547 -1 572 -1
548}; 573};
549 574
575const short da850_rmii_pins[] __initdata = {
576 DA850_RMII_TXD_0, DA850_RMII_TXD_1, DA850_RMII_TXEN,
577 DA850_RMII_CRS_DV, DA850_RMII_RXD_0, DA850_RMII_RXD_1,
578 DA850_RMII_RXER, DA850_RMII_MHZ_50_CLK, DA850_MDIO_CLK,
579 DA850_MDIO_D,
580 -1
581};
582
550const short da850_mcasp_pins[] __initdata = { 583const short da850_mcasp_pins[] __initdata = {
551 DA850_AHCLKX, DA850_ACLKX, DA850_AFSX, 584 DA850_AHCLKX, DA850_ACLKX, DA850_AFSX,
552 DA850_AHCLKR, DA850_ACLKR, DA850_AFSR, DA850_AMUTE, 585 DA850_AHCLKR, DA850_ACLKR, DA850_AFSR, DA850_AMUTE,
@@ -555,12 +588,11 @@ const short da850_mcasp_pins[] __initdata = {
555}; 588};
556 589
557const short da850_lcdcntl_pins[] __initdata = { 590const short da850_lcdcntl_pins[] __initdata = {
558 DA850_LCD_D_1, DA850_LCD_D_2, DA850_LCD_D_3, DA850_LCD_D_4, 591 DA850_LCD_D_0, DA850_LCD_D_1, DA850_LCD_D_2, DA850_LCD_D_3,
559 DA850_LCD_D_5, DA850_LCD_D_6, DA850_LCD_D_7, DA850_LCD_D_8, 592 DA850_LCD_D_4, DA850_LCD_D_5, DA850_LCD_D_6, DA850_LCD_D_7,
560 DA850_LCD_D_9, DA850_LCD_D_10, DA850_LCD_D_11, DA850_LCD_D_12, 593 DA850_LCD_D_8, DA850_LCD_D_9, DA850_LCD_D_10, DA850_LCD_D_11,
561 DA850_LCD_D_13, DA850_LCD_D_14, DA850_LCD_D_15, DA850_LCD_PCLK, 594 DA850_LCD_D_12, DA850_LCD_D_13, DA850_LCD_D_14, DA850_LCD_D_15,
562 DA850_LCD_HSYNC, DA850_LCD_VSYNC, DA850_NLCD_AC_ENB_CS, DA850_GPIO2_15, 595 DA850_LCD_PCLK, DA850_LCD_HSYNC, DA850_LCD_VSYNC, DA850_NLCD_AC_ENB_CS,
563 DA850_GPIO8_10,
564 -1 596 -1
565}; 597};
566 598
@@ -790,16 +822,221 @@ static struct davinci_timer_info da850_timer_info = {
790 .clocksource_id = T0_TOP, 822 .clocksource_id = T0_TOP,
791}; 823};
792 824
825static void da850_set_async3_src(int pllnum)
826{
827 struct clk *clk, *newparent = pllnum ? &pll1_sysclk2 : &pll0_sysclk2;
828 struct davinci_clk *c;
829 unsigned int v;
830 int ret;
831
832 for (c = da850_clks; c->lk.clk; c++) {
833 clk = c->lk.clk;
834 if (clk->flags & DA850_CLK_ASYNC3) {
835 ret = clk_set_parent(clk, newparent);
836 WARN(ret, "DA850: unable to re-parent clock %s",
837 clk->name);
838 }
839 }
840
841 v = __raw_readl(DA8XX_SYSCFG_VIRT(DA8XX_CFGCHIP3_REG));
842 if (pllnum)
843 v |= CFGCHIP3_ASYNC3_CLKSRC;
844 else
845 v &= ~CFGCHIP3_ASYNC3_CLKSRC;
846 __raw_writel(v, DA8XX_SYSCFG_VIRT(DA8XX_CFGCHIP3_REG));
847}
848
849#ifdef CONFIG_CPU_FREQ
850/*
851 * Notes:
852 * According to the TRM, minimum PLLM results in maximum power savings.
853 * The OPP definitions below should keep the PLLM as low as possible.
854 *
855 * The output of the PLLM must be between 400 to 600 MHz.
856 * This rules out prediv of anything but divide-by-one for 24Mhz OSC input.
857 */
858struct da850_opp {
859 unsigned int freq; /* in KHz */
860 unsigned int prediv;
861 unsigned int mult;
862 unsigned int postdiv;
863 unsigned int cvdd_min; /* in uV */
864 unsigned int cvdd_max; /* in uV */
865};
866
867static const struct da850_opp da850_opp_300 = {
868 .freq = 300000,
869 .prediv = 1,
870 .mult = 25,
871 .postdiv = 2,
872 .cvdd_min = 1140000,
873 .cvdd_max = 1320000,
874};
875
876static const struct da850_opp da850_opp_200 = {
877 .freq = 200000,
878 .prediv = 1,
879 .mult = 25,
880 .postdiv = 3,
881 .cvdd_min = 1050000,
882 .cvdd_max = 1160000,
883};
884
885static const struct da850_opp da850_opp_96 = {
886 .freq = 96000,
887 .prediv = 1,
888 .mult = 20,
889 .postdiv = 5,
890 .cvdd_min = 950000,
891 .cvdd_max = 1050000,
892};
893
894#define OPP(freq) \
895 { \
896 .index = (unsigned int) &da850_opp_##freq, \
897 .frequency = freq * 1000, \
898 }
899
900static struct cpufreq_frequency_table da850_freq_table[] = {
901 OPP(300),
902 OPP(200),
903 OPP(96),
904 {
905 .index = 0,
906 .frequency = CPUFREQ_TABLE_END,
907 },
908};
909
910#ifdef CONFIG_REGULATOR
911static struct regulator *cvdd;
912
913static int da850_set_voltage(unsigned int index)
914{
915 struct da850_opp *opp;
916
917 if (!cvdd)
918 return -ENODEV;
919
920 opp = (struct da850_opp *) da850_freq_table[index].index;
921
922 return regulator_set_voltage(cvdd, opp->cvdd_min, opp->cvdd_max);
923}
924
925static int da850_regulator_init(void)
926{
927 cvdd = regulator_get(NULL, "cvdd");
928 if (WARN(IS_ERR(cvdd), "Unable to obtain voltage regulator for CVDD;"
929 " voltage scaling unsupported\n")) {
930 return PTR_ERR(cvdd);
931 }
932
933 return 0;
934}
935#endif
936
937static struct davinci_cpufreq_config cpufreq_info = {
938 .freq_table = &da850_freq_table[0],
939#ifdef CONFIG_REGULATOR
940 .init = da850_regulator_init,
941 .set_voltage = da850_set_voltage,
942#endif
943};
944
945static struct platform_device da850_cpufreq_device = {
946 .name = "cpufreq-davinci",
947 .dev = {
948 .platform_data = &cpufreq_info,
949 },
950};
951
952int __init da850_register_cpufreq(void)
953{
954 return platform_device_register(&da850_cpufreq_device);
955}
956
957static int da850_round_armrate(struct clk *clk, unsigned long rate)
958{
959 int i, ret = 0, diff;
960 unsigned int best = (unsigned int) -1;
961
962 rate /= 1000; /* convert to kHz */
963
964 for (i = 0; da850_freq_table[i].frequency != CPUFREQ_TABLE_END; i++) {
965 diff = da850_freq_table[i].frequency - rate;
966 if (diff < 0)
967 diff = -diff;
968
969 if (diff < best) {
970 best = diff;
971 ret = da850_freq_table[i].frequency;
972 }
973 }
974
975 return ret * 1000;
976}
977
978static int da850_set_armrate(struct clk *clk, unsigned long index)
979{
980 struct clk *pllclk = &pll0_clk;
981
982 return clk_set_rate(pllclk, index);
983}
984
985static int da850_set_pll0rate(struct clk *clk, unsigned long index)
986{
987 unsigned int prediv, mult, postdiv;
988 struct da850_opp *opp;
989 struct pll_data *pll = clk->pll_data;
990 unsigned int v;
991 int ret;
992
993 opp = (struct da850_opp *) da850_freq_table[index].index;
994 prediv = opp->prediv;
995 mult = opp->mult;
996 postdiv = opp->postdiv;
997
998 /* Unlock writing to PLL registers */
999 v = __raw_readl(DA8XX_SYSCFG_VIRT(DA8XX_CFGCHIP0_REG));
1000 v &= ~CFGCHIP0_PLL_MASTER_LOCK;
1001 __raw_writel(v, DA8XX_SYSCFG_VIRT(DA8XX_CFGCHIP0_REG));
1002
1003 ret = davinci_set_pllrate(pll, prediv, mult, postdiv);
1004 if (WARN_ON(ret))
1005 return ret;
1006
1007 return 0;
1008}
1009#else
1010int __init da850_register_cpufreq(void)
1011{
1012 return 0;
1013}
1014
1015static int da850_set_armrate(struct clk *clk, unsigned long rate)
1016{
1017 return -EINVAL;
1018}
1019
1020static int da850_set_pll0rate(struct clk *clk, unsigned long armrate)
1021{
1022 return -EINVAL;
1023}
1024
1025static int da850_round_armrate(struct clk *clk, unsigned long rate)
1026{
1027 return clk->rate;
1028}
1029#endif
1030
1031
793static struct davinci_soc_info davinci_soc_info_da850 = { 1032static struct davinci_soc_info davinci_soc_info_da850 = {
794 .io_desc = da850_io_desc, 1033 .io_desc = da850_io_desc,
795 .io_desc_num = ARRAY_SIZE(da850_io_desc), 1034 .io_desc_num = ARRAY_SIZE(da850_io_desc),
796 .jtag_id_base = IO_ADDRESS(DA8XX_JTAG_ID_REG),
797 .ids = da850_ids, 1035 .ids = da850_ids,
798 .ids_num = ARRAY_SIZE(da850_ids), 1036 .ids_num = ARRAY_SIZE(da850_ids),
799 .cpu_clks = da850_clks, 1037 .cpu_clks = da850_clks,
800 .psc_bases = da850_psc_bases, 1038 .psc_bases = da850_psc_bases,
801 .psc_bases_num = ARRAY_SIZE(da850_psc_bases), 1039 .psc_bases_num = ARRAY_SIZE(da850_psc_bases),
802 .pinmux_base = IO_ADDRESS(DA8XX_BOOT_CFG_BASE + 0x120),
803 .pinmux_pins = da850_pins, 1040 .pinmux_pins = da850_pins,
804 .pinmux_pins_num = ARRAY_SIZE(da850_pins), 1041 .pinmux_pins_num = ARRAY_SIZE(da850_pins),
805 .intc_base = (void __iomem *)DA8XX_CP_INTC_VIRT, 1042 .intc_base = (void __iomem *)DA8XX_CP_INTC_VIRT,
@@ -816,5 +1053,22 @@ static struct davinci_soc_info davinci_soc_info_da850 = {
816 1053
817void __init da850_init(void) 1054void __init da850_init(void)
818{ 1055{
1056 da8xx_syscfg_base = ioremap(DA8XX_SYSCFG_BASE, SZ_4K);
1057 if (WARN(!da8xx_syscfg_base, "Unable to map syscfg module"))
1058 return;
1059
1060 davinci_soc_info_da850.jtag_id_base =
1061 DA8XX_SYSCFG_VIRT(DA8XX_JTAG_ID_REG);
1062 davinci_soc_info_da850.pinmux_base = DA8XX_SYSCFG_VIRT(0x120);
1063
819 davinci_common_init(&davinci_soc_info_da850); 1064 davinci_common_init(&davinci_soc_info_da850);
1065
1066 /*
1067 * Move the clock source of Async3 domain to PLL1 SYSCLK2.
1068 * This helps keeping the peripherals on this domain insulated
1069 * from CPU frequency changes caused by DVFS. The firmware sets
1070 * both PLL0 and PLL1 to the same frequency so, there should not
1071 * be any noticible change even in non-DVFS use cases.
1072 */
1073 da850_set_async3_src(1);
820} 1074}
diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c
index 58ad5b66fd60..dd2d32c4ce86 100644
--- a/arch/arm/mach-davinci/devices-da8xx.c
+++ b/arch/arm/mach-davinci/devices-da8xx.c
@@ -10,8 +10,6 @@
10 * the Free Software Foundation; either version 2 of the License, or 10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version. 11 * (at your option) any later version.
12 */ 12 */
13#include <linux/module.h>
14#include <linux/kernel.h>
15#include <linux/init.h> 13#include <linux/init.h>
16#include <linux/platform_device.h> 14#include <linux/platform_device.h>
17#include <linux/dma-mapping.h> 15#include <linux/dma-mapping.h>
@@ -21,7 +19,7 @@
21#include <mach/common.h> 19#include <mach/common.h>
22#include <mach/time.h> 20#include <mach/time.h>
23#include <mach/da8xx.h> 21#include <mach/da8xx.h>
24#include <video/da8xx-fb.h> 22#include <mach/cpuidle.h>
25 23
26#include "clock.h" 24#include "clock.h"
27 25
@@ -30,6 +28,7 @@
30#define DA8XX_TPTC1_BASE 0x01c08400 28#define DA8XX_TPTC1_BASE 0x01c08400
31#define DA8XX_WDOG_BASE 0x01c21000 /* DA8XX_TIMER64P1_BASE */ 29#define DA8XX_WDOG_BASE 0x01c21000 /* DA8XX_TIMER64P1_BASE */
32#define DA8XX_I2C0_BASE 0x01c22000 30#define DA8XX_I2C0_BASE 0x01c22000
31#define DA8XX_RTC_BASE 0x01C23000
33#define DA8XX_EMAC_CPPI_PORT_BASE 0x01e20000 32#define DA8XX_EMAC_CPPI_PORT_BASE 0x01e20000
34#define DA8XX_EMAC_CPGMACSS_BASE 0x01e22000 33#define DA8XX_EMAC_CPGMACSS_BASE 0x01e22000
35#define DA8XX_EMAC_CPGMAC_BASE 0x01e23000 34#define DA8XX_EMAC_CPGMAC_BASE 0x01e23000
@@ -43,6 +42,8 @@
43#define DA8XX_MDIO_REG_OFFSET 0x4000 42#define DA8XX_MDIO_REG_OFFSET 0x4000
44#define DA8XX_EMAC_CTRL_RAM_SIZE SZ_8K 43#define DA8XX_EMAC_CTRL_RAM_SIZE SZ_8K
45 44
45void __iomem *da8xx_syscfg_base;
46
46static struct plat_serial8250_port da8xx_serial_pdata[] = { 47static struct plat_serial8250_port da8xx_serial_pdata[] = {
47 { 48 {
48 .mapbase = DA8XX_UART0_BASE, 49 .mapbase = DA8XX_UART0_BASE,
@@ -282,6 +283,11 @@ static struct platform_device da8xx_emac_device = {
282 .resource = da8xx_emac_resources, 283 .resource = da8xx_emac_resources,
283}; 284};
284 285
286int __init da8xx_register_emac(void)
287{
288 return platform_device_register(&da8xx_emac_device);
289}
290
285static struct resource da830_mcasp1_resources[] = { 291static struct resource da830_mcasp1_resources[] = {
286 { 292 {
287 .name = "mcasp1", 293 .name = "mcasp1",
@@ -338,12 +344,7 @@ static struct platform_device da850_mcasp_device = {
338 .resource = da850_mcasp_resources, 344 .resource = da850_mcasp_resources,
339}; 345};
340 346
341int __init da8xx_register_emac(void) 347void __init da8xx_register_mcasp(int id, struct snd_platform_data *pdata)
342{
343 return platform_device_register(&da8xx_emac_device);
344}
345
346void __init da8xx_init_mcasp(int id, struct snd_platform_data *pdata)
347{ 348{
348 /* DA830/OMAP-L137 has 3 instances of McASP */ 349 /* DA830/OMAP-L137 has 3 instances of McASP */
349 if (cpu_is_davinci_da830() && id == 1) { 350 if (cpu_is_davinci_da830() && id == 1) {
@@ -379,10 +380,16 @@ static struct lcd_ctrl_config lcd_cfg = {
379 .raster_order = 0, 380 .raster_order = 0,
380}; 381};
381 382
382static struct da8xx_lcdc_platform_data da850_evm_lcdc_pdata = { 383struct da8xx_lcdc_platform_data sharp_lcd035q3dg01_pdata = {
383 .manu_name = "sharp", 384 .manu_name = "sharp",
384 .controller_data = &lcd_cfg, 385 .controller_data = &lcd_cfg,
385 .type = "Sharp_LK043T1DG01", 386 .type = "Sharp_LCD035Q3DG01",
387};
388
389struct da8xx_lcdc_platform_data sharp_lk043t1dg01_pdata = {
390 .manu_name = "sharp",
391 .controller_data = &lcd_cfg,
392 .type = "Sharp_LK043T1DG01",
386}; 393};
387 394
388static struct resource da8xx_lcdc_resources[] = { 395static struct resource da8xx_lcdc_resources[] = {
@@ -398,19 +405,17 @@ static struct resource da8xx_lcdc_resources[] = {
398 }, 405 },
399}; 406};
400 407
401static struct platform_device da850_lcdc_device = { 408static struct platform_device da8xx_lcdc_device = {
402 .name = "da8xx_lcdc", 409 .name = "da8xx_lcdc",
403 .id = 0, 410 .id = 0,
404 .num_resources = ARRAY_SIZE(da8xx_lcdc_resources), 411 .num_resources = ARRAY_SIZE(da8xx_lcdc_resources),
405 .resource = da8xx_lcdc_resources, 412 .resource = da8xx_lcdc_resources,
406 .dev = {
407 .platform_data = &da850_evm_lcdc_pdata,
408 }
409}; 413};
410 414
411int __init da8xx_register_lcdc(void) 415int __init da8xx_register_lcdc(struct da8xx_lcdc_platform_data *pdata)
412{ 416{
413 return platform_device_register(&da850_lcdc_device); 417 da8xx_lcdc_device.dev.platform_data = pdata;
418 return platform_device_register(&da8xx_lcdc_device);
414} 419}
415 420
416static struct resource da8xx_mmcsd0_resources[] = { 421static struct resource da8xx_mmcsd0_resources[] = {
@@ -448,3 +453,66 @@ int __init da8xx_register_mmcsd0(struct davinci_mmc_config *config)
448 da8xx_mmcsd0_device.dev.platform_data = config; 453 da8xx_mmcsd0_device.dev.platform_data = config;
449 return platform_device_register(&da8xx_mmcsd0_device); 454 return platform_device_register(&da8xx_mmcsd0_device);
450} 455}
456
457static struct resource da8xx_rtc_resources[] = {
458 {
459 .start = DA8XX_RTC_BASE,
460 .end = DA8XX_RTC_BASE + SZ_4K - 1,
461 .flags = IORESOURCE_MEM,
462 },
463 { /* timer irq */
464 .start = IRQ_DA8XX_RTC,
465 .end = IRQ_DA8XX_RTC,
466 .flags = IORESOURCE_IRQ,
467 },
468 { /* alarm irq */
469 .start = IRQ_DA8XX_RTC,
470 .end = IRQ_DA8XX_RTC,
471 .flags = IORESOURCE_IRQ,
472 },
473};
474
475static struct platform_device da8xx_rtc_device = {
476 .name = "omap_rtc",
477 .id = -1,
478 .num_resources = ARRAY_SIZE(da8xx_rtc_resources),
479 .resource = da8xx_rtc_resources,
480};
481
482int da8xx_register_rtc(void)
483{
484 /* Unlock the rtc's registers */
485 __raw_writel(0x83e70b13, IO_ADDRESS(DA8XX_RTC_BASE + 0x6c));
486 __raw_writel(0x95a4f1e0, IO_ADDRESS(DA8XX_RTC_BASE + 0x70));
487
488 return platform_device_register(&da8xx_rtc_device);
489}
490
491static struct resource da8xx_cpuidle_resources[] = {
492 {
493 .start = DA8XX_DDR2_CTL_BASE,
494 .end = DA8XX_DDR2_CTL_BASE + SZ_32K - 1,
495 .flags = IORESOURCE_MEM,
496 },
497};
498
499/* DA8XX devices support DDR2 power down */
500static struct davinci_cpuidle_config da8xx_cpuidle_pdata = {
501 .ddr2_pdown = 1,
502};
503
504
505static struct platform_device da8xx_cpuidle_device = {
506 .name = "cpuidle-davinci",
507 .num_resources = ARRAY_SIZE(da8xx_cpuidle_resources),
508 .resource = da8xx_cpuidle_resources,
509 .dev = {
510 .platform_data = &da8xx_cpuidle_pdata,
511 },
512};
513
514int __init da8xx_register_cpuidle(void)
515{
516 return platform_device_register(&da8xx_cpuidle_device);
517}
518
diff --git a/arch/arm/mach-davinci/devices.c b/arch/arm/mach-davinci/devices.c
index a55b650db71e..147949650c25 100644
--- a/arch/arm/mach-davinci/devices.c
+++ b/arch/arm/mach-davinci/devices.c
@@ -9,15 +9,11 @@
9 * (at your option) any later version. 9 * (at your option) any later version.
10 */ 10 */
11 11
12#include <linux/module.h>
13#include <linux/kernel.h>
14#include <linux/init.h> 12#include <linux/init.h>
15#include <linux/platform_device.h> 13#include <linux/platform_device.h>
16#include <linux/dma-mapping.h> 14#include <linux/dma-mapping.h>
17#include <linux/io.h> 15#include <linux/io.h>
18 16
19#include <asm/mach/map.h>
20
21#include <mach/hardware.h> 17#include <mach/hardware.h>
22#include <mach/i2c.h> 18#include <mach/i2c.h>
23#include <mach/irqs.h> 19#include <mach/irqs.h>
@@ -177,7 +173,7 @@ void __init davinci_setup_mmc(int module, struct davinci_mmc_config *config)
177 mmcsd1_resources[0].start = DM365_MMCSD1_BASE; 173 mmcsd1_resources[0].start = DM365_MMCSD1_BASE;
178 mmcsd1_resources[0].end = DM365_MMCSD1_BASE + 174 mmcsd1_resources[0].end = DM365_MMCSD1_BASE +
179 SZ_4K - 1; 175 SZ_4K - 1;
180 mmcsd0_resources[2].start = IRQ_DM365_SDIOINT1; 176 mmcsd1_resources[2].start = IRQ_DM365_SDIOINT1;
181 } else 177 } else
182 break; 178 break;
183 179
diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c
index 059670018aff..dedf4d4f3a27 100644
--- a/arch/arm/mach-davinci/dm355.c
+++ b/arch/arm/mach-davinci/dm355.c
@@ -8,7 +8,6 @@
8 * is licensed "as is" without any warranty of any kind, whether express 8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied. 9 * or implied.
10 */ 10 */
11#include <linux/kernel.h>
12#include <linux/init.h> 11#include <linux/init.h>
13#include <linux/clk.h> 12#include <linux/clk.h>
14#include <linux/serial_8250.h> 13#include <linux/serial_8250.h>
@@ -21,7 +20,6 @@
21#include <asm/mach/map.h> 20#include <asm/mach/map.h>
22 21
23#include <mach/dm355.h> 22#include <mach/dm355.h>
24#include <mach/clock.h>
25#include <mach/cputype.h> 23#include <mach/cputype.h>
26#include <mach/edma.h> 24#include <mach/edma.h>
27#include <mach/psc.h> 25#include <mach/psc.h>
diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c
index e81517434703..2ec619ec1657 100644
--- a/arch/arm/mach-davinci/dm365.c
+++ b/arch/arm/mach-davinci/dm365.c
@@ -12,7 +12,6 @@
12 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details. 13 * GNU General Public License for more details.
14 */ 14 */
15#include <linux/kernel.h>
16#include <linux/init.h> 15#include <linux/init.h>
17#include <linux/clk.h> 16#include <linux/clk.h>
18#include <linux/serial_8250.h> 17#include <linux/serial_8250.h>
@@ -23,7 +22,6 @@
23#include <asm/mach/map.h> 22#include <asm/mach/map.h>
24 23
25#include <mach/dm365.h> 24#include <mach/dm365.h>
26#include <mach/clock.h>
27#include <mach/cputype.h> 25#include <mach/cputype.h>
28#include <mach/edma.h> 26#include <mach/edma.h>
29#include <mach/psc.h> 27#include <mach/psc.h>
@@ -32,6 +30,8 @@
32#include <mach/time.h> 30#include <mach/time.h>
33#include <mach/serial.h> 31#include <mach/serial.h>
34#include <mach/common.h> 32#include <mach/common.h>
33#include <mach/asp.h>
34#include <mach/keyscan.h>
35 35
36#include "clock.h" 36#include "clock.h"
37#include "mux.h" 37#include "mux.h"
@@ -369,7 +369,7 @@ static struct clk timer3_clk = {
369 369
370static struct clk usb_clk = { 370static struct clk usb_clk = {
371 .name = "usb", 371 .name = "usb",
372 .parent = &pll2_sysclk1, 372 .parent = &pll1_aux_clk,
373 .lpsc = DAVINCI_LPSC_USB, 373 .lpsc = DAVINCI_LPSC_USB,
374}; 374};
375 375
@@ -456,7 +456,7 @@ static struct davinci_clk dm365_clks[] = {
456 CLK(NULL, "usb", &usb_clk), 456 CLK(NULL, "usb", &usb_clk),
457 CLK("davinci_emac.1", NULL, &emac_clk), 457 CLK("davinci_emac.1", NULL, &emac_clk),
458 CLK("voice_codec", NULL, &voicecodec_clk), 458 CLK("voice_codec", NULL, &voicecodec_clk),
459 CLK("soc-audio.0", NULL, &asp0_clk), 459 CLK("davinci-asp.0", NULL, &asp0_clk),
460 CLK(NULL, "rto", &rto_clk), 460 CLK(NULL, "rto", &rto_clk),
461 CLK(NULL, "mjcp", &mjcp_clk), 461 CLK(NULL, "mjcp", &mjcp_clk),
462 CLK(NULL, NULL, NULL), 462 CLK(NULL, NULL, NULL),
@@ -531,7 +531,7 @@ MUX_CFG(DM365, EMAC_CRS, 3, 2, 1, 1, false)
531MUX_CFG(DM365, EMAC_MDIO, 3, 1, 1, 1, false) 531MUX_CFG(DM365, EMAC_MDIO, 3, 1, 1, 1, false)
532MUX_CFG(DM365, EMAC_MDCLK, 3, 0, 1, 1, false) 532MUX_CFG(DM365, EMAC_MDCLK, 3, 0, 1, 1, false)
533 533
534MUX_CFG(DM365, KEYPAD, 2, 0, 0x3f, 0x3f, false) 534MUX_CFG(DM365, KEYSCAN, 2, 0, 0x3f, 0x3f, false)
535 535
536MUX_CFG(DM365, PWM0, 1, 0, 3, 2, false) 536MUX_CFG(DM365, PWM0, 1, 0, 3, 2, false)
537MUX_CFG(DM365, PWM0_G23, 3, 26, 3, 3, false) 537MUX_CFG(DM365, PWM0_G23, 3, 26, 3, 3, false)
@@ -603,6 +603,9 @@ INT_CFG(DM365, INT_IMX1_ENABLE, 24, 1, 1, false)
603INT_CFG(DM365, INT_IMX1_DISABLE, 24, 1, 0, false) 603INT_CFG(DM365, INT_IMX1_DISABLE, 24, 1, 0, false)
604INT_CFG(DM365, INT_NSF_ENABLE, 25, 1, 1, false) 604INT_CFG(DM365, INT_NSF_ENABLE, 25, 1, 1, false)
605INT_CFG(DM365, INT_NSF_DISABLE, 25, 1, 0, false) 605INT_CFG(DM365, INT_NSF_DISABLE, 25, 1, 0, false)
606
607EVT_CFG(DM365, EVT2_ASP_TX, 0, 1, 0, false)
608EVT_CFG(DM365, EVT3_ASP_RX, 1, 1, 0, false)
606#endif 609#endif
607}; 610};
608 611
@@ -696,6 +699,7 @@ static u8 dm365_default_priorities[DAVINCI_N_AINTC_IRQ] = {
696 [IRQ_I2C] = 3, 699 [IRQ_I2C] = 3,
697 [IRQ_UARTINT0] = 3, 700 [IRQ_UARTINT0] = 3,
698 [IRQ_UARTINT1] = 3, 701 [IRQ_UARTINT1] = 3,
702 [IRQ_DM365_RTCINT] = 3,
699 [IRQ_DM365_SPIINT0_0] = 3, 703 [IRQ_DM365_SPIINT0_0] = 3,
700 [IRQ_DM365_SPIINT3_0] = 3, 704 [IRQ_DM365_SPIINT3_0] = 3,
701 [IRQ_DM365_GPIO0] = 3, 705 [IRQ_DM365_GPIO0] = 3,
@@ -806,6 +810,50 @@ static struct platform_device dm365_edma_device = {
806 .resource = edma_resources, 810 .resource = edma_resources,
807}; 811};
808 812
813static struct resource dm365_asp_resources[] = {
814 {
815 .start = DAVINCI_DM365_ASP0_BASE,
816 .end = DAVINCI_DM365_ASP0_BASE + SZ_8K - 1,
817 .flags = IORESOURCE_MEM,
818 },
819 {
820 .start = DAVINCI_DMA_ASP0_TX,
821 .end = DAVINCI_DMA_ASP0_TX,
822 .flags = IORESOURCE_DMA,
823 },
824 {
825 .start = DAVINCI_DMA_ASP0_RX,
826 .end = DAVINCI_DMA_ASP0_RX,
827 .flags = IORESOURCE_DMA,
828 },
829};
830
831static struct platform_device dm365_asp_device = {
832 .name = "davinci-asp",
833 .id = 0,
834 .num_resources = ARRAY_SIZE(dm365_asp_resources),
835 .resource = dm365_asp_resources,
836};
837
838static struct resource dm365_rtc_resources[] = {
839 {
840 .start = DM365_RTC_BASE,
841 .end = DM365_RTC_BASE + SZ_1K - 1,
842 .flags = IORESOURCE_MEM,
843 },
844 {
845 .start = IRQ_DM365_RTCINT,
846 .flags = IORESOURCE_IRQ,
847 },
848};
849
850static struct platform_device dm365_rtc_device = {
851 .name = "rtc_davinci",
852 .id = 0,
853 .num_resources = ARRAY_SIZE(dm365_rtc_resources),
854 .resource = dm365_rtc_resources,
855};
856
809static struct map_desc dm365_io_desc[] = { 857static struct map_desc dm365_io_desc[] = {
810 { 858 {
811 .virtual = IO_VIRT, 859 .virtual = IO_VIRT,
@@ -822,6 +870,28 @@ static struct map_desc dm365_io_desc[] = {
822 }, 870 },
823}; 871};
824 872
873static struct resource dm365_ks_resources[] = {
874 {
875 /* registers */
876 .start = DM365_KEYSCAN_BASE,
877 .end = DM365_KEYSCAN_BASE + SZ_1K - 1,
878 .flags = IORESOURCE_MEM,
879 },
880 {
881 /* interrupt */
882 .start = IRQ_DM365_KEYINT,
883 .end = IRQ_DM365_KEYINT,
884 .flags = IORESOURCE_IRQ,
885 },
886};
887
888static struct platform_device dm365_ks_device = {
889 .name = "davinci_keyscan",
890 .id = 0,
891 .num_resources = ARRAY_SIZE(dm365_ks_resources),
892 .resource = dm365_ks_resources,
893};
894
825/* Contents of JTAG ID register used to identify exact cpu type */ 895/* Contents of JTAG ID register used to identify exact cpu type */
826static struct davinci_id dm365_ids[] = { 896static struct davinci_id dm365_ids[] = {
827 { 897 {
@@ -907,6 +977,33 @@ static struct davinci_soc_info davinci_soc_info_dm365 = {
907 .sram_len = SZ_32K, 977 .sram_len = SZ_32K,
908}; 978};
909 979
980void __init dm365_init_asp(struct snd_platform_data *pdata)
981{
982 davinci_cfg_reg(DM365_MCBSP0_BDX);
983 davinci_cfg_reg(DM365_MCBSP0_X);
984 davinci_cfg_reg(DM365_MCBSP0_BFSX);
985 davinci_cfg_reg(DM365_MCBSP0_BDR);
986 davinci_cfg_reg(DM365_MCBSP0_R);
987 davinci_cfg_reg(DM365_MCBSP0_BFSR);
988 davinci_cfg_reg(DM365_EVT2_ASP_TX);
989 davinci_cfg_reg(DM365_EVT3_ASP_RX);
990 dm365_asp_device.dev.platform_data = pdata;
991 platform_device_register(&dm365_asp_device);
992}
993
994void __init dm365_init_ks(struct davinci_ks_platform_data *pdata)
995{
996 davinci_cfg_reg(DM365_KEYSCAN);
997 dm365_ks_device.dev.platform_data = pdata;
998 platform_device_register(&dm365_ks_device);
999}
1000
1001void __init dm365_init_rtc(void)
1002{
1003 davinci_cfg_reg(DM365_INT_PRTCSS);
1004 platform_device_register(&dm365_rtc_device);
1005}
1006
910void __init dm365_init(void) 1007void __init dm365_init(void)
911{ 1008{
912 davinci_common_init(&davinci_soc_info_dm365); 1009 davinci_common_init(&davinci_soc_info_dm365);
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c
index d6e0fa5a8d8a..2cd008156dea 100644
--- a/arch/arm/mach-davinci/dm644x.c
+++ b/arch/arm/mach-davinci/dm644x.c
@@ -8,7 +8,6 @@
8 * is licensed "as is" without any warranty of any kind, whether express 8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied. 9 * or implied.
10 */ 10 */
11#include <linux/kernel.h>
12#include <linux/init.h> 11#include <linux/init.h>
13#include <linux/clk.h> 12#include <linux/clk.h>
14#include <linux/serial_8250.h> 13#include <linux/serial_8250.h>
@@ -18,7 +17,6 @@
18#include <asm/mach/map.h> 17#include <asm/mach/map.h>
19 18
20#include <mach/dm644x.h> 19#include <mach/dm644x.h>
21#include <mach/clock.h>
22#include <mach/cputype.h> 20#include <mach/cputype.h>
23#include <mach/edma.h> 21#include <mach/edma.h>
24#include <mach/irqs.h> 22#include <mach/irqs.h>
@@ -370,6 +368,11 @@ MUX_CFG(DM644X, ATAEN_DISABLE, 0, 17, 1, 0, true)
370MUX_CFG(DM644X, HPIEN_DISABLE, 0, 29, 1, 0, true) 368MUX_CFG(DM644X, HPIEN_DISABLE, 0, 29, 1, 0, true)
371 369
372MUX_CFG(DM644X, AEAW, 0, 0, 31, 31, true) 370MUX_CFG(DM644X, AEAW, 0, 0, 31, 31, true)
371MUX_CFG(DM644X, AEAW0, 0, 0, 1, 0, true)
372MUX_CFG(DM644X, AEAW1, 0, 1, 1, 0, true)
373MUX_CFG(DM644X, AEAW2, 0, 2, 1, 0, true)
374MUX_CFG(DM644X, AEAW3, 0, 3, 1, 0, true)
375MUX_CFG(DM644X, AEAW4, 0, 4, 1, 0, true)
373 376
374MUX_CFG(DM644X, MSTK, 1, 9, 1, 0, false) 377MUX_CFG(DM644X, MSTK, 1, 9, 1, 0, false)
375 378
diff --git a/arch/arm/mach-davinci/dm646x.c b/arch/arm/mach-davinci/dm646x.c
index 0976049c7b3b..829a44bcf799 100644
--- a/arch/arm/mach-davinci/dm646x.c
+++ b/arch/arm/mach-davinci/dm646x.c
@@ -8,7 +8,6 @@
8 * is licensed "as is" without any warranty of any kind, whether express 8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied. 9 * or implied.
10 */ 10 */
11#include <linux/kernel.h>
12#include <linux/init.h> 11#include <linux/init.h>
13#include <linux/clk.h> 12#include <linux/clk.h>
14#include <linux/serial_8250.h> 13#include <linux/serial_8250.h>
@@ -18,7 +17,6 @@
18#include <asm/mach/map.h> 17#include <asm/mach/map.h>
19 18
20#include <mach/dm646x.h> 19#include <mach/dm646x.h>
21#include <mach/clock.h>
22#include <mach/cputype.h> 20#include <mach/cputype.h>
23#include <mach/edma.h> 21#include <mach/edma.h>
24#include <mach/irqs.h> 22#include <mach/irqs.h>
@@ -789,7 +787,14 @@ static struct davinci_id dm646x_ids[] = {
789 .part_no = 0xb770, 787 .part_no = 0xb770,
790 .manufacturer = 0x017, 788 .manufacturer = 0x017,
791 .cpu_id = DAVINCI_CPU_ID_DM6467, 789 .cpu_id = DAVINCI_CPU_ID_DM6467,
792 .name = "dm6467", 790 .name = "dm6467_rev1.x",
791 },
792 {
793 .variant = 0x1,
794 .part_no = 0xb770,
795 .manufacturer = 0x017,
796 .cpu_id = DAVINCI_CPU_ID_DM6467,
797 .name = "dm6467_rev3.x",
793 }, 798 },
794}; 799};
795 800
diff --git a/arch/arm/mach-davinci/dma.c b/arch/arm/mach-davinci/dma.c
index f2e57d272958..648fbb760ae1 100644
--- a/arch/arm/mach-davinci/dma.c
+++ b/arch/arm/mach-davinci/dma.c
@@ -18,22 +18,13 @@
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */ 19 */
20#include <linux/kernel.h> 20#include <linux/kernel.h>
21#include <linux/sched.h>
22#include <linux/init.h> 21#include <linux/init.h>
23#include <linux/module.h> 22#include <linux/module.h>
24#include <linux/interrupt.h> 23#include <linux/interrupt.h>
25#include <linux/platform_device.h> 24#include <linux/platform_device.h>
26#include <linux/spinlock.h>
27#include <linux/compiler.h>
28#include <linux/io.h> 25#include <linux/io.h>
29 26
30#include <mach/cputype.h>
31#include <mach/memory.h>
32#include <mach/hardware.h>
33#include <mach/irqs.h>
34#include <mach/edma.h> 27#include <mach/edma.h>
35#include <mach/mux.h>
36
37 28
38/* Offsets matching "struct edmacc_param" */ 29/* Offsets matching "struct edmacc_param" */
39#define PARM_OPT 0x00 30#define PARM_OPT 0x00
@@ -509,43 +500,59 @@ static irqreturn_t dma_tc1err_handler(int irq, void *data)
509 return IRQ_HANDLED; 500 return IRQ_HANDLED;
510} 501}
511 502
512static int reserve_contiguous_params(int ctlr, unsigned int id, 503static int reserve_contiguous_slots(int ctlr, unsigned int id,
513 unsigned int num_params, 504 unsigned int num_slots,
514 unsigned int start_param) 505 unsigned int start_slot)
515{ 506{
516 int i, j; 507 int i, j;
517 unsigned int count = num_params; 508 unsigned int count = num_slots;
509 int stop_slot = start_slot;
510 DECLARE_BITMAP(tmp_inuse, EDMA_MAX_PARAMENTRY);
518 511
519 for (i = start_param; i < edma_info[ctlr]->num_slots; ++i) { 512 for (i = start_slot; i < edma_info[ctlr]->num_slots; ++i) {
520 j = EDMA_CHAN_SLOT(i); 513 j = EDMA_CHAN_SLOT(i);
521 if (!test_and_set_bit(j, edma_info[ctlr]->edma_inuse)) 514 if (!test_and_set_bit(j, edma_info[ctlr]->edma_inuse)) {
515 /* Record our current beginning slot */
516 if (count == num_slots)
517 stop_slot = i;
518
522 count--; 519 count--;
520 set_bit(j, tmp_inuse);
521
523 if (count == 0) 522 if (count == 0)
524 break; 523 break;
525 else if (id == EDMA_CONT_PARAMS_FIXED_EXACT) 524 } else {
526 break; 525 clear_bit(j, tmp_inuse);
527 else 526
528 count = num_params; 527 if (id == EDMA_CONT_PARAMS_FIXED_EXACT) {
528 stop_slot = i;
529 break;
530 } else
531 count = num_slots;
532 }
529 } 533 }
530 534
531 /* 535 /*
532 * We have to clear any bits that we set 536 * We have to clear any bits that we set
533 * if we run out parameter RAMs, i.e we do find a set 537 * if we run out parameter RAM slots, i.e we do find a set
534 * of contiguous parameter RAMs but do not find the exact number 538 * of contiguous parameter RAM slots but do not find the exact number
535 * requested as we may reach the total number of parameter RAMs 539 * requested as we may reach the total number of parameter RAM slots
536 */ 540 */
537 if (count) { 541 if (i == edma_info[ctlr]->num_slots)
538 for (j = i - num_params + count + 1; j <= i ; ++j) 542 stop_slot = i;
543
544 for (j = start_slot; j < stop_slot; j++)
545 if (test_bit(j, tmp_inuse))
539 clear_bit(j, edma_info[ctlr]->edma_inuse); 546 clear_bit(j, edma_info[ctlr]->edma_inuse);
540 547
548 if (count)
541 return -EBUSY; 549 return -EBUSY;
542 }
543 550
544 for (j = i - num_params + 1; j <= i; ++j) 551 for (j = i - num_slots + 1; j <= i; ++j)
545 memcpy_toio(edmacc_regs_base[ctlr] + PARM_OFFSET(j), 552 memcpy_toio(edmacc_regs_base[ctlr] + PARM_OFFSET(j),
546 &dummy_paramset, PARM_SIZE); 553 &dummy_paramset, PARM_SIZE);
547 554
548 return EDMA_CTLR_CHAN(ctlr, i - num_params + 1); 555 return EDMA_CTLR_CHAN(ctlr, i - num_slots + 1);
549} 556}
550 557
551/*-----------------------------------------------------------------------*/ 558/*-----------------------------------------------------------------------*/
@@ -743,26 +750,27 @@ EXPORT_SYMBOL(edma_free_slot);
743/** 750/**
744 * edma_alloc_cont_slots- alloc contiguous parameter RAM slots 751 * edma_alloc_cont_slots- alloc contiguous parameter RAM slots
745 * The API will return the starting point of a set of 752 * The API will return the starting point of a set of
746 * contiguous PARAM's that have been requested 753 * contiguous parameter RAM slots that have been requested
747 * 754 *
748 * @id: can only be EDMA_CONT_PARAMS_ANY or EDMA_CONT_PARAMS_FIXED_EXACT 755 * @id: can only be EDMA_CONT_PARAMS_ANY or EDMA_CONT_PARAMS_FIXED_EXACT
749 * or EDMA_CONT_PARAMS_FIXED_NOT_EXACT 756 * or EDMA_CONT_PARAMS_FIXED_NOT_EXACT
750 * @count: number of contiguous Paramter RAM's 757 * @count: number of contiguous Paramter RAM slots
751 * @param - the start value of Parameter RAM that should be passed if id 758 * @slot - the start value of Parameter RAM slot that should be passed if id
752 * is EDMA_CONT_PARAMS_FIXED_EXACT or EDMA_CONT_PARAMS_FIXED_NOT_EXACT 759 * is EDMA_CONT_PARAMS_FIXED_EXACT or EDMA_CONT_PARAMS_FIXED_NOT_EXACT
753 * 760 *
754 * If id is EDMA_CONT_PARAMS_ANY then the API starts looking for a set of 761 * If id is EDMA_CONT_PARAMS_ANY then the API starts looking for a set of
755 * contiguous Parameter RAMs from parameter RAM 64 in the case of DaVinci SOCs 762 * contiguous Parameter RAM slots from parameter RAM 64 in the case of
756 * and 32 in the case of Primus 763 * DaVinci SOCs and 32 in the case of DA8xx SOCs.
757 * 764 *
758 * If id is EDMA_CONT_PARAMS_FIXED_EXACT then the API starts looking for a 765 * If id is EDMA_CONT_PARAMS_FIXED_EXACT then the API starts looking for a
759 * set of contiguous parameter RAMs from the "param" that is passed as an 766 * set of contiguous parameter RAM slots from the "slot" that is passed as an
760 * argument to the API. 767 * argument to the API.
761 * 768 *
762 * If id is EDMA_CONT_PARAMS_FIXED_NOT_EXACT then the API initially tries 769 * If id is EDMA_CONT_PARAMS_FIXED_NOT_EXACT then the API initially tries
763 * starts looking for a set of contiguous parameter RAMs from the "param" 770 * starts looking for a set of contiguous parameter RAMs from the "slot"
764 * that is passed as an argument to the API. On failure the API will try to 771 * that is passed as an argument to the API. On failure the API will try to
765 * find a set of contiguous Parameter RAMs in the remaining Parameter RAMs 772 * find a set of contiguous Parameter RAM slots from the remaining Parameter
773 * RAM slots
766 */ 774 */
767int edma_alloc_cont_slots(unsigned ctlr, unsigned int id, int slot, int count) 775int edma_alloc_cont_slots(unsigned ctlr, unsigned int id, int slot, int count)
768{ 776{
@@ -771,12 +779,13 @@ int edma_alloc_cont_slots(unsigned ctlr, unsigned int id, int slot, int count)
771 * the number of channels and lesser than the total number 779 * the number of channels and lesser than the total number
772 * of slots 780 * of slots
773 */ 781 */
774 if (slot < edma_info[ctlr]->num_channels || 782 if ((id != EDMA_CONT_PARAMS_ANY) &&
775 slot >= edma_info[ctlr]->num_slots) 783 (slot < edma_info[ctlr]->num_channels ||
784 slot >= edma_info[ctlr]->num_slots))
776 return -EINVAL; 785 return -EINVAL;
777 786
778 /* 787 /*
779 * The number of parameter RAMs requested cannot be less than 1 788 * The number of parameter RAM slots requested cannot be less than 1
780 * and cannot be more than the number of slots minus the number of 789 * and cannot be more than the number of slots minus the number of
781 * channels 790 * channels
782 */ 791 */
@@ -786,11 +795,11 @@ int edma_alloc_cont_slots(unsigned ctlr, unsigned int id, int slot, int count)
786 795
787 switch (id) { 796 switch (id) {
788 case EDMA_CONT_PARAMS_ANY: 797 case EDMA_CONT_PARAMS_ANY:
789 return reserve_contiguous_params(ctlr, id, count, 798 return reserve_contiguous_slots(ctlr, id, count,
790 edma_info[ctlr]->num_channels); 799 edma_info[ctlr]->num_channels);
791 case EDMA_CONT_PARAMS_FIXED_EXACT: 800 case EDMA_CONT_PARAMS_FIXED_EXACT:
792 case EDMA_CONT_PARAMS_FIXED_NOT_EXACT: 801 case EDMA_CONT_PARAMS_FIXED_NOT_EXACT:
793 return reserve_contiguous_params(ctlr, id, count, slot); 802 return reserve_contiguous_slots(ctlr, id, count, slot);
794 default: 803 default:
795 return -EINVAL; 804 return -EINVAL;
796 } 805 }
@@ -799,21 +808,21 @@ int edma_alloc_cont_slots(unsigned ctlr, unsigned int id, int slot, int count)
799EXPORT_SYMBOL(edma_alloc_cont_slots); 808EXPORT_SYMBOL(edma_alloc_cont_slots);
800 809
801/** 810/**
802 * edma_free_cont_slots - deallocate DMA parameter RAMs 811 * edma_free_cont_slots - deallocate DMA parameter RAM slots
803 * @slot: first parameter RAM of a set of parameter RAMs to be freed 812 * @slot: first parameter RAM of a set of parameter RAM slots to be freed
804 * @count: the number of contiguous parameter RAMs to be freed 813 * @count: the number of contiguous parameter RAM slots to be freed
805 * 814 *
806 * This deallocates the parameter RAM slots allocated by 815 * This deallocates the parameter RAM slots allocated by
807 * edma_alloc_cont_slots. 816 * edma_alloc_cont_slots.
808 * Callers/applications need to keep track of sets of contiguous 817 * Callers/applications need to keep track of sets of contiguous
809 * parameter RAMs that have been allocated using the edma_alloc_cont_slots 818 * parameter RAM slots that have been allocated using the edma_alloc_cont_slots
810 * API. 819 * API.
811 * Callers are responsible for ensuring the slots are inactive, and will 820 * Callers are responsible for ensuring the slots are inactive, and will
812 * not be activated. 821 * not be activated.
813 */ 822 */
814int edma_free_cont_slots(unsigned slot, int count) 823int edma_free_cont_slots(unsigned slot, int count)
815{ 824{
816 unsigned ctlr; 825 unsigned ctlr, slot_to_free;
817 int i; 826 int i;
818 827
819 ctlr = EDMA_CTLR(slot); 828 ctlr = EDMA_CTLR(slot);
@@ -826,11 +835,11 @@ int edma_free_cont_slots(unsigned slot, int count)
826 835
827 for (i = slot; i < slot + count; ++i) { 836 for (i = slot; i < slot + count; ++i) {
828 ctlr = EDMA_CTLR(i); 837 ctlr = EDMA_CTLR(i);
829 slot = EDMA_CHAN_SLOT(i); 838 slot_to_free = EDMA_CHAN_SLOT(i);
830 839
831 memcpy_toio(edmacc_regs_base[ctlr] + PARM_OFFSET(slot), 840 memcpy_toio(edmacc_regs_base[ctlr] + PARM_OFFSET(slot_to_free),
832 &dummy_paramset, PARM_SIZE); 841 &dummy_paramset, PARM_SIZE);
833 clear_bit(slot, edma_info[ctlr]->edma_inuse); 842 clear_bit(slot_to_free, edma_info[ctlr]->edma_inuse);
834 } 843 }
835 844
836 return 0; 845 return 0;
diff --git a/arch/arm/mach-davinci/gpio.c b/arch/arm/mach-davinci/gpio.c
index f6ea9db11f41..744755b53236 100644
--- a/arch/arm/mach-davinci/gpio.c
+++ b/arch/arm/mach-davinci/gpio.c
@@ -12,23 +12,14 @@
12 12
13#include <linux/errno.h> 13#include <linux/errno.h>
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/list.h>
16#include <linux/module.h>
17#include <linux/clk.h> 15#include <linux/clk.h>
18#include <linux/err.h> 16#include <linux/err.h>
19#include <linux/io.h> 17#include <linux/io.h>
20#include <linux/irq.h>
21#include <linux/bitops.h>
22 18
23#include <mach/cputype.h>
24#include <mach/irqs.h>
25#include <mach/hardware.h>
26#include <mach/common.h>
27#include <mach/gpio.h> 19#include <mach/gpio.h>
28 20
29#include <asm/mach/irq.h> 21#include <asm/mach/irq.h>
30 22
31
32static DEFINE_SPINLOCK(gpio_lock); 23static DEFINE_SPINLOCK(gpio_lock);
33 24
34struct davinci_gpio { 25struct davinci_gpio {
diff --git a/arch/arm/mach-davinci/include/mach/asp.h b/arch/arm/mach-davinci/include/mach/asp.h
index 18e4ce34ece6..834725f1e81d 100644
--- a/arch/arm/mach-davinci/include/mach/asp.h
+++ b/arch/arm/mach-davinci/include/mach/asp.h
@@ -11,6 +11,9 @@
11#define DAVINCI_ASP0_BASE 0x01E02000 11#define DAVINCI_ASP0_BASE 0x01E02000
12#define DAVINCI_ASP1_BASE 0x01E04000 12#define DAVINCI_ASP1_BASE 0x01E04000
13 13
14/* Bases of dm365 register banks */
15#define DAVINCI_DM365_ASP0_BASE 0x01D02000
16
14/* Bases of dm646x register banks */ 17/* Bases of dm646x register banks */
15#define DAVINCI_DM646X_MCASP0_REG_BASE 0x01D01000 18#define DAVINCI_DM646X_MCASP0_REG_BASE 0x01D01000
16#define DAVINCI_DM646X_MCASP1_REG_BASE 0x01D01800 19#define DAVINCI_DM646X_MCASP1_REG_BASE 0x01D01800
@@ -51,6 +54,14 @@ struct snd_platform_data {
51 u32 rx_dma_offset; 54 u32 rx_dma_offset;
52 enum dma_event_q eventq_no; /* event queue number */ 55 enum dma_event_q eventq_no; /* event queue number */
53 unsigned int codec_fmt; 56 unsigned int codec_fmt;
57 /*
58 * Allowing this is more efficient and eliminates left and right swaps
59 * caused by underruns, but will swap the left and right channels
60 * when compared to previous behavior.
61 */
62 unsigned enable_channel_combine:1;
63 unsigned sram_size_playback;
64 unsigned sram_size_capture;
54 65
55 /* McASP specific fields */ 66 /* McASP specific fields */
56 int tdm_slots; 67 int tdm_slots;
diff --git a/arch/arm/mach-davinci/include/mach/common.h b/arch/arm/mach-davinci/include/mach/common.h
index 1fd3917cae4e..6ca2c9a0a482 100644
--- a/arch/arm/mach-davinci/include/mach/common.h
+++ b/arch/arm/mach-davinci/include/mach/common.h
@@ -20,12 +20,6 @@ extern void davinci_irq_init(void);
20extern void __iomem *davinci_intc_base; 20extern void __iomem *davinci_intc_base;
21extern int davinci_intc_type; 21extern int davinci_intc_type;
22 22
23/* parameters describe VBUS sourcing for host mode */
24extern void setup_usb(unsigned mA, unsigned potpgt_msec);
25
26/* parameters describe VBUS sourcing for host mode */
27extern void setup_usb(unsigned mA, unsigned potpgt_msec);
28
29struct davinci_timer_instance { 23struct davinci_timer_instance {
30 void __iomem *base; 24 void __iomem *base;
31 u32 bottom_irq; 25 u32 bottom_irq;
diff --git a/arch/arm/mach-davinci/include/mach/cpufreq.h b/arch/arm/mach-davinci/include/mach/cpufreq.h
new file mode 100644
index 000000000000..3c089cfb6cd6
--- /dev/null
+++ b/arch/arm/mach-davinci/include/mach/cpufreq.h
@@ -0,0 +1,26 @@
1/*
2 * TI DaVinci CPUFreq platform support.
3 *
4 * Copyright (C) 2009 Texas Instruments, Inc. http://www.ti.com/
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation version 2.
9 *
10 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
11 * kind, whether express or implied; without even the implied warranty
12 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15#ifndef _MACH_DAVINCI_CPUFREQ_H
16#define _MACH_DAVINCI_CPUFREQ_H
17
18#include <linux/cpufreq.h>
19
20struct davinci_cpufreq_config {
21 struct cpufreq_frequency_table *freq_table;
22 int (*set_voltage) (unsigned int index);
23 int (*init) (void);
24};
25
26#endif
diff --git a/arch/arm/mach-davinci/include/mach/cpuidle.h b/arch/arm/mach-davinci/include/mach/cpuidle.h
new file mode 100644
index 000000000000..cbfc6a9c81b4
--- /dev/null
+++ b/arch/arm/mach-davinci/include/mach/cpuidle.h
@@ -0,0 +1,17 @@
1/*
2 * TI DaVinci cpuidle platform support
3 *
4 * 2009 (C) Texas Instruments, Inc. http://www.ti.com/
5 *
6 * This file is licensed under the terms of the GNU General Public License
7 * version 2. This program is licensed "as is" without any warranty of any
8 * kind, whether express or implied.
9 */
10#ifndef _MACH_DAVINCI_CPUIDLE_H
11#define _MACH_DAVINCI_CPUIDLE_H
12
13struct davinci_cpuidle_config {
14 u32 ddr2_pdown;
15};
16
17#endif
diff --git a/arch/arm/mach-davinci/include/mach/da8xx.h b/arch/arm/mach-davinci/include/mach/da8xx.h
index d4095d0572c6..90704910d343 100644
--- a/arch/arm/mach-davinci/include/mach/da8xx.h
+++ b/arch/arm/mach-davinci/include/mach/da8xx.h
@@ -11,12 +11,17 @@
11#ifndef __ASM_ARCH_DAVINCI_DA8XX_H 11#ifndef __ASM_ARCH_DAVINCI_DA8XX_H
12#define __ASM_ARCH_DAVINCI_DA8XX_H 12#define __ASM_ARCH_DAVINCI_DA8XX_H
13 13
14#include <video/da8xx-fb.h>
15
14#include <mach/serial.h> 16#include <mach/serial.h>
15#include <mach/edma.h> 17#include <mach/edma.h>
16#include <mach/i2c.h> 18#include <mach/i2c.h>
17#include <mach/emac.h> 19#include <mach/emac.h>
18#include <mach/asp.h> 20#include <mach/asp.h>
19#include <mach/mmc.h> 21#include <mach/mmc.h>
22#include <mach/usb.h>
23
24extern void __iomem *da8xx_syscfg_base;
20 25
21/* 26/*
22 * The cp_intc interrupt controller for the da8xx isn't in the same 27 * The cp_intc interrupt controller for the da8xx isn't in the same
@@ -29,11 +34,15 @@
29#define DA8XX_CP_INTC_SIZE SZ_8K 34#define DA8XX_CP_INTC_SIZE SZ_8K
30#define DA8XX_CP_INTC_VIRT (IO_VIRT - DA8XX_CP_INTC_SIZE - SZ_4K) 35#define DA8XX_CP_INTC_VIRT (IO_VIRT - DA8XX_CP_INTC_SIZE - SZ_4K)
31 36
32#define DA8XX_BOOT_CFG_BASE (IO_PHYS + 0x14000) 37#define DA8XX_SYSCFG_BASE (IO_PHYS + 0x14000)
38#define DA8XX_SYSCFG_VIRT(x) (da8xx_syscfg_base + (x))
39#define DA8XX_JTAG_ID_REG 0x18
40#define DA8XX_CFGCHIP0_REG 0x17c
41#define DA8XX_CFGCHIP2_REG 0x184
42#define DA8XX_CFGCHIP3_REG 0x188
33 43
34#define DA8XX_PSC0_BASE 0x01c10000 44#define DA8XX_PSC0_BASE 0x01c10000
35#define DA8XX_PLL0_BASE 0x01c11000 45#define DA8XX_PLL0_BASE 0x01c11000
36#define DA8XX_JTAG_ID_REG 0x01c14018
37#define DA8XX_TIMER64P0_BASE 0x01c20000 46#define DA8XX_TIMER64P0_BASE 0x01c20000
38#define DA8XX_TIMER64P1_BASE 0x01c21000 47#define DA8XX_TIMER64P1_BASE 0x01c21000
39#define DA8XX_GPIO_BASE 0x01e26000 48#define DA8XX_GPIO_BASE 0x01e26000
@@ -43,6 +52,7 @@
43#define DA8XX_AEMIF_CS2_BASE 0x60000000 52#define DA8XX_AEMIF_CS2_BASE 0x60000000
44#define DA8XX_AEMIF_CS3_BASE 0x62000000 53#define DA8XX_AEMIF_CS3_BASE 0x62000000
45#define DA8XX_AEMIF_CTL_BASE 0x68000000 54#define DA8XX_AEMIF_CTL_BASE 0x68000000
55#define DA8XX_DDR2_CTL_BASE 0xb0000000
46 56
47#define PINMUX0 0x00 57#define PINMUX0 0x00
48#define PINMUX1 0x04 58#define PINMUX1 0x04
@@ -71,13 +81,20 @@ void __init da850_init(void);
71int da8xx_register_edma(void); 81int da8xx_register_edma(void);
72int da8xx_register_i2c(int instance, struct davinci_i2c_platform_data *pdata); 82int da8xx_register_i2c(int instance, struct davinci_i2c_platform_data *pdata);
73int da8xx_register_watchdog(void); 83int da8xx_register_watchdog(void);
84int da8xx_register_usb20(unsigned mA, unsigned potpgt);
85int da8xx_register_usb11(struct da8xx_ohci_root_hub *pdata);
74int da8xx_register_emac(void); 86int da8xx_register_emac(void);
75int da8xx_register_lcdc(void); 87int da8xx_register_lcdc(struct da8xx_lcdc_platform_data *pdata);
76int da8xx_register_mmcsd0(struct davinci_mmc_config *config); 88int da8xx_register_mmcsd0(struct davinci_mmc_config *config);
77void __init da8xx_init_mcasp(int id, struct snd_platform_data *pdata); 89void __init da8xx_register_mcasp(int id, struct snd_platform_data *pdata);
90int da8xx_register_rtc(void);
91int da850_register_cpufreq(void);
92int da8xx_register_cpuidle(void);
78 93
79extern struct platform_device da8xx_serial_device; 94extern struct platform_device da8xx_serial_device;
80extern struct emac_platform_data da8xx_emac_pdata; 95extern struct emac_platform_data da8xx_emac_pdata;
96extern struct da8xx_lcdc_platform_data sharp_lcd035q3dg01_pdata;
97extern struct da8xx_lcdc_platform_data sharp_lk043t1dg01_pdata;
81 98
82extern const short da830_emif25_pins[]; 99extern const short da830_emif25_pins[];
83extern const short da830_spi0_pins[]; 100extern const short da830_spi0_pins[];
@@ -110,6 +127,7 @@ extern const short da850_uart2_pins[];
110extern const short da850_i2c0_pins[]; 127extern const short da850_i2c0_pins[];
111extern const short da850_i2c1_pins[]; 128extern const short da850_i2c1_pins[];
112extern const short da850_cpgmac_pins[]; 129extern const short da850_cpgmac_pins[];
130extern const short da850_rmii_pins[];
113extern const short da850_mcasp_pins[]; 131extern const short da850_mcasp_pins[];
114extern const short da850_lcdcntl_pins[]; 132extern const short da850_lcdcntl_pins[];
115extern const short da850_mmcsd0_pins[]; 133extern const short da850_mmcsd0_pins[];
diff --git a/arch/arm/mach-davinci/include/mach/dm365.h b/arch/arm/mach-davinci/include/mach/dm365.h
index 09db4343bb4c..f1710a30e7ba 100644
--- a/arch/arm/mach-davinci/include/mach/dm365.h
+++ b/arch/arm/mach-davinci/include/mach/dm365.h
@@ -16,6 +16,8 @@
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17#include <mach/hardware.h> 17#include <mach/hardware.h>
18#include <mach/emac.h> 18#include <mach/emac.h>
19#include <mach/asp.h>
20#include <mach/keyscan.h>
19 21
20#define DM365_EMAC_BASE (0x01D07000) 22#define DM365_EMAC_BASE (0x01D07000)
21#define DM365_EMAC_CNTRL_OFFSET (0x0000) 23#define DM365_EMAC_CNTRL_OFFSET (0x0000)
@@ -24,6 +26,14 @@
24#define DM365_EMAC_MDIO_OFFSET (0x4000) 26#define DM365_EMAC_MDIO_OFFSET (0x4000)
25#define DM365_EMAC_CNTRL_RAM_SIZE (0x2000) 27#define DM365_EMAC_CNTRL_RAM_SIZE (0x2000)
26 28
29/* Base of key scan register bank */
30#define DM365_KEYSCAN_BASE (0x01C69400)
31
32#define DM365_RTC_BASE (0x01C69000)
33
27void __init dm365_init(void); 34void __init dm365_init(void);
35void __init dm365_init_asp(struct snd_platform_data *pdata);
36void __init dm365_init_ks(struct davinci_ks_platform_data *pdata);
37void __init dm365_init_rtc(void);
28 38
29#endif /* __ASM_ARCH_DM365_H */ 39#endif /* __ASM_ARCH_DM365_H */
diff --git a/arch/arm/mach-davinci/include/mach/dm644x.h b/arch/arm/mach-davinci/include/mach/dm644x.h
index 0efb73852c2c..44e8f0fae9ea 100644
--- a/arch/arm/mach-davinci/include/mach/dm644x.h
+++ b/arch/arm/mach-davinci/include/mach/dm644x.h
@@ -22,7 +22,6 @@
22#ifndef __ASM_ARCH_DM644X_H 22#ifndef __ASM_ARCH_DM644X_H
23#define __ASM_ARCH_DM644X_H 23#define __ASM_ARCH_DM644X_H
24 24
25#include <linux/platform_device.h>
26#include <mach/hardware.h> 25#include <mach/hardware.h>
27#include <mach/emac.h> 26#include <mach/emac.h>
28#include <mach/asp.h> 27#include <mach/asp.h>
diff --git a/arch/arm/mach-davinci/include/mach/irqs.h b/arch/arm/mach-davinci/include/mach/irqs.h
index 3c918a772619..354af71798dc 100644
--- a/arch/arm/mach-davinci/include/mach/irqs.h
+++ b/arch/arm/mach-davinci/include/mach/irqs.h
@@ -217,6 +217,7 @@
217#define IRQ_DM365_SDIOINT0 23 217#define IRQ_DM365_SDIOINT0 23
218#define IRQ_DM365_MMCINT1 27 218#define IRQ_DM365_MMCINT1 27
219#define IRQ_DM365_PWMINT3 28 219#define IRQ_DM365_PWMINT3 28
220#define IRQ_DM365_RTCINT 29
220#define IRQ_DM365_SDIOINT1 31 221#define IRQ_DM365_SDIOINT1 31
221#define IRQ_DM365_SPIINT0_0 42 222#define IRQ_DM365_SPIINT0_0 42
222#define IRQ_DM365_SPIINT3_0 43 223#define IRQ_DM365_SPIINT3_0 43
diff --git a/arch/arm/mach-davinci/include/mach/mux.h b/arch/arm/mach-davinci/include/mach/mux.h
index bb84893a4e83..b60c693985ff 100644
--- a/arch/arm/mach-davinci/include/mach/mux.h
+++ b/arch/arm/mach-davinci/include/mach/mux.h
@@ -40,6 +40,11 @@ enum davinci_dm644x_index {
40 40
41 /* AEAW functions */ 41 /* AEAW functions */
42 DM644X_AEAW, 42 DM644X_AEAW,
43 DM644X_AEAW0,
44 DM644X_AEAW1,
45 DM644X_AEAW2,
46 DM644X_AEAW3,
47 DM644X_AEAW4,
43 48
44 /* Memory Stick */ 49 /* Memory Stick */
45 DM644X_MSTK, 50 DM644X_MSTK,
@@ -237,8 +242,8 @@ enum davinci_dm365_index {
237 DM365_EMAC_MDIO, 242 DM365_EMAC_MDIO,
238 DM365_EMAC_MDCLK, 243 DM365_EMAC_MDCLK,
239 244
240 /* Keypad */ 245 /* Key Scan */
241 DM365_KEYPAD, 246 DM365_KEYSCAN,
242 247
243 /* PWM */ 248 /* PWM */
244 DM365_PWM0, 249 DM365_PWM0,
@@ -774,6 +779,14 @@ enum davinci_da850_index {
774 DA850_MII_RXD_0, 779 DA850_MII_RXD_0,
775 DA850_MDIO_CLK, 780 DA850_MDIO_CLK,
776 DA850_MDIO_D, 781 DA850_MDIO_D,
782 DA850_RMII_TXD_0,
783 DA850_RMII_TXD_1,
784 DA850_RMII_TXEN,
785 DA850_RMII_CRS_DV,
786 DA850_RMII_RXD_0,
787 DA850_RMII_RXD_1,
788 DA850_RMII_RXER,
789 DA850_RMII_MHZ_50_CLK,
777 790
778 /* McASP function */ 791 /* McASP function */
779 DA850_ACLKR, 792 DA850_ACLKR,
@@ -881,8 +894,9 @@ enum davinci_da850_index {
881 DA850_NEMA_CS_2, 894 DA850_NEMA_CS_2,
882 895
883 /* GPIO function */ 896 /* GPIO function */
897 DA850_GPIO2_6,
898 DA850_GPIO2_8,
884 DA850_GPIO2_15, 899 DA850_GPIO2_15,
885 DA850_GPIO8_10,
886 DA850_GPIO4_0, 900 DA850_GPIO4_0,
887 DA850_GPIO4_1, 901 DA850_GPIO4_1,
888}; 902};
diff --git a/arch/arm/mach-davinci/include/mach/system.h b/arch/arm/mach-davinci/include/mach/system.h
index 8e4f10fe1263..5a7d7581b8ce 100644
--- a/arch/arm/mach-davinci/include/mach/system.h
+++ b/arch/arm/mach-davinci/include/mach/system.h
@@ -11,9 +11,6 @@
11#ifndef __ASM_ARCH_SYSTEM_H 11#ifndef __ASM_ARCH_SYSTEM_H
12#define __ASM_ARCH_SYSTEM_H 12#define __ASM_ARCH_SYSTEM_H
13 13
14#include <linux/io.h>
15#include <mach/hardware.h>
16
17extern void davinci_watchdog_reset(void); 14extern void davinci_watchdog_reset(void);
18 15
19static inline void arch_idle(void) 16static inline void arch_idle(void)
diff --git a/arch/arm/mach-davinci/include/mach/usb.h b/arch/arm/mach-davinci/include/mach/usb.h
new file mode 100644
index 000000000000..e0bc4abe69c2
--- /dev/null
+++ b/arch/arm/mach-davinci/include/mach/usb.h
@@ -0,0 +1,59 @@
1/*
2 * USB related definitions
3 *
4 * Copyright (C) 2009 MontaVista Software, Inc. <source@mvista.com>
5 *
6 * This file is licensed under the terms of the GNU General Public License
7 * version 2. This program is licensed "as is" without any warranty of any
8 * kind, whether express or implied.
9 */
10
11#ifndef __ASM_ARCH_USB_H
12#define __ASM_ARCH_USB_H
13
14/* DA8xx CFGCHIP2 (USB 2.0 PHY Control) register bits */
15#define CFGCHIP2_PHYCLKGD (1 << 17)
16#define CFGCHIP2_VBUSSENSE (1 << 16)
17#define CFGCHIP2_RESET (1 << 15)
18#define CFGCHIP2_OTGMODE (3 << 13)
19#define CFGCHIP2_NO_OVERRIDE (0 << 13)
20#define CFGCHIP2_FORCE_HOST (1 << 13)
21#define CFGCHIP2_FORCE_DEVICE (2 << 13)
22#define CFGCHIP2_FORCE_HOST_VBUS_LOW (3 << 13)
23#define CFGCHIP2_USB1PHYCLKMUX (1 << 12)
24#define CFGCHIP2_USB2PHYCLKMUX (1 << 11)
25#define CFGCHIP2_PHYPWRDN (1 << 10)
26#define CFGCHIP2_OTGPWRDN (1 << 9)
27#define CFGCHIP2_DATPOL (1 << 8)
28#define CFGCHIP2_USB1SUSPENDM (1 << 7)
29#define CFGCHIP2_PHY_PLLON (1 << 6) /* override PLL suspend */
30#define CFGCHIP2_SESENDEN (1 << 5) /* Vsess_end comparator */
31#define CFGCHIP2_VBDTCTEN (1 << 4) /* Vbus comparator */
32#define CFGCHIP2_REFFREQ (0xf << 0)
33#define CFGCHIP2_REFFREQ_12MHZ (1 << 0)
34#define CFGCHIP2_REFFREQ_24MHZ (2 << 0)
35#define CFGCHIP2_REFFREQ_48MHZ (3 << 0)
36
37struct da8xx_ohci_root_hub;
38
39typedef void (*da8xx_ocic_handler_t)(struct da8xx_ohci_root_hub *hub,
40 unsigned port);
41
42/* Passed as the platform data to the OHCI driver */
43struct da8xx_ohci_root_hub {
44 /* Switch the port power on/off */
45 int (*set_power)(unsigned port, int on);
46 /* Read the port power status */
47 int (*get_power)(unsigned port);
48 /* Read the port over-current indicator */
49 int (*get_oci)(unsigned port);
50 /* Over-current indicator change notification (pass NULL to disable) */
51 int (*ocic_notify)(da8xx_ocic_handler_t handler);
52
53 /* Time from power on to power good (in 2 ms units) */
54 u8 potpgt;
55};
56
57void davinci_setup_usb(unsigned mA, unsigned potpgt_ms);
58
59#endif /* ifndef __ASM_ARCH_USB_H */
diff --git a/arch/arm/mach-davinci/mux.c b/arch/arm/mach-davinci/mux.c
index 898905e48946..f757e83415f3 100644
--- a/arch/arm/mach-davinci/mux.c
+++ b/arch/arm/mach-davinci/mux.c
@@ -19,7 +19,6 @@
19#include <linux/module.h> 19#include <linux/module.h>
20#include <linux/spinlock.h> 20#include <linux/spinlock.h>
21 21
22#include <mach/hardware.h>
23#include <mach/mux.h> 22#include <mach/mux.h>
24#include <mach/common.h> 23#include <mach/common.h>
25 24
diff --git a/arch/arm/mach-davinci/psc.c b/arch/arm/mach-davinci/psc.c
index a78b657e916e..04a3cb72c5ab 100644
--- a/arch/arm/mach-davinci/psc.c
+++ b/arch/arm/mach-davinci/psc.c
@@ -19,14 +19,11 @@
19 * 19 *
20 */ 20 */
21#include <linux/kernel.h> 21#include <linux/kernel.h>
22#include <linux/module.h>
23#include <linux/init.h> 22#include <linux/init.h>
24#include <linux/io.h> 23#include <linux/io.h>
25 24
26#include <mach/cputype.h> 25#include <mach/cputype.h>
27#include <mach/hardware.h>
28#include <mach/psc.h> 26#include <mach/psc.h>
29#include <mach/mux.h>
30 27
31/* PSC register offsets */ 28/* PSC register offsets */
32#define EPCPR 0x070 29#define EPCPR 0x070
diff --git a/arch/arm/mach-davinci/serial.c b/arch/arm/mach-davinci/serial.c
index c530c7333d0a..7ce5ba086575 100644
--- a/arch/arm/mach-davinci/serial.c
+++ b/arch/arm/mach-davinci/serial.c
@@ -28,14 +28,8 @@
28#include <linux/clk.h> 28#include <linux/clk.h>
29#include <linux/io.h> 29#include <linux/io.h>
30 30
31#include <asm/irq.h>
32#include <mach/hardware.h>
33#include <mach/serial.h> 31#include <mach/serial.h>
34#include <mach/irqs.h>
35#include <mach/cputype.h> 32#include <mach/cputype.h>
36#include <mach/common.h>
37
38#include "clock.h"
39 33
40static inline unsigned int serial_read_reg(struct plat_serial8250_port *up, 34static inline unsigned int serial_read_reg(struct plat_serial8250_port *up,
41 int offset) 35 int offset)
diff --git a/arch/arm/mach-davinci/sram.c b/arch/arm/mach-davinci/sram.c
index 4f1fc9b318b3..db0f7787faf1 100644
--- a/arch/arm/mach-davinci/sram.c
+++ b/arch/arm/mach-davinci/sram.c
@@ -9,15 +9,12 @@
9 * (at your option) any later version. 9 * (at your option) any later version.
10 */ 10 */
11#include <linux/module.h> 11#include <linux/module.h>
12#include <linux/kernel.h>
13#include <linux/init.h> 12#include <linux/init.h>
14#include <linux/genalloc.h> 13#include <linux/genalloc.h>
15 14
16#include <mach/common.h> 15#include <mach/common.h>
17#include <mach/memory.h>
18#include <mach/sram.h> 16#include <mach/sram.h>
19 17
20
21static struct gen_pool *sram_pool; 18static struct gen_pool *sram_pool;
22 19
23void *sram_alloc(size_t len, dma_addr_t *dma) 20void *sram_alloc(size_t len, dma_addr_t *dma)
diff --git a/arch/arm/mach-davinci/time.c b/arch/arm/mach-davinci/time.c
index 0d1b6d407b46..42d985beece5 100644
--- a/arch/arm/mach-davinci/time.c
+++ b/arch/arm/mach-davinci/time.c
@@ -14,20 +14,14 @@
14#include <linux/interrupt.h> 14#include <linux/interrupt.h>
15#include <linux/clocksource.h> 15#include <linux/clocksource.h>
16#include <linux/clockchips.h> 16#include <linux/clockchips.h>
17#include <linux/spinlock.h>
18#include <linux/io.h> 17#include <linux/io.h>
19#include <linux/clk.h> 18#include <linux/clk.h>
20#include <linux/err.h> 19#include <linux/err.h>
21#include <linux/device.h>
22#include <linux/platform_device.h> 20#include <linux/platform_device.h>
23 21
24#include <mach/hardware.h> 22#include <mach/hardware.h>
25#include <asm/system.h>
26#include <asm/irq.h>
27#include <asm/mach/irq.h> 23#include <asm/mach/irq.h>
28#include <asm/mach/time.h> 24#include <asm/mach/time.h>
29#include <asm/errno.h>
30#include <mach/io.h>
31#include <mach/cputype.h> 25#include <mach/cputype.h>
32#include <mach/time.h> 26#include <mach/time.h>
33#include "clock.h" 27#include "clock.h"
diff --git a/arch/arm/mach-davinci/usb.c b/arch/arm/mach-davinci/usb.c
index 06f55931620c..31f0cbea0caa 100644
--- a/arch/arm/mach-davinci/usb.c
+++ b/arch/arm/mach-davinci/usb.c
@@ -1,21 +1,21 @@
1/* 1/*
2 * USB 2 * USB
3 */ 3 */
4#include <linux/kernel.h>
5#include <linux/module.h>
6#include <linux/init.h> 4#include <linux/init.h>
7#include <linux/platform_device.h> 5#include <linux/platform_device.h>
8#include <linux/dma-mapping.h> 6#include <linux/dma-mapping.h>
9 7
10#include <linux/usb/musb.h> 8#include <linux/usb/musb.h>
11#include <linux/usb/otg.h>
12 9
13#include <mach/common.h> 10#include <mach/common.h>
14#include <mach/hardware.h>
15#include <mach/irqs.h> 11#include <mach/irqs.h>
16#include <mach/cputype.h> 12#include <mach/cputype.h>
13#include <mach/usb.h>
17 14
18#define DAVINCI_USB_OTG_BASE 0x01C64000 15#define DAVINCI_USB_OTG_BASE 0x01c64000
16
17#define DA8XX_USB0_BASE 0x01e00000
18#define DA8XX_USB1_BASE 0x01e25000
19 19
20#if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE) 20#if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
21static struct musb_hdrc_eps_bits musb_eps[] = { 21static struct musb_hdrc_eps_bits musb_eps[] = {
@@ -85,10 +85,10 @@ static struct platform_device usb_dev = {
85 .num_resources = ARRAY_SIZE(usb_resources), 85 .num_resources = ARRAY_SIZE(usb_resources),
86}; 86};
87 87
88void __init setup_usb(unsigned mA, unsigned potpgt_msec) 88void __init davinci_setup_usb(unsigned mA, unsigned potpgt_ms)
89{ 89{
90 usb_data.power = mA / 2; 90 usb_data.power = mA > 510 ? 255 : mA / 2;
91 usb_data.potpgt = potpgt_msec / 2; 91 usb_data.potpgt = (potpgt_ms + 1) / 2;
92 92
93 if (cpu_is_davinci_dm646x()) { 93 if (cpu_is_davinci_dm646x()) {
94 /* Override the defaults as DM6467 uses different IRQs. */ 94 /* Override the defaults as DM6467 uses different IRQs. */
@@ -100,11 +100,77 @@ void __init setup_usb(unsigned mA, unsigned potpgt_msec)
100 platform_device_register(&usb_dev); 100 platform_device_register(&usb_dev);
101} 101}
102 102
103#ifdef CONFIG_ARCH_DAVINCI_DA8XX
104static struct resource da8xx_usb20_resources[] = {
105 {
106 .start = DA8XX_USB0_BASE,
107 .end = DA8XX_USB0_BASE + SZ_64K - 1,
108 .flags = IORESOURCE_MEM,
109 },
110 {
111 .start = IRQ_DA8XX_USB_INT,
112 .flags = IORESOURCE_IRQ,
113 },
114};
115
116int __init da8xx_register_usb20(unsigned mA, unsigned potpgt)
117{
118 usb_data.clock = "usb20";
119 usb_data.power = mA > 510 ? 255 : mA / 2;
120 usb_data.potpgt = (potpgt + 1) / 2;
121
122 usb_dev.resource = da8xx_usb20_resources;
123 usb_dev.num_resources = ARRAY_SIZE(da8xx_usb20_resources);
124
125 return platform_device_register(&usb_dev);
126}
127#endif /* CONFIG_DAVINCI_DA8XX */
128
103#else 129#else
104 130
105void __init setup_usb(unsigned mA, unsigned potpgt_msec) 131void __init davinci_setup_usb(unsigned mA, unsigned potpgt_ms)
106{ 132{
107} 133}
108 134
135#ifdef CONFIG_ARCH_DAVINCI_DA8XX
136int __init da8xx_register_usb20(unsigned mA, unsigned potpgt)
137{
138 return 0;
139}
140#endif
141
109#endif /* CONFIG_USB_MUSB_HDRC */ 142#endif /* CONFIG_USB_MUSB_HDRC */
110 143
144#ifdef CONFIG_ARCH_DAVINCI_DA8XX
145static struct resource da8xx_usb11_resources[] = {
146 [0] = {
147 .start = DA8XX_USB1_BASE,
148 .end = DA8XX_USB1_BASE + SZ_4K - 1,
149 .flags = IORESOURCE_MEM,
150 },
151 [1] = {
152 .start = IRQ_DA8XX_IRQN,
153 .end = IRQ_DA8XX_IRQN,
154 .flags = IORESOURCE_IRQ,
155 },
156};
157
158static u64 da8xx_usb11_dma_mask = DMA_BIT_MASK(32);
159
160static struct platform_device da8xx_usb11_device = {
161 .name = "ohci",
162 .id = 0,
163 .dev = {
164 .dma_mask = &da8xx_usb11_dma_mask,
165 .coherent_dma_mask = DMA_BIT_MASK(32),
166 },
167 .num_resources = ARRAY_SIZE(da8xx_usb11_resources),
168 .resource = da8xx_usb11_resources,
169};
170
171int __init da8xx_register_usb11(struct da8xx_ohci_root_hub *pdata)
172{
173 da8xx_usb11_device.dev.platform_data = pdata;
174 return platform_device_register(&da8xx_usb11_device);
175}
176#endif /* CONFIG_DAVINCI_DA8XX */
diff --git a/arch/arm/mach-dove/Kconfig b/arch/arm/mach-dove/Kconfig
new file mode 100644
index 000000000000..3b9a32ace909
--- /dev/null
+++ b/arch/arm/mach-dove/Kconfig
@@ -0,0 +1,14 @@
1if ARCH_DOVE
2
3menu "Marvell Dove Implementations"
4
5config MACH_DOVE_DB
6 bool "Marvell DB-MV88AP510 Development Board"
7 select I2C_BOARDINFO
8 help
9 Say 'Y' here if you want your kernel to support the
10 Marvell DB-MV88AP510 Development Board.
11
12endmenu
13
14endif
diff --git a/arch/arm/mach-dove/Makefile b/arch/arm/mach-dove/Makefile
new file mode 100644
index 000000000000..7ab3be53f642
--- /dev/null
+++ b/arch/arm/mach-dove/Makefile
@@ -0,0 +1,3 @@
1obj-y += common.o addr-map.o irq.o pcie.o
2
3obj-$(CONFIG_MACH_DOVE_DB) += dove-db-setup.o
diff --git a/arch/arm/mach-dove/Makefile.boot b/arch/arm/mach-dove/Makefile.boot
new file mode 100644
index 000000000000..67039c3e0c48
--- /dev/null
+++ b/arch/arm/mach-dove/Makefile.boot
@@ -0,0 +1,3 @@
1 zreladdr-y := 0x00008000
2params_phys-y := 0x00000100
3initrd_phys-y := 0x00800000
diff --git a/arch/arm/mach-dove/addr-map.c b/arch/arm/mach-dove/addr-map.c
new file mode 100644
index 000000000000..00be4fc26dd7
--- /dev/null
+++ b/arch/arm/mach-dove/addr-map.c
@@ -0,0 +1,149 @@
1/*
2 * arch/arm/mach-dove/addr-map.c
3 *
4 * Address map functions for Marvell Dove 88AP510 SoC
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
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/mbus.h>
14#include <linux/io.h>
15#include <asm/mach/arch.h>
16#include <asm/setup.h>
17#include "common.h"
18
19/*
20 * Generic Address Decode Windows bit settings
21 */
22#define TARGET_DDR 0x0
23#define TARGET_BOOTROM 0x1
24#define TARGET_CESA 0x3
25#define TARGET_PCIE0 0x4
26#define TARGET_PCIE1 0x8
27#define TARGET_SCRATCHPAD 0xd
28
29#define ATTR_CESA 0x01
30#define ATTR_BOOTROM 0xfd
31#define ATTR_DEV_SPI0_ROM 0xfe
32#define ATTR_DEV_SPI1_ROM 0xfb
33#define ATTR_PCIE_IO 0xe0
34#define ATTR_PCIE_MEM 0xe8
35#define ATTR_SCRATCHPAD 0x0
36
37/*
38 * CPU Address Decode Windows registers
39 */
40#define WIN_CTRL(n) (BRIDGE_VIRT_BASE + ((n) << 4) + 0x0)
41#define WIN_BASE(n) (BRIDGE_VIRT_BASE + ((n) << 4) + 0x4)
42#define WIN_REMAP_LO(n) (BRIDGE_VIRT_BASE + ((n) << 4) + 0x8)
43#define WIN_REMAP_HI(n) (BRIDGE_VIRT_BASE + ((n) << 4) + 0xc)
44
45struct mbus_dram_target_info dove_mbus_dram_info;
46
47static inline void __iomem *ddr_map_sc(int i)
48{
49 return (void __iomem *)(DOVE_MC_VIRT_BASE + 0x100 + ((i) << 4));
50}
51
52static int cpu_win_can_remap(int win)
53{
54 if (win < 4)
55 return 1;
56
57 return 0;
58}
59
60static void __init setup_cpu_win(int win, u32 base, u32 size,
61 u8 target, u8 attr, int remap)
62{
63 u32 ctrl;
64
65 base &= 0xffff0000;
66 ctrl = ((size - 1) & 0xffff0000) | (attr << 8) | (target << 4) | 1;
67
68 writel(base, WIN_BASE(win));
69 writel(ctrl, WIN_CTRL(win));
70 if (cpu_win_can_remap(win)) {
71 if (remap < 0)
72 remap = base;
73 writel(remap & 0xffff0000, WIN_REMAP_LO(win));
74 writel(0, WIN_REMAP_HI(win));
75 }
76}
77
78void __init dove_setup_cpu_mbus(void)
79{
80 int i;
81 int cs;
82
83 /*
84 * First, disable and clear windows.
85 */
86 for (i = 0; i < 8; i++) {
87 writel(0, WIN_BASE(i));
88 writel(0, WIN_CTRL(i));
89 if (cpu_win_can_remap(i)) {
90 writel(0, WIN_REMAP_LO(i));
91 writel(0, WIN_REMAP_HI(i));
92 }
93 }
94
95 /*
96 * Setup windows for PCIe IO+MEM space.
97 */
98 setup_cpu_win(0, DOVE_PCIE0_IO_PHYS_BASE, DOVE_PCIE0_IO_SIZE,
99 TARGET_PCIE0, ATTR_PCIE_IO, DOVE_PCIE0_IO_BUS_BASE);
100 setup_cpu_win(1, DOVE_PCIE1_IO_PHYS_BASE, DOVE_PCIE1_IO_SIZE,
101 TARGET_PCIE1, ATTR_PCIE_IO, DOVE_PCIE1_IO_BUS_BASE);
102 setup_cpu_win(2, DOVE_PCIE0_MEM_PHYS_BASE, DOVE_PCIE0_MEM_SIZE,
103 TARGET_PCIE0, ATTR_PCIE_MEM, -1);
104 setup_cpu_win(3, DOVE_PCIE1_MEM_PHYS_BASE, DOVE_PCIE1_MEM_SIZE,
105 TARGET_PCIE1, ATTR_PCIE_MEM, -1);
106
107 /*
108 * Setup window for CESA engine.
109 */
110 setup_cpu_win(4, DOVE_CESA_PHYS_BASE, DOVE_CESA_SIZE,
111 TARGET_CESA, ATTR_CESA, -1);
112
113 /*
114 * Setup the Window to the BootROM for Standby and Sleep Resume
115 */
116 setup_cpu_win(5, DOVE_BOOTROM_PHYS_BASE, DOVE_BOOTROM_SIZE,
117 TARGET_BOOTROM, ATTR_BOOTROM, -1);
118
119 /*
120 * Setup the Window to the PMU Scratch Pad space
121 */
122 setup_cpu_win(6, DOVE_SCRATCHPAD_PHYS_BASE, DOVE_SCRATCHPAD_SIZE,
123 TARGET_SCRATCHPAD, ATTR_SCRATCHPAD, -1);
124
125 /*
126 * Setup MBUS dram target info.
127 */
128 dove_mbus_dram_info.mbus_dram_target_id = TARGET_DDR;
129
130 for (i = 0, cs = 0; i < 2; i++) {
131 u32 map = readl(ddr_map_sc(i));
132
133 /*
134 * Chip select enabled?
135 */
136 if (map & 1) {
137 struct mbus_dram_window *w;
138
139 w = &dove_mbus_dram_info.cs[cs++];
140 w->cs_index = i;
141 w->mbus_attr = 0; /* CS address decoding done inside */
142 /* the DDR controller, no need to */
143 /* provide attributes */
144 w->base = map & 0xff800000;
145 w->size = 0x100000 << (((map & 0x000f0000) >> 16) - 4);
146 }
147 }
148 dove_mbus_dram_info.num_cs = cs;
149}
diff --git a/arch/arm/mach-dove/common.c b/arch/arm/mach-dove/common.c
new file mode 100644
index 000000000000..806972a68c87
--- /dev/null
+++ b/arch/arm/mach-dove/common.c
@@ -0,0 +1,781 @@
1/*
2 * arch/arm/mach-dove/common.c
3 *
4 * Core functions for Marvell Dove 88AP510 System On Chip
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
11#include <linux/kernel.h>
12#include <linux/delay.h>
13#include <linux/init.h>
14#include <linux/platform_device.h>
15#include <linux/pci.h>
16#include <linux/serial_8250.h>
17#include <linux/clk.h>
18#include <linux/mbus.h>
19#include <linux/mv643xx_eth.h>
20#include <linux/mv643xx_i2c.h>
21#include <linux/ata_platform.h>
22#include <linux/spi/orion_spi.h>
23#include <linux/gpio.h>
24#include <asm/page.h>
25#include <asm/setup.h>
26#include <asm/timex.h>
27#include <asm/hardware/cache-tauros2.h>
28#include <asm/mach/map.h>
29#include <asm/mach/time.h>
30#include <asm/mach/pci.h>
31#include <mach/dove.h>
32#include <mach/bridge-regs.h>
33#include <asm/mach/arch.h>
34#include <linux/irq.h>
35#include <plat/mv_xor.h>
36#include <plat/ehci-orion.h>
37#include <plat/time.h>
38#include "common.h"
39
40/*****************************************************************************
41 * I/O Address Mapping
42 ****************************************************************************/
43static struct map_desc dove_io_desc[] __initdata = {
44 {
45 .virtual = DOVE_SB_REGS_VIRT_BASE,
46 .pfn = __phys_to_pfn(DOVE_SB_REGS_PHYS_BASE),
47 .length = DOVE_SB_REGS_SIZE,
48 .type = MT_DEVICE,
49 }, {
50 .virtual = DOVE_NB_REGS_VIRT_BASE,
51 .pfn = __phys_to_pfn(DOVE_NB_REGS_PHYS_BASE),
52 .length = DOVE_NB_REGS_SIZE,
53 .type = MT_DEVICE,
54 }, {
55 .virtual = DOVE_PCIE0_IO_VIRT_BASE,
56 .pfn = __phys_to_pfn(DOVE_PCIE0_IO_PHYS_BASE),
57 .length = DOVE_PCIE0_IO_SIZE,
58 .type = MT_DEVICE,
59 }, {
60 .virtual = DOVE_PCIE1_IO_VIRT_BASE,
61 .pfn = __phys_to_pfn(DOVE_PCIE1_IO_PHYS_BASE),
62 .length = DOVE_PCIE1_IO_SIZE,
63 .type = MT_DEVICE,
64 },
65};
66
67void __init dove_map_io(void)
68{
69 iotable_init(dove_io_desc, ARRAY_SIZE(dove_io_desc));
70}
71
72/*****************************************************************************
73 * EHCI
74 ****************************************************************************/
75static struct orion_ehci_data dove_ehci_data = {
76 .dram = &dove_mbus_dram_info,
77 .phy_version = EHCI_PHY_NA,
78};
79
80static u64 ehci_dmamask = DMA_BIT_MASK(32);
81
82/*****************************************************************************
83 * EHCI0
84 ****************************************************************************/
85static struct resource dove_ehci0_resources[] = {
86 {
87 .start = DOVE_USB0_PHYS_BASE,
88 .end = DOVE_USB0_PHYS_BASE + SZ_4K - 1,
89 .flags = IORESOURCE_MEM,
90 }, {
91 .start = IRQ_DOVE_USB0,
92 .end = IRQ_DOVE_USB0,
93 .flags = IORESOURCE_IRQ,
94 },
95};
96
97static struct platform_device dove_ehci0 = {
98 .name = "orion-ehci",
99 .id = 0,
100 .dev = {
101 .dma_mask = &ehci_dmamask,
102 .coherent_dma_mask = DMA_BIT_MASK(32),
103 .platform_data = &dove_ehci_data,
104 },
105 .resource = dove_ehci0_resources,
106 .num_resources = ARRAY_SIZE(dove_ehci0_resources),
107};
108
109void __init dove_ehci0_init(void)
110{
111 platform_device_register(&dove_ehci0);
112}
113
114/*****************************************************************************
115 * EHCI1
116 ****************************************************************************/
117static struct resource dove_ehci1_resources[] = {
118 {
119 .start = DOVE_USB1_PHYS_BASE,
120 .end = DOVE_USB1_PHYS_BASE + SZ_4K - 1,
121 .flags = IORESOURCE_MEM,
122 }, {
123 .start = IRQ_DOVE_USB1,
124 .end = IRQ_DOVE_USB1,
125 .flags = IORESOURCE_IRQ,
126 },
127};
128
129static struct platform_device dove_ehci1 = {
130 .name = "orion-ehci",
131 .id = 1,
132 .dev = {
133 .dma_mask = &ehci_dmamask,
134 .coherent_dma_mask = DMA_BIT_MASK(32),
135 .platform_data = &dove_ehci_data,
136 },
137 .resource = dove_ehci1_resources,
138 .num_resources = ARRAY_SIZE(dove_ehci1_resources),
139};
140
141void __init dove_ehci1_init(void)
142{
143 platform_device_register(&dove_ehci1);
144}
145
146/*****************************************************************************
147 * GE00
148 ****************************************************************************/
149struct mv643xx_eth_shared_platform_data dove_ge00_shared_data = {
150 .t_clk = 0,
151 .dram = &dove_mbus_dram_info,
152};
153
154static struct resource dove_ge00_shared_resources[] = {
155 {
156 .name = "ge00 base",
157 .start = DOVE_GE00_PHYS_BASE + 0x2000,
158 .end = DOVE_GE00_PHYS_BASE + SZ_16K - 1,
159 .flags = IORESOURCE_MEM,
160 },
161};
162
163static struct platform_device dove_ge00_shared = {
164 .name = MV643XX_ETH_SHARED_NAME,
165 .id = 0,
166 .dev = {
167 .platform_data = &dove_ge00_shared_data,
168 },
169 .num_resources = 1,
170 .resource = dove_ge00_shared_resources,
171};
172
173static struct resource dove_ge00_resources[] = {
174 {
175 .name = "ge00 irq",
176 .start = IRQ_DOVE_GE00_SUM,
177 .end = IRQ_DOVE_GE00_SUM,
178 .flags = IORESOURCE_IRQ,
179 },
180};
181
182static struct platform_device dove_ge00 = {
183 .name = MV643XX_ETH_NAME,
184 .id = 0,
185 .num_resources = 1,
186 .resource = dove_ge00_resources,
187 .dev = {
188 .coherent_dma_mask = 0xffffffff,
189 },
190};
191
192void __init dove_ge00_init(struct mv643xx_eth_platform_data *eth_data)
193{
194 eth_data->shared = &dove_ge00_shared;
195 dove_ge00.dev.platform_data = eth_data;
196
197 platform_device_register(&dove_ge00_shared);
198 platform_device_register(&dove_ge00);
199}
200
201/*****************************************************************************
202 * SoC RTC
203 ****************************************************************************/
204static struct resource dove_rtc_resource[] = {
205 {
206 .start = DOVE_RTC_PHYS_BASE,
207 .end = DOVE_RTC_PHYS_BASE + 32 - 1,
208 .flags = IORESOURCE_MEM,
209 }, {
210 .start = IRQ_DOVE_RTC,
211 .flags = IORESOURCE_IRQ,
212 }
213};
214
215void __init dove_rtc_init(void)
216{
217 platform_device_register_simple("rtc-mv", -1, dove_rtc_resource, 2);
218}
219
220/*****************************************************************************
221 * SATA
222 ****************************************************************************/
223static struct resource dove_sata_resources[] = {
224 {
225 .name = "sata base",
226 .start = DOVE_SATA_PHYS_BASE,
227 .end = DOVE_SATA_PHYS_BASE + 0x5000 - 1,
228 .flags = IORESOURCE_MEM,
229 }, {
230 .name = "sata irq",
231 .start = IRQ_DOVE_SATA,
232 .end = IRQ_DOVE_SATA,
233 .flags = IORESOURCE_IRQ,
234 },
235};
236
237static struct platform_device dove_sata = {
238 .name = "sata_mv",
239 .id = 0,
240 .dev = {
241 .coherent_dma_mask = DMA_BIT_MASK(32),
242 },
243 .num_resources = ARRAY_SIZE(dove_sata_resources),
244 .resource = dove_sata_resources,
245};
246
247void __init dove_sata_init(struct mv_sata_platform_data *sata_data)
248{
249 sata_data->dram = &dove_mbus_dram_info;
250 dove_sata.dev.platform_data = sata_data;
251 platform_device_register(&dove_sata);
252}
253
254/*****************************************************************************
255 * UART0
256 ****************************************************************************/
257static struct plat_serial8250_port dove_uart0_data[] = {
258 {
259 .mapbase = DOVE_UART0_PHYS_BASE,
260 .membase = (char *)DOVE_UART0_VIRT_BASE,
261 .irq = IRQ_DOVE_UART_0,
262 .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF,
263 .iotype = UPIO_MEM,
264 .regshift = 2,
265 .uartclk = 0,
266 }, {
267 },
268};
269
270static struct resource dove_uart0_resources[] = {
271 {
272 .start = DOVE_UART0_PHYS_BASE,
273 .end = DOVE_UART0_PHYS_BASE + SZ_256 - 1,
274 .flags = IORESOURCE_MEM,
275 }, {
276 .start = IRQ_DOVE_UART_0,
277 .end = IRQ_DOVE_UART_0,
278 .flags = IORESOURCE_IRQ,
279 },
280};
281
282static struct platform_device dove_uart0 = {
283 .name = "serial8250",
284 .id = 0,
285 .dev = {
286 .platform_data = dove_uart0_data,
287 },
288 .resource = dove_uart0_resources,
289 .num_resources = ARRAY_SIZE(dove_uart0_resources),
290};
291
292void __init dove_uart0_init(void)
293{
294 platform_device_register(&dove_uart0);
295}
296
297/*****************************************************************************
298 * UART1
299 ****************************************************************************/
300static struct plat_serial8250_port dove_uart1_data[] = {
301 {
302 .mapbase = DOVE_UART1_PHYS_BASE,
303 .membase = (char *)DOVE_UART1_VIRT_BASE,
304 .irq = IRQ_DOVE_UART_1,
305 .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF,
306 .iotype = UPIO_MEM,
307 .regshift = 2,
308 .uartclk = 0,
309 }, {
310 },
311};
312
313static struct resource dove_uart1_resources[] = {
314 {
315 .start = DOVE_UART1_PHYS_BASE,
316 .end = DOVE_UART1_PHYS_BASE + SZ_256 - 1,
317 .flags = IORESOURCE_MEM,
318 }, {
319 .start = IRQ_DOVE_UART_1,
320 .end = IRQ_DOVE_UART_1,
321 .flags = IORESOURCE_IRQ,
322 },
323};
324
325static struct platform_device dove_uart1 = {
326 .name = "serial8250",
327 .id = 1,
328 .dev = {
329 .platform_data = dove_uart1_data,
330 },
331 .resource = dove_uart1_resources,
332 .num_resources = ARRAY_SIZE(dove_uart1_resources),
333};
334
335void __init dove_uart1_init(void)
336{
337 platform_device_register(&dove_uart1);
338}
339
340/*****************************************************************************
341 * UART2
342 ****************************************************************************/
343static struct plat_serial8250_port dove_uart2_data[] = {
344 {
345 .mapbase = DOVE_UART2_PHYS_BASE,
346 .membase = (char *)DOVE_UART2_VIRT_BASE,
347 .irq = IRQ_DOVE_UART_2,
348 .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF,
349 .iotype = UPIO_MEM,
350 .regshift = 2,
351 .uartclk = 0,
352 }, {
353 },
354};
355
356static struct resource dove_uart2_resources[] = {
357 {
358 .start = DOVE_UART2_PHYS_BASE,
359 .end = DOVE_UART2_PHYS_BASE + SZ_256 - 1,
360 .flags = IORESOURCE_MEM,
361 }, {
362 .start = IRQ_DOVE_UART_2,
363 .end = IRQ_DOVE_UART_2,
364 .flags = IORESOURCE_IRQ,
365 },
366};
367
368static struct platform_device dove_uart2 = {
369 .name = "serial8250",
370 .id = 2,
371 .dev = {
372 .platform_data = dove_uart2_data,
373 },
374 .resource = dove_uart2_resources,
375 .num_resources = ARRAY_SIZE(dove_uart2_resources),
376};
377
378void __init dove_uart2_init(void)
379{
380 platform_device_register(&dove_uart2);
381}
382
383/*****************************************************************************
384 * UART3
385 ****************************************************************************/
386static struct plat_serial8250_port dove_uart3_data[] = {
387 {
388 .mapbase = DOVE_UART3_PHYS_BASE,
389 .membase = (char *)DOVE_UART3_VIRT_BASE,
390 .irq = IRQ_DOVE_UART_3,
391 .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF,
392 .iotype = UPIO_MEM,
393 .regshift = 2,
394 .uartclk = 0,
395 }, {
396 },
397};
398
399static struct resource dove_uart3_resources[] = {
400 {
401 .start = DOVE_UART3_PHYS_BASE,
402 .end = DOVE_UART3_PHYS_BASE + SZ_256 - 1,
403 .flags = IORESOURCE_MEM,
404 }, {
405 .start = IRQ_DOVE_UART_3,
406 .end = IRQ_DOVE_UART_3,
407 .flags = IORESOURCE_IRQ,
408 },
409};
410
411static struct platform_device dove_uart3 = {
412 .name = "serial8250",
413 .id = 3,
414 .dev = {
415 .platform_data = dove_uart3_data,
416 },
417 .resource = dove_uart3_resources,
418 .num_resources = ARRAY_SIZE(dove_uart3_resources),
419};
420
421void __init dove_uart3_init(void)
422{
423 platform_device_register(&dove_uart3);
424}
425
426/*****************************************************************************
427 * SPI0
428 ****************************************************************************/
429static struct orion_spi_info dove_spi0_data = {
430 .tclk = 0,
431};
432
433static struct resource dove_spi0_resources[] = {
434 {
435 .start = DOVE_SPI0_PHYS_BASE,
436 .end = DOVE_SPI0_PHYS_BASE + SZ_512 - 1,
437 .flags = IORESOURCE_MEM,
438 }, {
439 .start = IRQ_DOVE_SPI0,
440 .end = IRQ_DOVE_SPI0,
441 .flags = IORESOURCE_IRQ,
442 },
443};
444
445static struct platform_device dove_spi0 = {
446 .name = "orion_spi",
447 .id = 0,
448 .resource = dove_spi0_resources,
449 .dev = {
450 .platform_data = &dove_spi0_data,
451 },
452 .num_resources = ARRAY_SIZE(dove_spi0_resources),
453};
454
455void __init dove_spi0_init(void)
456{
457 platform_device_register(&dove_spi0);
458}
459
460/*****************************************************************************
461 * SPI1
462 ****************************************************************************/
463static struct orion_spi_info dove_spi1_data = {
464 .tclk = 0,
465};
466
467static struct resource dove_spi1_resources[] = {
468 {
469 .start = DOVE_SPI1_PHYS_BASE,
470 .end = DOVE_SPI1_PHYS_BASE + SZ_512 - 1,
471 .flags = IORESOURCE_MEM,
472 }, {
473 .start = IRQ_DOVE_SPI1,
474 .end = IRQ_DOVE_SPI1,
475 .flags = IORESOURCE_IRQ,
476 },
477};
478
479static struct platform_device dove_spi1 = {
480 .name = "orion_spi",
481 .id = 1,
482 .resource = dove_spi1_resources,
483 .dev = {
484 .platform_data = &dove_spi1_data,
485 },
486 .num_resources = ARRAY_SIZE(dove_spi1_resources),
487};
488
489void __init dove_spi1_init(void)
490{
491 platform_device_register(&dove_spi1);
492}
493
494/*****************************************************************************
495 * I2C
496 ****************************************************************************/
497static struct mv64xxx_i2c_pdata dove_i2c_data = {
498 .freq_m = 10, /* assumes 166 MHz TCLK gets 94.3kHz */
499 .freq_n = 3,
500 .timeout = 1000, /* Default timeout of 1 second */
501};
502
503static struct resource dove_i2c_resources[] = {
504 {
505 .name = "i2c base",
506 .start = DOVE_I2C_PHYS_BASE,
507 .end = DOVE_I2C_PHYS_BASE + 0x20 - 1,
508 .flags = IORESOURCE_MEM,
509 }, {
510 .name = "i2c irq",
511 .start = IRQ_DOVE_I2C,
512 .end = IRQ_DOVE_I2C,
513 .flags = IORESOURCE_IRQ,
514 },
515};
516
517static struct platform_device dove_i2c = {
518 .name = MV64XXX_I2C_CTLR_NAME,
519 .id = 0,
520 .num_resources = ARRAY_SIZE(dove_i2c_resources),
521 .resource = dove_i2c_resources,
522 .dev = {
523 .platform_data = &dove_i2c_data,
524 },
525};
526
527void __init dove_i2c_init(void)
528{
529 platform_device_register(&dove_i2c);
530}
531
532/*****************************************************************************
533 * Time handling
534 ****************************************************************************/
535static int get_tclk(void)
536{
537 /* use DOVE_RESET_SAMPLE_HI/LO to detect tclk */
538 return 166666667;
539}
540
541static void dove_timer_init(void)
542{
543 orion_time_init(IRQ_DOVE_BRIDGE, get_tclk());
544}
545
546struct sys_timer dove_timer = {
547 .init = dove_timer_init,
548};
549
550/*****************************************************************************
551 * XOR
552 ****************************************************************************/
553static struct mv_xor_platform_shared_data dove_xor_shared_data = {
554 .dram = &dove_mbus_dram_info,
555};
556
557/*****************************************************************************
558 * XOR 0
559 ****************************************************************************/
560static u64 dove_xor0_dmamask = DMA_BIT_MASK(32);
561
562static struct resource dove_xor0_shared_resources[] = {
563 {
564 .name = "xor 0 low",
565 .start = DOVE_XOR0_PHYS_BASE,
566 .end = DOVE_XOR0_PHYS_BASE + 0xff,
567 .flags = IORESOURCE_MEM,
568 }, {
569 .name = "xor 0 high",
570 .start = DOVE_XOR0_HIGH_PHYS_BASE,
571 .end = DOVE_XOR0_HIGH_PHYS_BASE + 0xff,
572 .flags = IORESOURCE_MEM,
573 },
574};
575
576static struct platform_device dove_xor0_shared = {
577 .name = MV_XOR_SHARED_NAME,
578 .id = 0,
579 .dev = {
580 .platform_data = &dove_xor_shared_data,
581 },
582 .num_resources = ARRAY_SIZE(dove_xor0_shared_resources),
583 .resource = dove_xor0_shared_resources,
584};
585
586static struct resource dove_xor00_resources[] = {
587 [0] = {
588 .start = IRQ_DOVE_XOR_00,
589 .end = IRQ_DOVE_XOR_00,
590 .flags = IORESOURCE_IRQ,
591 },
592};
593
594static struct mv_xor_platform_data dove_xor00_data = {
595 .shared = &dove_xor0_shared,
596 .hw_id = 0,
597 .pool_size = PAGE_SIZE,
598};
599
600static struct platform_device dove_xor00_channel = {
601 .name = MV_XOR_NAME,
602 .id = 0,
603 .num_resources = ARRAY_SIZE(dove_xor00_resources),
604 .resource = dove_xor00_resources,
605 .dev = {
606 .dma_mask = &dove_xor0_dmamask,
607 .coherent_dma_mask = DMA_BIT_MASK(64),
608 .platform_data = (void *)&dove_xor00_data,
609 },
610};
611
612static struct resource dove_xor01_resources[] = {
613 [0] = {
614 .start = IRQ_DOVE_XOR_01,
615 .end = IRQ_DOVE_XOR_01,
616 .flags = IORESOURCE_IRQ,
617 },
618};
619
620static struct mv_xor_platform_data dove_xor01_data = {
621 .shared = &dove_xor0_shared,
622 .hw_id = 1,
623 .pool_size = PAGE_SIZE,
624};
625
626static struct platform_device dove_xor01_channel = {
627 .name = MV_XOR_NAME,
628 .id = 1,
629 .num_resources = ARRAY_SIZE(dove_xor01_resources),
630 .resource = dove_xor01_resources,
631 .dev = {
632 .dma_mask = &dove_xor0_dmamask,
633 .coherent_dma_mask = DMA_BIT_MASK(64),
634 .platform_data = (void *)&dove_xor01_data,
635 },
636};
637
638void __init dove_xor0_init(void)
639{
640 platform_device_register(&dove_xor0_shared);
641
642 /*
643 * two engines can't do memset simultaneously, this limitation
644 * satisfied by removing memset support from one of the engines.
645 */
646 dma_cap_set(DMA_MEMCPY, dove_xor00_data.cap_mask);
647 dma_cap_set(DMA_XOR, dove_xor00_data.cap_mask);
648 platform_device_register(&dove_xor00_channel);
649
650 dma_cap_set(DMA_MEMCPY, dove_xor01_data.cap_mask);
651 dma_cap_set(DMA_MEMSET, dove_xor01_data.cap_mask);
652 dma_cap_set(DMA_XOR, dove_xor01_data.cap_mask);
653 platform_device_register(&dove_xor01_channel);
654}
655
656/*****************************************************************************
657 * XOR 1
658 ****************************************************************************/
659static u64 dove_xor1_dmamask = DMA_BIT_MASK(32);
660
661static struct resource dove_xor1_shared_resources[] = {
662 {
663 .name = "xor 0 low",
664 .start = DOVE_XOR1_PHYS_BASE,
665 .end = DOVE_XOR1_PHYS_BASE + 0xff,
666 .flags = IORESOURCE_MEM,
667 }, {
668 .name = "xor 0 high",
669 .start = DOVE_XOR1_HIGH_PHYS_BASE,
670 .end = DOVE_XOR1_HIGH_PHYS_BASE + 0xff,
671 .flags = IORESOURCE_MEM,
672 },
673};
674
675static struct platform_device dove_xor1_shared = {
676 .name = MV_XOR_SHARED_NAME,
677 .id = 1,
678 .dev = {
679 .platform_data = &dove_xor_shared_data,
680 },
681 .num_resources = ARRAY_SIZE(dove_xor1_shared_resources),
682 .resource = dove_xor1_shared_resources,
683};
684
685static struct resource dove_xor10_resources[] = {
686 [0] = {
687 .start = IRQ_DOVE_XOR_10,
688 .end = IRQ_DOVE_XOR_10,
689 .flags = IORESOURCE_IRQ,
690 },
691};
692
693static struct mv_xor_platform_data dove_xor10_data = {
694 .shared = &dove_xor1_shared,
695 .hw_id = 0,
696 .pool_size = PAGE_SIZE,
697};
698
699static struct platform_device dove_xor10_channel = {
700 .name = MV_XOR_NAME,
701 .id = 2,
702 .num_resources = ARRAY_SIZE(dove_xor10_resources),
703 .resource = dove_xor10_resources,
704 .dev = {
705 .dma_mask = &dove_xor1_dmamask,
706 .coherent_dma_mask = DMA_BIT_MASK(64),
707 .platform_data = (void *)&dove_xor10_data,
708 },
709};
710
711static struct resource dove_xor11_resources[] = {
712 [0] = {
713 .start = IRQ_DOVE_XOR_11,
714 .end = IRQ_DOVE_XOR_11,
715 .flags = IORESOURCE_IRQ,
716 },
717};
718
719static struct mv_xor_platform_data dove_xor11_data = {
720 .shared = &dove_xor1_shared,
721 .hw_id = 1,
722 .pool_size = PAGE_SIZE,
723};
724
725static struct platform_device dove_xor11_channel = {
726 .name = MV_XOR_NAME,
727 .id = 3,
728 .num_resources = ARRAY_SIZE(dove_xor11_resources),
729 .resource = dove_xor11_resources,
730 .dev = {
731 .dma_mask = &dove_xor1_dmamask,
732 .coherent_dma_mask = DMA_BIT_MASK(64),
733 .platform_data = (void *)&dove_xor11_data,
734 },
735};
736
737void __init dove_xor1_init(void)
738{
739 platform_device_register(&dove_xor1_shared);
740
741 /*
742 * two engines can't do memset simultaneously, this limitation
743 * satisfied by removing memset support from one of the engines.
744 */
745 dma_cap_set(DMA_MEMCPY, dove_xor10_data.cap_mask);
746 dma_cap_set(DMA_XOR, dove_xor10_data.cap_mask);
747 platform_device_register(&dove_xor10_channel);
748
749 dma_cap_set(DMA_MEMCPY, dove_xor11_data.cap_mask);
750 dma_cap_set(DMA_MEMSET, dove_xor11_data.cap_mask);
751 dma_cap_set(DMA_XOR, dove_xor11_data.cap_mask);
752 platform_device_register(&dove_xor11_channel);
753}
754
755void __init dove_init(void)
756{
757 int tclk;
758
759 tclk = get_tclk();
760
761 printk(KERN_INFO "Dove 88AP510 SoC, ");
762 printk(KERN_INFO "TCLK = %dMHz\n", (tclk + 499999) / 1000000);
763
764#ifdef CONFIG_CACHE_TAUROS2
765 tauros2_init();
766#endif
767 dove_setup_cpu_mbus();
768
769 dove_ge00_shared_data.t_clk = tclk;
770 dove_uart0_data[0].uartclk = tclk;
771 dove_uart1_data[0].uartclk = tclk;
772 dove_uart2_data[0].uartclk = tclk;
773 dove_uart3_data[0].uartclk = tclk;
774 dove_spi0_data.tclk = tclk;
775 dove_spi1_data.tclk = tclk;
776
777 /* internal devices that every board has */
778 dove_rtc_init();
779 dove_xor0_init();
780 dove_xor1_init();
781}
diff --git a/arch/arm/mach-dove/common.h b/arch/arm/mach-dove/common.h
new file mode 100644
index 000000000000..b29e8937de4f
--- /dev/null
+++ b/arch/arm/mach-dove/common.h
@@ -0,0 +1,40 @@
1/*
2 * arch/arm/mach-dove/common.h
3 *
4 * Core functions for Marvell Dove 88AP510 System On Chip
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
11#ifndef __ARCH_DOVE_COMMON_H
12#define __ARCH_DOVE_COMMON_H
13
14struct mv643xx_eth_platform_data;
15struct mv_sata_platform_data;
16
17extern struct sys_timer dove_timer;
18extern struct mbus_dram_target_info dove_mbus_dram_info;
19
20/*
21 * Basic Dove init functions used early by machine-setup.
22 */
23void dove_map_io(void);
24void dove_init(void);
25void dove_init_irq(void);
26void dove_setup_cpu_mbus(void);
27void dove_ge00_init(struct mv643xx_eth_platform_data *eth_data);
28void dove_sata_init(struct mv_sata_platform_data *sata_data);
29void dove_pcie_init(int init_port0, int init_port1);
30void dove_ehci0_init(void);
31void dove_ehci1_init(void);
32void dove_uart0_init(void);
33void dove_uart1_init(void);
34void dove_uart2_init(void);
35void dove_uart3_init(void);
36void dove_spi0_init(void);
37void dove_spi1_init(void);
38void dove_i2c_init(void);
39
40#endif
diff --git a/arch/arm/mach-dove/dove-db-setup.c b/arch/arm/mach-dove/dove-db-setup.c
new file mode 100644
index 000000000000..f2971b745224
--- /dev/null
+++ b/arch/arm/mach-dove/dove-db-setup.c
@@ -0,0 +1,102 @@
1/*
2 * arch/arm/mach-dove/dove-db-setup.c
3 *
4 * Marvell DB-MV88AP510-BP Development Board Setup
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
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/platform_device.h>
14#include <linux/irq.h>
15#include <linux/mtd/physmap.h>
16#include <linux/mtd/nand.h>
17#include <linux/timer.h>
18#include <linux/ata_platform.h>
19#include <linux/mv643xx_eth.h>
20#include <linux/i2c.h>
21#include <linux/pci.h>
22#include <linux/spi/spi.h>
23#include <linux/spi/orion_spi.h>
24#include <linux/spi/flash.h>
25#include <linux/gpio.h>
26#include <asm/mach-types.h>
27#include <asm/mach/arch.h>
28#include <mach/dove.h>
29#include "common.h"
30
31static struct mv643xx_eth_platform_data dove_db_ge00_data = {
32 .phy_addr = MV643XX_ETH_PHY_ADDR_DEFAULT,
33};
34
35static struct mv_sata_platform_data dove_db_sata_data = {
36 .n_ports = 1,
37};
38
39/*****************************************************************************
40 * SPI Devices:
41 * SPI0: 4M Flash ST-M25P32-VMF6P
42 ****************************************************************************/
43static const struct flash_platform_data dove_db_spi_flash_data = {
44 .type = "m25p64",
45};
46
47static struct spi_board_info __initdata dove_db_spi_flash_info[] = {
48 {
49 .modalias = "m25p80",
50 .platform_data = &dove_db_spi_flash_data,
51 .irq = -1,
52 .max_speed_hz = 20000000,
53 .bus_num = 0,
54 .chip_select = 0,
55 },
56};
57
58/*****************************************************************************
59 * PCI
60 ****************************************************************************/
61static int __init dove_db_pci_init(void)
62{
63 if (machine_is_dove_db())
64 dove_pcie_init(1, 1);
65
66 return 0;
67}
68
69subsys_initcall(dove_db_pci_init);
70
71/*****************************************************************************
72 * Board Init
73 ****************************************************************************/
74static void __init dove_db_init(void)
75{
76 /*
77 * Basic Dove setup. Needs to be called early.
78 */
79 dove_init();
80
81 dove_ge00_init(&dove_db_ge00_data);
82 dove_ehci0_init();
83 dove_ehci1_init();
84 dove_sata_init(&dove_db_sata_data);
85 dove_spi0_init();
86 dove_spi1_init();
87 dove_uart0_init();
88 dove_uart1_init();
89 dove_i2c_init();
90 spi_register_board_info(dove_db_spi_flash_info,
91 ARRAY_SIZE(dove_db_spi_flash_info));
92}
93
94MACHINE_START(DOVE_DB, "Marvell DB-MV88AP510-BP Development Board")
95 .phys_io = DOVE_SB_REGS_PHYS_BASE,
96 .io_pg_offst = ((DOVE_SB_REGS_VIRT_BASE) >> 18) & 0xfffc,
97 .boot_params = 0x00000100,
98 .init_machine = dove_db_init,
99 .map_io = dove_map_io,
100 .init_irq = dove_init_irq,
101 .timer = &dove_timer,
102MACHINE_END
diff --git a/arch/arm/mach-dove/include/mach/bridge-regs.h b/arch/arm/mach-dove/include/mach/bridge-regs.h
new file mode 100644
index 000000000000..214a4c31f069
--- /dev/null
+++ b/arch/arm/mach-dove/include/mach/bridge-regs.h
@@ -0,0 +1,58 @@
1/*
2 * arch/arm/mach-dove/include/mach/bridge-regs.h
3 *
4 * Mbus-L to Mbus Bridge Registers
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
11#ifndef __ASM_ARCH_BRIDGE_REGS_H
12#define __ASM_ARCH_BRIDGE_REGS_H
13
14#include <mach/dove.h>
15
16#define CPU_CONFIG (BRIDGE_VIRT_BASE | 0x0000)
17
18#define CPU_CONTROL (BRIDGE_VIRT_BASE | 0x0104)
19#define CPU_CTRL_PCIE0_LINK 0x00000001
20#define CPU_RESET 0x00000002
21#define CPU_CTRL_PCIE1_LINK 0x00000008
22
23#define RSTOUTn_MASK (BRIDGE_VIRT_BASE | 0x0108)
24#define SOFT_RESET_OUT_EN 0x00000004
25
26#define SYSTEM_SOFT_RESET (BRIDGE_VIRT_BASE | 0x010c)
27#define SOFT_RESET 0x00000001
28
29#define BRIDGE_CAUSE (BRIDGE_VIRT_BASE | 0x0110)
30#define BRIDGE_MASK (BRIDGE_VIRT_BASE | 0x0114)
31#define BRIDGE_INT_TIMER0 0x0002
32#define BRIDGE_INT_TIMER1 0x0004
33#define BRIDGE_INT_TIMER1_CLR (~0x0004)
34
35#define IRQ_VIRT_BASE (BRIDGE_VIRT_BASE | 0x0200)
36#define IRQ_CAUSE_LOW_OFF 0x0000
37#define IRQ_MASK_LOW_OFF 0x0004
38#define FIQ_MASK_LOW_OFF 0x0008
39#define ENDPOINT_MASK_LOW_OFF 0x000c
40#define IRQ_CAUSE_HIGH_OFF 0x0010
41#define IRQ_MASK_HIGH_OFF 0x0014
42#define FIQ_MASK_HIGH_OFF 0x0018
43#define ENDPOINT_MASK_HIGH_OFF 0x001c
44#define PCIE_INTERRUPT_MASK_OFF 0x0020
45
46#define IRQ_MASK_LOW (IRQ_VIRT_BASE + IRQ_MASK_LOW_OFF)
47#define FIQ_MASK_LOW (IRQ_VIRT_BASE + FIQ_MASK_LOW_OFF)
48#define ENDPOINT_MASK_LOW (IRQ_VIRT_BASE + ENDPOINT_MASK_LOW_OFF)
49#define IRQ_MASK_HIGH (IRQ_VIRT_BASE + IRQ_MASK_HIGH_OFF)
50#define FIQ_MASK_HIGH (IRQ_VIRT_BASE + FIQ_MASK_HIGH_OFF)
51#define ENDPOINT_MASK_HIGH (IRQ_VIRT_BASE + ENDPOINT_MASK_HIGH_OFF)
52#define PCIE_INTERRUPT_MASK (IRQ_VIRT_BASE + PCIE_INTERRUPT_MASK_OFF)
53
54#define POWER_MANAGEMENT (BRIDGE_VIRT_BASE | 0x011c)
55
56#define TIMER_VIRT_BASE (BRIDGE_VIRT_BASE | 0x0300)
57
58#endif
diff --git a/arch/arm/mach-dove/include/mach/debug-macro.S b/arch/arm/mach-dove/include/mach/debug-macro.S
new file mode 100644
index 000000000000..9b89ec7d3040
--- /dev/null
+++ b/arch/arm/mach-dove/include/mach/debug-macro.S
@@ -0,0 +1,20 @@
1/*
2 * arch/arm/mach-dove/include/mach/debug-macro.S
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7*/
8
9#include <mach/bridge-regs.h>
10
11 .macro addruart,rx
12 mrc p15, 0, \rx, c1, c0
13 tst \rx, #1 @ MMU enabled?
14 ldreq \rx, =DOVE_SB_REGS_PHYS_BASE
15 ldrne \rx, =DOVE_SB_REGS_VIRT_BASE
16 orr \rx, \rx, #0x00012000
17 .endm
18
19#define UART_SHIFT 2
20#include <asm/hardware/debug-8250.S>
diff --git a/arch/arm/mach-dove/include/mach/dove.h b/arch/arm/mach-dove/include/mach/dove.h
new file mode 100644
index 000000000000..f6a08397f046
--- /dev/null
+++ b/arch/arm/mach-dove/include/mach/dove.h
@@ -0,0 +1,180 @@
1/*
2 * arch/arm/mach-dove/include/mach/dove.h
3 *
4 * Generic definitions for Marvell Dove 88AP510 SoC
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
11#ifndef __ASM_ARCH_DOVE_H
12#define __ASM_ARCH_DOVE_H
13
14#include <mach/vmalloc.h>
15
16/*
17 * Marvell Dove address maps.
18 *
19 * phys virt size
20 * c8000000 fdb00000 1M Cryptographic SRAM
21 * e0000000 @runtime 128M PCIe-0 Memory space
22 * e8000000 @runtime 128M PCIe-1 Memory space
23 * f1000000 fde00000 8M on-chip south-bridge registers
24 * f1800000 fe600000 8M on-chip north-bridge registers
25 * f2000000 fee00000 1M PCIe-0 I/O space
26 * f2100000 fef00000 1M PCIe-1 I/O space
27 */
28
29#define DOVE_CESA_PHYS_BASE 0xc8000000
30#define DOVE_CESA_VIRT_BASE 0xfdb00000
31#define DOVE_CESA_SIZE SZ_1M
32
33#define DOVE_PCIE0_MEM_PHYS_BASE 0xe0000000
34#define DOVE_PCIE0_MEM_SIZE SZ_128M
35
36#define DOVE_PCIE1_MEM_PHYS_BASE 0xe8000000
37#define DOVE_PCIE1_MEM_SIZE SZ_128M
38
39#define DOVE_BOOTROM_PHYS_BASE 0xf8000000
40#define DOVE_BOOTROM_SIZE SZ_128M
41
42#define DOVE_SCRATCHPAD_PHYS_BASE 0xf0000000
43#define DOVE_SCRATCHPAD_VIRT_BASE 0xfdd00000
44#define DOVE_SCRATCHPAD_SIZE SZ_1M
45
46#define DOVE_SB_REGS_PHYS_BASE 0xf1000000
47#define DOVE_SB_REGS_VIRT_BASE 0xfde00000
48#define DOVE_SB_REGS_SIZE SZ_8M
49
50#define DOVE_NB_REGS_PHYS_BASE 0xf1800000
51#define DOVE_NB_REGS_VIRT_BASE 0xfe600000
52#define DOVE_NB_REGS_SIZE SZ_8M
53
54#define DOVE_PCIE0_IO_PHYS_BASE 0xf2000000
55#define DOVE_PCIE0_IO_VIRT_BASE 0xfee00000
56#define DOVE_PCIE0_IO_BUS_BASE 0x00000000
57#define DOVE_PCIE0_IO_SIZE SZ_1M
58
59#define DOVE_PCIE1_IO_PHYS_BASE 0xf2100000
60#define DOVE_PCIE1_IO_VIRT_BASE 0xfef00000
61#define DOVE_PCIE1_IO_BUS_BASE 0x00100000
62#define DOVE_PCIE1_IO_SIZE SZ_1M
63
64/*
65 * Dove Core Registers Map
66 */
67
68/* SPI, I2C, UART */
69#define DOVE_I2C_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x11000)
70#define DOVE_UART0_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x12000)
71#define DOVE_UART0_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0x12000)
72#define DOVE_UART1_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x12100)
73#define DOVE_UART1_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0x12100)
74#define DOVE_UART2_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x12200)
75#define DOVE_UART2_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0x12200)
76#define DOVE_UART3_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x12300)
77#define DOVE_UART3_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0x12300)
78#define DOVE_SPI0_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x10600)
79#define DOVE_SPI1_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x14600)
80
81/* North-South Bridge */
82#define BRIDGE_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0x20000)
83
84/* Cryptographic Engine */
85#define DOVE_CRYPT_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x30000)
86
87/* PCIe 0 */
88#define DOVE_PCIE0_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0x40000)
89
90/* USB */
91#define DOVE_USB0_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x50000)
92#define DOVE_USB1_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x51000)
93
94/* XOR 0 Engine */
95#define DOVE_XOR0_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x60800)
96#define DOVE_XOR0_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0x60800)
97#define DOVE_XOR0_HIGH_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x60A00)
98#define DOVE_XOR0_HIGH_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0x60A00)
99
100/* XOR 1 Engine */
101#define DOVE_XOR1_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x60900)
102#define DOVE_XOR1_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0x60900)
103#define DOVE_XOR1_HIGH_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x60B00)
104#define DOVE_XOR1_HIGH_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0x60B00)
105
106/* Gigabit Ethernet */
107#define DOVE_GE00_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x70000)
108
109/* PCIe 1 */
110#define DOVE_PCIE1_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0x80000)
111
112/* CAFE */
113#define DOVE_SDIO0_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x92000)
114#define DOVE_SDIO1_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x90000)
115#define DOVE_CAM_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x94000)
116#define DOVE_CAFE_WIN_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x98000)
117
118/* SATA */
119#define DOVE_SATA_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0xa0000)
120
121/* I2S/SPDIF */
122#define DOVE_AUD0_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0xb0000)
123#define DOVE_AUD1_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0xb4000)
124
125/* NAND Flash Controller */
126#define DOVE_NFC_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0xc0000)
127
128/* MPP, GPIO, Reset Sampling */
129#define DOVE_MPP_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0xd0200)
130#define DOVE_PMU_MPP_GENERAL_CTRL (DOVE_MPP_VIRT_BASE + 0x10)
131#define DOVE_RESET_SAMPLE_LO (DOVE_MPP_VIRT_BASE | 0x014)
132#define DOVE_RESET_SAMPLE_HI (DOVE_MPP_VIRT_BASE | 0x018)
133#define DOVE_GPIO_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0xd0400)
134#define DOVE_MPP_GENERAL_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0xe803c)
135#define DOVE_AU1_SPDIFO_GPIO_EN (1 << 1)
136#define DOVE_NAND_GPIO_EN (1 << 0)
137#define DOVE_MPP_CTRL4_VIRT_BASE (DOVE_GPIO_VIRT_BASE + 0x40)
138
139
140/* Power Management */
141#define DOVE_PMU_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0xd0000)
142
143/* Real Time Clock */
144#define DOVE_RTC_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0xd8500)
145
146/* AC97 */
147#define DOVE_AC97_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0xe0000)
148#define DOVE_AC97_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0xe0000)
149
150/* Peripheral DMA */
151#define DOVE_PDMA_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0xe4000)
152#define DOVE_PDMA_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0xe4000)
153
154#define DOVE_GLOBAL_CONFIG_1 (DOVE_SB_REGS_VIRT_BASE | 0xe802C)
155#define DOVE_TWSI_ENABLE_OPTION1 (1 << 7)
156#define DOVE_GLOBAL_CONFIG_2 (DOVE_SB_REGS_VIRT_BASE | 0xe8030)
157#define DOVE_TWSI_ENABLE_OPTION2 (1 << 20)
158#define DOVE_TWSI_ENABLE_OPTION3 (1 << 21)
159#define DOVE_TWSI_OPTION3_GPIO (1 << 22)
160#define DOVE_SSP_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0xec000)
161#define DOVE_SSP_CTRL_STATUS_1 (DOVE_SB_REGS_VIRT_BASE | 0xe8034)
162#define DOVE_SSP_ON_AU1 (1 << 0)
163#define DOVE_SSP_CLOCK_ENABLE (1 << 1)
164#define DOVE_SSP_BPB_CLOCK_SRC_SSP (1 << 11)
165/* Memory Controller */
166#define DOVE_MC_VIRT_BASE (DOVE_NB_REGS_VIRT_BASE | 0x00000)
167
168/* LCD Controller */
169#define DOVE_LCD_PHYS_BASE (DOVE_NB_REGS_PHYS_BASE | 0x10000)
170#define DOVE_LCD1_PHYS_BASE (DOVE_NB_REGS_PHYS_BASE | 0x20000)
171#define DOVE_LCD2_PHYS_BASE (DOVE_NB_REGS_PHYS_BASE | 0x10000)
172#define DOVE_LCD_DCON_PHYS_BASE (DOVE_NB_REGS_PHYS_BASE | 0x30000)
173
174/* Graphic Engine */
175#define DOVE_GPU_PHYS_BASE (DOVE_NB_REGS_PHYS_BASE | 0x40000)
176
177/* Video Engine */
178#define DOVE_VPU_PHYS_BASE (DOVE_NB_REGS_PHYS_BASE | 0x400000)
179
180#endif
diff --git a/arch/arm/mach-dove/include/mach/entry-macro.S b/arch/arm/mach-dove/include/mach/entry-macro.S
new file mode 100644
index 000000000000..e84c78c2a8b7
--- /dev/null
+++ b/arch/arm/mach-dove/include/mach/entry-macro.S
@@ -0,0 +1,39 @@
1/*
2 * arch/arm/mach-dove/include/mach/entry-macro.S
3 *
4 * Low-level IRQ helper macros for Marvell Dove 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
11#include <mach/bridge-regs.h>
12
13 .macro disable_fiq
14 .endm
15
16 .macro arch_ret_to_user, tmp1, tmp2
17 .endm
18
19 .macro get_irqnr_preamble, base, tmp
20 ldr \base, =IRQ_VIRT_BASE
21 .endm
22
23 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
24 @ check low interrupts
25 ldr \irqstat, [\base, #IRQ_CAUSE_LOW_OFF]
26 ldr \tmp, [\base, #IRQ_MASK_LOW_OFF]
27 mov \irqnr, #31
28 ands \irqstat, \irqstat, \tmp
29
30 @ if no low interrupts set, check high interrupts
31 ldreq \irqstat, [\base, #IRQ_CAUSE_HIGH_OFF]
32 ldreq \tmp, [\base, #IRQ_MASK_HIGH_OFF]
33 moveq \irqnr, #63
34 andeqs \irqstat, \irqstat, \tmp
35
36 @ find first active interrupt source
37 clzne \irqstat, \irqstat
38 subne \irqnr, \irqnr, \irqstat
39 .endm
diff --git a/arch/arm/mach-dove/include/mach/gpio.h b/arch/arm/mach-dove/include/mach/gpio.h
new file mode 100644
index 000000000000..0ee70ff39e11
--- /dev/null
+++ b/arch/arm/mach-dove/include/mach/gpio.h
@@ -0,0 +1,49 @@
1/*
2 * arch/arm/mach-dove/include/mach/gpio.h
3 *
4 * This file is licensed under the terms of the GNU General Public
5 * License version 2. This program is licensed "as is" without any
6 * warranty of any kind, whether express or implied.
7 */
8
9#ifndef __ASM_ARCH_GPIO_H
10#define __ASM_ARCH_GPIO_H
11
12#include <asm/errno.h>
13#include <mach/irqs.h>
14#include <plat/gpio.h>
15#include <asm-generic/gpio.h> /* cansleep wrappers */
16
17#define GPIO_MAX 64
18
19#define GPIO_BASE_LO (DOVE_GPIO_VIRT_BASE + 0x00)
20#define GPIO_BASE_HI (DOVE_GPIO_VIRT_BASE + 0x20)
21
22#define GPIO_BASE(pin) ((pin < 32) ? GPIO_BASE_LO : GPIO_BASE_HI)
23
24#define GPIO_OUT(pin) (GPIO_BASE(pin) + 0x00)
25#define GPIO_IO_CONF(pin) (GPIO_BASE(pin) + 0x04)
26#define GPIO_BLINK_EN(pin) (GPIO_BASE(pin) + 0x08)
27#define GPIO_IN_POL(pin) (GPIO_BASE(pin) + 0x0c)
28#define GPIO_DATA_IN(pin) (GPIO_BASE(pin) + 0x10)
29#define GPIO_EDGE_CAUSE(pin) (GPIO_BASE(pin) + 0x14)
30#define GPIO_EDGE_MASK(pin) (GPIO_BASE(pin) + 0x18)
31#define GPIO_LEVEL_MASK(pin) (GPIO_BASE(pin) + 0x1c)
32
33static inline int gpio_to_irq(int pin)
34{
35 if (pin < NR_GPIO_IRQS)
36 return pin + IRQ_DOVE_GPIO_START;
37
38 return -EINVAL;
39}
40
41static inline int irq_to_gpio(int irq)
42{
43 if (IRQ_DOVE_GPIO_START < irq && irq < NR_IRQS)
44 return irq - IRQ_DOVE_GPIO_START;
45
46 return -EINVAL;
47}
48
49#endif
diff --git a/arch/arm/mach-dove/include/mach/hardware.h b/arch/arm/mach-dove/include/mach/hardware.h
new file mode 100644
index 000000000000..32b0826e7873
--- /dev/null
+++ b/arch/arm/mach-dove/include/mach/hardware.h
@@ -0,0 +1,26 @@
1/*
2 * arch/arm/mach-dove/include/mach/hardware.h
3 *
4 * This file is licensed under the terms of the GNU General Public
5 * License version 2. This program is licensed "as is" without any
6 * warranty of any kind, whether express or implied.
7 */
8
9#ifndef __ASM_ARCH_HARDWARE_H
10#define __ASM_ARCH_HARDWARE_H
11
12#include "dove.h"
13
14#define pcibios_assign_all_busses() 1
15
16#define PCIBIOS_MIN_IO 0x1000
17#define PCIBIOS_MIN_MEM 0x01000000
18#define PCIMEM_BASE DOVE_PCIE0_MEM_PHYS_BASE
19
20
21/* Macros below are required for compatibility with PXA AC'97 driver. */
22#define __REG(x) (*((volatile u32 *)((x) - DOVE_SB_REGS_PHYS_BASE + \
23 DOVE_SB_REGS_VIRT_BASE)))
24#define __PREG(x) (((u32)&(x)) - DOVE_SB_REGS_VIRT_BASE + \
25 DOVE_SB_REGS_PHYS_BASE)
26#endif
diff --git a/arch/arm/mach-dove/include/mach/io.h b/arch/arm/mach-dove/include/mach/io.h
new file mode 100644
index 000000000000..3b3e4721ce2e
--- /dev/null
+++ b/arch/arm/mach-dove/include/mach/io.h
@@ -0,0 +1,20 @@
1/*
2 * arch/arm/mach-dove/include/mach/io.h
3 *
4 * This file is licensed under the terms of the GNU General Public
5 * License version 2. This program is licensed "as is" without any
6 * warranty of any kind, whether express or implied.
7 */
8
9#ifndef __ASM_ARCH_IO_H
10#define __ASM_ARCH_IO_H
11
12#include "dove.h"
13
14#define IO_SPACE_LIMIT 0xffffffff
15
16#define __io(a) ((void __iomem *)(((a) - DOVE_PCIE0_IO_PHYS_BASE) +\
17 DOVE_PCIE0_IO_VIRT_BASE))
18#define __mem_pci(a) (a)
19
20#endif
diff --git a/arch/arm/mach-dove/include/mach/irqs.h b/arch/arm/mach-dove/include/mach/irqs.h
new file mode 100644
index 000000000000..46681466f92b
--- /dev/null
+++ b/arch/arm/mach-dove/include/mach/irqs.h
@@ -0,0 +1,101 @@
1/*
2 * arch/arm/mach-dove/include/mach/irqs.h
3 *
4 * IRQ definitions for Marvell Dove 88AP510 SoC
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
11#ifndef __ASM_ARCH_IRQS_H
12#define __ASM_ARCH_IRQS_H
13
14/*
15 * Dove Low Interrupt Controller
16 */
17#define IRQ_DOVE_BRIDGE 0
18#define IRQ_DOVE_H2C 1
19#define IRQ_DOVE_C2H 2
20#define IRQ_DOVE_NAND 3
21#define IRQ_DOVE_PDMA 4
22#define IRQ_DOVE_SPI1 5
23#define IRQ_DOVE_SPI0 6
24#define IRQ_DOVE_UART_0 7
25#define IRQ_DOVE_UART_1 8
26#define IRQ_DOVE_UART_2 9
27#define IRQ_DOVE_UART_3 10
28#define IRQ_DOVE_I2C 11
29#define IRQ_DOVE_GPIO_0_7 12
30#define IRQ_DOVE_GPIO_8_15 13
31#define IRQ_DOVE_GPIO_16_23 14
32#define IRQ_DOVE_PCIE0_ERR 15
33#define IRQ_DOVE_PCIE0 16
34#define IRQ_DOVE_PCIE1_ERR 17
35#define IRQ_DOVE_PCIE1 18
36#define IRQ_DOVE_I2S0 19
37#define IRQ_DOVE_I2S0_ERR 20
38#define IRQ_DOVE_I2S1 21
39#define IRQ_DOVE_I2S1_ERR 22
40#define IRQ_DOVE_USB_ERR 23
41#define IRQ_DOVE_USB0 24
42#define IRQ_DOVE_USB1 25
43#define IRQ_DOVE_GE00_RX 26
44#define IRQ_DOVE_GE00_TX 27
45#define IRQ_DOVE_GE00_MISC 28
46#define IRQ_DOVE_GE00_SUM 29
47#define IRQ_DOVE_GE00_ERR 30
48#define IRQ_DOVE_CRYPTO 31
49
50/*
51 * Dove High Interrupt Controller
52 */
53#define IRQ_DOVE_AC97 32
54#define IRQ_DOVE_PMU 33
55#define IRQ_DOVE_CAM 34
56#define IRQ_DOVE_SDIO0 35
57#define IRQ_DOVE_SDIO1 36
58#define IRQ_DOVE_SDIO0_WAKEUP 37
59#define IRQ_DOVE_SDIO1_WAKEUP 38
60#define IRQ_DOVE_XOR_00 39
61#define IRQ_DOVE_XOR_01 40
62#define IRQ_DOVE_XOR0_ERR 41
63#define IRQ_DOVE_XOR_10 42
64#define IRQ_DOVE_XOR_11 43
65#define IRQ_DOVE_XOR1_ERR 44
66#define IRQ_DOVE_LCD_DCON 45
67#define IRQ_DOVE_LCD1 46
68#define IRQ_DOVE_LCD0 47
69#define IRQ_DOVE_GPU 48
70#define IRQ_DOVE_PERFORM_MNTR 49
71#define IRQ_DOVE_VPRO_DMA1 51
72#define IRQ_DOVE_SSP_TIMER 54
73#define IRQ_DOVE_SSP 55
74#define IRQ_DOVE_MC_L2_ERR 56
75#define IRQ_DOVE_CRYPTO_ERR 59
76#define IRQ_DOVE_GPIO_24_31 60
77#define IRQ_DOVE_HIGH_GPIO 61
78#define IRQ_DOVE_SATA 62
79
80/*
81 * DOVE General Purpose Pins
82 */
83#define IRQ_DOVE_GPIO_START 64
84#define NR_GPIO_IRQS 64
85
86/*
87 * PMU interrupts
88 */
89#define IRQ_DOVE_PMU_START (IRQ_DOVE_GPIO_START + NR_GPIO_IRQS)
90#define NR_PMU_IRQS 7
91#define IRQ_DOVE_RTC (IRQ_DOVE_PMU_START + 5)
92
93#define NR_IRQS (IRQ_DOVE_PMU_START + NR_PMU_IRQS)
94
95/* Required for compatability with PXA AC97 driver. */
96#define IRQ_AC97 IRQ_DOVE_AC97
97/* Required for compatability with PXA DMA driver. */
98#define IRQ_DMA IRQ_DOVE_PDMA
99/* Required for compatability with PXA NAND driver */
100#define IRQ_NAND IRQ_DOVE_NAND
101#endif
diff --git a/arch/arm/mach-dove/include/mach/memory.h b/arch/arm/mach-dove/include/mach/memory.h
new file mode 100644
index 000000000000..d66872074946
--- /dev/null
+++ b/arch/arm/mach-dove/include/mach/memory.h
@@ -0,0 +1,10 @@
1/*
2 * arch/arm/mach-dove/include/mach/memory.h
3 */
4
5#ifndef __ASM_ARCH_MEMORY_H
6#define __ASM_ARCH_MEMORY_H
7
8#define PHYS_OFFSET UL(0x00000000)
9
10#endif
diff --git a/arch/arm/mach-dove/include/mach/pm.h b/arch/arm/mach-dove/include/mach/pm.h
new file mode 100644
index 000000000000..3ad9f946a9e8
--- /dev/null
+++ b/arch/arm/mach-dove/include/mach/pm.h
@@ -0,0 +1,54 @@
1/*
2 * arch/arm/mach-dove/include/mach/pm.h
3 *
4 * This file is licensed under the terms of the GNU General Public
5 * License version 2. This program is licensed "as is" without any
6 * warranty of any kind, whether express or implied.
7 */
8
9#ifndef __ASM_ARCH_PM_H
10#define __ASM_ARCH_PM_H
11
12#include <asm/errno.h>
13#include <mach/irqs.h>
14
15#define CLOCK_GATING_CONTROL (DOVE_PMU_VIRT_BASE + 0x38)
16#define CLOCK_GATING_USB0_MASK (1 << 0)
17#define CLOCK_GATING_USB1_MASK (1 << 1)
18#define CLOCK_GATING_GBE_MASK (1 << 2)
19#define CLOCK_GATING_SATA_MASK (1 << 3)
20#define CLOCK_GATING_PCIE0_MASK (1 << 4)
21#define CLOCK_GATING_PCIE1_MASK (1 << 5)
22#define CLOCK_GATING_SDIO0_MASK (1 << 8)
23#define CLOCK_GATING_SDIO1_MASK (1 << 9)
24#define CLOCK_GATING_NAND_MASK (1 << 10)
25#define CLOCK_GATING_CAMERA_MASK (1 << 11)
26#define CLOCK_GATING_I2S0_MASK (1 << 12)
27#define CLOCK_GATING_I2S1_MASK (1 << 13)
28#define CLOCK_GATING_CRYPTO_MASK (1 << 15)
29#define CLOCK_GATING_AC97_MASK (1 << 21)
30#define CLOCK_GATING_PDMA_MASK (1 << 22)
31#define CLOCK_GATING_XOR0_MASK (1 << 23)
32#define CLOCK_GATING_XOR1_MASK (1 << 24)
33#define CLOCK_GATING_GIGA_PHY_MASK (1 << 30)
34
35#define PMU_INTERRUPT_CAUSE (DOVE_PMU_VIRT_BASE + 0x50)
36#define PMU_INTERRUPT_MASK (DOVE_PMU_VIRT_BASE + 0x54)
37
38static inline int pmu_to_irq(int pin)
39{
40 if (pin < NR_PMU_IRQS)
41 return pin + IRQ_DOVE_PMU_START;
42
43 return -EINVAL;
44}
45
46static inline int irq_to_pmu(int irq)
47{
48 if (IRQ_DOVE_PMU_START < irq && irq < NR_IRQS)
49 return irq - IRQ_DOVE_PMU_START;
50
51 return -EINVAL;
52}
53
54#endif
diff --git a/arch/arm/mach-dove/include/mach/system.h b/arch/arm/mach-dove/include/mach/system.h
new file mode 100644
index 000000000000..356afda56853
--- /dev/null
+++ b/arch/arm/mach-dove/include/mach/system.h
@@ -0,0 +1,36 @@
1/*
2 * arch/arm/mach-dove/include/mach/system.h
3 *
4 * This file is licensed under the terms of the GNU General Public
5 * License version 2. This program is licensed "as is" without any
6 * warranty of any kind, whether express or implied.
7 */
8
9#ifndef __ASM_ARCH_SYSTEM_H
10#define __ASM_ARCH_SYSTEM_H
11
12#include <mach/bridge-regs.h>
13
14static inline void arch_idle(void)
15{
16 cpu_do_idle();
17}
18
19static inline void arch_reset(char mode, const char *cmd)
20{
21 /*
22 * Enable soft reset to assert RSTOUTn.
23 */
24 writel(SOFT_RESET_OUT_EN, RSTOUTn_MASK);
25
26 /*
27 * Assert soft reset.
28 */
29 writel(SOFT_RESET, SYSTEM_SOFT_RESET);
30
31 while (1)
32 ;
33}
34
35
36#endif
diff --git a/arch/arm/mach-dove/include/mach/timex.h b/arch/arm/mach-dove/include/mach/timex.h
new file mode 100644
index 000000000000..251d538541db
--- /dev/null
+++ b/arch/arm/mach-dove/include/mach/timex.h
@@ -0,0 +1,9 @@
1/*
2 * arch/arm/mach-dove/include/mach/timex.h
3 *
4 * This file is licensed under the terms of the GNU General Public
5 * License version 2. This program is licensed "as is" without any
6 * warranty of any kind, whether express or implied.
7 */
8
9#define CLOCK_TICK_RATE (100 * HZ)
diff --git a/arch/arm/mach-dove/include/mach/uncompress.h b/arch/arm/mach-dove/include/mach/uncompress.h
new file mode 100644
index 000000000000..2c5cdd7a3eed
--- /dev/null
+++ b/arch/arm/mach-dove/include/mach/uncompress.h
@@ -0,0 +1,37 @@
1/*
2 * arch/arm/mach-dove/include/mach/uncompress.h
3 *
4 * This file is licensed under the terms of the GNU General Public
5 * License version 2. This program is licensed "as is" without any
6 * warranty of any kind, whether express or implied.
7 */
8
9#include <mach/dove.h>
10
11#define UART_THR ((volatile unsigned char *)(DOVE_UART0_PHYS_BASE + 0x0))
12#define UART_LSR ((volatile unsigned char *)(DOVE_UART0_PHYS_BASE + 0x14))
13
14#define LSR_THRE 0x20
15
16static void putc(const char c)
17{
18 int i;
19
20 for (i = 0; i < 0x1000; i++) {
21 /* Transmit fifo not full? */
22 if (*UART_LSR & LSR_THRE)
23 break;
24 }
25
26 *UART_THR = c;
27}
28
29static void flush(void)
30{
31}
32
33/*
34 * nothing to do
35 */
36#define arch_decomp_setup()
37#define arch_decomp_wdog()
diff --git a/arch/arm/mach-dove/include/mach/vmalloc.h b/arch/arm/mach-dove/include/mach/vmalloc.h
new file mode 100644
index 000000000000..8b2c974755c6
--- /dev/null
+++ b/arch/arm/mach-dove/include/mach/vmalloc.h
@@ -0,0 +1,5 @@
1/*
2 * arch/arm/mach-dove/include/mach/vmalloc.h
3 */
4
5#define VMALLOC_END 0xfd800000
diff --git a/arch/arm/mach-dove/irq.c b/arch/arm/mach-dove/irq.c
new file mode 100644
index 000000000000..61bfcb3b08c2
--- /dev/null
+++ b/arch/arm/mach-dove/irq.c
@@ -0,0 +1,133 @@
1/*
2 * arch/arm/mach-dove/irq.c
3 *
4 * Dove IRQ handling.
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
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/irq.h>
14#include <linux/gpio.h>
15#include <linux/io.h>
16#include <asm/mach/arch.h>
17#include <plat/irq.h>
18#include <asm/mach/irq.h>
19#include <mach/pm.h>
20#include <mach/bridge-regs.h>
21#include "common.h"
22
23static void gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
24{
25 int irqoff;
26 BUG_ON(irq < IRQ_DOVE_GPIO_0_7 || irq > IRQ_DOVE_HIGH_GPIO);
27
28 irqoff = irq <= IRQ_DOVE_GPIO_16_23 ? irq - IRQ_DOVE_GPIO_0_7 :
29 3 + irq - IRQ_DOVE_GPIO_24_31;
30
31 orion_gpio_irq_handler(irqoff << 3);
32 if (irq == IRQ_DOVE_HIGH_GPIO) {
33 orion_gpio_irq_handler(40);
34 orion_gpio_irq_handler(48);
35 orion_gpio_irq_handler(56);
36 }
37}
38
39static void pmu_irq_mask(unsigned int irq)
40{
41 int pin = irq_to_pmu(irq);
42 u32 u;
43
44 u = readl(PMU_INTERRUPT_MASK);
45 u &= ~(1 << (pin & 31));
46 writel(u, PMU_INTERRUPT_MASK);
47}
48
49static void pmu_irq_unmask(unsigned int irq)
50{
51 int pin = irq_to_pmu(irq);
52 u32 u;
53
54 u = readl(PMU_INTERRUPT_MASK);
55 u |= 1 << (pin & 31);
56 writel(u, PMU_INTERRUPT_MASK);
57}
58
59static void pmu_irq_ack(unsigned int irq)
60{
61 int pin = irq_to_pmu(irq);
62 u32 u;
63
64 u = ~(1 << (pin & 31));
65 writel(u, PMU_INTERRUPT_CAUSE);
66}
67
68static struct irq_chip pmu_irq_chip = {
69 .name = "pmu_irq",
70 .mask = pmu_irq_mask,
71 .unmask = pmu_irq_unmask,
72 .ack = pmu_irq_ack,
73};
74
75static void pmu_irq_handler(unsigned int irq, struct irq_desc *desc)
76{
77 unsigned long cause = readl(PMU_INTERRUPT_CAUSE);
78
79 cause &= readl(PMU_INTERRUPT_MASK);
80 if (cause == 0) {
81 do_bad_IRQ(irq, desc);
82 return;
83 }
84
85 for (irq = 0; irq < NR_PMU_IRQS; irq++) {
86 if (!(cause & (1 << irq)))
87 continue;
88 irq = pmu_to_irq(irq);
89 desc = irq_desc + irq;
90 desc_handle_irq(irq, desc);
91 }
92}
93
94void __init dove_init_irq(void)
95{
96 int i;
97
98 orion_irq_init(0, (void __iomem *)(IRQ_VIRT_BASE + IRQ_MASK_LOW_OFF));
99 orion_irq_init(32, (void __iomem *)(IRQ_VIRT_BASE + IRQ_MASK_HIGH_OFF));
100
101 /*
102 * Mask and clear GPIO IRQ interrupts.
103 */
104 writel(0, GPIO_LEVEL_MASK(0));
105 writel(0, GPIO_EDGE_MASK(0));
106 writel(0, GPIO_EDGE_CAUSE(0));
107
108 /*
109 * Mask and clear PMU interrupts
110 */
111 writel(0, PMU_INTERRUPT_MASK);
112 writel(0, PMU_INTERRUPT_CAUSE);
113
114 for (i = IRQ_DOVE_GPIO_START; i < IRQ_DOVE_PMU_START; i++) {
115 set_irq_chip(i, &orion_gpio_irq_chip);
116 set_irq_handler(i, handle_level_irq);
117 irq_desc[i].status |= IRQ_LEVEL;
118 set_irq_flags(i, IRQF_VALID);
119 }
120 set_irq_chained_handler(IRQ_DOVE_GPIO_0_7, gpio_irq_handler);
121 set_irq_chained_handler(IRQ_DOVE_GPIO_8_15, gpio_irq_handler);
122 set_irq_chained_handler(IRQ_DOVE_GPIO_16_23, gpio_irq_handler);
123 set_irq_chained_handler(IRQ_DOVE_GPIO_24_31, gpio_irq_handler);
124 set_irq_chained_handler(IRQ_DOVE_HIGH_GPIO, gpio_irq_handler);
125
126 for (i = IRQ_DOVE_PMU_START; i < NR_IRQS; i++) {
127 set_irq_chip(i, &pmu_irq_chip);
128 set_irq_handler(i, handle_level_irq);
129 irq_desc[i].status |= IRQ_LEVEL;
130 set_irq_flags(i, IRQF_VALID);
131 }
132 set_irq_chained_handler(IRQ_DOVE_PMU, pmu_irq_handler);
133}
diff --git a/arch/arm/mach-dove/pcie.c b/arch/arm/mach-dove/pcie.c
new file mode 100644
index 000000000000..502d1ca2f4b7
--- /dev/null
+++ b/arch/arm/mach-dove/pcie.c
@@ -0,0 +1,238 @@
1/*
2 * arch/arm/mach-dove/pcie.c
3 *
4 * PCIe functions for Marvell Dove 88AP510 SoC
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
11#include <linux/kernel.h>
12#include <linux/pci.h>
13#include <linux/mbus.h>
14#include <asm/mach/pci.h>
15#include <asm/mach/arch.h>
16#include <asm/setup.h>
17#include <asm/delay.h>
18#include <plat/pcie.h>
19#include <mach/irqs.h>
20#include <mach/bridge-regs.h>
21#include "common.h"
22
23struct pcie_port {
24 u8 index;
25 u8 root_bus_nr;
26 void __iomem *base;
27 spinlock_t conf_lock;
28 char io_space_name[16];
29 char mem_space_name[16];
30 struct resource res[2];
31};
32
33static struct pcie_port pcie_port[2];
34static int num_pcie_ports;
35
36
37static int __init dove_pcie_setup(int nr, struct pci_sys_data *sys)
38{
39 struct pcie_port *pp;
40
41 if (nr >= num_pcie_ports)
42 return 0;
43
44 pp = &pcie_port[nr];
45 pp->root_bus_nr = sys->busnr;
46
47 /*
48 * Generic PCIe unit setup.
49 */
50 orion_pcie_set_local_bus_nr(pp->base, sys->busnr);
51
52 orion_pcie_setup(pp->base, &dove_mbus_dram_info);
53
54 /*
55 * IORESOURCE_IO
56 */
57 snprintf(pp->io_space_name, sizeof(pp->io_space_name),
58 "PCIe %d I/O", pp->index);
59 pp->io_space_name[sizeof(pp->io_space_name) - 1] = 0;
60 pp->res[0].name = pp->io_space_name;
61 if (pp->index == 0) {
62 pp->res[0].start = DOVE_PCIE0_IO_PHYS_BASE;
63 pp->res[0].end = pp->res[0].start + DOVE_PCIE0_IO_SIZE - 1;
64 } else {
65 pp->res[0].start = DOVE_PCIE1_IO_PHYS_BASE;
66 pp->res[0].end = pp->res[0].start + DOVE_PCIE1_IO_SIZE - 1;
67 }
68 pp->res[0].flags = IORESOURCE_IO;
69 if (request_resource(&ioport_resource, &pp->res[0]))
70 panic("Request PCIe IO resource failed\n");
71 sys->resource[0] = &pp->res[0];
72
73 /*
74 * IORESOURCE_MEM
75 */
76 snprintf(pp->mem_space_name, sizeof(pp->mem_space_name),
77 "PCIe %d MEM", pp->index);
78 pp->mem_space_name[sizeof(pp->mem_space_name) - 1] = 0;
79 pp->res[1].name = pp->mem_space_name;
80 if (pp->index == 0) {
81 pp->res[1].start = DOVE_PCIE0_MEM_PHYS_BASE;
82 pp->res[1].end = pp->res[1].start + DOVE_PCIE0_MEM_SIZE - 1;
83 } else {
84 pp->res[1].start = DOVE_PCIE1_MEM_PHYS_BASE;
85 pp->res[1].end = pp->res[1].start + DOVE_PCIE1_MEM_SIZE - 1;
86 }
87 pp->res[1].flags = IORESOURCE_MEM;
88 if (request_resource(&iomem_resource, &pp->res[1]))
89 panic("Request PCIe Memory resource failed\n");
90 sys->resource[1] = &pp->res[1];
91
92 sys->resource[2] = NULL;
93
94 return 1;
95}
96
97static struct pcie_port *bus_to_port(int bus)
98{
99 int i;
100
101 for (i = num_pcie_ports - 1; i >= 0; i--) {
102 int rbus = pcie_port[i].root_bus_nr;
103 if (rbus != -1 && rbus <= bus)
104 break;
105 }
106
107 return i >= 0 ? pcie_port + i : NULL;
108}
109
110static int pcie_valid_config(struct pcie_port *pp, int bus, int dev)
111{
112 /*
113 * Don't go out when trying to access nonexisting devices
114 * on the local bus.
115 */
116 if (bus == pp->root_bus_nr && dev > 1)
117 return 0;
118
119 return 1;
120}
121
122static int pcie_rd_conf(struct pci_bus *bus, u32 devfn, int where,
123 int size, u32 *val)
124{
125 struct pcie_port *pp = bus_to_port(bus->number);
126 unsigned long flags;
127 int ret;
128
129 if (pcie_valid_config(pp, bus->number, PCI_SLOT(devfn)) == 0) {
130 *val = 0xffffffff;
131 return PCIBIOS_DEVICE_NOT_FOUND;
132 }
133
134 spin_lock_irqsave(&pp->conf_lock, flags);
135 ret = orion_pcie_rd_conf(pp->base, bus, devfn, where, size, val);
136 spin_unlock_irqrestore(&pp->conf_lock, flags);
137
138 return ret;
139}
140
141static int pcie_wr_conf(struct pci_bus *bus, u32 devfn,
142 int where, int size, u32 val)
143{
144 struct pcie_port *pp = bus_to_port(bus->number);
145 unsigned long flags;
146 int ret;
147
148 if (pcie_valid_config(pp, bus->number, PCI_SLOT(devfn)) == 0)
149 return PCIBIOS_DEVICE_NOT_FOUND;
150
151 spin_lock_irqsave(&pp->conf_lock, flags);
152 ret = orion_pcie_wr_conf(pp->base, bus, devfn, where, size, val);
153 spin_unlock_irqrestore(&pp->conf_lock, flags);
154
155 return ret;
156}
157
158static struct pci_ops pcie_ops = {
159 .read = pcie_rd_conf,
160 .write = pcie_wr_conf,
161};
162
163static void __devinit rc_pci_fixup(struct pci_dev *dev)
164{
165 /*
166 * Prevent enumeration of root complex.
167 */
168 if (dev->bus->parent == NULL && dev->devfn == 0) {
169 int i;
170
171 for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
172 dev->resource[i].start = 0;
173 dev->resource[i].end = 0;
174 dev->resource[i].flags = 0;
175 }
176 }
177}
178DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MARVELL, PCI_ANY_ID, rc_pci_fixup);
179
180static struct pci_bus __init *
181dove_pcie_scan_bus(int nr, struct pci_sys_data *sys)
182{
183 struct pci_bus *bus;
184
185 if (nr < num_pcie_ports) {
186 bus = pci_scan_bus(sys->busnr, &pcie_ops, sys);
187 } else {
188 bus = NULL;
189 BUG();
190 }
191
192 return bus;
193}
194
195static int __init dove_pcie_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
196{
197 struct pcie_port *pp = bus_to_port(dev->bus->number);
198
199 return pp->index ? IRQ_DOVE_PCIE1 : IRQ_DOVE_PCIE0;
200}
201
202static struct hw_pci dove_pci __initdata = {
203 .nr_controllers = 2,
204 .swizzle = pci_std_swizzle,
205 .setup = dove_pcie_setup,
206 .scan = dove_pcie_scan_bus,
207 .map_irq = dove_pcie_map_irq,
208};
209
210static void __init add_pcie_port(int index, unsigned long base)
211{
212 printk(KERN_INFO "Dove PCIe port %d: ", index);
213
214 if (orion_pcie_link_up((void __iomem *)base)) {
215 struct pcie_port *pp = &pcie_port[num_pcie_ports++];
216
217 printk(KERN_INFO "link up\n");
218
219 pp->index = index;
220 pp->root_bus_nr = -1;
221 pp->base = (void __iomem *)base;
222 spin_lock_init(&pp->conf_lock);
223 memset(pp->res, 0, sizeof(pp->res));
224 } else {
225 printk(KERN_INFO "link down, ignoring\n");
226 }
227}
228
229void __init dove_pcie_init(int init_port0, int init_port1)
230{
231 if (init_port0)
232 add_pcie_port(0, DOVE_PCIE0_VIRT_BASE);
233
234 if (init_port1)
235 add_pcie_port(1, DOVE_PCIE1_VIRT_BASE);
236
237 pci_common_init(&dove_pci);
238}
diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c
index b4357c388d2e..1f0d66561bbe 100644
--- a/arch/arm/mach-ep93xx/core.c
+++ b/arch/arm/mach-ep93xx/core.c
@@ -31,6 +31,7 @@
31 31
32#include <mach/hardware.h> 32#include <mach/hardware.h>
33#include <mach/fb.h> 33#include <mach/fb.h>
34#include <mach/ep93xx_keypad.h>
34 35
35#include <asm/mach/map.h> 36#include <asm/mach/map.h>
36#include <asm/mach/time.h> 37#include <asm/mach/time.h>
@@ -728,6 +729,82 @@ void __init ep93xx_register_fb(struct ep93xxfb_mach_info *data)
728 platform_device_register(&ep93xx_fb_device); 729 platform_device_register(&ep93xx_fb_device);
729} 730}
730 731
732
733/*************************************************************************
734 * EP93xx matrix keypad peripheral handling
735 *************************************************************************/
736static struct resource ep93xx_keypad_resource[] = {
737 {
738 .start = EP93XX_KEY_MATRIX_PHYS_BASE,
739 .end = EP93XX_KEY_MATRIX_PHYS_BASE + 0x0c - 1,
740 .flags = IORESOURCE_MEM,
741 }, {
742 .start = IRQ_EP93XX_KEY,
743 .end = IRQ_EP93XX_KEY,
744 .flags = IORESOURCE_IRQ,
745 },
746};
747
748static struct platform_device ep93xx_keypad_device = {
749 .name = "ep93xx-keypad",
750 .id = -1,
751 .num_resources = ARRAY_SIZE(ep93xx_keypad_resource),
752 .resource = ep93xx_keypad_resource,
753};
754
755void __init ep93xx_register_keypad(struct ep93xx_keypad_platform_data *data)
756{
757 ep93xx_keypad_device.dev.platform_data = data;
758 platform_device_register(&ep93xx_keypad_device);
759}
760
761int ep93xx_keypad_acquire_gpio(struct platform_device *pdev)
762{
763 int err;
764 int i;
765
766 for (i = 0; i < 8; i++) {
767 err = gpio_request(EP93XX_GPIO_LINE_C(i), dev_name(&pdev->dev));
768 if (err)
769 goto fail_gpio_c;
770 err = gpio_request(EP93XX_GPIO_LINE_D(i), dev_name(&pdev->dev));
771 if (err)
772 goto fail_gpio_d;
773 }
774
775 /* Enable the keypad controller; GPIO ports C and D used for keypad */
776 ep93xx_devcfg_clear_bits(EP93XX_SYSCON_DEVCFG_KEYS |
777 EP93XX_SYSCON_DEVCFG_GONK);
778
779 return 0;
780
781fail_gpio_d:
782 gpio_free(EP93XX_GPIO_LINE_C(i));
783fail_gpio_c:
784 for ( ; i >= 0; --i) {
785 gpio_free(EP93XX_GPIO_LINE_C(i));
786 gpio_free(EP93XX_GPIO_LINE_D(i));
787 }
788 return err;
789}
790EXPORT_SYMBOL(ep93xx_keypad_acquire_gpio);
791
792void ep93xx_keypad_release_gpio(struct platform_device *pdev)
793{
794 int i;
795
796 for (i = 0; i < 8; i++) {
797 gpio_free(EP93XX_GPIO_LINE_C(i));
798 gpio_free(EP93XX_GPIO_LINE_D(i));
799 }
800
801 /* Disable the keypad controller; GPIO ports C and D used for GPIO */
802 ep93xx_devcfg_set_bits(EP93XX_SYSCON_DEVCFG_KEYS |
803 EP93XX_SYSCON_DEVCFG_GONK);
804}
805EXPORT_SYMBOL(ep93xx_keypad_release_gpio);
806
807
731extern void ep93xx_gpio_init(void); 808extern void ep93xx_gpio_init(void);
732 809
733void __init ep93xx_init_devices(void) 810void __init ep93xx_init_devices(void)
diff --git a/arch/arm/mach-ep93xx/include/mach/clkdev.h b/arch/arm/mach-ep93xx/include/mach/clkdev.h
index 04b37a89801c..50cb991eadeb 100644
--- a/arch/arm/mach-ep93xx/include/mach/clkdev.h
+++ b/arch/arm/mach-ep93xx/include/mach/clkdev.h
@@ -1,3 +1,7 @@
1/*
2 * arch/arm/mach-ep93xx/include/mach/clkdev.h
3 */
4
1#ifndef __ASM_MACH_CLKDEV_H 5#ifndef __ASM_MACH_CLKDEV_H
2#define __ASM_MACH_CLKDEV_H 6#define __ASM_MACH_CLKDEV_H
3 7
diff --git a/arch/arm/mach-ep93xx/include/mach/dma.h b/arch/arm/mach-ep93xx/include/mach/dma.h
index ef6bd9d13148..3a5961d3f3b1 100644
--- a/arch/arm/mach-ep93xx/include/mach/dma.h
+++ b/arch/arm/mach-ep93xx/include/mach/dma.h
@@ -1,3 +1,7 @@
1/*
2 * arch/arm/mach-ep93xx/include/mach/dma.h
3 */
4
1#ifndef __ASM_ARCH_DMA_H 5#ifndef __ASM_ARCH_DMA_H
2#define __ASM_ARCH_DMA_H 6#define __ASM_ARCH_DMA_H
3 7
diff --git a/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h b/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h
index b1f937eda29c..d55194a4c093 100644
--- a/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h
+++ b/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h
@@ -134,6 +134,7 @@
134#define EP93XX_UART3_PHYS_BASE EP93XX_APB_PHYS(0x000e0000) 134#define EP93XX_UART3_PHYS_BASE EP93XX_APB_PHYS(0x000e0000)
135#define EP93XX_UART3_BASE EP93XX_APB_IOMEM(0x000e0000) 135#define EP93XX_UART3_BASE EP93XX_APB_IOMEM(0x000e0000)
136 136
137#define EP93XX_KEY_MATRIX_PHYS_BASE EP93XX_APB_PHYS(0x000f0000)
137#define EP93XX_KEY_MATRIX_BASE EP93XX_APB_IOMEM(0x000f0000) 138#define EP93XX_KEY_MATRIX_BASE EP93XX_APB_IOMEM(0x000f0000)
138 139
139#define EP93XX_ADC_BASE EP93XX_APB_IOMEM(0x00100000) 140#define EP93XX_ADC_BASE EP93XX_APB_IOMEM(0x00100000)
diff --git a/arch/arm/mach-ep93xx/include/mach/hardware.h b/arch/arm/mach-ep93xx/include/mach/hardware.h
index 349fa7cb72d5..5a3ce024b593 100644
--- a/arch/arm/mach-ep93xx/include/mach/hardware.h
+++ b/arch/arm/mach-ep93xx/include/mach/hardware.h
@@ -1,6 +1,7 @@
1/* 1/*
2 * arch/arm/mach-ep93xx/include/mach/hardware.h 2 * arch/arm/mach-ep93xx/include/mach/hardware.h
3 */ 3 */
4
4#ifndef __ASM_ARCH_HARDWARE_H 5#ifndef __ASM_ARCH_HARDWARE_H
5#define __ASM_ARCH_HARDWARE_H 6#define __ASM_ARCH_HARDWARE_H
6 7
diff --git a/arch/arm/mach-ep93xx/include/mach/io.h b/arch/arm/mach-ep93xx/include/mach/io.h
index cebcc1c53d63..594b77f21054 100644
--- a/arch/arm/mach-ep93xx/include/mach/io.h
+++ b/arch/arm/mach-ep93xx/include/mach/io.h
@@ -1,6 +1,7 @@
1/* 1/*
2 * arch/arm/mach-ep93xx/include/mach/io.h 2 * arch/arm/mach-ep93xx/include/mach/io.h
3 */ 3 */
4
4#ifndef __ASM_MACH_IO_H 5#ifndef __ASM_MACH_IO_H
5#define __ASM_MACH_IO_H 6#define __ASM_MACH_IO_H
6 7
diff --git a/arch/arm/mach-ep93xx/include/mach/platform.h b/arch/arm/mach-ep93xx/include/mach/platform.h
index 469fd968d517..c6dc14dbca18 100644
--- a/arch/arm/mach-ep93xx/include/mach/platform.h
+++ b/arch/arm/mach-ep93xx/include/mach/platform.h
@@ -8,6 +8,7 @@ struct i2c_gpio_platform_data;
8struct i2c_board_info; 8struct i2c_board_info;
9struct platform_device; 9struct platform_device;
10struct ep93xxfb_mach_info; 10struct ep93xxfb_mach_info;
11struct ep93xx_keypad_platform_data;
11 12
12struct ep93xx_eth_data 13struct ep93xx_eth_data
13{ 14{
@@ -39,6 +40,9 @@ void ep93xx_register_fb(struct ep93xxfb_mach_info *data);
39void ep93xx_register_pwm(int pwm0, int pwm1); 40void ep93xx_register_pwm(int pwm0, int pwm1);
40int ep93xx_pwm_acquire_gpio(struct platform_device *pdev); 41int ep93xx_pwm_acquire_gpio(struct platform_device *pdev);
41void ep93xx_pwm_release_gpio(struct platform_device *pdev); 42void ep93xx_pwm_release_gpio(struct platform_device *pdev);
43void ep93xx_register_keypad(struct ep93xx_keypad_platform_data *data);
44int ep93xx_keypad_acquire_gpio(struct platform_device *pdev);
45void ep93xx_keypad_release_gpio(struct platform_device *pdev);
42 46
43void ep93xx_init_devices(void); 47void ep93xx_init_devices(void);
44extern struct sys_timer ep93xx_timer; 48extern struct sys_timer ep93xx_timer;
diff --git a/arch/arm/mach-iop13xx/include/mach/memory.h b/arch/arm/mach-iop13xx/include/mach/memory.h
index 42ae29b288a1..25b1da9a5035 100644
--- a/arch/arm/mach-iop13xx/include/mach/memory.h
+++ b/arch/arm/mach-iop13xx/include/mach/memory.h
@@ -64,6 +64,8 @@ static inline unsigned long __lbus_to_virt(dma_addr_t x)
64 (dma_addr_t)page_to_phys(page); \ 64 (dma_addr_t)page_to_phys(page); \
65 }) 65 })
66 66
67#define __arch_dma_to_page(dev, addr) phys_to_page(addr)
68
67#endif /* CONFIG_ARCH_IOP13XX */ 69#endif /* CONFIG_ARCH_IOP13XX */
68#endif /* !ASSEMBLY */ 70#endif /* !ASSEMBLY */
69 71
diff --git a/arch/arm/mach-iop13xx/include/mach/time.h b/arch/arm/mach-iop13xx/include/mach/time.h
index d6d52527589d..f1c00d6d560b 100644
--- a/arch/arm/mach-iop13xx/include/mach/time.h
+++ b/arch/arm/mach-iop13xx/include/mach/time.h
@@ -20,7 +20,6 @@
20#define IOP13XX_CORE_FREQ_1200 (5 << 16) 20#define IOP13XX_CORE_FREQ_1200 (5 << 16)
21 21
22void iop_init_time(unsigned long tickrate); 22void iop_init_time(unsigned long tickrate);
23unsigned long iop_gettimeoffset(void);
24 23
25static inline unsigned long iop13xx_core_freq(void) 24static inline unsigned long iop13xx_core_freq(void)
26{ 25{
@@ -66,6 +65,13 @@ static inline unsigned long iop13xx_xsi_bus_ratio(void)
66 return 2; 65 return 2;
67} 66}
68 67
68static inline u32 read_tmr0(void)
69{
70 u32 val;
71 asm volatile("mrc p6, 0, %0, c0, c9, 0" : "=r" (val));
72 return val;
73}
74
69static inline void write_tmr0(u32 val) 75static inline void write_tmr0(u32 val)
70{ 76{
71 asm volatile("mcr p6, 0, %0, c0, c9, 0" : : "r" (val)); 77 asm volatile("mcr p6, 0, %0, c0, c9, 0" : : "r" (val));
@@ -83,6 +89,11 @@ static inline u32 read_tcr0(void)
83 return val; 89 return val;
84} 90}
85 91
92static inline void write_tcr0(u32 val)
93{
94 asm volatile("mcr p6, 0, %0, c2, c9, 0" : : "r" (val));
95}
96
86static inline u32 read_tcr1(void) 97static inline u32 read_tcr1(void)
87{ 98{
88 u32 val; 99 u32 val;
@@ -90,6 +101,11 @@ static inline u32 read_tcr1(void)
90 return val; 101 return val;
91} 102}
92 103
104static inline void write_tcr1(u32 val)
105{
106 asm volatile("mcr p6, 0, %0, c3, c9, 0" : : "r" (val));
107}
108
93static inline void write_trr0(u32 val) 109static inline void write_trr0(u32 val)
94{ 110{
95 asm volatile("mcr p6, 0, %0, c4, c9, 0" : : "r" (val)); 111 asm volatile("mcr p6, 0, %0, c4, c9, 0" : : "r" (val));
diff --git a/arch/arm/mach-iop13xx/iq81340mc.c b/arch/arm/mach-iop13xx/iq81340mc.c
index 5051c03d437c..f91f3154577d 100644
--- a/arch/arm/mach-iop13xx/iq81340mc.c
+++ b/arch/arm/mach-iop13xx/iq81340mc.c
@@ -87,7 +87,6 @@ static void __init iq81340mc_timer_init(void)
87 87
88static struct sys_timer iq81340mc_timer = { 88static struct sys_timer iq81340mc_timer = {
89 .init = iq81340mc_timer_init, 89 .init = iq81340mc_timer_init,
90 .offset = iop_gettimeoffset,
91}; 90};
92 91
93MACHINE_START(IQ81340MC, "Intel IQ81340MC") 92MACHINE_START(IQ81340MC, "Intel IQ81340MC")
diff --git a/arch/arm/mach-iop13xx/iq81340sc.c b/arch/arm/mach-iop13xx/iq81340sc.c
index bc443073a8e3..ddb7a3435de9 100644
--- a/arch/arm/mach-iop13xx/iq81340sc.c
+++ b/arch/arm/mach-iop13xx/iq81340sc.c
@@ -89,7 +89,6 @@ static void __init iq81340sc_timer_init(void)
89 89
90static struct sys_timer iq81340sc_timer = { 90static struct sys_timer iq81340sc_timer = {
91 .init = iq81340sc_timer_init, 91 .init = iq81340sc_timer_init,
92 .offset = iop_gettimeoffset,
93}; 92};
94 93
95MACHINE_START(IQ81340SC, "Intel IQ81340SC") 94MACHINE_START(IQ81340SC, "Intel IQ81340SC")
diff --git a/arch/arm/mach-iop32x/em7210.c b/arch/arm/mach-iop32x/em7210.c
index 3ad4696ade42..2bef9b6e1cc9 100644
--- a/arch/arm/mach-iop32x/em7210.c
+++ b/arch/arm/mach-iop32x/em7210.c
@@ -42,7 +42,6 @@ static void __init em7210_timer_init(void)
42 42
43static struct sys_timer em7210_timer = { 43static struct sys_timer em7210_timer = {
44 .init = em7210_timer_init, 44 .init = em7210_timer_init,
45 .offset = iop_gettimeoffset,
46}; 45};
47 46
48/* 47/*
diff --git a/arch/arm/mach-iop32x/glantank.c b/arch/arm/mach-iop32x/glantank.c
index a9c2dfdb2507..93370a46b620 100644
--- a/arch/arm/mach-iop32x/glantank.c
+++ b/arch/arm/mach-iop32x/glantank.c
@@ -47,7 +47,6 @@ static void __init glantank_timer_init(void)
47 47
48static struct sys_timer glantank_timer = { 48static struct sys_timer glantank_timer = {
49 .init = glantank_timer_init, 49 .init = glantank_timer_init,
50 .offset = iop_gettimeoffset,
51}; 50};
52 51
53 52
diff --git a/arch/arm/mach-iop32x/iq31244.c b/arch/arm/mach-iop32x/iq31244.c
index dd1cd9904518..a7a08dda7f33 100644
--- a/arch/arm/mach-iop32x/iq31244.c
+++ b/arch/arm/mach-iop32x/iq31244.c
@@ -78,7 +78,6 @@ static void __init iq31244_timer_init(void)
78 78
79static struct sys_timer iq31244_timer = { 79static struct sys_timer iq31244_timer = {
80 .init = iq31244_timer_init, 80 .init = iq31244_timer_init,
81 .offset = iop_gettimeoffset,
82}; 81};
83 82
84 83
diff --git a/arch/arm/mach-iop32x/iq80321.c b/arch/arm/mach-iop32x/iq80321.c
index fbe27798759d..0200f80c1e17 100644
--- a/arch/arm/mach-iop32x/iq80321.c
+++ b/arch/arm/mach-iop32x/iq80321.c
@@ -46,7 +46,6 @@ static void __init iq80321_timer_init(void)
46 46
47static struct sys_timer iq80321_timer = { 47static struct sys_timer iq80321_timer = {
48 .init = iq80321_timer_init, 48 .init = iq80321_timer_init,
49 .offset = iop_gettimeoffset,
50}; 49};
51 50
52 51
diff --git a/arch/arm/mach-iop32x/n2100.c b/arch/arm/mach-iop32x/n2100.c
index d2e427899729..2a5c637639bb 100644
--- a/arch/arm/mach-iop32x/n2100.c
+++ b/arch/arm/mach-iop32x/n2100.c
@@ -53,7 +53,6 @@ static void __init n2100_timer_init(void)
53 53
54static struct sys_timer n2100_timer = { 54static struct sys_timer n2100_timer = {
55 .init = n2100_timer_init, 55 .init = n2100_timer_init,
56 .offset = iop_gettimeoffset,
57}; 56};
58 57
59 58
diff --git a/arch/arm/mach-iop33x/iq80331.c b/arch/arm/mach-iop33x/iq80331.c
index d51e10cddf20..394e95a30b75 100644
--- a/arch/arm/mach-iop33x/iq80331.c
+++ b/arch/arm/mach-iop33x/iq80331.c
@@ -48,7 +48,6 @@ static void __init iq80331_timer_init(void)
48 48
49static struct sys_timer iq80331_timer = { 49static struct sys_timer iq80331_timer = {
50 .init = iq80331_timer_init, 50 .init = iq80331_timer_init,
51 .offset = iop_gettimeoffset,
52}; 51};
53 52
54 53
diff --git a/arch/arm/mach-iop33x/iq80332.c b/arch/arm/mach-iop33x/iq80332.c
index 92fb44cdbcad..a40badf126c2 100644
--- a/arch/arm/mach-iop33x/iq80332.c
+++ b/arch/arm/mach-iop33x/iq80332.c
@@ -48,7 +48,6 @@ static void __init iq80332_timer_init(void)
48 48
49static struct sys_timer iq80332_timer = { 49static struct sys_timer iq80332_timer = {
50 .init = iq80332_timer_init, 50 .init = iq80332_timer_init,
51 .offset = iop_gettimeoffset,
52}; 51};
53 52
54 53
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index 0aca451b216d..8bf09ae5b347 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -33,10 +33,18 @@ config MACH_SHEEVAPLUG
33 Marvell SheevaPlug Reference Board. 33 Marvell SheevaPlug Reference Board.
34 34
35config MACH_TS219 35config MACH_TS219
36 bool "QNAP TS-119 and TS-219 Turbo NAS" 36 bool "QNAP TS-110, TS-119, TS-210, TS-219 and TS-219P Turbo NAS"
37 help 37 help
38 Say 'Y' here if you want your kernel to support the 38 Say 'Y' here if you want your kernel to support the
39 QNAP TS-119 and TS-219 Turbo NAS devices. 39 QNAP TS-110, TS-119, TS-210, TS-219 and TS-219P Turbo NAS
40 devices.
41
42config MACH_TS41X
43 bool "QNAP TS-410, TS-410U, TS-419P and TS-419U Turbo NAS"
44 help
45 Say 'Y' here if you want your kernel to support the
46 QNAP TS-410, TS-410U, TS-419P and TS-419U Turbo NAS
47 devices.
40 48
41config MACH_OPENRD_BASE 49config MACH_OPENRD_BASE
42 bool "Marvell OpenRD Base Board" 50 bool "Marvell OpenRD Base Board"
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index 80ab0ec90ee1..9f2f67b2b63d 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -5,7 +5,8 @@ obj-$(CONFIG_MACH_RD88F6192_NAS) += rd88f6192-nas-setup.o
5obj-$(CONFIG_MACH_RD88F6281) += rd88f6281-setup.o 5obj-$(CONFIG_MACH_RD88F6281) += rd88f6281-setup.o
6obj-$(CONFIG_MACH_MV88F6281GTW_GE) += mv88f6281gtw_ge-setup.o 6obj-$(CONFIG_MACH_MV88F6281GTW_GE) += mv88f6281gtw_ge-setup.o
7obj-$(CONFIG_MACH_SHEEVAPLUG) += sheevaplug-setup.o 7obj-$(CONFIG_MACH_SHEEVAPLUG) += sheevaplug-setup.o
8obj-$(CONFIG_MACH_TS219) += ts219-setup.o 8obj-$(CONFIG_MACH_TS219) += ts219-setup.o tsx1x-common.o
9obj-$(CONFIG_MACH_TS41X) += ts41x-setup.o tsx1x-common.o
9obj-$(CONFIG_MACH_OPENRD_BASE) += openrd_base-setup.o 10obj-$(CONFIG_MACH_OPENRD_BASE) += openrd_base-setup.o
10 11
11obj-$(CONFIG_CPU_IDLE) += cpuidle.o 12obj-$(CONFIG_CPU_IDLE) += cpuidle.o
diff --git a/arch/arm/mach-kirkwood/ts219-setup.c b/arch/arm/mach-kirkwood/ts219-setup.c
index ec1a64f263d2..2830f0fe80e0 100644
--- a/arch/arm/mach-kirkwood/ts219-setup.c
+++ b/arch/arm/mach-kirkwood/ts219-setup.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * 2 *
3 * QNAP TS-119/TS-219 Turbo NAS Board Setup 3 * QNAP TS-11x/TS-21x Turbo NAS Board Setup
4 * 4 *
5 * Copyright (C) 2009 Martin Michlmayr <tbm@cyrius.com> 5 * Copyright (C) 2009 Martin Michlmayr <tbm@cyrius.com>
6 * Copyright (C) 2008 Byron Bradley <byron.bbradley@gmail.com> 6 * Copyright (C) 2008 Byron Bradley <byron.bbradley@gmail.com>
@@ -14,87 +14,17 @@
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/spi/flash.h>
19#include <linux/spi/spi.h>
20#include <linux/spi/orion_spi.h>
21#include <linux/i2c.h> 17#include <linux/i2c.h>
22#include <linux/mv643xx_eth.h> 18#include <linux/mv643xx_eth.h>
23#include <linux/ata_platform.h> 19#include <linux/ata_platform.h>
24#include <linux/gpio_keys.h> 20#include <linux/gpio_keys.h>
25#include <linux/input.h> 21#include <linux/input.h>
26#include <linux/timex.h>
27#include <linux/serial_reg.h>
28#include <linux/pci.h>
29#include <asm/mach-types.h> 22#include <asm/mach-types.h>
30#include <asm/mach/arch.h> 23#include <asm/mach/arch.h>
31#include <mach/kirkwood.h> 24#include <mach/kirkwood.h>
32#include "common.h" 25#include "common.h"
33#include "mpp.h" 26#include "mpp.h"
34 27#include "tsx1x-common.h"
35/****************************************************************************
36 * 16 MiB NOR flash. The struct mtd_partition is not in the same order as the
37 * partitions on the device because we want to keep compatability with
38 * the QNAP firmware.
39 * Layout as used by QNAP:
40 * 0x00000000-0x00080000 : "U-Boot"
41 * 0x00200000-0x00400000 : "Kernel"
42 * 0x00400000-0x00d00000 : "RootFS"
43 * 0x00d00000-0x01000000 : "RootFS2"
44 * 0x00080000-0x000c0000 : "U-Boot Config"
45 * 0x000c0000-0x00200000 : "NAS Config"
46 *
47 * We'll use "RootFS1" instead of "RootFS" to stay compatible with the layout
48 * used by the QNAP TS-109/TS-209.
49 *
50 ***************************************************************************/
51
52static struct mtd_partition qnap_ts219_partitions[] = {
53 {
54 .name = "U-Boot",
55 .size = 0x00080000,
56 .offset = 0,
57 .mask_flags = MTD_WRITEABLE,
58 }, {
59 .name = "Kernel",
60 .size = 0x00200000,
61 .offset = 0x00200000,
62 }, {
63 .name = "RootFS1",
64 .size = 0x00900000,
65 .offset = 0x00400000,
66 }, {
67 .name = "RootFS2",
68 .size = 0x00300000,
69 .offset = 0x00d00000,
70 }, {
71 .name = "U-Boot Config",
72 .size = 0x00040000,
73 .offset = 0x00080000,
74 }, {
75 .name = "NAS Config",
76 .size = 0x00140000,
77 .offset = 0x000c0000,
78 },
79};
80
81static const struct flash_platform_data qnap_ts219_flash = {
82 .type = "m25p128",
83 .name = "spi_flash",
84 .parts = qnap_ts219_partitions,
85 .nr_parts = ARRAY_SIZE(qnap_ts219_partitions),
86};
87
88static struct spi_board_info __initdata qnap_ts219_spi_slave_info[] = {
89 {
90 .modalias = "m25p80",
91 .platform_data = &qnap_ts219_flash,
92 .irq = -1,
93 .max_speed_hz = 20000000,
94 .bus_num = 0,
95 .chip_select = 0,
96 },
97};
98 28
99static struct i2c_board_info __initdata qnap_ts219_i2c_rtc = { 29static struct i2c_board_info __initdata qnap_ts219_i2c_rtc = {
100 I2C_BOARD_INFO("s35390a", 0x30), 30 I2C_BOARD_INFO("s35390a", 0x30),
@@ -152,36 +82,10 @@ static unsigned int qnap_ts219_mpp_config[] __initdata = {
152 MPP14_UART1_RXD, /* PIC controller */ 82 MPP14_UART1_RXD, /* PIC controller */
153 MPP15_GPIO, /* USB Copy button */ 83 MPP15_GPIO, /* USB Copy button */
154 MPP16_GPIO, /* Reset button */ 84 MPP16_GPIO, /* Reset button */
85 MPP36_GPIO, /* RAM: 0: 256 MB, 1: 512 MB */
155 0 86 0
156}; 87};
157 88
158
159/*****************************************************************************
160 * QNAP TS-x19 specific power off method via UART1-attached PIC
161 ****************************************************************************/
162
163#define UART1_REG(x) (UART1_VIRT_BASE + ((UART_##x) << 2))
164
165void qnap_ts219_power_off(void)
166{
167 /* 19200 baud divisor */
168 const unsigned divisor = ((kirkwood_tclk + (8 * 19200)) / (16 * 19200));
169
170 pr_info("%s: triggering power-off...\n", __func__);
171
172 /* hijack UART1 and reset into sane state (19200,8n1) */
173 writel(0x83, UART1_REG(LCR));
174 writel(divisor & 0xff, UART1_REG(DLL));
175 writel((divisor >> 8) & 0xff, UART1_REG(DLM));
176 writel(0x03, UART1_REG(LCR));
177 writel(0x00, UART1_REG(IER));
178 writel(0x00, UART1_REG(FCR));
179 writel(0x00, UART1_REG(MCR));
180
181 /* send the power-off command 'A' to PIC */
182 writel('A', UART1_REG(TX));
183}
184
185static void __init qnap_ts219_init(void) 89static void __init qnap_ts219_init(void)
186{ 90{
187 /* 91 /*
@@ -192,9 +96,7 @@ static void __init qnap_ts219_init(void)
192 96
193 kirkwood_uart0_init(); 97 kirkwood_uart0_init();
194 kirkwood_uart1_init(); /* A PIC controller is connected here. */ 98 kirkwood_uart1_init(); /* A PIC controller is connected here. */
195 spi_register_board_info(qnap_ts219_spi_slave_info, 99 qnap_tsx1x_register_flash();
196 ARRAY_SIZE(qnap_ts219_spi_slave_info));
197 kirkwood_spi_init();
198 kirkwood_i2c_init(); 100 kirkwood_i2c_init();
199 i2c_register_board_info(0, &qnap_ts219_i2c_rtc, 1); 101 i2c_register_board_info(0, &qnap_ts219_i2c_rtc, 1);
200 kirkwood_ge00_init(&qnap_ts219_ge00_data); 102 kirkwood_ge00_init(&qnap_ts219_ge00_data);
@@ -202,7 +104,7 @@ static void __init qnap_ts219_init(void)
202 kirkwood_ehci_init(); 104 kirkwood_ehci_init();
203 platform_device_register(&qnap_ts219_button_device); 105 platform_device_register(&qnap_ts219_button_device);
204 106
205 pm_power_off = qnap_ts219_power_off; 107 pm_power_off = qnap_tsx1x_power_off;
206 108
207} 109}
208 110
diff --git a/arch/arm/mach-kirkwood/ts41x-setup.c b/arch/arm/mach-kirkwood/ts41x-setup.c
new file mode 100644
index 000000000000..de49c2d9e74b
--- /dev/null
+++ b/arch/arm/mach-kirkwood/ts41x-setup.c
@@ -0,0 +1,154 @@
1/*
2 *
3 * QNAP TS-410, TS-410U, TS-419P and TS-419U Turbo NAS Board Setup
4 *
5 * Copyright (C) 2009 Martin Michlmayr <tbm@cyrius.com>
6 * Copyright (C) 2008 Byron Bradley <byron.bbradley@gmail.com>
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version
11 * 2 of the License, or (at your option) any later version.
12 */
13
14#include <linux/kernel.h>
15#include <linux/init.h>
16#include <linux/platform_device.h>
17#include <linux/i2c.h>
18#include <linux/mv643xx_eth.h>
19#include <linux/ata_platform.h>
20#include <linux/gpio_keys.h>
21#include <linux/input.h>
22#include <asm/mach-types.h>
23#include <asm/mach/arch.h>
24#include <mach/kirkwood.h>
25#include "common.h"
26#include "mpp.h"
27#include "tsx1x-common.h"
28
29static struct i2c_board_info __initdata qnap_ts41x_i2c_rtc = {
30 I2C_BOARD_INFO("s35390a", 0x30),
31};
32
33static struct mv643xx_eth_platform_data qnap_ts41x_ge00_data = {
34 .phy_addr = MV643XX_ETH_PHY_ADDR(8),
35};
36
37static struct mv643xx_eth_platform_data qnap_ts41x_ge01_data = {
38 .phy_addr = MV643XX_ETH_PHY_ADDR(0),
39};
40
41static struct mv_sata_platform_data qnap_ts41x_sata_data = {
42 .n_ports = 2,
43};
44
45static struct gpio_keys_button qnap_ts41x_buttons[] = {
46 {
47 .code = KEY_COPY,
48 .gpio = 43,
49 .desc = "USB Copy",
50 .active_low = 1,
51 },
52 {
53 .code = KEY_RESTART,
54 .gpio = 37,
55 .desc = "Reset",
56 .active_low = 1,
57 },
58};
59
60static struct gpio_keys_platform_data qnap_ts41x_button_data = {
61 .buttons = qnap_ts41x_buttons,
62 .nbuttons = ARRAY_SIZE(qnap_ts41x_buttons),
63};
64
65static struct platform_device qnap_ts41x_button_device = {
66 .name = "gpio-keys",
67 .id = -1,
68 .num_resources = 0,
69 .dev = {
70 .platform_data = &qnap_ts41x_button_data,
71 }
72};
73
74static unsigned int qnap_ts41x_mpp_config[] __initdata = {
75 MPP0_SPI_SCn,
76 MPP1_SPI_MOSI,
77 MPP2_SPI_SCK,
78 MPP3_SPI_MISO,
79 MPP6_SYSRST_OUTn,
80 MPP7_PEX_RST_OUTn,
81 MPP8_TW_SDA,
82 MPP9_TW_SCK,
83 MPP10_UART0_TXD,
84 MPP11_UART0_RXD,
85 MPP13_UART1_TXD, /* PIC controller */
86 MPP14_UART1_RXD, /* PIC controller */
87 MPP15_SATA0_ACTn,
88 MPP16_SATA1_ACTn,
89 MPP20_GE1_0,
90 MPP21_GE1_1,
91 MPP22_GE1_2,
92 MPP23_GE1_3,
93 MPP24_GE1_4,
94 MPP25_GE1_5,
95 MPP26_GE1_6,
96 MPP27_GE1_7,
97 MPP30_GE1_10,
98 MPP31_GE1_11,
99 MPP32_GE1_12,
100 MPP33_GE1_13,
101 MPP36_GPIO, /* RAM: 0: 256 MB, 1: 512 MB */
102 MPP37_GPIO, /* Reset button */
103 MPP43_GPIO, /* USB Copy button */
104 MPP44_GPIO, /* Board ID: 0: TS-419U, 1: TS-419 */
105 MPP45_GPIO, /* JP1: 0: console, 1: LCD */
106 MPP46_GPIO, /* External SATA HDD1 error indicator */
107 MPP47_GPIO, /* External SATA HDD2 error indicator */
108 MPP48_GPIO, /* External SATA HDD3 error indicator */
109 MPP49_GPIO, /* External SATA HDD4 error indicator */
110 0
111};
112
113static void __init qnap_ts41x_init(void)
114{
115 /*
116 * Basic setup. Needs to be called early.
117 */
118 kirkwood_init();
119 kirkwood_mpp_conf(qnap_ts41x_mpp_config);
120
121 kirkwood_uart0_init();
122 kirkwood_uart1_init(); /* A PIC controller is connected here. */
123 qnap_tsx1x_register_flash();
124 kirkwood_i2c_init();
125 i2c_register_board_info(0, &qnap_ts41x_i2c_rtc, 1);
126 kirkwood_ge00_init(&qnap_ts41x_ge00_data);
127 kirkwood_ge01_init(&qnap_ts41x_ge01_data);
128 kirkwood_sata_init(&qnap_ts41x_sata_data);
129 kirkwood_ehci_init();
130 platform_device_register(&qnap_ts41x_button_device);
131
132 pm_power_off = qnap_tsx1x_power_off;
133
134}
135
136static int __init ts41x_pci_init(void)
137{
138 if (machine_is_ts41x())
139 kirkwood_pcie_init();
140
141 return 0;
142}
143subsys_initcall(ts41x_pci_init);
144
145MACHINE_START(TS41X, "QNAP TS-41x")
146 /* Maintainer: Martin Michlmayr <tbm@cyrius.com> */
147 .phys_io = KIRKWOOD_REGS_PHYS_BASE,
148 .io_pg_offst = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc,
149 .boot_params = 0x00000100,
150 .init_machine = qnap_ts41x_init,
151 .map_io = kirkwood_map_io,
152 .init_irq = kirkwood_init_irq,
153 .timer = &kirkwood_timer,
154MACHINE_END
diff --git a/arch/arm/mach-kirkwood/tsx1x-common.c b/arch/arm/mach-kirkwood/tsx1x-common.c
new file mode 100644
index 000000000000..7221c20b2afa
--- /dev/null
+++ b/arch/arm/mach-kirkwood/tsx1x-common.c
@@ -0,0 +1,113 @@
1#include <linux/kernel.h>
2#include <linux/pci.h>
3#include <linux/platform_device.h>
4#include <linux/mtd/physmap.h>
5#include <linux/spi/flash.h>
6#include <linux/spi/spi.h>
7#include <linux/spi/orion_spi.h>
8#include <linux/serial_reg.h>
9#include <mach/kirkwood.h>
10#include "common.h"
11
12/*
13 * QNAP TS-x1x Boards flash
14 */
15
16/****************************************************************************
17 * 16 MiB NOR flash. The struct mtd_partition is not in the same order as the
18 * partitions on the device because we want to keep compatability with
19 * the QNAP firmware.
20 * Layout as used by QNAP:
21 * 0x00000000-0x00080000 : "U-Boot"
22 * 0x00200000-0x00400000 : "Kernel"
23 * 0x00400000-0x00d00000 : "RootFS"
24 * 0x00d00000-0x01000000 : "RootFS2"
25 * 0x00080000-0x000c0000 : "U-Boot Config"
26 * 0x000c0000-0x00200000 : "NAS Config"
27 *
28 * We'll use "RootFS1" instead of "RootFS" to stay compatible with the layout
29 * used by the QNAP TS-109/TS-209.
30 *
31 ***************************************************************************/
32
33struct mtd_partition qnap_tsx1x_partitions[] = {
34 {
35 .name = "U-Boot",
36 .size = 0x00080000,
37 .offset = 0,
38 .mask_flags = MTD_WRITEABLE,
39 }, {
40 .name = "Kernel",
41 .size = 0x00200000,
42 .offset = 0x00200000,
43 }, {
44 .name = "RootFS1",
45 .size = 0x00900000,
46 .offset = 0x00400000,
47 }, {
48 .name = "RootFS2",
49 .size = 0x00300000,
50 .offset = 0x00d00000,
51 }, {
52 .name = "U-Boot Config",
53 .size = 0x00040000,
54 .offset = 0x00080000,
55 }, {
56 .name = "NAS Config",
57 .size = 0x00140000,
58 .offset = 0x000c0000,
59 },
60};
61
62const struct flash_platform_data qnap_tsx1x_flash = {
63 .type = "m25p128",
64 .name = "spi_flash",
65 .parts = qnap_tsx1x_partitions,
66 .nr_parts = ARRAY_SIZE(qnap_tsx1x_partitions),
67};
68
69struct spi_board_info __initdata qnap_tsx1x_spi_slave_info[] = {
70 {
71 .modalias = "m25p80",
72 .platform_data = &qnap_tsx1x_flash,
73 .irq = -1,
74 .max_speed_hz = 20000000,
75 .bus_num = 0,
76 .chip_select = 0,
77 },
78};
79
80void qnap_tsx1x_register_flash(void)
81{
82 spi_register_board_info(qnap_tsx1x_spi_slave_info,
83 ARRAY_SIZE(qnap_tsx1x_spi_slave_info));
84 kirkwood_spi_init();
85}
86
87
88/*****************************************************************************
89 * QNAP TS-x1x specific power off method via UART1-attached PIC
90 ****************************************************************************/
91
92#define UART1_REG(x) (UART1_VIRT_BASE + ((UART_##x) << 2))
93
94void qnap_tsx1x_power_off(void)
95{
96 /* 19200 baud divisor */
97 const unsigned divisor = ((kirkwood_tclk + (8 * 19200)) / (16 * 19200));
98
99 pr_info("%s: triggering power-off...\n", __func__);
100
101 /* hijack UART1 and reset into sane state (19200,8n1) */
102 writel(0x83, UART1_REG(LCR));
103 writel(divisor & 0xff, UART1_REG(DLL));
104 writel((divisor >> 8) & 0xff, UART1_REG(DLM));
105 writel(0x03, UART1_REG(LCR));
106 writel(0x00, UART1_REG(IER));
107 writel(0x00, UART1_REG(FCR));
108 writel(0x00, UART1_REG(MCR));
109
110 /* send the power-off command 'A' to PIC */
111 writel('A', UART1_REG(TX));
112}
113
diff --git a/arch/arm/mach-kirkwood/tsx1x-common.h b/arch/arm/mach-kirkwood/tsx1x-common.h
new file mode 100644
index 000000000000..9a592962a6ea
--- /dev/null
+++ b/arch/arm/mach-kirkwood/tsx1x-common.h
@@ -0,0 +1,7 @@
1#ifndef __ARCH_KIRKWOOD_TSX1X_COMMON_H
2#define __ARCH_KIRKWOOD_TSX1X_COMMON_H
3
4extern void qnap_tsx1x_register_flash(void);
5extern void qnap_tsx1x_power_off(void);
6
7#endif
diff --git a/arch/arm/mach-ks8695/include/mach/memory.h b/arch/arm/mach-ks8695/include/mach/memory.h
index 76e5308685a4..ffa19aae6e05 100644
--- a/arch/arm/mach-ks8695/include/mach/memory.h
+++ b/arch/arm/mach-ks8695/include/mach/memory.h
@@ -41,6 +41,13 @@ extern struct bus_type platform_bus_type;
41 __dma = __dma - PHYS_OFFSET + KS8695_PCIMEM_PA; \ 41 __dma = __dma - PHYS_OFFSET + KS8695_PCIMEM_PA; \
42 __dma; }) 42 __dma; })
43 43
44#define __arch_dma_to_page(dev, x) \
45 ({ dma_addr_t __dma = x; \
46 if (!is_lbus_device(dev)) \
47 __dma += PHYS_OFFSET - KS8695_PCIMEM_PA; \
48 phys_to_page(__dma); \
49 })
50
44#endif 51#endif
45 52
46#endif 53#endif
diff --git a/arch/arm/mach-mmp/aspenite.c b/arch/arm/mach-mmp/aspenite.c
index 4562452d4074..a2d307ec0420 100644
--- a/arch/arm/mach-mmp/aspenite.c
+++ b/arch/arm/mach-mmp/aspenite.c
@@ -13,6 +13,9 @@
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/platform_device.h> 14#include <linux/platform_device.h>
15#include <linux/smc91x.h> 15#include <linux/smc91x.h>
16#include <linux/mtd/mtd.h>
17#include <linux/mtd/partitions.h>
18#include <linux/mtd/nand.h>
16 19
17#include <asm/mach-types.h> 20#include <asm/mach-types.h>
18#include <asm/mach/arch.h> 21#include <asm/mach/arch.h>
@@ -85,12 +88,48 @@ static struct platform_device smc91x_device = {
85 .resource = smc91x_resources, 88 .resource = smc91x_resources,
86}; 89};
87 90
91static struct mtd_partition aspenite_nand_partitions[] = {
92 {
93 .name = "bootloader",
94 .offset = 0,
95 .size = SZ_1M,
96 .mask_flags = MTD_WRITEABLE,
97 }, {
98 .name = "reserved",
99 .offset = MTDPART_OFS_APPEND,
100 .size = SZ_128K,
101 .mask_flags = MTD_WRITEABLE,
102 }, {
103 .name = "reserved",
104 .offset = MTDPART_OFS_APPEND,
105 .size = SZ_8M,
106 .mask_flags = MTD_WRITEABLE,
107 }, {
108 .name = "kernel",
109 .offset = MTDPART_OFS_APPEND,
110 .size = (SZ_2M + SZ_1M),
111 .mask_flags = 0,
112 }, {
113 .name = "filesystem",
114 .offset = MTDPART_OFS_APPEND,
115 .size = SZ_48M,
116 .mask_flags = 0,
117 }
118};
119
120static struct pxa3xx_nand_platform_data aspenite_nand_info = {
121 .enable_arbiter = 1,
122 .parts = aspenite_nand_partitions,
123 .nr_parts = ARRAY_SIZE(aspenite_nand_partitions),
124};
125
88static void __init common_init(void) 126static void __init common_init(void)
89{ 127{
90 mfp_config(ARRAY_AND_SIZE(common_pin_config)); 128 mfp_config(ARRAY_AND_SIZE(common_pin_config));
91 129
92 /* on-chip devices */ 130 /* on-chip devices */
93 pxa168_add_uart(1); 131 pxa168_add_uart(1);
132 pxa168_add_nand(&aspenite_nand_info);
94 133
95 /* off-chip devices */ 134 /* off-chip devices */
96 platform_device_register(&smc91x_device); 135 platform_device_register(&smc91x_device);
diff --git a/arch/arm/mach-mmp/clock.c b/arch/arm/mach-mmp/clock.c
index 2d9cc5a7122f..2a46ed5cc2a2 100644
--- a/arch/arm/mach-mmp/clock.c
+++ b/arch/arm/mach-mmp/clock.c
@@ -34,6 +34,21 @@ struct clkops apbc_clk_ops = {
34 .disable = apbc_clk_disable, 34 .disable = apbc_clk_disable,
35}; 35};
36 36
37static void apmu_clk_enable(struct clk *clk)
38{
39 __raw_writel(clk->enable_val, clk->clk_rst);
40}
41
42static void apmu_clk_disable(struct clk *clk)
43{
44 __raw_writel(0, clk->clk_rst);
45}
46
47struct clkops apmu_clk_ops = {
48 .enable = apmu_clk_enable,
49 .disable = apmu_clk_disable,
50};
51
37static DEFINE_SPINLOCK(clocks_lock); 52static DEFINE_SPINLOCK(clocks_lock);
38 53
39int clk_enable(struct clk *clk) 54int clk_enable(struct clk *clk)
diff --git a/arch/arm/mach-mmp/clock.h b/arch/arm/mach-mmp/clock.h
index ed967e78e6a8..eefffbe683b0 100644
--- a/arch/arm/mach-mmp/clock.h
+++ b/arch/arm/mach-mmp/clock.h
@@ -25,6 +25,7 @@ struct clk {
25}; 25};
26 26
27extern struct clkops apbc_clk_ops; 27extern struct clkops apbc_clk_ops;
28extern struct clkops apmu_clk_ops;
28 29
29#define APBC_CLK(_name, _reg, _fnclksel, _rate) \ 30#define APBC_CLK(_name, _reg, _fnclksel, _rate) \
30struct clk clk_##_name = { \ 31struct clk clk_##_name = { \
diff --git a/arch/arm/mach-mmp/include/mach/irqs.h b/arch/arm/mach-mmp/include/mach/irqs.h
index 16295cfd5e29..d68871b0f28c 100644
--- a/arch/arm/mach-mmp/include/mach/irqs.h
+++ b/arch/arm/mach-mmp/include/mach/irqs.h
@@ -31,7 +31,9 @@
31#define IRQ_PXA168_DDR_INT 26 31#define IRQ_PXA168_DDR_INT 26
32#define IRQ_PXA168_UART1 27 32#define IRQ_PXA168_UART1 27
33#define IRQ_PXA168_UART2 28 33#define IRQ_PXA168_UART2 28
34#define IRQ_PXA168_UART3 29
34#define IRQ_PXA168_WDT 35 35#define IRQ_PXA168_WDT 35
36#define IRQ_PXA168_MAIN_PMU 36
35#define IRQ_PXA168_FRQ_CHANGE 38 37#define IRQ_PXA168_FRQ_CHANGE 38
36#define IRQ_PXA168_SDH1 39 38#define IRQ_PXA168_SDH1 39
37#define IRQ_PXA168_SDH2 40 39#define IRQ_PXA168_SDH2 40
@@ -46,7 +48,7 @@
46#define IRQ_PXA168_USB2 51 48#define IRQ_PXA168_USB2 51
47#define IRQ_PXA168_AC97 57 49#define IRQ_PXA168_AC97 57
48#define IRQ_PXA168_TWSI1 58 50#define IRQ_PXA168_TWSI1 58
49#define IRQ_PXA168_PMU 60 51#define IRQ_PXA168_AP_PMU 60
50#define IRQ_PXA168_SM_INT 63 52#define IRQ_PXA168_SM_INT 63
51 53
52/* 54/*
diff --git a/arch/arm/mach-mmp/include/mach/pxa168.h b/arch/arm/mach-mmp/include/mach/pxa168.h
index 6bf1f0eefcd1..3ad612cbdf09 100644
--- a/arch/arm/mach-mmp/include/mach/pxa168.h
+++ b/arch/arm/mach-mmp/include/mach/pxa168.h
@@ -4,6 +4,7 @@
4#include <linux/i2c.h> 4#include <linux/i2c.h>
5#include <mach/devices.h> 5#include <mach/devices.h>
6#include <plat/i2c.h> 6#include <plat/i2c.h>
7#include <plat/pxa3xx_nand.h>
7 8
8extern struct pxa_device_desc pxa168_device_uart1; 9extern struct pxa_device_desc pxa168_device_uart1;
9extern struct pxa_device_desc pxa168_device_uart2; 10extern struct pxa_device_desc pxa168_device_uart2;
@@ -13,6 +14,7 @@ extern struct pxa_device_desc pxa168_device_pwm1;
13extern struct pxa_device_desc pxa168_device_pwm2; 14extern struct pxa_device_desc pxa168_device_pwm2;
14extern struct pxa_device_desc pxa168_device_pwm3; 15extern struct pxa_device_desc pxa168_device_pwm3;
15extern struct pxa_device_desc pxa168_device_pwm4; 16extern struct pxa_device_desc pxa168_device_pwm4;
17extern struct pxa_device_desc pxa168_device_nand;
16 18
17static inline int pxa168_add_uart(int id) 19static inline int pxa168_add_uart(int id)
18{ 20{
@@ -64,4 +66,9 @@ static inline int pxa168_add_pwm(int id)
64 66
65 return pxa_register_device(d, NULL, 0); 67 return pxa_register_device(d, NULL, 0);
66} 68}
69
70static inline int pxa168_add_nand(struct pxa3xx_nand_platform_data *info)
71{
72 return pxa_register_device(&pxa168_device_nand, info, sizeof(*info));
73}
67#endif /* __ASM_MACH_PXA168_H */ 74#endif /* __ASM_MACH_PXA168_H */
diff --git a/arch/arm/mach-mmp/include/mach/pxa910.h b/arch/arm/mach-mmp/include/mach/pxa910.h
index 6ae1ed7a0a9f..4f0b4ec6f5d0 100644
--- a/arch/arm/mach-mmp/include/mach/pxa910.h
+++ b/arch/arm/mach-mmp/include/mach/pxa910.h
@@ -4,6 +4,7 @@
4#include <linux/i2c.h> 4#include <linux/i2c.h>
5#include <mach/devices.h> 5#include <mach/devices.h>
6#include <plat/i2c.h> 6#include <plat/i2c.h>
7#include <plat/pxa3xx_nand.h>
7 8
8extern struct pxa_device_desc pxa910_device_uart1; 9extern struct pxa_device_desc pxa910_device_uart1;
9extern struct pxa_device_desc pxa910_device_uart2; 10extern struct pxa_device_desc pxa910_device_uart2;
@@ -13,6 +14,7 @@ extern struct pxa_device_desc pxa910_device_pwm1;
13extern struct pxa_device_desc pxa910_device_pwm2; 14extern struct pxa_device_desc pxa910_device_pwm2;
14extern struct pxa_device_desc pxa910_device_pwm3; 15extern struct pxa_device_desc pxa910_device_pwm3;
15extern struct pxa_device_desc pxa910_device_pwm4; 16extern struct pxa_device_desc pxa910_device_pwm4;
17extern struct pxa_device_desc pxa910_device_nand;
16 18
17static inline int pxa910_add_uart(int id) 19static inline int pxa910_add_uart(int id)
18{ 20{
@@ -64,4 +66,9 @@ static inline int pxa910_add_pwm(int id)
64 66
65 return pxa_register_device(d, NULL, 0); 67 return pxa_register_device(d, NULL, 0);
66} 68}
69
70static inline int pxa910_add_nand(struct pxa3xx_nand_platform_data *info)
71{
72 return pxa_register_device(&pxa910_device_nand, info, sizeof(*info));
73}
67#endif /* __ASM_MACH_PXA910_H */ 74#endif /* __ASM_MACH_PXA910_H */
diff --git a/arch/arm/mach-mmp/pxa168.c b/arch/arm/mach-mmp/pxa168.c
index 71b1ae338753..37dbdde17fac 100644
--- a/arch/arm/mach-mmp/pxa168.c
+++ b/arch/arm/mach-mmp/pxa168.c
@@ -19,6 +19,7 @@
19#include <mach/addr-map.h> 19#include <mach/addr-map.h>
20#include <mach/cputype.h> 20#include <mach/cputype.h>
21#include <mach/regs-apbc.h> 21#include <mach/regs-apbc.h>
22#include <mach/regs-apmu.h>
22#include <mach/irqs.h> 23#include <mach/irqs.h>
23#include <mach/gpio.h> 24#include <mach/gpio.h>
24#include <mach/dma.h> 25#include <mach/dma.h>
@@ -72,6 +73,8 @@ static APBC_CLK(pwm2, PXA168_PWM2, 1, 13000000);
72static APBC_CLK(pwm3, PXA168_PWM3, 1, 13000000); 73static APBC_CLK(pwm3, PXA168_PWM3, 1, 13000000);
73static APBC_CLK(pwm4, PXA168_PWM4, 1, 13000000); 74static APBC_CLK(pwm4, PXA168_PWM4, 1, 13000000);
74 75
76static APMU_CLK(nand, NAND, 0x01db, 208000000);
77
75/* device and clock bindings */ 78/* device and clock bindings */
76static struct clk_lookup pxa168_clkregs[] = { 79static struct clk_lookup pxa168_clkregs[] = {
77 INIT_CLKREG(&clk_uart1, "pxa2xx-uart.0", NULL), 80 INIT_CLKREG(&clk_uart1, "pxa2xx-uart.0", NULL),
@@ -82,6 +85,7 @@ static struct clk_lookup pxa168_clkregs[] = {
82 INIT_CLKREG(&clk_pwm2, "pxa168-pwm.1", NULL), 85 INIT_CLKREG(&clk_pwm2, "pxa168-pwm.1", NULL),
83 INIT_CLKREG(&clk_pwm3, "pxa168-pwm.2", NULL), 86 INIT_CLKREG(&clk_pwm3, "pxa168-pwm.2", NULL),
84 INIT_CLKREG(&clk_pwm4, "pxa168-pwm.3", NULL), 87 INIT_CLKREG(&clk_pwm4, "pxa168-pwm.3", NULL),
88 INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL),
85}; 89};
86 90
87static int __init pxa168_init(void) 91static int __init pxa168_init(void)
@@ -127,3 +131,4 @@ PXA168_DEVICE(pwm1, "pxa168-pwm", 0, NONE, 0xd401a000, 0x10);
127PXA168_DEVICE(pwm2, "pxa168-pwm", 1, NONE, 0xd401a400, 0x10); 131PXA168_DEVICE(pwm2, "pxa168-pwm", 1, NONE, 0xd401a400, 0x10);
128PXA168_DEVICE(pwm3, "pxa168-pwm", 2, NONE, 0xd401a800, 0x10); 132PXA168_DEVICE(pwm3, "pxa168-pwm", 2, NONE, 0xd401a800, 0x10);
129PXA168_DEVICE(pwm4, "pxa168-pwm", 3, NONE, 0xd401ac00, 0x10); 133PXA168_DEVICE(pwm4, "pxa168-pwm", 3, NONE, 0xd401ac00, 0x10);
134PXA168_DEVICE(nand, "pxa3xx-nand", -1, NAND, 0xd4283000, 0x80, 97, 99);
diff --git a/arch/arm/mach-mmp/pxa910.c b/arch/arm/mach-mmp/pxa910.c
index 5882ca6b49fb..d4049508a4df 100644
--- a/arch/arm/mach-mmp/pxa910.c
+++ b/arch/arm/mach-mmp/pxa910.c
@@ -110,6 +110,8 @@ static APBC_CLK(pwm2, PXA910_PWM2, 1, 13000000);
110static APBC_CLK(pwm3, PXA910_PWM3, 1, 13000000); 110static APBC_CLK(pwm3, PXA910_PWM3, 1, 13000000);
111static APBC_CLK(pwm4, PXA910_PWM4, 1, 13000000); 111static APBC_CLK(pwm4, PXA910_PWM4, 1, 13000000);
112 112
113static APMU_CLK(nand, NAND, 0x01db, 208000000);
114
113/* device and clock bindings */ 115/* device and clock bindings */
114static struct clk_lookup pxa910_clkregs[] = { 116static struct clk_lookup pxa910_clkregs[] = {
115 INIT_CLKREG(&clk_uart1, "pxa2xx-uart.0", NULL), 117 INIT_CLKREG(&clk_uart1, "pxa2xx-uart.0", NULL),
@@ -120,6 +122,7 @@ static struct clk_lookup pxa910_clkregs[] = {
120 INIT_CLKREG(&clk_pwm2, "pxa910-pwm.1", NULL), 122 INIT_CLKREG(&clk_pwm2, "pxa910-pwm.1", NULL),
121 INIT_CLKREG(&clk_pwm3, "pxa910-pwm.2", NULL), 123 INIT_CLKREG(&clk_pwm3, "pxa910-pwm.2", NULL),
122 INIT_CLKREG(&clk_pwm4, "pxa910-pwm.3", NULL), 124 INIT_CLKREG(&clk_pwm4, "pxa910-pwm.3", NULL),
125 INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL),
123}; 126};
124 127
125static int __init pxa910_init(void) 128static int __init pxa910_init(void)
@@ -174,3 +177,4 @@ PXA910_DEVICE(pwm1, "pxa910-pwm", 0, NONE, 0xd401a000, 0x10);
174PXA910_DEVICE(pwm2, "pxa910-pwm", 1, NONE, 0xd401a400, 0x10); 177PXA910_DEVICE(pwm2, "pxa910-pwm", 1, NONE, 0xd401a400, 0x10);
175PXA910_DEVICE(pwm3, "pxa910-pwm", 2, NONE, 0xd401a800, 0x10); 178PXA910_DEVICE(pwm3, "pxa910-pwm", 2, NONE, 0xd401a800, 0x10);
176PXA910_DEVICE(pwm4, "pxa910-pwm", 3, NONE, 0xd401ac00, 0x10); 179PXA910_DEVICE(pwm4, "pxa910-pwm", 3, NONE, 0xd401ac00, 0x10);
180PXA910_DEVICE(nand, "pxa3xx-nand", -1, NAND, 0xd4283000, 0x80, 97, 99);
diff --git a/arch/arm/mach-mmp/ttc_dkb.c b/arch/arm/mach-mmp/ttc_dkb.c
index 08cfef6c92a2..8f49b2b12608 100644
--- a/arch/arm/mach-mmp/ttc_dkb.c
+++ b/arch/arm/mach-mmp/ttc_dkb.c
@@ -11,9 +11,13 @@
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <linux/platform_device.h> 13#include <linux/platform_device.h>
14#include <linux/mtd/mtd.h>
15#include <linux/mtd/partitions.h>
16#include <linux/mtd/onenand.h>
14 17
15#include <asm/mach-types.h> 18#include <asm/mach-types.h>
16#include <asm/mach/arch.h> 19#include <asm/mach/arch.h>
20#include <asm/mach/flash.h>
17#include <mach/addr-map.h> 21#include <mach/addr-map.h>
18#include <mach/mfp-pxa910.h> 22#include <mach/mfp-pxa910.h>
19#include <mach/pxa910.h> 23#include <mach/pxa910.h>
@@ -26,6 +30,86 @@ static unsigned long ttc_dkb_pin_config[] __initdata = {
26 /* UART2 */ 30 /* UART2 */
27 GPIO47_UART2_RXD, 31 GPIO47_UART2_RXD,
28 GPIO48_UART2_TXD, 32 GPIO48_UART2_TXD,
33
34 /* DFI */
35 DF_IO0_ND_IO0,
36 DF_IO1_ND_IO1,
37 DF_IO2_ND_IO2,
38 DF_IO3_ND_IO3,
39 DF_IO4_ND_IO4,
40 DF_IO5_ND_IO5,
41 DF_IO6_ND_IO6,
42 DF_IO7_ND_IO7,
43 DF_IO8_ND_IO8,
44 DF_IO9_ND_IO9,
45 DF_IO10_ND_IO10,
46 DF_IO11_ND_IO11,
47 DF_IO12_ND_IO12,
48 DF_IO13_ND_IO13,
49 DF_IO14_ND_IO14,
50 DF_IO15_ND_IO15,
51 DF_nCS0_SM_nCS2_nCS0,
52 DF_ALE_SM_WEn_ND_ALE,
53 DF_CLE_SM_OEn_ND_CLE,
54 DF_WEn_DF_WEn,
55 DF_REn_DF_REn,
56 DF_RDY0_DF_RDY0,
57};
58
59static struct mtd_partition ttc_dkb_onenand_partitions[] = {
60 {
61 .name = "bootloader",
62 .offset = 0,
63 .size = SZ_1M,
64 .mask_flags = MTD_WRITEABLE,
65 }, {
66 .name = "reserved",
67 .offset = MTDPART_OFS_APPEND,
68 .size = SZ_128K,
69 .mask_flags = MTD_WRITEABLE,
70 }, {
71 .name = "reserved",
72 .offset = MTDPART_OFS_APPEND,
73 .size = SZ_8M,
74 .mask_flags = MTD_WRITEABLE,
75 }, {
76 .name = "kernel",
77 .offset = MTDPART_OFS_APPEND,
78 .size = (SZ_2M + SZ_1M),
79 .mask_flags = 0,
80 }, {
81 .name = "filesystem",
82 .offset = MTDPART_OFS_APPEND,
83 .size = SZ_48M,
84 .mask_flags = 0,
85 }
86};
87
88static struct onenand_platform_data ttc_dkb_onenand_info = {
89 .parts = ttc_dkb_onenand_partitions,
90 .nr_parts = ARRAY_SIZE(ttc_dkb_onenand_partitions),
91};
92
93static struct resource ttc_dkb_resource_onenand[] = {
94 [0] = {
95 .start = SMC_CS0_PHYS_BASE,
96 .end = SMC_CS0_PHYS_BASE + SZ_1M,
97 .flags = IORESOURCE_MEM,
98 },
99};
100
101static struct platform_device ttc_dkb_device_onenand = {
102 .name = "onenand-flash",
103 .id = -1,
104 .resource = ttc_dkb_resource_onenand,
105 .num_resources = ARRAY_SIZE(ttc_dkb_resource_onenand),
106 .dev = {
107 .platform_data = &ttc_dkb_onenand_info,
108 },
109};
110
111static struct platform_device *ttc_dkb_devices[] = {
112 &ttc_dkb_device_onenand,
29}; 113};
30 114
31static void __init ttc_dkb_init(void) 115static void __init ttc_dkb_init(void)
@@ -34,6 +118,9 @@ static void __init ttc_dkb_init(void)
34 118
35 /* on-chip devices */ 119 /* on-chip devices */
36 pxa910_add_uart(1); 120 pxa910_add_uart(1);
121
122 /* off-chip devices */
123 platform_add_devices(ARRAY_AND_SIZE(ttc_dkb_devices));
37} 124}
38 125
39MACHINE_START(TTC_DKB, "PXA910-based TTC_DKB Development Platform") 126MACHINE_START(TTC_DKB, "PXA910-based TTC_DKB Development Platform")
diff --git a/arch/arm/mach-mx2/Kconfig b/arch/arm/mach-mx2/Kconfig
index c8a2eac4d13c..b96c6a389363 100644
--- a/arch/arm/mach-mx2/Kconfig
+++ b/arch/arm/mach-mx2/Kconfig
@@ -6,11 +6,13 @@ choice
6 6
7config MACH_MX21 7config MACH_MX21
8 bool "i.MX21 support" 8 bool "i.MX21 support"
9 select ARCH_MXC_AUDMUX_V1
9 help 10 help
10 This enables support for Freescale's MX2 based i.MX21 processor. 11 This enables support for Freescale's MX2 based i.MX21 processor.
11 12
12config MACH_MX27 13config MACH_MX27
13 bool "i.MX27 support" 14 bool "i.MX27 support"
15 select ARCH_MXC_AUDMUX_V1
14 help 16 help
15 This enables support for Freescale's MX2 based i.MX27 processor. 17 This enables support for Freescale's MX2 based i.MX27 processor.
16 18
@@ -102,4 +104,11 @@ config MACH_PCA100
102 Include support for phyCARD-s (aka pca100) platform. This 104 Include support for phyCARD-s (aka pca100) platform. This
103 includes specific configurations for the module and its peripherals. 105 includes specific configurations for the module and its peripherals.
104 106
107config MACH_MXT_TD60
108 bool "Maxtrack i-MXT TD60"
109 depends on MACH_MX27
110 help
111 Include support for i-MXT (aka td60) platform. This
112 includes specific configurations for the module and its peripherals.
113
105endif 114endif
diff --git a/arch/arm/mach-mx2/Makefile b/arch/arm/mach-mx2/Makefile
index 19560f045632..52aca0aaf9b5 100644
--- a/arch/arm/mach-mx2/Makefile
+++ b/arch/arm/mach-mx2/Makefile
@@ -20,4 +20,5 @@ obj-$(CONFIG_MACH_MX27LITE) += mx27lite.o
20obj-$(CONFIG_MACH_EUKREA_CPUIMX27) += eukrea_cpuimx27.o 20obj-$(CONFIG_MACH_EUKREA_CPUIMX27) += eukrea_cpuimx27.o
21obj-$(CONFIG_MACH_EUKREA_MBIMX27_BASEBOARD) += eukrea_mbimx27-baseboard.o 21obj-$(CONFIG_MACH_EUKREA_MBIMX27_BASEBOARD) += eukrea_mbimx27-baseboard.o
22obj-$(CONFIG_MACH_PCA100) += pca100.o 22obj-$(CONFIG_MACH_PCA100) += pca100.o
23obj-$(CONFIG_MACH_MXT_TD60) += mxt_td60.o
23 24
diff --git a/arch/arm/mach-mx2/clock_imx21.c b/arch/arm/mach-mx2/clock_imx21.c
index eede79855f4a..91901b5d56c2 100644
--- a/arch/arm/mach-mx2/clock_imx21.c
+++ b/arch/arm/mach-mx2/clock_imx21.c
@@ -1000,7 +1000,7 @@ int __init mx21_clocks_init(unsigned long lref, unsigned long href)
1000 clk_enable(&per_clk[0]); 1000 clk_enable(&per_clk[0]);
1001 clk_enable(&gpio_clk); 1001 clk_enable(&gpio_clk);
1002 1002
1003#ifdef CONFIG_DEBUG_LL_CONSOLE 1003#if defined(CONFIG_DEBUG_LL) && !defined(CONFIG_DEBUG_ICEDCC)
1004 clk_enable(&uart_clk[0]); 1004 clk_enable(&uart_clk[0]);
1005#endif 1005#endif
1006 1006
diff --git a/arch/arm/mach-mx2/clock_imx27.c b/arch/arm/mach-mx2/clock_imx27.c
index ff5e33298914..b010bf9ceaab 100644
--- a/arch/arm/mach-mx2/clock_imx27.c
+++ b/arch/arm/mach-mx2/clock_imx27.c
@@ -651,8 +651,8 @@ static struct clk_lookup lookups[] = {
651 _REGISTER_CLOCK("mxc-ehci.1", "usb_ahb", usb_clk1) 651 _REGISTER_CLOCK("mxc-ehci.1", "usb_ahb", usb_clk1)
652 _REGISTER_CLOCK("mxc-ehci.2", "usb", usb_clk) 652 _REGISTER_CLOCK("mxc-ehci.2", "usb", usb_clk)
653 _REGISTER_CLOCK("mxc-ehci.2", "usb_ahb", usb_clk1) 653 _REGISTER_CLOCK("mxc-ehci.2", "usb_ahb", usb_clk1)
654 _REGISTER_CLOCK(NULL, "ssi1", ssi1_clk) 654 _REGISTER_CLOCK("imx-ssi.0", NULL, ssi1_clk)
655 _REGISTER_CLOCK(NULL, "ssi2", ssi2_clk) 655 _REGISTER_CLOCK("imx-ssi.1", NULL, ssi2_clk)
656 _REGISTER_CLOCK("mxc_nand.0", NULL, nfc_clk) 656 _REGISTER_CLOCK("mxc_nand.0", NULL, nfc_clk)
657 _REGISTER_CLOCK(NULL, "vpu", vpu_clk) 657 _REGISTER_CLOCK(NULL, "vpu", vpu_clk)
658 _REGISTER_CLOCK(NULL, "dma", dma_clk) 658 _REGISTER_CLOCK(NULL, "dma", dma_clk)
@@ -751,7 +751,7 @@ int __init mx27_clocks_init(unsigned long fref)
751 clk_enable(&emi_clk); 751 clk_enable(&emi_clk);
752 clk_enable(&iim_clk); 752 clk_enable(&iim_clk);
753 753
754#ifdef CONFIG_DEBUG_LL_CONSOLE 754#if defined(CONFIG_DEBUG_LL) && !defined(CONFIG_DEBUG_ICEDCC)
755 clk_enable(&uart1_clk); 755 clk_enable(&uart1_clk);
756#endif 756#endif
757 757
diff --git a/arch/arm/mach-mx2/devices.c b/arch/arm/mach-mx2/devices.c
index 50199aff0143..3d398ce09b31 100644
--- a/arch/arm/mach-mx2/devices.c
+++ b/arch/arm/mach-mx2/devices.c
@@ -530,6 +530,84 @@ struct platform_device mxc_usbh2 = {
530}; 530};
531#endif 531#endif
532 532
533static struct resource imx_ssi_resources0[] = {
534 {
535 .start = SSI1_BASE_ADDR,
536 .end = SSI1_BASE_ADDR + 0x6F,
537 .flags = IORESOURCE_MEM,
538 }, {
539 .start = MXC_INT_SSI1,
540 .end = MXC_INT_SSI1,
541 .flags = IORESOURCE_IRQ,
542 }, {
543 .name = "tx0",
544 .start = DMA_REQ_SSI1_TX0,
545 .end = DMA_REQ_SSI1_TX0,
546 .flags = IORESOURCE_DMA,
547 }, {
548 .name = "rx0",
549 .start = DMA_REQ_SSI1_RX0,
550 .end = DMA_REQ_SSI1_RX0,
551 .flags = IORESOURCE_DMA,
552 }, {
553 .name = "tx1",
554 .start = DMA_REQ_SSI1_TX1,
555 .end = DMA_REQ_SSI1_TX1,
556 .flags = IORESOURCE_DMA,
557 }, {
558 .name = "rx1",
559 .start = DMA_REQ_SSI1_RX1,
560 .end = DMA_REQ_SSI1_RX1,
561 .flags = IORESOURCE_DMA,
562 },
563};
564
565static struct resource imx_ssi_resources1[] = {
566 {
567 .start = SSI2_BASE_ADDR,
568 .end = SSI2_BASE_ADDR + 0x6F,
569 .flags = IORESOURCE_MEM,
570 }, {
571 .start = MXC_INT_SSI2,
572 .end = MXC_INT_SSI2,
573 .flags = IORESOURCE_IRQ,
574 }, {
575 .name = "tx0",
576 .start = DMA_REQ_SSI2_TX0,
577 .end = DMA_REQ_SSI2_TX0,
578 .flags = IORESOURCE_DMA,
579 }, {
580 .name = "rx0",
581 .start = DMA_REQ_SSI2_RX0,
582 .end = DMA_REQ_SSI2_RX0,
583 .flags = IORESOURCE_DMA,
584 }, {
585 .name = "tx1",
586 .start = DMA_REQ_SSI2_TX1,
587 .end = DMA_REQ_SSI2_TX1,
588 .flags = IORESOURCE_DMA,
589 }, {
590 .name = "rx1",
591 .start = DMA_REQ_SSI2_RX1,
592 .end = DMA_REQ_SSI2_RX1,
593 .flags = IORESOURCE_DMA,
594 },
595};
596
597struct platform_device imx_ssi_device0 = {
598 .name = "imx-ssi",
599 .id = 0,
600 .num_resources = ARRAY_SIZE(imx_ssi_resources0),
601 .resource = imx_ssi_resources0,
602};
603
604struct platform_device imx_ssi_device1 = {
605 .name = "imx-ssi",
606 .id = 1,
607 .num_resources = ARRAY_SIZE(imx_ssi_resources1),
608 .resource = imx_ssi_resources1,
609};
610
533/* GPIO port description */ 611/* GPIO port description */
534static struct mxc_gpio_port imx_gpio_ports[] = { 612static struct mxc_gpio_port imx_gpio_ports[] = {
535 { 613 {
diff --git a/arch/arm/mach-mx2/devices.h b/arch/arm/mach-mx2/devices.h
index d315406d6725..97306aa18f1c 100644
--- a/arch/arm/mach-mx2/devices.h
+++ b/arch/arm/mach-mx2/devices.h
@@ -26,4 +26,5 @@ extern struct platform_device mxc_usbh2;
26extern struct platform_device mxc_spi_device0; 26extern struct platform_device mxc_spi_device0;
27extern struct platform_device mxc_spi_device1; 27extern struct platform_device mxc_spi_device1;
28extern struct platform_device mxc_spi_device2; 28extern struct platform_device mxc_spi_device2;
29 29extern struct platform_device imx_ssi_device0;
30extern struct platform_device imx_ssi_device1;
diff --git a/arch/arm/mach-mx2/mxt_td60.c b/arch/arm/mach-mx2/mxt_td60.c
new file mode 100644
index 000000000000..03dbbdc98955
--- /dev/null
+++ b/arch/arm/mach-mx2/mxt_td60.c
@@ -0,0 +1,319 @@
1/*
2 * Copyright (C) 2000 Deep Blue Solutions Ltd
3 * Copyright (C) 2002 Shane Nay (shane@minirl.com)
4 * Copyright 2006-2007 Freescale Semiconductor, Inc. All Rights Reserved.
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 as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#include <linux/platform_device.h>
22#include <linux/mtd/mtd.h>
23#include <linux/mtd/map.h>
24#include <linux/mtd/partitions.h>
25#include <linux/mtd/physmap.h>
26#include <linux/i2c.h>
27#include <linux/irq.h>
28#include <mach/common.h>
29#include <mach/hardware.h>
30#include <asm/mach-types.h>
31#include <asm/mach/arch.h>
32#include <asm/mach/time.h>
33#include <asm/mach/map.h>
34#include <linux/gpio.h>
35#include <mach/imx-uart.h>
36#include <mach/iomux.h>
37#include <mach/mxc_nand.h>
38#include <mach/i2c.h>
39#include <linux/i2c/pca953x.h>
40#include <mach/imxfb.h>
41#include <mach/mmc.h>
42
43#include "devices.h"
44
45static unsigned int mxt_td60_pins[] __initdata = {
46 /* UART0 */
47 PE12_PF_UART1_TXD,
48 PE13_PF_UART1_RXD,
49 PE14_PF_UART1_CTS,
50 PE15_PF_UART1_RTS,
51 /* UART1 */
52 PE3_PF_UART2_CTS,
53 PE4_PF_UART2_RTS,
54 PE6_PF_UART2_TXD,
55 PE7_PF_UART2_RXD,
56 /* UART2 */
57 PE8_PF_UART3_TXD,
58 PE9_PF_UART3_RXD,
59 PE10_PF_UART3_CTS,
60 PE11_PF_UART3_RTS,
61 /* UART3 */
62 PB26_AF_UART4_RTS,
63 PB28_AF_UART4_TXD,
64 PB29_AF_UART4_CTS,
65 PB31_AF_UART4_RXD,
66 /* UART4 */
67 PB18_AF_UART5_TXD,
68 PB19_AF_UART5_RXD,
69 PB20_AF_UART5_CTS,
70 PB21_AF_UART5_RTS,
71 /* UART5 */
72 PB10_AF_UART6_TXD,
73 PB12_AF_UART6_CTS,
74 PB11_AF_UART6_RXD,
75 PB13_AF_UART6_RTS,
76 /* FEC */
77 PD0_AIN_FEC_TXD0,
78 PD1_AIN_FEC_TXD1,
79 PD2_AIN_FEC_TXD2,
80 PD3_AIN_FEC_TXD3,
81 PD4_AOUT_FEC_RX_ER,
82 PD5_AOUT_FEC_RXD1,
83 PD6_AOUT_FEC_RXD2,
84 PD7_AOUT_FEC_RXD3,
85 PD8_AF_FEC_MDIO,
86 PD9_AIN_FEC_MDC,
87 PD10_AOUT_FEC_CRS,
88 PD11_AOUT_FEC_TX_CLK,
89 PD12_AOUT_FEC_RXD0,
90 PD13_AOUT_FEC_RX_DV,
91 PD14_AOUT_FEC_RX_CLK,
92 PD15_AOUT_FEC_COL,
93 PD16_AIN_FEC_TX_ER,
94 PF23_AIN_FEC_TX_EN,
95 /* I2C1 */
96 PD17_PF_I2C_DATA,
97 PD18_PF_I2C_CLK,
98 /* I2C2 */
99 PC5_PF_I2C2_SDA,
100 PC6_PF_I2C2_SCL,
101 /* FB */
102 PA5_PF_LSCLK,
103 PA6_PF_LD0,
104 PA7_PF_LD1,
105 PA8_PF_LD2,
106 PA9_PF_LD3,
107 PA10_PF_LD4,
108 PA11_PF_LD5,
109 PA12_PF_LD6,
110 PA13_PF_LD7,
111 PA14_PF_LD8,
112 PA15_PF_LD9,
113 PA16_PF_LD10,
114 PA17_PF_LD11,
115 PA18_PF_LD12,
116 PA19_PF_LD13,
117 PA20_PF_LD14,
118 PA21_PF_LD15,
119 PA22_PF_LD16,
120 PA23_PF_LD17,
121 PA25_PF_CLS,
122 PA27_PF_SPL_SPR,
123 PA28_PF_HSYNC,
124 PA29_PF_VSYNC,
125 PA30_PF_CONTRAST,
126 PA31_PF_OE_ACD,
127 /* OWIRE */
128 PE16_AF_OWIRE,
129 /* SDHC1*/
130 PE18_PF_SD1_D0,
131 PE19_PF_SD1_D1,
132 PE20_PF_SD1_D2,
133 PE21_PF_SD1_D3,
134 PE22_PF_SD1_CMD,
135 PE23_PF_SD1_CLK,
136 PF8_AF_ATA_IORDY,
137 /* SDHC2*/
138 PB4_PF_SD2_D0,
139 PB5_PF_SD2_D1,
140 PB6_PF_SD2_D2,
141 PB7_PF_SD2_D3,
142 PB8_PF_SD2_CMD,
143 PB9_PF_SD2_CLK,
144};
145
146static struct mxc_nand_platform_data mxt_td60_nand_board_info = {
147 .width = 1,
148 .hw_ecc = 1,
149};
150
151static struct imxi2c_platform_data mxt_td60_i2c_data = {
152 .bitrate = 100000,
153};
154
155/* PCA9557 */
156static int mxt_td60_pca9557_setup(struct i2c_client *client,
157 unsigned gpio_base, unsigned ngpio,
158 void *context)
159{
160 static int mxt_td60_gpio_value[] = {
161 -1, -1, -1, -1, -1, -1, -1, 1
162 };
163 int n;
164
165 for (n = 0; n < ARRAY_SIZE(mxt_td60_gpio_value); ++n) {
166 gpio_request(gpio_base + n, "MXT_TD60 GPIO Exp");
167 if (mxt_td60_gpio_value[n] < 0)
168 gpio_direction_input(gpio_base + n);
169 else
170 gpio_direction_output(gpio_base + n,
171 mxt_td60_gpio_value[n]);
172 gpio_export(gpio_base + n, 0);
173 }
174
175 return 0;
176}
177
178static struct pca953x_platform_data mxt_td60_pca9557_pdata = {
179 .gpio_base = 240, /* place PCA9557 after all MX27 gpio pins */
180 .invert = 0, /* Do not invert */
181 .setup = mxt_td60_pca9557_setup,
182};
183
184static struct i2c_board_info mxt_td60_i2c_devices[] = {
185 {
186 I2C_BOARD_INFO("pca9557", 0x18),
187 .platform_data = &mxt_td60_pca9557_pdata,
188 },
189};
190
191static struct imxi2c_platform_data mxt_td60_i2c2_data = {
192 .bitrate = 100000,
193};
194
195static struct i2c_board_info mxt_td60_i2c2_devices[] = {
196};
197
198static struct imx_fb_videomode mxt_td60_modes[] = {
199 {
200 .mode = {
201 .name = "Chimei LW700AT9003",
202 .refresh = 60,
203 .xres = 800,
204 .yres = 480,
205 .pixclock = 30303,
206 .hsync_len = 64,
207 .left_margin = 0x67,
208 .right_margin = 0x68,
209 .vsync_len = 16,
210 .upper_margin = 0x0f,
211 .lower_margin = 0x0f,
212 },
213 .bpp = 16,
214 .pcr = 0xFA208B83,
215 },
216};
217
218static struct imx_fb_platform_data mxt_td60_fb_data = {
219 .mode = mxt_td60_modes,
220 .num_modes = ARRAY_SIZE(mxt_td60_modes),
221
222 /*
223 * - HSYNC active high
224 * - VSYNC active high
225 * - clk notenabled while idle
226 * - clock inverted
227 * - data not inverted
228 * - data enable low active
229 * - enable sharp mode
230 */
231 .pwmr = 0x00A903FF,
232 .lscr1 = 0x00120300,
233 .dmacr = 0x00020010,
234};
235
236static int mxt_td60_sdhc1_init(struct device *dev, irq_handler_t detect_irq,
237 void *data)
238{
239 return request_irq(IRQ_GPIOF(8), detect_irq, IRQF_TRIGGER_FALLING,
240 "sdhc1-card-detect", data);
241}
242
243static void mxt_td60_sdhc1_exit(struct device *dev, void *data)
244{
245 free_irq(IRQ_GPIOF(8), data);
246}
247
248static struct imxmmc_platform_data sdhc1_pdata = {
249 .init = mxt_td60_sdhc1_init,
250 .exit = mxt_td60_sdhc1_exit,
251};
252
253static struct platform_device *platform_devices[] __initdata = {
254 &mxc_fec_device,
255};
256
257static struct imxuart_platform_data uart_pdata[] = {
258 {
259 .flags = IMXUART_HAVE_RTSCTS,
260 }, {
261 .flags = IMXUART_HAVE_RTSCTS,
262 }, {
263 .flags = IMXUART_HAVE_RTSCTS,
264 }, {
265 .flags = IMXUART_HAVE_RTSCTS,
266 }, {
267 .flags = IMXUART_HAVE_RTSCTS,
268 }, {
269 .flags = IMXUART_HAVE_RTSCTS,
270 },
271};
272
273static void __init mxt_td60_board_init(void)
274{
275 mxc_gpio_setup_multiple_pins(mxt_td60_pins, ARRAY_SIZE(mxt_td60_pins),
276 "MXT_TD60");
277
278 mxc_register_device(&mxc_uart_device0, &uart_pdata[0]);
279 mxc_register_device(&mxc_uart_device1, &uart_pdata[1]);
280 mxc_register_device(&mxc_uart_device2, &uart_pdata[2]);
281 mxc_register_device(&mxc_uart_device3, &uart_pdata[3]);
282 mxc_register_device(&mxc_uart_device4, &uart_pdata[4]);
283 mxc_register_device(&mxc_uart_device5, &uart_pdata[5]);
284 mxc_register_device(&mxc_nand_device, &mxt_td60_nand_board_info);
285
286 i2c_register_board_info(0, mxt_td60_i2c_devices,
287 ARRAY_SIZE(mxt_td60_i2c_devices));
288
289 i2c_register_board_info(1, mxt_td60_i2c2_devices,
290 ARRAY_SIZE(mxt_td60_i2c2_devices));
291
292 mxc_register_device(&mxc_i2c_device0, &mxt_td60_i2c_data);
293 mxc_register_device(&mxc_i2c_device1, &mxt_td60_i2c2_data);
294 mxc_register_device(&mxc_fb_device, &mxt_td60_fb_data);
295 mxc_register_device(&mxc_sdhc_device0, &sdhc1_pdata);
296
297 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
298}
299
300static void __init mxt_td60_timer_init(void)
301{
302 mx27_clocks_init(26000000);
303}
304
305static struct sys_timer mxt_td60_timer = {
306 .init = mxt_td60_timer_init,
307};
308
309MACHINE_START(MXT_TD60, "Maxtrack i-MXT TD60")
310 /* maintainer: Maxtrack Industrial */
311 .phys_io = AIPI_BASE_ADDR,
312 .io_pg_offst = ((AIPI_BASE_ADDR_VIRT) >> 18) & 0xfffc,
313 .boot_params = PHYS_OFFSET + 0x100,
314 .map_io = mx27_map_io,
315 .init_irq = mx27_init_irq,
316 .init_machine = mxt_td60_board_init,
317 .timer = &mxt_td60_timer,
318MACHINE_END
319
diff --git a/arch/arm/mach-mx2/pca100.c b/arch/arm/mach-mx2/pca100.c
index fe5b165b88cc..aea3d340d2e1 100644
--- a/arch/arm/mach-mx2/pca100.c
+++ b/arch/arm/mach-mx2/pca100.c
@@ -237,7 +237,7 @@ MACHINE_START(PCA100, "phyCARD-i.MX27")
237 .io_pg_offst = ((AIPI_BASE_ADDR_VIRT) >> 18) & 0xfffc, 237 .io_pg_offst = ((AIPI_BASE_ADDR_VIRT) >> 18) & 0xfffc,
238 .boot_params = PHYS_OFFSET + 0x100, 238 .boot_params = PHYS_OFFSET + 0x100,
239 .map_io = mx27_map_io, 239 .map_io = mx27_map_io,
240 .init_irq = mxc_init_irq, 240 .init_irq = mx27_init_irq,
241 .init_machine = pca100_init, 241 .init_machine = pca100_init,
242 .timer = &pca100_timer, 242 .timer = &pca100_timer,
243MACHINE_END 243MACHINE_END
diff --git a/arch/arm/mach-mx3/Kconfig b/arch/arm/mach-mx3/Kconfig
index 851f2458bf65..ea8ed109a7c2 100644
--- a/arch/arm/mach-mx3/Kconfig
+++ b/arch/arm/mach-mx3/Kconfig
@@ -2,11 +2,13 @@ if ARCH_MX3
2 2
3config ARCH_MX31 3config ARCH_MX31
4 select ARCH_HAS_RNGA 4 select ARCH_HAS_RNGA
5 select ARCH_MXC_AUDMUX_V2
5 bool 6 bool
6 7
7config ARCH_MX35 8config ARCH_MX35
8 bool 9 bool
9 select ARCH_MXC_IOMUX_V3 10 select ARCH_MXC_IOMUX_V3
11 select ARCH_MXC_AUDMUX_V2
10 12
11comment "MX3 platforms:" 13comment "MX3 platforms:"
12 14
@@ -61,6 +63,7 @@ config MACH_MX31_3DS
61config MACH_MX31MOBOARD 63config MACH_MX31MOBOARD
62 bool "Support mx31moboard platforms (EPFL Mobots group)" 64 bool "Support mx31moboard platforms (EPFL Mobots group)"
63 select ARCH_MX31 65 select ARCH_MX31
66 select MXC_ULPI
64 help 67 help
65 Include support for mx31moboard platform. This includes specific 68 Include support for mx31moboard platform. This includes specific
66 configurations for the board and its peripherals. 69 configurations for the board and its peripherals.
@@ -100,4 +103,12 @@ config MACH_MX35_3DS
100 help 103 help
101 Include support for MX35PDK platform. This includes specific 104 Include support for MX35PDK platform. This includes specific
102 configurations for the board and its peripherals. 105 configurations for the board and its peripherals.
106
107config MACH_KZM_ARM11_01
108 bool "Support KZM-ARM11-01(Kyoto Microcomputer)"
109 select ARCH_MX31
110 help
111 Include support for KZM-ARM11-01. This includes specific
112 configurations for the board and its peripherals.
113
103endif 114endif
diff --git a/arch/arm/mach-mx3/Makefile b/arch/arm/mach-mx3/Makefile
index 6b9775471be6..93c7b296be6a 100644
--- a/arch/arm/mach-mx3/Makefile
+++ b/arch/arm/mach-mx3/Makefile
@@ -4,12 +4,12 @@
4 4
5# Object file lists. 5# Object file lists.
6 6
7obj-y := mm.o devices.o 7obj-y := mm.o devices.o cpu.o
8obj-$(CONFIG_ARCH_MX31) += clock.o iomux.o 8obj-$(CONFIG_ARCH_MX31) += clock.o iomux.o
9obj-$(CONFIG_ARCH_MX35) += clock-imx35.o 9obj-$(CONFIG_ARCH_MX35) += clock-imx35.o
10obj-$(CONFIG_MACH_MX31ADS) += mx31ads.o 10obj-$(CONFIG_MACH_MX31ADS) += mx31ads.o
11obj-$(CONFIG_MACH_MX31LILLY) += mx31lilly.o mx31lilly-db.o 11obj-$(CONFIG_MACH_MX31LILLY) += mx31lilly.o mx31lilly-db.o
12obj-$(CONFIG_MACH_MX31LITE) += mx31lite.o 12obj-$(CONFIG_MACH_MX31LITE) += mx31lite.o mx31lite-db.o
13obj-$(CONFIG_MACH_PCM037) += pcm037.o 13obj-$(CONFIG_MACH_PCM037) += pcm037.o
14obj-$(CONFIG_MACH_PCM037_EET) += pcm037_eet.o 14obj-$(CONFIG_MACH_PCM037_EET) += pcm037_eet.o
15obj-$(CONFIG_MACH_MX31_3DS) += mx31pdk.o 15obj-$(CONFIG_MACH_MX31_3DS) += mx31pdk.o
@@ -19,3 +19,4 @@ obj-$(CONFIG_MACH_QONG) += qong.o
19obj-$(CONFIG_MACH_PCM043) += pcm043.o 19obj-$(CONFIG_MACH_PCM043) += pcm043.o
20obj-$(CONFIG_MACH_ARMADILLO5X0) += armadillo5x0.o 20obj-$(CONFIG_MACH_ARMADILLO5X0) += armadillo5x0.o
21obj-$(CONFIG_MACH_MX35_3DS) += mx35pdk.o 21obj-$(CONFIG_MACH_MX35_3DS) += mx35pdk.o
22obj-$(CONFIG_MACH_KZM_ARM11_01) += kzmarm11.o
diff --git a/arch/arm/mach-mx3/armadillo5x0.c b/arch/arm/mach-mx3/armadillo5x0.c
index 776c0ee1b3cd..54aab401dbdf 100644
--- a/arch/arm/mach-mx3/armadillo5x0.c
+++ b/arch/arm/mach-mx3/armadillo5x0.c
@@ -33,6 +33,9 @@
33#include <linux/irq.h> 33#include <linux/irq.h>
34#include <linux/mtd/physmap.h> 34#include <linux/mtd/physmap.h>
35#include <linux/io.h> 35#include <linux/io.h>
36#include <linux/input.h>
37#include <linux/gpio_keys.h>
38#include <linux/i2c.h>
36 39
37#include <mach/hardware.h> 40#include <mach/hardware.h>
38#include <asm/mach-types.h> 41#include <asm/mach-types.h>
@@ -97,6 +100,47 @@ static int armadillo5x0_pins[] = {
97 MX31_PIN_FPSHIFT__FPSHIFT, 100 MX31_PIN_FPSHIFT__FPSHIFT,
98 MX31_PIN_DRDY0__DRDY0, 101 MX31_PIN_DRDY0__DRDY0,
99 IOMUX_MODE(MX31_PIN_LCS1, IOMUX_CONFIG_GPIO), /*ADV7125_PSAVE*/ 102 IOMUX_MODE(MX31_PIN_LCS1, IOMUX_CONFIG_GPIO), /*ADV7125_PSAVE*/
103 /* I2C2 */
104 MX31_PIN_CSPI2_MOSI__SCL,
105 MX31_PIN_CSPI2_MISO__SDA,
106};
107
108/* RTC over I2C*/
109#define ARMADILLO5X0_RTC_GPIO IOMUX_TO_GPIO(MX31_PIN_SRXD4)
110
111static struct i2c_board_info armadillo5x0_i2c_rtc = {
112 I2C_BOARD_INFO("s35390a", 0x30),
113};
114
115/* GPIO BUTTONS */
116static struct gpio_keys_button armadillo5x0_buttons[] = {
117 {
118 .code = KEY_ENTER, /*28*/
119 .gpio = IOMUX_TO_GPIO(MX31_PIN_SCLK0),
120 .active_low = 1,
121 .desc = "menu",
122 .wakeup = 1,
123 }, {
124 .code = KEY_BACK, /*158*/
125 .gpio = IOMUX_TO_GPIO(MX31_PIN_SRST0),
126 .active_low = 1,
127 .desc = "back",
128 .wakeup = 1,
129 }
130};
131
132static struct gpio_keys_platform_data armadillo5x0_button_data = {
133 .buttons = armadillo5x0_buttons,
134 .nbuttons = ARRAY_SIZE(armadillo5x0_buttons),
135};
136
137static struct platform_device armadillo5x0_button_device = {
138 .name = "gpio-keys",
139 .id = -1,
140 .num_resources = 0,
141 .dev = {
142 .platform_data = &armadillo5x0_button_data,
143 }
100}; 144};
101 145
102/* 146/*
@@ -278,7 +322,7 @@ static struct resource armadillo5x0_smc911x_resources[] = {
278}; 322};
279 323
280static struct smsc911x_platform_config smsc911x_info = { 324static struct smsc911x_platform_config smsc911x_info = {
281 .flags = SMSC911X_USE_32BIT, 325 .flags = SMSC911X_USE_16BIT,
282 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, 326 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
283 .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL, 327 .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
284}; 328};
@@ -300,6 +344,8 @@ static struct imxuart_platform_data uart_pdata = {
300 344
301static struct platform_device *devices[] __initdata = { 345static struct platform_device *devices[] __initdata = {
302 &armadillo5x0_smc911x_device, 346 &armadillo5x0_smc911x_device,
347 &mxc_i2c_device1,
348 &armadillo5x0_button_device,
303}; 349};
304 350
305/* 351/*
@@ -335,6 +381,18 @@ static void __init armadillo5x0_init(void)
335 381
336 /* set NAND page size to 2k if not configured via boot mode pins */ 382 /* set NAND page size to 2k if not configured via boot mode pins */
337 __raw_writel(__raw_readl(MXC_CCM_RCSR) | (1 << 30), MXC_CCM_RCSR); 383 __raw_writel(__raw_readl(MXC_CCM_RCSR) | (1 << 30), MXC_CCM_RCSR);
384
385 /* RTC */
386 /* Get RTC IRQ and register the chip */
387 if (gpio_request(ARMADILLO5X0_RTC_GPIO, "rtc") == 0) {
388 if (gpio_direction_input(ARMADILLO5X0_RTC_GPIO) == 0)
389 armadillo5x0_i2c_rtc.irq = gpio_to_irq(ARMADILLO5X0_RTC_GPIO);
390 else
391 gpio_free(ARMADILLO5X0_RTC_GPIO);
392 }
393 if (armadillo5x0_i2c_rtc.irq == 0)
394 pr_warning("armadillo5x0_init: failed to get RTC IRQ\n");
395 i2c_register_board_info(1, &armadillo5x0_i2c_rtc, 1);
338} 396}
339 397
340static void __init armadillo5x0_timer_init(void) 398static void __init armadillo5x0_timer_init(void)
diff --git a/arch/arm/mach-mx3/clock-imx35.c b/arch/arm/mach-mx3/clock-imx35.c
index c595260ec1f9..7584b4c6c556 100644
--- a/arch/arm/mach-mx3/clock-imx35.c
+++ b/arch/arm/mach-mx3/clock-imx35.c
@@ -335,7 +335,7 @@ static void clk_cgr_disable(struct clk *clk)
335 335
336DEFINE_CLOCK(asrc_clk, 0, CCM_CGR0, 0, NULL, NULL); 336DEFINE_CLOCK(asrc_clk, 0, CCM_CGR0, 0, NULL, NULL);
337DEFINE_CLOCK(ata_clk, 0, CCM_CGR0, 2, get_rate_ipg, NULL); 337DEFINE_CLOCK(ata_clk, 0, CCM_CGR0, 2, get_rate_ipg, NULL);
338DEFINE_CLOCK(audmux_clk, 0, CCM_CGR0, 4, NULL, NULL); 338/* DEFINE_CLOCK(audmux_clk, 0, CCM_CGR0, 4, NULL, NULL); */
339DEFINE_CLOCK(can1_clk, 0, CCM_CGR0, 6, get_rate_ipg, NULL); 339DEFINE_CLOCK(can1_clk, 0, CCM_CGR0, 6, get_rate_ipg, NULL);
340DEFINE_CLOCK(can2_clk, 1, CCM_CGR0, 8, get_rate_ipg, NULL); 340DEFINE_CLOCK(can2_clk, 1, CCM_CGR0, 8, get_rate_ipg, NULL);
341DEFINE_CLOCK(cspi1_clk, 0, CCM_CGR0, 10, get_rate_ipg, NULL); 341DEFINE_CLOCK(cspi1_clk, 0, CCM_CGR0, 10, get_rate_ipg, NULL);
@@ -381,12 +381,43 @@ DEFINE_CLOCK(uart3_clk, 2, CCM_CGR2, 20, get_rate_uart, NULL);
381DEFINE_CLOCK(usbotg_clk, 0, CCM_CGR2, 22, get_rate_otg, NULL); 381DEFINE_CLOCK(usbotg_clk, 0, CCM_CGR2, 22, get_rate_otg, NULL);
382DEFINE_CLOCK(wdog_clk, 0, CCM_CGR2, 24, NULL, NULL); 382DEFINE_CLOCK(wdog_clk, 0, CCM_CGR2, 24, NULL, NULL);
383DEFINE_CLOCK(max_clk, 0, CCM_CGR2, 26, NULL, NULL); 383DEFINE_CLOCK(max_clk, 0, CCM_CGR2, 26, NULL, NULL);
384DEFINE_CLOCK(admux_clk, 0, CCM_CGR2, 30, NULL, NULL); 384DEFINE_CLOCK(audmux_clk, 0, CCM_CGR2, 30, NULL, NULL);
385 385
386DEFINE_CLOCK(csi_clk, 0, CCM_CGR3, 0, get_rate_csi, NULL); 386DEFINE_CLOCK(csi_clk, 0, CCM_CGR3, 0, get_rate_csi, NULL);
387DEFINE_CLOCK(iim_clk, 0, CCM_CGR3, 2, NULL, NULL); 387DEFINE_CLOCK(iim_clk, 0, CCM_CGR3, 2, NULL, NULL);
388DEFINE_CLOCK(gpu2d_clk, 0, CCM_CGR3, 4, NULL, NULL); 388DEFINE_CLOCK(gpu2d_clk, 0, CCM_CGR3, 4, NULL, NULL);
389 389
390DEFINE_CLOCK(usbahb_clk, 0, 0, 0, get_rate_ahb, NULL);
391
392static int clk_dummy_enable(struct clk *clk)
393{
394 return 0;
395}
396
397static void clk_dummy_disable(struct clk *clk)
398{
399}
400
401static unsigned long get_rate_nfc(struct clk *clk)
402{
403 unsigned long div1;
404
405 div1 = (__raw_readl(CCM_BASE + CCM_PDR4) >> 28) + 1;
406
407 return get_rate_ahb(NULL) / div1;
408}
409
410/* NAND Controller: It seems it can't be disabled */
411static struct clk nfc_clk = {
412 .id = 0,
413 .enable_reg = 0,
414 .enable_shift = 0,
415 .get_rate = get_rate_nfc,
416 .set_rate = NULL, /* set_rate_nfc, */
417 .enable = clk_dummy_enable,
418 .disable = clk_dummy_disable
419};
420
390#define _REGISTER_CLOCK(d, n, c) \ 421#define _REGISTER_CLOCK(d, n, c) \
391 { \ 422 { \
392 .dev_id = d, \ 423 .dev_id = d, \
@@ -397,7 +428,6 @@ DEFINE_CLOCK(gpu2d_clk, 0, CCM_CGR3, 4, NULL, NULL);
397static struct clk_lookup lookups[] = { 428static struct clk_lookup lookups[] = {
398 _REGISTER_CLOCK(NULL, "asrc", asrc_clk) 429 _REGISTER_CLOCK(NULL, "asrc", asrc_clk)
399 _REGISTER_CLOCK(NULL, "ata", ata_clk) 430 _REGISTER_CLOCK(NULL, "ata", ata_clk)
400 _REGISTER_CLOCK(NULL, "audmux", audmux_clk)
401 _REGISTER_CLOCK(NULL, "can", can1_clk) 431 _REGISTER_CLOCK(NULL, "can", can1_clk)
402 _REGISTER_CLOCK(NULL, "can", can2_clk) 432 _REGISTER_CLOCK(NULL, "can", can2_clk)
403 _REGISTER_CLOCK("spi_imx.0", NULL, cspi1_clk) 433 _REGISTER_CLOCK("spi_imx.0", NULL, cspi1_clk)
@@ -434,8 +464,8 @@ static struct clk_lookup lookups[] = {
434 _REGISTER_CLOCK(NULL, "sdma", sdma_clk) 464 _REGISTER_CLOCK(NULL, "sdma", sdma_clk)
435 _REGISTER_CLOCK(NULL, "spba", spba_clk) 465 _REGISTER_CLOCK(NULL, "spba", spba_clk)
436 _REGISTER_CLOCK(NULL, "spdif", spdif_clk) 466 _REGISTER_CLOCK(NULL, "spdif", spdif_clk)
437 _REGISTER_CLOCK(NULL, "ssi", ssi1_clk) 467 _REGISTER_CLOCK("imx-ssi.0", NULL, ssi1_clk)
438 _REGISTER_CLOCK(NULL, "ssi", ssi2_clk) 468 _REGISTER_CLOCK("imx-ssi.1", NULL, ssi2_clk)
439 _REGISTER_CLOCK("imx-uart.0", NULL, uart1_clk) 469 _REGISTER_CLOCK("imx-uart.0", NULL, uart1_clk)
440 _REGISTER_CLOCK("imx-uart.1", NULL, uart2_clk) 470 _REGISTER_CLOCK("imx-uart.1", NULL, uart2_clk)
441 _REGISTER_CLOCK("imx-uart.2", NULL, uart3_clk) 471 _REGISTER_CLOCK("imx-uart.2", NULL, uart3_clk)
@@ -443,12 +473,14 @@ static struct clk_lookup lookups[] = {
443 _REGISTER_CLOCK("mxc-ehci.1", "usb", usbotg_clk) 473 _REGISTER_CLOCK("mxc-ehci.1", "usb", usbotg_clk)
444 _REGISTER_CLOCK("mxc-ehci.2", "usb", usbotg_clk) 474 _REGISTER_CLOCK("mxc-ehci.2", "usb", usbotg_clk)
445 _REGISTER_CLOCK("fsl-usb2-udc", "usb", usbotg_clk) 475 _REGISTER_CLOCK("fsl-usb2-udc", "usb", usbotg_clk)
476 _REGISTER_CLOCK("fsl-usb2-udc", "usb_ahb", usbahb_clk)
446 _REGISTER_CLOCK("imx-wdt.0", NULL, wdog_clk) 477 _REGISTER_CLOCK("imx-wdt.0", NULL, wdog_clk)
447 _REGISTER_CLOCK(NULL, "max", max_clk) 478 _REGISTER_CLOCK(NULL, "max", max_clk)
448 _REGISTER_CLOCK(NULL, "admux", admux_clk) 479 _REGISTER_CLOCK(NULL, "audmux", audmux_clk)
449 _REGISTER_CLOCK(NULL, "csi", csi_clk) 480 _REGISTER_CLOCK(NULL, "csi", csi_clk)
450 _REGISTER_CLOCK(NULL, "iim", iim_clk) 481 _REGISTER_CLOCK(NULL, "iim", iim_clk)
451 _REGISTER_CLOCK(NULL, "gpu2d", gpu2d_clk) 482 _REGISTER_CLOCK(NULL, "gpu2d", gpu2d_clk)
483 _REGISTER_CLOCK("mxc_nand.0", NULL, nfc_clk)
452}; 484};
453 485
454int __init mx35_clocks_init() 486int __init mx35_clocks_init()
@@ -456,7 +488,7 @@ int __init mx35_clocks_init()
456 int i; 488 int i;
457 unsigned int ll = 0; 489 unsigned int ll = 0;
458 490
459#ifdef CONFIG_DEBUG_LL_CONSOLE 491#if defined(CONFIG_DEBUG_LL) && !defined(CONFIG_DEBUG_ICEDCC)
460 ll = (3 << 16); 492 ll = (3 << 16);
461#endif 493#endif
462 494
diff --git a/arch/arm/mach-mx3/clock.c b/arch/arm/mach-mx3/clock.c
index b2a3bcf8266e..27a318af0d20 100644
--- a/arch/arm/mach-mx3/clock.c
+++ b/arch/arm/mach-mx3/clock.c
@@ -558,8 +558,8 @@ static struct clk_lookup lookups[] = {
558 _REGISTER_CLOCK("mxc_w1.0", NULL, owire_clk) 558 _REGISTER_CLOCK("mxc_w1.0", NULL, owire_clk)
559 _REGISTER_CLOCK("mxc-mmc.0", NULL, sdhc1_clk) 559 _REGISTER_CLOCK("mxc-mmc.0", NULL, sdhc1_clk)
560 _REGISTER_CLOCK("mxc-mmc.1", NULL, sdhc2_clk) 560 _REGISTER_CLOCK("mxc-mmc.1", NULL, sdhc2_clk)
561 _REGISTER_CLOCK(NULL, "ssi", ssi1_clk) 561 _REGISTER_CLOCK("imx-ssi.0", NULL, ssi1_clk)
562 _REGISTER_CLOCK(NULL, "ssi", ssi2_clk) 562 _REGISTER_CLOCK("imx-ssi.1", NULL, ssi2_clk)
563 _REGISTER_CLOCK(NULL, "firi", firi_clk) 563 _REGISTER_CLOCK(NULL, "firi", firi_clk)
564 _REGISTER_CLOCK(NULL, "ata", ata_clk) 564 _REGISTER_CLOCK(NULL, "ata", ata_clk)
565 _REGISTER_CLOCK(NULL, "rtic", rtic_clk) 565 _REGISTER_CLOCK(NULL, "rtic", rtic_clk)
@@ -616,6 +616,8 @@ int __init mx31_clocks_init(unsigned long fref)
616 616
617 clk_enable(&serial_pll_clk); 617 clk_enable(&serial_pll_clk);
618 618
619 mx31_read_cpu_rev();
620
619 if (mx31_revision() >= CHIP_REV_2_0) { 621 if (mx31_revision() >= CHIP_REV_2_0) {
620 reg = __raw_readl(MXC_CCM_PMCR1); 622 reg = __raw_readl(MXC_CCM_PMCR1);
621 /* No PLL restart on DVFS switch; enable auto EMI handshake */ 623 /* No PLL restart on DVFS switch; enable auto EMI handshake */
diff --git a/arch/arm/mach-mx3/cpu.c b/arch/arm/mach-mx3/cpu.c
new file mode 100644
index 000000000000..db828809c675
--- /dev/null
+++ b/arch/arm/mach-mx3/cpu.c
@@ -0,0 +1,57 @@
1/*
2 * MX3 CPU type detection
3 *
4 * Copyright (c) 2009 Daniel Mack <daniel@caiaq.de>
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 as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 */
11
12#include <linux/module.h>
13#include <linux/io.h>
14#include <mach/hardware.h>
15#include <mach/iim.h>
16
17unsigned int mx31_cpu_rev;
18EXPORT_SYMBOL(mx31_cpu_rev);
19
20struct mx3_cpu_type {
21 u8 srev;
22 const char *name;
23 const char *v;
24 unsigned int rev;
25};
26
27static struct mx3_cpu_type mx31_cpu_type[] __initdata = {
28 { .srev = 0x00, .name = "i.MX31(L)", .v = "1.0", .rev = CHIP_REV_1_0 },
29 { .srev = 0x10, .name = "i.MX31", .v = "1.1", .rev = CHIP_REV_1_1 },
30 { .srev = 0x11, .name = "i.MX31L", .v = "1.1", .rev = CHIP_REV_1_1 },
31 { .srev = 0x12, .name = "i.MX31", .v = "1.15", .rev = CHIP_REV_1_1 },
32 { .srev = 0x13, .name = "i.MX31L", .v = "1.15", .rev = CHIP_REV_1_1 },
33 { .srev = 0x14, .name = "i.MX31", .v = "1.2", .rev = CHIP_REV_1_2 },
34 { .srev = 0x15, .name = "i.MX31L", .v = "1.2", .rev = CHIP_REV_1_2 },
35 { .srev = 0x28, .name = "i.MX31", .v = "2.0", .rev = CHIP_REV_2_0 },
36 { .srev = 0x29, .name = "i.MX31L", .v = "2.0", .rev = CHIP_REV_2_0 },
37};
38
39void __init mx31_read_cpu_rev(void)
40{
41 u32 i, srev;
42
43 /* read SREV register from IIM module */
44 srev = __raw_readl(IO_ADDRESS(IIM_BASE_ADDR) + MXC_IIMSREV);
45
46 for (i = 0; i < ARRAY_SIZE(mx31_cpu_type); i++)
47 if (srev == mx31_cpu_type[i].srev) {
48 printk(KERN_INFO
49 "CPU identified as %s, silicon rev %s\n",
50 mx31_cpu_type[i].name, mx31_cpu_type[i].v);
51
52 mx31_cpu_rev = mx31_cpu_type[i].rev;
53 return;
54 }
55
56 printk(KERN_WARNING "Unknown CPU identifier. srev = %02x\n", srev);
57}
diff --git a/arch/arm/mach-mx3/devices.c b/arch/arm/mach-mx3/devices.c
index e6abe181b967..6adb586515ea 100644
--- a/arch/arm/mach-mx3/devices.c
+++ b/arch/arm/mach-mx3/devices.c
@@ -537,6 +537,44 @@ struct platform_device mxc_fec_device = {
537}; 537};
538#endif 538#endif
539 539
540static struct resource imx_ssi_resources0[] = {
541 {
542 .start = SSI1_BASE_ADDR,
543 .end = SSI1_BASE_ADDR + 0xfff,
544 .flags = IORESOURCE_MEM,
545 }, {
546 .start = MX31_INT_SSI1,
547 .end = MX31_INT_SSI1,
548 .flags = IORESOURCE_IRQ,
549 },
550};
551
552static struct resource imx_ssi_resources1[] = {
553 {
554 .start = SSI2_BASE_ADDR,
555 .end = SSI2_BASE_ADDR + 0xfff,
556 .flags = IORESOURCE_MEM
557 }, {
558 .start = MX31_INT_SSI2,
559 .end = MX31_INT_SSI2,
560 .flags = IORESOURCE_IRQ,
561 },
562};
563
564struct platform_device imx_ssi_device0 = {
565 .name = "imx-ssi",
566 .id = 0,
567 .num_resources = ARRAY_SIZE(imx_ssi_resources0),
568 .resource = imx_ssi_resources0,
569};
570
571struct platform_device imx_ssi_device1 = {
572 .name = "imx-ssi",
573 .id = 1,
574 .num_resources = ARRAY_SIZE(imx_ssi_resources1),
575 .resource = imx_ssi_resources1,
576};
577
540static int mx3_devices_init(void) 578static int mx3_devices_init(void)
541{ 579{
542 if (cpu_is_mx31()) { 580 if (cpu_is_mx31()) {
@@ -546,7 +584,7 @@ static int mx3_devices_init(void)
546 } 584 }
547 if (cpu_is_mx35()) { 585 if (cpu_is_mx35()) {
548 mxc_nand_resources[0].start = MX35_NFC_BASE_ADDR; 586 mxc_nand_resources[0].start = MX35_NFC_BASE_ADDR;
549 mxc_nand_resources[0].end = MX35_NFC_BASE_ADDR + 0xfff; 587 mxc_nand_resources[0].end = MX35_NFC_BASE_ADDR + 0x1fff;
550 otg_resources[0].start = MX35_OTG_BASE_ADDR; 588 otg_resources[0].start = MX35_OTG_BASE_ADDR;
551 otg_resources[0].end = MX35_OTG_BASE_ADDR + 0x1ff; 589 otg_resources[0].end = MX35_OTG_BASE_ADDR + 0x1ff;
552 otg_resources[1].start = MXC_INT_USBOTG; 590 otg_resources[1].start = MXC_INT_USBOTG;
@@ -555,6 +593,10 @@ static int mx3_devices_init(void)
555 mxc_usbh1_resources[0].end = MX35_OTG_BASE_ADDR + 0x5ff; 593 mxc_usbh1_resources[0].end = MX35_OTG_BASE_ADDR + 0x5ff;
556 mxc_usbh1_resources[1].start = MXC_INT_USBHS; 594 mxc_usbh1_resources[1].start = MXC_INT_USBHS;
557 mxc_usbh1_resources[1].end = MXC_INT_USBHS; 595 mxc_usbh1_resources[1].end = MXC_INT_USBHS;
596 imx_ssi_resources0[1].start = MX35_INT_SSI1;
597 imx_ssi_resources0[1].end = MX35_INT_SSI1;
598 imx_ssi_resources1[1].start = MX35_INT_SSI2;
599 imx_ssi_resources1[1].end = MX35_INT_SSI2;
558 } 600 }
559 601
560 return 0; 602 return 0;
diff --git a/arch/arm/mach-mx3/devices.h b/arch/arm/mach-mx3/devices.h
index ab87419dc9a0..42cf175eac6b 100644
--- a/arch/arm/mach-mx3/devices.h
+++ b/arch/arm/mach-mx3/devices.h
@@ -23,4 +23,6 @@ extern struct platform_device mxc_rnga_device;
23extern struct platform_device mxc_spi_device0; 23extern struct platform_device mxc_spi_device0;
24extern struct platform_device mxc_spi_device1; 24extern struct platform_device mxc_spi_device1;
25extern struct platform_device mxc_spi_device2; 25extern struct platform_device mxc_spi_device2;
26extern struct platform_device imx_ssi_device0;
27extern struct platform_device imx_ssi_device1;
26 28
diff --git a/arch/arm/mach-mx3/kzmarm11.c b/arch/arm/mach-mx3/kzmarm11.c
new file mode 100644
index 000000000000..6fa99ce3008a
--- /dev/null
+++ b/arch/arm/mach-mx3/kzmarm11.c
@@ -0,0 +1,268 @@
1/*
2 * KZM-ARM11-01 support
3 * Copyright (C) 2009 Yoichi Yuasa <yuasa@linux-mips.org>
4 *
5 * based on code for MX31ADS,
6 * Copyright (C) 2000 Deep Blue Solutions Ltd
7 * Copyright (C) 2002 Shane Nay (shane@minirl.com)
8 * Copyright 2005-2007 Freescale Semiconductor, Inc. All Rights Reserved.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 */
24
25#include <linux/gpio.h>
26#include <linux/init.h>
27#include <linux/platform_device.h>
28#include <linux/serial_8250.h>
29#include <linux/smsc911x.h>
30#include <linux/types.h>
31
32#include <asm/irq.h>
33#include <asm/mach-types.h>
34#include <asm/setup.h>
35#include <asm/mach/arch.h>
36#include <asm/mach/irq.h>
37#include <asm/mach/map.h>
38#include <asm/mach/time.h>
39
40#include <mach/board-kzmarm11.h>
41#include <mach/clock.h>
42#include <mach/common.h>
43#include <mach/imx-uart.h>
44#include <mach/iomux-mx3.h>
45#include <mach/memory.h>
46
47#include "devices.h"
48
49#if defined(CONFIG_SERIAL_8250) || defined(CONFIG_SERIAL_8250_MODULE)
50/*
51 * KZM-ARM11-01 has an external UART on FPGA
52 */
53static struct plat_serial8250_port serial_platform_data[] = {
54 {
55 .membase = IO_ADDRESS(KZM_ARM11_16550),
56 .mapbase = KZM_ARM11_16550,
57 .irq = IOMUX_TO_IRQ(MX31_PIN_GPIO1_1),
58 .irqflags = IRQ_TYPE_EDGE_RISING,
59 .uartclk = 14745600,
60 .regshift = 0,
61 .iotype = UPIO_MEM,
62 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
63 UPF_BUGGY_UART,
64 },
65 {},
66};
67
68static struct resource serial8250_resources[] = {
69 {
70 .start = KZM_ARM11_16550,
71 .end = KZM_ARM11_16550 + 0x10,
72 .flags = IORESOURCE_MEM,
73 },
74 {
75 .start = IOMUX_TO_IRQ(MX31_PIN_GPIO1_1),
76 .end = IOMUX_TO_IRQ(MX31_PIN_GPIO1_1),
77 .flags = IORESOURCE_IRQ,
78 },
79};
80
81static struct platform_device serial_device = {
82 .name = "serial8250",
83 .id = PLAT8250_DEV_PLATFORM,
84 .dev = {
85 .platform_data = serial_platform_data,
86 },
87 .num_resources = ARRAY_SIZE(serial8250_resources),
88 .resource = serial8250_resources,
89};
90
91static int __init kzm_init_ext_uart(void)
92{
93 u8 tmp;
94
95 /*
96 * GPIO 1-1: external UART interrupt line
97 */
98 mxc_iomux_mode(IOMUX_MODE(MX31_PIN_GPIO1_1, IOMUX_CONFIG_GPIO));
99 gpio_request(IOMUX_TO_GPIO(MX31_PIN_GPIO1_1), "ext-uart-int");
100 gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_GPIO1_1));
101
102 /*
103 * Unmask UART interrupt
104 */
105 tmp = __raw_readb(IO_ADDRESS(KZM_ARM11_CTL1));
106 tmp |= 0x2;
107 __raw_writeb(tmp, IO_ADDRESS(KZM_ARM11_CTL1));
108
109 return platform_device_register(&serial_device);
110}
111#else
112static inline int kzm_init_ext_uart(void)
113{
114 return 0;
115}
116#endif
117
118/*
119 * SMSC LAN9118
120 */
121#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
122static struct smsc911x_platform_config kzm_smsc9118_config = {
123 .phy_interface = PHY_INTERFACE_MODE_MII,
124 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_HIGH,
125 .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
126 .flags = SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS,
127};
128
129static struct resource kzm_smsc9118_resources[] = {
130 {
131 .start = CS5_BASE_ADDR,
132 .end = CS5_BASE_ADDR + SZ_128K - 1,
133 .flags = IORESOURCE_MEM,
134 },
135 {
136 .start = IOMUX_TO_IRQ(MX31_PIN_GPIO1_2),
137 .end = IOMUX_TO_IRQ(MX31_PIN_GPIO1_2),
138 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
139 },
140};
141
142static struct platform_device kzm_smsc9118_device = {
143 .name = "smsc911x",
144 .id = -1,
145 .num_resources = ARRAY_SIZE(kzm_smsc9118_resources),
146 .resource = kzm_smsc9118_resources,
147 .dev = {
148 .platform_data = &kzm_smsc9118_config,
149 },
150};
151
152static int __init kzm_init_smsc9118(void)
153{
154 /*
155 * GPIO 1-2: SMSC9118 interrupt line
156 */
157 mxc_iomux_mode(IOMUX_MODE(MX31_PIN_GPIO1_2, IOMUX_CONFIG_GPIO));
158 gpio_request(IOMUX_TO_GPIO(MX31_PIN_GPIO1_2), "smsc9118-int");
159 gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_GPIO1_2));
160
161 return platform_device_register(&kzm_smsc9118_device);
162}
163#else
164static inline int kzm_init_smsc9118(void)
165{
166 return 0;
167}
168#endif
169
170#if defined(CONFIG_SERIAL_IMX) || defined(CONFIG_SERIAL_IMX_MODULE)
171static struct imxuart_platform_data uart_pdata = {
172 .flags = IMXUART_HAVE_RTSCTS,
173};
174
175static void __init kzm_init_imx_uart(void)
176{
177 mxc_register_device(&mxc_uart_device0, &uart_pdata);
178
179 mxc_register_device(&mxc_uart_device1, &uart_pdata);
180}
181#else
182static inline void kzm_init_imx_uart(void)
183{
184}
185#endif
186
187static int kzm_pins[] __initdata = {
188 MX31_PIN_CTS1__CTS1,
189 MX31_PIN_RTS1__RTS1,
190 MX31_PIN_TXD1__TXD1,
191 MX31_PIN_RXD1__RXD1,
192 MX31_PIN_DCD_DCE1__DCD_DCE1,
193 MX31_PIN_RI_DCE1__RI_DCE1,
194 MX31_PIN_DSR_DCE1__DSR_DCE1,
195 MX31_PIN_DTR_DCE1__DTR_DCE1,
196 MX31_PIN_CTS2__CTS2,
197 MX31_PIN_RTS2__RTS2,
198 MX31_PIN_TXD2__TXD2,
199 MX31_PIN_RXD2__RXD2,
200 MX31_PIN_DCD_DTE1__DCD_DTE2,
201 MX31_PIN_RI_DTE1__RI_DTE2,
202 MX31_PIN_DSR_DTE1__DSR_DTE2,
203 MX31_PIN_DTR_DTE1__DTR_DTE2,
204};
205
206/*
207 * Board specific initialization.
208 */
209static void __init kzm_board_init(void)
210{
211 mxc_iomux_setup_multiple_pins(kzm_pins,
212 ARRAY_SIZE(kzm_pins), "kzm");
213 kzm_init_ext_uart();
214 kzm_init_smsc9118();
215 kzm_init_imx_uart();
216
217 pr_info("Clock input source is 26MHz\n");
218}
219
220/*
221 * This structure defines static mappings for the kzm-arm11-01 board.
222 */
223static struct map_desc kzm_io_desc[] __initdata = {
224 {
225 .virtual = CS4_BASE_ADDR_VIRT,
226 .pfn = __phys_to_pfn(CS4_BASE_ADDR),
227 .length = CS4_SIZE,
228 .type = MT_DEVICE
229 },
230 {
231 .virtual = CS5_BASE_ADDR_VIRT,
232 .pfn = __phys_to_pfn(CS5_BASE_ADDR),
233 .length = CS5_SIZE,
234 .type = MT_DEVICE
235 },
236};
237
238/*
239 * Set up static virtual mappings.
240 */
241static void __init kzm_map_io(void)
242{
243 mx31_map_io();
244 iotable_init(kzm_io_desc, ARRAY_SIZE(kzm_io_desc));
245}
246
247static void __init kzm_timer_init(void)
248{
249 mx31_clocks_init(26000000);
250}
251
252static struct sys_timer kzm_timer = {
253 .init = kzm_timer_init,
254};
255
256/*
257 * The following uses standard kernel macros define in arch.h in order to
258 * initialize __mach_desc_KZM_ARM11_01 data structure.
259 */
260MACHINE_START(KZM_ARM11_01, "Kyoto Microcomputer Co., Ltd. KZM-ARM11-01")
261 .phys_io = AIPS1_BASE_ADDR,
262 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc,
263 .boot_params = PHYS_OFFSET + 0x100,
264 .map_io = kzm_map_io,
265 .init_irq = mx31_init_irq,
266 .init_machine = kzm_board_init,
267 .timer = &kzm_timer,
268MACHINE_END
diff --git a/arch/arm/mach-mx3/mx31lilly-db.c b/arch/arm/mach-mx3/mx31lilly-db.c
index 3b3a78f49c23..7aebd74a12e8 100644
--- a/arch/arm/mach-mx3/mx31lilly-db.c
+++ b/arch/arm/mach-mx3/mx31lilly-db.c
@@ -109,6 +109,9 @@ static int mxc_mmc1_get_ro(struct device *dev)
109 109
110static int gpio_det, gpio_wp; 110static int gpio_det, gpio_wp;
111 111
112#define MMC_PAD_CFG (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST | PAD_CTL_HYS_CMOS | \
113 PAD_CTL_ODE_CMOS | PAD_CTL_100K_PU)
114
112static int mxc_mmc1_init(struct device *dev, 115static int mxc_mmc1_init(struct device *dev,
113 irq_handler_t detect_irq, void *data) 116 irq_handler_t detect_irq, void *data)
114{ 117{
@@ -117,6 +120,13 @@ static int mxc_mmc1_init(struct device *dev,
117 gpio_det = IOMUX_TO_GPIO(MX31_PIN_GPIO1_1); 120 gpio_det = IOMUX_TO_GPIO(MX31_PIN_GPIO1_1);
118 gpio_wp = IOMUX_TO_GPIO(MX31_PIN_LCS0); 121 gpio_wp = IOMUX_TO_GPIO(MX31_PIN_LCS0);
119 122
123 mxc_iomux_set_pad(MX31_PIN_SD1_DATA0, MMC_PAD_CFG);
124 mxc_iomux_set_pad(MX31_PIN_SD1_DATA1, MMC_PAD_CFG);
125 mxc_iomux_set_pad(MX31_PIN_SD1_DATA2, MMC_PAD_CFG);
126 mxc_iomux_set_pad(MX31_PIN_SD1_DATA3, MMC_PAD_CFG);
127 mxc_iomux_set_pad(MX31_PIN_SD1_CLK, MMC_PAD_CFG);
128 mxc_iomux_set_pad(MX31_PIN_SD1_CMD, MMC_PAD_CFG);
129
120 ret = gpio_request(gpio_det, "MMC detect"); 130 ret = gpio_request(gpio_det, "MMC detect");
121 if (ret) 131 if (ret)
122 return ret; 132 return ret;
diff --git a/arch/arm/mach-mx3/mx31lilly.c b/arch/arm/mach-mx3/mx31lilly.c
index 423025150f6f..9ce029f554b9 100644
--- a/arch/arm/mach-mx3/mx31lilly.c
+++ b/arch/arm/mach-mx3/mx31lilly.c
@@ -31,6 +31,8 @@
31#include <linux/interrupt.h> 31#include <linux/interrupt.h>
32#include <linux/smsc911x.h> 32#include <linux/smsc911x.h>
33#include <linux/mtd/physmap.h> 33#include <linux/mtd/physmap.h>
34#include <linux/spi/spi.h>
35#include <linux/mfd/mc13783.h>
34 36
35#include <asm/mach-types.h> 37#include <asm/mach-types.h>
36#include <asm/mach/arch.h> 38#include <asm/mach/arch.h>
@@ -41,6 +43,7 @@
41#include <mach/common.h> 43#include <mach/common.h>
42#include <mach/iomux-mx3.h> 44#include <mach/iomux-mx3.h>
43#include <mach/board-mx31lilly.h> 45#include <mach/board-mx31lilly.h>
46#include <mach/spi.h>
44 47
45#include "devices.h" 48#include "devices.h"
46 49
@@ -108,7 +111,36 @@ static struct platform_device physmap_flash_device = {
108static struct platform_device *devices[] __initdata = { 111static struct platform_device *devices[] __initdata = {
109 &smsc91x_device, 112 &smsc91x_device,
110 &physmap_flash_device, 113 &physmap_flash_device,
111 &mxc_i2c_device1, 114};
115
116/* SPI */
117
118static int spi_internal_chipselect[] = {
119 MXC_SPI_CS(0),
120 MXC_SPI_CS(1),
121 MXC_SPI_CS(2),
122};
123
124static struct spi_imx_master spi0_pdata = {
125 .chipselect = spi_internal_chipselect,
126 .num_chipselect = ARRAY_SIZE(spi_internal_chipselect),
127};
128
129static struct spi_imx_master spi1_pdata = {
130 .chipselect = spi_internal_chipselect,
131 .num_chipselect = ARRAY_SIZE(spi_internal_chipselect),
132};
133
134static struct mc13783_platform_data mc13783_pdata __initdata = {
135 .flags = MC13783_USE_RTC | MC13783_USE_TOUCHSCREEN,
136};
137
138static struct spi_board_info mc13783_dev __initdata = {
139 .modalias = "mc13783",
140 .max_speed_hz = 1000000,
141 .bus_num = 1,
142 .chip_select = 0,
143 .platform_data = &mc13783_pdata,
112}; 144};
113 145
114static int mx31lilly_baseboard; 146static int mx31lilly_baseboard;
@@ -128,8 +160,27 @@ static void __init mx31lilly_board_init(void)
128 } 160 }
129 161
130 mxc_iomux_alloc_pin(MX31_PIN_CS4__CS4, "Ethernet CS"); 162 mxc_iomux_alloc_pin(MX31_PIN_CS4__CS4, "Ethernet CS");
131 mxc_iomux_alloc_pin(MX31_PIN_CSPI2_MOSI__SCL, "I2C SCL"); 163
132 mxc_iomux_alloc_pin(MX31_PIN_CSPI2_MISO__SDA, "I2C SDA"); 164 /* SPI */
165 mxc_iomux_alloc_pin(MX31_PIN_CSPI1_SCLK__SCLK, "SPI1_CLK");
166 mxc_iomux_alloc_pin(MX31_PIN_CSPI1_MOSI__MOSI, "SPI1_TX");
167 mxc_iomux_alloc_pin(MX31_PIN_CSPI1_MISO__MISO, "SPI1_RX");
168 mxc_iomux_alloc_pin(MX31_PIN_CSPI1_SPI_RDY__SPI_RDY, "SPI1_RDY");
169 mxc_iomux_alloc_pin(MX31_PIN_CSPI1_SS0__SS0, "SPI1_SS0");
170 mxc_iomux_alloc_pin(MX31_PIN_CSPI1_SS1__SS1, "SPI1_SS1");
171 mxc_iomux_alloc_pin(MX31_PIN_CSPI1_SS2__SS2, "SPI1_SS2");
172
173 mxc_iomux_alloc_pin(MX31_PIN_CSPI2_SCLK__SCLK, "SPI2_CLK");
174 mxc_iomux_alloc_pin(MX31_PIN_CSPI2_MOSI__MOSI, "SPI2_TX");
175 mxc_iomux_alloc_pin(MX31_PIN_CSPI2_MISO__MISO, "SPI2_RX");
176 mxc_iomux_alloc_pin(MX31_PIN_CSPI2_SPI_RDY__SPI_RDY, "SPI2_RDY");
177 mxc_iomux_alloc_pin(MX31_PIN_CSPI2_SS0__SS0, "SPI2_SS0");
178 mxc_iomux_alloc_pin(MX31_PIN_CSPI2_SS1__SS1, "SPI2_SS1");
179 mxc_iomux_alloc_pin(MX31_PIN_CSPI2_SS2__SS2, "SPI2_SS2");
180
181 mxc_register_device(&mxc_spi_device0, &spi0_pdata);
182 mxc_register_device(&mxc_spi_device1, &spi1_pdata);
183 spi_register_board_info(&mc13783_dev, 1);
133 184
134 platform_add_devices(devices, ARRAY_SIZE(devices)); 185 platform_add_devices(devices, ARRAY_SIZE(devices));
135} 186}
diff --git a/arch/arm/mach-mx3/mx31lite-db.c b/arch/arm/mach-mx3/mx31lite-db.c
new file mode 100644
index 000000000000..694611d6b057
--- /dev/null
+++ b/arch/arm/mach-mx3/mx31lite-db.c
@@ -0,0 +1,198 @@
1/*
2 * LogicPD i.MX31 SOM-LV development board support
3 *
4 * Copyright (c) 2009 Daniel Mack <daniel@caiaq.de>
5 *
6 * based on code for other MX31 boards,
7 *
8 * Copyright 2005-2007 Freescale Semiconductor
9 * Copyright (c) 2009 Alberto Panizzo <maramaopercheseimorto@gmail.com>
10 * Copyright (C) 2009 Valentin Longchamp, EPFL Mobots group
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 */
26
27#include <linux/kernel.h>
28#include <linux/types.h>
29#include <linux/init.h>
30#include <linux/gpio.h>
31#include <linux/platform_device.h>
32#include <linux/leds.h>
33#include <linux/platform_device.h>
34
35#include <asm/mach-types.h>
36#include <asm/mach/arch.h>
37#include <asm/mach/map.h>
38
39#include <mach/hardware.h>
40#include <mach/common.h>
41#include <mach/imx-uart.h>
42#include <mach/iomux-mx3.h>
43#include <mach/board-mx31lite.h>
44#include <mach/mmc.h>
45#include <mach/spi.h>
46
47#include "devices.h"
48
49/*
50 * This file contains board-specific initialization routines for the
51 * LogicPD i.MX31 SOM-LV development board, aka 'LiteKit'.
52 * If you design an own baseboard for the module, use this file as base
53 * for support code.
54 */
55
56static unsigned int litekit_db_board_pins[] __initdata = {
57 /* UART1 */
58 MX31_PIN_CTS1__CTS1,
59 MX31_PIN_RTS1__RTS1,
60 MX31_PIN_TXD1__TXD1,
61 MX31_PIN_RXD1__RXD1,
62 /* SPI 0 */
63 MX31_PIN_CSPI1_SCLK__SCLK,
64 MX31_PIN_CSPI1_MOSI__MOSI,
65 MX31_PIN_CSPI1_MISO__MISO,
66 MX31_PIN_CSPI1_SPI_RDY__SPI_RDY,
67 MX31_PIN_CSPI1_SS0__SS0,
68 MX31_PIN_CSPI1_SS1__SS1,
69 MX31_PIN_CSPI1_SS2__SS2,
70};
71
72/* UART */
73static struct imxuart_platform_data uart_pdata __initdata = {
74 .flags = IMXUART_HAVE_RTSCTS,
75};
76
77/* MMC */
78
79static int gpio_det, gpio_wp;
80
81#define MMC_PAD_CFG (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST | PAD_CTL_HYS_CMOS | \
82 PAD_CTL_ODE_CMOS | PAD_CTL_100K_PU)
83
84static int mxc_mmc1_get_ro(struct device *dev)
85{
86 return gpio_get_value(IOMUX_TO_GPIO(MX31_PIN_LCS0));
87}
88
89static int mxc_mmc1_init(struct device *dev,
90 irq_handler_t detect_irq, void *data)
91{
92 int ret;
93
94 gpio_det = IOMUX_TO_GPIO(MX31_PIN_DCD_DCE1);
95 gpio_wp = IOMUX_TO_GPIO(MX31_PIN_GPIO1_6);
96
97 mxc_iomux_set_pad(MX31_PIN_SD1_DATA0, MMC_PAD_CFG);
98 mxc_iomux_set_pad(MX31_PIN_SD1_DATA1, MMC_PAD_CFG);
99 mxc_iomux_set_pad(MX31_PIN_SD1_DATA2, MMC_PAD_CFG);
100 mxc_iomux_set_pad(MX31_PIN_SD1_DATA3, MMC_PAD_CFG);
101 mxc_iomux_set_pad(MX31_PIN_SD1_CLK, MMC_PAD_CFG);
102 mxc_iomux_set_pad(MX31_PIN_SD1_CMD, MMC_PAD_CFG);
103
104 ret = gpio_request(gpio_det, "MMC detect");
105 if (ret)
106 return ret;
107
108 ret = gpio_request(gpio_wp, "MMC w/p");
109 if (ret)
110 goto exit_free_det;
111
112 gpio_direction_input(gpio_det);
113 gpio_direction_input(gpio_wp);
114
115 ret = request_irq(IOMUX_TO_IRQ(MX31_PIN_DCD_DCE1), detect_irq,
116 IRQF_DISABLED | IRQF_TRIGGER_FALLING,
117 "MMC detect", data);
118 if (ret)
119 goto exit_free_wp;
120
121 return 0;
122
123exit_free_wp:
124 gpio_free(gpio_wp);
125
126exit_free_det:
127 gpio_free(gpio_det);
128
129 return ret;
130}
131
132static void mxc_mmc1_exit(struct device *dev, void *data)
133{
134 gpio_free(gpio_det);
135 gpio_free(gpio_wp);
136 free_irq(IOMUX_TO_IRQ(MX31_PIN_GPIO1_1), data);
137}
138
139static struct imxmmc_platform_data mmc_pdata = {
140 .get_ro = mxc_mmc1_get_ro,
141 .init = mxc_mmc1_init,
142 .exit = mxc_mmc1_exit,
143};
144
145/* SPI */
146
147static int spi_internal_chipselect[] = {
148 MXC_SPI_CS(0),
149 MXC_SPI_CS(1),
150 MXC_SPI_CS(2),
151};
152
153static struct spi_imx_master spi0_pdata = {
154 .chipselect = spi_internal_chipselect,
155 .num_chipselect = ARRAY_SIZE(spi_internal_chipselect),
156};
157
158/* GPIO LEDs */
159
160static struct gpio_led litekit_leds[] = {
161 {
162 .name = "GPIO0",
163 .gpio = IOMUX_TO_GPIO(MX31_PIN_COMPARE),
164 .active_low = 1,
165 .default_state = LEDS_GPIO_DEFSTATE_OFF,
166 },
167 {
168 .name = "GPIO1",
169 .gpio = IOMUX_TO_GPIO(MX31_PIN_CAPTURE),
170 .active_low = 1,
171 .default_state = LEDS_GPIO_DEFSTATE_OFF,
172 }
173};
174
175static struct gpio_led_platform_data litekit_led_platform_data = {
176 .leds = litekit_leds,
177 .num_leds = ARRAY_SIZE(litekit_leds),
178};
179
180static struct platform_device litekit_led_device = {
181 .name = "leds-gpio",
182 .id = -1,
183 .dev = {
184 .platform_data = &litekit_led_platform_data,
185 },
186};
187
188void __init mx31lite_db_init(void)
189{
190 mxc_iomux_setup_multiple_pins(litekit_db_board_pins,
191 ARRAY_SIZE(litekit_db_board_pins),
192 "development board pins");
193 mxc_register_device(&mxc_uart_device0, &uart_pdata);
194 mxc_register_device(&mxcsdhc_device0, &mmc_pdata);
195 mxc_register_device(&mxc_spi_device0, &spi0_pdata);
196 platform_device_register(&litekit_led_device);
197}
198
diff --git a/arch/arm/mach-mx3/mx31lite.c b/arch/arm/mach-mx3/mx31lite.c
index a8d57decdfdb..def6b6736594 100644
--- a/arch/arm/mach-mx3/mx31lite.c
+++ b/arch/arm/mach-mx3/mx31lite.c
@@ -2,6 +2,7 @@
2 * Copyright (C) 2000 Deep Blue Solutions Ltd 2 * Copyright (C) 2000 Deep Blue Solutions Ltd
3 * Copyright (C) 2002 Shane Nay (shane@minirl.com) 3 * Copyright (C) 2002 Shane Nay (shane@minirl.com)
4 * Copyright 2005-2007 Freescale Semiconductor, Inc. All Rights Reserved. 4 * Copyright 2005-2007 Freescale Semiconductor, Inc. All Rights Reserved.
5 * Copyright (C) 2009 Daniel Mack <daniel@caiaq.de>
5 * 6 *
6 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
@@ -25,38 +26,47 @@
25#include <linux/platform_device.h> 26#include <linux/platform_device.h>
26#include <linux/gpio.h> 27#include <linux/gpio.h>
27#include <linux/smsc911x.h> 28#include <linux/smsc911x.h>
29#include <linux/mfd/mc13783.h>
30#include <linux/spi/spi.h>
31#include <linux/usb/otg.h>
32#include <linux/usb/ulpi.h>
33#include <linux/mtd/physmap.h>
28 34
29#include <mach/hardware.h>
30#include <asm/mach-types.h> 35#include <asm/mach-types.h>
31#include <asm/mach/arch.h> 36#include <asm/mach/arch.h>
32#include <asm/mach/time.h> 37#include <asm/mach/time.h>
33#include <asm/mach/map.h> 38#include <asm/mach/map.h>
34#include <mach/common.h>
35#include <asm/page.h> 39#include <asm/page.h>
36#include <asm/setup.h> 40#include <asm/setup.h>
41
42#include <mach/hardware.h>
43#include <mach/common.h>
37#include <mach/board-mx31lite.h> 44#include <mach/board-mx31lite.h>
38#include <mach/imx-uart.h> 45#include <mach/imx-uart.h>
39#include <mach/iomux-mx3.h> 46#include <mach/iomux-mx3.h>
40#include <mach/irqs.h> 47#include <mach/irqs.h>
41#include <mach/mxc_nand.h> 48#include <mach/mxc_nand.h>
49#include <mach/spi.h>
50#include <mach/mxc_ehci.h>
51#include <mach/ulpi.h>
52
42#include "devices.h" 53#include "devices.h"
43 54
44/* 55/*
45 * This file contains the board-specific initialization routines. 56 * This file contains the module-specific initialization routines.
46 */ 57 */
47 58
48static unsigned int mx31lite_pins[] = { 59static unsigned int mx31lite_pins[] = {
49 /* UART1 */
50 MX31_PIN_CTS1__CTS1,
51 MX31_PIN_RTS1__RTS1,
52 MX31_PIN_TXD1__TXD1,
53 MX31_PIN_RXD1__RXD1,
54 /* LAN9117 IRQ pin */ 60 /* LAN9117 IRQ pin */
55 IOMUX_MODE(MX31_PIN_SFS6, IOMUX_CONFIG_GPIO), 61 IOMUX_MODE(MX31_PIN_SFS6, IOMUX_CONFIG_GPIO),
56}; 62 /* SPI 1 */
57 63 MX31_PIN_CSPI2_SCLK__SCLK,
58static struct imxuart_platform_data uart_pdata = { 64 MX31_PIN_CSPI2_MOSI__MOSI,
59 .flags = IMXUART_HAVE_RTSCTS, 65 MX31_PIN_CSPI2_MISO__MISO,
66 MX31_PIN_CSPI2_SPI_RDY__SPI_RDY,
67 MX31_PIN_CSPI2_SS0__SS0,
68 MX31_PIN_CSPI2_SS1__SS1,
69 MX31_PIN_CSPI2_SS2__SS2,
60}; 70};
61 71
62static struct mxc_nand_platform_data mx31lite_nand_board_info = { 72static struct mxc_nand_platform_data mx31lite_nand_board_info = {
@@ -93,6 +103,111 @@ static struct platform_device smsc911x_device = {
93}; 103};
94 104
95/* 105/*
106 * SPI
107 *
108 * The MC13783 is the only hard-wired SPI device on the module.
109 */
110
111static int spi_internal_chipselect[] = {
112 MXC_SPI_CS(0),
113};
114
115static struct spi_imx_master spi1_pdata = {
116 .chipselect = spi_internal_chipselect,
117 .num_chipselect = ARRAY_SIZE(spi_internal_chipselect),
118};
119
120static struct mc13783_platform_data mc13783_pdata __initdata = {
121 .flags = MC13783_USE_RTC |
122 MC13783_USE_REGULATOR,
123};
124
125static struct spi_board_info mc13783_spi_dev __initdata = {
126 .modalias = "mc13783",
127 .max_speed_hz = 1000000,
128 .bus_num = 1,
129 .chip_select = 0,
130 .platform_data = &mc13783_pdata,
131 .irq = IOMUX_TO_IRQ(MX31_PIN_GPIO1_3),
132};
133
134/*
135 * USB
136 */
137
138#define USB_PAD_CFG (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST | PAD_CTL_HYS_CMOS | \
139 PAD_CTL_ODE_CMOS | PAD_CTL_100K_PU)
140
141static int usbh2_init(struct platform_device *pdev)
142{
143 int pins[] = {
144 MX31_PIN_USBH2_DATA0__USBH2_DATA0,
145 MX31_PIN_USBH2_DATA1__USBH2_DATA1,
146 MX31_PIN_USBH2_CLK__USBH2_CLK,
147 MX31_PIN_USBH2_DIR__USBH2_DIR,
148 MX31_PIN_USBH2_NXT__USBH2_NXT,
149 MX31_PIN_USBH2_STP__USBH2_STP,
150 };
151
152 mxc_iomux_setup_multiple_pins(pins, ARRAY_SIZE(pins), "USB H2");
153
154 mxc_iomux_set_pad(MX31_PIN_USBH2_CLK, USB_PAD_CFG);
155 mxc_iomux_set_pad(MX31_PIN_USBH2_DIR, USB_PAD_CFG);
156 mxc_iomux_set_pad(MX31_PIN_USBH2_NXT, USB_PAD_CFG);
157 mxc_iomux_set_pad(MX31_PIN_USBH2_STP, USB_PAD_CFG);
158 mxc_iomux_set_pad(MX31_PIN_USBH2_DATA0, USB_PAD_CFG);
159 mxc_iomux_set_pad(MX31_PIN_USBH2_DATA1, USB_PAD_CFG);
160 mxc_iomux_set_pad(MX31_PIN_SRXD6, USB_PAD_CFG);
161 mxc_iomux_set_pad(MX31_PIN_STXD6, USB_PAD_CFG);
162 mxc_iomux_set_pad(MX31_PIN_SFS3, USB_PAD_CFG);
163 mxc_iomux_set_pad(MX31_PIN_SCK3, USB_PAD_CFG);
164 mxc_iomux_set_pad(MX31_PIN_SRXD3, USB_PAD_CFG);
165 mxc_iomux_set_pad(MX31_PIN_STXD3, USB_PAD_CFG);
166
167 mxc_iomux_set_gpr(MUX_PGP_UH2, true);
168
169 /* chip select */
170 mxc_iomux_alloc_pin(IOMUX_MODE(MX31_PIN_DTR_DCE1, IOMUX_CONFIG_GPIO),
171 "USBH2_CS");
172 gpio_request(IOMUX_TO_GPIO(MX31_PIN_DTR_DCE1), "USBH2 CS");
173 gpio_direction_output(IOMUX_TO_GPIO(MX31_PIN_DTR_DCE1), 0);
174
175 return 0;
176}
177
178static struct mxc_usbh_platform_data usbh2_pdata = {
179 .init = usbh2_init,
180 .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT,
181 .flags = MXC_EHCI_POWER_PINS_ENABLED,
182};
183
184/*
185 * NOR flash
186 */
187
188static struct physmap_flash_data nor_flash_data = {
189 .width = 2,
190};
191
192static struct resource nor_flash_resource = {
193 .start = 0xa0000000,
194 .end = 0xa1ffffff,
195 .flags = IORESOURCE_MEM,
196};
197
198static struct platform_device physmap_flash_device = {
199 .name = "physmap-flash",
200 .id = 0,
201 .dev = {
202 .platform_data = &nor_flash_data,
203 },
204 .resource = &nor_flash_resource,
205 .num_resources = 1,
206};
207
208
209
210/*
96 * This structure defines the MX31 memory map. 211 * This structure defines the MX31 memory map.
97 */ 212 */
98static struct map_desc mx31lite_io_desc[] __initdata = { 213static struct map_desc mx31lite_io_desc[] __initdata = {
@@ -118,19 +233,40 @@ void __init mx31lite_map_io(void)
118 iotable_init(mx31lite_io_desc, ARRAY_SIZE(mx31lite_io_desc)); 233 iotable_init(mx31lite_io_desc, ARRAY_SIZE(mx31lite_io_desc));
119} 234}
120 235
121/* 236static int mx31lite_baseboard;
122 * Board specific initialization. 237core_param(mx31lite_baseboard, mx31lite_baseboard, int, 0444);
123 */ 238
124static void __init mxc_board_init(void) 239static void __init mxc_board_init(void)
125{ 240{
126 int ret; 241 int ret;
127 242
243 switch (mx31lite_baseboard) {
244 case MX31LITE_NOBOARD:
245 break;
246 case MX31LITE_DB:
247 mx31lite_db_init();
248 break;
249 default:
250 printk(KERN_ERR "Illegal mx31lite_baseboard type %d\n",
251 mx31lite_baseboard);
252 }
253
128 mxc_iomux_setup_multiple_pins(mx31lite_pins, ARRAY_SIZE(mx31lite_pins), 254 mxc_iomux_setup_multiple_pins(mx31lite_pins, ARRAY_SIZE(mx31lite_pins),
129 "mx31lite"); 255 "mx31lite");
130 256
131 mxc_register_device(&mxc_uart_device0, &uart_pdata); 257 /* NOR and NAND flash */
258 platform_device_register(&physmap_flash_device);
132 mxc_register_device(&mxc_nand_device, &mx31lite_nand_board_info); 259 mxc_register_device(&mxc_nand_device, &mx31lite_nand_board_info);
133 260
261 mxc_register_device(&mxc_spi_device1, &spi1_pdata);
262 spi_register_board_info(&mc13783_spi_dev, 1);
263
264 /* USB */
265 usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops,
266 USB_OTG_DRV_VBUS | USB_OTG_DRV_VBUS_EXT);
267
268 mxc_register_device(&mxc_usbh2, &usbh2_pdata);
269
134 /* SMSC9117 IRQ pin */ 270 /* SMSC9117 IRQ pin */
135 ret = gpio_request(IOMUX_TO_GPIO(MX31_PIN_SFS6), "sms9117-irq"); 271 ret = gpio_request(IOMUX_TO_GPIO(MX31_PIN_SFS6), "sms9117-irq");
136 if (ret) 272 if (ret)
@@ -150,12 +286,7 @@ struct sys_timer mx31lite_timer = {
150 .init = mx31lite_timer_init, 286 .init = mx31lite_timer_init,
151}; 287};
152 288
153/* 289MACHINE_START(MX31LITE, "LogicPD i.MX31 SOM")
154 * The following uses standard kernel macros defined in arch.h in order to
155 * initialize __mach_desc_MX31LITE data structure.
156 */
157
158MACHINE_START(MX31LITE, "LogicPD MX31 LITEKIT")
159 /* Maintainer: Freescale Semiconductor, Inc. */ 290 /* Maintainer: Freescale Semiconductor, Inc. */
160 .phys_io = AIPS1_BASE_ADDR, 291 .phys_io = AIPS1_BASE_ADDR,
161 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc, 292 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc,
diff --git a/arch/arm/mach-mx3/mx31moboard-devboard.c b/arch/arm/mach-mx3/mx31moboard-devboard.c
index 5592cdb8d0ad..8fc624f141cb 100644
--- a/arch/arm/mach-mx3/mx31moboard-devboard.c
+++ b/arch/arm/mach-mx3/mx31moboard-devboard.c
@@ -22,11 +22,15 @@
22#include <linux/platform_device.h> 22#include <linux/platform_device.h>
23#include <linux/types.h> 23#include <linux/types.h>
24 24
25#include <linux/usb/otg.h>
26
25#include <mach/common.h> 27#include <mach/common.h>
26#include <mach/imx-uart.h> 28#include <mach/imx-uart.h>
27#include <mach/iomux-mx3.h> 29#include <mach/iomux-mx3.h>
28#include <mach/hardware.h> 30#include <mach/hardware.h>
29#include <mach/mmc.h> 31#include <mach/mmc.h>
32#include <mach/mxc_ehci.h>
33#include <mach/ulpi.h>
30 34
31#include "devices.h" 35#include "devices.h"
32 36
@@ -39,6 +43,12 @@ static unsigned int devboard_pins[] = {
39 MX31_PIN_PC_READY__SD2_DATA1, MX31_PIN_PC_WAIT_B__SD2_DATA0, 43 MX31_PIN_PC_READY__SD2_DATA1, MX31_PIN_PC_WAIT_B__SD2_DATA0,
40 MX31_PIN_PC_CD2_B__SD2_CLK, MX31_PIN_PC_CD1_B__SD2_CMD, 44 MX31_PIN_PC_CD2_B__SD2_CLK, MX31_PIN_PC_CD1_B__SD2_CMD,
41 MX31_PIN_ATA_DIOR__GPIO3_28, MX31_PIN_ATA_DIOW__GPIO3_29, 45 MX31_PIN_ATA_DIOR__GPIO3_28, MX31_PIN_ATA_DIOW__GPIO3_29,
46 /* USB H1 */
47 MX31_PIN_CSPI1_MISO__USBH1_RXDP, MX31_PIN_CSPI1_MOSI__USBH1_RXDM,
48 MX31_PIN_CSPI1_SS0__USBH1_TXDM, MX31_PIN_CSPI1_SS1__USBH1_TXDP,
49 MX31_PIN_CSPI1_SS2__USBH1_RCV, MX31_PIN_CSPI1_SCLK__USBH1_OEB,
50 MX31_PIN_CSPI1_SPI_RDY__USBH1_FS, MX31_PIN_SFS6__USBH1_SUSPEND,
51 MX31_PIN_NFRE_B__GPIO1_11, MX31_PIN_NFALE__GPIO1_12,
42}; 52};
43 53
44static struct imxuart_platform_data uart_pdata = { 54static struct imxuart_platform_data uart_pdata = {
@@ -98,6 +108,80 @@ static struct imxmmc_platform_data sdhc2_pdata = {
98 .exit = devboard_sdhc2_exit, 108 .exit = devboard_sdhc2_exit,
99}; 109};
100 110
111#define USB_PAD_CFG (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST | PAD_CTL_HYS_CMOS | \
112 PAD_CTL_ODE_CMOS | PAD_CTL_100K_PU)
113
114static int devboard_usbh1_hw_init(struct platform_device *pdev)
115{
116 mxc_iomux_set_gpr(MUX_PGP_USB_SUSPEND, true);
117
118 mxc_iomux_set_pad(MX31_PIN_CSPI1_MISO, USB_PAD_CFG);
119 mxc_iomux_set_pad(MX31_PIN_CSPI1_MOSI, USB_PAD_CFG);
120 mxc_iomux_set_pad(MX31_PIN_CSPI1_SS0, USB_PAD_CFG);
121 mxc_iomux_set_pad(MX31_PIN_CSPI1_SS1, USB_PAD_CFG);
122 mxc_iomux_set_pad(MX31_PIN_CSPI1_SS2, USB_PAD_CFG);
123 mxc_iomux_set_pad(MX31_PIN_CSPI1_SCLK, USB_PAD_CFG);
124 mxc_iomux_set_pad(MX31_PIN_CSPI1_SPI_RDY, USB_PAD_CFG);
125 mxc_iomux_set_pad(MX31_PIN_SFS6, USB_PAD_CFG);
126
127 return 0;
128}
129
130#define USBH1_VBUSEN_B IOMUX_TO_GPIO(MX31_PIN_NFRE_B)
131#define USBH1_MODE IOMUX_TO_GPIO(MX31_PIN_NFALE)
132
133static int devboard_isp1105_init(struct otg_transceiver *otg)
134{
135 int ret = gpio_request(USBH1_MODE, "usbh1-mode");
136 if (ret)
137 return ret;
138 /* single ended */
139 gpio_direction_output(USBH1_MODE, 0);
140
141 ret = gpio_request(USBH1_VBUSEN_B, "usbh1-vbusen");
142 if (ret) {
143 gpio_free(USBH1_MODE);
144 return ret;
145 }
146 gpio_direction_output(USBH1_VBUSEN_B, 1);
147
148 return 0;
149}
150
151
152static int devboard_isp1105_set_vbus(struct otg_transceiver *otg, bool on)
153{
154 if (on)
155 gpio_set_value(USBH1_VBUSEN_B, 0);
156 else
157 gpio_set_value(USBH1_VBUSEN_B, 1);
158
159 return 0;
160}
161
162static struct mxc_usbh_platform_data usbh1_pdata = {
163 .init = devboard_usbh1_hw_init,
164 .portsc = MXC_EHCI_MODE_UTMI | MXC_EHCI_SERIAL,
165 .flags = MXC_EHCI_POWER_PINS_ENABLED | MXC_EHCI_INTERFACE_SINGLE_UNI,
166};
167
168static int __init devboard_usbh1_init(void)
169{
170 struct otg_transceiver *otg;
171
172 otg = kzalloc(sizeof(*otg), GFP_KERNEL);
173 if (!otg)
174 return -ENOMEM;
175
176 otg->label = "ISP1105";
177 otg->init = devboard_isp1105_init;
178 otg->set_vbus = devboard_isp1105_set_vbus;
179
180 usbh1_pdata.otg = otg;
181
182 return mxc_register_device(&mx31_usbh1, &usbh1_pdata);
183}
184
101/* 185/*
102 * system init for baseboard usage. Will be called by mx31moboard init. 186 * system init for baseboard usage. Will be called by mx31moboard init.
103 */ 187 */
@@ -111,4 +195,6 @@ void __init mx31moboard_devboard_init(void)
111 mxc_register_device(&mxc_uart_device1, &uart_pdata); 195 mxc_register_device(&mxc_uart_device1, &uart_pdata);
112 196
113 mxc_register_device(&mxcsdhc_device1, &sdhc2_pdata); 197 mxc_register_device(&mxcsdhc_device1, &sdhc2_pdata);
198
199 devboard_usbh1_init();
114} 200}
diff --git a/arch/arm/mach-mx3/mx31moboard-marxbot.c b/arch/arm/mach-mx3/mx31moboard-marxbot.c
index 2bfaffb344f0..85184a35e674 100644
--- a/arch/arm/mach-mx3/mx31moboard-marxbot.c
+++ b/arch/arm/mach-mx3/mx31moboard-marxbot.c
@@ -16,17 +16,26 @@
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */ 17 */
18 18
19#include <linux/delay.h>
19#include <linux/gpio.h> 20#include <linux/gpio.h>
20#include <linux/init.h> 21#include <linux/init.h>
21#include <linux/interrupt.h> 22#include <linux/interrupt.h>
23#include <linux/i2c.h>
24#include <linux/spi/spi.h>
22#include <linux/platform_device.h> 25#include <linux/platform_device.h>
23#include <linux/types.h> 26#include <linux/types.h>
24 27
28#include <linux/usb/otg.h>
29
25#include <mach/common.h> 30#include <mach/common.h>
26#include <mach/hardware.h> 31#include <mach/hardware.h>
27#include <mach/imx-uart.h> 32#include <mach/imx-uart.h>
28#include <mach/iomux-mx3.h> 33#include <mach/iomux-mx3.h>
29#include <mach/mmc.h> 34#include <mach/mmc.h>
35#include <mach/mxc_ehci.h>
36#include <mach/ulpi.h>
37
38#include <media/soc_camera.h>
30 39
31#include "devices.h" 40#include "devices.h"
32 41
@@ -37,7 +46,6 @@ static unsigned int marxbot_pins[] = {
37 MX31_PIN_PC_CD2_B__SD2_CLK, MX31_PIN_PC_CD1_B__SD2_CMD, 46 MX31_PIN_PC_CD2_B__SD2_CLK, MX31_PIN_PC_CD1_B__SD2_CMD,
38 MX31_PIN_ATA_DIOR__GPIO3_28, MX31_PIN_ATA_DIOW__GPIO3_29, 47 MX31_PIN_ATA_DIOR__GPIO3_28, MX31_PIN_ATA_DIOW__GPIO3_29,
39 /* CSI */ 48 /* CSI */
40 MX31_PIN_CSI_D4__CSI_D4, MX31_PIN_CSI_D5__CSI_D5,
41 MX31_PIN_CSI_D6__CSI_D6, MX31_PIN_CSI_D7__CSI_D7, 49 MX31_PIN_CSI_D6__CSI_D6, MX31_PIN_CSI_D7__CSI_D7,
42 MX31_PIN_CSI_D8__CSI_D8, MX31_PIN_CSI_D9__CSI_D9, 50 MX31_PIN_CSI_D8__CSI_D8, MX31_PIN_CSI_D9__CSI_D9,
43 MX31_PIN_CSI_D10__CSI_D10, MX31_PIN_CSI_D11__CSI_D11, 51 MX31_PIN_CSI_D10__CSI_D10, MX31_PIN_CSI_D11__CSI_D11,
@@ -45,10 +53,19 @@ static unsigned int marxbot_pins[] = {
45 MX31_PIN_CSI_D14__CSI_D14, MX31_PIN_CSI_D15__CSI_D15, 53 MX31_PIN_CSI_D14__CSI_D14, MX31_PIN_CSI_D15__CSI_D15,
46 MX31_PIN_CSI_HSYNC__CSI_HSYNC, MX31_PIN_CSI_MCLK__CSI_MCLK, 54 MX31_PIN_CSI_HSYNC__CSI_HSYNC, MX31_PIN_CSI_MCLK__CSI_MCLK,
47 MX31_PIN_CSI_PIXCLK__CSI_PIXCLK, MX31_PIN_CSI_VSYNC__CSI_VSYNC, 55 MX31_PIN_CSI_PIXCLK__CSI_PIXCLK, MX31_PIN_CSI_VSYNC__CSI_VSYNC,
56 MX31_PIN_CSI_D4__GPIO3_4, MX31_PIN_CSI_D5__GPIO3_5,
48 MX31_PIN_GPIO3_0__GPIO3_0, MX31_PIN_GPIO3_1__GPIO3_1, 57 MX31_PIN_GPIO3_0__GPIO3_0, MX31_PIN_GPIO3_1__GPIO3_1,
49 MX31_PIN_TXD2__GPIO1_28, 58 MX31_PIN_TXD2__GPIO1_28,
50 /* dsPIC resets */ 59 /* dsPIC resets */
51 MX31_PIN_STXD5__GPIO1_21, MX31_PIN_SRXD5__GPIO1_22, 60 MX31_PIN_STXD5__GPIO1_21, MX31_PIN_SRXD5__GPIO1_22,
61 /*battery detection */
62 MX31_PIN_LCS0__GPIO3_23,
63 /* USB H1 */
64 MX31_PIN_CSPI1_MISO__USBH1_RXDP, MX31_PIN_CSPI1_MOSI__USBH1_RXDM,
65 MX31_PIN_CSPI1_SS0__USBH1_TXDM, MX31_PIN_CSPI1_SS1__USBH1_TXDP,
66 MX31_PIN_CSPI1_SS2__USBH1_RCV, MX31_PIN_CSPI1_SCLK__USBH1_OEB,
67 MX31_PIN_CSPI1_SPI_RDY__USBH1_FS, MX31_PIN_SFS6__USBH1_SUSPEND,
68 MX31_PIN_NFRE_B__GPIO1_11, MX31_PIN_NFALE__GPIO1_12,
52}; 69};
53 70
54#define SDHC2_CD IOMUX_TO_GPIO(MX31_PIN_ATA_DIOR) 71#define SDHC2_CD IOMUX_TO_GPIO(MX31_PIN_ATA_DIOR)
@@ -120,6 +137,166 @@ static void dspics_resets_init(void)
120 } 137 }
121} 138}
122 139
140static struct spi_board_info marxbot_spi_board_info[] __initdata = {
141 {
142 .modalias = "spidev",
143 .max_speed_hz = 300000,
144 .bus_num = 1,
145 .chip_select = 1, /* according spi1_cs[] ! */
146 },
147};
148
149#define TURRETCAM_POWER IOMUX_TO_GPIO(MX31_PIN_GPIO3_1)
150#define BASECAM_POWER IOMUX_TO_GPIO(MX31_PIN_CSI_D5)
151#define TURRETCAM_RST_B IOMUX_TO_GPIO(MX31_PIN_GPIO3_0)
152#define BASECAM_RST_B IOMUX_TO_GPIO(MX31_PIN_CSI_D4)
153#define CAM_CHOICE IOMUX_TO_GPIO(MX31_PIN_TXD2)
154
155static int marxbot_basecam_power(struct device *dev, int on)
156{
157 gpio_set_value(BASECAM_POWER, !on);
158 return 0;
159}
160
161static int marxbot_basecam_reset(struct device *dev)
162{
163 gpio_set_value(BASECAM_RST_B, 0);
164 udelay(100);
165 gpio_set_value(BASECAM_RST_B, 1);
166 return 0;
167}
168
169static struct i2c_board_info marxbot_i2c_devices[] = {
170 {
171 I2C_BOARD_INFO("mt9t031", 0x5d),
172 },
173};
174
175static struct soc_camera_link base_iclink = {
176 .bus_id = 0, /* Must match with the camera ID */
177 .power = marxbot_basecam_power,
178 .reset = marxbot_basecam_reset,
179 .board_info = &marxbot_i2c_devices[0],
180 .i2c_adapter_id = 0,
181 .module_name = "mt9t031",
182};
183
184static struct platform_device marxbot_camera[] = {
185 {
186 .name = "soc-camera-pdrv",
187 .id = 0,
188 .dev = {
189 .platform_data = &base_iclink,
190 },
191 },
192};
193
194static struct platform_device *marxbot_cameras[] __initdata = {
195 &marxbot_camera[0],
196};
197
198static int __init marxbot_cam_init(void)
199{
200 int ret = gpio_request(CAM_CHOICE, "cam-choice");
201 if (ret)
202 return ret;
203 gpio_direction_output(CAM_CHOICE, 1);
204
205 ret = gpio_request(BASECAM_RST_B, "basecam-reset");
206 if (ret)
207 return ret;
208 gpio_direction_output(BASECAM_RST_B, 1);
209 ret = gpio_request(BASECAM_POWER, "basecam-standby");
210 if (ret)
211 return ret;
212 gpio_direction_output(BASECAM_POWER, 0);
213
214 ret = gpio_request(TURRETCAM_RST_B, "turretcam-reset");
215 if (ret)
216 return ret;
217 gpio_direction_output(TURRETCAM_RST_B, 1);
218 ret = gpio_request(TURRETCAM_POWER, "turretcam-standby");
219 if (ret)
220 return ret;
221 gpio_direction_output(TURRETCAM_POWER, 0);
222
223 return 0;
224}
225
226#define USB_PAD_CFG (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST | PAD_CTL_HYS_CMOS | \
227 PAD_CTL_ODE_CMOS | PAD_CTL_100K_PU)
228
229static int marxbot_usbh1_hw_init(struct platform_device *pdev)
230{
231 mxc_iomux_set_gpr(MUX_PGP_USB_SUSPEND, true);
232
233 mxc_iomux_set_pad(MX31_PIN_CSPI1_MISO, USB_PAD_CFG);
234 mxc_iomux_set_pad(MX31_PIN_CSPI1_MOSI, USB_PAD_CFG);
235 mxc_iomux_set_pad(MX31_PIN_CSPI1_SS0, USB_PAD_CFG);
236 mxc_iomux_set_pad(MX31_PIN_CSPI1_SS1, USB_PAD_CFG);
237 mxc_iomux_set_pad(MX31_PIN_CSPI1_SS2, USB_PAD_CFG);
238 mxc_iomux_set_pad(MX31_PIN_CSPI1_SCLK, USB_PAD_CFG);
239 mxc_iomux_set_pad(MX31_PIN_CSPI1_SPI_RDY, USB_PAD_CFG);
240 mxc_iomux_set_pad(MX31_PIN_SFS6, USB_PAD_CFG);
241
242 return 0;
243}
244
245#define USBH1_VBUSEN_B IOMUX_TO_GPIO(MX31_PIN_NFRE_B)
246#define USBH1_MODE IOMUX_TO_GPIO(MX31_PIN_NFALE)
247
248static int marxbot_isp1105_init(struct otg_transceiver *otg)
249{
250 int ret = gpio_request(USBH1_MODE, "usbh1-mode");
251 if (ret)
252 return ret;
253 /* single ended */
254 gpio_direction_output(USBH1_MODE, 0);
255
256 ret = gpio_request(USBH1_VBUSEN_B, "usbh1-vbusen");
257 if (ret) {
258 gpio_free(USBH1_MODE);
259 return ret;
260 }
261 gpio_direction_output(USBH1_VBUSEN_B, 1);
262
263 return 0;
264}
265
266
267static int marxbot_isp1105_set_vbus(struct otg_transceiver *otg, bool on)
268{
269 if (on)
270 gpio_set_value(USBH1_VBUSEN_B, 0);
271 else
272 gpio_set_value(USBH1_VBUSEN_B, 1);
273
274 return 0;
275}
276
277static struct mxc_usbh_platform_data usbh1_pdata = {
278 .init = marxbot_usbh1_hw_init,
279 .portsc = MXC_EHCI_MODE_UTMI | MXC_EHCI_SERIAL,
280 .flags = MXC_EHCI_POWER_PINS_ENABLED | MXC_EHCI_INTERFACE_SINGLE_UNI,
281};
282
283static int __init marxbot_usbh1_init(void)
284{
285 struct otg_transceiver *otg;
286
287 otg = kzalloc(sizeof(*otg), GFP_KERNEL);
288 if (!otg)
289 return -ENOMEM;
290
291 otg->label = "ISP1105";
292 otg->init = marxbot_isp1105_init;
293 otg->set_vbus = marxbot_isp1105_set_vbus;
294
295 usbh1_pdata.otg = otg;
296
297 return mxc_register_device(&mx31_usbh1, &usbh1_pdata);
298}
299
123/* 300/*
124 * system init for baseboard usage. Will be called by mx31moboard init. 301 * system init for baseboard usage. Will be called by mx31moboard init.
125 */ 302 */
@@ -133,4 +310,17 @@ void __init mx31moboard_marxbot_init(void)
133 dspics_resets_init(); 310 dspics_resets_init();
134 311
135 mxc_register_device(&mxcsdhc_device1, &sdhc2_pdata); 312 mxc_register_device(&mxcsdhc_device1, &sdhc2_pdata);
313
314 spi_register_board_info(marxbot_spi_board_info,
315 ARRAY_SIZE(marxbot_spi_board_info));
316
317 marxbot_cam_init();
318 platform_add_devices(marxbot_cameras, ARRAY_SIZE(marxbot_cameras));
319
320 /* battery present pin */
321 gpio_request(IOMUX_TO_GPIO(MX31_PIN_LCS0), "bat-present");
322 gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_LCS0));
323 gpio_export(IOMUX_TO_GPIO(MX31_PIN_LCS0), false);
324
325 marxbot_usbh1_init();
136} 326}
diff --git a/arch/arm/mach-mx3/mx31moboard.c b/arch/arm/mach-mx3/mx31moboard.c
index 9243de54041a..b70529145936 100644
--- a/arch/arm/mach-mx3/mx31moboard.c
+++ b/arch/arm/mach-mx3/mx31moboard.c
@@ -17,6 +17,7 @@
17 */ 17 */
18 18
19#include <linux/delay.h> 19#include <linux/delay.h>
20#include <linux/dma-mapping.h>
20#include <linux/fsl_devices.h> 21#include <linux/fsl_devices.h>
21#include <linux/gpio.h> 22#include <linux/gpio.h>
22#include <linux/init.h> 23#include <linux/init.h>
@@ -26,8 +27,14 @@
26#include <linux/mtd/physmap.h> 27#include <linux/mtd/physmap.h>
27#include <linux/mtd/partitions.h> 28#include <linux/mtd/partitions.h>
28#include <linux/platform_device.h> 29#include <linux/platform_device.h>
30#include <linux/regulator/machine.h>
31#include <linux/mfd/mc13783.h>
32#include <linux/spi/spi.h>
29#include <linux/types.h> 33#include <linux/types.h>
30 34
35#include <linux/usb/otg.h>
36#include <linux/usb/ulpi.h>
37
31#include <asm/mach-types.h> 38#include <asm/mach-types.h>
32#include <asm/mach/arch.h> 39#include <asm/mach/arch.h>
33#include <asm/mach/time.h> 40#include <asm/mach/time.h>
@@ -37,16 +44,20 @@
37#include <mach/hardware.h> 44#include <mach/hardware.h>
38#include <mach/imx-uart.h> 45#include <mach/imx-uart.h>
39#include <mach/iomux-mx3.h> 46#include <mach/iomux-mx3.h>
47#include <mach/ipu.h>
40#include <mach/i2c.h> 48#include <mach/i2c.h>
41#include <mach/mmc.h> 49#include <mach/mmc.h>
42#include <mach/mx31.h> 50#include <mach/mxc_ehci.h>
51#include <mach/mx3_camera.h>
52#include <mach/spi.h>
53#include <mach/ulpi.h>
43 54
44#include "devices.h" 55#include "devices.h"
45 56
46static unsigned int moboard_pins[] = { 57static unsigned int moboard_pins[] = {
47 /* UART0 */ 58 /* UART0 */
48 MX31_PIN_CTS1__CTS1, MX31_PIN_RTS1__RTS1,
49 MX31_PIN_TXD1__TXD1, MX31_PIN_RXD1__RXD1, 59 MX31_PIN_TXD1__TXD1, MX31_PIN_RXD1__RXD1,
60 MX31_PIN_CTS1__GPIO2_7,
50 /* UART4 */ 61 /* UART4 */
51 MX31_PIN_PC_RST__CTS5, MX31_PIN_PC_VS2__RTS5, 62 MX31_PIN_PC_RST__CTS5, MX31_PIN_PC_VS2__RTS5,
52 MX31_PIN_PC_BVD2__TXD5, MX31_PIN_PC_BVD1__RXD5, 63 MX31_PIN_PC_BVD2__TXD5, MX31_PIN_PC_BVD1__RXD5,
@@ -73,12 +84,31 @@ static unsigned int moboard_pins[] = {
73 MX31_PIN_USBOTG_CLK__USBOTG_CLK, MX31_PIN_USBOTG_DIR__USBOTG_DIR, 84 MX31_PIN_USBOTG_CLK__USBOTG_CLK, MX31_PIN_USBOTG_DIR__USBOTG_DIR,
74 MX31_PIN_USBOTG_NXT__USBOTG_NXT, MX31_PIN_USBOTG_STP__USBOTG_STP, 85 MX31_PIN_USBOTG_NXT__USBOTG_NXT, MX31_PIN_USBOTG_STP__USBOTG_STP,
75 MX31_PIN_USB_OC__GPIO1_30, 86 MX31_PIN_USB_OC__GPIO1_30,
87 /* USB H2 */
88 MX31_PIN_USBH2_DATA0__USBH2_DATA0,
89 MX31_PIN_USBH2_DATA1__USBH2_DATA1,
90 MX31_PIN_STXD3__USBH2_DATA2, MX31_PIN_SRXD3__USBH2_DATA3,
91 MX31_PIN_SCK3__USBH2_DATA4, MX31_PIN_SFS3__USBH2_DATA5,
92 MX31_PIN_STXD6__USBH2_DATA6, MX31_PIN_SRXD6__USBH2_DATA7,
93 MX31_PIN_USBH2_CLK__USBH2_CLK, MX31_PIN_USBH2_DIR__USBH2_DIR,
94 MX31_PIN_USBH2_NXT__USBH2_NXT, MX31_PIN_USBH2_STP__USBH2_STP,
95 MX31_PIN_SCK6__GPIO1_25,
76 /* LEDs */ 96 /* LEDs */
77 MX31_PIN_SVEN0__GPIO2_0, MX31_PIN_STX0__GPIO2_1, 97 MX31_PIN_SVEN0__GPIO2_0, MX31_PIN_STX0__GPIO2_1,
78 MX31_PIN_SRX0__GPIO2_2, MX31_PIN_SIMPD0__GPIO2_3, 98 MX31_PIN_SRX0__GPIO2_2, MX31_PIN_SIMPD0__GPIO2_3,
79 /* SEL */ 99 /* SEL */
80 MX31_PIN_DTR_DCE1__GPIO2_8, MX31_PIN_DSR_DCE1__GPIO2_9, 100 MX31_PIN_DTR_DCE1__GPIO2_8, MX31_PIN_DSR_DCE1__GPIO2_9,
81 MX31_PIN_RI_DCE1__GPIO2_10, MX31_PIN_DCD_DCE1__GPIO2_11, 101 MX31_PIN_RI_DCE1__GPIO2_10, MX31_PIN_DCD_DCE1__GPIO2_11,
102 /* SPI1 */
103 MX31_PIN_CSPI2_MOSI__MOSI, MX31_PIN_CSPI2_MISO__MISO,
104 MX31_PIN_CSPI2_SCLK__SCLK, MX31_PIN_CSPI2_SPI_RDY__SPI_RDY,
105 MX31_PIN_CSPI2_SS0__SS0, MX31_PIN_CSPI2_SS2__SS2,
106 /* Atlas IRQ */
107 MX31_PIN_GPIO1_3__GPIO1_3,
108 /* SPI2 */
109 MX31_PIN_CSPI3_MOSI__MOSI, MX31_PIN_CSPI3_MISO__MISO,
110 MX31_PIN_CSPI3_SCLK__SCLK, MX31_PIN_CSPI3_SPI_RDY__SPI_RDY,
111 MX31_PIN_CSPI2_SS1__CSPI3_SS1,
82}; 112};
83 113
84static struct physmap_flash_data mx31moboard_flash_data = { 114static struct physmap_flash_data mx31moboard_flash_data = {
@@ -101,7 +131,18 @@ static struct platform_device mx31moboard_flash = {
101 .num_resources = 1, 131 .num_resources = 1,
102}; 132};
103 133
104static struct imxuart_platform_data uart_pdata = { 134static int moboard_uart0_init(struct platform_device *pdev)
135{
136 gpio_request(IOMUX_TO_GPIO(MX31_PIN_CTS1), "uart0-cts-hack");
137 gpio_direction_output(IOMUX_TO_GPIO(MX31_PIN_CTS1), 0);
138 return 0;
139}
140
141static struct imxuart_platform_data uart0_pdata = {
142 .init = moboard_uart0_init,
143};
144
145static struct imxuart_platform_data uart4_pdata = {
105 .flags = IMXUART_HAVE_RTSCTS, 146 .flags = IMXUART_HAVE_RTSCTS,
106}; 147};
107 148
@@ -113,6 +154,103 @@ static struct imxi2c_platform_data moboard_i2c1_pdata = {
113 .bitrate = 100000, 154 .bitrate = 100000,
114}; 155};
115 156
157static int moboard_spi1_cs[] = {
158 MXC_SPI_CS(0),
159 MXC_SPI_CS(2),
160};
161
162static struct spi_imx_master moboard_spi1_master = {
163 .chipselect = moboard_spi1_cs,
164 .num_chipselect = ARRAY_SIZE(moboard_spi1_cs),
165};
166
167static struct regulator_consumer_supply sdhc_consumers[] = {
168 {
169 .dev = &mxcsdhc_device0.dev,
170 .supply = "sdhc0_vcc",
171 },
172 {
173 .dev = &mxcsdhc_device1.dev,
174 .supply = "sdhc1_vcc",
175 },
176};
177
178static struct regulator_init_data sdhc_vreg_data = {
179 .constraints = {
180 .min_uV = 2700000,
181 .max_uV = 3000000,
182 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
183 REGULATOR_CHANGE_MODE | REGULATOR_CHANGE_STATUS,
184 .valid_modes_mask = REGULATOR_MODE_NORMAL |
185 REGULATOR_MODE_FAST,
186 .always_on = 0,
187 .boot_on = 1,
188 },
189 .num_consumer_supplies = ARRAY_SIZE(sdhc_consumers),
190 .consumer_supplies = sdhc_consumers,
191};
192
193static struct regulator_consumer_supply cam_consumers[] = {
194 {
195 .dev = &mx3_camera.dev,
196 .supply = "cam_vcc",
197 },
198};
199
200static struct regulator_init_data cam_vreg_data = {
201 .constraints = {
202 .min_uV = 2700000,
203 .max_uV = 3000000,
204 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
205 REGULATOR_CHANGE_MODE | REGULATOR_CHANGE_STATUS,
206 .valid_modes_mask = REGULATOR_MODE_NORMAL |
207 REGULATOR_MODE_FAST,
208 .always_on = 0,
209 .boot_on = 1,
210 },
211 .num_consumer_supplies = ARRAY_SIZE(cam_consumers),
212 .consumer_supplies = cam_consumers,
213};
214
215static struct mc13783_regulator_init_data moboard_regulators[] = {
216 {
217 .id = MC13783_REGU_VMMC1,
218 .init_data = &sdhc_vreg_data,
219 },
220 {
221 .id = MC13783_REGU_VCAM,
222 .init_data = &cam_vreg_data,
223 },
224};
225
226static struct mc13783_platform_data moboard_pmic = {
227 .regulators = moboard_regulators,
228 .num_regulators = ARRAY_SIZE(moboard_regulators),
229 .flags = MC13783_USE_REGULATOR | MC13783_USE_RTC |
230 MC13783_USE_ADC,
231};
232
233static struct spi_board_info moboard_spi_board_info[] __initdata = {
234 {
235 .modalias = "mc13783",
236 .irq = IOMUX_TO_IRQ(MX31_PIN_GPIO1_3),
237 .max_speed_hz = 300000,
238 .bus_num = 1,
239 .chip_select = 0,
240 .platform_data = &moboard_pmic,
241 .mode = SPI_CS_HIGH,
242 },
243};
244
245static int moboard_spi2_cs[] = {
246 MXC_SPI_CS(1),
247};
248
249static struct spi_imx_master moboard_spi2_master = {
250 .chipselect = moboard_spi2_cs,
251 .num_chipselect = ARRAY_SIZE(moboard_spi2_cs),
252};
253
116#define SDHC1_CD IOMUX_TO_GPIO(MX31_PIN_ATA_CS0) 254#define SDHC1_CD IOMUX_TO_GPIO(MX31_PIN_ATA_CS0)
117#define SDHC1_WP IOMUX_TO_GPIO(MX31_PIN_ATA_CS1) 255#define SDHC1_WP IOMUX_TO_GPIO(MX31_PIN_ATA_CS1)
118 256
@@ -208,6 +346,56 @@ static struct fsl_usb2_platform_data usb_pdata = {
208 .phy_mode = FSL_USB2_PHY_ULPI, 346 .phy_mode = FSL_USB2_PHY_ULPI,
209}; 347};
210 348
349#define USBH2_EN_B IOMUX_TO_GPIO(MX31_PIN_SCK6)
350
351static int moboard_usbh2_hw_init(struct platform_device *pdev)
352{
353 int ret = gpio_request(USBH2_EN_B, "usbh2-en");
354 if (ret)
355 return ret;
356
357 mxc_iomux_set_gpr(MUX_PGP_UH2, true);
358
359 mxc_iomux_set_pad(MX31_PIN_USBH2_CLK, USB_PAD_CFG);
360 mxc_iomux_set_pad(MX31_PIN_USBH2_DIR, USB_PAD_CFG);
361 mxc_iomux_set_pad(MX31_PIN_USBH2_NXT, USB_PAD_CFG);
362 mxc_iomux_set_pad(MX31_PIN_USBH2_STP, USB_PAD_CFG);
363 mxc_iomux_set_pad(MX31_PIN_USBH2_DATA0, USB_PAD_CFG);
364 mxc_iomux_set_pad(MX31_PIN_USBH2_DATA1, USB_PAD_CFG);
365 mxc_iomux_set_pad(MX31_PIN_SRXD6, USB_PAD_CFG);
366 mxc_iomux_set_pad(MX31_PIN_STXD6, USB_PAD_CFG);
367 mxc_iomux_set_pad(MX31_PIN_SFS3, USB_PAD_CFG);
368 mxc_iomux_set_pad(MX31_PIN_SCK3, USB_PAD_CFG);
369 mxc_iomux_set_pad(MX31_PIN_SRXD3, USB_PAD_CFG);
370 mxc_iomux_set_pad(MX31_PIN_STXD3, USB_PAD_CFG);
371
372 gpio_direction_output(USBH2_EN_B, 0);
373
374 return 0;
375}
376
377static int moboard_usbh2_hw_exit(struct platform_device *pdev)
378{
379 gpio_free(USBH2_EN_B);
380 return 0;
381}
382
383static struct mxc_usbh_platform_data usbh2_pdata = {
384 .init = moboard_usbh2_hw_init,
385 .exit = moboard_usbh2_hw_exit,
386 .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT,
387 .flags = MXC_EHCI_POWER_PINS_ENABLED,
388};
389
390static int __init moboard_usbh2_init(void)
391{
392 usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops,
393 USB_OTG_DRV_VBUS | USB_OTG_DRV_VBUS_EXT);
394
395 return mxc_register_device(&mx31_usbh2, &usbh2_pdata);
396}
397
398
211static struct gpio_led mx31moboard_leds[] = { 399static struct gpio_led mx31moboard_leds[] = {
212 { 400 {
213 .name = "coreboard-led-0:red:running", 401 .name = "coreboard-led-0:red:running",
@@ -266,11 +454,48 @@ static void mx31moboard_init_sel_gpios(void)
266 } 454 }
267} 455}
268 456
457static struct ipu_platform_data mx3_ipu_data = {
458 .irq_base = MXC_IPU_IRQ_START,
459};
460
269static struct platform_device *devices[] __initdata = { 461static struct platform_device *devices[] __initdata = {
270 &mx31moboard_flash, 462 &mx31moboard_flash,
271 &mx31moboard_leds_device, 463 &mx31moboard_leds_device,
272}; 464};
273 465
466static struct mx3_camera_pdata camera_pdata = {
467 .dma_dev = &mx3_ipu.dev,
468 .flags = MX3_CAMERA_DATAWIDTH_8 | MX3_CAMERA_DATAWIDTH_10,
469 .mclk_10khz = 4800,
470};
471
472#define CAMERA_BUF_SIZE (4*1024*1024)
473
474static int __init mx31moboard_cam_alloc_dma(const size_t buf_size)
475{
476 dma_addr_t dma_handle;
477 void *buf;
478 int dma;
479
480 if (buf_size < 2 * 1024 * 1024)
481 return -EINVAL;
482
483 buf = dma_alloc_coherent(NULL, buf_size, &dma_handle, GFP_KERNEL);
484 if (!buf) {
485 pr_err("%s: cannot allocate camera buffer-memory\n", __func__);
486 return -ENOMEM;
487 }
488
489 memset(buf, 0, buf_size);
490
491 dma = dma_declare_coherent_memory(&mx3_camera.dev,
492 dma_handle, dma_handle, buf_size,
493 DMA_MEMORY_MAP | DMA_MEMORY_EXCLUSIVE);
494
495 /* The way we call dma_declare_coherent_memory only a malloc can fail */
496 return dma & DMA_MEMORY_MAP ? 0 : -ENOMEM;
497}
498
274static int mx31moboard_baseboard; 499static int mx31moboard_baseboard;
275core_param(mx31moboard_baseboard, mx31moboard_baseboard, int, 0444); 500core_param(mx31moboard_baseboard, mx31moboard_baseboard, int, 0444);
276 501
@@ -284,20 +509,34 @@ static void __init mxc_board_init(void)
284 509
285 platform_add_devices(devices, ARRAY_SIZE(devices)); 510 platform_add_devices(devices, ARRAY_SIZE(devices));
286 511
287 mxc_register_device(&mxc_uart_device0, &uart_pdata); 512 mxc_register_device(&mxc_uart_device0, &uart0_pdata);
288 mxc_register_device(&mxc_uart_device4, &uart_pdata); 513
514 mxc_register_device(&mxc_uart_device4, &uart4_pdata);
289 515
290 mx31moboard_init_sel_gpios(); 516 mx31moboard_init_sel_gpios();
291 517
292 mxc_register_device(&mxc_i2c_device0, &moboard_i2c0_pdata); 518 mxc_register_device(&mxc_i2c_device0, &moboard_i2c0_pdata);
293 mxc_register_device(&mxc_i2c_device1, &moboard_i2c1_pdata); 519 mxc_register_device(&mxc_i2c_device1, &moboard_i2c1_pdata);
294 520
521 mxc_register_device(&mxc_spi_device1, &moboard_spi1_master);
522 mxc_register_device(&mxc_spi_device2, &moboard_spi2_master);
523
524 gpio_request(IOMUX_TO_GPIO(MX31_PIN_GPIO1_3), "pmic-irq");
525 gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_GPIO1_3));
526 spi_register_board_info(moboard_spi_board_info,
527 ARRAY_SIZE(moboard_spi_board_info));
528
295 mxc_register_device(&mxcsdhc_device0, &sdhc1_pdata); 529 mxc_register_device(&mxcsdhc_device0, &sdhc1_pdata);
296 530
531 mxc_register_device(&mx3_ipu, &mx3_ipu_data);
532 if (!mx31moboard_cam_alloc_dma(CAMERA_BUF_SIZE))
533 mxc_register_device(&mx3_camera, &camera_pdata);
534
297 usb_xcvr_reset(); 535 usb_xcvr_reset();
298 536
299 moboard_usbotg_init(); 537 moboard_usbotg_init();
300 mxc_register_device(&mxc_otg_udc_device, &usb_pdata); 538 mxc_register_device(&mxc_otg_udc_device, &usb_pdata);
539 moboard_usbh2_init();
301 540
302 switch (mx31moboard_baseboard) { 541 switch (mx31moboard_baseboard) {
303 case MX31NOBOARD: 542 case MX31NOBOARD:
diff --git a/arch/arm/mach-mx3/mx35pdk.c b/arch/arm/mach-mx3/mx35pdk.c
index 6ff186e46ceb..0bbc65ea23c8 100644
--- a/arch/arm/mach-mx3/mx35pdk.c
+++ b/arch/arm/mach-mx3/mx35pdk.c
@@ -23,6 +23,7 @@
23#include <linux/platform_device.h> 23#include <linux/platform_device.h>
24#include <linux/memory.h> 24#include <linux/memory.h>
25#include <linux/gpio.h> 25#include <linux/gpio.h>
26#include <linux/fsl_devices.h>
26 27
27#include <asm/mach-types.h> 28#include <asm/mach-types.h>
28#include <asm/mach/arch.h> 29#include <asm/mach/arch.h>
@@ -69,6 +70,15 @@ static struct pad_desc mx35pdk_pads[] = {
69 MX35_PAD_FEC_TDATA2__FEC_TDATA_2, 70 MX35_PAD_FEC_TDATA2__FEC_TDATA_2,
70 MX35_PAD_FEC_RDATA3__FEC_RDATA_3, 71 MX35_PAD_FEC_RDATA3__FEC_RDATA_3,
71 MX35_PAD_FEC_TDATA3__FEC_TDATA_3, 72 MX35_PAD_FEC_TDATA3__FEC_TDATA_3,
73 /* USBOTG */
74 MX35_PAD_USBOTG_PWR__USB_TOP_USBOTG_PWR,
75 MX35_PAD_USBOTG_OC__USB_TOP_USBOTG_OC,
76};
77
78/* OTG config */
79static struct fsl_usb2_platform_data usb_pdata = {
80 .operating_mode = FSL_USB2_DR_DEVICE,
81 .phy_mode = FSL_USB2_PHY_UTMI_WIDE,
72}; 82};
73 83
74/* 84/*
@@ -81,6 +91,8 @@ static void __init mxc_board_init(void)
81 platform_add_devices(devices, ARRAY_SIZE(devices)); 91 platform_add_devices(devices, ARRAY_SIZE(devices));
82 92
83 mxc_register_device(&mxc_uart_device0, &uart_pdata); 93 mxc_register_device(&mxc_uart_device0, &uart_pdata);
94
95 mxc_register_device(&mxc_otg_udc_device, &usb_pdata);
84} 96}
85 97
86static void __init mx35pdk_timer_init(void) 98static void __init mx35pdk_timer_init(void)
diff --git a/arch/arm/mach-mx3/pcm043.c b/arch/arm/mach-mx3/pcm043.c
index e18a224671fa..e3aa829be586 100644
--- a/arch/arm/mach-mx3/pcm043.c
+++ b/arch/arm/mach-mx3/pcm043.c
@@ -43,6 +43,7 @@
43#include <mach/iomux-mx35.h> 43#include <mach/iomux-mx35.h>
44#include <mach/ipu.h> 44#include <mach/ipu.h>
45#include <mach/mx3fb.h> 45#include <mach/mx3fb.h>
46#include <mach/mxc_nand.h>
46 47
47#include "devices.h" 48#include "devices.h"
48 49
@@ -206,6 +207,11 @@ static struct pad_desc pcm043_pads[] = {
206 MX35_PAD_ATA_CS0__GPIO2_6, 207 MX35_PAD_ATA_CS0__GPIO2_6,
207}; 208};
208 209
210static struct mxc_nand_platform_data pcm037_nand_board_info = {
211 .width = 1,
212 .hw_ecc = 1,
213};
214
209/* 215/*
210 * Board specific initialization. 216 * Board specific initialization.
211 */ 217 */
@@ -216,6 +222,7 @@ static void __init mxc_board_init(void)
216 platform_add_devices(devices, ARRAY_SIZE(devices)); 222 platform_add_devices(devices, ARRAY_SIZE(devices));
217 223
218 mxc_register_device(&mxc_uart_device0, &uart_pdata); 224 mxc_register_device(&mxc_uart_device0, &uart_pdata);
225 mxc_register_device(&mxc_nand_device, &pcm037_nand_board_info);
219 226
220 mxc_register_device(&mxc_uart_device1, &uart_pdata); 227 mxc_register_device(&mxc_uart_device1, &uart_pdata);
221 228
diff --git a/arch/arm/mach-nomadik/Kconfig b/arch/arm/mach-nomadik/Kconfig
index 2a02b49c40f0..3c5e0f522e9c 100644
--- a/arch/arm/mach-nomadik/Kconfig
+++ b/arch/arm/mach-nomadik/Kconfig
@@ -5,13 +5,13 @@ menu "Nomadik boards"
5config MACH_NOMADIK_8815NHK 5config MACH_NOMADIK_8815NHK
6 bool "ST 8815 Nomadik Hardware Kit (evaluation board)" 6 bool "ST 8815 Nomadik Hardware Kit (evaluation board)"
7 select NOMADIK_8815 7 select NOMADIK_8815
8 select HAS_MTU
8 9
9endmenu 10endmenu
10 11
11config NOMADIK_8815 12config NOMADIK_8815
12 bool 13 bool
13 14
14
15config I2C_BITBANG_8815NHK 15config I2C_BITBANG_8815NHK
16 tristate "Driver for bit-bang busses found on the 8815 NHK" 16 tristate "Driver for bit-bang busses found on the 8815 NHK"
17 depends on I2C && MACH_NOMADIK_8815NHK 17 depends on I2C && MACH_NOMADIK_8815NHK
diff --git a/arch/arm/mach-nomadik/Makefile b/arch/arm/mach-nomadik/Makefile
index 412040982a40..36f67fb207d2 100644
--- a/arch/arm/mach-nomadik/Makefile
+++ b/arch/arm/mach-nomadik/Makefile
@@ -7,7 +7,7 @@
7 7
8# Object file lists. 8# Object file lists.
9 9
10obj-y += clock.o timer.o gpio.o 10obj-y += clock.o gpio.o
11 11
12# Cpu revision 12# Cpu revision
13obj-$(CONFIG_NOMADIK_8815) += cpu-8815.o 13obj-$(CONFIG_NOMADIK_8815) += cpu-8815.o
diff --git a/arch/arm/mach-nomadik/board-nhk8815.c b/arch/arm/mach-nomadik/board-nhk8815.c
index 6bfd537d5afb..116394484e71 100644
--- a/arch/arm/mach-nomadik/board-nhk8815.c
+++ b/arch/arm/mach-nomadik/board-nhk8815.c
@@ -25,11 +25,18 @@
25#include <asm/mach/arch.h> 25#include <asm/mach/arch.h>
26#include <asm/mach/irq.h> 26#include <asm/mach/irq.h>
27#include <asm/mach/flash.h> 27#include <asm/mach/flash.h>
28
29#include <plat/mtu.h>
30
28#include <mach/setup.h> 31#include <mach/setup.h>
29#include <mach/nand.h> 32#include <mach/nand.h>
30#include <mach/fsmc.h> 33#include <mach/fsmc.h>
31#include "clock.h" 34#include "clock.h"
32 35
36/* Initial value for SRC control register: all timers use MXTAL/8 source */
37#define SRC_CR_INIT_MASK 0x00007fff
38#define SRC_CR_INIT_VAL 0x2aaa8000
39
33/* These adresses span 16MB, so use three individual pages */ 40/* These adresses span 16MB, so use three individual pages */
34static struct resource nhk8815_nand_resources[] = { 41static struct resource nhk8815_nand_resources[] = {
35 { 42 {
@@ -239,6 +246,26 @@ static struct platform_device *nhk8815_platform_devices[] __initdata = {
239 /* will add more devices */ 246 /* will add more devices */
240}; 247};
241 248
249static void __init nomadik_timer_init(void)
250{
251 u32 src_cr;
252
253 /* Configure timer sources in "system reset controller" ctrl reg */
254 src_cr = readl(io_p2v(NOMADIK_SRC_BASE));
255 src_cr &= SRC_CR_INIT_MASK;
256 src_cr |= SRC_CR_INIT_VAL;
257 writel(src_cr, io_p2v(NOMADIK_SRC_BASE));
258
259 /* Save global pointer to mtu, used by platform timer code */
260 mtu_base = io_p2v(NOMADIK_MTU0_BASE);
261
262 nmdk_timer_init();
263}
264
265static struct sys_timer nomadik_timer = {
266 .init = nomadik_timer_init,
267};
268
242static void __init nhk8815_platform_init(void) 269static void __init nhk8815_platform_init(void)
243{ 270{
244 int i; 271 int i;
diff --git a/arch/arm/mach-nomadik/include/mach/setup.h b/arch/arm/mach-nomadik/include/mach/setup.h
index a4e468cf63da..b7897edf1f35 100644
--- a/arch/arm/mach-nomadik/include/mach/setup.h
+++ b/arch/arm/mach-nomadik/include/mach/setup.h
@@ -15,7 +15,7 @@
15extern void cpu8815_map_io(void); 15extern void cpu8815_map_io(void);
16extern void cpu8815_platform_init(void); 16extern void cpu8815_platform_init(void);
17extern void cpu8815_init_irq(void); 17extern void cpu8815_init_irq(void);
18extern struct sys_timer nomadik_timer; 18extern void nmdk_timer_init(void);
19 19
20#endif /* NOMADIK_8815 */ 20#endif /* NOMADIK_8815 */
21 21
diff --git a/arch/arm/mach-omap1/Kconfig b/arch/arm/mach-omap1/Kconfig
index 55ecc01ea206..27f489747bbd 100644
--- a/arch/arm/mach-omap1/Kconfig
+++ b/arch/arm/mach-omap1/Kconfig
@@ -11,6 +11,7 @@ config ARCH_OMAP850
11 depends on ARCH_OMAP1 11 depends on ARCH_OMAP1
12 bool "OMAP850 Based System" 12 bool "OMAP850 Based System"
13 select CPU_ARM926T 13 select CPU_ARM926T
14 select ARCH_OMAP_OTG
14 15
15config ARCH_OMAP15XX 16config ARCH_OMAP15XX
16 depends on ARCH_OMAP1 17 depends on ARCH_OMAP1
@@ -56,6 +57,12 @@ config MACH_OMAP_HTCWIZARD
56 help 57 help
57 HTC Wizard smartphone support (AKA QTEK 9100, ...) 58 HTC Wizard smartphone support (AKA QTEK 9100, ...)
58 59
60config MACH_HERALD
61 bool "HTC Herald"
62 depends on ARCH_OMAP850
63 help
64 HTC Herald smartphone support (AKA T-Mobile Wing, ...)
65
59config MACH_OMAP_OSK 66config MACH_OMAP_OSK
60 bool "TI OSK Support" 67 bool "TI OSK Support"
61 depends on ARCH_OMAP1 && ARCH_OMAP16XX 68 depends on ARCH_OMAP1 && ARCH_OMAP16XX
diff --git a/arch/arm/mach-omap1/Makefile b/arch/arm/mach-omap1/Makefile
index 6867cd3ad0b4..87e539aa8ad9 100644
--- a/arch/arm/mach-omap1/Makefile
+++ b/arch/arm/mach-omap1/Makefile
@@ -34,6 +34,7 @@ obj-$(CONFIG_MACH_OMAP_PALMTT) += board-palmtt.o
34obj-$(CONFIG_MACH_NOKIA770) += board-nokia770.o 34obj-$(CONFIG_MACH_NOKIA770) += board-nokia770.o
35obj-$(CONFIG_MACH_AMS_DELTA) += board-ams-delta.o 35obj-$(CONFIG_MACH_AMS_DELTA) += board-ams-delta.o
36obj-$(CONFIG_MACH_SX1) += board-sx1.o board-sx1-mmc.o 36obj-$(CONFIG_MACH_SX1) += board-sx1.o board-sx1-mmc.o
37obj-$(CONFIG_MACH_HERALD) += board-htcherald.o
37 38
38ifeq ($(CONFIG_ARCH_OMAP15XX),y) 39ifeq ($(CONFIG_ARCH_OMAP15XX),y)
39# Innovator-1510 FPGA 40# Innovator-1510 FPGA
diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c
index 8ad5cc3e83e3..7fc11c34b696 100644
--- a/arch/arm/mach-omap1/board-ams-delta.c
+++ b/arch/arm/mach-omap1/board-ams-delta.c
@@ -25,13 +25,13 @@
25#include <asm/mach/arch.h> 25#include <asm/mach/arch.h>
26#include <asm/mach/map.h> 26#include <asm/mach/map.h>
27 27
28#include <mach/board-ams-delta.h> 28#include <plat/board-ams-delta.h>
29#include <mach/gpio.h> 29#include <mach/gpio.h>
30#include <mach/keypad.h> 30#include <plat/keypad.h>
31#include <mach/mux.h> 31#include <plat/mux.h>
32#include <mach/usb.h> 32#include <plat/usb.h>
33#include <mach/board.h> 33#include <plat/board.h>
34#include <mach/common.h> 34#include <plat/common.h>
35 35
36static u8 ams_delta_latch1_reg; 36static u8 ams_delta_latch1_reg;
37static u16 ams_delta_latch2_reg; 37static u16 ams_delta_latch2_reg;
diff --git a/arch/arm/mach-omap1/board-fsample.c b/arch/arm/mach-omap1/board-fsample.c
index a7ead1b93226..f4b72c1654f5 100644
--- a/arch/arm/mach-omap1/board-fsample.c
+++ b/arch/arm/mach-omap1/board-fsample.c
@@ -26,14 +26,14 @@
26#include <asm/mach/flash.h> 26#include <asm/mach/flash.h>
27#include <asm/mach/map.h> 27#include <asm/mach/map.h>
28 28
29#include <mach/tc.h> 29#include <plat/tc.h>
30#include <mach/gpio.h> 30#include <mach/gpio.h>
31#include <mach/mux.h> 31#include <plat/mux.h>
32#include <mach/fpga.h> 32#include <plat/fpga.h>
33#include <mach/nand.h> 33#include <plat/nand.h>
34#include <mach/keypad.h> 34#include <plat/keypad.h>
35#include <mach/common.h> 35#include <plat/common.h>
36#include <mach/board.h> 36#include <plat/board.h>
37 37
38/* fsample is pretty close to p2-sample */ 38/* fsample is pretty close to p2-sample */
39 39
@@ -107,7 +107,7 @@ static struct resource smc91x_resources[] = {
107 .flags = IORESOURCE_MEM, 107 .flags = IORESOURCE_MEM,
108 }, 108 },
109 [1] = { 109 [1] = {
110 .start = INT_730_MPU_EXT_NIRQ, 110 .start = INT_7XX_MPU_EXT_NIRQ,
111 .end = 0, 111 .end = 0,
112 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE, 112 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
113 }, 113 },
@@ -196,8 +196,8 @@ static struct platform_device smc91x_device = {
196 196
197static struct resource kp_resources[] = { 197static struct resource kp_resources[] = {
198 [0] = { 198 [0] = {
199 .start = INT_730_MPUIO_KEYPAD, 199 .start = INT_7XX_MPUIO_KEYPAD,
200 .end = INT_730_MPUIO_KEYPAD, 200 .end = INT_7XX_MPUIO_KEYPAD,
201 .flags = IORESOURCE_IRQ, 201 .flags = IORESOURCE_IRQ,
202 }, 202 },
203}; 203};
@@ -309,7 +309,7 @@ static void __init omap_fsample_map_io(void)
309 /* 309 /*
310 * Hold GSM Reset until needed 310 * Hold GSM Reset until needed
311 */ 311 */
312 omap_writew(omap_readw(OMAP730_DSP_M_CTL) & ~1, OMAP730_DSP_M_CTL); 312 omap_writew(omap_readw(OMAP7XX_DSP_M_CTL) & ~1, OMAP7XX_DSP_M_CTL);
313 313
314 /* 314 /*
315 * UARTs -> done automagically by 8250 driver 315 * UARTs -> done automagically by 8250 driver
@@ -320,21 +320,21 @@ static void __init omap_fsample_map_io(void)
320 */ 320 */
321 321
322 /* Flash: CS0 timings setup */ 322 /* Flash: CS0 timings setup */
323 omap_writel(0x0000fff3, OMAP730_FLASH_CFG_0); 323 omap_writel(0x0000fff3, OMAP7XX_FLASH_CFG_0);
324 omap_writel(0x00000088, OMAP730_FLASH_ACFG_0); 324 omap_writel(0x00000088, OMAP7XX_FLASH_ACFG_0);
325 325
326 /* 326 /*
327 * Ethernet support through the debug board 327 * Ethernet support through the debug board
328 * CS1 timings setup 328 * CS1 timings setup
329 */ 329 */
330 omap_writel(0x0000fff3, OMAP730_FLASH_CFG_1); 330 omap_writel(0x0000fff3, OMAP7XX_FLASH_CFG_1);
331 omap_writel(0x00000000, OMAP730_FLASH_ACFG_1); 331 omap_writel(0x00000000, OMAP7XX_FLASH_ACFG_1);
332 332
333 /* 333 /*
334 * Configure MPU_EXT_NIRQ IO in IO_CONF9 register, 334 * Configure MPU_EXT_NIRQ IO in IO_CONF9 register,
335 * It is used as the Ethernet controller interrupt 335 * It is used as the Ethernet controller interrupt
336 */ 336 */
337 omap_writel(omap_readl(OMAP730_IO_CONF_9) & 0x1FFFFFFF, OMAP730_IO_CONF_9); 337 omap_writel(omap_readl(OMAP7XX_IO_CONF_9) & 0x1FFFFFFF, OMAP7XX_IO_CONF_9);
338} 338}
339 339
340MACHINE_START(OMAP_FSAMPLE, "OMAP730 F-Sample") 340MACHINE_START(OMAP_FSAMPLE, "OMAP730 F-Sample")
diff --git a/arch/arm/mach-omap1/board-generic.c b/arch/arm/mach-omap1/board-generic.c
index 6c8a41f20e51..e1195a3467b8 100644
--- a/arch/arm/mach-omap1/board-generic.c
+++ b/arch/arm/mach-omap1/board-generic.c
@@ -23,10 +23,10 @@
23#include <asm/mach/map.h> 23#include <asm/mach/map.h>
24 24
25#include <mach/gpio.h> 25#include <mach/gpio.h>
26#include <mach/mux.h> 26#include <plat/mux.h>
27#include <mach/usb.h> 27#include <plat/usb.h>
28#include <mach/board.h> 28#include <plat/board.h>
29#include <mach/common.h> 29#include <plat/common.h>
30 30
31static void __init omap_generic_init_irq(void) 31static void __init omap_generic_init_irq(void)
32{ 32{
diff --git a/arch/arm/mach-omap1/board-h2-mmc.c b/arch/arm/mach-omap1/board-h2-mmc.c
index 46098f546824..b30c4990744d 100644
--- a/arch/arm/mach-omap1/board-h2-mmc.c
+++ b/arch/arm/mach-omap1/board-h2-mmc.c
@@ -16,7 +16,7 @@
16 16
17#include <linux/i2c/tps65010.h> 17#include <linux/i2c/tps65010.h>
18 18
19#include <mach/mmc.h> 19#include <plat/mmc.h>
20#include <mach/gpio.h> 20#include <mach/gpio.h>
21 21
22#include "board-h2.h" 22#include "board-h2.h"
diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c
index aab860307dca..89ba8ec4bbf4 100644
--- a/arch/arm/mach-omap1/board-h2.c
+++ b/arch/arm/mach-omap1/board-h2.c
@@ -37,14 +37,14 @@
37#include <asm/mach/flash.h> 37#include <asm/mach/flash.h>
38#include <asm/mach/map.h> 38#include <asm/mach/map.h>
39 39
40#include <mach/mux.h> 40#include <plat/mux.h>
41#include <mach/dma.h> 41#include <plat/dma.h>
42#include <mach/tc.h> 42#include <plat/tc.h>
43#include <mach/nand.h> 43#include <plat/nand.h>
44#include <mach/irda.h> 44#include <plat/irda.h>
45#include <mach/usb.h> 45#include <plat/usb.h>
46#include <mach/keypad.h> 46#include <plat/keypad.h>
47#include <mach/common.h> 47#include <plat/common.h>
48 48
49#include "board-h2.h" 49#include "board-h2.h"
50 50
diff --git a/arch/arm/mach-omap1/board-h3-mmc.c b/arch/arm/mach-omap1/board-h3-mmc.c
index 5e8877ce35e0..54b0f063e263 100644
--- a/arch/arm/mach-omap1/board-h3-mmc.c
+++ b/arch/arm/mach-omap1/board-h3-mmc.c
@@ -16,7 +16,7 @@
16 16
17#include <linux/i2c/tps65010.h> 17#include <linux/i2c/tps65010.h>
18 18
19#include <mach/mmc.h> 19#include <plat/mmc.h>
20#include <mach/gpio.h> 20#include <mach/gpio.h>
21 21
22#include "board-h3.h" 22#include "board-h3.h"
diff --git a/arch/arm/mach-omap1/board-h3.c b/arch/arm/mach-omap1/board-h3.c
index 89586b80b8d5..f5cc0a730524 100644
--- a/arch/arm/mach-omap1/board-h3.c
+++ b/arch/arm/mach-omap1/board-h3.c
@@ -40,13 +40,13 @@
40#include <asm/mach/map.h> 40#include <asm/mach/map.h>
41 41
42#include <mach/irqs.h> 42#include <mach/irqs.h>
43#include <mach/mux.h> 43#include <plat/mux.h>
44#include <mach/tc.h> 44#include <plat/tc.h>
45#include <mach/nand.h> 45#include <plat/nand.h>
46#include <mach/usb.h> 46#include <plat/usb.h>
47#include <mach/keypad.h> 47#include <plat/keypad.h>
48#include <mach/dma.h> 48#include <plat/dma.h>
49#include <mach/common.h> 49#include <plat/common.h>
50 50
51#include "board-h3.h" 51#include "board-h3.h"
52 52
diff --git a/arch/arm/mach-omap1/board-htcherald.c b/arch/arm/mach-omap1/board-htcherald.c
new file mode 100644
index 000000000000..5f28a5ceacac
--- /dev/null
+++ b/arch/arm/mach-omap1/board-htcherald.c
@@ -0,0 +1,247 @@
1/*
2 * HTC Herald board configuration
3 * Copyright (C) 2009 Cory Maccarrone <darkstar6262@gmail.com>
4 * Copyright (C) 2009 Wing Linux
5 *
6 * Based on the board-htcwizard.c file from the linwizard project:
7 * Copyright (C) 2006 Unai Uribarri
8 * Copyright (C) 2008 linwizard.sourceforge.net
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License as
12 * published by the Free Software Foundation; either version 2 of the
13 * License, or (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23 * 02110-1301, USA.
24 *
25 */
26
27#include <linux/kernel.h>
28#include <linux/init.h>
29#include <linux/platform_device.h>
30#include <linux/input.h>
31#include <linux/bootmem.h>
32#include <linux/io.h>
33#include <linux/gpio.h>
34
35#include <asm/mach-types.h>
36#include <asm/mach/arch.h>
37
38#include <plat/omap7xx.h>
39#include <plat/common.h>
40#include <plat/board.h>
41#include <plat/keypad.h>
42
43#include <mach/irqs.h>
44
45#include <linux/delay.h>
46
47/* LCD register definition */
48#define OMAP_LCDC_CONTROL (0xfffec000 + 0x00)
49#define OMAP_LCDC_STATUS (0xfffec000 + 0x10)
50#define OMAP_DMA_LCD_CCR (0xfffee300 + 0xc2)
51#define OMAP_DMA_LCD_CTRL (0xfffee300 + 0xc4)
52#define OMAP_LCDC_CTRL_LCD_EN (1 << 0)
53#define OMAP_LCDC_STAT_DONE (1 << 0)
54
55static struct omap_lcd_config htcherald_lcd_config __initdata = {
56 .ctrl_name = "internal",
57};
58
59static struct omap_board_config_kernel htcherald_config[] __initdata = {
60 { OMAP_TAG_LCD, &htcherald_lcd_config },
61};
62
63/* Keyboard definition */
64
65static int htc_herald_keymap[] = {
66 KEY(0, 0, KEY_RECORD), /* Mail button */
67 KEY(0, 1, KEY_CAMERA), /* Camera */
68 KEY(0, 2, KEY_PHONE), /* Send key */
69 KEY(0, 3, KEY_VOLUMEUP), /* Volume up */
70 KEY(0, 4, KEY_F2), /* Right bar (landscape) */
71 KEY(0, 5, KEY_MAIL), /* Win key (portrait) */
72 KEY(0, 6, KEY_DIRECTORY), /* Right bar (protrait) */
73 KEY(1, 0, KEY_LEFTCTRL), /* Windows key */
74 KEY(1, 1, KEY_COMMA),
75 KEY(1, 2, KEY_M),
76 KEY(1, 3, KEY_K),
77 KEY(1, 4, KEY_SLASH), /* OK key */
78 KEY(1, 5, KEY_I),
79 KEY(1, 6, KEY_U),
80 KEY(2, 0, KEY_LEFTALT),
81 KEY(2, 1, KEY_TAB),
82 KEY(2, 2, KEY_N),
83 KEY(2, 3, KEY_J),
84 KEY(2, 4, KEY_ENTER),
85 KEY(2, 5, KEY_H),
86 KEY(2, 6, KEY_Y),
87 KEY(3, 0, KEY_SPACE),
88 KEY(3, 1, KEY_L),
89 KEY(3, 2, KEY_B),
90 KEY(3, 3, KEY_V),
91 KEY(3, 4, KEY_BACKSPACE),
92 KEY(3, 5, KEY_G),
93 KEY(3, 6, KEY_T),
94 KEY(4, 0, KEY_CAPSLOCK), /* Shift */
95 KEY(4, 1, KEY_C),
96 KEY(4, 2, KEY_F),
97 KEY(4, 3, KEY_R),
98 KEY(4, 4, KEY_O),
99 KEY(4, 5, KEY_E),
100 KEY(4, 6, KEY_D),
101 KEY(5, 0, KEY_X),
102 KEY(5, 1, KEY_Z),
103 KEY(5, 2, KEY_S),
104 KEY(5, 3, KEY_W),
105 KEY(5, 4, KEY_P),
106 KEY(5, 5, KEY_Q),
107 KEY(5, 6, KEY_A),
108 KEY(6, 0, KEY_CONNECT), /* Voice button */
109 KEY(6, 2, KEY_CANCEL), /* End key */
110 KEY(6, 3, KEY_VOLUMEDOWN), /* Volume down */
111 KEY(6, 4, KEY_F1), /* Left bar (landscape) */
112 KEY(6, 5, KEY_WWW), /* OK button (portrait) */
113 KEY(6, 6, KEY_CALENDAR), /* Left bar (portrait) */
114 0
115};
116
117struct omap_kp_platform_data htcherald_kp_data = {
118 .rows = 7,
119 .cols = 7,
120 .delay = 20,
121 .rep = 1,
122 .keymap = htc_herald_keymap,
123};
124
125static struct resource kp_resources[] = {
126 [0] = {
127 .start = INT_7XX_MPUIO_KEYPAD,
128 .end = INT_7XX_MPUIO_KEYPAD,
129 .flags = IORESOURCE_IRQ,
130 },
131};
132
133static struct platform_device kp_device = {
134 .name = "omap-keypad",
135 .id = -1,
136 .dev = {
137 .platform_data = &htcherald_kp_data,
138 },
139 .num_resources = ARRAY_SIZE(kp_resources),
140 .resource = kp_resources,
141};
142
143/* LCD Device resources */
144static struct platform_device lcd_device = {
145 .name = "lcd_htcherald",
146 .id = -1,
147};
148
149static struct platform_device *devices[] __initdata = {
150 &kp_device,
151 &lcd_device,
152};
153
154/*
155 * Init functions from here on
156 */
157
158static void __init htcherald_lcd_init(void)
159{
160 u32 reg;
161 unsigned int tries = 200;
162
163 /* disable controller if active */
164 reg = omap_readl(OMAP_LCDC_CONTROL);
165 if (reg & OMAP_LCDC_CTRL_LCD_EN) {
166 reg &= ~OMAP_LCDC_CTRL_LCD_EN;
167 omap_writel(reg, OMAP_LCDC_CONTROL);
168
169 /* wait for end of frame */
170 while (!(omap_readl(OMAP_LCDC_STATUS) & OMAP_LCDC_STAT_DONE)) {
171 tries--;
172 if (!tries)
173 break;
174 }
175 if (!tries)
176 printk(KERN_WARNING "Timeout waiting for end of frame "
177 "-- LCD may not be available\n");
178
179 /* turn off DMA */
180 reg = omap_readw(OMAP_DMA_LCD_CCR);
181 reg &= ~(1 << 7);
182 omap_writew(reg, OMAP_DMA_LCD_CCR);
183
184 reg = omap_readw(OMAP_DMA_LCD_CTRL);
185 reg &= ~(1 << 8);
186 omap_writew(reg, OMAP_DMA_LCD_CTRL);
187 }
188}
189
190static void __init htcherald_map_io(void)
191{
192 omap1_map_common_io();
193
194 /*
195 * The LCD panel must be disabled and DMA turned off here, as doing
196 * it later causes the LCD never to reinitialize.
197 */
198 htcherald_lcd_init();
199
200 printk(KERN_INFO "htcherald_map_io done.\n");
201}
202
203static void __init htcherald_disable_watchdog(void)
204{
205 /* Disable watchdog if running */
206 if (omap_readl(OMAP_WDT_TIMER_MODE) & 0x8000) {
207 /*
208 * disable a potentially running watchdog timer before
209 * it kills us.
210 */
211 printk(KERN_WARNING "OMAP850 Watchdog seems to be activated, disabling it for now.\n");
212 omap_writel(0xF5, OMAP_WDT_TIMER_MODE);
213 omap_writel(0xA0, OMAP_WDT_TIMER_MODE);
214 }
215}
216
217static void __init htcherald_init(void)
218{
219 printk(KERN_INFO "HTC Herald init.\n");
220
221 omap_gpio_init();
222
223 omap_board_config = htcherald_config;
224 omap_board_config_size = ARRAY_SIZE(htcherald_config);
225 platform_add_devices(devices, ARRAY_SIZE(devices));
226
227 htcherald_disable_watchdog();
228}
229
230static void __init htcherald_init_irq(void)
231{
232 printk(KERN_INFO "htcherald_init_irq.\n");
233 omap1_init_common_hw();
234 omap_init_irq();
235}
236
237MACHINE_START(HERALD, "HTC Herald")
238 /* Maintainer: Cory Maccarrone <darkstar6262@gmail.com> */
239 /* Maintainer: wing-linux.sourceforge.net */
240 .phys_io = 0xfff00000,
241 .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc,
242 .boot_params = 0x10000100,
243 .map_io = htcherald_map_io,
244 .init_irq = htcherald_init_irq,
245 .init_machine = htcherald_init,
246 .timer = &omap_timer,
247MACHINE_END
diff --git a/arch/arm/mach-omap1/board-innovator.c b/arch/arm/mach-omap1/board-innovator.c
index cd6c39514826..cf0fdb9c182f 100644
--- a/arch/arm/mach-omap1/board-innovator.c
+++ b/arch/arm/mach-omap1/board-innovator.c
@@ -30,14 +30,14 @@
30#include <asm/mach/flash.h> 30#include <asm/mach/flash.h>
31#include <asm/mach/map.h> 31#include <asm/mach/map.h>
32 32
33#include <mach/mux.h> 33#include <plat/mux.h>
34#include <mach/fpga.h> 34#include <plat/fpga.h>
35#include <mach/gpio.h> 35#include <mach/gpio.h>
36#include <mach/tc.h> 36#include <plat/tc.h>
37#include <mach/usb.h> 37#include <plat/usb.h>
38#include <mach/keypad.h> 38#include <plat/keypad.h>
39#include <mach/common.h> 39#include <plat/common.h>
40#include <mach/mmc.h> 40#include <plat/mmc.h>
41 41
42/* At OMAP1610 Innovator the Ethernet is directly connected to CS1 */ 42/* At OMAP1610 Innovator the Ethernet is directly connected to CS1 */
43#define INNOVATOR1610_ETHR_START 0x04000300 43#define INNOVATOR1610_ETHR_START 0x04000300
diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c
index ed2a48a9ce74..5a275bab2dfe 100644
--- a/arch/arm/mach-omap1/board-nokia770.c
+++ b/arch/arm/mach-omap1/board-nokia770.c
@@ -26,17 +26,17 @@
26#include <asm/mach/map.h> 26#include <asm/mach/map.h>
27 27
28#include <mach/gpio.h> 28#include <mach/gpio.h>
29#include <mach/mux.h> 29#include <plat/mux.h>
30#include <mach/usb.h> 30#include <plat/usb.h>
31#include <mach/board.h> 31#include <plat/board.h>
32#include <mach/keypad.h> 32#include <plat/keypad.h>
33#include <mach/common.h> 33#include <plat/common.h>
34#include <mach/dsp_common.h> 34#include <plat/dsp_common.h>
35#include <mach/omapfb.h> 35#include <plat/omapfb.h>
36#include <mach/hwa742.h> 36#include <plat/hwa742.h>
37#include <mach/lcd_mipid.h> 37#include <plat/lcd_mipid.h>
38#include <mach/mmc.h> 38#include <plat/mmc.h>
39#include <mach/clock.h> 39#include <plat/clock.h>
40 40
41#define ADS7846_PENDOWN_GPIO 15 41#define ADS7846_PENDOWN_GPIO 15
42 42
diff --git a/arch/arm/mach-omap1/board-osk.c b/arch/arm/mach-omap1/board-osk.c
index ed891b8a6b15..50c92c13e48a 100644
--- a/arch/arm/mach-omap1/board-osk.c
+++ b/arch/arm/mach-omap1/board-osk.c
@@ -47,10 +47,10 @@
47#include <asm/mach/map.h> 47#include <asm/mach/map.h>
48#include <asm/mach/flash.h> 48#include <asm/mach/flash.h>
49 49
50#include <mach/usb.h> 50#include <plat/usb.h>
51#include <mach/mux.h> 51#include <plat/mux.h>
52#include <mach/tc.h> 52#include <plat/tc.h>
53#include <mach/common.h> 53#include <plat/common.h>
54 54
55/* At OMAP5912 OSK the Ethernet is directly connected to CS1 */ 55/* At OMAP5912 OSK the Ethernet is directly connected to CS1 */
56#define OMAP_OSK_ETHR_START 0x04800300 56#define OMAP_OSK_ETHR_START 0x04800300
@@ -312,7 +312,7 @@ static struct omap_board_config_kernel osk_config[] __initdata = {
312#include <linux/spi/spi.h> 312#include <linux/spi/spi.h>
313#include <linux/spi/ads7846.h> 313#include <linux/spi/ads7846.h>
314 314
315#include <mach/keypad.h> 315#include <plat/keypad.h>
316 316
317static struct at24_platform_data at24c04 = { 317static struct at24_platform_data at24c04 = {
318 .byte_len = SZ_4K / 8, 318 .byte_len = SZ_4K / 8,
diff --git a/arch/arm/mach-omap1/board-palmte.c b/arch/arm/mach-omap1/board-palmte.c
index 4de258420f39..9fe887262bdf 100644
--- a/arch/arm/mach-omap1/board-palmte.c
+++ b/arch/arm/mach-omap1/board-palmte.c
@@ -34,14 +34,14 @@
34#include <asm/mach/flash.h> 34#include <asm/mach/flash.h>
35 35
36#include <mach/gpio.h> 36#include <mach/gpio.h>
37#include <mach/mux.h> 37#include <plat/mux.h>
38#include <mach/usb.h> 38#include <plat/usb.h>
39#include <mach/tc.h> 39#include <plat/tc.h>
40#include <mach/dma.h> 40#include <plat/dma.h>
41#include <mach/board.h> 41#include <plat/board.h>
42#include <mach/irda.h> 42#include <plat/irda.h>
43#include <mach/keypad.h> 43#include <plat/keypad.h>
44#include <mach/common.h> 44#include <plat/common.h>
45 45
46#define PALMTE_USBDETECT_GPIO 0 46#define PALMTE_USBDETECT_GPIO 0
47#define PALMTE_USB_OR_DC_GPIO 1 47#define PALMTE_USB_OR_DC_GPIO 1
diff --git a/arch/arm/mach-omap1/board-palmtt.c b/arch/arm/mach-omap1/board-palmtt.c
index d972cf941b76..af068e3e0fe7 100644
--- a/arch/arm/mach-omap1/board-palmtt.c
+++ b/arch/arm/mach-omap1/board-palmtt.c
@@ -29,16 +29,16 @@
29#include <asm/mach/map.h> 29#include <asm/mach/map.h>
30#include <asm/mach/flash.h> 30#include <asm/mach/flash.h>
31 31
32#include <mach/led.h> 32#include <plat/led.h>
33#include <mach/gpio.h> 33#include <mach/gpio.h>
34#include <mach/mux.h> 34#include <plat/mux.h>
35#include <mach/usb.h> 35#include <plat/usb.h>
36#include <mach/dma.h> 36#include <plat/dma.h>
37#include <mach/tc.h> 37#include <plat/tc.h>
38#include <mach/board.h> 38#include <plat/board.h>
39#include <mach/irda.h> 39#include <plat/irda.h>
40#include <mach/keypad.h> 40#include <plat/keypad.h>
41#include <mach/common.h> 41#include <plat/common.h>
42 42
43#include <linux/spi/spi.h> 43#include <linux/spi/spi.h>
44#include <linux/spi/ads7846.h> 44#include <linux/spi/ads7846.h>
diff --git a/arch/arm/mach-omap1/board-palmz71.c b/arch/arm/mach-omap1/board-palmz71.c
index 986bd4df0e97..c7a3b6f36500 100644
--- a/arch/arm/mach-omap1/board-palmz71.c
+++ b/arch/arm/mach-omap1/board-palmz71.c
@@ -33,15 +33,15 @@
33#include <asm/mach/flash.h> 33#include <asm/mach/flash.h>
34 34
35#include <mach/gpio.h> 35#include <mach/gpio.h>
36#include <mach/mux.h> 36#include <plat/mux.h>
37#include <mach/usb.h> 37#include <plat/usb.h>
38#include <mach/dma.h> 38#include <plat/dma.h>
39#include <mach/tc.h> 39#include <plat/tc.h>
40#include <mach/board.h> 40#include <plat/board.h>
41#include <mach/irda.h> 41#include <plat/irda.h>
42#include <mach/keypad.h> 42#include <plat/keypad.h>
43#include <mach/common.h> 43#include <plat/common.h>
44#include <mach/omap-alsa.h> 44#include <plat/omap-alsa.h>
45 45
46#include <linux/spi/spi.h> 46#include <linux/spi/spi.h>
47#include <linux/spi/ads7846.h> 47#include <linux/spi/ads7846.h>
diff --git a/arch/arm/mach-omap1/board-perseus2.c b/arch/arm/mach-omap1/board-perseus2.c
index 83406699f310..ca7df1e93efc 100644
--- a/arch/arm/mach-omap1/board-perseus2.c
+++ b/arch/arm/mach-omap1/board-perseus2.c
@@ -26,14 +26,14 @@
26#include <asm/mach/flash.h> 26#include <asm/mach/flash.h>
27#include <asm/mach/map.h> 27#include <asm/mach/map.h>
28 28
29#include <mach/tc.h> 29#include <plat/tc.h>
30#include <mach/gpio.h> 30#include <mach/gpio.h>
31#include <mach/mux.h> 31#include <plat/mux.h>
32#include <mach/fpga.h> 32#include <plat/fpga.h>
33#include <mach/nand.h> 33#include <plat/nand.h>
34#include <mach/keypad.h> 34#include <plat/keypad.h>
35#include <mach/common.h> 35#include <plat/common.h>
36#include <mach/board.h> 36#include <plat/board.h>
37 37
38static int p2_keymap[] = { 38static int p2_keymap[] = {
39 KEY(0,0,KEY_UP), 39 KEY(0,0,KEY_UP),
@@ -74,7 +74,7 @@ static struct resource smc91x_resources[] = {
74 .flags = IORESOURCE_MEM, 74 .flags = IORESOURCE_MEM,
75 }, 75 },
76 [1] = { 76 [1] = {
77 .start = INT_730_MPU_EXT_NIRQ, 77 .start = INT_7XX_MPU_EXT_NIRQ,
78 .end = 0, 78 .end = 0,
79 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE, 79 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
80 }, 80 },
@@ -163,8 +163,8 @@ static struct platform_device smc91x_device = {
163 163
164static struct resource kp_resources[] = { 164static struct resource kp_resources[] = {
165 [0] = { 165 [0] = {
166 .start = INT_730_MPUIO_KEYPAD, 166 .start = INT_7XX_MPUIO_KEYPAD,
167 .end = INT_730_MPUIO_KEYPAD, 167 .end = INT_7XX_MPUIO_KEYPAD,
168 .flags = IORESOURCE_IRQ, 168 .flags = IORESOURCE_IRQ,
169 }, 169 },
170}; 170};
@@ -270,7 +270,7 @@ static void __init omap_perseus2_map_io(void)
270 /* 270 /*
271 * Hold GSM Reset until needed 271 * Hold GSM Reset until needed
272 */ 272 */
273 omap_writew(omap_readw(OMAP730_DSP_M_CTL) & ~1, OMAP730_DSP_M_CTL); 273 omap_writew(omap_readw(OMAP7XX_DSP_M_CTL) & ~1, OMAP7XX_DSP_M_CTL);
274 274
275 /* 275 /*
276 * UARTs -> done automagically by 8250 driver 276 * UARTs -> done automagically by 8250 driver
@@ -281,21 +281,21 @@ static void __init omap_perseus2_map_io(void)
281 */ 281 */
282 282
283 /* Flash: CS0 timings setup */ 283 /* Flash: CS0 timings setup */
284 omap_writel(0x0000fff3, OMAP730_FLASH_CFG_0); 284 omap_writel(0x0000fff3, OMAP7XX_FLASH_CFG_0);
285 omap_writel(0x00000088, OMAP730_FLASH_ACFG_0); 285 omap_writel(0x00000088, OMAP7XX_FLASH_ACFG_0);
286 286
287 /* 287 /*
288 * Ethernet support through the debug board 288 * Ethernet support through the debug board
289 * CS1 timings setup 289 * CS1 timings setup
290 */ 290 */
291 omap_writel(0x0000fff3, OMAP730_FLASH_CFG_1); 291 omap_writel(0x0000fff3, OMAP7XX_FLASH_CFG_1);
292 omap_writel(0x00000000, OMAP730_FLASH_ACFG_1); 292 omap_writel(0x00000000, OMAP7XX_FLASH_ACFG_1);
293 293
294 /* 294 /*
295 * Configure MPU_EXT_NIRQ IO in IO_CONF9 register, 295 * Configure MPU_EXT_NIRQ IO in IO_CONF9 register,
296 * It is used as the Ethernet controller interrupt 296 * It is used as the Ethernet controller interrupt
297 */ 297 */
298 omap_writel(omap_readl(OMAP730_IO_CONF_9) & 0x1FFFFFFF, OMAP730_IO_CONF_9); 298 omap_writel(omap_readl(OMAP7XX_IO_CONF_9) & 0x1FFFFFFF, OMAP7XX_IO_CONF_9);
299} 299}
300 300
301MACHINE_START(OMAP_PERSEUS2, "OMAP730 Perseus2") 301MACHINE_START(OMAP_PERSEUS2, "OMAP730 Perseus2")
diff --git a/arch/arm/mach-omap1/board-sx1-mmc.c b/arch/arm/mach-omap1/board-sx1-mmc.c
index 58a46e4e45c3..5b33ae8141bc 100644
--- a/arch/arm/mach-omap1/board-sx1-mmc.c
+++ b/arch/arm/mach-omap1/board-sx1-mmc.c
@@ -15,9 +15,9 @@
15#include <linux/platform_device.h> 15#include <linux/platform_device.h>
16 16
17#include <mach/hardware.h> 17#include <mach/hardware.h>
18#include <mach/mmc.h> 18#include <plat/mmc.h>
19#include <mach/gpio.h> 19#include <mach/gpio.h>
20#include <mach/board-sx1.h> 20#include <plat/board-sx1.h>
21 21
22#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) 22#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE)
23 23
diff --git a/arch/arm/mach-omap1/board-sx1.c b/arch/arm/mach-omap1/board-sx1.c
index 056ae64e0f55..7a97fac83d8d 100644
--- a/arch/arm/mach-omap1/board-sx1.c
+++ b/arch/arm/mach-omap1/board-sx1.c
@@ -33,15 +33,15 @@
33#include <asm/mach/map.h> 33#include <asm/mach/map.h>
34 34
35#include <mach/gpio.h> 35#include <mach/gpio.h>
36#include <mach/mux.h> 36#include <plat/mux.h>
37#include <mach/dma.h> 37#include <plat/dma.h>
38#include <mach/irda.h> 38#include <plat/irda.h>
39#include <mach/usb.h> 39#include <plat/usb.h>
40#include <mach/tc.h> 40#include <plat/tc.h>
41#include <mach/board.h> 41#include <plat/board.h>
42#include <mach/common.h> 42#include <plat/common.h>
43#include <mach/keypad.h> 43#include <plat/keypad.h>
44#include <mach/board-sx1.h> 44#include <plat/board-sx1.h>
45 45
46/* Write to I2C device */ 46/* Write to I2C device */
47int sx1_i2c_write_byte(u8 devaddr, u8 regoffset, u8 value) 47int sx1_i2c_write_byte(u8 devaddr, u8 regoffset, u8 value)
diff --git a/arch/arm/mach-omap1/board-voiceblue.c b/arch/arm/mach-omap1/board-voiceblue.c
index 07b07522d5bf..35c75c1bd0aa 100644
--- a/arch/arm/mach-omap1/board-voiceblue.c
+++ b/arch/arm/mach-omap1/board-voiceblue.c
@@ -29,11 +29,11 @@
29#include <asm/mach/flash.h> 29#include <asm/mach/flash.h>
30#include <asm/mach/map.h> 30#include <asm/mach/map.h>
31 31
32#include <mach/common.h> 32#include <plat/common.h>
33#include <mach/gpio.h> 33#include <mach/gpio.h>
34#include <mach/mux.h> 34#include <plat/mux.h>
35#include <mach/tc.h> 35#include <plat/tc.h>
36#include <mach/usb.h> 36#include <plat/usb.h>
37 37
38static struct plat_serial8250_port voiceblue_ports[] = { 38static struct plat_serial8250_port voiceblue_ports[] = {
39 { 39 {
diff --git a/arch/arm/mach-omap1/clock.c b/arch/arm/mach-omap1/clock.c
index 436eed22801b..42cbe203da36 100644
--- a/arch/arm/mach-omap1/clock.c
+++ b/arch/arm/mach-omap1/clock.c
@@ -22,10 +22,10 @@
22#include <asm/mach-types.h> 22#include <asm/mach-types.h>
23#include <asm/clkdev.h> 23#include <asm/clkdev.h>
24 24
25#include <mach/cpu.h> 25#include <plat/cpu.h>
26#include <mach/usb.h> 26#include <plat/usb.h>
27#include <mach/clock.h> 27#include <plat/clock.h>
28#include <mach/sram.h> 28#include <plat/sram.h>
29 29
30static const struct clkops clkops_generic; 30static const struct clkops clkops_generic;
31static const struct clkops clkops_uart; 31static const struct clkops clkops_uart;
@@ -69,13 +69,13 @@ struct omap_clk {
69 } 69 }
70 70
71#define CK_310 (1 << 0) 71#define CK_310 (1 << 0)
72#define CK_730 (1 << 1) 72#define CK_7XX (1 << 1)
73#define CK_1510 (1 << 2) 73#define CK_1510 (1 << 2)
74#define CK_16XX (1 << 3) 74#define CK_16XX (1 << 3)
75 75
76static struct omap_clk omap_clks[] = { 76static struct omap_clk omap_clks[] = {
77 /* non-ULPD clocks */ 77 /* non-ULPD clocks */
78 CLK(NULL, "ck_ref", &ck_ref, CK_16XX | CK_1510 | CK_310), 78 CLK(NULL, "ck_ref", &ck_ref, CK_16XX | CK_1510 | CK_310 | CK_7XX),
79 CLK(NULL, "ck_dpll1", &ck_dpll1, CK_16XX | CK_1510 | CK_310), 79 CLK(NULL, "ck_dpll1", &ck_dpll1, CK_16XX | CK_1510 | CK_310),
80 /* CK_GEN1 clocks */ 80 /* CK_GEN1 clocks */
81 CLK(NULL, "ck_dpll1out", &ck_dpll1out.clk, CK_16XX), 81 CLK(NULL, "ck_dpll1out", &ck_dpll1out.clk, CK_16XX),
@@ -83,7 +83,7 @@ static struct omap_clk omap_clks[] = {
83 CLK(NULL, "arm_ck", &arm_ck, CK_16XX | CK_1510 | CK_310), 83 CLK(NULL, "arm_ck", &arm_ck, CK_16XX | CK_1510 | CK_310),
84 CLK(NULL, "armper_ck", &armper_ck.clk, CK_16XX | CK_1510 | CK_310), 84 CLK(NULL, "armper_ck", &armper_ck.clk, CK_16XX | CK_1510 | CK_310),
85 CLK(NULL, "arm_gpio_ck", &arm_gpio_ck, CK_1510 | CK_310), 85 CLK(NULL, "arm_gpio_ck", &arm_gpio_ck, CK_1510 | CK_310),
86 CLK(NULL, "armxor_ck", &armxor_ck.clk, CK_16XX | CK_1510 | CK_310), 86 CLK(NULL, "armxor_ck", &armxor_ck.clk, CK_16XX | CK_1510 | CK_310 | CK_7XX),
87 CLK(NULL, "armtim_ck", &armtim_ck.clk, CK_16XX | CK_1510 | CK_310), 87 CLK(NULL, "armtim_ck", &armtim_ck.clk, CK_16XX | CK_1510 | CK_310),
88 CLK("omap_wdt", "fck", &armwdt_ck.clk, CK_16XX | CK_1510 | CK_310), 88 CLK("omap_wdt", "fck", &armwdt_ck.clk, CK_16XX | CK_1510 | CK_310),
89 CLK("omap_wdt", "ick", &armper_ck.clk, CK_16XX), 89 CLK("omap_wdt", "ick", &armper_ck.clk, CK_16XX),
@@ -97,9 +97,9 @@ static struct omap_clk omap_clks[] = {
97 CLK(NULL, "dspxor_ck", &dspxor_ck, CK_16XX | CK_1510 | CK_310), 97 CLK(NULL, "dspxor_ck", &dspxor_ck, CK_16XX | CK_1510 | CK_310),
98 CLK(NULL, "dsptim_ck", &dsptim_ck, CK_16XX | CK_1510 | CK_310), 98 CLK(NULL, "dsptim_ck", &dsptim_ck, CK_16XX | CK_1510 | CK_310),
99 /* CK_GEN3 clocks */ 99 /* CK_GEN3 clocks */
100 CLK(NULL, "tc_ck", &tc_ck.clk, CK_16XX | CK_1510 | CK_310 | CK_730), 100 CLK(NULL, "tc_ck", &tc_ck.clk, CK_16XX | CK_1510 | CK_310 | CK_7XX),
101 CLK(NULL, "tipb_ck", &tipb_ck, CK_1510 | CK_310), 101 CLK(NULL, "tipb_ck", &tipb_ck, CK_1510 | CK_310),
102 CLK(NULL, "l3_ocpi_ck", &l3_ocpi_ck, CK_16XX), 102 CLK(NULL, "l3_ocpi_ck", &l3_ocpi_ck, CK_16XX | CK_7XX),
103 CLK(NULL, "tc1_ck", &tc1_ck, CK_16XX), 103 CLK(NULL, "tc1_ck", &tc1_ck, CK_16XX),
104 CLK(NULL, "tc2_ck", &tc2_ck, CK_16XX), 104 CLK(NULL, "tc2_ck", &tc2_ck, CK_16XX),
105 CLK(NULL, "dma_ck", &dma_ck, CK_16XX | CK_1510 | CK_310), 105 CLK(NULL, "dma_ck", &dma_ck, CK_16XX | CK_1510 | CK_310),
@@ -108,7 +108,7 @@ static struct omap_clk omap_clks[] = {
108 CLK(NULL, "lb_ck", &lb_ck.clk, CK_1510 | CK_310), 108 CLK(NULL, "lb_ck", &lb_ck.clk, CK_1510 | CK_310),
109 CLK(NULL, "rhea1_ck", &rhea1_ck, CK_16XX), 109 CLK(NULL, "rhea1_ck", &rhea1_ck, CK_16XX),
110 CLK(NULL, "rhea2_ck", &rhea2_ck, CK_16XX), 110 CLK(NULL, "rhea2_ck", &rhea2_ck, CK_16XX),
111 CLK(NULL, "lcd_ck", &lcd_ck_16xx, CK_16XX | CK_730), 111 CLK(NULL, "lcd_ck", &lcd_ck_16xx, CK_16XX | CK_7XX),
112 CLK(NULL, "lcd_ck", &lcd_ck_1510.clk, CK_1510 | CK_310), 112 CLK(NULL, "lcd_ck", &lcd_ck_1510.clk, CK_1510 | CK_310),
113 /* ULPD clocks */ 113 /* ULPD clocks */
114 CLK(NULL, "uart1_ck", &uart1_1510, CK_1510 | CK_310), 114 CLK(NULL, "uart1_ck", &uart1_1510, CK_1510 | CK_310),
@@ -120,12 +120,14 @@ static struct omap_clk omap_clks[] = {
120 CLK(NULL, "usb_hhc_ck", &usb_hhc_ck1510, CK_1510 | CK_310), 120 CLK(NULL, "usb_hhc_ck", &usb_hhc_ck1510, CK_1510 | CK_310),
121 CLK(NULL, "usb_hhc_ck", &usb_hhc_ck16xx, CK_16XX), 121 CLK(NULL, "usb_hhc_ck", &usb_hhc_ck16xx, CK_16XX),
122 CLK(NULL, "usb_dc_ck", &usb_dc_ck, CK_16XX), 122 CLK(NULL, "usb_dc_ck", &usb_dc_ck, CK_16XX),
123 CLK(NULL, "usb_dc_ck", &usb_dc_ck7xx, CK_7XX),
123 CLK(NULL, "mclk", &mclk_1510, CK_1510 | CK_310), 124 CLK(NULL, "mclk", &mclk_1510, CK_1510 | CK_310),
124 CLK(NULL, "mclk", &mclk_16xx, CK_16XX), 125 CLK(NULL, "mclk", &mclk_16xx, CK_16XX),
125 CLK(NULL, "bclk", &bclk_1510, CK_1510 | CK_310), 126 CLK(NULL, "bclk", &bclk_1510, CK_1510 | CK_310),
126 CLK(NULL, "bclk", &bclk_16xx, CK_16XX), 127 CLK(NULL, "bclk", &bclk_16xx, CK_16XX),
127 CLK("mmci-omap.0", "fck", &mmc1_ck, CK_16XX | CK_1510 | CK_310), 128 CLK("mmci-omap.0", "fck", &mmc1_ck, CK_16XX | CK_1510 | CK_310),
128 CLK("mmci-omap.0", "ick", &armper_ck.clk, CK_16XX | CK_1510 | CK_310), 129 CLK("mmci-omap.0", "fck", &mmc3_ck, CK_7XX),
130 CLK("mmci-omap.0", "ick", &armper_ck.clk, CK_16XX | CK_1510 | CK_310 | CK_7XX),
129 CLK("mmci-omap.1", "fck", &mmc2_ck, CK_16XX), 131 CLK("mmci-omap.1", "fck", &mmc2_ck, CK_16XX),
130 CLK("mmci-omap.1", "ick", &armper_ck.clk, CK_16XX), 132 CLK("mmci-omap.1", "ick", &armper_ck.clk, CK_16XX),
131 /* Virtual clocks */ 133 /* Virtual clocks */
@@ -398,7 +400,7 @@ static int omap1_select_table_rate(struct clk * clk, unsigned long rate)
398 * Reprogramming the DPLL is tricky, it must be done from SRAM. 400 * Reprogramming the DPLL is tricky, it must be done from SRAM.
399 * (on 730, bit 13 must always be 1) 401 * (on 730, bit 13 must always be 1)
400 */ 402 */
401 if (cpu_is_omap730()) 403 if (cpu_is_omap7xx())
402 omap_sram_reprogram_clock(ptr->dpllctl_val, ptr->ckctl_val | 0x2000); 404 omap_sram_reprogram_clock(ptr->dpllctl_val, ptr->ckctl_val | 0x2000);
403 else 405 else
404 omap_sram_reprogram_clock(ptr->dpllctl_val, ptr->ckctl_val); 406 omap_sram_reprogram_clock(ptr->dpllctl_val, ptr->ckctl_val);
@@ -783,8 +785,8 @@ int __init omap1_clk_init(void)
783 cpu_mask |= CK_16XX; 785 cpu_mask |= CK_16XX;
784 if (cpu_is_omap1510()) 786 if (cpu_is_omap1510())
785 cpu_mask |= CK_1510; 787 cpu_mask |= CK_1510;
786 if (cpu_is_omap730()) 788 if (cpu_is_omap7xx())
787 cpu_mask |= CK_730; 789 cpu_mask |= CK_7XX;
788 if (cpu_is_omap310()) 790 if (cpu_is_omap310())
789 cpu_mask |= CK_310; 791 cpu_mask |= CK_310;
790 792
@@ -800,7 +802,7 @@ int __init omap1_clk_init(void)
800 crystal_type = info->system_clock_type; 802 crystal_type = info->system_clock_type;
801 } 803 }
802 804
803#if defined(CONFIG_ARCH_OMAP730) 805#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
804 ck_ref.rate = 13000000; 806 ck_ref.rate = 13000000;
805#elif defined(CONFIG_ARCH_OMAP16XX) 807#elif defined(CONFIG_ARCH_OMAP16XX)
806 if (crystal_type == 2) 808 if (crystal_type == 2)
@@ -847,7 +849,7 @@ int __init omap1_clk_init(void)
847 printk(KERN_ERR "System frequencies not set. Check your config.\n"); 849 printk(KERN_ERR "System frequencies not set. Check your config.\n");
848 /* Guess sane values (60MHz) */ 850 /* Guess sane values (60MHz) */
849 omap_writew(0x2290, DPLL_CTL); 851 omap_writew(0x2290, DPLL_CTL);
850 omap_writew(cpu_is_omap730() ? 0x3005 : 0x1005, ARM_CKCTL); 852 omap_writew(cpu_is_omap7xx() ? 0x3005 : 0x1005, ARM_CKCTL);
851 ck_dpll1.rate = 60000000; 853 ck_dpll1.rate = 60000000;
852 } 854 }
853#endif 855#endif
@@ -862,7 +864,7 @@ int __init omap1_clk_init(void)
862 864
863#if defined(CONFIG_MACH_OMAP_PERSEUS2) || defined(CONFIG_MACH_OMAP_FSAMPLE) 865#if defined(CONFIG_MACH_OMAP_PERSEUS2) || defined(CONFIG_MACH_OMAP_FSAMPLE)
864 /* Select slicer output as OMAP input clock */ 866 /* Select slicer output as OMAP input clock */
865 omap_writew(omap_readw(OMAP730_PCC_UPLD_CTRL) & ~0x1, OMAP730_PCC_UPLD_CTRL); 867 omap_writew(omap_readw(OMAP7XX_PCC_UPLD_CTRL) & ~0x1, OMAP7XX_PCC_UPLD_CTRL);
866#endif 868#endif
867 869
868 /* Amstrad Delta wants BCLK high when inactive */ 870 /* Amstrad Delta wants BCLK high when inactive */
@@ -873,7 +875,7 @@ int __init omap1_clk_init(void)
873 875
874 /* Turn off DSP and ARM_TIMXO. Make sure ARM_INTHCK is not divided */ 876 /* Turn off DSP and ARM_TIMXO. Make sure ARM_INTHCK is not divided */
875 /* (on 730, bit 13 must not be cleared) */ 877 /* (on 730, bit 13 must not be cleared) */
876 if (cpu_is_omap730()) 878 if (cpu_is_omap7xx())
877 omap_writew(omap_readw(ARM_CKCTL) & 0x2fff, ARM_CKCTL); 879 omap_writew(omap_readw(ARM_CKCTL) & 0x2fff, ARM_CKCTL);
878 else 880 else
879 omap_writew(omap_readw(ARM_CKCTL) & 0x0fff, ARM_CKCTL); 881 omap_writew(omap_readw(ARM_CKCTL) & 0x0fff, ARM_CKCTL);
diff --git a/arch/arm/mach-omap1/clock.h b/arch/arm/mach-omap1/clock.h
index 17f874271255..29ffa97dc7f3 100644
--- a/arch/arm/mach-omap1/clock.h
+++ b/arch/arm/mach-omap1/clock.h
@@ -574,6 +574,16 @@ static struct clk usb_dc_ck = {
574 .enable_bit = 4, 574 .enable_bit = 4,
575}; 575};
576 576
577static struct clk usb_dc_ck7xx = {
578 .name = "usb_dc_ck",
579 .ops = &clkops_generic,
580 /* Direct from ULPD, no parent */
581 .rate = 48000000,
582 .flags = RATE_FIXED,
583 .enable_reg = OMAP1_IO_ADDRESS(SOFT_REQ_REG),
584 .enable_bit = 8,
585};
586
577static struct clk mclk_1510 = { 587static struct clk mclk_1510 = {
578 .name = "mclk", 588 .name = "mclk",
579 .ops = &clkops_generic, 589 .ops = &clkops_generic,
@@ -637,6 +647,18 @@ static struct clk mmc2_ck = {
637 .enable_bit = 20, 647 .enable_bit = 20,
638}; 648};
639 649
650static struct clk mmc3_ck = {
651 .name = "mmc_ck",
652 .id = 2,
653 .ops = &clkops_generic,
654 /* Functional clock is direct from ULPD, interface clock is ARMPER */
655 .parent = &armper_ck.clk,
656 .rate = 48000000,
657 .flags = RATE_FIXED | ENABLE_REG_32BIT | CLOCK_NO_IDLE_PARENT,
658 .enable_reg = OMAP1_IO_ADDRESS(SOFT_REQ_REG),
659 .enable_bit = 12,
660};
661
640static struct clk virtual_ck_mpu = { 662static struct clk virtual_ck_mpu = {
641 .name = "mpu", 663 .name = "mpu",
642 .ops = &clkops_null, 664 .ops = &clkops_null,
diff --git a/arch/arm/mach-omap1/devices.c b/arch/arm/mach-omap1/devices.c
index 06808434ea04..23ded2d49600 100644
--- a/arch/arm/mach-omap1/devices.c
+++ b/arch/arm/mach-omap1/devices.c
@@ -18,11 +18,11 @@
18#include <mach/hardware.h> 18#include <mach/hardware.h>
19#include <asm/mach/map.h> 19#include <asm/mach/map.h>
20 20
21#include <mach/tc.h> 21#include <plat/tc.h>
22#include <mach/board.h> 22#include <plat/board.h>
23#include <mach/mux.h> 23#include <plat/mux.h>
24#include <mach/gpio.h> 24#include <mach/gpio.h>
25#include <mach/mmc.h> 25#include <plat/mmc.h>
26 26
27/*-------------------------------------------------------------------------*/ 27/*-------------------------------------------------------------------------*/
28 28
@@ -108,15 +108,22 @@ static inline void omap1_mmc_mux(struct omap_mmc_platform_data *mmc_controller,
108 int controller_nr) 108 int controller_nr)
109{ 109{
110 if (controller_nr == 0) { 110 if (controller_nr == 0) {
111 omap_cfg_reg(MMC_CMD); 111 if (cpu_is_omap7xx()) {
112 omap_cfg_reg(MMC_CLK); 112 omap_cfg_reg(MMC_7XX_CMD);
113 omap_cfg_reg(MMC_DAT0); 113 omap_cfg_reg(MMC_7XX_CLK);
114 omap_cfg_reg(MMC_7XX_DAT0);
115 } else {
116 omap_cfg_reg(MMC_CMD);
117 omap_cfg_reg(MMC_CLK);
118 omap_cfg_reg(MMC_DAT0);
119 }
120
114 if (cpu_is_omap1710()) { 121 if (cpu_is_omap1710()) {
115 omap_cfg_reg(M15_1710_MMC_CLKI); 122 omap_cfg_reg(M15_1710_MMC_CLKI);
116 omap_cfg_reg(P19_1710_MMC_CMDDIR); 123 omap_cfg_reg(P19_1710_MMC_CMDDIR);
117 omap_cfg_reg(P20_1710_MMC_DATDIR0); 124 omap_cfg_reg(P20_1710_MMC_DATDIR0);
118 } 125 }
119 if (mmc_controller->slots[0].wires == 4) { 126 if (mmc_controller->slots[0].wires == 4 && !cpu_is_omap7xx()) {
120 omap_cfg_reg(MMC_DAT1); 127 omap_cfg_reg(MMC_DAT1);
121 /* NOTE: DAT2 can be on W10 (here) or M15 */ 128 /* NOTE: DAT2 can be on W10 (here) or M15 */
122 if (!mmc_controller->slots[0].nomux) 129 if (!mmc_controller->slots[0].nomux)
diff --git a/arch/arm/mach-omap1/fpga.c b/arch/arm/mach-omap1/fpga.c
index 4f2b8a7adb19..5cfce1636da0 100644
--- a/arch/arm/mach-omap1/fpga.c
+++ b/arch/arm/mach-omap1/fpga.c
@@ -27,7 +27,7 @@
27#include <asm/irq.h> 27#include <asm/irq.h>
28#include <asm/mach/irq.h> 28#include <asm/mach/irq.h>
29 29
30#include <mach/fpga.h> 30#include <plat/fpga.h>
31#include <mach/gpio.h> 31#include <mach/gpio.h>
32 32
33static void fpga_mask_irq(unsigned int irq) 33static void fpga_mask_irq(unsigned int irq)
diff --git a/arch/arm/mach-omap1/id.c b/arch/arm/mach-omap1/id.c
index e5dcdf764c91..a0e3560b39db 100644
--- a/arch/arm/mach-omap1/id.c
+++ b/arch/arm/mach-omap1/id.c
@@ -15,7 +15,7 @@
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/io.h> 17#include <linux/io.h>
18#include <mach/cpu.h> 18#include <plat/cpu.h>
19 19
20#define OMAP_DIE_ID_0 0xfffe1800 20#define OMAP_DIE_ID_0 0xfffe1800
21#define OMAP_DIE_ID_1 0xfffe1804 21#define OMAP_DIE_ID_1 0xfffe1804
diff --git a/arch/arm/mach-omap1/include/mach/clkdev.h b/arch/arm/mach-omap1/include/mach/clkdev.h
new file mode 100644
index 000000000000..ea8640e4603e
--- /dev/null
+++ b/arch/arm/mach-omap1/include/mach/clkdev.h
@@ -0,0 +1,5 @@
1/*
2 * arch/arm/mach-omap1/include/mach/clkdev.h
3 */
4
5#include <plat/clkdev.h>
diff --git a/arch/arm/mach-omap1/include/mach/debug-macro.S b/arch/arm/mach-omap1/include/mach/debug-macro.S
new file mode 100644
index 000000000000..aedb746fc33c
--- /dev/null
+++ b/arch/arm/mach-omap1/include/mach/debug-macro.S
@@ -0,0 +1,45 @@
1/* arch/arm/mach-omap1/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 .macro addruart,rx
15 mrc p15, 0, \rx, c1, c0
16 tst \rx, #1 @ MMU enabled?
17 moveq \rx, #0xff000000 @ physical base address
18 movne \rx, #0xfe000000 @ virtual base
19 orr \rx, \rx, #0x00fb0000
20#ifdef CONFIG_OMAP_LL_DEBUG_UART3
21 orr \rx, \rx, #0x00009000 @ UART 3
22#endif
23#if defined(CONFIG_OMAP_LL_DEBUG_UART2) || defined(CONFIG_OMAP_LL_DEBUG_UART3)
24 orr \rx, \rx, #0x00000800 @ UART 2 & 3
25#endif
26 .endm
27
28 .macro senduart,rd,rx
29 strb \rd, [\rx]
30 .endm
31
32 .macro busyuart,rd,rx
331001: ldrb \rd, [\rx, #(0x5 << 2)] @ OMAP-1510 and friends
34 and \rd, \rd, #0x60
35 teq \rd, #0x60
36 beq 1002f
37 ldrb \rd, [\rx, #(0x5 << 0)] @ OMAP-730 only
38 and \rd, \rd, #0x60
39 teq \rd, #0x60
40 bne 1001b
411002:
42 .endm
43
44 .macro waituart,rd,rx
45 .endm
diff --git a/arch/arm/mach-omap1/include/mach/entry-macro.S b/arch/arm/mach-omap1/include/mach/entry-macro.S
new file mode 100644
index 000000000000..df9060edda28
--- /dev/null
+++ b/arch/arm/mach-omap1/include/mach/entry-macro.S
@@ -0,0 +1,58 @@
1/*
2 * arch/arm/mach-omap1/include/mach/entry-macro.S
3 *
4 * Low-level IRQ helper macros for OMAP-based platforms
5 *
6 * Copyright (C) 2009 Texas Instruments
7 *
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
11 */
12#include <mach/hardware.h>
13#include <mach/io.h>
14#include <mach/irqs.h>
15#include <asm/hardware/gic.h>
16
17#if (defined(CONFIG_ARCH_OMAP730)||defined(CONFIG_ARCH_OMAP850)) && \
18 (defined(CONFIG_ARCH_OMAP15XX) || defined(CONFIG_ARCH_OMAP16XX))
19#error "FIXME: OMAP7XX doesn't support multiple-OMAP"
20#elif defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
21#define INT_IH2_IRQ INT_7XX_IH2_IRQ
22#elif defined(CONFIG_ARCH_OMAP15XX)
23#define INT_IH2_IRQ INT_1510_IH2_IRQ
24#elif defined(CONFIG_ARCH_OMAP16XX)
25#define INT_IH2_IRQ INT_1610_IH2_IRQ
26#else
27#warning "IH2 IRQ defaulted"
28#define INT_IH2_IRQ INT_1510_IH2_IRQ
29#endif
30
31 .macro disable_fiq
32 .endm
33
34 .macro get_irqnr_preamble, base, tmp
35 .endm
36
37 .macro arch_ret_to_user, tmp1, tmp2
38 .endm
39
40 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
41 ldr \base, =OMAP1_IO_ADDRESS(OMAP_IH1_BASE)
42 ldr \irqnr, [\base, #IRQ_ITR_REG_OFFSET]
43 ldr \tmp, [\base, #IRQ_MIR_REG_OFFSET]
44 mov \irqstat, #0xffffffff
45 bic \tmp, \irqstat, \tmp
46 tst \irqnr, \tmp
47 beq 1510f
48
49 ldr \irqnr, [\base, #IRQ_SIR_FIQ_REG_OFFSET]
50 cmp \irqnr, #0
51 ldreq \irqnr, [\base, #IRQ_SIR_IRQ_REG_OFFSET]
52 cmpeq \irqnr, #INT_IH2_IRQ
53 ldreq \base, =OMAP1_IO_ADDRESS(OMAP_IH2_BASE)
54 ldreq \irqnr, [\base, #IRQ_SIR_IRQ_REG_OFFSET]
55 addeqs \irqnr, \irqnr, #32
561510:
57 .endm
58
diff --git a/arch/arm/mach-omap1/include/mach/gpio.h b/arch/arm/mach-omap1/include/mach/gpio.h
new file mode 100644
index 000000000000..e737706a8fe1
--- /dev/null
+++ b/arch/arm/mach-omap1/include/mach/gpio.h
@@ -0,0 +1,5 @@
1/*
2 * arch/arm/mach-omap1/include/mach/gpio.h
3 */
4
5#include <plat/gpio.h>
diff --git a/arch/arm/mach-omap1/include/mach/hardware.h b/arch/arm/mach-omap1/include/mach/hardware.h
new file mode 100644
index 000000000000..a3f6287b2007
--- /dev/null
+++ b/arch/arm/mach-omap1/include/mach/hardware.h
@@ -0,0 +1,5 @@
1/*
2 * arch/arm/mach-omap1/include/mach/hardware.h
3 */
4
5#include <plat/hardware.h>
diff --git a/arch/arm/mach-omap1/include/mach/io.h b/arch/arm/mach-omap1/include/mach/io.h
new file mode 100644
index 000000000000..57bdf74a3e64
--- /dev/null
+++ b/arch/arm/mach-omap1/include/mach/io.h
@@ -0,0 +1,5 @@
1/*
2 * arch/arm/mach-omap1/include/mach/io.h
3 */
4
5#include <plat/io.h>
diff --git a/arch/arm/mach-omap1/include/mach/irqs.h b/arch/arm/mach-omap1/include/mach/irqs.h
new file mode 100644
index 000000000000..9292fdc1cb0b
--- /dev/null
+++ b/arch/arm/mach-omap1/include/mach/irqs.h
@@ -0,0 +1,5 @@
1/*
2 * arch/arm/mach-omap1/include/mach/irqs.h
3 */
4
5#include <plat/irqs.h>
diff --git a/arch/arm/mach-omap1/include/mach/memory.h b/arch/arm/mach-omap1/include/mach/memory.h
new file mode 100644
index 000000000000..e9b600c113ef
--- /dev/null
+++ b/arch/arm/mach-omap1/include/mach/memory.h
@@ -0,0 +1,5 @@
1/*
2 * arch/arm/mach-omap1/include/mach/memory.h
3 */
4
5#include <plat/memory.h>
diff --git a/arch/arm/plat-omap/include/mach/mtd-xip.h b/arch/arm/mach-omap1/include/mach/mtd-xip.h
index f82a8dcaad94..f82a8dcaad94 100644
--- a/arch/arm/plat-omap/include/mach/mtd-xip.h
+++ b/arch/arm/mach-omap1/include/mach/mtd-xip.h
diff --git a/arch/arm/mach-omap1/include/mach/smp.h b/arch/arm/mach-omap1/include/mach/smp.h
new file mode 100644
index 000000000000..80a371c06e59
--- /dev/null
+++ b/arch/arm/mach-omap1/include/mach/smp.h
@@ -0,0 +1,5 @@
1/*
2 * arch/arm/mach-omap1/include/mach/smp.h
3 */
4
5#include <plat/smp.h>
diff --git a/arch/arm/mach-omap1/include/mach/system.h b/arch/arm/mach-omap1/include/mach/system.h
new file mode 100644
index 000000000000..a6c1b3a16dfc
--- /dev/null
+++ b/arch/arm/mach-omap1/include/mach/system.h
@@ -0,0 +1,5 @@
1/*
2 * arch/arm/mach-omap1/include/mach/system.h
3 */
4
5#include <plat/system.h>
diff --git a/arch/arm/mach-omap1/include/mach/timex.h b/arch/arm/mach-omap1/include/mach/timex.h
new file mode 100644
index 000000000000..4793790d53cc
--- /dev/null
+++ b/arch/arm/mach-omap1/include/mach/timex.h
@@ -0,0 +1,5 @@
1/*
2 * arch/arm/mach-omap1/include/mach/timex.h
3 */
4
5#include <plat/timex.h>
diff --git a/arch/arm/mach-omap1/include/mach/uncompress.h b/arch/arm/mach-omap1/include/mach/uncompress.h
new file mode 100644
index 000000000000..0ff22dc075c7
--- /dev/null
+++ b/arch/arm/mach-omap1/include/mach/uncompress.h
@@ -0,0 +1,5 @@
1/*
2 * arch/arm/mach-omap1/include/mach/uncompress.h
3 */
4
5#include <plat/uncompress.h>
diff --git a/arch/arm/mach-omap1/include/mach/vmalloc.h b/arch/arm/mach-omap1/include/mach/vmalloc.h
new file mode 100644
index 000000000000..1b2af14df151
--- /dev/null
+++ b/arch/arm/mach-omap1/include/mach/vmalloc.h
@@ -0,0 +1,20 @@
1/*
2 * arch/arm/mach-omap1/include/mach/vmalloc.h
3 *
4 * Copyright (C) 2000 Russell King.
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 as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#define VMALLOC_END (PAGE_OFFSET + 0x18000000)
diff --git a/arch/arm/mach-omap1/io.c b/arch/arm/mach-omap1/io.c
index 7030f9281ea1..2a6d68aa3489 100644
--- a/arch/arm/mach-omap1/io.c
+++ b/arch/arm/mach-omap1/io.c
@@ -15,8 +15,8 @@
15 15
16#include <asm/tlb.h> 16#include <asm/tlb.h>
17#include <asm/mach/map.h> 17#include <asm/mach/map.h>
18#include <mach/mux.h> 18#include <plat/mux.h>
19#include <mach/tc.h> 19#include <plat/tc.h>
20 20
21extern int omap1_clk_init(void); 21extern int omap1_clk_init(void);
22extern void omap_check_revision(void); 22extern void omap_check_revision(void);
@@ -36,33 +36,17 @@ static struct map_desc omap_io_desc[] __initdata = {
36 } 36 }
37}; 37};
38 38
39#ifdef CONFIG_ARCH_OMAP730 39#if defined (CONFIG_ARCH_OMAP730) || defined (CONFIG_ARCH_OMAP850)
40static struct map_desc omap730_io_desc[] __initdata = { 40static struct map_desc omap7xx_io_desc[] __initdata = {
41 { 41 {
42 .virtual = OMAP730_DSP_BASE, 42 .virtual = OMAP7XX_DSP_BASE,
43 .pfn = __phys_to_pfn(OMAP730_DSP_START), 43 .pfn = __phys_to_pfn(OMAP7XX_DSP_START),
44 .length = OMAP730_DSP_SIZE, 44 .length = OMAP7XX_DSP_SIZE,
45 .type = MT_DEVICE 45 .type = MT_DEVICE
46 }, { 46 }, {
47 .virtual = OMAP730_DSPREG_BASE, 47 .virtual = OMAP7XX_DSPREG_BASE,
48 .pfn = __phys_to_pfn(OMAP730_DSPREG_START), 48 .pfn = __phys_to_pfn(OMAP7XX_DSPREG_START),
49 .length = OMAP730_DSPREG_SIZE, 49 .length = OMAP7XX_DSPREG_SIZE,
50 .type = MT_DEVICE
51 }
52};
53#endif
54
55#ifdef CONFIG_ARCH_OMAP850
56static struct map_desc omap850_io_desc[] __initdata = {
57 {
58 .virtual = OMAP850_DSP_BASE,
59 .pfn = __phys_to_pfn(OMAP850_DSP_START),
60 .length = OMAP850_DSP_SIZE,
61 .type = MT_DEVICE
62 }, {
63 .virtual = OMAP850_DSPREG_BASE,
64 .pfn = __phys_to_pfn(OMAP850_DSPREG_START),
65 .length = OMAP850_DSPREG_SIZE,
66 .type = MT_DEVICE 50 .type = MT_DEVICE
67 } 51 }
68}; 52};
@@ -120,18 +104,11 @@ void __init omap1_map_common_io(void)
120 */ 104 */
121 omap_check_revision(); 105 omap_check_revision();
122 106
123#ifdef CONFIG_ARCH_OMAP730 107#if defined (CONFIG_ARCH_OMAP730) || defined (CONFIG_ARCH_OMAP850)
124 if (cpu_is_omap730()) { 108 if (cpu_is_omap7xx()) {
125 iotable_init(omap730_io_desc, ARRAY_SIZE(omap730_io_desc)); 109 iotable_init(omap7xx_io_desc, ARRAY_SIZE(omap7xx_io_desc));
126 }
127#endif
128
129#ifdef CONFIG_ARCH_OMAP850
130 if (cpu_is_omap850()) {
131 iotable_init(omap850_io_desc, ARRAY_SIZE(omap850_io_desc));
132 } 110 }
133#endif 111#endif
134
135#ifdef CONFIG_ARCH_OMAP15XX 112#ifdef CONFIG_ARCH_OMAP15XX
136 if (cpu_is_omap15xx()) { 113 if (cpu_is_omap15xx()) {
137 iotable_init(omap1510_io_desc, ARRAY_SIZE(omap1510_io_desc)); 114 iotable_init(omap1510_io_desc, ARRAY_SIZE(omap1510_io_desc));
diff --git a/arch/arm/mach-omap1/irq.c b/arch/arm/mach-omap1/irq.c
index de03c8448994..db913c34d1fe 100644
--- a/arch/arm/mach-omap1/irq.c
+++ b/arch/arm/mach-omap1/irq.c
@@ -46,7 +46,7 @@
46#include <asm/irq.h> 46#include <asm/irq.h>
47#include <asm/mach/irq.h> 47#include <asm/mach/irq.h>
48#include <mach/gpio.h> 48#include <mach/gpio.h>
49#include <mach/cpu.h> 49#include <plat/cpu.h>
50 50
51#define IRQ_BANK(irq) ((irq) >> 5) 51#define IRQ_BANK(irq) ((irq) >> 5)
52#define IRQ_BIT(irq) ((irq) & 0x1f) 52#define IRQ_BIT(irq) ((irq) & 0x1f)
@@ -137,16 +137,8 @@ static void omap_irq_set_cfg(int irq, int fiq, int priority, int trigger)
137 irq_bank_writel(val, bank, offset); 137 irq_bank_writel(val, bank, offset);
138} 138}
139 139
140#ifdef CONFIG_ARCH_OMAP730 140#if defined (CONFIG_ARCH_OMAP730) || defined (CONFIG_ARCH_OMAP850)
141static struct omap_irq_bank omap730_irq_banks[] = { 141static struct omap_irq_bank omap7xx_irq_banks[] = {
142 { .base_reg = OMAP_IH1_BASE, .trigger_map = 0xb3f8e22f },
143 { .base_reg = OMAP_IH2_BASE, .trigger_map = 0xfdb9c1f2 },
144 { .base_reg = OMAP_IH2_BASE + 0x100, .trigger_map = 0x800040f3 },
145};
146#endif
147
148#ifdef CONFIG_ARCH_OMAP850
149static struct omap_irq_bank omap850_irq_banks[] = {
150 { .base_reg = OMAP_IH1_BASE, .trigger_map = 0xb3f8e22f }, 142 { .base_reg = OMAP_IH1_BASE, .trigger_map = 0xb3f8e22f },
151 { .base_reg = OMAP_IH2_BASE, .trigger_map = 0xfdb9c1f2 }, 143 { .base_reg = OMAP_IH2_BASE, .trigger_map = 0xfdb9c1f2 },
152 { .base_reg = OMAP_IH2_BASE + 0x100, .trigger_map = 0x800040f3 }, 144 { .base_reg = OMAP_IH2_BASE + 0x100, .trigger_map = 0x800040f3 },
@@ -186,16 +178,10 @@ void __init omap_init_irq(void)
186{ 178{
187 int i, j; 179 int i, j;
188 180
189#ifdef CONFIG_ARCH_OMAP730 181#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
190 if (cpu_is_omap730()) { 182 if (cpu_is_omap7xx()) {
191 irq_banks = omap730_irq_banks; 183 irq_banks = omap7xx_irq_banks;
192 irq_bank_count = ARRAY_SIZE(omap730_irq_banks); 184 irq_bank_count = ARRAY_SIZE(omap7xx_irq_banks);
193 }
194#endif
195#ifdef CONFIG_ARCH_OMAP850
196 if (cpu_is_omap850()) {
197 irq_banks = omap850_irq_banks;
198 irq_bank_count = ARRAY_SIZE(omap850_irq_banks);
199 } 185 }
200#endif 186#endif
201#ifdef CONFIG_ARCH_OMAP15XX 187#ifdef CONFIG_ARCH_OMAP15XX
@@ -247,10 +233,8 @@ void __init omap_init_irq(void)
247 233
248 /* Unmask level 2 handler */ 234 /* Unmask level 2 handler */
249 235
250 if (cpu_is_omap730()) 236 if (cpu_is_omap7xx())
251 omap_unmask_irq(INT_730_IH2_IRQ); 237 omap_unmask_irq(INT_7XX_IH2_IRQ);
252 else if (cpu_is_omap850())
253 omap_unmask_irq(INT_850_IH2_IRQ);
254 else if (cpu_is_omap15xx()) 238 else if (cpu_is_omap15xx())
255 omap_unmask_irq(INT_1510_IH2_IRQ); 239 omap_unmask_irq(INT_1510_IH2_IRQ);
256 else if (cpu_is_omap16xx()) 240 else if (cpu_is_omap16xx())
diff --git a/arch/arm/mach-omap1/leds-h2p2-debug.c b/arch/arm/mach-omap1/leds-h2p2-debug.c
index 17c9d0e04216..b4f9be52e1e8 100644
--- a/arch/arm/mach-omap1/leds-h2p2-debug.c
+++ b/arch/arm/mach-omap1/leds-h2p2-debug.c
@@ -19,7 +19,7 @@
19#include <asm/system.h> 19#include <asm/system.h>
20#include <asm/mach-types.h> 20#include <asm/mach-types.h>
21 21
22#include <mach/fpga.h> 22#include <plat/fpga.h>
23#include <mach/gpio.h> 23#include <mach/gpio.h>
24 24
25#include "leds.h" 25#include "leds.h"
diff --git a/arch/arm/mach-omap1/leds.c b/arch/arm/mach-omap1/leds.c
index 8cbf2562dcaa..277f356d4cd0 100644
--- a/arch/arm/mach-omap1/leds.c
+++ b/arch/arm/mach-omap1/leds.c
@@ -10,7 +10,7 @@
10#include <asm/mach-types.h> 10#include <asm/mach-types.h>
11 11
12#include <mach/gpio.h> 12#include <mach/gpio.h>
13#include <mach/mux.h> 13#include <plat/mux.h>
14 14
15#include "leds.h" 15#include "leds.h"
16 16
diff --git a/arch/arm/mach-omap1/mailbox.c b/arch/arm/mach-omap1/mailbox.c
index 6810b4aeb02c..caf889aaa248 100644
--- a/arch/arm/mach-omap1/mailbox.c
+++ b/arch/arm/mach-omap1/mailbox.c
@@ -14,7 +14,7 @@
14#include <linux/interrupt.h> 14#include <linux/interrupt.h>
15#include <linux/platform_device.h> 15#include <linux/platform_device.h>
16#include <linux/io.h> 16#include <linux/io.h>
17#include <mach/mailbox.h> 17#include <plat/mailbox.h>
18#include <mach/irqs.h> 18#include <mach/irqs.h>
19 19
20#define MAILBOX_ARM2DSP1 0x00 20#define MAILBOX_ARM2DSP1 0x00
diff --git a/arch/arm/mach-omap1/mcbsp.c b/arch/arm/mach-omap1/mcbsp.c
index 505d98cfe508..6bddce104ee9 100644
--- a/arch/arm/mach-omap1/mcbsp.c
+++ b/arch/arm/mach-omap1/mcbsp.c
@@ -18,11 +18,11 @@
18#include <linux/platform_device.h> 18#include <linux/platform_device.h>
19 19
20#include <mach/irqs.h> 20#include <mach/irqs.h>
21#include <mach/dma.h> 21#include <plat/dma.h>
22#include <mach/mux.h> 22#include <plat/mux.h>
23#include <mach/cpu.h> 23#include <plat/cpu.h>
24#include <mach/mcbsp.h> 24#include <plat/mcbsp.h>
25#include <mach/dsp_common.h> 25#include <plat/dsp_common.h>
26 26
27#define DPS_RSTCT2_PER_EN (1 << 0) 27#define DPS_RSTCT2_PER_EN (1 << 0)
28#define DSP_RSTCT2_WD_PER_EN (1 << 1) 28#define DSP_RSTCT2_WD_PER_EN (1 << 1)
@@ -79,29 +79,29 @@ static struct omap_mcbsp_ops omap1_mcbsp_ops = {
79 .free = omap1_mcbsp_free, 79 .free = omap1_mcbsp_free,
80}; 80};
81 81
82#ifdef CONFIG_ARCH_OMAP730 82#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
83static struct omap_mcbsp_platform_data omap730_mcbsp_pdata[] = { 83static struct omap_mcbsp_platform_data omap7xx_mcbsp_pdata[] = {
84 { 84 {
85 .phys_base = OMAP730_MCBSP1_BASE, 85 .phys_base = OMAP7XX_MCBSP1_BASE,
86 .dma_rx_sync = OMAP_DMA_MCBSP1_RX, 86 .dma_rx_sync = OMAP_DMA_MCBSP1_RX,
87 .dma_tx_sync = OMAP_DMA_MCBSP1_TX, 87 .dma_tx_sync = OMAP_DMA_MCBSP1_TX,
88 .rx_irq = INT_730_McBSP1RX, 88 .rx_irq = INT_7XX_McBSP1RX,
89 .tx_irq = INT_730_McBSP1TX, 89 .tx_irq = INT_7XX_McBSP1TX,
90 .ops = &omap1_mcbsp_ops, 90 .ops = &omap1_mcbsp_ops,
91 }, 91 },
92 { 92 {
93 .phys_base = OMAP730_MCBSP2_BASE, 93 .phys_base = OMAP7XX_MCBSP2_BASE,
94 .dma_rx_sync = OMAP_DMA_MCBSP3_RX, 94 .dma_rx_sync = OMAP_DMA_MCBSP3_RX,
95 .dma_tx_sync = OMAP_DMA_MCBSP3_TX, 95 .dma_tx_sync = OMAP_DMA_MCBSP3_TX,
96 .rx_irq = INT_730_McBSP2RX, 96 .rx_irq = INT_7XX_McBSP2RX,
97 .tx_irq = INT_730_McBSP2TX, 97 .tx_irq = INT_7XX_McBSP2TX,
98 .ops = &omap1_mcbsp_ops, 98 .ops = &omap1_mcbsp_ops,
99 }, 99 },
100}; 100};
101#define OMAP730_MCBSP_PDATA_SZ ARRAY_SIZE(omap730_mcbsp_pdata) 101#define OMAP7XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap7xx_mcbsp_pdata)
102#else 102#else
103#define omap730_mcbsp_pdata NULL 103#define omap7xx_mcbsp_pdata NULL
104#define OMAP730_MCBSP_PDATA_SZ 0 104#define OMAP7XX_MCBSP_PDATA_SZ 0
105#endif 105#endif
106 106
107#ifdef CONFIG_ARCH_OMAP15XX 107#ifdef CONFIG_ARCH_OMAP15XX
@@ -172,8 +172,8 @@ static struct omap_mcbsp_platform_data omap16xx_mcbsp_pdata[] = {
172 172
173int __init omap1_mcbsp_init(void) 173int __init omap1_mcbsp_init(void)
174{ 174{
175 if (cpu_is_omap730()) 175 if (cpu_is_omap7xx())
176 omap_mcbsp_count = OMAP730_MCBSP_PDATA_SZ; 176 omap_mcbsp_count = OMAP7XX_MCBSP_PDATA_SZ;
177 if (cpu_is_omap15xx()) 177 if (cpu_is_omap15xx())
178 omap_mcbsp_count = OMAP15XX_MCBSP_PDATA_SZ; 178 omap_mcbsp_count = OMAP15XX_MCBSP_PDATA_SZ;
179 if (cpu_is_omap16xx()) 179 if (cpu_is_omap16xx())
@@ -184,9 +184,9 @@ int __init omap1_mcbsp_init(void)
184 if (!mcbsp_ptr) 184 if (!mcbsp_ptr)
185 return -ENOMEM; 185 return -ENOMEM;
186 186
187 if (cpu_is_omap730()) 187 if (cpu_is_omap7xx())
188 omap_mcbsp_register_board_cfg(omap730_mcbsp_pdata, 188 omap_mcbsp_register_board_cfg(omap7xx_mcbsp_pdata,
189 OMAP730_MCBSP_PDATA_SZ); 189 OMAP7XX_MCBSP_PDATA_SZ);
190 190
191 if (cpu_is_omap15xx()) 191 if (cpu_is_omap15xx())
192 omap_mcbsp_register_board_cfg(omap15xx_mcbsp_pdata, 192 omap_mcbsp_register_board_cfg(omap15xx_mcbsp_pdata,
diff --git a/arch/arm/mach-omap1/mux.c b/arch/arm/mach-omap1/mux.c
index 721e0d9d8b1d..785371e982fc 100644
--- a/arch/arm/mach-omap1/mux.c
+++ b/arch/arm/mach-omap1/mux.c
@@ -29,53 +29,39 @@
29 29
30#include <asm/system.h> 30#include <asm/system.h>
31 31
32#include <mach/mux.h> 32#include <plat/mux.h>
33 33
34#ifdef CONFIG_OMAP_MUX 34#ifdef CONFIG_OMAP_MUX
35 35
36static struct omap_mux_cfg arch_mux_cfg; 36static struct omap_mux_cfg arch_mux_cfg;
37 37
38#ifdef CONFIG_ARCH_OMAP730 38#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
39static struct pin_config __initdata_or_module omap730_pins[] = { 39static struct pin_config __initdata_or_module omap7xx_pins[] = {
40MUX_CFG_730("E2_730_KBR0", 12, 21, 0, 20, 1, 0) 40MUX_CFG_7XX("E2_7XX_KBR0", 12, 21, 0, 20, 1, 0)
41MUX_CFG_730("J7_730_KBR1", 12, 25, 0, 24, 1, 0) 41MUX_CFG_7XX("J7_7XX_KBR1", 12, 25, 0, 24, 1, 0)
42MUX_CFG_730("E1_730_KBR2", 12, 29, 0, 28, 1, 0) 42MUX_CFG_7XX("E1_7XX_KBR2", 12, 29, 0, 28, 1, 0)
43MUX_CFG_730("F3_730_KBR3", 13, 1, 0, 0, 1, 0) 43MUX_CFG_7XX("F3_7XX_KBR3", 13, 1, 0, 0, 1, 0)
44MUX_CFG_730("D2_730_KBR4", 13, 5, 0, 4, 1, 0) 44MUX_CFG_7XX("D2_7XX_KBR4", 13, 5, 0, 4, 1, 0)
45MUX_CFG_730("C2_730_KBC0", 13, 9, 0, 8, 1, 0) 45MUX_CFG_7XX("C2_7XX_KBC0", 13, 9, 0, 8, 1, 0)
46MUX_CFG_730("D3_730_KBC1", 13, 13, 0, 12, 1, 0) 46MUX_CFG_7XX("D3_7XX_KBC1", 13, 13, 0, 12, 1, 0)
47MUX_CFG_730("E4_730_KBC2", 13, 17, 0, 16, 1, 0) 47MUX_CFG_7XX("E4_7XX_KBC2", 13, 17, 0, 16, 1, 0)
48MUX_CFG_730("F4_730_KBC3", 13, 21, 0, 20, 1, 0) 48MUX_CFG_7XX("F4_7XX_KBC3", 13, 21, 0, 20, 1, 0)
49MUX_CFG_730("E3_730_KBC4", 13, 25, 0, 24, 1, 0) 49MUX_CFG_7XX("E3_7XX_KBC4", 13, 25, 0, 24, 1, 0)
50 50
51MUX_CFG_730("AA17_730_USB_DM", 2, 21, 0, 20, 0, 0) 51MUX_CFG_7XX("AA17_7XX_USB_DM", 2, 21, 0, 20, 0, 0)
52MUX_CFG_730("W16_730_USB_PU_EN", 2, 25, 0, 24, 0, 0) 52MUX_CFG_7XX("W16_7XX_USB_PU_EN", 2, 25, 0, 24, 0, 0)
53MUX_CFG_730("W17_730_USB_VBUSI", 2, 29, 0, 28, 0, 0) 53MUX_CFG_7XX("W17_7XX_USB_VBUSI", 2, 29, 0, 28, 0, 0)
54
55/* MMC Pins */
56MUX_CFG_7XX("MMC_7XX_CMD", 2, 9, 0, 8, 1, 0)
57MUX_CFG_7XX("MMC_7XX_CLK", 2, 13, 0, 12, 1, 0)
58MUX_CFG_7XX("MMC_7XX_DAT0", 2, 17, 0, 16, 1, 0)
54}; 59};
55#define OMAP730_PINS_SZ ARRAY_SIZE(omap730_pins) 60#define OMAP7XX_PINS_SZ ARRAY_SIZE(omap7xx_pins)
56#else 61#else
57#define omap730_pins NULL 62#define omap7xx_pins NULL
58#define OMAP730_PINS_SZ 0 63#define OMAP7XX_PINS_SZ 0
59#endif /* CONFIG_ARCH_OMAP730 */ 64#endif /* CONFIG_ARCH_OMAP730 || CONFIG_ARCH_OMAP850 */
60
61#ifdef CONFIG_ARCH_OMAP850
62struct pin_config __initdata_or_module omap850_pins[] = {
63MUX_CFG_850("E2_850_KBR0", 12, 21, 0, 20, 1, 0)
64MUX_CFG_850("J7_850_KBR1", 12, 25, 0, 24, 1, 0)
65MUX_CFG_850("E1_850_KBR2", 12, 29, 0, 28, 1, 0)
66MUX_CFG_850("F3_850_KBR3", 13, 1, 0, 0, 1, 0)
67MUX_CFG_850("D2_850_KBR4", 13, 5, 0, 4, 1, 0)
68MUX_CFG_850("C2_850_KBC0", 13, 9, 0, 8, 1, 0)
69MUX_CFG_850("D3_850_KBC1", 13, 13, 0, 12, 1, 0)
70MUX_CFG_850("E4_850_KBC2", 13, 17, 0, 16, 1, 0)
71MUX_CFG_850("F4_850_KBC3", 13, 21, 0, 20, 1, 0)
72MUX_CFG_850("E3_850_KBC4", 13, 25, 0, 24, 1, 0)
73
74MUX_CFG_850("AA17_850_USB_DM", 2, 21, 0, 20, 0, 0)
75MUX_CFG_850("W16_850_USB_PU_EN", 2, 25, 0, 24, 0, 0)
76MUX_CFG_850("W17_850_USB_VBUSI", 2, 29, 0, 28, 0, 0)
77};
78#endif
79 65
80#if defined(CONFIG_ARCH_OMAP15XX) || defined(CONFIG_ARCH_OMAP16XX) 66#if defined(CONFIG_ARCH_OMAP15XX) || defined(CONFIG_ARCH_OMAP16XX)
81static struct pin_config __initdata_or_module omap1xxx_pins[] = { 67static struct pin_config __initdata_or_module omap1xxx_pins[] = {
@@ -438,11 +424,6 @@ int __init_or_module omap1_cfg_reg(const struct pin_config *cfg)
438 printk(" %s (0x%08x) = 0x%08x -> 0x%08x\n", 424 printk(" %s (0x%08x) = 0x%08x -> 0x%08x\n",
439 cfg->pull_name, cfg->pull_reg, pull_orig, pull); 425 cfg->pull_name, cfg->pull_reg, pull_orig, pull);
440 } 426 }
441
442#ifdef CONFIG_ARCH_OMAP850
443 omap_mux_register(omap850_pins, ARRAY_SIZE(omap850_pins));
444#endif
445
446#endif 427#endif
447 428
448#ifdef CONFIG_OMAP_MUX_ERRORS 429#ifdef CONFIG_OMAP_MUX_ERRORS
@@ -454,9 +435,9 @@ int __init_or_module omap1_cfg_reg(const struct pin_config *cfg)
454 435
455int __init omap1_mux_init(void) 436int __init omap1_mux_init(void)
456{ 437{
457 if (cpu_is_omap730()) { 438 if (cpu_is_omap7xx()) {
458 arch_mux_cfg.pins = omap730_pins; 439 arch_mux_cfg.pins = omap7xx_pins;
459 arch_mux_cfg.size = OMAP730_PINS_SZ; 440 arch_mux_cfg.size = OMAP7XX_PINS_SZ;
460 arch_mux_cfg.cfg_reg = omap1_cfg_reg; 441 arch_mux_cfg.cfg_reg = omap1_cfg_reg;
461 } 442 }
462 443
diff --git a/arch/arm/mach-omap1/pm.c b/arch/arm/mach-omap1/pm.c
index 5218943c91c0..b1d3f9fade23 100644
--- a/arch/arm/mach-omap1/pm.c
+++ b/arch/arm/mach-omap1/pm.c
@@ -48,21 +48,21 @@
48#include <asm/mach/time.h> 48#include <asm/mach/time.h>
49#include <asm/mach/irq.h> 49#include <asm/mach/irq.h>
50 50
51#include <mach/cpu.h> 51#include <plat/cpu.h>
52#include <mach/irqs.h> 52#include <mach/irqs.h>
53#include <mach/clock.h> 53#include <plat/clock.h>
54#include <mach/sram.h> 54#include <plat/sram.h>
55#include <mach/tc.h> 55#include <plat/tc.h>
56#include <mach/mux.h> 56#include <plat/mux.h>
57#include <mach/dma.h> 57#include <plat/dma.h>
58#include <mach/dmtimer.h> 58#include <plat/dmtimer.h>
59 59
60#include "pm.h" 60#include "pm.h"
61 61
62static unsigned int arm_sleep_save[ARM_SLEEP_SAVE_SIZE]; 62static unsigned int arm_sleep_save[ARM_SLEEP_SAVE_SIZE];
63static unsigned short dsp_sleep_save[DSP_SLEEP_SAVE_SIZE]; 63static unsigned short dsp_sleep_save[DSP_SLEEP_SAVE_SIZE];
64static unsigned short ulpd_sleep_save[ULPD_SLEEP_SAVE_SIZE]; 64static unsigned short ulpd_sleep_save[ULPD_SLEEP_SAVE_SIZE];
65static unsigned int mpui730_sleep_save[MPUI730_SLEEP_SAVE_SIZE]; 65static unsigned int mpui7xx_sleep_save[MPUI7XX_SLEEP_SAVE_SIZE];
66static unsigned int mpui1510_sleep_save[MPUI1510_SLEEP_SAVE_SIZE]; 66static unsigned int mpui1510_sleep_save[MPUI1510_SLEEP_SAVE_SIZE];
67static unsigned int mpui1610_sleep_save[MPUI1610_SLEEP_SAVE_SIZE]; 67static unsigned int mpui1610_sleep_save[MPUI1610_SLEEP_SAVE_SIZE];
68 68
@@ -183,9 +183,9 @@ static void omap_pm_wakeup_setup(void)
183 * drivers must still separately call omap_set_gpio_wakeup() to 183 * drivers must still separately call omap_set_gpio_wakeup() to
184 * wake up to a GPIO interrupt. 184 * wake up to a GPIO interrupt.
185 */ 185 */
186 if (cpu_is_omap730()) 186 if (cpu_is_omap7xx())
187 level1_wake = OMAP_IRQ_BIT(INT_730_GPIO_BANK1) | 187 level1_wake = OMAP_IRQ_BIT(INT_7XX_GPIO_BANK1) |
188 OMAP_IRQ_BIT(INT_730_IH2_IRQ); 188 OMAP_IRQ_BIT(INT_7XX_IH2_IRQ);
189 else if (cpu_is_omap15xx()) 189 else if (cpu_is_omap15xx())
190 level1_wake = OMAP_IRQ_BIT(INT_GPIO_BANK1) | 190 level1_wake = OMAP_IRQ_BIT(INT_GPIO_BANK1) |
191 OMAP_IRQ_BIT(INT_1510_IH2_IRQ); 191 OMAP_IRQ_BIT(INT_1510_IH2_IRQ);
@@ -195,10 +195,10 @@ static void omap_pm_wakeup_setup(void)
195 195
196 omap_writel(~level1_wake, OMAP_IH1_MIR); 196 omap_writel(~level1_wake, OMAP_IH1_MIR);
197 197
198 if (cpu_is_omap730()) { 198 if (cpu_is_omap7xx()) {
199 omap_writel(~level2_wake, OMAP_IH2_0_MIR); 199 omap_writel(~level2_wake, OMAP_IH2_0_MIR);
200 omap_writel(~(OMAP_IRQ_BIT(INT_730_WAKE_UP_REQ) | 200 omap_writel(~(OMAP_IRQ_BIT(INT_7XX_WAKE_UP_REQ) |
201 OMAP_IRQ_BIT(INT_730_MPUIO_KEYPAD)), 201 OMAP_IRQ_BIT(INT_7XX_MPUIO_KEYPAD)),
202 OMAP_IH2_1_MIR); 202 OMAP_IH2_1_MIR);
203 } else if (cpu_is_omap15xx()) { 203 } else if (cpu_is_omap15xx()) {
204 level2_wake |= OMAP_IRQ_BIT(INT_KEYBOARD); 204 level2_wake |= OMAP_IRQ_BIT(INT_KEYBOARD);
@@ -253,15 +253,15 @@ void omap1_pm_suspend(void)
253 * Save interrupt, MPUI, ARM and UPLD control registers. 253 * Save interrupt, MPUI, ARM and UPLD control registers.
254 */ 254 */
255 255
256 if (cpu_is_omap730()) { 256 if (cpu_is_omap7xx()) {
257 MPUI730_SAVE(OMAP_IH1_MIR); 257 MPUI7XX_SAVE(OMAP_IH1_MIR);
258 MPUI730_SAVE(OMAP_IH2_0_MIR); 258 MPUI7XX_SAVE(OMAP_IH2_0_MIR);
259 MPUI730_SAVE(OMAP_IH2_1_MIR); 259 MPUI7XX_SAVE(OMAP_IH2_1_MIR);
260 MPUI730_SAVE(MPUI_CTRL); 260 MPUI7XX_SAVE(MPUI_CTRL);
261 MPUI730_SAVE(MPUI_DSP_BOOT_CONFIG); 261 MPUI7XX_SAVE(MPUI_DSP_BOOT_CONFIG);
262 MPUI730_SAVE(MPUI_DSP_API_CONFIG); 262 MPUI7XX_SAVE(MPUI_DSP_API_CONFIG);
263 MPUI730_SAVE(EMIFS_CONFIG); 263 MPUI7XX_SAVE(EMIFS_CONFIG);
264 MPUI730_SAVE(EMIFF_SDRAM_CONFIG); 264 MPUI7XX_SAVE(EMIFF_SDRAM_CONFIG);
265 265
266 } else if (cpu_is_omap15xx()) { 266 } else if (cpu_is_omap15xx()) {
267 MPUI1510_SAVE(OMAP_IH1_MIR); 267 MPUI1510_SAVE(OMAP_IH1_MIR);
@@ -306,7 +306,7 @@ void omap1_pm_suspend(void)
306 omap_writew(omap_readw(ARM_RSTCT1) & ~(1 << DSP_EN), ARM_RSTCT1); 306 omap_writew(omap_readw(ARM_RSTCT1) & ~(1 << DSP_EN), ARM_RSTCT1);
307 307
308 /* shut down dsp_ck */ 308 /* shut down dsp_ck */
309 if (!cpu_is_omap730()) 309 if (!cpu_is_omap7xx())
310 omap_writew(omap_readw(ARM_CKCTL) & ~(1 << EN_DSPCK), ARM_CKCTL); 310 omap_writew(omap_readw(ARM_CKCTL) & ~(1 << EN_DSPCK), ARM_CKCTL);
311 311
312 /* temporarily enabling api_ck to access DSP registers */ 312 /* temporarily enabling api_ck to access DSP registers */
@@ -383,12 +383,12 @@ void omap1_pm_suspend(void)
383 ULPD_RESTORE(ULPD_CLOCK_CTRL); 383 ULPD_RESTORE(ULPD_CLOCK_CTRL);
384 ULPD_RESTORE(ULPD_STATUS_REQ); 384 ULPD_RESTORE(ULPD_STATUS_REQ);
385 385
386 if (cpu_is_omap730()) { 386 if (cpu_is_omap7xx()) {
387 MPUI730_RESTORE(EMIFS_CONFIG); 387 MPUI7XX_RESTORE(EMIFS_CONFIG);
388 MPUI730_RESTORE(EMIFF_SDRAM_CONFIG); 388 MPUI7XX_RESTORE(EMIFF_SDRAM_CONFIG);
389 MPUI730_RESTORE(OMAP_IH1_MIR); 389 MPUI7XX_RESTORE(OMAP_IH1_MIR);
390 MPUI730_RESTORE(OMAP_IH2_0_MIR); 390 MPUI7XX_RESTORE(OMAP_IH2_0_MIR);
391 MPUI730_RESTORE(OMAP_IH2_1_MIR); 391 MPUI7XX_RESTORE(OMAP_IH2_1_MIR);
392 } else if (cpu_is_omap15xx()) { 392 } else if (cpu_is_omap15xx()) {
393 MPUI1510_RESTORE(MPUI_CTRL); 393 MPUI1510_RESTORE(MPUI_CTRL);
394 MPUI1510_RESTORE(MPUI_DSP_BOOT_CONFIG); 394 MPUI1510_RESTORE(MPUI_DSP_BOOT_CONFIG);
@@ -461,13 +461,13 @@ static int omap_pm_read_proc(
461 ULPD_SAVE(ULPD_DPLL_CTRL); 461 ULPD_SAVE(ULPD_DPLL_CTRL);
462 ULPD_SAVE(ULPD_POWER_CTRL); 462 ULPD_SAVE(ULPD_POWER_CTRL);
463 463
464 if (cpu_is_omap730()) { 464 if (cpu_is_omap7xx()) {
465 MPUI730_SAVE(MPUI_CTRL); 465 MPUI7XX_SAVE(MPUI_CTRL);
466 MPUI730_SAVE(MPUI_DSP_STATUS); 466 MPUI7XX_SAVE(MPUI_DSP_STATUS);
467 MPUI730_SAVE(MPUI_DSP_BOOT_CONFIG); 467 MPUI7XX_SAVE(MPUI_DSP_BOOT_CONFIG);
468 MPUI730_SAVE(MPUI_DSP_API_CONFIG); 468 MPUI7XX_SAVE(MPUI_DSP_API_CONFIG);
469 MPUI730_SAVE(EMIFF_SDRAM_CONFIG); 469 MPUI7XX_SAVE(EMIFF_SDRAM_CONFIG);
470 MPUI730_SAVE(EMIFS_CONFIG); 470 MPUI7XX_SAVE(EMIFS_CONFIG);
471 } else if (cpu_is_omap15xx()) { 471 } else if (cpu_is_omap15xx()) {
472 MPUI1510_SAVE(MPUI_CTRL); 472 MPUI1510_SAVE(MPUI_CTRL);
473 MPUI1510_SAVE(MPUI_DSP_STATUS); 473 MPUI1510_SAVE(MPUI_DSP_STATUS);
@@ -517,20 +517,20 @@ static int omap_pm_read_proc(
517 ULPD_SHOW(ULPD_STATUS_REQ), 517 ULPD_SHOW(ULPD_STATUS_REQ),
518 ULPD_SHOW(ULPD_POWER_CTRL)); 518 ULPD_SHOW(ULPD_POWER_CTRL));
519 519
520 if (cpu_is_omap730()) { 520 if (cpu_is_omap7xx()) {
521 my_buffer_offset += sprintf(my_base + my_buffer_offset, 521 my_buffer_offset += sprintf(my_base + my_buffer_offset,
522 "MPUI730_CTRL_REG 0x%-8x \n" 522 "MPUI7XX_CTRL_REG 0x%-8x \n"
523 "MPUI730_DSP_STATUS_REG: 0x%-8x \n" 523 "MPUI7XX_DSP_STATUS_REG: 0x%-8x \n"
524 "MPUI730_DSP_BOOT_CONFIG_REG: 0x%-8x \n" 524 "MPUI7XX_DSP_BOOT_CONFIG_REG: 0x%-8x \n"
525 "MPUI730_DSP_API_CONFIG_REG: 0x%-8x \n" 525 "MPUI7XX_DSP_API_CONFIG_REG: 0x%-8x \n"
526 "MPUI730_SDRAM_CONFIG_REG: 0x%-8x \n" 526 "MPUI7XX_SDRAM_CONFIG_REG: 0x%-8x \n"
527 "MPUI730_EMIFS_CONFIG_REG: 0x%-8x \n", 527 "MPUI7XX_EMIFS_CONFIG_REG: 0x%-8x \n",
528 MPUI730_SHOW(MPUI_CTRL), 528 MPUI7XX_SHOW(MPUI_CTRL),
529 MPUI730_SHOW(MPUI_DSP_STATUS), 529 MPUI7XX_SHOW(MPUI_DSP_STATUS),
530 MPUI730_SHOW(MPUI_DSP_BOOT_CONFIG), 530 MPUI7XX_SHOW(MPUI_DSP_BOOT_CONFIG),
531 MPUI730_SHOW(MPUI_DSP_API_CONFIG), 531 MPUI7XX_SHOW(MPUI_DSP_API_CONFIG),
532 MPUI730_SHOW(EMIFF_SDRAM_CONFIG), 532 MPUI7XX_SHOW(EMIFF_SDRAM_CONFIG),
533 MPUI730_SHOW(EMIFS_CONFIG)); 533 MPUI7XX_SHOW(EMIFS_CONFIG));
534 } else if (cpu_is_omap15xx()) { 534 } else if (cpu_is_omap15xx()) {
535 my_buffer_offset += sprintf(my_base + my_buffer_offset, 535 my_buffer_offset += sprintf(my_base + my_buffer_offset,
536 "MPUI1510_CTRL_REG 0x%-8x \n" 536 "MPUI1510_CTRL_REG 0x%-8x \n"
@@ -668,9 +668,9 @@ static int __init omap_pm_init(void)
668 * These routines need to be in SRAM as that's the only 668 * These routines need to be in SRAM as that's the only
669 * memory the MPU can see when it wakes up. 669 * memory the MPU can see when it wakes up.
670 */ 670 */
671 if (cpu_is_omap730()) { 671 if (cpu_is_omap7xx()) {
672 omap_sram_suspend = omap_sram_push(omap730_cpu_suspend, 672 omap_sram_suspend = omap_sram_push(omap7xx_cpu_suspend,
673 omap730_cpu_suspend_sz); 673 omap7xx_cpu_suspend_sz);
674 } else if (cpu_is_omap15xx()) { 674 } else if (cpu_is_omap15xx()) {
675 omap_sram_suspend = omap_sram_push(omap1510_cpu_suspend, 675 omap_sram_suspend = omap_sram_push(omap1510_cpu_suspend,
676 omap1510_cpu_suspend_sz); 676 omap1510_cpu_suspend_sz);
@@ -686,8 +686,8 @@ static int __init omap_pm_init(void)
686 686
687 pm_idle = omap1_pm_idle; 687 pm_idle = omap1_pm_idle;
688 688
689 if (cpu_is_omap730()) 689 if (cpu_is_omap7xx())
690 setup_irq(INT_730_WAKE_UP_REQ, &omap_wakeup_irq); 690 setup_irq(INT_7XX_WAKE_UP_REQ, &omap_wakeup_irq);
691 else if (cpu_is_omap16xx()) 691 else if (cpu_is_omap16xx())
692 setup_irq(INT_1610_WAKE_UP_REQ, &omap_wakeup_irq); 692 setup_irq(INT_1610_WAKE_UP_REQ, &omap_wakeup_irq);
693 693
@@ -700,8 +700,8 @@ static int __init omap_pm_init(void)
700 omap_writew(ULPD_POWER_CTRL_REG_VAL, ULPD_POWER_CTRL); 700 omap_writew(ULPD_POWER_CTRL_REG_VAL, ULPD_POWER_CTRL);
701 701
702 /* Configure IDLECT3 */ 702 /* Configure IDLECT3 */
703 if (cpu_is_omap730()) 703 if (cpu_is_omap7xx())
704 omap_writel(OMAP730_IDLECT3_VAL, OMAP730_IDLECT3); 704 omap_writel(OMAP7XX_IDLECT3_VAL, OMAP7XX_IDLECT3);
705 else if (cpu_is_omap16xx()) 705 else if (cpu_is_omap16xx())
706 omap_writel(OMAP1610_IDLECT3_VAL, OMAP1610_IDLECT3); 706 omap_writel(OMAP1610_IDLECT3_VAL, OMAP1610_IDLECT3);
707 707
diff --git a/arch/arm/mach-omap1/pm.h b/arch/arm/mach-omap1/pm.h
index c4f05bdcf8a6..56a647986ae9 100644
--- a/arch/arm/mach-omap1/pm.h
+++ b/arch/arm/mach-omap1/pm.h
@@ -98,13 +98,14 @@
98#define OMAP1610_IDLECT3 0xfffece24 98#define OMAP1610_IDLECT3 0xfffece24
99#define OMAP1610_IDLE_LOOP_REQUEST 0x0400 99#define OMAP1610_IDLE_LOOP_REQUEST 0x0400
100 100
101#define OMAP730_IDLECT1_SLEEP_VAL 0x16c7 101#define OMAP7XX_IDLECT1_SLEEP_VAL 0x16c7
102#define OMAP730_IDLECT2_SLEEP_VAL 0x09c7 102#define OMAP7XX_IDLECT2_SLEEP_VAL 0x09c7
103#define OMAP730_IDLECT3_VAL 0x3f 103#define OMAP7XX_IDLECT3_VAL 0x3f
104#define OMAP730_IDLECT3 0xfffece24 104#define OMAP7XX_IDLECT3 0xfffece24
105#define OMAP730_IDLE_LOOP_REQUEST 0x0C00 105#define OMAP7XX_IDLE_LOOP_REQUEST 0x0C00
106 106
107#if !defined(CONFIG_ARCH_OMAP730) && \ 107#if !defined(CONFIG_ARCH_OMAP730) && \
108 !defined(CONFIG_ARCH_OMAP850) && \
108 !defined(CONFIG_ARCH_OMAP15XX) && \ 109 !defined(CONFIG_ARCH_OMAP15XX) && \
109 !defined(CONFIG_ARCH_OMAP16XX) 110 !defined(CONFIG_ARCH_OMAP16XX)
110#warning "Power management for this processor not implemented yet" 111#warning "Power management for this processor not implemented yet"
@@ -122,17 +123,17 @@ extern void allow_idle_sleep(void);
122extern void omap1_pm_idle(void); 123extern void omap1_pm_idle(void);
123extern void omap1_pm_suspend(void); 124extern void omap1_pm_suspend(void);
124 125
125extern void omap730_cpu_suspend(unsigned short, unsigned short); 126extern void omap7xx_cpu_suspend(unsigned short, unsigned short);
126extern void omap1510_cpu_suspend(unsigned short, unsigned short); 127extern void omap1510_cpu_suspend(unsigned short, unsigned short);
127extern void omap1610_cpu_suspend(unsigned short, unsigned short); 128extern void omap1610_cpu_suspend(unsigned short, unsigned short);
128extern void omap730_idle_loop_suspend(void); 129extern void omap7xx_idle_loop_suspend(void);
129extern void omap1510_idle_loop_suspend(void); 130extern void omap1510_idle_loop_suspend(void);
130extern void omap1610_idle_loop_suspend(void); 131extern void omap1610_idle_loop_suspend(void);
131 132
132extern unsigned int omap730_cpu_suspend_sz; 133extern unsigned int omap7xx_cpu_suspend_sz;
133extern unsigned int omap1510_cpu_suspend_sz; 134extern unsigned int omap1510_cpu_suspend_sz;
134extern unsigned int omap1610_cpu_suspend_sz; 135extern unsigned int omap1610_cpu_suspend_sz;
135extern unsigned int omap730_idle_loop_suspend_sz; 136extern unsigned int omap7xx_idle_loop_suspend_sz;
136extern unsigned int omap1510_idle_loop_suspend_sz; 137extern unsigned int omap1510_idle_loop_suspend_sz;
137extern unsigned int omap1610_idle_loop_suspend_sz; 138extern unsigned int omap1610_idle_loop_suspend_sz;
138 139
@@ -155,9 +156,9 @@ extern void omap_serial_wake_trigger(int enable);
155#define ULPD_RESTORE(x) omap_writew((ulpd_sleep_save[ULPD_SLEEP_SAVE_##x]), (x)) 156#define ULPD_RESTORE(x) omap_writew((ulpd_sleep_save[ULPD_SLEEP_SAVE_##x]), (x))
156#define ULPD_SHOW(x) ulpd_sleep_save[ULPD_SLEEP_SAVE_##x] 157#define ULPD_SHOW(x) ulpd_sleep_save[ULPD_SLEEP_SAVE_##x]
157 158
158#define MPUI730_SAVE(x) mpui730_sleep_save[MPUI730_SLEEP_SAVE_##x] = omap_readl(x) 159#define MPUI7XX_SAVE(x) mpui7xx_sleep_save[MPUI7XX_SLEEP_SAVE_##x] = omap_readl(x)
159#define MPUI730_RESTORE(x) omap_writel((mpui730_sleep_save[MPUI730_SLEEP_SAVE_##x]), (x)) 160#define MPUI7XX_RESTORE(x) omap_writel((mpui7xx_sleep_save[MPUI7XX_SLEEP_SAVE_##x]), (x))
160#define MPUI730_SHOW(x) mpui730_sleep_save[MPUI730_SLEEP_SAVE_##x] 161#define MPUI7XX_SHOW(x) mpui7xx_sleep_save[MPUI7XX_SLEEP_SAVE_##x]
161 162
162#define MPUI1510_SAVE(x) mpui1510_sleep_save[MPUI1510_SLEEP_SAVE_##x] = omap_readl(x) 163#define MPUI1510_SAVE(x) mpui1510_sleep_save[MPUI1510_SLEEP_SAVE_##x] = omap_readl(x)
163#define MPUI1510_RESTORE(x) omap_writel((mpui1510_sleep_save[MPUI1510_SLEEP_SAVE_##x]), (x)) 164#define MPUI1510_RESTORE(x) omap_writel((mpui1510_sleep_save[MPUI1510_SLEEP_SAVE_##x]), (x))
@@ -232,24 +233,24 @@ enum mpui1510_save_state {
232#endif 233#endif
233}; 234};
234 235
235enum mpui730_save_state { 236enum mpui7xx_save_state {
236 MPUI730_SLEEP_SAVE_START = 0, 237 MPUI7XX_SLEEP_SAVE_START = 0,
237 /* 238 /*
238 * MPUI registers 32 bits 239 * MPUI registers 32 bits
239 */ 240 */
240 MPUI730_SLEEP_SAVE_MPUI_CTRL, 241 MPUI7XX_SLEEP_SAVE_MPUI_CTRL,
241 MPUI730_SLEEP_SAVE_MPUI_DSP_BOOT_CONFIG, 242 MPUI7XX_SLEEP_SAVE_MPUI_DSP_BOOT_CONFIG,
242 MPUI730_SLEEP_SAVE_MPUI_DSP_API_CONFIG, 243 MPUI7XX_SLEEP_SAVE_MPUI_DSP_API_CONFIG,
243 MPUI730_SLEEP_SAVE_MPUI_DSP_STATUS, 244 MPUI7XX_SLEEP_SAVE_MPUI_DSP_STATUS,
244 MPUI730_SLEEP_SAVE_EMIFF_SDRAM_CONFIG, 245 MPUI7XX_SLEEP_SAVE_EMIFF_SDRAM_CONFIG,
245 MPUI730_SLEEP_SAVE_EMIFS_CONFIG, 246 MPUI7XX_SLEEP_SAVE_EMIFS_CONFIG,
246 MPUI730_SLEEP_SAVE_OMAP_IH1_MIR, 247 MPUI7XX_SLEEP_SAVE_OMAP_IH1_MIR,
247 MPUI730_SLEEP_SAVE_OMAP_IH2_0_MIR, 248 MPUI7XX_SLEEP_SAVE_OMAP_IH2_0_MIR,
248 MPUI730_SLEEP_SAVE_OMAP_IH2_1_MIR, 249 MPUI7XX_SLEEP_SAVE_OMAP_IH2_1_MIR,
249#if defined(CONFIG_ARCH_OMAP730) 250#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
250 MPUI730_SLEEP_SAVE_SIZE 251 MPUI7XX_SLEEP_SAVE_SIZE
251#else 252#else
252 MPUI730_SLEEP_SAVE_SIZE = 0 253 MPUI7XX_SLEEP_SAVE_SIZE = 0
253#endif 254#endif
254}; 255};
255 256
diff --git a/arch/arm/mach-omap1/serial.c b/arch/arm/mach-omap1/serial.c
index d23979bc0fd5..6e5207c81cf4 100644
--- a/arch/arm/mach-omap1/serial.c
+++ b/arch/arm/mach-omap1/serial.c
@@ -22,10 +22,10 @@
22 22
23#include <asm/mach-types.h> 23#include <asm/mach-types.h>
24 24
25#include <mach/board.h> 25#include <plat/board.h>
26#include <mach/mux.h> 26#include <plat/mux.h>
27#include <mach/gpio.h> 27#include <mach/gpio.h>
28#include <mach/fpga.h> 28#include <plat/fpga.h>
29 29
30static struct clk * uart1_ck; 30static struct clk * uart1_ck;
31static struct clk * uart2_ck; 31static struct clk * uart2_ck;
@@ -64,7 +64,6 @@ static void __init omap_serial_reset(struct plat_serial8250_port *p)
64 64
65static struct plat_serial8250_port serial_platform_data[] = { 65static struct plat_serial8250_port serial_platform_data[] = {
66 { 66 {
67 .membase = OMAP1_IO_ADDRESS(OMAP_UART1_BASE),
68 .mapbase = OMAP_UART1_BASE, 67 .mapbase = OMAP_UART1_BASE,
69 .irq = INT_UART1, 68 .irq = INT_UART1,
70 .flags = UPF_BOOT_AUTOCONF, 69 .flags = UPF_BOOT_AUTOCONF,
@@ -73,7 +72,6 @@ static struct plat_serial8250_port serial_platform_data[] = {
73 .uartclk = OMAP16XX_BASE_BAUD * 16, 72 .uartclk = OMAP16XX_BASE_BAUD * 16,
74 }, 73 },
75 { 74 {
76 .membase = OMAP1_IO_ADDRESS(OMAP_UART2_BASE),
77 .mapbase = OMAP_UART2_BASE, 75 .mapbase = OMAP_UART2_BASE,
78 .irq = INT_UART2, 76 .irq = INT_UART2,
79 .flags = UPF_BOOT_AUTOCONF, 77 .flags = UPF_BOOT_AUTOCONF,
@@ -82,7 +80,6 @@ static struct plat_serial8250_port serial_platform_data[] = {
82 .uartclk = OMAP16XX_BASE_BAUD * 16, 80 .uartclk = OMAP16XX_BASE_BAUD * 16,
83 }, 81 },
84 { 82 {
85 .membase = OMAP1_IO_ADDRESS(OMAP_UART3_BASE),
86 .mapbase = OMAP_UART3_BASE, 83 .mapbase = OMAP_UART3_BASE,
87 .irq = INT_UART3, 84 .irq = INT_UART3,
88 .flags = UPF_BOOT_AUTOCONF, 85 .flags = UPF_BOOT_AUTOCONF,
@@ -110,18 +107,11 @@ void __init omap_serial_init(void)
110{ 107{
111 int i; 108 int i;
112 109
113 if (cpu_is_omap730()) { 110 if (cpu_is_omap7xx()) {
114 serial_platform_data[0].regshift = 0; 111 serial_platform_data[0].regshift = 0;
115 serial_platform_data[1].regshift = 0; 112 serial_platform_data[1].regshift = 0;
116 serial_platform_data[0].irq = INT_730_UART_MODEM_1; 113 serial_platform_data[0].irq = INT_7XX_UART_MODEM_1;
117 serial_platform_data[1].irq = INT_730_UART_MODEM_IRDA_2; 114 serial_platform_data[1].irq = INT_7XX_UART_MODEM_IRDA_2;
118 }
119
120 if (cpu_is_omap850()) {
121 serial_platform_data[0].regshift = 0;
122 serial_platform_data[1].regshift = 0;
123 serial_platform_data[0].irq = INT_850_UART_MODEM_1;
124 serial_platform_data[1].irq = INT_850_UART_MODEM_IRDA_2;
125 } 115 }
126 116
127 if (cpu_is_omap15xx()) { 117 if (cpu_is_omap15xx()) {
@@ -130,7 +120,15 @@ void __init omap_serial_init(void)
130 serial_platform_data[2].uartclk = OMAP1510_BASE_BAUD * 16; 120 serial_platform_data[2].uartclk = OMAP1510_BASE_BAUD * 16;
131 } 121 }
132 122
133 for (i = 0; i < OMAP_MAX_NR_PORTS; i++) { 123 for (i = 0; i < ARRAY_SIZE(serial_platform_data) - 1; i++) {
124
125 /* Static mapping, never released */
126 serial_platform_data[i].membase =
127 ioremap(serial_platform_data[i].mapbase, SZ_2K);
128 if (!serial_platform_data[i].membase) {
129 printk(KERN_ERR "Could not ioremap uart%i\n", i);
130 continue;
131 }
134 switch (i) { 132 switch (i) {
135 case 0: 133 case 0:
136 uart1_ck = clk_get(NULL, "uart1_ck"); 134 uart1_ck = clk_get(NULL, "uart1_ck");
diff --git a/arch/arm/mach-omap1/sleep.S b/arch/arm/mach-omap1/sleep.S
index 22e8568339b0..ef771ce8b030 100644
--- a/arch/arm/mach-omap1/sleep.S
+++ b/arch/arm/mach-omap1/sleep.S
@@ -1,7 +1,7 @@
1/* 1/*
2 * linux/arch/arm/mach-omap1/sleep.S 2 * linux/arch/arm/mach-omap1/sleep.S
3 * 3 *
4 * Low-level OMAP730/1510/1610 sleep/wakeUp support 4 * Low-level OMAP7XX/1510/1610 sleep/wakeUp support
5 * 5 *
6 * Initial SA1110 code: 6 * Initial SA1110 code:
7 * Copyright (c) 2001 Cliff Brake <cbrake@accelent.com> 7 * Copyright (c) 2001 Cliff Brake <cbrake@accelent.com>
@@ -57,8 +57,8 @@
57 * 57 *
58 */ 58 */
59 59
60#if defined(CONFIG_ARCH_OMAP730) 60#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
61ENTRY(omap730_cpu_suspend) 61ENTRY(omap7xx_cpu_suspend)
62 62
63 @ save registers on stack 63 @ save registers on stack
64 stmfd sp!, {r0 - r12, lr} 64 stmfd sp!, {r0 - r12, lr}
@@ -91,13 +91,13 @@ ENTRY(omap730_cpu_suspend)
91 91
92 @ turn off clock domains 92 @ turn off clock domains
93 @ do not disable PERCK (0x04) 93 @ do not disable PERCK (0x04)
94 mov r5, #OMAP730_IDLECT2_SLEEP_VAL & 0xff 94 mov r5, #OMAP7XX_IDLECT2_SLEEP_VAL & 0xff
95 orr r5, r5, #OMAP730_IDLECT2_SLEEP_VAL & 0xff00 95 orr r5, r5, #OMAP7XX_IDLECT2_SLEEP_VAL & 0xff00
96 strh r5, [r4, #ARM_IDLECT2_ASM_OFFSET & 0xff] 96 strh r5, [r4, #ARM_IDLECT2_ASM_OFFSET & 0xff]
97 97
98 @ request ARM idle 98 @ request ARM idle
99 mov r3, #OMAP730_IDLECT1_SLEEP_VAL & 0xff 99 mov r3, #OMAP7XX_IDLECT1_SLEEP_VAL & 0xff
100 orr r3, r3, #OMAP730_IDLECT1_SLEEP_VAL & 0xff00 100 orr r3, r3, #OMAP7XX_IDLECT1_SLEEP_VAL & 0xff00
101 strh r3, [r4, #ARM_IDLECT1_ASM_OFFSET & 0xff] 101 strh r3, [r4, #ARM_IDLECT1_ASM_OFFSET & 0xff]
102 102
103 @ disable instruction cache 103 @ disable instruction cache
@@ -113,7 +113,7 @@ ENTRY(omap730_cpu_suspend)
113 mov r2, #0 113 mov r2, #0
114 mcr p15, 0, r2, c7, c0, 4 @ wait for interrupt 114 mcr p15, 0, r2, c7, c0, 4 @ wait for interrupt
115/* 115/*
116 * omap730_cpu_suspend()'s resume point. 116 * omap7xx_cpu_suspend()'s resume point.
117 * 117 *
118 * It will just start executing here, so we'll restore stuff from the 118 * It will just start executing here, so we'll restore stuff from the
119 * stack. 119 * stack.
@@ -132,9 +132,9 @@ ENTRY(omap730_cpu_suspend)
132 @ restore regs and return 132 @ restore regs and return
133 ldmfd sp!, {r0 - r12, pc} 133 ldmfd sp!, {r0 - r12, pc}
134 134
135ENTRY(omap730_cpu_suspend_sz) 135ENTRY(omap7xx_cpu_suspend_sz)
136 .word . - omap730_cpu_suspend 136 .word . - omap7xx_cpu_suspend
137#endif /* CONFIG_ARCH_OMAP730 */ 137#endif /* CONFIG_ARCH_OMAP730 || CONFIG_ARCH_OMAP850 */
138 138
139#ifdef CONFIG_ARCH_OMAP15XX 139#ifdef CONFIG_ARCH_OMAP15XX
140ENTRY(omap1510_cpu_suspend) 140ENTRY(omap1510_cpu_suspend)
diff --git a/arch/arm/mach-omap1/timer32k.c b/arch/arm/mach-omap1/timer32k.c
index fd3f7396e162..9ad118563f7d 100644
--- a/arch/arm/mach-omap1/timer32k.c
+++ b/arch/arm/mach-omap1/timer32k.c
@@ -52,7 +52,7 @@
52#include <asm/irq.h> 52#include <asm/irq.h>
53#include <asm/mach/irq.h> 53#include <asm/mach/irq.h>
54#include <asm/mach/time.h> 54#include <asm/mach/time.h>
55#include <mach/dmtimer.h> 55#include <plat/dmtimer.h>
56 56
57struct sys_timer omap_timer; 57struct sys_timer omap_timer;
58 58
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index aad194f61a33..7309aab305a9 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -65,6 +65,10 @@ config MACH_OMAP3EVM
65 bool "OMAP 3530 EVM board" 65 bool "OMAP 3530 EVM board"
66 depends on ARCH_OMAP3 && ARCH_OMAP34XX 66 depends on ARCH_OMAP3 && ARCH_OMAP34XX
67 67
68config MACH_OMAP3517EVM
69 bool "OMAP3517/ AM3517 EVM board"
70 depends on ARCH_OMAP3 && ARCH_OMAP34XX
71
68config MACH_OMAP3_PANDORA 72config MACH_OMAP3_PANDORA
69 bool "OMAP3 Pandora" 73 bool "OMAP3 Pandora"
70 depends on ARCH_OMAP3 && ARCH_OMAP34XX 74 depends on ARCH_OMAP3 && ARCH_OMAP34XX
@@ -97,6 +101,30 @@ config MACH_OMAP_ZOOM2
97 bool "OMAP3 Zoom2 board" 101 bool "OMAP3 Zoom2 board"
98 depends on ARCH_OMAP3 && ARCH_OMAP34XX 102 depends on ARCH_OMAP3 && ARCH_OMAP34XX
99 103
104config MACH_OMAP_ZOOM3
105 bool "OMAP3630 Zoom3 board"
106 depends on ARCH_OMAP3 && ARCH_OMAP34XX
107
108config MACH_CM_T35
109 bool "CompuLab CM-T35 module"
110 depends on ARCH_OMAP3 && ARCH_OMAP34XX
111
112config MACH_IGEP0020
113 bool "IGEP0020"
114 depends on ARCH_OMAP3 && ARCH_OMAP34XX
115
116config MACH_OMAP_3630SDP
117 bool "OMAP3630 SDP board"
118 depends on ARCH_OMAP3 && ARCH_OMAP34XX
119
100config MACH_OMAP_4430SDP 120config MACH_OMAP_4430SDP
101 bool "OMAP 4430 SDP board" 121 bool "OMAP 4430 SDP board"
102 depends on ARCH_OMAP4 122 depends on ARCH_OMAP4
123
124config OMAP3_EMU
125 bool "OMAP3 debugging peripherals"
126 depends on ARCH_OMAP3
127 select OC_ETM
128 help
129 Say Y here to enable debugging hardware of omap3
130
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 8cb16777661a..32548a4510c5 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -31,7 +31,7 @@ obj-$(CONFIG_ARCH_OMAP2) += sdrc2xxx.o
31ifeq ($(CONFIG_PM),y) 31ifeq ($(CONFIG_PM),y)
32obj-$(CONFIG_ARCH_OMAP2) += pm24xx.o 32obj-$(CONFIG_ARCH_OMAP2) += pm24xx.o
33obj-$(CONFIG_ARCH_OMAP24XX) += sleep24xx.o 33obj-$(CONFIG_ARCH_OMAP24XX) += sleep24xx.o
34obj-$(CONFIG_ARCH_OMAP3) += pm34xx.o sleep34xx.o 34obj-$(CONFIG_ARCH_OMAP3) += pm34xx.o sleep34xx.o cpuidle34xx.o
35obj-$(CONFIG_PM_DEBUG) += pm-debug.o 35obj-$(CONFIG_PM_DEBUG) += pm-debug.o
36endif 36endif
37 37
@@ -44,6 +44,12 @@ obj-$(CONFIG_ARCH_OMAP4) += cm4xxx.o
44obj-$(CONFIG_ARCH_OMAP2) += clock24xx.o 44obj-$(CONFIG_ARCH_OMAP2) += clock24xx.o
45obj-$(CONFIG_ARCH_OMAP3) += clock34xx.o 45obj-$(CONFIG_ARCH_OMAP3) += clock34xx.o
46 46
47# EMU peripherals
48obj-$(CONFIG_OMAP3_EMU) += emu.o
49
50obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox_mach.o
51mailbox_mach-objs := mailbox.o
52
47iommu-y += iommu2.o 53iommu-y += iommu2.o
48iommu-$(CONFIG_ARCH_OMAP3) += omap3-iommu.o 54iommu-$(CONFIG_ARCH_OMAP3) += omap3-iommu.o
49 55
@@ -69,17 +75,33 @@ obj-$(CONFIG_MACH_OMAP_3430SDP) += board-3430sdp.o \
69 mmc-twl4030.o 75 mmc-twl4030.o
70obj-$(CONFIG_MACH_NOKIA_N8X0) += board-n8x0.o 76obj-$(CONFIG_MACH_NOKIA_N8X0) += board-n8x0.o
71obj-$(CONFIG_MACH_NOKIA_RX51) += board-rx51.o \ 77obj-$(CONFIG_MACH_NOKIA_RX51) += board-rx51.o \
78 board-rx51-sdram.o \
72 board-rx51-peripherals.o \ 79 board-rx51-peripherals.o \
73 mmc-twl4030.o 80 mmc-twl4030.o
74obj-$(CONFIG_MACH_OMAP_ZOOM2) += board-zoom2.o \ 81obj-$(CONFIG_MACH_OMAP_ZOOM2) += board-zoom2.o \
82 board-zoom-peripherals.o \
83 mmc-twl4030.o \
84 board-zoom-debugboard.o
85obj-$(CONFIG_MACH_OMAP_ZOOM3) += board-zoom3.o \
86 board-zoom-peripherals.o \
75 mmc-twl4030.o \ 87 mmc-twl4030.o \
76 board-zoom-debugboard.o 88 board-zoom-debugboard.o
89obj-$(CONFIG_MACH_OMAP_3630SDP) += board-3630sdp.o \
90 board-zoom-peripherals.o \
91 mmc-twl4030.o
92obj-$(CONFIG_MACH_CM_T35) += board-cm-t35.o \
93 mmc-twl4030.o
94obj-$(CONFIG_MACH_IGEP0020) += board-igep0020.o \
95 mmc-twl4030.o
77 96
78obj-$(CONFIG_MACH_OMAP_4430SDP) += board-4430sdp.o 97obj-$(CONFIG_MACH_OMAP_4430SDP) += board-4430sdp.o
79 98
99obj-$(CONFIG_MACH_OMAP3517EVM) += board-am3517evm.o
100
80# Platform specific device init code 101# Platform specific device init code
81obj-y += usb-musb.o 102obj-y += usb-musb.o
82obj-$(CONFIG_MACH_OMAP2_TUSB6010) += usb-tusb6010.o 103obj-$(CONFIG_MACH_OMAP2_TUSB6010) += usb-tusb6010.o
104obj-y += usb-ehci.o
83 105
84onenand-$(CONFIG_MTD_ONENAND_OMAP2) := gpmc-onenand.o 106onenand-$(CONFIG_MTD_ONENAND_OMAP2) := gpmc-onenand.o
85obj-y += $(onenand-m) $(onenand-y) 107obj-y += $(onenand-m) $(onenand-y)
diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c
index 42217b32f835..db9374bc528b 100644
--- a/arch/arm/mach-omap2/board-2430sdp.c
+++ b/arch/arm/mach-omap2/board-2430sdp.c
@@ -31,12 +31,12 @@
31#include <asm/mach/flash.h> 31#include <asm/mach/flash.h>
32 32
33#include <mach/gpio.h> 33#include <mach/gpio.h>
34#include <mach/mux.h> 34#include <plat/mux.h>
35#include <mach/board.h> 35#include <plat/board.h>
36#include <mach/common.h> 36#include <plat/common.h>
37#include <mach/gpmc.h> 37#include <plat/gpmc.h>
38#include <mach/usb.h> 38#include <plat/usb.h>
39#include <mach/gpmc-smc91x.h> 39#include <plat/gpmc-smc91x.h>
40 40
41#include "mmc-twl4030.h" 41#include "mmc-twl4030.h"
42 42
@@ -221,7 +221,7 @@ static void __init omap_2430sdp_map_io(void)
221MACHINE_START(OMAP_2430SDP, "OMAP2430 sdp2430 board") 221MACHINE_START(OMAP_2430SDP, "OMAP2430 sdp2430 board")
222 /* Maintainer: Syed Khasim - Texas Instruments Inc */ 222 /* Maintainer: Syed Khasim - Texas Instruments Inc */
223 .phys_io = 0x48000000, 223 .phys_io = 0x48000000,
224 .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc, 224 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc,
225 .boot_params = 0x80000100, 225 .boot_params = 0x80000100,
226 .map_io = omap_2430sdp_map_io, 226 .map_io = omap_2430sdp_map_io,
227 .init_irq = omap_2430sdp_init_irq, 227 .init_irq = omap_2430sdp_init_irq,
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
index 0acb5560229c..491364e44c7d 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -30,16 +30,16 @@
30#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
31#include <asm/mach/map.h> 31#include <asm/mach/map.h>
32 32
33#include <mach/mcspi.h> 33#include <plat/mcspi.h>
34#include <mach/mux.h> 34#include <plat/mux.h>
35#include <mach/board.h> 35#include <plat/board.h>
36#include <mach/usb.h> 36#include <plat/usb.h>
37#include <mach/common.h> 37#include <plat/common.h>
38#include <mach/dma.h> 38#include <plat/dma.h>
39#include <mach/gpmc.h> 39#include <plat/gpmc.h>
40 40
41#include <mach/control.h> 41#include <plat/control.h>
42#include <mach/gpmc-smc91x.h> 42#include <plat/gpmc-smc91x.h>
43 43
44#include "sdram-qimonda-hyb18m512160af-6.h" 44#include "sdram-qimonda-hyb18m512160af-6.h"
45#include "mmc-twl4030.h" 45#include "mmc-twl4030.h"
@@ -410,6 +410,15 @@ static struct regulator_init_data sdp3430_vpll2 = {
410 .consumer_supplies = &sdp3430_vdvi_supply, 410 .consumer_supplies = &sdp3430_vdvi_supply,
411}; 411};
412 412
413static struct twl4030_codec_audio_data sdp3430_audio = {
414 .audio_mclk = 26000000,
415};
416
417static struct twl4030_codec_data sdp3430_codec = {
418 .audio_mclk = 26000000,
419 .audio = &sdp3430_audio,
420};
421
413static struct twl4030_platform_data sdp3430_twldata = { 422static struct twl4030_platform_data sdp3430_twldata = {
414 .irq_base = TWL4030_IRQ_BASE, 423 .irq_base = TWL4030_IRQ_BASE,
415 .irq_end = TWL4030_IRQ_END, 424 .irq_end = TWL4030_IRQ_END,
@@ -420,6 +429,7 @@ static struct twl4030_platform_data sdp3430_twldata = {
420 .madc = &sdp3430_madc_data, 429 .madc = &sdp3430_madc_data,
421 .keypad = &sdp3430_kp_data, 430 .keypad = &sdp3430_kp_data,
422 .usb = &sdp3430_usb_data, 431 .usb = &sdp3430_usb_data,
432 .codec = &sdp3430_codec,
423 433
424 .vaux1 = &sdp3430_vaux1, 434 .vaux1 = &sdp3430_vaux1,
425 .vaux2 = &sdp3430_vaux2, 435 .vaux2 = &sdp3430_vaux2,
@@ -484,6 +494,18 @@ static void enable_board_wakeup_source(void)
484 omap_cfg_reg(AF26_34XX_SYS_NIRQ); /* T2 interrupt line (keypad) */ 494 omap_cfg_reg(AF26_34XX_SYS_NIRQ); /* T2 interrupt line (keypad) */
485} 495}
486 496
497static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
498
499 .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
500 .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY,
501 .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
502
503 .phy_reset = true,
504 .reset_gpio_port[0] = 57,
505 .reset_gpio_port[1] = 61,
506 .reset_gpio_port[2] = -EINVAL
507};
508
487static void __init omap_3430sdp_init(void) 509static void __init omap_3430sdp_init(void)
488{ 510{
489 omap3430_i2c_init(); 511 omap3430_i2c_init();
@@ -500,6 +522,7 @@ static void __init omap_3430sdp_init(void)
500 usb_musb_init(); 522 usb_musb_init();
501 board_smc91x_init(); 523 board_smc91x_init();
502 enable_board_wakeup_source(); 524 enable_board_wakeup_source();
525 usb_ehci_init(&ehci_pdata);
503} 526}
504 527
505static void __init omap_3430sdp_map_io(void) 528static void __init omap_3430sdp_map_io(void)
@@ -511,7 +534,7 @@ static void __init omap_3430sdp_map_io(void)
511MACHINE_START(OMAP_3430SDP, "OMAP3430 3430SDP board") 534MACHINE_START(OMAP_3430SDP, "OMAP3430 3430SDP board")
512 /* Maintainer: Syed Khasim - Texas Instruments Inc */ 535 /* Maintainer: Syed Khasim - Texas Instruments Inc */
513 .phys_io = 0x48000000, 536 .phys_io = 0x48000000,
514 .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc, 537 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc,
515 .boot_params = 0x80000100, 538 .boot_params = 0x80000100,
516 .map_io = omap_3430sdp_map_io, 539 .map_io = omap_3430sdp_map_io,
517 .init_irq = omap_3430sdp_init_irq, 540 .init_irq = omap_3430sdp_init_irq,
diff --git a/arch/arm/mach-omap2/board-3630sdp.c b/arch/arm/mach-omap2/board-3630sdp.c
new file mode 100755
index 000000000000..348b70b98336
--- /dev/null
+++ b/arch/arm/mach-omap2/board-3630sdp.c
@@ -0,0 +1,101 @@
1/*
2 * Copyright (C) 2009 Texas Instruments Inc.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#include <linux/kernel.h>
10#include <linux/init.h>
11#include <linux/platform_device.h>
12#include <linux/input.h>
13#include <linux/gpio.h>
14
15#include <asm/mach-types.h>
16#include <asm/mach/arch.h>
17
18#include <plat/common.h>
19#include <plat/board.h>
20#include <plat/gpmc-smc91x.h>
21#include <plat/mux.h>
22#include <plat/usb.h>
23
24#include <mach/board-zoom.h>
25
26#include "sdram-hynix-h8mbx00u0mer-0em.h"
27
28#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
29
30static struct omap_smc91x_platform_data board_smc91x_data = {
31 .cs = 3,
32 .flags = GPMC_MUX_ADD_DATA | IORESOURCE_IRQ_LOWLEVEL,
33};
34
35static void __init board_smc91x_init(void)
36{
37 board_smc91x_data.gpio_irq = 158;
38 gpmc_smc91x_init(&board_smc91x_data);
39}
40
41#else
42
43static inline void board_smc91x_init(void)
44{
45}
46
47#endif /* defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) */
48
49static void enable_board_wakeup_source(void)
50{
51 omap_cfg_reg(AF26_34XX_SYS_NIRQ); /* T2 interrupt line (keypad) */
52}
53
54static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
55
56 .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
57 .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY,
58 .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
59
60 .phy_reset = true,
61 .reset_gpio_port[0] = 126,
62 .reset_gpio_port[1] = 61,
63 .reset_gpio_port[2] = -EINVAL
64};
65
66static void __init omap_sdp_map_io(void)
67{
68 omap2_set_globals_343x();
69 omap2_map_common_io();
70}
71
72static struct omap_board_config_kernel sdp_config[] __initdata = {
73};
74
75static void __init omap_sdp_init_irq(void)
76{
77 omap_board_config = sdp_config;
78 omap_board_config_size = ARRAY_SIZE(sdp_config);
79 omap2_init_common_hw(h8mbx00u0mer0em_sdrc_params,
80 h8mbx00u0mer0em_sdrc_params);
81 omap_init_irq();
82 omap_gpio_init();
83}
84
85static void __init omap_sdp_init(void)
86{
87 zoom_peripherals_init();
88 board_smc91x_init();
89 enable_board_wakeup_source();
90 usb_ehci_init(&ehci_pdata);
91}
92
93MACHINE_START(OMAP_3630SDP, "OMAP 3630SDP board")
94 .phys_io = 0x48000000,
95 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc,
96 .boot_params = 0x80000100,
97 .map_io = omap_sdp_map_io,
98 .init_irq = omap_sdp_init_irq,
99 .init_machine = omap_sdp_init,
100 .timer = &omap_timer,
101MACHINE_END
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c
index 609a5a4a7e29..0c6be6b4a7e2 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -23,10 +23,10 @@
23#include <asm/mach/arch.h> 23#include <asm/mach/arch.h>
24#include <asm/mach/map.h> 24#include <asm/mach/map.h>
25 25
26#include <mach/board.h> 26#include <plat/board.h>
27#include <mach/common.h> 27#include <plat/common.h>
28#include <mach/control.h> 28#include <plat/control.h>
29#include <mach/timer-gp.h> 29#include <plat/timer-gp.h>
30#include <asm/hardware/gic.h> 30#include <asm/hardware/gic.h>
31 31
32static struct platform_device sdp4430_lcd_device = { 32static struct platform_device sdp4430_lcd_device = {
@@ -52,8 +52,17 @@ static struct omap_board_config_kernel sdp4430_config[] __initdata = {
52 52
53static void __init gic_init_irq(void) 53static void __init gic_init_irq(void)
54{ 54{
55 gic_dist_init(0, OMAP2_IO_ADDRESS(OMAP44XX_GIC_DIST_BASE), 29); 55 void __iomem *base;
56 gic_cpu_init(0, OMAP2_IO_ADDRESS(OMAP44XX_GIC_CPU_BASE)); 56
57 /* Static mapping, never released */
58 base = ioremap(OMAP44XX_GIC_DIST_BASE, SZ_4K);
59 BUG_ON(!base);
60 gic_dist_init(0, base, 29);
61
62 /* Static mapping, never released */
63 gic_cpu_base_addr = ioremap(OMAP44XX_GIC_CPU_BASE, SZ_512);
64 BUG_ON(!gic_cpu_base_addr);
65 gic_cpu_init(0, gic_cpu_base_addr);
57} 66}
58 67
59static void __init omap_4430sdp_init_irq(void) 68static void __init omap_4430sdp_init_irq(void)
@@ -84,7 +93,7 @@ static void __init omap_4430sdp_map_io(void)
84MACHINE_START(OMAP_4430SDP, "OMAP4430 4430SDP board") 93MACHINE_START(OMAP_4430SDP, "OMAP4430 4430SDP board")
85 /* Maintainer: Santosh Shilimkar - Texas Instruments Inc */ 94 /* Maintainer: Santosh Shilimkar - Texas Instruments Inc */
86 .phys_io = 0x48000000, 95 .phys_io = 0x48000000,
87 .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc, 96 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc,
88 .boot_params = 0x80000100, 97 .boot_params = 0x80000100,
89 .map_io = omap_4430sdp_map_io, 98 .map_io = omap_4430sdp_map_io,
90 .init_irq = omap_4430sdp_init_irq, 99 .init_irq = omap_4430sdp_init_irq,
diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c
new file mode 100644
index 000000000000..415a13d767cc
--- /dev/null
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -0,0 +1,86 @@
1/*
2 * linux/arch/arm/mach-omap2/board-am3517evm.c
3 *
4 * Copyright (C) 2009 Texas Instruments Incorporated
5 * Author: Ranjith Lohithakshan <ranjithl@ti.com>
6 *
7 * Based on mach-omap2/board-omap3evm.c
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation version 2.
12 *
13 * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
14 * whether express or implied; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 */
18
19#include <linux/kernel.h>
20#include <linux/init.h>
21#include <linux/platform_device.h>
22#include <linux/gpio.h>
23
24#include <mach/hardware.h>
25#include <asm/mach-types.h>
26#include <asm/mach/arch.h>
27#include <asm/mach/map.h>
28
29#include <plat/board.h>
30#include <plat/common.h>
31#include <plat/usb.h>
32
33/*
34 * Board initialization
35 */
36static struct omap_board_config_kernel am3517_evm_config[] __initdata = {
37};
38
39static struct platform_device *am3517_evm_devices[] __initdata = {
40};
41
42static void __init am3517_evm_init_irq(void)
43{
44 omap_board_config = am3517_evm_config;
45 omap_board_config_size = ARRAY_SIZE(am3517_evm_config);
46
47 omap2_init_common_hw(NULL, NULL);
48 omap_init_irq();
49 omap_gpio_init();
50}
51
52static struct ehci_hcd_omap_platform_data ehci_pdata __initdata = {
53 .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
54 .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY,
55 .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
56
57 .phy_reset = true,
58 .reset_gpio_port[0] = 57,
59 .reset_gpio_port[1] = -EINVAL,
60 .reset_gpio_port[2] = -EINVAL
61};
62
63static void __init am3517_evm_init(void)
64{
65 platform_add_devices(am3517_evm_devices,
66 ARRAY_SIZE(am3517_evm_devices));
67
68 omap_serial_init();
69 usb_ehci_init(&ehci_pdata);
70}
71
72static void __init am3517_evm_map_io(void)
73{
74 omap2_set_globals_343x();
75 omap2_map_common_io();
76}
77
78MACHINE_START(OMAP3517EVM, "OMAP3517/AM3517 EVM")
79 .phys_io = 0x48000000,
80 .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc,
81 .boot_params = 0x80000100,
82 .map_io = am3517_evm_map_io,
83 .init_irq = am3517_evm_init_irq,
84 .init_machine = am3517_evm_init,
85 .timer = &omap_timer,
86MACHINE_END
diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c
index a1132288c701..8a2ce77a02ec 100644
--- a/arch/arm/mach-omap2/board-apollon.c
+++ b/arch/arm/mach-omap2/board-apollon.c
@@ -33,13 +33,13 @@
33#include <asm/mach/flash.h> 33#include <asm/mach/flash.h>
34 34
35#include <mach/gpio.h> 35#include <mach/gpio.h>
36#include <mach/led.h> 36#include <plat/led.h>
37#include <mach/mux.h> 37#include <plat/mux.h>
38#include <mach/usb.h> 38#include <plat/usb.h>
39#include <mach/board.h> 39#include <plat/board.h>
40#include <mach/common.h> 40#include <plat/common.h>
41#include <mach/gpmc.h> 41#include <plat/gpmc.h>
42#include <mach/control.h> 42#include <plat/control.h>
43 43
44/* LED & Switch macros */ 44/* LED & Switch macros */
45#define LED0_GPIO13 13 45#define LED0_GPIO13 13
@@ -333,7 +333,7 @@ static void __init omap_apollon_map_io(void)
333MACHINE_START(OMAP_APOLLON, "OMAP24xx Apollon") 333MACHINE_START(OMAP_APOLLON, "OMAP24xx Apollon")
334 /* Maintainer: Kyungmin Park <kyungmin.park@samsung.com> */ 334 /* Maintainer: Kyungmin Park <kyungmin.park@samsung.com> */
335 .phys_io = 0x48000000, 335 .phys_io = 0x48000000,
336 .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc, 336 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc,
337 .boot_params = 0x80000100, 337 .boot_params = 0x80000100,
338 .map_io = omap_apollon_map_io, 338 .map_io = omap_apollon_map_io,
339 .init_irq = omap_apollon_init_irq, 339 .init_irq = omap_apollon_init_irq,
diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c
new file mode 100644
index 000000000000..22c45290db63
--- /dev/null
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -0,0 +1,507 @@
1/*
2 * board-cm-t35.c (CompuLab CM-T35 module)
3 *
4 * Copyright (C) 2009 CompuLab, Ltd.
5 * Author: Mike Rapoport <mike@compulab.co.il>
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * version 2 as published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
19 * 02110-1301 USA
20 *
21 */
22
23#include <linux/kernel.h>
24#include <linux/init.h>
25#include <linux/platform_device.h>
26#include <linux/input.h>
27#include <linux/input/matrix_keypad.h>
28#include <linux/delay.h>
29#include <linux/gpio.h>
30
31#include <linux/i2c/at24.h>
32#include <linux/i2c/twl4030.h>
33#include <linux/regulator/machine.h>
34
35#include <asm/mach-types.h>
36#include <asm/mach/arch.h>
37#include <asm/mach/map.h>
38
39#include <plat/board.h>
40#include <plat/common.h>
41#include <plat/mux.h>
42#include <plat/nand.h>
43#include <plat/gpmc.h>
44#include <plat/usb.h>
45
46#include <mach/hardware.h>
47
48#include "sdram-micron-mt46h32m32lf-6.h"
49#include "mmc-twl4030.h"
50
51#define CM_T35_GPIO_PENDOWN 57
52
53#define CM_T35_SMSC911X_CS 5
54#define CM_T35_SMSC911X_GPIO 163
55#define SB_T35_SMSC911X_CS 4
56#define SB_T35_SMSC911X_GPIO 65
57
58#define NAND_BLOCK_SIZE SZ_128K
59#define GPMC_CS0_BASE 0x60
60#define GPMC_CS0_BASE_ADDR (OMAP34XX_GPMC_VIRT + GPMC_CS0_BASE)
61
62#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
63#include <linux/smsc911x.h>
64
65static struct smsc911x_platform_config cm_t35_smsc911x_config = {
66 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
67 .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
68 .flags = SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS,
69 .phy_interface = PHY_INTERFACE_MODE_MII,
70};
71
72static struct resource cm_t35_smsc911x_resources[] = {
73 {
74 .flags = IORESOURCE_MEM,
75 },
76 {
77 .start = OMAP_GPIO_IRQ(CM_T35_SMSC911X_GPIO),
78 .end = OMAP_GPIO_IRQ(CM_T35_SMSC911X_GPIO),
79 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
80 },
81};
82
83static struct platform_device cm_t35_smsc911x_device = {
84 .name = "smsc911x",
85 .id = 0,
86 .num_resources = ARRAY_SIZE(cm_t35_smsc911x_resources),
87 .resource = cm_t35_smsc911x_resources,
88 .dev = {
89 .platform_data = &cm_t35_smsc911x_config,
90 },
91};
92
93static struct resource sb_t35_smsc911x_resources[] = {
94 {
95 .flags = IORESOURCE_MEM,
96 },
97 {
98 .start = OMAP_GPIO_IRQ(SB_T35_SMSC911X_GPIO),
99 .end = OMAP_GPIO_IRQ(SB_T35_SMSC911X_GPIO),
100 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
101 },
102};
103
104static struct platform_device sb_t35_smsc911x_device = {
105 .name = "smsc911x",
106 .id = 1,
107 .num_resources = ARRAY_SIZE(sb_t35_smsc911x_resources),
108 .resource = sb_t35_smsc911x_resources,
109 .dev = {
110 .platform_data = &cm_t35_smsc911x_config,
111 },
112};
113
114static void __init cm_t35_init_smsc911x(struct platform_device *dev,
115 int cs, int irq_gpio)
116{
117 unsigned long cs_mem_base;
118
119 if (gpmc_cs_request(cs, SZ_16M, &cs_mem_base) < 0) {
120 pr_err("CM-T35: Failed request for GPMC mem for smsc911x\n");
121 return;
122 }
123
124 dev->resource[0].start = cs_mem_base + 0x0;
125 dev->resource[0].end = cs_mem_base + 0xff;
126
127 if ((gpio_request(irq_gpio, "ETH IRQ") == 0) &&
128 (gpio_direction_input(irq_gpio) == 0)) {
129 gpio_export(irq_gpio, 0);
130 } else {
131 pr_err("CM-T35: could not obtain gpio for SMSC911X IRQ\n");
132 return;
133 }
134
135 platform_device_register(dev);
136}
137
138static void __init cm_t35_init_ethernet(void)
139{
140 cm_t35_init_smsc911x(&cm_t35_smsc911x_device,
141 CM_T35_SMSC911X_CS, CM_T35_SMSC911X_GPIO);
142 cm_t35_init_smsc911x(&sb_t35_smsc911x_device,
143 SB_T35_SMSC911X_CS, SB_T35_SMSC911X_GPIO);
144}
145#else
146static inline void __init cm_t35_init_ethernet(void) { return; }
147#endif
148
149#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
150#include <linux/leds.h>
151
152static struct gpio_led cm_t35_leds[] = {
153 [0] = {
154 .gpio = 186,
155 .name = "cm-t35:green",
156 .default_trigger = "heartbeat",
157 .active_low = 0,
158 },
159};
160
161static struct gpio_led_platform_data cm_t35_led_pdata = {
162 .num_leds = ARRAY_SIZE(cm_t35_leds),
163 .leds = cm_t35_leds,
164};
165
166static struct platform_device cm_t35_led_device = {
167 .name = "leds-gpio",
168 .id = -1,
169 .dev = {
170 .platform_data = &cm_t35_led_pdata,
171 },
172};
173
174static void __init cm_t35_init_led(void)
175{
176 platform_device_register(&cm_t35_led_device);
177}
178#else
179static inline void cm_t35_init_led(void) {}
180#endif
181
182#if defined(CONFIG_MTD_NAND_OMAP2) || defined(CONFIG_MTD_NAND_OMAP2_MODULE)
183#include <linux/mtd/mtd.h>
184#include <linux/mtd/nand.h>
185#include <linux/mtd/partitions.h>
186
187static struct mtd_partition cm_t35_nand_partitions[] = {
188 {
189 .name = "xloader",
190 .offset = 0, /* Offset = 0x00000 */
191 .size = 4 * NAND_BLOCK_SIZE,
192 .mask_flags = MTD_WRITEABLE
193 },
194 {
195 .name = "uboot",
196 .offset = MTDPART_OFS_APPEND, /* Offset = 0x80000 */
197 .size = 15 * NAND_BLOCK_SIZE,
198 },
199 {
200 .name = "uboot environment",
201 .offset = MTDPART_OFS_APPEND, /* Offset = 0x260000 */
202 .size = 2 * NAND_BLOCK_SIZE,
203 },
204 {
205 .name = "linux",
206 .offset = MTDPART_OFS_APPEND, /* Offset = 0x280000 */
207 .size = 32 * NAND_BLOCK_SIZE,
208 },
209 {
210 .name = "rootfs",
211 .offset = MTDPART_OFS_APPEND, /* Offset = 0x680000 */
212 .size = MTDPART_SIZ_FULL,
213 },
214};
215
216static struct omap_nand_platform_data cm_t35_nand_data = {
217 .parts = cm_t35_nand_partitions,
218 .nr_parts = ARRAY_SIZE(cm_t35_nand_partitions),
219 .dma_channel = -1, /* disable DMA in OMAP NAND driver */
220 .cs = 0,
221 .gpmc_cs_baseaddr = (void __iomem *)GPMC_CS0_BASE_ADDR,
222 .gpmc_baseaddr = (void __iomem *)OMAP34XX_GPMC_VIRT,
223
224};
225
226static struct resource cm_t35_nand_resource = {
227 .flags = IORESOURCE_MEM,
228};
229
230static struct platform_device cm_t35_nand_device = {
231 .name = "omap2-nand",
232 .id = -1,
233 .num_resources = 1,
234 .resource = &cm_t35_nand_resource,
235 .dev = {
236 .platform_data = &cm_t35_nand_data,
237 },
238};
239
240static void __init cm_t35_init_nand(void)
241{
242 if (platform_device_register(&cm_t35_nand_device) < 0)
243 pr_err("CM-T35: Unable to register NAND device\n");
244}
245#else
246static inline void cm_t35_init_nand(void) {}
247#endif
248
249#if defined(CONFIG_TOUCHSCREEN_ADS7846) || \
250 defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
251#include <linux/spi/spi.h>
252#include <linux/spi/ads7846.h>
253
254#include <plat/mcspi.h>
255
256static struct omap2_mcspi_device_config ads7846_mcspi_config = {
257 .turbo_mode = 0,
258 .single_channel = 1, /* 0: slave, 1: master */
259};
260
261static int ads7846_get_pendown_state(void)
262{
263 return !gpio_get_value(CM_T35_GPIO_PENDOWN);
264}
265
266static struct ads7846_platform_data ads7846_config = {
267 .x_max = 0x0fff,
268 .y_max = 0x0fff,
269 .x_plate_ohms = 180,
270 .pressure_max = 255,
271 .debounce_max = 10,
272 .debounce_tol = 3,
273 .debounce_rep = 1,
274 .get_pendown_state = ads7846_get_pendown_state,
275 .keep_vref_on = 1,
276};
277
278static struct spi_board_info cm_t35_spi_board_info[] __initdata = {
279 {
280 .modalias = "ads7846",
281 .bus_num = 1,
282 .chip_select = 0,
283 .max_speed_hz = 1500000,
284 .controller_data = &ads7846_mcspi_config,
285 .irq = OMAP_GPIO_IRQ(CM_T35_GPIO_PENDOWN),
286 .platform_data = &ads7846_config,
287 },
288};
289
290static void __init cm_t35_init_ads7846(void)
291{
292 if ((gpio_request(CM_T35_GPIO_PENDOWN, "ADS7846_PENDOWN") == 0) &&
293 (gpio_direction_input(CM_T35_GPIO_PENDOWN) == 0)) {
294 gpio_export(CM_T35_GPIO_PENDOWN, 0);
295 } else {
296 pr_err("CM-T35: could not obtain gpio for ADS7846_PENDOWN\n");
297 return;
298 }
299
300 spi_register_board_info(cm_t35_spi_board_info,
301 ARRAY_SIZE(cm_t35_spi_board_info));
302}
303#else
304static inline void cm_t35_init_ads7846(void) {}
305#endif
306
307static struct regulator_consumer_supply cm_t35_vmmc1_supply = {
308 .supply = "vmmc",
309};
310
311static struct regulator_consumer_supply cm_t35_vsim_supply = {
312 .supply = "vmmc_aux",
313};
314
315/* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */
316static struct regulator_init_data cm_t35_vmmc1 = {
317 .constraints = {
318 .min_uV = 1850000,
319 .max_uV = 3150000,
320 .valid_modes_mask = REGULATOR_MODE_NORMAL
321 | REGULATOR_MODE_STANDBY,
322 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
323 | REGULATOR_CHANGE_MODE
324 | REGULATOR_CHANGE_STATUS,
325 },
326 .num_consumer_supplies = 1,
327 .consumer_supplies = &cm_t35_vmmc1_supply,
328};
329
330/* VSIM for MMC1 pins DAT4..DAT7 (2 mA, plus card == max 50 mA) */
331static struct regulator_init_data cm_t35_vsim = {
332 .constraints = {
333 .min_uV = 1800000,
334 .max_uV = 3000000,
335 .valid_modes_mask = REGULATOR_MODE_NORMAL
336 | REGULATOR_MODE_STANDBY,
337 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
338 | REGULATOR_CHANGE_MODE
339 | REGULATOR_CHANGE_STATUS,
340 },
341 .num_consumer_supplies = 1,
342 .consumer_supplies = &cm_t35_vsim_supply,
343};
344
345static struct twl4030_usb_data cm_t35_usb_data = {
346 .usb_mode = T2_USB_MODE_ULPI,
347};
348
349static int cm_t35_keymap[] = {
350 KEY(0, 0, KEY_A), KEY(0, 1, KEY_B), KEY(0, 2, KEY_LEFT),
351 KEY(1, 0, KEY_UP), KEY(1, 1, KEY_ENTER), KEY(1, 2, KEY_DOWN),
352 KEY(2, 0, KEY_RIGHT), KEY(2, 1, KEY_C), KEY(2, 2, KEY_D),
353};
354
355static struct matrix_keymap_data cm_t35_keymap_data = {
356 .keymap = cm_t35_keymap,
357 .keymap_size = ARRAY_SIZE(cm_t35_keymap),
358};
359
360static struct twl4030_keypad_data cm_t35_kp_data = {
361 .keymap_data = &cm_t35_keymap_data,
362 .rows = 3,
363 .cols = 3,
364 .rep = 1,
365};
366
367static struct twl4030_hsmmc_info mmc[] = {
368 {
369 .mmc = 1,
370 .wires = 4,
371 .gpio_cd = -EINVAL,
372 .gpio_wp = -EINVAL,
373
374 },
375 {
376 .mmc = 2,
377 .wires = 4,
378 .transceiver = 1,
379 .gpio_cd = -EINVAL,
380 .gpio_wp = -EINVAL,
381 .ocr_mask = 0x00100000, /* 3.3V */
382 },
383 {} /* Terminator */
384};
385
386static struct ehci_hcd_omap_platform_data ehci_pdata = {
387 .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
388 .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY,
389 .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
390
391 .phy_reset = true,
392 .reset_gpio_port[0] = -EINVAL,
393 .reset_gpio_port[1] = -EINVAL,
394 .reset_gpio_port[2] = -EINVAL
395};
396
397static int cm_t35_twl_gpio_setup(struct device *dev, unsigned gpio,
398 unsigned ngpio)
399{
400 int wlan_rst = gpio + 2;
401
402 if ((gpio_request(wlan_rst, "WLAN RST") == 0) &&
403 (gpio_direction_output(wlan_rst, 1) == 0)) {
404 gpio_export(wlan_rst, 0);
405
406 udelay(10);
407 gpio_set_value(wlan_rst, 0);
408 udelay(10);
409 gpio_set_value(wlan_rst, 1);
410 } else {
411 pr_err("CM-T35: could not obtain gpio for WiFi reset\n");
412 }
413
414 /* gpio + 0 is "mmc0_cd" (input/IRQ) */
415 mmc[0].gpio_cd = gpio + 0;
416 twl4030_mmc_init(mmc);
417
418 /* link regulators to MMC adapters */
419 cm_t35_vmmc1_supply.dev = mmc[0].dev;
420 cm_t35_vsim_supply.dev = mmc[0].dev;
421
422 /* setup USB with proper PHY reset GPIOs */
423 ehci_pdata.reset_gpio_port[0] = gpio + 6;
424 ehci_pdata.reset_gpio_port[1] = gpio + 7;
425
426 usb_ehci_init(&ehci_pdata);
427
428 return 0;
429}
430
431static struct twl4030_gpio_platform_data cm_t35_gpio_data = {
432 .gpio_base = OMAP_MAX_GPIO_LINES,
433 .irq_base = TWL4030_GPIO_IRQ_BASE,
434 .irq_end = TWL4030_GPIO_IRQ_END,
435 .setup = cm_t35_twl_gpio_setup,
436};
437
438static struct twl4030_platform_data cm_t35_twldata = {
439 .irq_base = TWL4030_IRQ_BASE,
440 .irq_end = TWL4030_IRQ_END,
441
442 /* platform_data for children goes here */
443 .keypad = &cm_t35_kp_data,
444 .usb = &cm_t35_usb_data,
445 .gpio = &cm_t35_gpio_data,
446 .vmmc1 = &cm_t35_vmmc1,
447 .vsim = &cm_t35_vsim,
448};
449
450static struct i2c_board_info __initdata cm_t35_i2c_boardinfo[] = {
451 {
452 I2C_BOARD_INFO("tps65930", 0x48),
453 .flags = I2C_CLIENT_WAKE,
454 .irq = INT_34XX_SYS_NIRQ,
455 .platform_data = &cm_t35_twldata,
456 },
457};
458
459static void __init cm_t35_init_i2c(void)
460{
461 omap_register_i2c_bus(1, 2600, cm_t35_i2c_boardinfo,
462 ARRAY_SIZE(cm_t35_i2c_boardinfo));
463}
464
465static struct omap_board_config_kernel cm_t35_config[] __initdata = {
466};
467
468static void __init cm_t35_init_irq(void)
469{
470 omap_board_config = cm_t35_config;
471 omap_board_config_size = ARRAY_SIZE(cm_t35_config);
472
473 omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
474 mt46h32m32lf6_sdrc_params);
475 omap_init_irq();
476 omap_gpio_init();
477}
478
479static void __init cm_t35_map_io(void)
480{
481 omap2_set_globals_343x();
482 omap2_map_common_io();
483}
484
485static void __init cm_t35_init(void)
486{
487 omap_serial_init();
488 cm_t35_init_i2c();
489 cm_t35_init_nand();
490 cm_t35_init_ads7846();
491 cm_t35_init_ethernet();
492 cm_t35_init_led();
493
494 usb_musb_init();
495
496 omap_cfg_reg(AF26_34XX_SYS_NIRQ);
497}
498
499MACHINE_START(CM_T35, "Compulab CM-T35")
500 .phys_io = 0x48000000,
501 .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc,
502 .boot_params = 0x80000100,
503 .map_io = cm_t35_map_io,
504 .init_irq = cm_t35_init_irq,
505 .init_machine = cm_t35_init,
506 .timer = &omap_timer,
507MACHINE_END
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
index 2e09a1c444cb..7e6e6ca88be5 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -26,10 +26,10 @@
26#include <asm/mach/map.h> 26#include <asm/mach/map.h>
27 27
28#include <mach/gpio.h> 28#include <mach/gpio.h>
29#include <mach/mux.h> 29#include <plat/mux.h>
30#include <mach/usb.h> 30#include <plat/usb.h>
31#include <mach/board.h> 31#include <plat/board.h>
32#include <mach/common.h> 32#include <plat/common.h>
33 33
34static struct omap_board_config_kernel generic_config[] = { 34static struct omap_board_config_kernel generic_config[] = {
35}; 35};
@@ -56,7 +56,7 @@ static void __init omap_generic_map_io(void)
56MACHINE_START(OMAP_GENERIC, "Generic OMAP24xx") 56MACHINE_START(OMAP_GENERIC, "Generic OMAP24xx")
57 /* Maintainer: Paul Mundt <paul.mundt@nokia.com> */ 57 /* Maintainer: Paul Mundt <paul.mundt@nokia.com> */
58 .phys_io = 0x48000000, 58 .phys_io = 0x48000000,
59 .io_pg_offst = ((0xd8000000) >> 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 .init_irq = omap_generic_init_irq, 62 .init_irq = omap_generic_init_irq,
diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c
index eaa02d012c5c..cfb7f1257d20 100644
--- a/arch/arm/mach-omap2/board-h4.c
+++ b/arch/arm/mach-omap2/board-h4.c
@@ -31,16 +31,16 @@
31#include <asm/mach/map.h> 31#include <asm/mach/map.h>
32#include <asm/mach/flash.h> 32#include <asm/mach/flash.h>
33 33
34#include <mach/control.h> 34#include <plat/control.h>
35#include <mach/gpio.h> 35#include <mach/gpio.h>
36#include <mach/mux.h> 36#include <plat/mux.h>
37#include <mach/usb.h> 37#include <plat/usb.h>
38#include <mach/board.h> 38#include <plat/board.h>
39#include <mach/common.h> 39#include <plat/common.h>
40#include <mach/keypad.h> 40#include <plat/keypad.h>
41#include <mach/menelaus.h> 41#include <plat/menelaus.h>
42#include <mach/dma.h> 42#include <plat/dma.h>
43#include <mach/gpmc.h> 43#include <plat/gpmc.h>
44 44
45#define H4_FLASH_CS 0 45#define H4_FLASH_CS 0
46#define H4_SMC91X_CS 1 46#define H4_SMC91X_CS 1
@@ -376,7 +376,7 @@ static void __init omap_h4_map_io(void)
376MACHINE_START(OMAP_H4, "OMAP2420 H4 board") 376MACHINE_START(OMAP_H4, "OMAP2420 H4 board")
377 /* Maintainer: Paul Mundt <paul.mundt@nokia.com> */ 377 /* Maintainer: Paul Mundt <paul.mundt@nokia.com> */
378 .phys_io = 0x48000000, 378 .phys_io = 0x48000000,
379 .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc, 379 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc,
380 .boot_params = 0x80000100, 380 .boot_params = 0x80000100,
381 .map_io = omap_h4_map_io, 381 .map_io = omap_h4_map_io,
382 .init_irq = omap_h4_init_irq, 382 .init_irq = omap_h4_init_irq,
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
new file mode 100644
index 000000000000..fa62e80c13b7
--- /dev/null
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -0,0 +1,251 @@
1/*
2 * Copyright (C) 2009 Integration Software and Electronic Engineering.
3 *
4 * Modified from mach-omap2/board-generic.c
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
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/platform_device.h>
14#include <linux/delay.h>
15#include <linux/err.h>
16#include <linux/clk.h>
17#include <linux/io.h>
18#include <linux/gpio.h>
19#include <linux/interrupt.h>
20
21#include <linux/regulator/machine.h>
22#include <linux/i2c/twl4030.h>
23
24#include <asm/mach-types.h>
25#include <asm/mach/arch.h>
26
27#include <plat/board.h>
28#include <plat/common.h>
29#include <plat/gpmc.h>
30#include <plat/mux.h>
31#include <plat/usb.h>
32
33#include "mmc-twl4030.h"
34
35#define IGEP2_SMSC911X_CS 5
36#define IGEP2_SMSC911X_GPIO 176
37#define IGEP2_GPIO_USBH_NRESET 24
38#define IGEP2_GPIO_LED0_RED 26
39#define IGEP2_GPIO_LED0_GREEN 27
40#define IGEP2_GPIO_LED1_RED 28
41
42#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
43
44#include <linux/smsc911x.h>
45
46static struct smsc911x_platform_config igep2_smsc911x_config = {
47 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
48 .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
49 .flags = SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS ,
50 .phy_interface = PHY_INTERFACE_MODE_MII,
51};
52
53static struct resource igep2_smsc911x_resources[] = {
54 {
55 .flags = IORESOURCE_MEM,
56 },
57 {
58 .start = OMAP_GPIO_IRQ(IGEP2_SMSC911X_GPIO),
59 .end = OMAP_GPIO_IRQ(IGEP2_SMSC911X_GPIO),
60 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
61 },
62};
63
64static struct platform_device igep2_smsc911x_device = {
65 .name = "smsc911x",
66 .id = 0,
67 .num_resources = ARRAY_SIZE(igep2_smsc911x_resources),
68 .resource = igep2_smsc911x_resources,
69 .dev = {
70 .platform_data = &igep2_smsc911x_config,
71 },
72};
73
74static inline void __init igep2_init_smsc911x(void)
75{
76 unsigned long cs_mem_base;
77
78 if (gpmc_cs_request(IGEP2_SMSC911X_CS, SZ_16M, &cs_mem_base) < 0) {
79 pr_err("IGEP v2: Failed request for GPMC mem for smsc911x\n");
80 gpmc_cs_free(IGEP2_SMSC911X_CS);
81 return;
82 }
83
84 igep2_smsc911x_resources[0].start = cs_mem_base + 0x0;
85 igep2_smsc911x_resources[0].end = cs_mem_base + 0xff;
86
87 if ((gpio_request(IGEP2_SMSC911X_GPIO, "SMSC911X IRQ") == 0) &&
88 (gpio_direction_input(IGEP2_SMSC911X_GPIO) == 0)) {
89 gpio_export(IGEP2_SMSC911X_GPIO, 0);
90 } else {
91 pr_err("IGEP v2: Could not obtain gpio for for SMSC911X IRQ\n");
92 return;
93 }
94
95 platform_device_register(&igep2_smsc911x_device);
96}
97
98#else
99static inline void __init igep2_init_smsc911x(void) { }
100#endif
101
102static struct omap_board_config_kernel igep2_config[] __initdata = {
103};
104
105static struct regulator_consumer_supply igep2_vmmc1_supply = {
106 .supply = "vmmc",
107};
108
109/* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */
110static struct regulator_init_data igep2_vmmc1 = {
111 .constraints = {
112 .min_uV = 1850000,
113 .max_uV = 3150000,
114 .valid_modes_mask = REGULATOR_MODE_NORMAL
115 | REGULATOR_MODE_STANDBY,
116 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
117 | REGULATOR_CHANGE_MODE
118 | REGULATOR_CHANGE_STATUS,
119 },
120 .num_consumer_supplies = 1,
121 .consumer_supplies = &igep2_vmmc1_supply,
122};
123
124static struct twl4030_hsmmc_info mmc[] = {
125 {
126 .mmc = 1,
127 .wires = 4,
128 .gpio_cd = -EINVAL,
129 .gpio_wp = -EINVAL,
130 },
131 {
132 .mmc = 2,
133 .wires = 4,
134 .gpio_cd = -EINVAL,
135 .gpio_wp = -EINVAL,
136 },
137 {} /* Terminator */
138};
139
140static int igep2_twl_gpio_setup(struct device *dev,
141 unsigned gpio, unsigned ngpio)
142{
143 /* gpio + 0 is "mmc0_cd" (input/IRQ) */
144 mmc[0].gpio_cd = gpio + 0;
145 twl4030_mmc_init(mmc);
146
147 /* link regulators to MMC adapters ... we "know" the
148 * regulators will be set up only *after* we return.
149 */
150 igep2_vmmc1_supply.dev = mmc[0].dev;
151
152 return 0;
153};
154
155static struct twl4030_gpio_platform_data igep2_gpio_data = {
156 .gpio_base = OMAP_MAX_GPIO_LINES,
157 .irq_base = TWL4030_GPIO_IRQ_BASE,
158 .irq_end = TWL4030_GPIO_IRQ_END,
159 .use_leds = false,
160 .setup = igep2_twl_gpio_setup,
161};
162
163static struct twl4030_usb_data igep2_usb_data = {
164 .usb_mode = T2_USB_MODE_ULPI,
165};
166
167static void __init igep2_init_irq(void)
168{
169 omap_board_config = igep2_config;
170 omap_board_config_size = ARRAY_SIZE(igep2_config);
171 omap2_init_common_hw(NULL, NULL);
172 omap_init_irq();
173 omap_gpio_init();
174}
175
176static struct twl4030_platform_data igep2_twldata = {
177 .irq_base = TWL4030_IRQ_BASE,
178 .irq_end = TWL4030_IRQ_END,
179
180 /* platform_data for children goes here */
181 .usb = &igep2_usb_data,
182 .gpio = &igep2_gpio_data,
183 .vmmc1 = &igep2_vmmc1,
184
185};
186
187static struct i2c_board_info __initdata igep2_i2c_boardinfo[] = {
188 {
189 I2C_BOARD_INFO("twl4030", 0x48),
190 .flags = I2C_CLIENT_WAKE,
191 .irq = INT_34XX_SYS_NIRQ,
192 .platform_data = &igep2_twldata,
193 },
194};
195
196static int __init igep2_i2c_init(void)
197{
198 omap_register_i2c_bus(1, 2600, igep2_i2c_boardinfo,
199 ARRAY_SIZE(igep2_i2c_boardinfo));
200 /* Bus 3 is attached to the DVI port where devices like the pico DLP
201 * projector don't work reliably with 400kHz */
202 omap_register_i2c_bus(3, 100, NULL, 0);
203 return 0;
204}
205
206static void __init igep2_init(void)
207{
208 igep2_i2c_init();
209 omap_serial_init();
210 usb_musb_init();
211
212 igep2_init_smsc911x();
213
214 /* GPIO userspace leds */
215 if ((gpio_request(IGEP2_GPIO_LED0_RED, "GPIO_LED0_RED") == 0) &&
216 (gpio_direction_output(IGEP2_GPIO_LED0_RED, 1) == 0)) {
217 gpio_export(IGEP2_GPIO_LED0_RED, 0);
218 gpio_set_value(IGEP2_GPIO_LED0_RED, 0);
219 } else
220 pr_warning("IGEP v2: Could not obtain gpio GPIO_LED0_RED\n");
221
222 if ((gpio_request(IGEP2_GPIO_LED0_GREEN, "GPIO_LED0_GREEN") == 0) &&
223 (gpio_direction_output(IGEP2_GPIO_LED0_GREEN, 1) == 0)) {
224 gpio_export(IGEP2_GPIO_LED0_GREEN, 0);
225 gpio_set_value(IGEP2_GPIO_LED0_GREEN, 0);
226 } else
227 pr_warning("IGEP v2: Could not obtain gpio GPIO_LED0_GREEN\n");
228
229 if ((gpio_request(IGEP2_GPIO_LED1_RED, "GPIO_LED1_RED") == 0) &&
230 (gpio_direction_output(IGEP2_GPIO_LED1_RED, 1) == 0)) {
231 gpio_export(IGEP2_GPIO_LED1_RED, 0);
232 gpio_set_value(IGEP2_GPIO_LED1_RED, 0);
233 } else
234 pr_warning("IGEP v2: Could not obtain gpio GPIO_LED1_RED\n");
235}
236
237static void __init igep2_map_io(void)
238{
239 omap2_set_globals_343x();
240 omap2_map_common_io();
241}
242
243MACHINE_START(IGEP0020, "IGEP v2 board")
244 .phys_io = 0x48000000,
245 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc,
246 .boot_params = 0x80000100,
247 .map_io = igep2_map_io,
248 .init_irq = igep2_init_irq,
249 .init_machine = igep2_init,
250 .timer = &omap_timer,
251MACHINE_END
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index d57ec2f4d0a9..c062238fe881 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -33,15 +33,15 @@
33#include <asm/mach/arch.h> 33#include <asm/mach/arch.h>
34#include <asm/mach/map.h> 34#include <asm/mach/map.h>
35 35
36#include <mach/mcspi.h> 36#include <plat/mcspi.h>
37#include <mach/gpio.h> 37#include <mach/gpio.h>
38#include <mach/board.h> 38#include <plat/board.h>
39#include <mach/common.h> 39#include <plat/common.h>
40#include <mach/gpmc.h> 40#include <plat/gpmc.h>
41 41
42#include <asm/delay.h> 42#include <asm/delay.h>
43#include <mach/control.h> 43#include <plat/control.h>
44#include <mach/usb.h> 44#include <plat/usb.h>
45 45
46#include "mmc-twl4030.h" 46#include "mmc-twl4030.h"
47 47
@@ -399,7 +399,7 @@ static void __init omap_ldp_map_io(void)
399 399
400MACHINE_START(OMAP_LDP, "OMAP LDP board") 400MACHINE_START(OMAP_LDP, "OMAP LDP board")
401 .phys_io = 0x48000000, 401 .phys_io = 0x48000000,
402 .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc, 402 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc,
403 .boot_params = 0x80000100, 403 .boot_params = 0x80000100,
404 .map_io = omap_ldp_map_io, 404 .map_io = omap_ldp_map_io,
405 .init_irq = omap_ldp_init_irq, 405 .init_irq = omap_ldp_init_irq,
diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c
index 8341632d260b..764ab1ed576d 100644
--- a/arch/arm/mach-omap2/board-n8x0.c
+++ b/arch/arm/mach-omap2/board-n8x0.c
@@ -23,12 +23,12 @@
23#include <asm/mach/arch.h> 23#include <asm/mach/arch.h>
24#include <asm/mach-types.h> 24#include <asm/mach-types.h>
25 25
26#include <mach/board.h> 26#include <plat/board.h>
27#include <mach/common.h> 27#include <plat/common.h>
28#include <mach/irqs.h> 28#include <mach/irqs.h>
29#include <mach/mcspi.h> 29#include <plat/mcspi.h>
30#include <mach/onenand.h> 30#include <plat/onenand.h>
31#include <mach/serial.h> 31#include <plat/serial.h>
32 32
33static struct omap2_mcspi_device_config p54spi_mcspi_config = { 33static struct omap2_mcspi_device_config p54spi_mcspi_config = {
34 .turbo_mode = 0, 34 .turbo_mode = 0,
@@ -121,7 +121,7 @@ static void __init n8x0_init_machine(void)
121 121
122MACHINE_START(NOKIA_N800, "Nokia N800") 122MACHINE_START(NOKIA_N800, "Nokia N800")
123 .phys_io = 0x48000000, 123 .phys_io = 0x48000000,
124 .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc, 124 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc,
125 .boot_params = 0x80000100, 125 .boot_params = 0x80000100,
126 .map_io = n8x0_map_io, 126 .map_io = n8x0_map_io,
127 .init_irq = n8x0_init_irq, 127 .init_irq = n8x0_init_irq,
@@ -131,7 +131,7 @@ MACHINE_END
131 131
132MACHINE_START(NOKIA_N810, "Nokia N810") 132MACHINE_START(NOKIA_N810, "Nokia N810")
133 .phys_io = 0x48000000, 133 .phys_io = 0x48000000,
134 .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc, 134 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc,
135 .boot_params = 0x80000100, 135 .boot_params = 0x80000100,
136 .map_io = n8x0_map_io, 136 .map_io = n8x0_map_io,
137 .init_irq = n8x0_init_irq, 137 .init_irq = n8x0_init_irq,
@@ -141,7 +141,7 @@ MACHINE_END
141 141
142MACHINE_START(NOKIA_N810_WIMAX, "Nokia N810 WiMAX") 142MACHINE_START(NOKIA_N810_WIMAX, "Nokia N810 WiMAX")
143 .phys_io = 0x48000000, 143 .phys_io = 0x48000000,
144 .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc, 144 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc,
145 .boot_params = 0x80000100, 145 .boot_params = 0x80000100,
146 .map_io = n8x0_map_io, 146 .map_io = n8x0_map_io,
147 .init_irq = n8x0_init_irq, 147 .init_irq = n8x0_init_irq,
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 08b0816afa61..41480bd0e58a 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -37,13 +37,13 @@
37#include <asm/mach/map.h> 37#include <asm/mach/map.h>
38#include <asm/mach/flash.h> 38#include <asm/mach/flash.h>
39 39
40#include <mach/board.h> 40#include <plat/board.h>
41#include <mach/common.h> 41#include <plat/common.h>
42#include <mach/gpmc.h> 42#include <plat/gpmc.h>
43#include <mach/nand.h> 43#include <plat/nand.h>
44#include <mach/mux.h> 44#include <plat/mux.h>
45#include <mach/usb.h> 45#include <plat/usb.h>
46#include <mach/timer-gp.h> 46#include <plat/timer-gp.h>
47 47
48#include "mmc-twl4030.h" 48#include "mmc-twl4030.h"
49 49
@@ -254,6 +254,15 @@ static struct twl4030_usb_data beagle_usb_data = {
254 .usb_mode = T2_USB_MODE_ULPI, 254 .usb_mode = T2_USB_MODE_ULPI,
255}; 255};
256 256
257static struct twl4030_codec_audio_data beagle_audio_data = {
258 .audio_mclk = 26000000,
259};
260
261static struct twl4030_codec_data beagle_codec_data = {
262 .audio_mclk = 26000000,
263 .audio = &beagle_audio_data,
264};
265
257static struct twl4030_platform_data beagle_twldata = { 266static struct twl4030_platform_data beagle_twldata = {
258 .irq_base = TWL4030_IRQ_BASE, 267 .irq_base = TWL4030_IRQ_BASE,
259 .irq_end = TWL4030_IRQ_END, 268 .irq_end = TWL4030_IRQ_END,
@@ -261,6 +270,7 @@ static struct twl4030_platform_data beagle_twldata = {
261 /* platform_data for children goes here */ 270 /* platform_data for children goes here */
262 .usb = &beagle_usb_data, 271 .usb = &beagle_usb_data,
263 .gpio = &beagle_gpio_data, 272 .gpio = &beagle_gpio_data,
273 .codec = &beagle_codec_data,
264 .vmmc1 = &beagle_vmmc1, 274 .vmmc1 = &beagle_vmmc1,
265 .vsim = &beagle_vsim, 275 .vsim = &beagle_vsim,
266 .vdac = &beagle_vdac, 276 .vdac = &beagle_vdac,
@@ -400,6 +410,18 @@ static void __init omap3beagle_flash_init(void)
400 } 410 }
401} 411}
402 412
413static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
414
415 .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
416 .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY,
417 .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
418
419 .phy_reset = true,
420 .reset_gpio_port[0] = -EINVAL,
421 .reset_gpio_port[1] = 147,
422 .reset_gpio_port[2] = -EINVAL
423};
424
403static void __init omap3_beagle_init(void) 425static void __init omap3_beagle_init(void)
404{ 426{
405 omap3_beagle_i2c_init(); 427 omap3_beagle_i2c_init();
@@ -413,6 +435,7 @@ static void __init omap3_beagle_init(void)
413 gpio_direction_output(170, true); 435 gpio_direction_output(170, true);
414 436
415 usb_musb_init(); 437 usb_musb_init();
438 usb_ehci_init(&ehci_pdata);
416 omap3beagle_flash_init(); 439 omap3beagle_flash_init();
417 440
418 /* Ensure SDRC pins are mux'd for self-refresh */ 441 /* Ensure SDRC pins are mux'd for self-refresh */
@@ -429,7 +452,7 @@ static void __init omap3_beagle_map_io(void)
429MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board") 452MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board")
430 /* Maintainer: Syed Mohammed Khasim - http://beagleboard.org */ 453 /* Maintainer: Syed Mohammed Khasim - http://beagleboard.org */
431 .phys_io = 0x48000000, 454 .phys_io = 0x48000000,
432 .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc, 455 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc,
433 .boot_params = 0x80000100, 456 .boot_params = 0x80000100,
434 .map_io = omap3_beagle_map_io, 457 .map_io = omap3_beagle_map_io,
435 .init_irq = omap3_beagle_init_irq, 458 .init_irq = omap3_beagle_init_irq,
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index 4c4d7f8dbd72..5efc2e9068db 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -22,34 +22,74 @@
22#include <linux/input.h> 22#include <linux/input.h>
23#include <linux/input/matrix_keypad.h> 23#include <linux/input/matrix_keypad.h>
24#include <linux/leds.h> 24#include <linux/leds.h>
25#include <linux/interrupt.h>
25 26
26#include <linux/spi/spi.h> 27#include <linux/spi/spi.h>
27#include <linux/spi/ads7846.h> 28#include <linux/spi/ads7846.h>
28#include <linux/i2c/twl4030.h> 29#include <linux/i2c/twl4030.h>
29#include <linux/usb/otg.h> 30#include <linux/usb/otg.h>
31#include <linux/smsc911x.h>
32
33#include <linux/regulator/machine.h>
30 34
31#include <mach/hardware.h> 35#include <mach/hardware.h>
32#include <asm/mach-types.h> 36#include <asm/mach-types.h>
33#include <asm/mach/arch.h> 37#include <asm/mach/arch.h>
34#include <asm/mach/map.h> 38#include <asm/mach/map.h>
35 39
36#include <mach/board.h> 40#include <plat/board.h>
37#include <mach/mux.h> 41#include <plat/mux.h>
38#include <mach/usb.h> 42#include <plat/usb.h>
39#include <mach/common.h> 43#include <plat/common.h>
40#include <mach/mcspi.h> 44#include <plat/mcspi.h>
41 45
42#include "sdram-micron-mt46h32m32lf-6.h" 46#include "sdram-micron-mt46h32m32lf-6.h"
43#include "mmc-twl4030.h" 47#include "mmc-twl4030.h"
44 48
45#define OMAP3_EVM_TS_GPIO 175 49#define OMAP3_EVM_TS_GPIO 175
50#define OMAP3_EVM_EHCI_VBUS 22
51#define OMAP3_EVM_EHCI_SELECT 61
46 52
47#define OMAP3EVM_ETHR_START 0x2c000000 53#define OMAP3EVM_ETHR_START 0x2c000000
48#define OMAP3EVM_ETHR_SIZE 1024 54#define OMAP3EVM_ETHR_SIZE 1024
55#define OMAP3EVM_ETHR_ID_REV 0x50
49#define OMAP3EVM_ETHR_GPIO_IRQ 176 56#define OMAP3EVM_ETHR_GPIO_IRQ 176
50#define OMAP3EVM_SMC911X_CS 5 57#define OMAP3EVM_SMSC911X_CS 5
58
59static u8 omap3_evm_version;
60
61u8 get_omap3_evm_rev(void)
62{
63 return omap3_evm_version;
64}
65EXPORT_SYMBOL(get_omap3_evm_rev);
66
67static void __init omap3_evm_get_revision(void)
68{
69 void __iomem *ioaddr;
70 unsigned int smsc_id;
71
72 /* Ethernet PHY ID is stored at ID_REV register */
73 ioaddr = ioremap_nocache(OMAP3EVM_ETHR_START, SZ_1K);
74 if (!ioaddr)
75 return;
76 smsc_id = readl(ioaddr + OMAP3EVM_ETHR_ID_REV) & 0xFFFF0000;
77 iounmap(ioaddr);
78
79 switch (smsc_id) {
80 /*SMSC9115 chipset*/
81 case 0x01150000:
82 omap3_evm_version = OMAP3EVM_BOARD_GEN_1;
83 break;
84 /*SMSC 9220 chipset*/
85 case 0x92200000:
86 default:
87 omap3_evm_version = OMAP3EVM_BOARD_GEN_2;
88 }
89}
51 90
52static struct resource omap3evm_smc911x_resources[] = { 91#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
92static struct resource omap3evm_smsc911x_resources[] = {
53 [0] = { 93 [0] = {
54 .start = OMAP3EVM_ETHR_START, 94 .start = OMAP3EVM_ETHR_START,
55 .end = (OMAP3EVM_ETHR_START + OMAP3EVM_ETHR_SIZE - 1), 95 .end = (OMAP3EVM_ETHR_START + OMAP3EVM_ETHR_SIZE - 1),
@@ -58,24 +98,34 @@ static struct resource omap3evm_smc911x_resources[] = {
58 [1] = { 98 [1] = {
59 .start = OMAP_GPIO_IRQ(OMAP3EVM_ETHR_GPIO_IRQ), 99 .start = OMAP_GPIO_IRQ(OMAP3EVM_ETHR_GPIO_IRQ),
60 .end = OMAP_GPIO_IRQ(OMAP3EVM_ETHR_GPIO_IRQ), 100 .end = OMAP_GPIO_IRQ(OMAP3EVM_ETHR_GPIO_IRQ),
61 .flags = IORESOURCE_IRQ, 101 .flags = (IORESOURCE_IRQ | IRQF_TRIGGER_LOW),
62 }, 102 },
63}; 103};
64 104
65static struct platform_device omap3evm_smc911x_device = { 105static struct smsc911x_platform_config smsc911x_config = {
66 .name = "smc911x", 106 .phy_interface = PHY_INTERFACE_MODE_MII,
107 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
108 .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
109 .flags = (SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS),
110};
111
112static struct platform_device omap3evm_smsc911x_device = {
113 .name = "smsc911x",
67 .id = -1, 114 .id = -1,
68 .num_resources = ARRAY_SIZE(omap3evm_smc911x_resources), 115 .num_resources = ARRAY_SIZE(omap3evm_smsc911x_resources),
69 .resource = &omap3evm_smc911x_resources[0], 116 .resource = &omap3evm_smsc911x_resources[0],
117 .dev = {
118 .platform_data = &smsc911x_config,
119 },
70}; 120};
71 121
72static inline void __init omap3evm_init_smc911x(void) 122static inline void __init omap3evm_init_smsc911x(void)
73{ 123{
74 int eth_cs; 124 int eth_cs;
75 struct clk *l3ck; 125 struct clk *l3ck;
76 unsigned int rate; 126 unsigned int rate;
77 127
78 eth_cs = OMAP3EVM_SMC911X_CS; 128 eth_cs = OMAP3EVM_SMSC911X_CS;
79 129
80 l3ck = clk_get(NULL, "l3_ck"); 130 l3ck = clk_get(NULL, "l3_ck");
81 if (IS_ERR(l3ck)) 131 if (IS_ERR(l3ck))
@@ -83,15 +133,58 @@ static inline void __init omap3evm_init_smc911x(void)
83 else 133 else
84 rate = clk_get_rate(l3ck); 134 rate = clk_get_rate(l3ck);
85 135
86 if (gpio_request(OMAP3EVM_ETHR_GPIO_IRQ, "SMC911x irq") < 0) { 136 if (gpio_request(OMAP3EVM_ETHR_GPIO_IRQ, "SMSC911x irq") < 0) {
87 printk(KERN_ERR "Failed to request GPIO%d for smc911x IRQ\n", 137 printk(KERN_ERR "Failed to request GPIO%d for smsc911x IRQ\n",
88 OMAP3EVM_ETHR_GPIO_IRQ); 138 OMAP3EVM_ETHR_GPIO_IRQ);
89 return; 139 return;
90 } 140 }
91 141
92 gpio_direction_input(OMAP3EVM_ETHR_GPIO_IRQ); 142 gpio_direction_input(OMAP3EVM_ETHR_GPIO_IRQ);
143 platform_device_register(&omap3evm_smsc911x_device);
93} 144}
94 145
146#else
147static inline void __init omap3evm_init_smsc911x(void) { return; }
148#endif
149
150static struct regulator_consumer_supply omap3evm_vmmc1_supply = {
151 .supply = "vmmc",
152};
153
154static struct regulator_consumer_supply omap3evm_vsim_supply = {
155 .supply = "vmmc_aux",
156};
157
158/* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */
159static struct regulator_init_data omap3evm_vmmc1 = {
160 .constraints = {
161 .min_uV = 1850000,
162 .max_uV = 3150000,
163 .valid_modes_mask = REGULATOR_MODE_NORMAL
164 | REGULATOR_MODE_STANDBY,
165 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
166 | REGULATOR_CHANGE_MODE
167 | REGULATOR_CHANGE_STATUS,
168 },
169 .num_consumer_supplies = 1,
170 .consumer_supplies = &omap3evm_vmmc1_supply,
171};
172
173/* VSIM for MMC1 pins DAT4..DAT7 (2 mA, plus card == max 50 mA) */
174static struct regulator_init_data omap3evm_vsim = {
175 .constraints = {
176 .min_uV = 1800000,
177 .max_uV = 3000000,
178 .valid_modes_mask = REGULATOR_MODE_NORMAL
179 | REGULATOR_MODE_STANDBY,
180 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
181 | REGULATOR_CHANGE_MODE
182 | REGULATOR_CHANGE_STATUS,
183 },
184 .num_consumer_supplies = 1,
185 .consumer_supplies = &omap3evm_vsim_supply,
186};
187
95static struct twl4030_hsmmc_info mmc[] = { 188static struct twl4030_hsmmc_info mmc[] = {
96 { 189 {
97 .mmc = 1, 190 .mmc = 1,
@@ -134,6 +227,10 @@ static int omap3evm_twl_gpio_setup(struct device *dev,
134 mmc[0].gpio_cd = gpio + 0; 227 mmc[0].gpio_cd = gpio + 0;
135 twl4030_mmc_init(mmc); 228 twl4030_mmc_init(mmc);
136 229
230 /* link regulators to MMC adapters */
231 omap3evm_vmmc1_supply.dev = mmc[0].dev;
232 omap3evm_vsim_supply.dev = mmc[0].dev;
233
137 /* 234 /*
138 * Most GPIOs are for USB OTG. Some are mostly sent to 235 * Most GPIOs are for USB OTG. Some are mostly sent to
139 * the P2 connector; notably LEDA for the LCD backlight. 236 * the P2 connector; notably LEDA for the LCD backlight.
@@ -194,6 +291,15 @@ static struct twl4030_madc_platform_data omap3evm_madc_data = {
194 .irq_line = 1, 291 .irq_line = 1,
195}; 292};
196 293
294static struct twl4030_codec_audio_data omap3evm_audio_data = {
295 .audio_mclk = 26000000,
296};
297
298static struct twl4030_codec_data omap3evm_codec_data = {
299 .audio_mclk = 26000000,
300 .audio = &omap3evm_audio_data,
301};
302
197static struct twl4030_platform_data omap3evm_twldata = { 303static struct twl4030_platform_data omap3evm_twldata = {
198 .irq_base = TWL4030_IRQ_BASE, 304 .irq_base = TWL4030_IRQ_BASE,
199 .irq_end = TWL4030_IRQ_END, 305 .irq_end = TWL4030_IRQ_END,
@@ -203,6 +309,7 @@ static struct twl4030_platform_data omap3evm_twldata = {
203 .madc = &omap3evm_madc_data, 309 .madc = &omap3evm_madc_data,
204 .usb = &omap3evm_usb_data, 310 .usb = &omap3evm_usb_data,
205 .gpio = &omap3evm_gpio_data, 311 .gpio = &omap3evm_gpio_data,
312 .codec = &omap3evm_codec_data,
206}; 313};
207 314
208static struct i2c_board_info __initdata omap3evm_i2c_boardinfo[] = { 315static struct i2c_board_info __initdata omap3evm_i2c_boardinfo[] = {
@@ -216,6 +323,13 @@ static struct i2c_board_info __initdata omap3evm_i2c_boardinfo[] = {
216 323
217static int __init omap3_evm_i2c_init(void) 324static int __init omap3_evm_i2c_init(void)
218{ 325{
326 /*
327 * REVISIT: These entries can be set in omap3evm_twl_data
328 * after a merge with MFD tree
329 */
330 omap3evm_twldata.vmmc1 = &omap3evm_vmmc1;
331 omap3evm_twldata.vsim = &omap3evm_vsim;
332
219 omap_register_i2c_bus(1, 2600, omap3evm_i2c_boardinfo, 333 omap_register_i2c_bus(1, 2600, omap3evm_i2c_boardinfo,
220 ARRAY_SIZE(omap3evm_i2c_boardinfo)); 334 ARRAY_SIZE(omap3evm_i2c_boardinfo));
221 omap_register_i2c_bus(2, 400, NULL, 0); 335 omap_register_i2c_bus(2, 400, NULL, 0);
@@ -289,16 +403,29 @@ static void __init omap3_evm_init_irq(void)
289 omap2_init_common_hw(mt46h32m32lf6_sdrc_params, NULL); 403 omap2_init_common_hw(mt46h32m32lf6_sdrc_params, NULL);
290 omap_init_irq(); 404 omap_init_irq();
291 omap_gpio_init(); 405 omap_gpio_init();
292 omap3evm_init_smc911x();
293} 406}
294 407
295static struct platform_device *omap3_evm_devices[] __initdata = { 408static struct platform_device *omap3_evm_devices[] __initdata = {
296 &omap3_evm_lcd_device, 409 &omap3_evm_lcd_device,
297 &omap3evm_smc911x_device, 410};
411
412static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
413
414 .port_mode[0] = EHCI_HCD_OMAP_MODE_UNKNOWN,
415 .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY,
416 .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
417
418 .phy_reset = true,
419 /* PHY reset GPIO will be runtime programmed based on EVM version */
420 .reset_gpio_port[0] = -EINVAL,
421 .reset_gpio_port[1] = -EINVAL,
422 .reset_gpio_port[2] = -EINVAL
298}; 423};
299 424
300static void __init omap3_evm_init(void) 425static void __init omap3_evm_init(void)
301{ 426{
427 omap3_evm_get_revision();
428
302 omap3_evm_i2c_init(); 429 omap3_evm_i2c_init();
303 430
304 platform_add_devices(omap3_evm_devices, ARRAY_SIZE(omap3_evm_devices)); 431 platform_add_devices(omap3_evm_devices, ARRAY_SIZE(omap3_evm_devices));
@@ -311,8 +438,32 @@ static void __init omap3_evm_init(void)
311 /* OMAP3EVM uses ISP1504 phy and so register nop transceiver */ 438 /* OMAP3EVM uses ISP1504 phy and so register nop transceiver */
312 usb_nop_xceiv_register(); 439 usb_nop_xceiv_register();
313#endif 440#endif
441 if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) {
442 /* enable EHCI VBUS using GPIO22 */
443 omap_cfg_reg(AF9_34XX_GPIO22);
444 gpio_request(OMAP3_EVM_EHCI_VBUS, "enable EHCI VBUS");
445 gpio_direction_output(OMAP3_EVM_EHCI_VBUS, 0);
446 gpio_set_value(OMAP3_EVM_EHCI_VBUS, 1);
447
448 /* Select EHCI port on main board */
449 omap_cfg_reg(U3_34XX_GPIO61);
450 gpio_request(OMAP3_EVM_EHCI_SELECT, "select EHCI port");
451 gpio_direction_output(OMAP3_EVM_EHCI_SELECT, 0);
452 gpio_set_value(OMAP3_EVM_EHCI_SELECT, 0);
453
454 /* setup EHCI phy reset config */
455 omap_cfg_reg(AH14_34XX_GPIO21);
456 ehci_pdata.reset_gpio_port[1] = 21;
457
458 } else {
459 /* setup EHCI phy reset on MDC */
460 omap_cfg_reg(AF4_34XX_GPIO135_OUT);
461 ehci_pdata.reset_gpio_port[1] = 135;
462 }
314 usb_musb_init(); 463 usb_musb_init();
464 usb_ehci_init(&ehci_pdata);
315 ads7846_dev_init(); 465 ads7846_dev_init();
466 omap3evm_init_smsc911x();
316} 467}
317 468
318static void __init omap3_evm_map_io(void) 469static void __init omap3_evm_map_io(void)
@@ -324,7 +475,7 @@ static void __init omap3_evm_map_io(void)
324MACHINE_START(OMAP3EVM, "OMAP3 EVM") 475MACHINE_START(OMAP3EVM, "OMAP3 EVM")
325 /* Maintainer: Syed Mohammed Khasim - Texas Instruments */ 476 /* Maintainer: Syed Mohammed Khasim - Texas Instruments */
326 .phys_io = 0x48000000, 477 .phys_io = 0x48000000,
327 .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc, 478 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc,
328 .boot_params = 0x80000100, 479 .boot_params = 0x80000100,
329 .map_io = omap3_evm_map_io, 480 .map_io = omap3_evm_map_io,
330 .init_irq = omap3_evm_init_irq, 481 .init_irq = omap3_evm_init_irq,
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
index 7519edb69155..2db5ba5b3bf7 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -34,13 +34,13 @@
34#include <asm/mach/arch.h> 34#include <asm/mach/arch.h>
35#include <asm/mach/map.h> 35#include <asm/mach/map.h>
36 36
37#include <mach/board.h> 37#include <plat/board.h>
38#include <mach/common.h> 38#include <plat/common.h>
39#include <mach/gpio.h> 39#include <mach/gpio.h>
40#include <mach/hardware.h> 40#include <mach/hardware.h>
41#include <mach/mcspi.h> 41#include <plat/mcspi.h>
42#include <mach/usb.h> 42#include <plat/usb.h>
43#include <mach/mux.h> 43#include <plat/mux.h>
44 44
45#include "sdram-micron-mt46h32m32lf-6.h" 45#include "sdram-micron-mt46h32m32lf-6.h"
46#include "mmc-twl4030.h" 46#include "mmc-twl4030.h"
@@ -281,11 +281,21 @@ static struct twl4030_usb_data omap3pandora_usb_data = {
281 .usb_mode = T2_USB_MODE_ULPI, 281 .usb_mode = T2_USB_MODE_ULPI,
282}; 282};
283 283
284static struct twl4030_codec_audio_data omap3pandora_audio_data = {
285 .audio_mclk = 26000000,
286};
287
288static struct twl4030_codec_data omap3pandora_codec_data = {
289 .audio_mclk = 26000000,
290 .audio = &omap3pandora_audio_data,
291};
292
284static struct twl4030_platform_data omap3pandora_twldata = { 293static struct twl4030_platform_data omap3pandora_twldata = {
285 .irq_base = TWL4030_IRQ_BASE, 294 .irq_base = TWL4030_IRQ_BASE,
286 .irq_end = TWL4030_IRQ_END, 295 .irq_end = TWL4030_IRQ_END,
287 .gpio = &omap3pandora_gpio_data, 296 .gpio = &omap3pandora_gpio_data,
288 .usb = &omap3pandora_usb_data, 297 .usb = &omap3pandora_usb_data,
298 .codec = &omap3pandora_codec_data,
289 .vmmc1 = &pandora_vmmc1, 299 .vmmc1 = &pandora_vmmc1,
290 .vmmc2 = &pandora_vmmc2, 300 .vmmc2 = &pandora_vmmc2,
291 .keypad = &pandora_kp_data, 301 .keypad = &pandora_kp_data,
@@ -387,6 +397,18 @@ static struct platform_device *omap3pandora_devices[] __initdata = {
387 &pandora_keys_gpio, 397 &pandora_keys_gpio,
388}; 398};
389 399
400static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
401
402 .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
403 .port_mode[1] = EHCI_HCD_OMAP_MODE_UNKNOWN,
404 .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
405
406 .phy_reset = true,
407 .reset_gpio_port[0] = 16,
408 .reset_gpio_port[1] = -EINVAL,
409 .reset_gpio_port[2] = -EINVAL
410};
411
390static void __init omap3pandora_init(void) 412static void __init omap3pandora_init(void)
391{ 413{
392 omap3pandora_i2c_init(); 414 omap3pandora_i2c_init();
@@ -396,6 +418,7 @@ static void __init omap3pandora_init(void)
396 spi_register_board_info(omap3pandora_spi_board_info, 418 spi_register_board_info(omap3pandora_spi_board_info,
397 ARRAY_SIZE(omap3pandora_spi_board_info)); 419 ARRAY_SIZE(omap3pandora_spi_board_info));
398 omap3pandora_ads7846_init(); 420 omap3pandora_ads7846_init();
421 usb_ehci_init(&ehci_pdata);
399 pandora_keys_gpio_init(); 422 pandora_keys_gpio_init();
400 usb_musb_init(); 423 usb_musb_init();
401 424
@@ -412,7 +435,7 @@ static void __init omap3pandora_map_io(void)
412 435
413MACHINE_START(OMAP3_PANDORA, "Pandora Handheld Console") 436MACHINE_START(OMAP3_PANDORA, "Pandora Handheld Console")
414 .phys_io = 0x48000000, 437 .phys_io = 0x48000000,
415 .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc, 438 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc,
416 .boot_params = 0x80000100, 439 .boot_params = 0x80000100,
417 .map_io = omap3pandora_map_io, 440 .map_io = omap3pandora_map_io,
418 .init_irq = omap3pandora_init_irq, 441 .init_irq = omap3pandora_init_irq,
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index 9917d2fddc2f..52dfd51a938e 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -38,14 +38,14 @@
38#include <asm/mach/flash.h> 38#include <asm/mach/flash.h>
39#include <asm/mach/map.h> 39#include <asm/mach/map.h>
40 40
41#include <mach/board.h> 41#include <plat/board.h>
42#include <mach/common.h> 42#include <plat/common.h>
43#include <mach/gpio.h> 43#include <mach/gpio.h>
44#include <mach/gpmc.h> 44#include <plat/gpmc.h>
45#include <mach/hardware.h> 45#include <mach/hardware.h>
46#include <mach/nand.h> 46#include <plat/nand.h>
47#include <mach/mux.h> 47#include <plat/mux.h>
48#include <mach/usb.h> 48#include <plat/usb.h>
49 49
50#include "sdram-micron-mt46h32m32lf-6.h" 50#include "sdram-micron-mt46h32m32lf-6.h"
51#include "mmc-twl4030.h" 51#include "mmc-twl4030.h"
@@ -67,7 +67,7 @@
67#if defined(CONFIG_TOUCHSCREEN_ADS7846) || \ 67#if defined(CONFIG_TOUCHSCREEN_ADS7846) || \
68 defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE) 68 defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
69 69
70#include <mach/mcspi.h> 70#include <plat/mcspi.h>
71#include <linux/spi/spi.h> 71#include <linux/spi/spi.h>
72#include <linux/spi/ads7846.h> 72#include <linux/spi/ads7846.h>
73 73
@@ -329,6 +329,15 @@ static struct regulator_init_data overo_vmmc1 = {
329 .consumer_supplies = &overo_vmmc1_supply, 329 .consumer_supplies = &overo_vmmc1_supply,
330}; 330};
331 331
332static struct twl4030_codec_audio_data overo_audio_data = {
333 .audio_mclk = 26000000,
334};
335
336static struct twl4030_codec_data overo_codec_data = {
337 .audio_mclk = 26000000,
338 .audio = &overo_audio_data,
339};
340
332/* mmc2 (WLAN) and Bluetooth don't use twl4030 regulators */ 341/* mmc2 (WLAN) and Bluetooth don't use twl4030 regulators */
333 342
334static struct twl4030_platform_data overo_twldata = { 343static struct twl4030_platform_data overo_twldata = {
@@ -336,6 +345,7 @@ static struct twl4030_platform_data overo_twldata = {
336 .irq_end = TWL4030_IRQ_END, 345 .irq_end = TWL4030_IRQ_END,
337 .gpio = &overo_gpio_data, 346 .gpio = &overo_gpio_data,
338 .usb = &overo_usb_data, 347 .usb = &overo_usb_data,
348 .codec = &overo_codec_data,
339 .vmmc1 = &overo_vmmc1, 349 .vmmc1 = &overo_vmmc1,
340}; 350};
341 351
@@ -384,6 +394,18 @@ static struct platform_device *overo_devices[] __initdata = {
384 &overo_lcd_device, 394 &overo_lcd_device,
385}; 395};
386 396
397static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
398 .port_mode[0] = EHCI_HCD_OMAP_MODE_UNKNOWN,
399 .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY,
400 .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
401
402 .phy_reset = true,
403 .reset_gpio_port[0] = -EINVAL,
404 .reset_gpio_port[1] = OVERO_GPIO_USBH_NRESET,
405 .reset_gpio_port[2] = -EINVAL
406};
407
408
387static void __init overo_init(void) 409static void __init overo_init(void)
388{ 410{
389 overo_i2c_init(); 411 overo_i2c_init();
@@ -391,6 +413,7 @@ static void __init overo_init(void)
391 omap_serial_init(); 413 omap_serial_init();
392 overo_flash_init(); 414 overo_flash_init();
393 usb_musb_init(); 415 usb_musb_init();
416 usb_ehci_init(&ehci_pdata);
394 overo_ads7846_init(); 417 overo_ads7846_init();
395 overo_init_smsc911x(); 418 overo_init_smsc911x();
396 419
@@ -433,14 +456,6 @@ static void __init overo_init(void)
433 else 456 else
434 printk(KERN_ERR "could not obtain gpio for " 457 printk(KERN_ERR "could not obtain gpio for "
435 "OVERO_GPIO_USBH_CPEN\n"); 458 "OVERO_GPIO_USBH_CPEN\n");
436
437 if ((gpio_request(OVERO_GPIO_USBH_NRESET,
438 "OVERO_GPIO_USBH_NRESET") == 0) &&
439 (gpio_direction_output(OVERO_GPIO_USBH_NRESET, 1) == 0))
440 gpio_export(OVERO_GPIO_USBH_NRESET, 0);
441 else
442 printk(KERN_ERR "could not obtain gpio for "
443 "OVERO_GPIO_USBH_NRESET\n");
444} 459}
445 460
446static void __init overo_map_io(void) 461static void __init overo_map_io(void)
@@ -451,7 +466,7 @@ static void __init overo_map_io(void)
451 466
452MACHINE_START(OVERO, "Gumstix Overo") 467MACHINE_START(OVERO, "Gumstix Overo")
453 .phys_io = 0x48000000, 468 .phys_io = 0x48000000,
454 .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc, 469 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc,
455 .boot_params = 0x80000100, 470 .boot_params = 0x80000100,
456 .map_io = overo_map_io, 471 .map_io = overo_map_io,
457 .init_irq = overo_init_irq, 472 .init_irq = overo_init_irq,
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c
index e34d96a825e3..15ce6514c5fd 100644
--- a/arch/arm/mach-omap2/board-rx51-peripherals.c
+++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
@@ -14,28 +14,137 @@
14#include <linux/input.h> 14#include <linux/input.h>
15#include <linux/input/matrix_keypad.h> 15#include <linux/input/matrix_keypad.h>
16#include <linux/spi/spi.h> 16#include <linux/spi/spi.h>
17#include <linux/spi/wl12xx.h>
17#include <linux/i2c.h> 18#include <linux/i2c.h>
18#include <linux/i2c/twl4030.h> 19#include <linux/i2c/twl4030.h>
19#include <linux/clk.h> 20#include <linux/clk.h>
20#include <linux/delay.h> 21#include <linux/delay.h>
21#include <linux/regulator/machine.h> 22#include <linux/regulator/machine.h>
22#include <linux/gpio.h> 23#include <linux/gpio.h>
24#include <linux/gpio_keys.h>
23#include <linux/mmc/host.h> 25#include <linux/mmc/host.h>
24 26
25#include <mach/mcspi.h> 27#include <plat/mcspi.h>
26#include <mach/mux.h> 28#include <plat/mux.h>
27#include <mach/board.h> 29#include <plat/board.h>
28#include <mach/common.h> 30#include <plat/common.h>
29#include <mach/dma.h> 31#include <plat/dma.h>
30#include <mach/gpmc.h> 32#include <plat/gpmc.h>
31#include <mach/onenand.h> 33#include <plat/onenand.h>
32#include <mach/gpmc-smc91x.h> 34#include <plat/gpmc-smc91x.h>
33 35
34#include "mmc-twl4030.h" 36#include "mmc-twl4030.h"
35 37
36#define SYSTEM_REV_B_USES_VAUX3 0x1699 38#define SYSTEM_REV_B_USES_VAUX3 0x1699
37#define SYSTEM_REV_S_USES_VAUX3 0x8 39#define SYSTEM_REV_S_USES_VAUX3 0x8
38 40
41#define RX51_WL1251_POWER_GPIO 87
42#define RX51_WL1251_IRQ_GPIO 42
43
44/* list all spi devices here */
45enum {
46 RX51_SPI_WL1251,
47};
48
49static struct wl12xx_platform_data wl1251_pdata;
50
51static struct omap2_mcspi_device_config wl1251_mcspi_config = {
52 .turbo_mode = 0,
53 .single_channel = 1,
54};
55
56static struct spi_board_info rx51_peripherals_spi_board_info[] __initdata = {
57 [RX51_SPI_WL1251] = {
58 .modalias = "wl1251",
59 .bus_num = 4,
60 .chip_select = 0,
61 .max_speed_hz = 48000000,
62 .mode = SPI_MODE_2,
63 .controller_data = &wl1251_mcspi_config,
64 .platform_data = &wl1251_pdata,
65 },
66};
67
68#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
69
70#define RX51_GPIO_CAMERA_LENS_COVER 110
71#define RX51_GPIO_CAMERA_FOCUS 68
72#define RX51_GPIO_CAMERA_CAPTURE 69
73#define RX51_GPIO_KEYPAD_SLIDE 71
74#define RX51_GPIO_LOCK_BUTTON 113
75#define RX51_GPIO_PROXIMITY 89
76
77#define RX51_GPIO_DEBOUNCE_TIMEOUT 10
78
79static struct gpio_keys_button rx51_gpio_keys[] = {
80 {
81 .desc = "Camera Lens Cover",
82 .type = EV_SW,
83 .code = SW_CAMERA_LENS_COVER,
84 .gpio = RX51_GPIO_CAMERA_LENS_COVER,
85 .active_low = 1,
86 .debounce_interval = RX51_GPIO_DEBOUNCE_TIMEOUT,
87 }, {
88 .desc = "Camera Focus",
89 .type = EV_KEY,
90 .code = KEY_CAMERA_FOCUS,
91 .gpio = RX51_GPIO_CAMERA_FOCUS,
92 .active_low = 1,
93 .debounce_interval = RX51_GPIO_DEBOUNCE_TIMEOUT,
94 }, {
95 .desc = "Camera Capture",
96 .type = EV_KEY,
97 .code = KEY_CAMERA,
98 .gpio = RX51_GPIO_CAMERA_CAPTURE,
99 .active_low = 1,
100 .debounce_interval = RX51_GPIO_DEBOUNCE_TIMEOUT,
101 }, {
102 .desc = "Lock Button",
103 .type = EV_KEY,
104 .code = KEY_SCREENLOCK,
105 .gpio = RX51_GPIO_LOCK_BUTTON,
106 .active_low = 1,
107 .debounce_interval = RX51_GPIO_DEBOUNCE_TIMEOUT,
108 }, {
109 .desc = "Keypad Slide",
110 .type = EV_SW,
111 .code = SW_KEYPAD_SLIDE,
112 .gpio = RX51_GPIO_KEYPAD_SLIDE,
113 .active_low = 1,
114 .debounce_interval = RX51_GPIO_DEBOUNCE_TIMEOUT,
115 }, {
116 .desc = "Proximity Sensor",
117 .type = EV_SW,
118 .code = SW_FRONT_PROXIMITY,
119 .gpio = RX51_GPIO_PROXIMITY,
120 .active_low = 0,
121 .debounce_interval = RX51_GPIO_DEBOUNCE_TIMEOUT,
122 }
123};
124
125static struct gpio_keys_platform_data rx51_gpio_keys_data = {
126 .buttons = rx51_gpio_keys,
127 .nbuttons = ARRAY_SIZE(rx51_gpio_keys),
128};
129
130static struct platform_device rx51_gpio_keys_device = {
131 .name = "gpio-keys",
132 .id = -1,
133 .dev = {
134 .platform_data = &rx51_gpio_keys_data,
135 },
136};
137
138static void __init rx51_add_gpio_keys(void)
139{
140 platform_device_register(&rx51_gpio_keys_device);
141}
142#else
143static void __init rx51_add_gpio_keys(void)
144{
145}
146#endif /* CONFIG_KEYBOARD_GPIO || CONFIG_KEYBOARD_GPIO_MODULE */
147
39static int board_keymap[] = { 148static int board_keymap[] = {
40 KEY(0, 0, KEY_Q), 149 KEY(0, 0, KEY_Q),
41 KEY(0, 1, KEY_O), 150 KEY(0, 1, KEY_O),
@@ -536,10 +645,64 @@ static inline void board_smc91x_init(void)
536 645
537#endif 646#endif
538 647
648static void rx51_wl1251_set_power(bool enable)
649{
650 gpio_set_value(RX51_WL1251_POWER_GPIO, enable);
651}
652
653static void __init rx51_init_wl1251(void)
654{
655 int irq, ret;
656
657 ret = gpio_request(RX51_WL1251_POWER_GPIO, "wl1251 power");
658 if (ret < 0)
659 goto error;
660
661 ret = gpio_direction_output(RX51_WL1251_POWER_GPIO, 0);
662 if (ret < 0)
663 goto err_power;
664
665 ret = gpio_request(RX51_WL1251_IRQ_GPIO, "wl1251 irq");
666 if (ret < 0)
667 goto err_power;
668
669 ret = gpio_direction_input(RX51_WL1251_IRQ_GPIO);
670 if (ret < 0)
671 goto err_irq;
672
673 irq = gpio_to_irq(RX51_WL1251_IRQ_GPIO);
674 if (irq < 0)
675 goto err_irq;
676
677 wl1251_pdata.set_power = rx51_wl1251_set_power;
678 rx51_peripherals_spi_board_info[RX51_SPI_WL1251].irq = irq;
679
680 return;
681
682err_irq:
683 gpio_free(RX51_WL1251_IRQ_GPIO);
684
685err_power:
686 gpio_free(RX51_WL1251_POWER_GPIO);
687
688error:
689 printk(KERN_ERR "wl1251 board initialisation failed\n");
690 wl1251_pdata.set_power = NULL;
691
692 /*
693 * Now rx51_peripherals_spi_board_info[1].irq is zero and
694 * set_power is null, and wl1251_probe() will fail.
695 */
696}
697
539void __init rx51_peripherals_init(void) 698void __init rx51_peripherals_init(void)
540{ 699{
541 rx51_i2c_init(); 700 rx51_i2c_init();
542 board_onenand_init(); 701 board_onenand_init();
543 board_smc91x_init(); 702 board_smc91x_init();
703 rx51_add_gpio_keys();
704 rx51_init_wl1251();
705 spi_register_board_info(rx51_peripherals_spi_board_info,
706 ARRAY_SIZE(rx51_peripherals_spi_board_info));
544} 707}
545 708
diff --git a/arch/arm/mach-omap2/board-rx51-sdram.c b/arch/arm/mach-omap2/board-rx51-sdram.c
new file mode 100644
index 000000000000..f392844195d2
--- /dev/null
+++ b/arch/arm/mach-omap2/board-rx51-sdram.c
@@ -0,0 +1,221 @@
1/*
2 * SDRC register values for RX51
3 *
4 * Copyright (C) 2008 Nokia Corporation
5 *
6 * Lauri Leukkunen <lauri.leukkunen@nokia.com>
7 *
8 * Original code by Juha Yrjola <juha.yrjola@solidboot.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#include <linux/kernel.h>
16#include <linux/clk.h>
17#include <linux/err.h>
18#include <linux/io.h>
19
20#include <plat/io.h>
21#include <plat/common.h>
22#include <plat/clock.h>
23#include <plat/sdrc.h>
24
25
26/* In picoseconds, except for tREF (ns), tXP, tCKE, tWTR (clks) */
27struct sdram_timings {
28 u32 casl;
29 u32 tDAL;
30 u32 tDPL;
31 u32 tRRD;
32 u32 tRCD;
33 u32 tRP;
34 u32 tRAS;
35 u32 tRC;
36 u32 tRFC;
37 u32 tXSR;
38
39 u32 tREF; /* in ns */
40
41 u32 tXP;
42 u32 tCKE;
43 u32 tWTR;
44};
45
46struct omap_sdrc_params rx51_sdrc_params[4];
47
48static const struct sdram_timings rx51_timings[] = {
49 {
50 .casl = 3,
51 .tDAL = 33000,
52 .tDPL = 15000,
53 .tRRD = 12000,
54 .tRCD = 22500,
55 .tRP = 18000,
56 .tRAS = 42000,
57 .tRC = 66000,
58 .tRFC = 138000,
59 .tXSR = 200000,
60
61 .tREF = 7800,
62
63 .tXP = 2,
64 .tCKE = 2,
65 .tWTR = 2
66 },
67};
68
69static unsigned long sdrc_get_fclk_period(long rate)
70{
71 /* In picoseconds */
72 return 1000000000 / rate;
73}
74
75static unsigned int sdrc_ps_to_ticks(unsigned int time_ps, long rate)
76{
77 unsigned long tick_ps;
78
79 /* Calculate in picosecs to yield more exact results */
80 tick_ps = sdrc_get_fclk_period(rate);
81
82 return (time_ps + tick_ps - 1) / tick_ps;
83}
84#undef DEBUG
85#ifdef DEBUG
86static int set_sdrc_timing_regval(u32 *regval, int st_bit, int end_bit,
87 int ticks, long rate, const char *name)
88#else
89static int set_sdrc_timing_regval(u32 *regval, int st_bit, int end_bit,
90 int ticks)
91#endif
92{
93 int mask, nr_bits;
94
95 nr_bits = end_bit - st_bit + 1;
96 if (ticks >= 1 << nr_bits)
97 return -1;
98 mask = (1 << nr_bits) - 1;
99 *regval &= ~(mask << st_bit);
100 *regval |= ticks << st_bit;
101#ifdef DEBUG
102 printk(KERN_INFO "SDRC %s: %i ticks %i ns\n", name, ticks,
103 (unsigned int)sdrc_get_fclk_period(rate) * ticks /
104 1000);
105#endif
106
107 return 0;
108}
109
110#ifdef DEBUG
111#define SDRC_SET_ONE(reg, st, end, field, rate) \
112 if (set_sdrc_timing_regval((reg), (st), (end), \
113 rx51_timings->field, (rate), #field) < 0) \
114 err = -1;
115#else
116#define SDRC_SET_ONE(reg, st, end, field, rate) \
117 if (set_sdrc_timing_regval((reg), (st), (end), \
118 rx51_timings->field) < 0) \
119 err = -1;
120#endif
121
122#ifdef DEBUG
123static int set_sdrc_timing_regval_ps(u32 *regval, int st_bit, int end_bit,
124 int time, long rate, const char *name)
125#else
126static int set_sdrc_timing_regval_ps(u32 *regval, int st_bit, int end_bit,
127 int time, long rate)
128#endif
129{
130 int ticks, ret;
131 ret = 0;
132
133 if (time == 0)
134 ticks = 0;
135 else
136 ticks = sdrc_ps_to_ticks(time, rate);
137
138#ifdef DEBUG
139 ret = set_sdrc_timing_regval(regval, st_bit, end_bit, ticks,
140 rate, name);
141#else
142 ret = set_sdrc_timing_regval(regval, st_bit, end_bit, ticks);
143#endif
144
145 return ret;
146}
147
148#ifdef DEBUG
149#define SDRC_SET_ONE_PS(reg, st, end, field, rate) \
150 if (set_sdrc_timing_regval_ps((reg), (st), (end), \
151 rx51_timings->field, \
152 (rate), #field) < 0) \
153 err = -1;
154
155#else
156#define SDRC_SET_ONE_PS(reg, st, end, field, rate) \
157 if (set_sdrc_timing_regval_ps((reg), (st), (end), \
158 rx51_timings->field, (rate)) < 0) \
159 err = -1;
160#endif
161
162static int sdrc_timings(int id, long rate)
163{
164 u32 ticks_per_ms;
165 u32 rfr, l;
166 u32 actim_ctrla = 0, actim_ctrlb = 0;
167 u32 rfr_ctrl;
168 int err = 0;
169 long l3_rate = rate / 1000;
170
171 SDRC_SET_ONE_PS(&actim_ctrla, 0, 4, tDAL, l3_rate);
172 SDRC_SET_ONE_PS(&actim_ctrla, 6, 8, tDPL, l3_rate);
173 SDRC_SET_ONE_PS(&actim_ctrla, 9, 11, tRRD, l3_rate);
174 SDRC_SET_ONE_PS(&actim_ctrla, 12, 14, tRCD, l3_rate);
175 SDRC_SET_ONE_PS(&actim_ctrla, 15, 17, tRP, l3_rate);
176 SDRC_SET_ONE_PS(&actim_ctrla, 18, 21, tRAS, l3_rate);
177 SDRC_SET_ONE_PS(&actim_ctrla, 22, 26, tRC, l3_rate);
178 SDRC_SET_ONE_PS(&actim_ctrla, 27, 31, tRFC, l3_rate);
179
180 SDRC_SET_ONE_PS(&actim_ctrlb, 0, 7, tXSR, l3_rate);
181
182 SDRC_SET_ONE(&actim_ctrlb, 8, 10, tXP, l3_rate);
183 SDRC_SET_ONE(&actim_ctrlb, 12, 14, tCKE, l3_rate);
184 SDRC_SET_ONE(&actim_ctrlb, 16, 17, tWTR, l3_rate);
185
186 ticks_per_ms = l3_rate;
187 rfr = rx51_timings[0].tREF * ticks_per_ms / 1000000;
188 if (rfr > 65535 + 50)
189 rfr = 65535;
190 else
191 rfr -= 50;
192
193#ifdef DEBUG
194 printk(KERN_INFO "SDRC tREF: %i ticks\n", rfr);
195#endif
196
197 l = rfr << 8;
198 rfr_ctrl = l | 0x1; /* autorefresh, reload counter with 1xARCV */
199
200 rx51_sdrc_params[id].rate = rate;
201 rx51_sdrc_params[id].actim_ctrla = actim_ctrla;
202 rx51_sdrc_params[id].actim_ctrlb = actim_ctrlb;
203 rx51_sdrc_params[id].rfr_ctrl = rfr_ctrl;
204 rx51_sdrc_params[id].mr = 0x32;
205
206 rx51_sdrc_params[id + 1].rate = 0;
207
208 return err;
209}
210
211struct omap_sdrc_params *rx51_get_sdram_timings(void)
212{
213 int err;
214
215 err = sdrc_timings(0, 41500000);
216 err |= sdrc_timings(1, 83000000);
217 err |= sdrc_timings(2, 166000000);
218
219 return &rx51_sdrc_params[0];
220}
221
diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c
index 78869a9a1cc2..1bb1de245917 100644
--- a/arch/arm/mach-omap2/board-rx51.c
+++ b/arch/arm/mach-omap2/board-rx51.c
@@ -22,13 +22,15 @@
22#include <asm/mach/arch.h> 22#include <asm/mach/arch.h>
23#include <asm/mach/map.h> 23#include <asm/mach/map.h>
24 24
25#include <mach/mcspi.h> 25#include <plat/mcspi.h>
26#include <mach/mux.h> 26#include <plat/mux.h>
27#include <mach/board.h> 27#include <plat/board.h>
28#include <mach/common.h> 28#include <plat/common.h>
29#include <mach/dma.h> 29#include <plat/dma.h>
30#include <mach/gpmc.h> 30#include <plat/gpmc.h>
31#include <mach/usb.h> 31#include <plat/usb.h>
32
33struct omap_sdrc_params *rx51_get_sdram_timings(void);
32 34
33static struct omap_lcd_config rx51_lcd_config = { 35static struct omap_lcd_config rx51_lcd_config = {
34 .ctrl_name = "internal", 36 .ctrl_name = "internal",
@@ -55,9 +57,12 @@ static struct omap_board_config_kernel rx51_config[] = {
55 57
56static void __init rx51_init_irq(void) 58static void __init rx51_init_irq(void)
57{ 59{
60 struct omap_sdrc_params *sdrc_params;
61
58 omap_board_config = rx51_config; 62 omap_board_config = rx51_config;
59 omap_board_config_size = ARRAY_SIZE(rx51_config); 63 omap_board_config_size = ARRAY_SIZE(rx51_config);
60 omap2_init_common_hw(NULL, NULL); 64 sdrc_params = rx51_get_sdram_timings();
65 omap2_init_common_hw(sdrc_params, sdrc_params);
61 omap_init_irq(); 66 omap_init_irq();
62 omap_gpio_init(); 67 omap_gpio_init();
63} 68}
@@ -84,7 +89,7 @@ static void __init rx51_map_io(void)
84MACHINE_START(NOKIA_RX51, "Nokia RX-51 board") 89MACHINE_START(NOKIA_RX51, "Nokia RX-51 board")
85 /* Maintainer: Lauri Leukkunen <lauri.leukkunen@nokia.com> */ 90 /* Maintainer: Lauri Leukkunen <lauri.leukkunen@nokia.com> */
86 .phys_io = 0x48000000, 91 .phys_io = 0x48000000,
87 .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc, 92 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc,
88 .boot_params = 0x80000100, 93 .boot_params = 0x80000100,
89 .map_io = rx51_map_io, 94 .map_io = rx51_map_io,
90 .init_irq = rx51_init_irq, 95 .init_irq = rx51_init_irq,
diff --git a/arch/arm/mach-omap2/board-zoom-debugboard.c b/arch/arm/mach-omap2/board-zoom-debugboard.c
index 1f13e2a1f322..bb4018b60642 100644
--- a/arch/arm/mach-omap2/board-zoom-debugboard.c
+++ b/arch/arm/mach-omap2/board-zoom-debugboard.c
@@ -14,20 +14,20 @@
14#include <linux/smsc911x.h> 14#include <linux/smsc911x.h>
15#include <linux/interrupt.h> 15#include <linux/interrupt.h>
16 16
17#include <mach/gpmc.h> 17#include <plat/gpmc.h>
18 18
19#define ZOOM2_SMSC911X_CS 7 19#define ZOOM_SMSC911X_CS 7
20#define ZOOM2_SMSC911X_GPIO 158 20#define ZOOM_SMSC911X_GPIO 158
21#define ZOOM2_QUADUART_CS 3 21#define ZOOM_QUADUART_CS 3
22#define ZOOM2_QUADUART_GPIO 102 22#define ZOOM_QUADUART_GPIO 102
23#define QUART_CLK 1843200 23#define QUART_CLK 1843200
24#define DEBUG_BASE 0x08000000 24#define DEBUG_BASE 0x08000000
25#define ZOOM2_ETHR_START DEBUG_BASE 25#define ZOOM_ETHR_START DEBUG_BASE
26 26
27static struct resource zoom2_smsc911x_resources[] = { 27static struct resource zoom_smsc911x_resources[] = {
28 [0] = { 28 [0] = {
29 .start = ZOOM2_ETHR_START, 29 .start = ZOOM_ETHR_START,
30 .end = ZOOM2_ETHR_START + SZ_4K, 30 .end = ZOOM_ETHR_START + SZ_4K,
31 .flags = IORESOURCE_MEM, 31 .flags = IORESOURCE_MEM,
32 }, 32 },
33 [1] = { 33 [1] = {
@@ -35,42 +35,42 @@ static struct resource zoom2_smsc911x_resources[] = {
35 }, 35 },
36}; 36};
37 37
38static struct smsc911x_platform_config zoom2_smsc911x_config = { 38static struct smsc911x_platform_config zoom_smsc911x_config = {
39 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, 39 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
40 .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN, 40 .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
41 .flags = SMSC911X_USE_32BIT, 41 .flags = SMSC911X_USE_32BIT,
42 .phy_interface = PHY_INTERFACE_MODE_MII, 42 .phy_interface = PHY_INTERFACE_MODE_MII,
43}; 43};
44 44
45static struct platform_device zoom2_smsc911x_device = { 45static struct platform_device zoom_smsc911x_device = {
46 .name = "smsc911x", 46 .name = "smsc911x",
47 .id = -1, 47 .id = -1,
48 .num_resources = ARRAY_SIZE(zoom2_smsc911x_resources), 48 .num_resources = ARRAY_SIZE(zoom_smsc911x_resources),
49 .resource = zoom2_smsc911x_resources, 49 .resource = zoom_smsc911x_resources,
50 .dev = { 50 .dev = {
51 .platform_data = &zoom2_smsc911x_config, 51 .platform_data = &zoom_smsc911x_config,
52 }, 52 },
53}; 53};
54 54
55static inline void __init zoom2_init_smsc911x(void) 55static inline void __init zoom_init_smsc911x(void)
56{ 56{
57 int eth_cs; 57 int eth_cs;
58 unsigned long cs_mem_base; 58 unsigned long cs_mem_base;
59 int eth_gpio = 0; 59 int eth_gpio = 0;
60 60
61 eth_cs = ZOOM2_SMSC911X_CS; 61 eth_cs = ZOOM_SMSC911X_CS;
62 62
63 if (gpmc_cs_request(eth_cs, SZ_16M, &cs_mem_base) < 0) { 63 if (gpmc_cs_request(eth_cs, SZ_16M, &cs_mem_base) < 0) {
64 printk(KERN_ERR "Failed to request GPMC mem for smsc911x\n"); 64 printk(KERN_ERR "Failed to request GPMC mem for smsc911x\n");
65 return; 65 return;
66 } 66 }
67 67
68 zoom2_smsc911x_resources[0].start = cs_mem_base + 0x0; 68 zoom_smsc911x_resources[0].start = cs_mem_base + 0x0;
69 zoom2_smsc911x_resources[0].end = cs_mem_base + 0xff; 69 zoom_smsc911x_resources[0].end = cs_mem_base + 0xff;
70 70
71 eth_gpio = ZOOM2_SMSC911X_GPIO; 71 eth_gpio = ZOOM_SMSC911X_GPIO;
72 72
73 zoom2_smsc911x_resources[1].start = OMAP_GPIO_IRQ(eth_gpio); 73 zoom_smsc911x_resources[1].start = OMAP_GPIO_IRQ(eth_gpio);
74 74
75 if (gpio_request(eth_gpio, "smsc911x irq") < 0) { 75 if (gpio_request(eth_gpio, "smsc911x irq") < 0) {
76 printk(KERN_ERR "Failed to request GPIO%d for smsc911x IRQ\n", 76 printk(KERN_ERR "Failed to request GPIO%d for smsc911x IRQ\n",
@@ -94,7 +94,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
94 } 94 }
95}; 95};
96 96
97static struct platform_device zoom2_debugboard_serial_device = { 97static struct platform_device zoom_debugboard_serial_device = {
98 .name = "serial8250", 98 .name = "serial8250",
99 .id = 3, 99 .id = 3,
100 .dev = { 100 .dev = {
@@ -102,13 +102,13 @@ static struct platform_device zoom2_debugboard_serial_device = {
102 }, 102 },
103}; 103};
104 104
105static inline void __init zoom2_init_quaduart(void) 105static inline void __init zoom_init_quaduart(void)
106{ 106{
107 int quart_cs; 107 int quart_cs;
108 unsigned long cs_mem_base; 108 unsigned long cs_mem_base;
109 int quart_gpio = 0; 109 int quart_gpio = 0;
110 110
111 quart_cs = ZOOM2_QUADUART_CS; 111 quart_cs = ZOOM_QUADUART_CS;
112 112
113 if (gpmc_cs_request(quart_cs, SZ_1M, &cs_mem_base) < 0) { 113 if (gpmc_cs_request(quart_cs, SZ_1M, &cs_mem_base) < 0) {
114 printk(KERN_ERR "Failed to request GPMC mem" 114 printk(KERN_ERR "Failed to request GPMC mem"
@@ -116,7 +116,7 @@ static inline void __init zoom2_init_quaduart(void)
116 return; 116 return;
117 } 117 }
118 118
119 quart_gpio = ZOOM2_QUADUART_GPIO; 119 quart_gpio = ZOOM_QUADUART_GPIO;
120 120
121 if (gpio_request(quart_gpio, "TL16CP754C GPIO") < 0) { 121 if (gpio_request(quart_gpio, "TL16CP754C GPIO") < 0) {
122 printk(KERN_ERR "Failed to request GPIO%d for TL16CP754C\n", 122 printk(KERN_ERR "Failed to request GPIO%d for TL16CP754C\n",
@@ -126,15 +126,15 @@ static inline void __init zoom2_init_quaduart(void)
126 gpio_direction_input(quart_gpio); 126 gpio_direction_input(quart_gpio);
127} 127}
128 128
129static inline int omap_zoom2_debugboard_detect(void) 129static inline int omap_zoom_debugboard_detect(void)
130{ 130{
131 int debug_board_detect = 0; 131 int debug_board_detect = 0;
132 int ret = 1; 132 int ret = 1;
133 133
134 debug_board_detect = ZOOM2_SMSC911X_GPIO; 134 debug_board_detect = ZOOM_SMSC911X_GPIO;
135 135
136 if (gpio_request(debug_board_detect, "Zoom2 debug board detect") < 0) { 136 if (gpio_request(debug_board_detect, "Zoom debug board detect") < 0) {
137 printk(KERN_ERR "Failed to request GPIO%d for Zoom2 debug" 137 printk(KERN_ERR "Failed to request GPIO%d for Zoom debug"
138 "board detect\n", debug_board_detect); 138 "board detect\n", debug_board_detect);
139 return 0; 139 return 0;
140 } 140 }
@@ -147,17 +147,17 @@ static inline int omap_zoom2_debugboard_detect(void)
147 return ret; 147 return ret;
148} 148}
149 149
150static struct platform_device *zoom2_devices[] __initdata = { 150static struct platform_device *zoom_devices[] __initdata = {
151 &zoom2_smsc911x_device, 151 &zoom_smsc911x_device,
152 &zoom2_debugboard_serial_device, 152 &zoom_debugboard_serial_device,
153}; 153};
154 154
155int __init omap_zoom2_debugboard_init(void) 155int __init zoom_debugboard_init(void)
156{ 156{
157 if (!omap_zoom2_debugboard_detect()) 157 if (!omap_zoom_debugboard_detect())
158 return 0; 158 return 0;
159 159
160 zoom2_init_smsc911x(); 160 zoom_init_smsc911x();
161 zoom2_init_quaduart(); 161 zoom_init_quaduart();
162 return platform_add_devices(zoom2_devices, ARRAY_SIZE(zoom2_devices)); 162 return platform_add_devices(zoom_devices, ARRAY_SIZE(zoom_devices));
163} 163}
diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c b/arch/arm/mach-omap2/board-zoom-peripherals.c
new file mode 100755
index 000000000000..f14baa392760
--- /dev/null
+++ b/arch/arm/mach-omap2/board-zoom-peripherals.c
@@ -0,0 +1,267 @@
1/*
2 * Copyright (C) 2009 Texas Instruments Inc.
3 *
4 * Modified from mach-omap2/board-zoom2.c
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
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/platform_device.h>
14#include <linux/input.h>
15#include <linux/input/matrix_keypad.h>
16#include <linux/gpio.h>
17#include <linux/i2c/twl4030.h>
18#include <linux/regulator/machine.h>
19
20#include <asm/mach-types.h>
21#include <asm/mach/arch.h>
22#include <asm/mach/map.h>
23
24#include <plat/common.h>
25#include <plat/usb.h>
26
27#include "mmc-twl4030.h"
28
29/* Zoom2 has Qwerty keyboard*/
30static int board_keymap[] = {
31 KEY(0, 0, KEY_E),
32 KEY(0, 1, KEY_R),
33 KEY(0, 2, KEY_T),
34 KEY(0, 3, KEY_HOME),
35 KEY(0, 6, KEY_I),
36 KEY(0, 7, KEY_LEFTSHIFT),
37 KEY(1, 0, KEY_D),
38 KEY(1, 1, KEY_F),
39 KEY(1, 2, KEY_G),
40 KEY(1, 3, KEY_SEND),
41 KEY(1, 6, KEY_K),
42 KEY(1, 7, KEY_ENTER),
43 KEY(2, 0, KEY_X),
44 KEY(2, 1, KEY_C),
45 KEY(2, 2, KEY_V),
46 KEY(2, 3, KEY_END),
47 KEY(2, 6, KEY_DOT),
48 KEY(2, 7, KEY_CAPSLOCK),
49 KEY(3, 0, KEY_Z),
50 KEY(3, 1, KEY_KPPLUS),
51 KEY(3, 2, KEY_B),
52 KEY(3, 3, KEY_F1),
53 KEY(3, 6, KEY_O),
54 KEY(3, 7, KEY_SPACE),
55 KEY(4, 0, KEY_W),
56 KEY(4, 1, KEY_Y),
57 KEY(4, 2, KEY_U),
58 KEY(4, 3, KEY_F2),
59 KEY(4, 4, KEY_VOLUMEUP),
60 KEY(4, 6, KEY_L),
61 KEY(4, 7, KEY_LEFT),
62 KEY(5, 0, KEY_S),
63 KEY(5, 1, KEY_H),
64 KEY(5, 2, KEY_J),
65 KEY(5, 3, KEY_F3),
66 KEY(5, 5, KEY_VOLUMEDOWN),
67 KEY(5, 6, KEY_M),
68 KEY(5, 7, KEY_ENTER),
69 KEY(6, 0, KEY_Q),
70 KEY(6, 1, KEY_A),
71 KEY(6, 2, KEY_N),
72 KEY(6, 3, KEY_BACKSPACE),
73 KEY(6, 6, KEY_P),
74 KEY(6, 7, KEY_SELECT),
75 KEY(7, 0, KEY_PROG1), /*MACRO 1 <User defined> */
76 KEY(7, 1, KEY_PROG2), /*MACRO 2 <User defined> */
77 KEY(7, 2, KEY_PROG3), /*MACRO 3 <User defined> */
78 KEY(7, 3, KEY_PROG4), /*MACRO 4 <User defined> */
79 KEY(7, 5, KEY_RIGHT),
80 KEY(7, 6, KEY_UP),
81 KEY(7, 7, KEY_DOWN)
82};
83
84static struct matrix_keymap_data board_map_data = {
85 .keymap = board_keymap,
86 .keymap_size = ARRAY_SIZE(board_keymap),
87};
88
89static struct twl4030_keypad_data zoom_kp_twl4030_data = {
90 .keymap_data = &board_map_data,
91 .rows = 8,
92 .cols = 8,
93 .rep = 1,
94};
95
96static struct regulator_consumer_supply zoom_vmmc1_supply = {
97 .supply = "vmmc",
98};
99
100static struct regulator_consumer_supply zoom_vsim_supply = {
101 .supply = "vmmc_aux",
102};
103
104static struct regulator_consumer_supply zoom_vmmc2_supply = {
105 .supply = "vmmc",
106};
107
108/* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */
109static struct regulator_init_data zoom_vmmc1 = {
110 .constraints = {
111 .min_uV = 1850000,
112 .max_uV = 3150000,
113 .valid_modes_mask = REGULATOR_MODE_NORMAL
114 | REGULATOR_MODE_STANDBY,
115 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
116 | REGULATOR_CHANGE_MODE
117 | REGULATOR_CHANGE_STATUS,
118 },
119 .num_consumer_supplies = 1,
120 .consumer_supplies = &zoom_vmmc1_supply,
121};
122
123/* VMMC2 for MMC2 card */
124static struct regulator_init_data zoom_vmmc2 = {
125 .constraints = {
126 .min_uV = 1850000,
127 .max_uV = 1850000,
128 .apply_uV = true,
129 .valid_modes_mask = REGULATOR_MODE_NORMAL
130 | REGULATOR_MODE_STANDBY,
131 .valid_ops_mask = REGULATOR_CHANGE_MODE
132 | REGULATOR_CHANGE_STATUS,
133 },
134 .num_consumer_supplies = 1,
135 .consumer_supplies = &zoom_vmmc2_supply,
136};
137
138/* VSIM for OMAP VDD_MMC1A (i/o for DAT4..DAT7) */
139static struct regulator_init_data zoom_vsim = {
140 .constraints = {
141 .min_uV = 1800000,
142 .max_uV = 3000000,
143 .valid_modes_mask = REGULATOR_MODE_NORMAL
144 | REGULATOR_MODE_STANDBY,
145 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
146 | REGULATOR_CHANGE_MODE
147 | REGULATOR_CHANGE_STATUS,
148 },
149 .num_consumer_supplies = 1,
150 .consumer_supplies = &zoom_vsim_supply,
151};
152
153static struct twl4030_hsmmc_info mmc[] __initdata = {
154 {
155 .mmc = 1,
156 .wires = 4,
157 .gpio_wp = -EINVAL,
158 },
159 {
160 .mmc = 2,
161 .wires = 4,
162 .gpio_wp = -EINVAL,
163 },
164 {} /* Terminator */
165};
166
167static int zoom_twl_gpio_setup(struct device *dev,
168 unsigned gpio, unsigned ngpio)
169{
170 /* gpio + 0 is "mmc0_cd" (input/IRQ),
171 * gpio + 1 is "mmc1_cd" (input/IRQ)
172 */
173 mmc[0].gpio_cd = gpio + 0;
174 mmc[1].gpio_cd = gpio + 1;
175 twl4030_mmc_init(mmc);
176
177 /* link regulators to MMC adapters ... we "know" the
178 * regulators will be set up only *after* we return.
179 */
180 zoom_vmmc1_supply.dev = mmc[0].dev;
181 zoom_vsim_supply.dev = mmc[0].dev;
182 zoom_vmmc2_supply.dev = mmc[1].dev;
183
184 return 0;
185}
186
187
188static int zoom_batt_table[] = {
189/* 0 C*/
19030800, 29500, 28300, 27100,
19126000, 24900, 23900, 22900, 22000, 21100, 20300, 19400, 18700, 17900,
19217200, 16500, 15900, 15300, 14700, 14100, 13600, 13100, 12600, 12100,
19311600, 11200, 10800, 10400, 10000, 9630, 9280, 8950, 8620, 8310,
1948020, 7730, 7460, 7200, 6950, 6710, 6470, 6250, 6040, 5830,
1955640, 5450, 5260, 5090, 4920, 4760, 4600, 4450, 4310, 4170,
1964040, 3910, 3790, 3670, 3550
197};
198
199static struct twl4030_bci_platform_data zoom_bci_data = {
200 .battery_tmp_tbl = zoom_batt_table,
201 .tblsize = ARRAY_SIZE(zoom_batt_table),
202};
203
204static struct twl4030_usb_data zoom_usb_data = {
205 .usb_mode = T2_USB_MODE_ULPI,
206};
207
208static struct twl4030_gpio_platform_data zoom_gpio_data = {
209 .gpio_base = OMAP_MAX_GPIO_LINES,
210 .irq_base = TWL4030_GPIO_IRQ_BASE,
211 .irq_end = TWL4030_GPIO_IRQ_END,
212 .setup = zoom_twl_gpio_setup,
213};
214
215static struct twl4030_madc_platform_data zoom_madc_data = {
216 .irq_line = 1,
217};
218
219static struct twl4030_codec_audio_data zoom_audio_data = {
220 .audio_mclk = 26000000,
221};
222
223static struct twl4030_codec_data zoom_codec_data = {
224 .audio_mclk = 26000000,
225 .audio = &zoom_audio_data,
226};
227
228static struct twl4030_platform_data zoom_twldata = {
229 .irq_base = TWL4030_IRQ_BASE,
230 .irq_end = TWL4030_IRQ_END,
231
232 /* platform_data for children goes here */
233 .bci = &zoom_bci_data,
234 .madc = &zoom_madc_data,
235 .usb = &zoom_usb_data,
236 .gpio = &zoom_gpio_data,
237 .keypad = &zoom_kp_twl4030_data,
238 .codec = &zoom_codec_data,
239 .vmmc2 = &zoom_vmmc2,
240 .vsim = &zoom_vsim,
241
242};
243
244static struct i2c_board_info __initdata zoom_i2c_boardinfo[] = {
245 {
246 I2C_BOARD_INFO("twl5030", 0x48),
247 .flags = I2C_CLIENT_WAKE,
248 .irq = INT_34XX_SYS_NIRQ,
249 .platform_data = &zoom_twldata,
250 },
251};
252
253static int __init omap_i2c_init(void)
254{
255 omap_register_i2c_bus(1, 2400, zoom_i2c_boardinfo,
256 ARRAY_SIZE(zoom_i2c_boardinfo));
257 omap_register_i2c_bus(2, 400, NULL, 0);
258 omap_register_i2c_bus(3, 400, NULL, 0);
259 return 0;
260}
261
262void __init zoom_peripherals_init(void)
263{
264 omap_i2c_init();
265 omap_serial_init();
266 usb_musb_init();
267}
diff --git a/arch/arm/mach-omap2/board-zoom2.c b/arch/arm/mach-omap2/board-zoom2.c
index 51e0b3ba5f3a..d94d047c7dce 100644
--- a/arch/arm/mach-omap2/board-zoom2.c
+++ b/arch/arm/mach-omap2/board-zoom2.c
@@ -13,223 +13,42 @@
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/platform_device.h> 14#include <linux/platform_device.h>
15#include <linux/input.h> 15#include <linux/input.h>
16#include <linux/input/matrix_keypad.h>
17#include <linux/gpio.h> 16#include <linux/gpio.h>
18#include <linux/i2c/twl4030.h>
19#include <linux/regulator/machine.h>
20 17
21#include <asm/mach-types.h> 18#include <asm/mach-types.h>
22#include <asm/mach/arch.h> 19#include <asm/mach/arch.h>
23 20
24#include <mach/common.h> 21#include <plat/common.h>
25#include <mach/usb.h> 22#include <plat/board.h>
26 23
27#include "mmc-twl4030.h" 24#include <mach/board-zoom.h>
28#include "sdram-micron-mt46h32m32lf-6.h"
29
30/* Zoom2 has Qwerty keyboard*/
31static int board_keymap[] = {
32 KEY(0, 0, KEY_E),
33 KEY(0, 1, KEY_R),
34 KEY(0, 2, KEY_T),
35 KEY(0, 3, KEY_HOME),
36 KEY(0, 6, KEY_I),
37 KEY(0, 7, KEY_LEFTSHIFT),
38 KEY(1, 0, KEY_D),
39 KEY(1, 1, KEY_F),
40 KEY(1, 2, KEY_G),
41 KEY(1, 3, KEY_SEND),
42 KEY(1, 6, KEY_K),
43 KEY(1, 7, KEY_ENTER),
44 KEY(2, 0, KEY_X),
45 KEY(2, 1, KEY_C),
46 KEY(2, 2, KEY_V),
47 KEY(2, 3, KEY_END),
48 KEY(2, 6, KEY_DOT),
49 KEY(2, 7, KEY_CAPSLOCK),
50 KEY(3, 0, KEY_Z),
51 KEY(3, 1, KEY_KPPLUS),
52 KEY(3, 2, KEY_B),
53 KEY(3, 3, KEY_F1),
54 KEY(3, 6, KEY_O),
55 KEY(3, 7, KEY_SPACE),
56 KEY(4, 0, KEY_W),
57 KEY(4, 1, KEY_Y),
58 KEY(4, 2, KEY_U),
59 KEY(4, 3, KEY_F2),
60 KEY(4, 4, KEY_VOLUMEUP),
61 KEY(4, 6, KEY_L),
62 KEY(4, 7, KEY_LEFT),
63 KEY(5, 0, KEY_S),
64 KEY(5, 1, KEY_H),
65 KEY(5, 2, KEY_J),
66 KEY(5, 3, KEY_F3),
67 KEY(5, 5, KEY_VOLUMEDOWN),
68 KEY(5, 6, KEY_M),
69 KEY(5, 7, KEY_ENTER),
70 KEY(6, 0, KEY_Q),
71 KEY(6, 1, KEY_A),
72 KEY(6, 2, KEY_N),
73 KEY(6, 3, KEY_BACKSPACE),
74 KEY(6, 6, KEY_P),
75 KEY(6, 7, KEY_SELECT),
76 KEY(7, 0, KEY_PROG1), /*MACRO 1 <User defined> */
77 KEY(7, 1, KEY_PROG2), /*MACRO 2 <User defined> */
78 KEY(7, 2, KEY_PROG3), /*MACRO 3 <User defined> */
79 KEY(7, 3, KEY_PROG4), /*MACRO 4 <User defined> */
80 KEY(7, 5, KEY_RIGHT),
81 KEY(7, 6, KEY_UP),
82 KEY(7, 7, KEY_DOWN)
83};
84
85static struct matrix_keymap_data board_map_data = {
86 .keymap = board_keymap,
87 .keymap_size = ARRAY_SIZE(board_keymap),
88};
89
90static struct twl4030_keypad_data zoom2_kp_twl4030_data = {
91 .keymap_data = &board_map_data,
92 .rows = 8,
93 .cols = 8,
94 .rep = 1,
95};
96
97static struct omap_board_config_kernel zoom2_config[] __initdata = {
98};
99
100static struct regulator_consumer_supply zoom2_vmmc1_supply = {
101 .supply = "vmmc",
102};
103
104static struct regulator_consumer_supply zoom2_vsim_supply = {
105 .supply = "vmmc_aux",
106};
107
108static struct regulator_consumer_supply zoom2_vmmc2_supply = {
109 .supply = "vmmc",
110};
111
112/* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */
113static struct regulator_init_data zoom2_vmmc1 = {
114 .constraints = {
115 .min_uV = 1850000,
116 .max_uV = 3150000,
117 .valid_modes_mask = REGULATOR_MODE_NORMAL
118 | REGULATOR_MODE_STANDBY,
119 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
120 | REGULATOR_CHANGE_MODE
121 | REGULATOR_CHANGE_STATUS,
122 },
123 .num_consumer_supplies = 1,
124 .consumer_supplies = &zoom2_vmmc1_supply,
125};
126
127/* VMMC2 for MMC2 card */
128static struct regulator_init_data zoom2_vmmc2 = {
129 .constraints = {
130 .min_uV = 1850000,
131 .max_uV = 1850000,
132 .apply_uV = true,
133 .valid_modes_mask = REGULATOR_MODE_NORMAL
134 | REGULATOR_MODE_STANDBY,
135 .valid_ops_mask = REGULATOR_CHANGE_MODE
136 | REGULATOR_CHANGE_STATUS,
137 },
138 .num_consumer_supplies = 1,
139 .consumer_supplies = &zoom2_vmmc2_supply,
140};
141
142/* VSIM for OMAP VDD_MMC1A (i/o for DAT4..DAT7) */
143static struct regulator_init_data zoom2_vsim = {
144 .constraints = {
145 .min_uV = 1800000,
146 .max_uV = 3000000,
147 .valid_modes_mask = REGULATOR_MODE_NORMAL
148 | REGULATOR_MODE_STANDBY,
149 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
150 | REGULATOR_CHANGE_MODE
151 | REGULATOR_CHANGE_STATUS,
152 },
153 .num_consumer_supplies = 1,
154 .consumer_supplies = &zoom2_vsim_supply,
155};
156
157static struct twl4030_hsmmc_info mmc[] __initdata = {
158 {
159 .mmc = 1,
160 .wires = 4,
161 .gpio_wp = -EINVAL,
162 },
163 {
164 .mmc = 2,
165 .wires = 4,
166 .gpio_wp = -EINVAL,
167 },
168 {} /* Terminator */
169};
170 25
171static int zoom2_twl_gpio_setup(struct device *dev, 26#include "sdram-micron-mt46h32m32lf-6.h"
172 unsigned gpio, unsigned ngpio)
173{
174 /* gpio + 0 is "mmc0_cd" (input/IRQ),
175 * gpio + 1 is "mmc1_cd" (input/IRQ)
176 */
177 mmc[0].gpio_cd = gpio + 0;
178 mmc[1].gpio_cd = gpio + 1;
179 twl4030_mmc_init(mmc);
180
181 /* link regulators to MMC adapters ... we "know" the
182 * regulators will be set up only *after* we return.
183 */
184 zoom2_vmmc1_supply.dev = mmc[0].dev;
185 zoom2_vsim_supply.dev = mmc[0].dev;
186 zoom2_vmmc2_supply.dev = mmc[1].dev;
187
188 return 0;
189}
190
191
192static int zoom2_batt_table[] = {
193/* 0 C*/
19430800, 29500, 28300, 27100,
19526000, 24900, 23900, 22900, 22000, 21100, 20300, 19400, 18700, 17900,
19617200, 16500, 15900, 15300, 14700, 14100, 13600, 13100, 12600, 12100,
19711600, 11200, 10800, 10400, 10000, 9630, 9280, 8950, 8620, 8310,
1988020, 7730, 7460, 7200, 6950, 6710, 6470, 6250, 6040, 5830,
1995640, 5450, 5260, 5090, 4920, 4760, 4600, 4450, 4310, 4170,
2004040, 3910, 3790, 3670, 3550
201};
202
203static struct twl4030_bci_platform_data zoom2_bci_data = {
204 .battery_tmp_tbl = zoom2_batt_table,
205 .tblsize = ARRAY_SIZE(zoom2_batt_table),
206};
207
208static struct twl4030_usb_data zoom2_usb_data = {
209 .usb_mode = T2_USB_MODE_ULPI,
210};
211 27
212static void __init omap_zoom2_init_irq(void) 28static void __init omap_zoom2_init_irq(void)
213{ 29{
214 omap_board_config = zoom2_config;
215 omap_board_config_size = ARRAY_SIZE(zoom2_config);
216 omap2_init_common_hw(mt46h32m32lf6_sdrc_params, 30 omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
217 mt46h32m32lf6_sdrc_params); 31 mt46h32m32lf6_sdrc_params);
218 omap_init_irq(); 32 omap_init_irq();
219 omap_gpio_init(); 33 omap_gpio_init();
220} 34}
221 35
222static struct twl4030_gpio_platform_data zoom2_gpio_data = { 36/* REVISIT: These audio entries can be removed once MFD code is merged */
223 .gpio_base = OMAP_MAX_GPIO_LINES, 37#if 0
224 .irq_base = TWL4030_GPIO_IRQ_BASE,
225 .irq_end = TWL4030_GPIO_IRQ_END,
226 .setup = zoom2_twl_gpio_setup,
227};
228 38
229static struct twl4030_madc_platform_data zoom2_madc_data = { 39static struct twl4030_madc_platform_data zoom2_madc_data = {
230 .irq_line = 1, 40 .irq_line = 1,
231}; 41};
232 42
43static struct twl4030_codec_audio_data zoom2_audio_data = {
44 .audio_mclk = 26000000,
45};
46
47static struct twl4030_codec_data zoom2_codec_data = {
48 .audio_mclk = 26000000,
49 .audio = &zoom2_audio_data,
50};
51
233static struct twl4030_platform_data zoom2_twldata = { 52static struct twl4030_platform_data zoom2_twldata = {
234 .irq_base = TWL4030_IRQ_BASE, 53 .irq_base = TWL4030_IRQ_BASE,
235 .irq_end = TWL4030_IRQ_END, 54 .irq_end = TWL4030_IRQ_END,
@@ -240,38 +59,19 @@ static struct twl4030_platform_data zoom2_twldata = {
240 .usb = &zoom2_usb_data, 59 .usb = &zoom2_usb_data,
241 .gpio = &zoom2_gpio_data, 60 .gpio = &zoom2_gpio_data,
242 .keypad = &zoom2_kp_twl4030_data, 61 .keypad = &zoom2_kp_twl4030_data,
62 .codec = &zoom2_codec_data,
243 .vmmc1 = &zoom2_vmmc1, 63 .vmmc1 = &zoom2_vmmc1,
244 .vmmc2 = &zoom2_vmmc2, 64 .vmmc2 = &zoom2_vmmc2,
245 .vsim = &zoom2_vsim, 65 .vsim = &zoom2_vsim,
246 66
247}; 67};
248 68
249static struct i2c_board_info __initdata zoom2_i2c_boardinfo[] = { 69#endif
250 {
251 I2C_BOARD_INFO("twl4030", 0x48),
252 .flags = I2C_CLIENT_WAKE,
253 .irq = INT_34XX_SYS_NIRQ,
254 .platform_data = &zoom2_twldata,
255 },
256};
257
258static int __init omap_i2c_init(void)
259{
260 omap_register_i2c_bus(1, 2600, zoom2_i2c_boardinfo,
261 ARRAY_SIZE(zoom2_i2c_boardinfo));
262 omap_register_i2c_bus(2, 400, NULL, 0);
263 omap_register_i2c_bus(3, 400, NULL, 0);
264 return 0;
265}
266
267extern int __init omap_zoom2_debugboard_init(void);
268 70
269static void __init omap_zoom2_init(void) 71static void __init omap_zoom2_init(void)
270{ 72{
271 omap_i2c_init(); 73 zoom_peripherals_init();
272 omap_serial_init(); 74 zoom_debugboard_init();
273 omap_zoom2_debugboard_init();
274 usb_musb_init();
275} 75}
276 76
277static void __init omap_zoom2_map_io(void) 77static void __init omap_zoom2_map_io(void)
@@ -282,7 +82,7 @@ static void __init omap_zoom2_map_io(void)
282 82
283MACHINE_START(OMAP_ZOOM2, "OMAP Zoom2 board") 83MACHINE_START(OMAP_ZOOM2, "OMAP Zoom2 board")
284 .phys_io = 0x48000000, 84 .phys_io = 0x48000000,
285 .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc, 85 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc,
286 .boot_params = 0x80000100, 86 .boot_params = 0x80000100,
287 .map_io = omap_zoom2_map_io, 87 .map_io = omap_zoom2_map_io,
288 .init_irq = omap_zoom2_init_irq, 88 .init_irq = omap_zoom2_init_irq,
diff --git a/arch/arm/mach-omap2/board-zoom3.c b/arch/arm/mach-omap2/board-zoom3.c
new file mode 100644
index 000000000000..8d965a6516c8
--- /dev/null
+++ b/arch/arm/mach-omap2/board-zoom3.c
@@ -0,0 +1,59 @@
1/*
2 * Copyright (C) 2009 Texas Instruments Inc.
3 *
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 */
9
10#include <linux/kernel.h>
11#include <linux/init.h>
12#include <linux/platform_device.h>
13#include <linux/input.h>
14#include <linux/gpio.h>
15
16#include <asm/mach-types.h>
17#include <asm/mach/arch.h>
18
19#include <mach/board-zoom.h>
20
21#include <plat/common.h>
22#include <plat/board.h>
23
24#include "sdram-hynix-h8mbx00u0mer-0em.h"
25
26static void __init omap_zoom_map_io(void)
27{
28 omap2_set_globals_343x();
29 omap2_map_common_io();
30}
31
32static struct omap_board_config_kernel zoom_config[] __initdata = {
33};
34
35static void __init omap_zoom_init_irq(void)
36{
37 omap_board_config = zoom_config;
38 omap_board_config_size = ARRAY_SIZE(zoom_config);
39 omap2_init_common_hw(h8mbx00u0mer0em_sdrc_params,
40 h8mbx00u0mer0em_sdrc_params);
41 omap_init_irq();
42 omap_gpio_init();
43}
44
45static void __init omap_zoom_init(void)
46{
47 zoom_peripherals_init();
48 zoom_debugboard_init();
49}
50
51MACHINE_START(OMAP_ZOOM3, "OMAP Zoom3 board")
52 .phys_io = 0x48000000,
53 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc,
54 .boot_params = 0x80000100,
55 .map_io = omap_zoom_map_io,
56 .init_irq = omap_zoom_init_irq,
57 .init_machine = omap_zoom_init,
58 .timer = &omap_timer,
59MACHINE_END
diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
index f2a92d614f0f..4716206547ac 100644
--- a/arch/arm/mach-omap2/clock.c
+++ b/arch/arm/mach-omap2/clock.c
@@ -24,13 +24,13 @@
24#include <linux/io.h> 24#include <linux/io.h>
25#include <linux/bitops.h> 25#include <linux/bitops.h>
26 26
27#include <mach/clock.h> 27#include <plat/clock.h>
28#include <mach/clockdomain.h> 28#include <plat/clockdomain.h>
29#include <mach/cpu.h> 29#include <plat/cpu.h>
30#include <mach/prcm.h> 30#include <plat/prcm.h>
31#include <asm/div64.h> 31#include <asm/div64.h>
32 32
33#include <mach/sdrc.h> 33#include <plat/sdrc.h>
34#include "sdrc.h" 34#include "sdrc.h"
35#include "clock.h" 35#include "clock.h"
36#include "prm.h" 36#include "prm.h"
diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h
index 9ae7540f8af2..43b6bedaafd6 100644
--- a/arch/arm/mach-omap2/clock.h
+++ b/arch/arm/mach-omap2/clock.h
@@ -16,7 +16,7 @@
16#ifndef __ARCH_ARM_MACH_OMAP2_CLOCK_H 16#ifndef __ARCH_ARM_MACH_OMAP2_CLOCK_H
17#define __ARCH_ARM_MACH_OMAP2_CLOCK_H 17#define __ARCH_ARM_MACH_OMAP2_CLOCK_H
18 18
19#include <mach/clock.h> 19#include <plat/clock.h>
20 20
21/* The maximum error between a target DPLL rate and the rounded rate in Hz */ 21/* The maximum error between a target DPLL rate and the rounded rate in Hz */
22#define DEFAULT_DPLL_RATE_TOLERANCE 50000 22#define DEFAULT_DPLL_RATE_TOLERANCE 50000
diff --git a/arch/arm/mach-omap2/clock24xx.c b/arch/arm/mach-omap2/clock24xx.c
index e2dbedd581e8..e70e7e000eaa 100644
--- a/arch/arm/mach-omap2/clock24xx.c
+++ b/arch/arm/mach-omap2/clock24xx.c
@@ -28,13 +28,13 @@
28#include <linux/cpufreq.h> 28#include <linux/cpufreq.h>
29#include <linux/bitops.h> 29#include <linux/bitops.h>
30 30
31#include <mach/clock.h> 31#include <plat/clock.h>
32#include <mach/sram.h> 32#include <plat/sram.h>
33#include <mach/prcm.h> 33#include <plat/prcm.h>
34#include <asm/div64.h> 34#include <asm/div64.h>
35#include <asm/clkdev.h> 35#include <asm/clkdev.h>
36 36
37#include <mach/sdrc.h> 37#include <plat/sdrc.h>
38#include "clock.h" 38#include "clock.h"
39#include "prm.h" 39#include "prm.h"
40#include "prm-regbits-24xx.h" 40#include "prm-regbits-24xx.h"
diff --git a/arch/arm/mach-omap2/clock34xx.c b/arch/arm/mach-omap2/clock34xx.c
index 7c5c00df3c70..9f2feaf79865 100644
--- a/arch/arm/mach-omap2/clock34xx.c
+++ b/arch/arm/mach-omap2/clock34xx.c
@@ -27,13 +27,13 @@
27#include <linux/limits.h> 27#include <linux/limits.h>
28#include <linux/bitops.h> 28#include <linux/bitops.h>
29 29
30#include <mach/cpu.h> 30#include <plat/cpu.h>
31#include <mach/clock.h> 31#include <plat/clock.h>
32#include <mach/sram.h> 32#include <plat/sram.h>
33#include <asm/div64.h> 33#include <asm/div64.h>
34#include <asm/clkdev.h> 34#include <asm/clkdev.h>
35 35
36#include <mach/sdrc.h> 36#include <plat/sdrc.h>
37#include "clock.h" 37#include "clock.h"
38#include "prm.h" 38#include "prm.h"
39#include "prm-regbits-34xx.h" 39#include "prm-regbits-34xx.h"
@@ -119,7 +119,7 @@ static struct omap_clk omap34xx_clks[] = {
119 CLK(NULL, "dpll3_m2x2_ck", &dpll3_m2x2_ck, CK_343X), 119 CLK(NULL, "dpll3_m2x2_ck", &dpll3_m2x2_ck, CK_343X),
120 CLK(NULL, "dpll3_m3_ck", &dpll3_m3_ck, CK_343X), 120 CLK(NULL, "dpll3_m3_ck", &dpll3_m3_ck, CK_343X),
121 CLK(NULL, "dpll3_m3x2_ck", &dpll3_m3x2_ck, CK_343X), 121 CLK(NULL, "dpll3_m3x2_ck", &dpll3_m3x2_ck, CK_343X),
122 CLK(NULL, "emu_core_alwon_ck", &emu_core_alwon_ck, CK_343X), 122 CLK("etb", "emu_core_alwon_ck", &emu_core_alwon_ck, CK_343X),
123 CLK(NULL, "dpll4_ck", &dpll4_ck, CK_343X), 123 CLK(NULL, "dpll4_ck", &dpll4_ck, CK_343X),
124 CLK(NULL, "dpll4_x2_ck", &dpll4_x2_ck, CK_343X), 124 CLK(NULL, "dpll4_x2_ck", &dpll4_x2_ck, CK_343X),
125 CLK(NULL, "omap_96m_alwon_fck", &omap_96m_alwon_fck, CK_343X), 125 CLK(NULL, "omap_96m_alwon_fck", &omap_96m_alwon_fck, CK_343X),
@@ -138,7 +138,7 @@ static struct omap_clk omap34xx_clks[] = {
138 CLK(NULL, "dpll4_m5x2_ck", &dpll4_m5x2_ck, CK_343X), 138 CLK(NULL, "dpll4_m5x2_ck", &dpll4_m5x2_ck, CK_343X),
139 CLK(NULL, "dpll4_m6_ck", &dpll4_m6_ck, CK_343X), 139 CLK(NULL, "dpll4_m6_ck", &dpll4_m6_ck, CK_343X),
140 CLK(NULL, "dpll4_m6x2_ck", &dpll4_m6x2_ck, CK_343X), 140 CLK(NULL, "dpll4_m6x2_ck", &dpll4_m6x2_ck, CK_343X),
141 CLK(NULL, "emu_per_alwon_ck", &emu_per_alwon_ck, CK_343X), 141 CLK("etb", "emu_per_alwon_ck", &emu_per_alwon_ck, CK_343X),
142 CLK(NULL, "dpll5_ck", &dpll5_ck, CK_3430ES2), 142 CLK(NULL, "dpll5_ck", &dpll5_ck, CK_3430ES2),
143 CLK(NULL, "dpll5_m2_ck", &dpll5_m2_ck, CK_3430ES2), 143 CLK(NULL, "dpll5_m2_ck", &dpll5_m2_ck, CK_3430ES2),
144 CLK(NULL, "clkout2_src_ck", &clkout2_src_ck, CK_343X), 144 CLK(NULL, "clkout2_src_ck", &clkout2_src_ck, CK_343X),
@@ -147,7 +147,7 @@ static struct omap_clk omap34xx_clks[] = {
147 CLK(NULL, "dpll1_fck", &dpll1_fck, CK_343X), 147 CLK(NULL, "dpll1_fck", &dpll1_fck, CK_343X),
148 CLK(NULL, "mpu_ck", &mpu_ck, CK_343X), 148 CLK(NULL, "mpu_ck", &mpu_ck, CK_343X),
149 CLK(NULL, "arm_fck", &arm_fck, CK_343X), 149 CLK(NULL, "arm_fck", &arm_fck, CK_343X),
150 CLK(NULL, "emu_mpu_alwon_ck", &emu_mpu_alwon_ck, CK_343X), 150 CLK("etb", "emu_mpu_alwon_ck", &emu_mpu_alwon_ck, CK_343X),
151 CLK(NULL, "dpll2_fck", &dpll2_fck, CK_343X), 151 CLK(NULL, "dpll2_fck", &dpll2_fck, CK_343X),
152 CLK(NULL, "iva2_ck", &iva2_ck, CK_343X), 152 CLK(NULL, "iva2_ck", &iva2_ck, CK_343X),
153 CLK(NULL, "l3_ick", &l3_ick, CK_343X), 153 CLK(NULL, "l3_ick", &l3_ick, CK_343X),
@@ -302,7 +302,7 @@ static struct omap_clk omap34xx_clks[] = {
302 CLK("omap-mcbsp.2", "fck", &mcbsp2_fck, CK_343X), 302 CLK("omap-mcbsp.2", "fck", &mcbsp2_fck, CK_343X),
303 CLK("omap-mcbsp.3", "fck", &mcbsp3_fck, CK_343X), 303 CLK("omap-mcbsp.3", "fck", &mcbsp3_fck, CK_343X),
304 CLK("omap-mcbsp.4", "fck", &mcbsp4_fck, CK_343X), 304 CLK("omap-mcbsp.4", "fck", &mcbsp4_fck, CK_343X),
305 CLK(NULL, "emu_src_ck", &emu_src_ck, CK_343X), 305 CLK("etb", "emu_src_ck", &emu_src_ck, CK_343X),
306 CLK(NULL, "pclk_fck", &pclk_fck, CK_343X), 306 CLK(NULL, "pclk_fck", &pclk_fck, CK_343X),
307 CLK(NULL, "pclkx2_fck", &pclkx2_fck, CK_343X), 307 CLK(NULL, "pclkx2_fck", &pclkx2_fck, CK_343X),
308 CLK(NULL, "atclk_fck", &atclk_fck, CK_343X), 308 CLK(NULL, "atclk_fck", &atclk_fck, CK_343X),
diff --git a/arch/arm/mach-omap2/clock34xx.h b/arch/arm/mach-omap2/clock34xx.h
index 9565c05bebd2..8fe1bcb23dd9 100644
--- a/arch/arm/mach-omap2/clock34xx.h
+++ b/arch/arm/mach-omap2/clock34xx.h
@@ -19,7 +19,7 @@
19#ifndef __ARCH_ARM_MACH_OMAP2_CLOCK34XX_H 19#ifndef __ARCH_ARM_MACH_OMAP2_CLOCK34XX_H
20#define __ARCH_ARM_MACH_OMAP2_CLOCK34XX_H 20#define __ARCH_ARM_MACH_OMAP2_CLOCK34XX_H
21 21
22#include <mach/control.h> 22#include <plat/control.h>
23 23
24#include "clock.h" 24#include "clock.h"
25#include "cm.h" 25#include "cm.h"
diff --git a/arch/arm/mach-omap2/clockdomain.c b/arch/arm/mach-omap2/clockdomain.c
index 58aff8485df9..fcd82320a6a3 100644
--- a/arch/arm/mach-omap2/clockdomain.c
+++ b/arch/arm/mach-omap2/clockdomain.c
@@ -28,14 +28,14 @@
28 28
29#include <linux/bitops.h> 29#include <linux/bitops.h>
30 30
31#include <mach/clock.h> 31#include <plat/clock.h>
32 32
33#include "prm.h" 33#include "prm.h"
34#include "prm-regbits-24xx.h" 34#include "prm-regbits-24xx.h"
35#include "cm.h" 35#include "cm.h"
36 36
37#include <mach/powerdomain.h> 37#include <plat/powerdomain.h>
38#include <mach/clockdomain.h> 38#include <plat/clockdomain.h>
39 39
40/* clkdm_list contains all registered struct clockdomains */ 40/* clkdm_list contains all registered struct clockdomains */
41static LIST_HEAD(clkdm_list); 41static LIST_HEAD(clkdm_list);
diff --git a/arch/arm/mach-omap2/clockdomains.h b/arch/arm/mach-omap2/clockdomains.h
index fe319ae4ca0a..c4ee0761d908 100644
--- a/arch/arm/mach-omap2/clockdomains.h
+++ b/arch/arm/mach-omap2/clockdomains.h
@@ -10,7 +10,7 @@
10#ifndef __ARCH_ARM_MACH_OMAP2_CLOCKDOMAINS_H 10#ifndef __ARCH_ARM_MACH_OMAP2_CLOCKDOMAINS_H
11#define __ARCH_ARM_MACH_OMAP2_CLOCKDOMAINS_H 11#define __ARCH_ARM_MACH_OMAP2_CLOCKDOMAINS_H
12 12
13#include <mach/clockdomain.h> 13#include <plat/clockdomain.h>
14 14
15/* 15/*
16 * OMAP2/3-common clockdomains 16 * OMAP2/3-common clockdomains
diff --git a/arch/arm/mach-omap2/cm.h b/arch/arm/mach-omap2/cm.h
index cfd0b726ba44..a2fcfcc253cc 100644
--- a/arch/arm/mach-omap2/cm.h
+++ b/arch/arm/mach-omap2/cm.h
@@ -17,11 +17,11 @@
17#include "prcm-common.h" 17#include "prcm-common.h"
18 18
19#define OMAP2420_CM_REGADDR(module, reg) \ 19#define OMAP2420_CM_REGADDR(module, reg) \
20 OMAP2_IO_ADDRESS(OMAP2420_CM_BASE + (module) + (reg)) 20 OMAP2_L4_IO_ADDRESS(OMAP2420_CM_BASE + (module) + (reg))
21#define OMAP2430_CM_REGADDR(module, reg) \ 21#define OMAP2430_CM_REGADDR(module, reg) \
22 OMAP2_IO_ADDRESS(OMAP2430_CM_BASE + (module) + (reg)) 22 OMAP2_L4_IO_ADDRESS(OMAP2430_CM_BASE + (module) + (reg))
23#define OMAP34XX_CM_REGADDR(module, reg) \ 23#define OMAP34XX_CM_REGADDR(module, reg) \
24 OMAP2_IO_ADDRESS(OMAP3430_CM_BASE + (module) + (reg)) 24 OMAP2_L4_IO_ADDRESS(OMAP3430_CM_BASE + (module) + (reg))
25 25
26/* 26/*
27 * Architecture-specific global CM registers 27 * Architecture-specific global CM registers
diff --git a/arch/arm/mach-omap2/control.c b/arch/arm/mach-omap2/control.c
index 5f3aad977842..cdd1f35636dd 100644
--- a/arch/arm/mach-omap2/control.c
+++ b/arch/arm/mach-omap2/control.c
@@ -15,11 +15,127 @@
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/io.h> 16#include <linux/io.h>
17 17
18#include <mach/common.h> 18#include <plat/common.h>
19#include <mach/control.h> 19#include <plat/control.h>
20#include <plat/sdrc.h>
21#include "cm-regbits-34xx.h"
22#include "prm-regbits-34xx.h"
23#include "cm.h"
24#include "prm.h"
25#include "sdrc.h"
20 26
21static void __iomem *omap2_ctrl_base; 27static void __iomem *omap2_ctrl_base;
22 28
29#if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_PM)
30struct omap3_scratchpad {
31 u32 boot_config_ptr;
32 u32 public_restore_ptr;
33 u32 secure_ram_restore_ptr;
34 u32 sdrc_module_semaphore;
35 u32 prcm_block_offset;
36 u32 sdrc_block_offset;
37};
38
39struct omap3_scratchpad_prcm_block {
40 u32 prm_clksrc_ctrl;
41 u32 prm_clksel;
42 u32 cm_clksel_core;
43 u32 cm_clksel_wkup;
44 u32 cm_clken_pll;
45 u32 cm_autoidle_pll;
46 u32 cm_clksel1_pll;
47 u32 cm_clksel2_pll;
48 u32 cm_clksel3_pll;
49 u32 cm_clken_pll_mpu;
50 u32 cm_autoidle_pll_mpu;
51 u32 cm_clksel1_pll_mpu;
52 u32 cm_clksel2_pll_mpu;
53 u32 prcm_block_size;
54};
55
56struct omap3_scratchpad_sdrc_block {
57 u16 sysconfig;
58 u16 cs_cfg;
59 u16 sharing;
60 u16 err_type;
61 u32 dll_a_ctrl;
62 u32 dll_b_ctrl;
63 u32 power;
64 u32 cs_0;
65 u32 mcfg_0;
66 u16 mr_0;
67 u16 emr_1_0;
68 u16 emr_2_0;
69 u16 emr_3_0;
70 u32 actim_ctrla_0;
71 u32 actim_ctrlb_0;
72 u32 rfr_ctrl_0;
73 u32 cs_1;
74 u32 mcfg_1;
75 u16 mr_1;
76 u16 emr_1_1;
77 u16 emr_2_1;
78 u16 emr_3_1;
79 u32 actim_ctrla_1;
80 u32 actim_ctrlb_1;
81 u32 rfr_ctrl_1;
82 u16 dcdl_1_ctrl;
83 u16 dcdl_2_ctrl;
84 u32 flags;
85 u32 block_size;
86};
87
88void *omap3_secure_ram_storage;
89
90/*
91 * This is used to store ARM registers in SDRAM before attempting
92 * an MPU OFF. The save and restore happens from the SRAM sleep code.
93 * The address is stored in scratchpad, so that it can be used
94 * during the restore path.
95 */
96u32 omap3_arm_context[128];
97
98struct omap3_control_regs {
99 u32 sysconfig;
100 u32 devconf0;
101 u32 mem_dftrw0;
102 u32 mem_dftrw1;
103 u32 msuspendmux_0;
104 u32 msuspendmux_1;
105 u32 msuspendmux_2;
106 u32 msuspendmux_3;
107 u32 msuspendmux_4;
108 u32 msuspendmux_5;
109 u32 sec_ctrl;
110 u32 devconf1;
111 u32 csirxfe;
112 u32 iva2_bootaddr;
113 u32 iva2_bootmod;
114 u32 debobs_0;
115 u32 debobs_1;
116 u32 debobs_2;
117 u32 debobs_3;
118 u32 debobs_4;
119 u32 debobs_5;
120 u32 debobs_6;
121 u32 debobs_7;
122 u32 debobs_8;
123 u32 prog_io0;
124 u32 prog_io1;
125 u32 dss_dpll_spreading;
126 u32 core_dpll_spreading;
127 u32 per_dpll_spreading;
128 u32 usbhost_dpll_spreading;
129 u32 pbias_lite;
130 u32 temp_sensor;
131 u32 sramldo4;
132 u32 sramldo5;
133 u32 csi;
134};
135
136static struct omap3_control_regs control_context;
137#endif /* CONFIG_ARCH_OMAP3 && CONFIG_PM */
138
23#define OMAP_CTRL_REGADDR(reg) (omap2_ctrl_base + (reg)) 139#define OMAP_CTRL_REGADDR(reg) (omap2_ctrl_base + (reg))
24 140
25void __init omap2_set_globals_control(struct omap_globals *omap2_globals) 141void __init omap2_set_globals_control(struct omap_globals *omap2_globals)
@@ -62,3 +178,268 @@ void omap_ctrl_writel(u32 val, u16 offset)
62 __raw_writel(val, OMAP_CTRL_REGADDR(offset)); 178 __raw_writel(val, OMAP_CTRL_REGADDR(offset));
63} 179}
64 180
181#if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_PM)
182/*
183 * Clears the scratchpad contents in case of cold boot-
184 * called during bootup
185 */
186void omap3_clear_scratchpad_contents(void)
187{
188 u32 max_offset = OMAP343X_SCRATCHPAD_ROM_OFFSET;
189 u32 *v_addr;
190 u32 offset = 0;
191 v_addr = OMAP2_L4_IO_ADDRESS(OMAP343X_SCRATCHPAD_ROM);
192 if (prm_read_mod_reg(OMAP3430_GR_MOD, OMAP3_PRM_RSTST_OFFSET) &
193 OMAP3430_GLOBAL_COLD_RST) {
194 for ( ; offset <= max_offset; offset += 0x4)
195 __raw_writel(0x0, (v_addr + offset));
196 prm_set_mod_reg_bits(OMAP3430_GLOBAL_COLD_RST, OMAP3430_GR_MOD,
197 OMAP3_PRM_RSTST_OFFSET);
198 }
199}
200
201/* Populate the scratchpad structure with restore structure */
202void omap3_save_scratchpad_contents(void)
203{
204 void * __iomem scratchpad_address;
205 u32 arm_context_addr;
206 struct omap3_scratchpad scratchpad_contents;
207 struct omap3_scratchpad_prcm_block prcm_block_contents;
208 struct omap3_scratchpad_sdrc_block sdrc_block_contents;
209
210 /* Populate the Scratchpad contents */
211 scratchpad_contents.boot_config_ptr = 0x0;
212 if (omap_rev() != OMAP3430_REV_ES3_0 &&
213 omap_rev() != OMAP3430_REV_ES3_1)
214 scratchpad_contents.public_restore_ptr =
215 virt_to_phys(get_restore_pointer());
216 else
217 scratchpad_contents.public_restore_ptr =
218 virt_to_phys(get_es3_restore_pointer());
219 if (omap_type() == OMAP2_DEVICE_TYPE_GP)
220 scratchpad_contents.secure_ram_restore_ptr = 0x0;
221 else
222 scratchpad_contents.secure_ram_restore_ptr =
223 (u32) __pa(omap3_secure_ram_storage);
224 scratchpad_contents.sdrc_module_semaphore = 0x0;
225 scratchpad_contents.prcm_block_offset = 0x2C;
226 scratchpad_contents.sdrc_block_offset = 0x64;
227
228 /* Populate the PRCM block contents */
229 prcm_block_contents.prm_clksrc_ctrl = prm_read_mod_reg(OMAP3430_GR_MOD,
230 OMAP3_PRM_CLKSRC_CTRL_OFFSET);
231 prcm_block_contents.prm_clksel = prm_read_mod_reg(OMAP3430_CCR_MOD,
232 OMAP3_PRM_CLKSEL_OFFSET);
233 prcm_block_contents.cm_clksel_core =
234 cm_read_mod_reg(CORE_MOD, CM_CLKSEL);
235 prcm_block_contents.cm_clksel_wkup =
236 cm_read_mod_reg(WKUP_MOD, CM_CLKSEL);
237 prcm_block_contents.cm_clken_pll =
238 cm_read_mod_reg(PLL_MOD, CM_CLKEN);
239 prcm_block_contents.cm_autoidle_pll =
240 cm_read_mod_reg(PLL_MOD, OMAP3430_CM_AUTOIDLE_PLL);
241 prcm_block_contents.cm_clksel1_pll =
242 cm_read_mod_reg(PLL_MOD, OMAP3430_CM_CLKSEL1_PLL);
243 prcm_block_contents.cm_clksel2_pll =
244 cm_read_mod_reg(PLL_MOD, OMAP3430_CM_CLKSEL2_PLL);
245 prcm_block_contents.cm_clksel3_pll =
246 cm_read_mod_reg(PLL_MOD, OMAP3430_CM_CLKSEL3);
247 prcm_block_contents.cm_clken_pll_mpu =
248 cm_read_mod_reg(MPU_MOD, OMAP3430_CM_CLKEN_PLL);
249 prcm_block_contents.cm_autoidle_pll_mpu =
250 cm_read_mod_reg(MPU_MOD, OMAP3430_CM_AUTOIDLE_PLL);
251 prcm_block_contents.cm_clksel1_pll_mpu =
252 cm_read_mod_reg(MPU_MOD, OMAP3430_CM_CLKSEL1_PLL);
253 prcm_block_contents.cm_clksel2_pll_mpu =
254 cm_read_mod_reg(MPU_MOD, OMAP3430_CM_CLKSEL2_PLL);
255 prcm_block_contents.prcm_block_size = 0x0;
256
257 /* Populate the SDRC block contents */
258 sdrc_block_contents.sysconfig =
259 (sdrc_read_reg(SDRC_SYSCONFIG) & 0xFFFF);
260 sdrc_block_contents.cs_cfg =
261 (sdrc_read_reg(SDRC_CS_CFG) & 0xFFFF);
262 sdrc_block_contents.sharing =
263 (sdrc_read_reg(SDRC_SHARING) & 0xFFFF);
264 sdrc_block_contents.err_type =
265 (sdrc_read_reg(SDRC_ERR_TYPE) & 0xFFFF);
266 sdrc_block_contents.dll_a_ctrl = sdrc_read_reg(SDRC_DLLA_CTRL);
267 sdrc_block_contents.dll_b_ctrl = 0x0;
268 /*
269 * Due to a OMAP3 errata (1.142), on EMU/HS devices SRDC should
270 * be programed to issue automatic self refresh on timeout
271 * of AUTO_CNT = 1 prior to any transition to OFF mode.
272 */
273 if ((omap_type() != OMAP2_DEVICE_TYPE_GP)
274 && (omap_rev() >= OMAP3430_REV_ES3_0))
275 sdrc_block_contents.power = (sdrc_read_reg(SDRC_POWER) &
276 ~(SDRC_POWER_AUTOCOUNT_MASK|
277 SDRC_POWER_CLKCTRL_MASK)) |
278 (1 << SDRC_POWER_AUTOCOUNT_SHIFT) |
279 SDRC_SELF_REFRESH_ON_AUTOCOUNT;
280 else
281 sdrc_block_contents.power = sdrc_read_reg(SDRC_POWER);
282
283 sdrc_block_contents.cs_0 = 0x0;
284 sdrc_block_contents.mcfg_0 = sdrc_read_reg(SDRC_MCFG_0);
285 sdrc_block_contents.mr_0 = (sdrc_read_reg(SDRC_MR_0) & 0xFFFF);
286 sdrc_block_contents.emr_1_0 = 0x0;
287 sdrc_block_contents.emr_2_0 = 0x0;
288 sdrc_block_contents.emr_3_0 = 0x0;
289 sdrc_block_contents.actim_ctrla_0 =
290 sdrc_read_reg(SDRC_ACTIM_CTRL_A_0);
291 sdrc_block_contents.actim_ctrlb_0 =
292 sdrc_read_reg(SDRC_ACTIM_CTRL_B_0);
293 sdrc_block_contents.rfr_ctrl_0 =
294 sdrc_read_reg(SDRC_RFR_CTRL_0);
295 sdrc_block_contents.cs_1 = 0x0;
296 sdrc_block_contents.mcfg_1 = sdrc_read_reg(SDRC_MCFG_1);
297 sdrc_block_contents.mr_1 = sdrc_read_reg(SDRC_MR_1) & 0xFFFF;
298 sdrc_block_contents.emr_1_1 = 0x0;
299 sdrc_block_contents.emr_2_1 = 0x0;
300 sdrc_block_contents.emr_3_1 = 0x0;
301 sdrc_block_contents.actim_ctrla_1 =
302 sdrc_read_reg(SDRC_ACTIM_CTRL_A_1);
303 sdrc_block_contents.actim_ctrlb_1 =
304 sdrc_read_reg(SDRC_ACTIM_CTRL_B_1);
305 sdrc_block_contents.rfr_ctrl_1 =
306 sdrc_read_reg(SDRC_RFR_CTRL_1);
307 sdrc_block_contents.dcdl_1_ctrl = 0x0;
308 sdrc_block_contents.dcdl_2_ctrl = 0x0;
309 sdrc_block_contents.flags = 0x0;
310 sdrc_block_contents.block_size = 0x0;
311
312 arm_context_addr = virt_to_phys(omap3_arm_context);
313
314 /* Copy all the contents to the scratchpad location */
315 scratchpad_address = OMAP2_L4_IO_ADDRESS(OMAP343X_SCRATCHPAD);
316 memcpy_toio(scratchpad_address, &scratchpad_contents,
317 sizeof(scratchpad_contents));
318 /* Scratchpad contents being 32 bits, a divide by 4 done here */
319 memcpy_toio(scratchpad_address +
320 scratchpad_contents.prcm_block_offset,
321 &prcm_block_contents, sizeof(prcm_block_contents));
322 memcpy_toio(scratchpad_address +
323 scratchpad_contents.sdrc_block_offset,
324 &sdrc_block_contents, sizeof(sdrc_block_contents));
325 /*
326 * Copies the address of the location in SDRAM where ARM
327 * registers get saved during a MPU OFF transition.
328 */
329 memcpy_toio(scratchpad_address +
330 scratchpad_contents.sdrc_block_offset +
331 sizeof(sdrc_block_contents), &arm_context_addr, 4);
332}
333
334void omap3_control_save_context(void)
335{
336 control_context.sysconfig = omap_ctrl_readl(OMAP2_CONTROL_SYSCONFIG);
337 control_context.devconf0 = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0);
338 control_context.mem_dftrw0 =
339 omap_ctrl_readl(OMAP343X_CONTROL_MEM_DFTRW0);
340 control_context.mem_dftrw1 =
341 omap_ctrl_readl(OMAP343X_CONTROL_MEM_DFTRW1);
342 control_context.msuspendmux_0 =
343 omap_ctrl_readl(OMAP2_CONTROL_MSUSPENDMUX_0);
344 control_context.msuspendmux_1 =
345 omap_ctrl_readl(OMAP2_CONTROL_MSUSPENDMUX_1);
346 control_context.msuspendmux_2 =
347 omap_ctrl_readl(OMAP2_CONTROL_MSUSPENDMUX_2);
348 control_context.msuspendmux_3 =
349 omap_ctrl_readl(OMAP2_CONTROL_MSUSPENDMUX_3);
350 control_context.msuspendmux_4 =
351 omap_ctrl_readl(OMAP2_CONTROL_MSUSPENDMUX_4);
352 control_context.msuspendmux_5 =
353 omap_ctrl_readl(OMAP2_CONTROL_MSUSPENDMUX_5);
354 control_context.sec_ctrl = omap_ctrl_readl(OMAP2_CONTROL_SEC_CTRL);
355 control_context.devconf1 = omap_ctrl_readl(OMAP343X_CONTROL_DEVCONF1);
356 control_context.csirxfe = omap_ctrl_readl(OMAP343X_CONTROL_CSIRXFE);
357 control_context.iva2_bootaddr =
358 omap_ctrl_readl(OMAP343X_CONTROL_IVA2_BOOTADDR);
359 control_context.iva2_bootmod =
360 omap_ctrl_readl(OMAP343X_CONTROL_IVA2_BOOTMOD);
361 control_context.debobs_0 = omap_ctrl_readl(OMAP343X_CONTROL_DEBOBS(0));
362 control_context.debobs_1 = omap_ctrl_readl(OMAP343X_CONTROL_DEBOBS(1));
363 control_context.debobs_2 = omap_ctrl_readl(OMAP343X_CONTROL_DEBOBS(2));
364 control_context.debobs_3 = omap_ctrl_readl(OMAP343X_CONTROL_DEBOBS(3));
365 control_context.debobs_4 = omap_ctrl_readl(OMAP343X_CONTROL_DEBOBS(4));
366 control_context.debobs_5 = omap_ctrl_readl(OMAP343X_CONTROL_DEBOBS(5));
367 control_context.debobs_6 = omap_ctrl_readl(OMAP343X_CONTROL_DEBOBS(6));
368 control_context.debobs_7 = omap_ctrl_readl(OMAP343X_CONTROL_DEBOBS(7));
369 control_context.debobs_8 = omap_ctrl_readl(OMAP343X_CONTROL_DEBOBS(8));
370 control_context.prog_io0 = omap_ctrl_readl(OMAP343X_CONTROL_PROG_IO0);
371 control_context.prog_io1 = omap_ctrl_readl(OMAP343X_CONTROL_PROG_IO1);
372 control_context.dss_dpll_spreading =
373 omap_ctrl_readl(OMAP343X_CONTROL_DSS_DPLL_SPREADING);
374 control_context.core_dpll_spreading =
375 omap_ctrl_readl(OMAP343X_CONTROL_CORE_DPLL_SPREADING);
376 control_context.per_dpll_spreading =
377 omap_ctrl_readl(OMAP343X_CONTROL_PER_DPLL_SPREADING);
378 control_context.usbhost_dpll_spreading =
379 omap_ctrl_readl(OMAP343X_CONTROL_USBHOST_DPLL_SPREADING);
380 control_context.pbias_lite =
381 omap_ctrl_readl(OMAP343X_CONTROL_PBIAS_LITE);
382 control_context.temp_sensor =
383 omap_ctrl_readl(OMAP343X_CONTROL_TEMP_SENSOR);
384 control_context.sramldo4 = omap_ctrl_readl(OMAP343X_CONTROL_SRAMLDO4);
385 control_context.sramldo5 = omap_ctrl_readl(OMAP343X_CONTROL_SRAMLDO5);
386 control_context.csi = omap_ctrl_readl(OMAP343X_CONTROL_CSI);
387 return;
388}
389
390void omap3_control_restore_context(void)
391{
392 omap_ctrl_writel(control_context.sysconfig, OMAP2_CONTROL_SYSCONFIG);
393 omap_ctrl_writel(control_context.devconf0, OMAP2_CONTROL_DEVCONF0);
394 omap_ctrl_writel(control_context.mem_dftrw0,
395 OMAP343X_CONTROL_MEM_DFTRW0);
396 omap_ctrl_writel(control_context.mem_dftrw1,
397 OMAP343X_CONTROL_MEM_DFTRW1);
398 omap_ctrl_writel(control_context.msuspendmux_0,
399 OMAP2_CONTROL_MSUSPENDMUX_0);
400 omap_ctrl_writel(control_context.msuspendmux_1,
401 OMAP2_CONTROL_MSUSPENDMUX_1);
402 omap_ctrl_writel(control_context.msuspendmux_2,
403 OMAP2_CONTROL_MSUSPENDMUX_2);
404 omap_ctrl_writel(control_context.msuspendmux_3,
405 OMAP2_CONTROL_MSUSPENDMUX_3);
406 omap_ctrl_writel(control_context.msuspendmux_4,
407 OMAP2_CONTROL_MSUSPENDMUX_4);
408 omap_ctrl_writel(control_context.msuspendmux_5,
409 OMAP2_CONTROL_MSUSPENDMUX_5);
410 omap_ctrl_writel(control_context.sec_ctrl, OMAP2_CONTROL_SEC_CTRL);
411 omap_ctrl_writel(control_context.devconf1, OMAP343X_CONTROL_DEVCONF1);
412 omap_ctrl_writel(control_context.csirxfe, OMAP343X_CONTROL_CSIRXFE);
413 omap_ctrl_writel(control_context.iva2_bootaddr,
414 OMAP343X_CONTROL_IVA2_BOOTADDR);
415 omap_ctrl_writel(control_context.iva2_bootmod,
416 OMAP343X_CONTROL_IVA2_BOOTMOD);
417 omap_ctrl_writel(control_context.debobs_0, OMAP343X_CONTROL_DEBOBS(0));
418 omap_ctrl_writel(control_context.debobs_1, OMAP343X_CONTROL_DEBOBS(1));
419 omap_ctrl_writel(control_context.debobs_2, OMAP343X_CONTROL_DEBOBS(2));
420 omap_ctrl_writel(control_context.debobs_3, OMAP343X_CONTROL_DEBOBS(3));
421 omap_ctrl_writel(control_context.debobs_4, OMAP343X_CONTROL_DEBOBS(4));
422 omap_ctrl_writel(control_context.debobs_5, OMAP343X_CONTROL_DEBOBS(5));
423 omap_ctrl_writel(control_context.debobs_6, OMAP343X_CONTROL_DEBOBS(6));
424 omap_ctrl_writel(control_context.debobs_7, OMAP343X_CONTROL_DEBOBS(7));
425 omap_ctrl_writel(control_context.debobs_8, OMAP343X_CONTROL_DEBOBS(8));
426 omap_ctrl_writel(control_context.prog_io0, OMAP343X_CONTROL_PROG_IO0);
427 omap_ctrl_writel(control_context.prog_io1, OMAP343X_CONTROL_PROG_IO1);
428 omap_ctrl_writel(control_context.dss_dpll_spreading,
429 OMAP343X_CONTROL_DSS_DPLL_SPREADING);
430 omap_ctrl_writel(control_context.core_dpll_spreading,
431 OMAP343X_CONTROL_CORE_DPLL_SPREADING);
432 omap_ctrl_writel(control_context.per_dpll_spreading,
433 OMAP343X_CONTROL_PER_DPLL_SPREADING);
434 omap_ctrl_writel(control_context.usbhost_dpll_spreading,
435 OMAP343X_CONTROL_USBHOST_DPLL_SPREADING);
436 omap_ctrl_writel(control_context.pbias_lite,
437 OMAP343X_CONTROL_PBIAS_LITE);
438 omap_ctrl_writel(control_context.temp_sensor,
439 OMAP343X_CONTROL_TEMP_SENSOR);
440 omap_ctrl_writel(control_context.sramldo4, OMAP343X_CONTROL_SRAMLDO4);
441 omap_ctrl_writel(control_context.sramldo5, OMAP343X_CONTROL_SRAMLDO5);
442 omap_ctrl_writel(control_context.csi, OMAP343X_CONTROL_CSI);
443 return;
444}
445#endif /* CONFIG_ARCH_OMAP3 && CONFIG_PM */
diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c
new file mode 100644
index 000000000000..a26d6a08ae3f
--- /dev/null
+++ b/arch/arm/mach-omap2/cpuidle34xx.c
@@ -0,0 +1,318 @@
1/*
2 * linux/arch/arm/mach-omap2/cpuidle34xx.c
3 *
4 * OMAP3 CPU IDLE Routines
5 *
6 * Copyright (C) 2008 Texas Instruments, Inc.
7 * Rajendra Nayak <rnayak@ti.com>
8 *
9 * Copyright (C) 2007 Texas Instruments, Inc.
10 * Karthik Dasu <karthik-dp@ti.com>
11 *
12 * Copyright (C) 2006 Nokia Corporation
13 * Tony Lindgren <tony@atomide.com>
14 *
15 * Copyright (C) 2005 Texas Instruments, Inc.
16 * Richard Woodruff <r-woodruff2@ti.com>
17 *
18 * Based on pm.c for omap2
19 *
20 * This program is free software; you can redistribute it and/or modify
21 * it under the terms of the GNU General Public License version 2 as
22 * published by the Free Software Foundation.
23 */
24
25#include <linux/sched.h>
26#include <linux/cpuidle.h>
27
28#include <plat/prcm.h>
29#include <plat/irqs.h>
30#include <plat/powerdomain.h>
31#include <plat/clockdomain.h>
32#include <plat/control.h>
33#include <plat/serial.h>
34
35#include "pm.h"
36
37#ifdef CONFIG_CPU_IDLE
38
39#define OMAP3_MAX_STATES 7
40#define OMAP3_STATE_C1 0 /* C1 - MPU WFI + Core active */
41#define OMAP3_STATE_C2 1 /* C2 - MPU WFI + Core inactive */
42#define OMAP3_STATE_C3 2 /* C3 - MPU CSWR + Core inactive */
43#define OMAP3_STATE_C4 3 /* C4 - MPU OFF + Core iactive */
44#define OMAP3_STATE_C5 4 /* C5 - MPU RET + Core RET */
45#define OMAP3_STATE_C6 5 /* C6 - MPU OFF + Core RET */
46#define OMAP3_STATE_C7 6 /* C7 - MPU OFF + Core OFF */
47
48struct omap3_processor_cx {
49 u8 valid;
50 u8 type;
51 u32 sleep_latency;
52 u32 wakeup_latency;
53 u32 mpu_state;
54 u32 core_state;
55 u32 threshold;
56 u32 flags;
57};
58
59struct omap3_processor_cx omap3_power_states[OMAP3_MAX_STATES];
60struct omap3_processor_cx current_cx_state;
61struct powerdomain *mpu_pd, *core_pd;
62
63static int omap3_idle_bm_check(void)
64{
65 if (!omap3_can_sleep())
66 return 1;
67 return 0;
68}
69
70static int _cpuidle_allow_idle(struct powerdomain *pwrdm,
71 struct clockdomain *clkdm)
72{
73 omap2_clkdm_allow_idle(clkdm);
74 return 0;
75}
76
77static int _cpuidle_deny_idle(struct powerdomain *pwrdm,
78 struct clockdomain *clkdm)
79{
80 omap2_clkdm_deny_idle(clkdm);
81 return 0;
82}
83
84/**
85 * omap3_enter_idle - Programs OMAP3 to enter the specified state
86 * @dev: cpuidle device
87 * @state: The target state to be programmed
88 *
89 * Called from the CPUidle framework to program the device to the
90 * specified target state selected by the governor.
91 */
92static int omap3_enter_idle(struct cpuidle_device *dev,
93 struct cpuidle_state *state)
94{
95 struct omap3_processor_cx *cx = cpuidle_get_statedata(state);
96 struct timespec ts_preidle, ts_postidle, ts_idle;
97 u32 mpu_state = cx->mpu_state, core_state = cx->core_state;
98
99 current_cx_state = *cx;
100
101 /* Used to keep track of the total time in idle */
102 getnstimeofday(&ts_preidle);
103
104 local_irq_disable();
105 local_fiq_disable();
106
107 if (!enable_off_mode) {
108 if (mpu_state < PWRDM_POWER_RET)
109 mpu_state = PWRDM_POWER_RET;
110 if (core_state < PWRDM_POWER_RET)
111 core_state = PWRDM_POWER_RET;
112 }
113
114 pwrdm_set_next_pwrst(mpu_pd, mpu_state);
115 pwrdm_set_next_pwrst(core_pd, core_state);
116
117 if (omap_irq_pending() || need_resched())
118 goto return_sleep_time;
119
120 if (cx->type == OMAP3_STATE_C1) {
121 pwrdm_for_each_clkdm(mpu_pd, _cpuidle_deny_idle);
122 pwrdm_for_each_clkdm(core_pd, _cpuidle_deny_idle);
123 }
124
125 /* Execute ARM wfi */
126 omap_sram_idle();
127
128 if (cx->type == OMAP3_STATE_C1) {
129 pwrdm_for_each_clkdm(mpu_pd, _cpuidle_allow_idle);
130 pwrdm_for_each_clkdm(core_pd, _cpuidle_allow_idle);
131 }
132
133return_sleep_time:
134 getnstimeofday(&ts_postidle);
135 ts_idle = timespec_sub(ts_postidle, ts_preidle);
136
137 local_irq_enable();
138 local_fiq_enable();
139
140 return (u32)timespec_to_ns(&ts_idle)/1000;
141}
142
143/**
144 * omap3_enter_idle_bm - Checks for any bus activity
145 * @dev: cpuidle device
146 * @state: The target state to be programmed
147 *
148 * Used for C states with CPUIDLE_FLAG_CHECK_BM flag set. This
149 * function checks for any pending activity and then programs the
150 * device to the specified or a safer state.
151 */
152static int omap3_enter_idle_bm(struct cpuidle_device *dev,
153 struct cpuidle_state *state)
154{
155 struct cpuidle_state *new_state = state;
156
157 if ((state->flags & CPUIDLE_FLAG_CHECK_BM) && omap3_idle_bm_check()) {
158 BUG_ON(!dev->safe_state);
159 new_state = dev->safe_state;
160 }
161
162 dev->last_state = new_state;
163 return omap3_enter_idle(dev, new_state);
164}
165
166DEFINE_PER_CPU(struct cpuidle_device, omap3_idle_dev);
167
168/* omap3_init_power_states - Initialises the OMAP3 specific C states.
169 *
170 * Below is the desciption of each C state.
171 * C1 . MPU WFI + Core active
172 * C2 . MPU WFI + Core inactive
173 * C3 . MPU CSWR + Core inactive
174 * C4 . MPU OFF + Core inactive
175 * C5 . MPU CSWR + Core CSWR
176 * C6 . MPU OFF + Core CSWR
177 * C7 . MPU OFF + Core OFF
178 */
179void omap_init_power_states(void)
180{
181 /* C1 . MPU WFI + Core active */
182 omap3_power_states[OMAP3_STATE_C1].valid = 1;
183 omap3_power_states[OMAP3_STATE_C1].type = OMAP3_STATE_C1;
184 omap3_power_states[OMAP3_STATE_C1].sleep_latency = 2;
185 omap3_power_states[OMAP3_STATE_C1].wakeup_latency = 2;
186 omap3_power_states[OMAP3_STATE_C1].threshold = 5;
187 omap3_power_states[OMAP3_STATE_C1].mpu_state = PWRDM_POWER_ON;
188 omap3_power_states[OMAP3_STATE_C1].core_state = PWRDM_POWER_ON;
189 omap3_power_states[OMAP3_STATE_C1].flags = CPUIDLE_FLAG_TIME_VALID;
190
191 /* C2 . MPU WFI + Core inactive */
192 omap3_power_states[OMAP3_STATE_C2].valid = 1;
193 omap3_power_states[OMAP3_STATE_C2].type = OMAP3_STATE_C2;
194 omap3_power_states[OMAP3_STATE_C2].sleep_latency = 10;
195 omap3_power_states[OMAP3_STATE_C2].wakeup_latency = 10;
196 omap3_power_states[OMAP3_STATE_C2].threshold = 30;
197 omap3_power_states[OMAP3_STATE_C2].mpu_state = PWRDM_POWER_ON;
198 omap3_power_states[OMAP3_STATE_C2].core_state = PWRDM_POWER_ON;
199 omap3_power_states[OMAP3_STATE_C2].flags = CPUIDLE_FLAG_TIME_VALID;
200
201 /* C3 . MPU CSWR + Core inactive */
202 omap3_power_states[OMAP3_STATE_C3].valid = 1;
203 omap3_power_states[OMAP3_STATE_C3].type = OMAP3_STATE_C3;
204 omap3_power_states[OMAP3_STATE_C3].sleep_latency = 50;
205 omap3_power_states[OMAP3_STATE_C3].wakeup_latency = 50;
206 omap3_power_states[OMAP3_STATE_C3].threshold = 300;
207 omap3_power_states[OMAP3_STATE_C3].mpu_state = PWRDM_POWER_RET;
208 omap3_power_states[OMAP3_STATE_C3].core_state = PWRDM_POWER_ON;
209 omap3_power_states[OMAP3_STATE_C3].flags = CPUIDLE_FLAG_TIME_VALID |
210 CPUIDLE_FLAG_CHECK_BM;
211
212 /* C4 . MPU OFF + Core inactive */
213 omap3_power_states[OMAP3_STATE_C4].valid = 1;
214 omap3_power_states[OMAP3_STATE_C4].type = OMAP3_STATE_C4;
215 omap3_power_states[OMAP3_STATE_C4].sleep_latency = 1500;
216 omap3_power_states[OMAP3_STATE_C4].wakeup_latency = 1800;
217 omap3_power_states[OMAP3_STATE_C4].threshold = 4000;
218 omap3_power_states[OMAP3_STATE_C4].mpu_state = PWRDM_POWER_OFF;
219 omap3_power_states[OMAP3_STATE_C4].core_state = PWRDM_POWER_ON;
220 omap3_power_states[OMAP3_STATE_C4].flags = CPUIDLE_FLAG_TIME_VALID |
221 CPUIDLE_FLAG_CHECK_BM;
222
223 /* C5 . MPU CSWR + Core CSWR*/
224 omap3_power_states[OMAP3_STATE_C5].valid = 1;
225 omap3_power_states[OMAP3_STATE_C5].type = OMAP3_STATE_C5;
226 omap3_power_states[OMAP3_STATE_C5].sleep_latency = 2500;
227 omap3_power_states[OMAP3_STATE_C5].wakeup_latency = 7500;
228 omap3_power_states[OMAP3_STATE_C5].threshold = 12000;
229 omap3_power_states[OMAP3_STATE_C5].mpu_state = PWRDM_POWER_RET;
230 omap3_power_states[OMAP3_STATE_C5].core_state = PWRDM_POWER_RET;
231 omap3_power_states[OMAP3_STATE_C5].flags = CPUIDLE_FLAG_TIME_VALID |
232 CPUIDLE_FLAG_CHECK_BM;
233
234 /* C6 . MPU OFF + Core CSWR */
235 omap3_power_states[OMAP3_STATE_C6].valid = 1;
236 omap3_power_states[OMAP3_STATE_C6].type = OMAP3_STATE_C6;
237 omap3_power_states[OMAP3_STATE_C6].sleep_latency = 3000;
238 omap3_power_states[OMAP3_STATE_C6].wakeup_latency = 8500;
239 omap3_power_states[OMAP3_STATE_C6].threshold = 15000;
240 omap3_power_states[OMAP3_STATE_C6].mpu_state = PWRDM_POWER_OFF;
241 omap3_power_states[OMAP3_STATE_C6].core_state = PWRDM_POWER_RET;
242 omap3_power_states[OMAP3_STATE_C6].flags = CPUIDLE_FLAG_TIME_VALID |
243 CPUIDLE_FLAG_CHECK_BM;
244
245 /* C7 . MPU OFF + Core OFF */
246 omap3_power_states[OMAP3_STATE_C7].valid = 1;
247 omap3_power_states[OMAP3_STATE_C7].type = OMAP3_STATE_C7;
248 omap3_power_states[OMAP3_STATE_C7].sleep_latency = 10000;
249 omap3_power_states[OMAP3_STATE_C7].wakeup_latency = 30000;
250 omap3_power_states[OMAP3_STATE_C7].threshold = 300000;
251 omap3_power_states[OMAP3_STATE_C7].mpu_state = PWRDM_POWER_OFF;
252 omap3_power_states[OMAP3_STATE_C7].core_state = PWRDM_POWER_OFF;
253 omap3_power_states[OMAP3_STATE_C7].flags = CPUIDLE_FLAG_TIME_VALID |
254 CPUIDLE_FLAG_CHECK_BM;
255}
256
257struct cpuidle_driver omap3_idle_driver = {
258 .name = "omap3_idle",
259 .owner = THIS_MODULE,
260};
261
262/**
263 * omap3_idle_init - Init routine for OMAP3 idle
264 *
265 * Registers the OMAP3 specific cpuidle driver with the cpuidle
266 * framework with the valid set of states.
267 */
268int __init omap3_idle_init(void)
269{
270 int i, count = 0;
271 struct omap3_processor_cx *cx;
272 struct cpuidle_state *state;
273 struct cpuidle_device *dev;
274
275 mpu_pd = pwrdm_lookup("mpu_pwrdm");
276 core_pd = pwrdm_lookup("core_pwrdm");
277
278 omap_init_power_states();
279 cpuidle_register_driver(&omap3_idle_driver);
280
281 dev = &per_cpu(omap3_idle_dev, smp_processor_id());
282
283 for (i = OMAP3_STATE_C1; i < OMAP3_MAX_STATES; i++) {
284 cx = &omap3_power_states[i];
285 state = &dev->states[count];
286
287 if (!cx->valid)
288 continue;
289 cpuidle_set_statedata(state, cx);
290 state->exit_latency = cx->sleep_latency + cx->wakeup_latency;
291 state->target_residency = cx->threshold;
292 state->flags = cx->flags;
293 state->enter = (state->flags & CPUIDLE_FLAG_CHECK_BM) ?
294 omap3_enter_idle_bm : omap3_enter_idle;
295 if (cx->type == OMAP3_STATE_C1)
296 dev->safe_state = state;
297 sprintf(state->name, "C%d", count+1);
298 count++;
299 }
300
301 if (!count)
302 return -EINVAL;
303 dev->state_count = count;
304
305 if (cpuidle_register_device(dev)) {
306 printk(KERN_ERR "%s: CPUidle register device failed\n",
307 __func__);
308 return -EIO;
309 }
310
311 return 0;
312}
313#else
314int __init omap3_idle_init(void)
315{
316 return 0;
317}
318#endif /* CONFIG_CPU_IDLE */
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index faf7a1e0c525..733d3dcff98b 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -20,12 +20,12 @@
20#include <asm/mach-types.h> 20#include <asm/mach-types.h>
21#include <asm/mach/map.h> 21#include <asm/mach/map.h>
22 22
23#include <mach/control.h> 23#include <plat/control.h>
24#include <mach/tc.h> 24#include <plat/tc.h>
25#include <mach/board.h> 25#include <plat/board.h>
26#include <mach/mux.h> 26#include <plat/mux.h>
27#include <mach/gpio.h> 27#include <mach/gpio.h>
28#include <mach/mmc.h> 28#include <plat/mmc.h>
29 29
30#if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE) 30#if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE)
31 31
@@ -136,9 +136,10 @@ static inline void omap_init_camera(void)
136 136
137#if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE) 137#if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE)
138 138
139#define MBOX_REG_SIZE 0x120 139#define MBOX_REG_SIZE 0x120
140 140
141static struct resource omap2_mbox_resources[] = { 141#ifdef CONFIG_ARCH_OMAP2
142static struct resource omap_mbox_resources[] = {
142 { 143 {
143 .start = OMAP24XX_MAILBOX_BASE, 144 .start = OMAP24XX_MAILBOX_BASE,
144 .end = OMAP24XX_MAILBOX_BASE + MBOX_REG_SIZE - 1, 145 .end = OMAP24XX_MAILBOX_BASE + MBOX_REG_SIZE - 1,
@@ -153,8 +154,10 @@ static struct resource omap2_mbox_resources[] = {
153 .flags = IORESOURCE_IRQ, 154 .flags = IORESOURCE_IRQ,
154 }, 155 },
155}; 156};
157#endif
156 158
157static struct resource omap3_mbox_resources[] = { 159#ifdef CONFIG_ARCH_OMAP3
160static struct resource omap_mbox_resources[] = {
158 { 161 {
159 .start = OMAP34XX_MAILBOX_BASE, 162 .start = OMAP34XX_MAILBOX_BASE,
160 .end = OMAP34XX_MAILBOX_BASE + MBOX_REG_SIZE - 1, 163 .end = OMAP34XX_MAILBOX_BASE + MBOX_REG_SIZE - 1,
@@ -165,6 +168,24 @@ static struct resource omap3_mbox_resources[] = {
165 .flags = IORESOURCE_IRQ, 168 .flags = IORESOURCE_IRQ,
166 }, 169 },
167}; 170};
171#endif
172
173#ifdef CONFIG_ARCH_OMAP4
174
175#define OMAP4_MBOX_REG_SIZE 0x130
176static struct resource omap_mbox_resources[] = {
177 {
178 .start = OMAP44XX_MAILBOX_BASE,
179 .end = OMAP44XX_MAILBOX_BASE +
180 OMAP4_MBOX_REG_SIZE - 1,
181 .flags = IORESOURCE_MEM,
182 },
183 {
184 .start = INT_44XX_MAIL_U0_MPU,
185 .flags = IORESOURCE_IRQ,
186 },
187};
188#endif
168 189
169static struct platform_device mbox_device = { 190static struct platform_device mbox_device = {
170 .name = "omap2-mailbox", 191 .name = "omap2-mailbox",
@@ -173,12 +194,9 @@ static struct platform_device mbox_device = {
173 194
174static inline void omap_init_mbox(void) 195static inline void omap_init_mbox(void)
175{ 196{
176 if (cpu_is_omap2420()) { 197 if (cpu_is_omap2420() || cpu_is_omap3430() || cpu_is_omap44xx()) {
177 mbox_device.num_resources = ARRAY_SIZE(omap2_mbox_resources); 198 mbox_device.num_resources = ARRAY_SIZE(omap_mbox_resources);
178 mbox_device.resource = omap2_mbox_resources; 199 mbox_device.resource = omap_mbox_resources;
179 } else if (cpu_is_omap3430()) {
180 mbox_device.num_resources = ARRAY_SIZE(omap3_mbox_resources);
181 mbox_device.resource = omap3_mbox_resources;
182 } else { 200 } else {
183 pr_err("%s: platform not supported\n", __func__); 201 pr_err("%s: platform not supported\n", __func__);
184 return; 202 return;
@@ -250,7 +268,7 @@ static inline void omap_init_sti(void) {}
250 268
251#if defined(CONFIG_SPI_OMAP24XX) || defined(CONFIG_SPI_OMAP24XX_MODULE) 269#if defined(CONFIG_SPI_OMAP24XX) || defined(CONFIG_SPI_OMAP24XX_MODULE)
252 270
253#include <mach/mcspi.h> 271#include <plat/mcspi.h>
254 272
255#define OMAP2_MCSPI1_BASE 0x48098000 273#define OMAP2_MCSPI1_BASE 0x48098000
256#define OMAP2_MCSPI2_BASE 0x4809a000 274#define OMAP2_MCSPI2_BASE 0x4809a000
@@ -575,7 +593,7 @@ static inline void omap2_mmc_mux(struct omap_mmc_platform_data *mmc_controller,
575 } 593 }
576 } 594 }
577 595
578 if (cpu_is_omap3430()) { 596 if (cpu_is_omap34xx()) {
579 if (controller_nr == 0) { 597 if (controller_nr == 0) {
580 omap_cfg_reg(N28_3430_MMC1_CLK); 598 omap_cfg_reg(N28_3430_MMC1_CLK);
581 omap_cfg_reg(M27_3430_MMC1_CMD); 599 omap_cfg_reg(M27_3430_MMC1_CMD);
@@ -609,6 +627,12 @@ static inline void omap2_mmc_mux(struct omap_mmc_platform_data *mmc_controller,
609 omap_cfg_reg(AG4_3430_MMC2_DAT2); 627 omap_cfg_reg(AG4_3430_MMC2_DAT2);
610 omap_cfg_reg(AF4_3430_MMC2_DAT3); 628 omap_cfg_reg(AF4_3430_MMC2_DAT3);
611 } 629 }
630 if (mmc_controller->slots[0].wires == 8) {
631 omap_cfg_reg(AE4_3430_MMC2_DAT4);
632 omap_cfg_reg(AH3_3430_MMC2_DAT5);
633 omap_cfg_reg(AF3_3430_MMC2_DAT6);
634 omap_cfg_reg(AE3_3430_MMC2_DAT7);
635 }
612 } 636 }
613 637
614 /* 638 /*
diff --git a/arch/arm/mach-omap2/emu.c b/arch/arm/mach-omap2/emu.c
new file mode 100644
index 000000000000..ec0d984a26fc
--- /dev/null
+++ b/arch/arm/mach-omap2/emu.c
@@ -0,0 +1,66 @@
1/*
2 * emu.c
3 *
4 * ETM and ETB CoreSight components' resources as found in OMAP3xxx.
5 *
6 * Copyright (C) 2009 Nokia Corporation.
7 * Alexander Shishkin
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 version 2 as
11 * published by the Free Software Foundation.
12 */
13
14#include <linux/kernel.h>
15#include <linux/init.h>
16#include <linux/types.h>
17#include <linux/module.h>
18#include <linux/device.h>
19#include <linux/amba/bus.h>
20#include <linux/io.h>
21#include <linux/clk.h>
22#include <linux/err.h>
23
24MODULE_LICENSE("GPL");
25MODULE_AUTHOR("Alexander Shishkin");
26
27/* Cortex CoreSight components within omap3xxx EMU */
28#define ETM_BASE (L4_EMU_34XX_PHYS + 0x10000)
29#define DBG_BASE (L4_EMU_34XX_PHYS + 0x11000)
30#define ETB_BASE (L4_EMU_34XX_PHYS + 0x1b000)
31#define DAPCTL (L4_EMU_34XX_PHYS + 0x1d000)
32
33static struct amba_device omap3_etb_device = {
34 .dev = {
35 .init_name = "etb",
36 },
37 .res = {
38 .start = ETB_BASE,
39 .end = ETB_BASE + SZ_4K - 1,
40 .flags = IORESOURCE_MEM,
41 },
42 .periphid = 0x000bb907,
43};
44
45static struct amba_device omap3_etm_device = {
46 .dev = {
47 .init_name = "etm",
48 },
49 .res = {
50 .start = ETM_BASE,
51 .end = ETM_BASE + SZ_4K - 1,
52 .flags = IORESOURCE_MEM,
53 },
54 .periphid = 0x102bb921,
55};
56
57static int __init emu_init(void)
58{
59 amba_device_register(&omap3_etb_device, &iomem_resource);
60 amba_device_register(&omap3_etm_device, &iomem_resource);
61
62 return 0;
63}
64
65subsys_initcall(emu_init);
66
diff --git a/arch/arm/mach-omap2/gpmc-onenand.c b/arch/arm/mach-omap2/gpmc-onenand.c
index 54fec53a48e7..7bb69220adfa 100644
--- a/arch/arm/mach-omap2/gpmc-onenand.c
+++ b/arch/arm/mach-omap2/gpmc-onenand.c
@@ -17,9 +17,9 @@
17 17
18#include <asm/mach/flash.h> 18#include <asm/mach/flash.h>
19 19
20#include <mach/onenand.h> 20#include <plat/onenand.h>
21#include <mach/board.h> 21#include <plat/board.h>
22#include <mach/gpmc.h> 22#include <plat/gpmc.h>
23 23
24static struct omap_onenand_platform_data *gpmc_onenand_data; 24static struct omap_onenand_platform_data *gpmc_onenand_data;
25 25
diff --git a/arch/arm/mach-omap2/gpmc-smc91x.c b/arch/arm/mach-omap2/gpmc-smc91x.c
index df99d31d8b64..6083e21b3be6 100644
--- a/arch/arm/mach-omap2/gpmc-smc91x.c
+++ b/arch/arm/mach-omap2/gpmc-smc91x.c
@@ -17,9 +17,9 @@
17#include <linux/io.h> 17#include <linux/io.h>
18#include <linux/smc91x.h> 18#include <linux/smc91x.h>
19 19
20#include <mach/board.h> 20#include <plat/board.h>
21#include <mach/gpmc.h> 21#include <plat/gpmc.h>
22#include <mach/gpmc-smc91x.h> 22#include <plat/gpmc-smc91x.h>
23 23
24static struct omap_smc91x_platform_data *gpmc_cfg; 24static struct omap_smc91x_platform_data *gpmc_cfg;
25 25
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index f3c992e29651..e86f5ca180ea 100644
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -24,9 +24,9 @@
24#include <linux/module.h> 24#include <linux/module.h>
25 25
26#include <asm/mach-types.h> 26#include <asm/mach-types.h>
27#include <mach/gpmc.h> 27#include <plat/gpmc.h>
28 28
29#include <mach/sdrc.h> 29#include <plat/sdrc.h>
30 30
31/* GPMC register offsets */ 31/* GPMC register offsets */
32#define GPMC_REVISION 0x00 32#define GPMC_REVISION 0x00
@@ -62,6 +62,33 @@
62#define ENABLE_PREFETCH (0x1 << 7) 62#define ENABLE_PREFETCH (0x1 << 7)
63#define DMA_MPU_MODE 2 63#define DMA_MPU_MODE 2
64 64
65/* Structure to save gpmc cs context */
66struct gpmc_cs_config {
67 u32 config1;
68 u32 config2;
69 u32 config3;
70 u32 config4;
71 u32 config5;
72 u32 config6;
73 u32 config7;
74 int is_valid;
75};
76
77/*
78 * Structure to save/restore gpmc context
79 * to support core off on OMAP3
80 */
81struct omap3_gpmc_regs {
82 u32 sysconfig;
83 u32 irqenable;
84 u32 timeout_ctrl;
85 u32 config;
86 u32 prefetch_config1;
87 u32 prefetch_config2;
88 u32 prefetch_control;
89 struct gpmc_cs_config cs_context[GPMC_CS_NUM];
90};
91
65static struct resource gpmc_mem_root; 92static struct resource gpmc_mem_root;
66static struct resource gpmc_cs_mem[GPMC_CS_NUM]; 93static struct resource gpmc_cs_mem[GPMC_CS_NUM];
67static DEFINE_SPINLOCK(gpmc_mem_lock); 94static DEFINE_SPINLOCK(gpmc_mem_lock);
@@ -261,7 +288,7 @@ static void gpmc_cs_enable_mem(int cs, u32 base, u32 size)
261 l = (base >> GPMC_CHUNK_SHIFT) & 0x3f; 288 l = (base >> GPMC_CHUNK_SHIFT) & 0x3f;
262 l &= ~(0x0f << 8); 289 l &= ~(0x0f << 8);
263 l |= ((mask >> GPMC_CHUNK_SHIFT) & 0x0f) << 8; 290 l |= ((mask >> GPMC_CHUNK_SHIFT) & 0x0f) << 8;
264 l |= 1 << 6; /* CSVALID */ 291 l |= GPMC_CONFIG7_CSVALID;
265 gpmc_cs_write_reg(cs, GPMC_CS_CONFIG7, l); 292 gpmc_cs_write_reg(cs, GPMC_CS_CONFIG7, l);
266} 293}
267 294
@@ -270,7 +297,7 @@ static void gpmc_cs_disable_mem(int cs)
270 u32 l; 297 u32 l;
271 298
272 l = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG7); 299 l = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG7);
273 l &= ~(1 << 6); /* CSVALID */ 300 l &= ~GPMC_CONFIG7_CSVALID;
274 gpmc_cs_write_reg(cs, GPMC_CS_CONFIG7, l); 301 gpmc_cs_write_reg(cs, GPMC_CS_CONFIG7, l);
275} 302}
276 303
@@ -290,7 +317,7 @@ static int gpmc_cs_mem_enabled(int cs)
290 u32 l; 317 u32 l;
291 318
292 l = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG7); 319 l = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG7);
293 return l & (1 << 6); 320 return l & GPMC_CONFIG7_CSVALID;
294} 321}
295 322
296int gpmc_cs_set_reserved(int cs, int reserved) 323int gpmc_cs_set_reserved(int cs, int reserved)
@@ -516,3 +543,68 @@ void __init gpmc_init(void)
516 gpmc_write_reg(GPMC_SYSCONFIG, l); 543 gpmc_write_reg(GPMC_SYSCONFIG, l);
517 gpmc_mem_init(); 544 gpmc_mem_init();
518} 545}
546
547#ifdef CONFIG_ARCH_OMAP3
548static struct omap3_gpmc_regs gpmc_context;
549
550void omap3_gpmc_save_context()
551{
552 int i;
553 gpmc_context.sysconfig = gpmc_read_reg(GPMC_SYSCONFIG);
554 gpmc_context.irqenable = gpmc_read_reg(GPMC_IRQENABLE);
555 gpmc_context.timeout_ctrl = gpmc_read_reg(GPMC_TIMEOUT_CONTROL);
556 gpmc_context.config = gpmc_read_reg(GPMC_CONFIG);
557 gpmc_context.prefetch_config1 = gpmc_read_reg(GPMC_PREFETCH_CONFIG1);
558 gpmc_context.prefetch_config2 = gpmc_read_reg(GPMC_PREFETCH_CONFIG2);
559 gpmc_context.prefetch_control = gpmc_read_reg(GPMC_PREFETCH_CONTROL);
560 for (i = 0; i < GPMC_CS_NUM; i++) {
561 gpmc_context.cs_context[i].is_valid = gpmc_cs_mem_enabled(i);
562 if (gpmc_context.cs_context[i].is_valid) {
563 gpmc_context.cs_context[i].config1 =
564 gpmc_cs_read_reg(i, GPMC_CS_CONFIG1);
565 gpmc_context.cs_context[i].config2 =
566 gpmc_cs_read_reg(i, GPMC_CS_CONFIG2);
567 gpmc_context.cs_context[i].config3 =
568 gpmc_cs_read_reg(i, GPMC_CS_CONFIG3);
569 gpmc_context.cs_context[i].config4 =
570 gpmc_cs_read_reg(i, GPMC_CS_CONFIG4);
571 gpmc_context.cs_context[i].config5 =
572 gpmc_cs_read_reg(i, GPMC_CS_CONFIG5);
573 gpmc_context.cs_context[i].config6 =
574 gpmc_cs_read_reg(i, GPMC_CS_CONFIG6);
575 gpmc_context.cs_context[i].config7 =
576 gpmc_cs_read_reg(i, GPMC_CS_CONFIG7);
577 }
578 }
579}
580
581void omap3_gpmc_restore_context()
582{
583 int i;
584 gpmc_write_reg(GPMC_SYSCONFIG, gpmc_context.sysconfig);
585 gpmc_write_reg(GPMC_IRQENABLE, gpmc_context.irqenable);
586 gpmc_write_reg(GPMC_TIMEOUT_CONTROL, gpmc_context.timeout_ctrl);
587 gpmc_write_reg(GPMC_CONFIG, gpmc_context.config);
588 gpmc_write_reg(GPMC_PREFETCH_CONFIG1, gpmc_context.prefetch_config1);
589 gpmc_write_reg(GPMC_PREFETCH_CONFIG2, gpmc_context.prefetch_config2);
590 gpmc_write_reg(GPMC_PREFETCH_CONTROL, gpmc_context.prefetch_control);
591 for (i = 0; i < GPMC_CS_NUM; i++) {
592 if (gpmc_context.cs_context[i].is_valid) {
593 gpmc_cs_write_reg(i, GPMC_CS_CONFIG1,
594 gpmc_context.cs_context[i].config1);
595 gpmc_cs_write_reg(i, GPMC_CS_CONFIG2,
596 gpmc_context.cs_context[i].config2);
597 gpmc_cs_write_reg(i, GPMC_CS_CONFIG3,
598 gpmc_context.cs_context[i].config3);
599 gpmc_cs_write_reg(i, GPMC_CS_CONFIG4,
600 gpmc_context.cs_context[i].config4);
601 gpmc_cs_write_reg(i, GPMC_CS_CONFIG5,
602 gpmc_context.cs_context[i].config5);
603 gpmc_cs_write_reg(i, GPMC_CS_CONFIG6,
604 gpmc_context.cs_context[i].config6);
605 gpmc_cs_write_reg(i, GPMC_CS_CONFIG7,
606 gpmc_context.cs_context[i].config7);
607 }
608 }
609}
610#endif /* CONFIG_ARCH_OMAP3 */
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index a98201cc265c..f48a4b2654dd 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -21,13 +21,14 @@
21 21
22#include <asm/cputype.h> 22#include <asm/cputype.h>
23 23
24#include <mach/common.h> 24#include <plat/common.h>
25#include <mach/control.h> 25#include <plat/control.h>
26#include <mach/cpu.h> 26#include <plat/cpu.h>
27 27
28static struct omap_chip_id omap_chip; 28static struct omap_chip_id omap_chip;
29static unsigned int omap_revision; 29static unsigned int omap_revision;
30 30
31u32 omap3_features;
31 32
32unsigned int omap_rev(void) 33unsigned int omap_rev(void)
33{ 34{
@@ -52,11 +53,11 @@ int omap_type(void)
52{ 53{
53 u32 val = 0; 54 u32 val = 0;
54 55
55 if (cpu_is_omap24xx()) 56 if (cpu_is_omap24xx()) {
56 val = omap_ctrl_readl(OMAP24XX_CONTROL_STATUS); 57 val = omap_ctrl_readl(OMAP24XX_CONTROL_STATUS);
57 else if (cpu_is_omap34xx()) 58 } else if (cpu_is_omap34xx()) {
58 val = omap_ctrl_readl(OMAP343X_CONTROL_STATUS); 59 val = omap_ctrl_readl(OMAP343X_CONTROL_STATUS);
59 else { 60 } else {
60 pr_err("Cannot detect omap type!\n"); 61 pr_err("Cannot detect omap type!\n");
61 goto out; 62 goto out;
62 } 63 }
@@ -155,12 +156,37 @@ void __init omap24xx_check_revision(void)
155 pr_info("\n"); 156 pr_info("\n");
156} 157}
157 158
158void __init omap34xx_check_revision(void) 159#define OMAP3_CHECK_FEATURE(status,feat) \
160 if (((status & OMAP3_ ##feat## _MASK) \
161 >> OMAP3_ ##feat## _SHIFT) != FEAT_ ##feat## _NONE) { \
162 omap3_features |= OMAP3_HAS_ ##feat; \
163 }
164
165void __init omap3_check_features(void)
166{
167 u32 status;
168
169 omap3_features = 0;
170
171 status = omap_ctrl_readl(OMAP3_CONTROL_OMAP_STATUS);
172
173 OMAP3_CHECK_FEATURE(status, L2CACHE);
174 OMAP3_CHECK_FEATURE(status, IVA);
175 OMAP3_CHECK_FEATURE(status, SGX);
176 OMAP3_CHECK_FEATURE(status, NEON);
177 OMAP3_CHECK_FEATURE(status, ISP);
178
179 /*
180 * TODO: Get additional info (where applicable)
181 * e.g. Size of L2 cache.
182 */
183}
184
185void __init omap3_check_revision(void)
159{ 186{
160 u32 cpuid, idcode; 187 u32 cpuid, idcode;
161 u16 hawkeye; 188 u16 hawkeye;
162 u8 rev; 189 u8 rev;
163 char *rev_name = "ES1.0";
164 190
165 /* 191 /*
166 * We cannot access revision registers on ES1.0. 192 * We cannot access revision registers on ES1.0.
@@ -170,7 +196,7 @@ void __init omap34xx_check_revision(void)
170 cpuid = read_cpuid(CPUID_ID); 196 cpuid = read_cpuid(CPUID_ID);
171 if ((((cpuid >> 4) & 0xfff) == 0xc08) && ((cpuid & 0xf) == 0x0)) { 197 if ((((cpuid >> 4) & 0xfff) == 0xc08) && ((cpuid & 0xf) == 0x0)) {
172 omap_revision = OMAP3430_REV_ES1_0; 198 omap_revision = OMAP3430_REV_ES1_0;
173 goto out; 199 return;
174 } 200 }
175 201
176 /* 202 /*
@@ -183,33 +209,115 @@ void __init omap34xx_check_revision(void)
183 hawkeye = (idcode >> 12) & 0xffff; 209 hawkeye = (idcode >> 12) & 0xffff;
184 rev = (idcode >> 28) & 0xff; 210 rev = (idcode >> 28) & 0xff;
185 211
186 if (hawkeye == 0xb7ae) { 212 switch (hawkeye) {
213 case 0xb7ae:
214 /* Handle 34xx/35xx devices */
187 switch (rev) { 215 switch (rev) {
188 case 0: 216 case 0: /* Take care of early samples */
217 case 1:
189 omap_revision = OMAP3430_REV_ES2_0; 218 omap_revision = OMAP3430_REV_ES2_0;
190 rev_name = "ES2.0";
191 break; 219 break;
192 case 2: 220 case 2:
193 omap_revision = OMAP3430_REV_ES2_1; 221 omap_revision = OMAP3430_REV_ES2_1;
194 rev_name = "ES2.1";
195 break; 222 break;
196 case 3: 223 case 3:
197 omap_revision = OMAP3430_REV_ES3_0; 224 omap_revision = OMAP3430_REV_ES3_0;
198 rev_name = "ES3.0";
199 break; 225 break;
200 case 4: 226 case 4:
201 omap_revision = OMAP3430_REV_ES3_1; 227 /* FALLTHROUGH */
202 rev_name = "ES3.1";
203 break;
204 default: 228 default:
205 /* Use the latest known revision as default */ 229 /* Use the latest known revision as default */
206 omap_revision = OMAP3430_REV_ES3_1; 230 omap_revision = OMAP3430_REV_ES3_1;
207 rev_name = "Unknown revision\n";
208 } 231 }
232 break;
233 case 0xb868:
234 /* Handle OMAP35xx/AM35xx devices
235 *
236 * Set the device to be OMAP3505 here. Actual device
237 * is identified later based on the features.
238 */
239 omap_revision = OMAP3505_REV(rev);
240 break;
241 case 0xb891:
242 /* FALLTHROUGH */
243 default:
244 /* Unknown default to latest silicon rev as default*/
245 omap_revision = OMAP3630_REV_ES1_0;
209 } 246 }
247}
210 248
211out: 249#define OMAP3_SHOW_FEATURE(feat) \
212 pr_info("OMAP%04x %s\n", omap_rev() >> 16, rev_name); 250 if (omap3_has_ ##feat()) \
251 printk(#feat" ");
252
253void __init omap3_cpuinfo(void)
254{
255 u8 rev = GET_OMAP_REVISION();
256 char cpu_name[16], cpu_rev[16];
257
258 /* OMAP3430 and OMAP3530 are assumed to be same.
259 *
260 * OMAP3525, OMAP3515 and OMAP3503 can be detected only based
261 * on available features. Upon detection, update the CPU id
262 * and CPU class bits.
263 */
264 if (cpu_is_omap3630()) {
265 strcpy(cpu_name, "OMAP3630");
266 } else if (cpu_is_omap3505()) {
267 /*
268 * AM35xx devices
269 */
270 if (omap3_has_sgx()) {
271 omap_revision = OMAP3517_REV(rev);
272 strcpy(cpu_name, "AM3517");
273 } else {
274 /* Already set in omap3_check_revision() */
275 strcpy(cpu_name, "AM3505");
276 }
277 } else if (omap3_has_iva() && omap3_has_sgx()) {
278 /* OMAP3430, OMAP3525, OMAP3515, OMAP3503 devices */
279 strcpy(cpu_name, "OMAP3430/3530");
280 } else if (omap3_has_sgx()) {
281 omap_revision = OMAP3525_REV(rev);
282 strcpy(cpu_name, "OMAP3525");
283 } else if (omap3_has_iva()) {
284 omap_revision = OMAP3515_REV(rev);
285 strcpy(cpu_name, "OMAP3515");
286 } else {
287 omap_revision = OMAP3503_REV(rev);
288 strcpy(cpu_name, "OMAP3503");
289 }
290
291 switch (rev) {
292 case OMAP_REVBITS_00:
293 strcpy(cpu_rev, "1.0");
294 break;
295 case OMAP_REVBITS_10:
296 strcpy(cpu_rev, "2.0");
297 break;
298 case OMAP_REVBITS_20:
299 strcpy(cpu_rev, "2.1");
300 break;
301 case OMAP_REVBITS_30:
302 strcpy(cpu_rev, "3.0");
303 break;
304 case OMAP_REVBITS_40:
305 /* FALLTHROUGH */
306 default:
307 /* Use the latest known revision as default */
308 strcpy(cpu_rev, "3.1");
309 }
310
311 /* Print verbose information */
312 pr_info("%s ES%s (", cpu_name, cpu_rev);
313
314 OMAP3_SHOW_FEATURE(l2cache);
315 OMAP3_SHOW_FEATURE(iva);
316 OMAP3_SHOW_FEATURE(sgx);
317 OMAP3_SHOW_FEATURE(neon);
318 OMAP3_SHOW_FEATURE(isp);
319
320 printk(")\n");
213} 321}
214 322
215/* 323/*
@@ -221,15 +329,18 @@ void __init omap2_check_revision(void)
221 * At this point we have an idea about the processor revision set 329 * At this point we have an idea about the processor revision set
222 * earlier with omap2_set_globals_tap(). 330 * earlier with omap2_set_globals_tap().
223 */ 331 */
224 if (cpu_is_omap24xx()) 332 if (cpu_is_omap24xx()) {
225 omap24xx_check_revision(); 333 omap24xx_check_revision();
226 else if (cpu_is_omap34xx()) 334 } else if (cpu_is_omap34xx()) {
227 omap34xx_check_revision(); 335 omap3_check_revision();
228 else if (cpu_is_omap44xx()) { 336 omap3_check_features();
337 omap3_cpuinfo();
338 } else if (cpu_is_omap44xx()) {
229 printk(KERN_INFO "FIXME: CPU revision = OMAP4430\n"); 339 printk(KERN_INFO "FIXME: CPU revision = OMAP4430\n");
230 return; 340 return;
231 } else 341 } else {
232 pr_err("OMAP revision unknown, please fix!\n"); 342 pr_err("OMAP revision unknown, please fix!\n");
343 }
233 344
234 /* 345 /*
235 * OK, now we know the exact revision. Initialize omap_chip bits 346 * OK, now we know the exact revision. Initialize omap_chip bits
@@ -241,6 +352,8 @@ void __init omap2_check_revision(void)
241 } else if (cpu_is_omap242x()) { 352 } else if (cpu_is_omap242x()) {
242 /* Currently only supports 2420ES2.1.1 and 2420-all */ 353 /* Currently only supports 2420ES2.1.1 and 2420-all */
243 omap_chip.oc |= CHIP_IS_OMAP2420; 354 omap_chip.oc |= CHIP_IS_OMAP2420;
355 } else if (cpu_is_omap3505() || cpu_is_omap3517()) {
356 omap_chip.oc = CHIP_IS_OMAP3430 | CHIP_IS_OMAP3430ES3_1;
244 } else if (cpu_is_omap343x()) { 357 } else if (cpu_is_omap343x()) {
245 omap_chip.oc = CHIP_IS_OMAP3430; 358 omap_chip.oc = CHIP_IS_OMAP3430;
246 if (omap_rev() == OMAP3430_REV_ES1_0) 359 if (omap_rev() == OMAP3430_REV_ES1_0)
@@ -252,6 +365,8 @@ void __init omap2_check_revision(void)
252 omap_chip.oc |= CHIP_IS_OMAP3430ES3_0; 365 omap_chip.oc |= CHIP_IS_OMAP3430ES3_0;
253 else if (omap_rev() == OMAP3430_REV_ES3_1) 366 else if (omap_rev() == OMAP3430_REV_ES3_1)
254 omap_chip.oc |= CHIP_IS_OMAP3430ES3_1; 367 omap_chip.oc |= CHIP_IS_OMAP3430ES3_1;
368 else if (omap_rev() == OMAP3630_REV_ES1_0)
369 omap_chip.oc |= CHIP_IS_OMAP3630ES1;
255 } else { 370 } else {
256 pr_err("Uninitialized omap_chip, please fix!\n"); 371 pr_err("Uninitialized omap_chip, please fix!\n");
257 } 372 }
diff --git a/arch/arm/mach-omap2/include/mach/board-zoom.h b/arch/arm/mach-omap2/include/mach/board-zoom.h
new file mode 100644
index 000000000000..c93b29e21b78
--- /dev/null
+++ b/arch/arm/mach-omap2/include/mach/board-zoom.h
@@ -0,0 +1,5 @@
1/*
2 * Defines for zoom boards
3 */
4extern int __init zoom_debugboard_init(void);
5extern void __init zoom_peripherals_init(void);
diff --git a/arch/arm/mach-omap2/include/mach/clkdev.h b/arch/arm/mach-omap2/include/mach/clkdev.h
new file mode 100644
index 000000000000..53b027441c56
--- /dev/null
+++ b/arch/arm/mach-omap2/include/mach/clkdev.h
@@ -0,0 +1,5 @@
1/*
2 * arch/arm/mach-omap2/include/mach/clkdev.h
3 */
4
5#include <plat/clkdev.h>
diff --git a/arch/arm/plat-omap/include/mach/debug-macro.S b/arch/arm/mach-omap2/include/mach/debug-macro.S
index ac24050e3416..e9f255df9163 100644
--- a/arch/arm/plat-omap/include/mach/debug-macro.S
+++ b/arch/arm/mach-omap2/include/mach/debug-macro.S
@@ -1,4 +1,4 @@
1/* arch/arm/plat-omap/include/mach/debug-macro.S 1/* arch/arm/mach-omap2/include/mach/debug-macro.S
2 * 2 *
3 * Debugging macro include header 3 * Debugging macro include header
4 * 4 *
@@ -14,20 +14,9 @@
14 .macro addruart,rx 14 .macro addruart,rx
15 mrc p15, 0, \rx, c1, c0 15 mrc p15, 0, \rx, c1, c0
16 tst \rx, #1 @ MMU enabled? 16 tst \rx, #1 @ MMU enabled?
17#ifdef CONFIG_ARCH_OMAP1 17#ifdef CONFIG_ARCH_OMAP2
18 moveq \rx, #0xff000000 @ physical base address
19 movne \rx, #0xfe000000 @ virtual base
20 orr \rx, \rx, #0x00fb0000
21#ifdef CONFIG_OMAP_LL_DEBUG_UART3
22 orr \rx, \rx, #0x00009000 @ UART 3
23#endif
24#if defined(CONFIG_OMAP_LL_DEBUG_UART2) || defined(CONFIG_OMAP_LL_DEBUG_UART3)
25 orr \rx, \rx, #0x00000800 @ UART 2 & 3
26#endif
27
28#elif CONFIG_ARCH_OMAP2
29 moveq \rx, #0x48000000 @ physical base address 18 moveq \rx, #0x48000000 @ physical base address
30 movne \rx, #0xd8000000 @ virtual base 19 movne \rx, #0xfa000000 @ virtual base
31 orr \rx, \rx, #0x0006a000 20 orr \rx, \rx, #0x0006a000
32#ifdef CONFIG_OMAP_LL_DEBUG_UART2 21#ifdef CONFIG_OMAP_LL_DEBUG_UART2
33 add \rx, \rx, #0x00002000 @ UART 2 22 add \rx, \rx, #0x00002000 @ UART 2
@@ -38,7 +27,7 @@
38 27
39#elif defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4) 28#elif defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
40 moveq \rx, #0x48000000 @ physical base address 29 moveq \rx, #0x48000000 @ physical base address
41 movne \rx, #0xd8000000 @ virtual base 30 movne \rx, #0xfa000000 @ virtual base
42 orr \rx, \rx, #0x0006a000 31 orr \rx, \rx, #0x0006a000
43#ifdef CONFIG_OMAP_LL_DEBUG_UART2 32#ifdef CONFIG_OMAP_LL_DEBUG_UART2
44 add \rx, \rx, #0x00002000 @ UART 2 33 add \rx, \rx, #0x00002000 @ UART 2
diff --git a/arch/arm/plat-omap/include/mach/entry-macro.S b/arch/arm/mach-omap2/include/mach/entry-macro.S
index a5592991634d..c7f1720bf282 100644
--- a/arch/arm/plat-omap/include/mach/entry-macro.S
+++ b/arch/arm/mach-omap2/include/mach/entry-macro.S
@@ -15,65 +15,17 @@
15#include <mach/irqs.h> 15#include <mach/irqs.h>
16#include <asm/hardware/gic.h> 16#include <asm/hardware/gic.h>
17 17
18#if defined(CONFIG_ARCH_OMAP1) 18#include <plat/omap24xx.h>
19 19#include <plat/omap34xx.h>
20#if defined(CONFIG_ARCH_OMAP730) && \
21 (defined(CONFIG_ARCH_OMAP15XX) || defined(CONFIG_ARCH_OMAP16XX))
22#error "FIXME: OMAP730 doesn't support multiple-OMAP"
23#elif defined(CONFIG_ARCH_OMAP730)
24#define INT_IH2_IRQ INT_730_IH2_IRQ
25#elif defined(CONFIG_ARCH_OMAP15XX)
26#define INT_IH2_IRQ INT_1510_IH2_IRQ
27#elif defined(CONFIG_ARCH_OMAP16XX)
28#define INT_IH2_IRQ INT_1610_IH2_IRQ
29#else
30#warning "IH2 IRQ defaulted"
31#define INT_IH2_IRQ INT_1510_IH2_IRQ
32#endif
33
34 .macro disable_fiq
35 .endm
36
37 .macro get_irqnr_preamble, base, tmp
38 .endm
39
40 .macro arch_ret_to_user, tmp1, tmp2
41 .endm
42
43 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
44 ldr \base, =OMAP1_IO_ADDRESS(OMAP_IH1_BASE)
45 ldr \irqnr, [\base, #IRQ_ITR_REG_OFFSET]
46 ldr \tmp, [\base, #IRQ_MIR_REG_OFFSET]
47 mov \irqstat, #0xffffffff
48 bic \tmp, \irqstat, \tmp
49 tst \irqnr, \tmp
50 beq 1510f
51
52 ldr \irqnr, [\base, #IRQ_SIR_FIQ_REG_OFFSET]
53 cmp \irqnr, #0
54 ldreq \irqnr, [\base, #IRQ_SIR_IRQ_REG_OFFSET]
55 cmpeq \irqnr, #INT_IH2_IRQ
56 ldreq \base, =OMAP1_IO_ADDRESS(OMAP_IH2_BASE)
57 ldreq \irqnr, [\base, #IRQ_SIR_IRQ_REG_OFFSET]
58 addeqs \irqnr, \irqnr, #32
591510:
60 .endm
61
62#endif
63#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) || \
64 defined(CONFIG_ARCH_OMAP4)
65
66#include <mach/omap24xx.h>
67#include <mach/omap34xx.h>
68 20
69/* REVISIT: This should be set dynamically if CONFIG_MULTI_OMAP2 is selected */ 21/* REVISIT: This should be set dynamically if CONFIG_MULTI_OMAP2 is selected */
70#if defined(CONFIG_ARCH_OMAP2420) || defined(CONFIG_ARCH_OMAP2430) 22#if defined(CONFIG_ARCH_OMAP2420) || defined(CONFIG_ARCH_OMAP2430)
71#define OMAP2_VA_IC_BASE OMAP2_IO_ADDRESS(OMAP24XX_IC_BASE) 23#define OMAP2_VA_IC_BASE OMAP2_L4_IO_ADDRESS(OMAP24XX_IC_BASE)
72#elif defined(CONFIG_ARCH_OMAP34XX) 24#elif defined(CONFIG_ARCH_OMAP34XX)
73#define OMAP2_VA_IC_BASE OMAP2_IO_ADDRESS(OMAP34XX_IC_BASE) 25#define OMAP2_VA_IC_BASE OMAP2_L4_IO_ADDRESS(OMAP34XX_IC_BASE)
74#endif 26#endif
75#if defined(CONFIG_ARCH_OMAP4) 27#if defined(CONFIG_ARCH_OMAP4)
76#include <mach/omap44xx.h> 28#include <plat/omap44xx.h>
77#endif 29#endif
78#define INTCPS_SIR_IRQ_OFFSET 0x0040 /* Active interrupt offset */ 30#define INTCPS_SIR_IRQ_OFFSET 0x0040 /* Active interrupt offset */
79#define ACTIVEIRQ_MASK 0x7f /* Active interrupt bits */ 31#define ACTIVEIRQ_MASK 0x7f /* Active interrupt bits */
@@ -104,6 +56,8 @@
104 56
105 .endm 57 .endm
106#else 58#else
59#define OMAP44XX_VA_GIC_CPU_BASE OMAP2_L4_IO_ADDRESS(OMAP44XX_GIC_CPU_BASE)
60
107 /* 61 /*
108 * The interrupt numbering scheme is defined in the 62 * The interrupt numbering scheme is defined in the
109 * interrupt controller spec. To wit: 63 * interrupt controller spec. To wit:
@@ -168,5 +122,3 @@
168 122
169 .macro irq_prio_table 123 .macro irq_prio_table
170 .endm 124 .endm
171
172#endif
diff --git a/arch/arm/mach-omap2/include/mach/gpio.h b/arch/arm/mach-omap2/include/mach/gpio.h
new file mode 100644
index 000000000000..be4d290d57ee
--- /dev/null
+++ b/arch/arm/mach-omap2/include/mach/gpio.h
@@ -0,0 +1,5 @@
1/*
2 * arch/arm/mach-omap2/include/mach/gpio.h
3 */
4
5#include <plat/gpio.h>
diff --git a/arch/arm/mach-omap2/include/mach/hardware.h b/arch/arm/mach-omap2/include/mach/hardware.h
new file mode 100644
index 000000000000..78edf9d33f71
--- /dev/null
+++ b/arch/arm/mach-omap2/include/mach/hardware.h
@@ -0,0 +1,5 @@
1/*
2 * arch/arm/mach-omap2/include/mach/hardware.h
3 */
4
5#include <plat/hardware.h>
diff --git a/arch/arm/mach-omap2/include/mach/io.h b/arch/arm/mach-omap2/include/mach/io.h
new file mode 100644
index 000000000000..fd78f31aa1ad
--- /dev/null
+++ b/arch/arm/mach-omap2/include/mach/io.h
@@ -0,0 +1,5 @@
1/*
2 * arch/arm/mach-omap2/include/mach/io.h
3 */
4
5#include <plat/io.h>
diff --git a/arch/arm/mach-omap2/include/mach/irqs.h b/arch/arm/mach-omap2/include/mach/irqs.h
new file mode 100644
index 000000000000..44dab7725696
--- /dev/null
+++ b/arch/arm/mach-omap2/include/mach/irqs.h
@@ -0,0 +1,5 @@
1/*
2 * arch/arm/mach-omap2/include/mach/irqs.h
3 */
4
5#include <plat/irqs.h>
diff --git a/arch/arm/mach-omap2/include/mach/memory.h b/arch/arm/mach-omap2/include/mach/memory.h
new file mode 100644
index 000000000000..ca6d32a917dd
--- /dev/null
+++ b/arch/arm/mach-omap2/include/mach/memory.h
@@ -0,0 +1,5 @@
1/*
2 * arch/arm/mach-omap2/include/mach/memory.h
3 */
4
5#include <plat/memory.h>
diff --git a/arch/arm/mach-omap2/include/mach/smp.h b/arch/arm/mach-omap2/include/mach/smp.h
new file mode 100644
index 000000000000..323675f21b69
--- /dev/null
+++ b/arch/arm/mach-omap2/include/mach/smp.h
@@ -0,0 +1,5 @@
1/*
2 * arch/arm/mach-omap2/include/mach/smp.h
3 */
4
5#include <plat/smp.h>
diff --git a/arch/arm/mach-omap2/include/mach/system.h b/arch/arm/mach-omap2/include/mach/system.h
new file mode 100644
index 000000000000..d488721ab90b
--- /dev/null
+++ b/arch/arm/mach-omap2/include/mach/system.h
@@ -0,0 +1,5 @@
1/*
2 * arch/arm/mach-omap2/include/mach/system.h
3 */
4
5#include <plat/system.h>
diff --git a/arch/arm/mach-omap2/include/mach/timex.h b/arch/arm/mach-omap2/include/mach/timex.h
new file mode 100644
index 000000000000..de9f8fc40e7c
--- /dev/null
+++ b/arch/arm/mach-omap2/include/mach/timex.h
@@ -0,0 +1,5 @@
1/*
2 * arch/arm/mach-omap2/include/mach/timex.h
3 */
4
5#include <plat/timex.h>
diff --git a/arch/arm/mach-omap2/include/mach/uncompress.h b/arch/arm/mach-omap2/include/mach/uncompress.h
new file mode 100644
index 000000000000..78e0557bfd4e
--- /dev/null
+++ b/arch/arm/mach-omap2/include/mach/uncompress.h
@@ -0,0 +1,5 @@
1/*
2 * arch/arm/mach-omap2/include/mach/uncompress.h
3 */
4
5#include <plat/uncompress.h>
diff --git a/arch/arm/plat-omap/include/mach/vmalloc.h b/arch/arm/mach-omap2/include/mach/vmalloc.h
index b97dfafeebda..9ce9b6e8ad23 100644
--- a/arch/arm/plat-omap/include/mach/vmalloc.h
+++ b/arch/arm/mach-omap2/include/mach/vmalloc.h
@@ -17,5 +17,4 @@
17 * along with this program; if not, write to the Free Software 17 * along with this program; if not, write to the Free Software
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#define VMALLOC_END (PAGE_OFFSET + 0x18000000) 20#define VMALLOC_END (PAGE_OFFSET + 0x38000000)
21
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 56be87d13edb..59d28b2fd8c5 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -27,24 +27,24 @@
27 27
28#include <asm/mach/map.h> 28#include <asm/mach/map.h>
29 29
30#include <mach/mux.h> 30#include <plat/mux.h>
31#include <mach/omapfb.h> 31#include <plat/omapfb.h>
32#include <mach/sram.h> 32#include <plat/sram.h>
33#include <mach/sdrc.h> 33#include <plat/sdrc.h>
34#include <mach/gpmc.h> 34#include <plat/gpmc.h>
35#include <mach/serial.h> 35#include <plat/serial.h>
36 36
37#ifndef CONFIG_ARCH_OMAP4 /* FIXME: Remove this once clkdev is ready */ 37#ifndef CONFIG_ARCH_OMAP4 /* FIXME: Remove this once clkdev is ready */
38#include "clock.h" 38#include "clock.h"
39 39
40#include <mach/omap-pm.h> 40#include <plat/omap-pm.h>
41#include <mach/powerdomain.h> 41#include <plat/powerdomain.h>
42#include "powerdomains.h" 42#include "powerdomains.h"
43 43
44#include <mach/clockdomain.h> 44#include <plat/clockdomain.h>
45#include "clockdomains.h" 45#include "clockdomains.h"
46#endif 46#endif
47#include <mach/omap_hwmod.h> 47#include <plat/omap_hwmod.h>
48#include "omap_hwmod_2420.h" 48#include "omap_hwmod_2420.h"
49#include "omap_hwmod_2430.h" 49#include "omap_hwmod_2430.h"
50#include "omap_hwmod_34xx.h" 50#include "omap_hwmod_34xx.h"
@@ -203,6 +203,24 @@ static struct map_desc omap44xx_io_desc[] __initdata = {
203 .type = MT_DEVICE, 203 .type = MT_DEVICE,
204 }, 204 },
205 { 205 {
206 .virtual = OMAP44XX_EMIF1_VIRT,
207 .pfn = __phys_to_pfn(OMAP44XX_EMIF1_PHYS),
208 .length = OMAP44XX_EMIF1_SIZE,
209 .type = MT_DEVICE,
210 },
211 {
212 .virtual = OMAP44XX_EMIF2_VIRT,
213 .pfn = __phys_to_pfn(OMAP44XX_EMIF2_PHYS),
214 .length = OMAP44XX_EMIF2_SIZE,
215 .type = MT_DEVICE,
216 },
217 {
218 .virtual = OMAP44XX_DMM_VIRT,
219 .pfn = __phys_to_pfn(OMAP44XX_DMM_PHYS),
220 .length = OMAP44XX_DMM_SIZE,
221 .type = MT_DEVICE,
222 },
223 {
206 .virtual = L4_PER_44XX_VIRT, 224 .virtual = L4_PER_44XX_VIRT,
207 .pfn = __phys_to_pfn(L4_PER_44XX_PHYS), 225 .pfn = __phys_to_pfn(L4_PER_44XX_PHYS),
208 .length = L4_PER_44XX_SIZE, 226 .length = L4_PER_44XX_SIZE,
diff --git a/arch/arm/mach-omap2/iommu2.c b/arch/arm/mach-omap2/iommu2.c
index 4a0e1cd5c1f4..6f4b7cc8f4d1 100644
--- a/arch/arm/mach-omap2/iommu2.c
+++ b/arch/arm/mach-omap2/iommu2.c
@@ -17,7 +17,7 @@
17#include <linux/module.h> 17#include <linux/module.h>
18#include <linux/stringify.h> 18#include <linux/stringify.h>
19 19
20#include <mach/iommu.h> 20#include <plat/iommu.h>
21 21
22/* 22/*
23 * omap2 architecture specific register bit definitions 23 * omap2 architecture specific register bit definitions
diff --git a/arch/arm/mach-omap2/irq.c b/arch/arm/mach-omap2/irq.c
index b82863887f10..e9bc782fa414 100644
--- a/arch/arm/mach-omap2/irq.c
+++ b/arch/arm/mach-omap2/irq.c
@@ -25,6 +25,10 @@
25#define INTC_SYSSTATUS 0x0014 25#define INTC_SYSSTATUS 0x0014
26#define INTC_SIR 0x0040 26#define INTC_SIR 0x0040
27#define INTC_CONTROL 0x0048 27#define INTC_CONTROL 0x0048
28#define INTC_PROTECTION 0x004C
29#define INTC_IDLE 0x0050
30#define INTC_THRESHOLD 0x0068
31#define INTC_MIR0 0x0084
28#define INTC_MIR_CLEAR0 0x0088 32#define INTC_MIR_CLEAR0 0x0088
29#define INTC_MIR_SET0 0x008c 33#define INTC_MIR_SET0 0x008c
30#define INTC_PENDING_IRQ0 0x0098 34#define INTC_PENDING_IRQ0 0x0098
@@ -48,6 +52,18 @@ static struct omap_irq_bank {
48 }, 52 },
49}; 53};
50 54
55/* Structure to save interrupt controller context */
56struct omap3_intc_regs {
57 u32 sysconfig;
58 u32 protection;
59 u32 idle;
60 u32 threshold;
61 u32 ilr[INTCPS_NR_IRQS];
62 u32 mir[INTCPS_NR_MIR_REGS];
63};
64
65static struct omap3_intc_regs intc_context[ARRAY_SIZE(irq_banks)];
66
51/* INTC bank register get/set */ 67/* INTC bank register get/set */
52 68
53static void intc_bank_write_reg(u32 val, struct omap_irq_bank *bank, u16 reg) 69static void intc_bank_write_reg(u32 val, struct omap_irq_bank *bank, u16 reg)
@@ -178,12 +194,20 @@ void __init omap_init_irq(void)
178 int i; 194 int i;
179 195
180 for (i = 0; i < ARRAY_SIZE(irq_banks); i++) { 196 for (i = 0; i < ARRAY_SIZE(irq_banks); i++) {
197 unsigned long base;
181 struct omap_irq_bank *bank = irq_banks + i; 198 struct omap_irq_bank *bank = irq_banks + i;
182 199
183 if (cpu_is_omap24xx()) 200 if (cpu_is_omap24xx())
184 bank->base_reg = OMAP2_IO_ADDRESS(OMAP24XX_IC_BASE); 201 base = OMAP24XX_IC_BASE;
185 else if (cpu_is_omap34xx()) 202 else if (cpu_is_omap34xx())
186 bank->base_reg = OMAP2_IO_ADDRESS(OMAP34XX_IC_BASE); 203 base = OMAP34XX_IC_BASE;
204
205 /* Static mapping, never released */
206 bank->base_reg = ioremap(base, SZ_4K);
207 if (!bank->base_reg) {
208 printk(KERN_ERR "Could not ioremap irq bank%i\n", i);
209 continue;
210 }
187 211
188 omap_irq_bank_init_one(bank); 212 omap_irq_bank_init_one(bank);
189 213
@@ -201,3 +225,53 @@ void __init omap_init_irq(void)
201 } 225 }
202} 226}
203 227
228#ifdef CONFIG_ARCH_OMAP3
229void omap_intc_save_context(void)
230{
231 int ind = 0, i = 0;
232 for (ind = 0; ind < ARRAY_SIZE(irq_banks); ind++) {
233 struct omap_irq_bank *bank = irq_banks + ind;
234 intc_context[ind].sysconfig =
235 intc_bank_read_reg(bank, INTC_SYSCONFIG);
236 intc_context[ind].protection =
237 intc_bank_read_reg(bank, INTC_PROTECTION);
238 intc_context[ind].idle =
239 intc_bank_read_reg(bank, INTC_IDLE);
240 intc_context[ind].threshold =
241 intc_bank_read_reg(bank, INTC_THRESHOLD);
242 for (i = 0; i < INTCPS_NR_IRQS; i++)
243 intc_context[ind].ilr[i] =
244 intc_bank_read_reg(bank, (0x100 + 0x4*i));
245 for (i = 0; i < INTCPS_NR_MIR_REGS; i++)
246 intc_context[ind].mir[i] =
247 intc_bank_read_reg(&irq_banks[0], INTC_MIR0 +
248 (0x20 * i));
249 }
250}
251
252void omap_intc_restore_context(void)
253{
254 int ind = 0, i = 0;
255
256 for (ind = 0; ind < ARRAY_SIZE(irq_banks); ind++) {
257 struct omap_irq_bank *bank = irq_banks + ind;
258 intc_bank_write_reg(intc_context[ind].sysconfig,
259 bank, INTC_SYSCONFIG);
260 intc_bank_write_reg(intc_context[ind].sysconfig,
261 bank, INTC_SYSCONFIG);
262 intc_bank_write_reg(intc_context[ind].protection,
263 bank, INTC_PROTECTION);
264 intc_bank_write_reg(intc_context[ind].idle,
265 bank, INTC_IDLE);
266 intc_bank_write_reg(intc_context[ind].threshold,
267 bank, INTC_THRESHOLD);
268 for (i = 0; i < INTCPS_NR_IRQS; i++)
269 intc_bank_write_reg(intc_context[ind].ilr[i],
270 bank, (0x100 + 0x4*i));
271 for (i = 0; i < INTCPS_NR_MIR_REGS; i++)
272 intc_bank_write_reg(intc_context[ind].mir[i],
273 &irq_banks[0], INTC_MIR0 + (0x20 * i));
274 }
275 /* MIRs are saved and restore with other PRCM registers */
276}
277#endif /* CONFIG_ARCH_OMAP3 */
diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c
index ef57b38a56a4..281ab6342448 100644
--- a/arch/arm/mach-omap2/mailbox.c
+++ b/arch/arm/mach-omap2/mailbox.c
@@ -15,9 +15,11 @@
15#include <linux/err.h> 15#include <linux/err.h>
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17#include <linux/io.h> 17#include <linux/io.h>
18#include <mach/mailbox.h> 18#include <plat/mailbox.h>
19#include <mach/irqs.h> 19#include <mach/irqs.h>
20 20
21#define DRV_NAME "omap2-mailbox"
22
21#define MAILBOX_REVISION 0x000 23#define MAILBOX_REVISION 0x000
22#define MAILBOX_SYSCONFIG 0x010 24#define MAILBOX_SYSCONFIG 0x010
23#define MAILBOX_SYSSTATUS 0x014 25#define MAILBOX_SYSSTATUS 0x014
@@ -27,8 +29,12 @@
27#define MAILBOX_IRQSTATUS(u) (0x100 + 8 * (u)) 29#define MAILBOX_IRQSTATUS(u) (0x100 + 8 * (u))
28#define MAILBOX_IRQENABLE(u) (0x104 + 8 * (u)) 30#define MAILBOX_IRQENABLE(u) (0x104 + 8 * (u))
29 31
30#define MAILBOX_IRQ_NEWMSG(u) (1 << (2 * (u))) 32#define OMAP4_MAILBOX_IRQSTATUS(u) (0x104 + 10 * (u))
31#define MAILBOX_IRQ_NOTFULL(u) (1 << (2 * (u) + 1)) 33#define OMAP4_MAILBOX_IRQENABLE(u) (0x108 + 10 * (u))
34#define OMAP4_MAILBOX_IRQENABLE_CLR(u) (0x10c + 10 * (u))
35
36#define MAILBOX_IRQ_NEWMSG(m) (1 << (2 * (m)))
37#define MAILBOX_IRQ_NOTFULL(m) (1 << (2 * (m) + 1))
32 38
33/* SYSCONFIG: register bit definition */ 39/* SYSCONFIG: register bit definition */
34#define AUTOIDLE (1 << 0) 40#define AUTOIDLE (1 << 0)
@@ -39,7 +45,11 @@
39#define RESETDONE (1 << 0) 45#define RESETDONE (1 << 0)
40 46
41#define MBOX_REG_SIZE 0x120 47#define MBOX_REG_SIZE 0x120
48
49#define OMAP4_MBOX_REG_SIZE 0x130
50
42#define MBOX_NR_REGS (MBOX_REG_SIZE / sizeof(u32)) 51#define MBOX_NR_REGS (MBOX_REG_SIZE / sizeof(u32))
52#define OMAP4_MBOX_NR_REGS (OMAP4_MBOX_REG_SIZE / sizeof(u32))
43 53
44static void __iomem *mbox_base; 54static void __iomem *mbox_base;
45 55
@@ -56,7 +66,8 @@ struct omap_mbox2_priv {
56 unsigned long irqstatus; 66 unsigned long irqstatus;
57 u32 newmsg_bit; 67 u32 newmsg_bit;
58 u32 notfull_bit; 68 u32 notfull_bit;
59 u32 ctx[MBOX_NR_REGS]; 69 u32 ctx[OMAP4_MBOX_NR_REGS];
70 unsigned long irqdisable;
60}; 71};
61 72
62static struct clk *mbox_ick_handle; 73static struct clk *mbox_ick_handle;
@@ -82,8 +93,9 @@ static int omap2_mbox_startup(struct omap_mbox *mbox)
82 93
83 mbox_ick_handle = clk_get(NULL, "mailboxes_ick"); 94 mbox_ick_handle = clk_get(NULL, "mailboxes_ick");
84 if (IS_ERR(mbox_ick_handle)) { 95 if (IS_ERR(mbox_ick_handle)) {
85 pr_err("Can't get mailboxes_ick\n"); 96 printk(KERN_ERR "Could not get mailboxes_ick: %d\n",
86 return -ENODEV; 97 PTR_ERR(mbox_ick_handle));
98 return PTR_ERR(mbox_ick_handle);
87 } 99 }
88 clk_enable(mbox_ick_handle); 100 clk_enable(mbox_ick_handle);
89 101
@@ -115,6 +127,7 @@ static void omap2_mbox_shutdown(struct omap_mbox *mbox)
115{ 127{
116 clk_disable(mbox_ick_handle); 128 clk_disable(mbox_ick_handle);
117 clk_put(mbox_ick_handle); 129 clk_put(mbox_ick_handle);
130 mbox_ick_handle = NULL;
118} 131}
119 132
120/* Mailbox FIFO handle functions */ 133/* Mailbox FIFO handle functions */
@@ -143,7 +156,7 @@ static int omap2_mbox_fifo_full(struct omap_mbox *mbox)
143{ 156{
144 struct omap_mbox2_fifo *fifo = 157 struct omap_mbox2_fifo *fifo =
145 &((struct omap_mbox2_priv *)mbox->priv)->tx_fifo; 158 &((struct omap_mbox2_priv *)mbox->priv)->tx_fifo;
146 return (mbox_read_reg(fifo->fifo_stat)); 159 return mbox_read_reg(fifo->fifo_stat);
147} 160}
148 161
149/* Mailbox IRQ handle functions */ 162/* Mailbox IRQ handle functions */
@@ -163,10 +176,9 @@ static void omap2_mbox_disable_irq(struct omap_mbox *mbox,
163{ 176{
164 struct omap_mbox2_priv *p = (struct omap_mbox2_priv *)mbox->priv; 177 struct omap_mbox2_priv *p = (struct omap_mbox2_priv *)mbox->priv;
165 u32 l, bit = (irq == IRQ_TX) ? p->notfull_bit : p->newmsg_bit; 178 u32 l, bit = (irq == IRQ_TX) ? p->notfull_bit : p->newmsg_bit;
166 179 l = mbox_read_reg(p->irqdisable);
167 l = mbox_read_reg(p->irqenable);
168 l &= ~bit; 180 l &= ~bit;
169 mbox_write_reg(l, p->irqenable); 181 mbox_write_reg(l, p->irqdisable);
170} 182}
171 183
172static void omap2_mbox_ack_irq(struct omap_mbox *mbox, 184static void omap2_mbox_ack_irq(struct omap_mbox *mbox,
@@ -189,15 +201,19 @@ static int omap2_mbox_is_irq(struct omap_mbox *mbox,
189 u32 enable = mbox_read_reg(p->irqenable); 201 u32 enable = mbox_read_reg(p->irqenable);
190 u32 status = mbox_read_reg(p->irqstatus); 202 u32 status = mbox_read_reg(p->irqstatus);
191 203
192 return (enable & status & bit); 204 return (int)(enable & status & bit);
193} 205}
194 206
195static void omap2_mbox_save_ctx(struct omap_mbox *mbox) 207static void omap2_mbox_save_ctx(struct omap_mbox *mbox)
196{ 208{
197 int i; 209 int i;
198 struct omap_mbox2_priv *p = mbox->priv; 210 struct omap_mbox2_priv *p = mbox->priv;
199 211 int nr_regs;
200 for (i = 0; i < MBOX_NR_REGS; i++) { 212 if (cpu_is_omap44xx())
213 nr_regs = OMAP4_MBOX_NR_REGS;
214 else
215 nr_regs = MBOX_NR_REGS;
216 for (i = 0; i < nr_regs; i++) {
201 p->ctx[i] = mbox_read_reg(i * sizeof(u32)); 217 p->ctx[i] = mbox_read_reg(i * sizeof(u32));
202 218
203 dev_dbg(mbox->dev, "%s: [%02x] %08x\n", __func__, 219 dev_dbg(mbox->dev, "%s: [%02x] %08x\n", __func__,
@@ -209,8 +225,12 @@ static void omap2_mbox_restore_ctx(struct omap_mbox *mbox)
209{ 225{
210 int i; 226 int i;
211 struct omap_mbox2_priv *p = mbox->priv; 227 struct omap_mbox2_priv *p = mbox->priv;
212 228 int nr_regs;
213 for (i = 0; i < MBOX_NR_REGS; i++) { 229 if (cpu_is_omap44xx())
230 nr_regs = OMAP4_MBOX_NR_REGS;
231 else
232 nr_regs = MBOX_NR_REGS;
233 for (i = 0; i < nr_regs; i++) {
214 mbox_write_reg(p->ctx[i], i * sizeof(u32)); 234 mbox_write_reg(p->ctx[i], i * sizeof(u32));
215 235
216 dev_dbg(mbox->dev, "%s: [%02x] %08x\n", __func__, 236 dev_dbg(mbox->dev, "%s: [%02x] %08x\n", __func__,
@@ -242,7 +262,6 @@ static struct omap_mbox_ops omap2_mbox_ops = {
242 */ 262 */
243 263
244/* FIXME: the following structs should be filled automatically by the user id */ 264/* FIXME: the following structs should be filled automatically by the user id */
245
246/* DSP */ 265/* DSP */
247static struct omap_mbox2_priv omap2_mbox_dsp_priv = { 266static struct omap_mbox2_priv omap2_mbox_dsp_priv = {
248 .tx_fifo = { 267 .tx_fifo = {
@@ -257,8 +276,36 @@ static struct omap_mbox2_priv omap2_mbox_dsp_priv = {
257 .irqstatus = MAILBOX_IRQSTATUS(0), 276 .irqstatus = MAILBOX_IRQSTATUS(0),
258 .notfull_bit = MAILBOX_IRQ_NOTFULL(0), 277 .notfull_bit = MAILBOX_IRQ_NOTFULL(0),
259 .newmsg_bit = MAILBOX_IRQ_NEWMSG(1), 278 .newmsg_bit = MAILBOX_IRQ_NEWMSG(1),
279 .irqdisable = MAILBOX_IRQENABLE(0),
280};
281
282
283
284/* OMAP4 specific data structure. Use the cpu_is_omap4xxx()
285to use this*/
286static struct omap_mbox2_priv omap2_mbox_1_priv = {
287 .tx_fifo = {
288 .msg = MAILBOX_MESSAGE(0),
289 .fifo_stat = MAILBOX_FIFOSTATUS(0),
290 },
291 .rx_fifo = {
292 .msg = MAILBOX_MESSAGE(1),
293 .msg_stat = MAILBOX_MSGSTATUS(1),
294 },
295 .irqenable = OMAP4_MAILBOX_IRQENABLE(0),
296 .irqstatus = OMAP4_MAILBOX_IRQSTATUS(0),
297 .notfull_bit = MAILBOX_IRQ_NOTFULL(0),
298 .newmsg_bit = MAILBOX_IRQ_NEWMSG(1),
299 .irqdisable = OMAP4_MAILBOX_IRQENABLE_CLR(0),
260}; 300};
261 301
302struct omap_mbox mbox_1_info = {
303 .name = "mailbox-1",
304 .ops = &omap2_mbox_ops,
305 .priv = &omap2_mbox_1_priv,
306};
307EXPORT_SYMBOL(mbox_1_info);
308
262struct omap_mbox mbox_dsp_info = { 309struct omap_mbox mbox_dsp_info = {
263 .name = "dsp", 310 .name = "dsp",
264 .ops = &omap2_mbox_ops, 311 .ops = &omap2_mbox_ops,
@@ -266,6 +313,30 @@ struct omap_mbox mbox_dsp_info = {
266}; 313};
267EXPORT_SYMBOL(mbox_dsp_info); 314EXPORT_SYMBOL(mbox_dsp_info);
268 315
316static struct omap_mbox2_priv omap2_mbox_2_priv = {
317 .tx_fifo = {
318 .msg = MAILBOX_MESSAGE(3),
319 .fifo_stat = MAILBOX_FIFOSTATUS(3),
320 },
321 .rx_fifo = {
322 .msg = MAILBOX_MESSAGE(2),
323 .msg_stat = MAILBOX_MSGSTATUS(2),
324 },
325 .irqenable = OMAP4_MAILBOX_IRQENABLE(0),
326 .irqstatus = OMAP4_MAILBOX_IRQSTATUS(0),
327 .notfull_bit = MAILBOX_IRQ_NOTFULL(3),
328 .newmsg_bit = MAILBOX_IRQ_NEWMSG(2),
329 .irqdisable = OMAP4_MAILBOX_IRQENABLE_CLR(0),
330};
331
332struct omap_mbox mbox_2_info = {
333 .name = "mailbox-2",
334 .ops = &omap2_mbox_ops,
335 .priv = &omap2_mbox_2_priv,
336};
337EXPORT_SYMBOL(mbox_2_info);
338
339
269#if defined(CONFIG_ARCH_OMAP2420) /* IVA */ 340#if defined(CONFIG_ARCH_OMAP2420) /* IVA */
270static struct omap_mbox2_priv omap2_mbox_iva_priv = { 341static struct omap_mbox2_priv omap2_mbox_iva_priv = {
271 .tx_fifo = { 342 .tx_fifo = {
@@ -280,6 +351,7 @@ static struct omap_mbox2_priv omap2_mbox_iva_priv = {
280 .irqstatus = MAILBOX_IRQSTATUS(3), 351 .irqstatus = MAILBOX_IRQSTATUS(3),
281 .notfull_bit = MAILBOX_IRQ_NOTFULL(2), 352 .notfull_bit = MAILBOX_IRQ_NOTFULL(2),
282 .newmsg_bit = MAILBOX_IRQ_NEWMSG(3), 353 .newmsg_bit = MAILBOX_IRQ_NEWMSG(3),
354 .irqdisable = MAILBOX_IRQENABLE(3),
283}; 355};
284 356
285static struct omap_mbox mbox_iva_info = { 357static struct omap_mbox mbox_iva_info = {
@@ -305,17 +377,31 @@ static int __devinit omap2_mbox_probe(struct platform_device *pdev)
305 return -ENOMEM; 377 return -ENOMEM;
306 378
307 /* DSP or IVA2 IRQ */ 379 /* DSP or IVA2 IRQ */
308 ret = platform_get_irq(pdev, 0); 380 res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
309 if (ret < 0) { 381
382 if (unlikely(!res)) {
310 dev_err(&pdev->dev, "invalid irq resource\n"); 383 dev_err(&pdev->dev, "invalid irq resource\n");
384 ret = -ENODEV;
311 goto err_dsp; 385 goto err_dsp;
312 } 386 }
313 mbox_dsp_info.irq = ret; 387 if (cpu_is_omap44xx()) {
314 388 mbox_1_info.irq = res->start;
315 ret = omap_mbox_register(&pdev->dev, &mbox_dsp_info); 389 ret = omap_mbox_register(&pdev->dev, &mbox_1_info);
390 } else {
391 mbox_dsp_info.irq = res->start;
392 ret = omap_mbox_register(&pdev->dev, &mbox_dsp_info);
393 }
316 if (ret) 394 if (ret)
317 goto err_dsp; 395 goto err_dsp;
318 396
397 if (cpu_is_omap44xx()) {
398 mbox_2_info.irq = res->start;
399 ret = omap_mbox_register(&pdev->dev, &mbox_2_info);
400 if (ret) {
401 omap_mbox_unregister(&mbox_1_info);
402 goto err_dsp;
403 }
404 }
319#if defined(CONFIG_ARCH_OMAP2420) /* IVA */ 405#if defined(CONFIG_ARCH_OMAP2420) /* IVA */
320 if (cpu_is_omap2420()) { 406 if (cpu_is_omap2420()) {
321 /* IVA IRQ */ 407 /* IVA IRQ */
@@ -335,6 +421,7 @@ static int __devinit omap2_mbox_probe(struct platform_device *pdev)
335 421
336err_iva1: 422err_iva1:
337 omap_mbox_unregister(&mbox_dsp_info); 423 omap_mbox_unregister(&mbox_dsp_info);
424
338err_dsp: 425err_dsp:
339 iounmap(mbox_base); 426 iounmap(mbox_base);
340 return ret; 427 return ret;
@@ -345,7 +432,12 @@ static int __devexit omap2_mbox_remove(struct platform_device *pdev)
345#if defined(CONFIG_ARCH_OMAP2420) 432#if defined(CONFIG_ARCH_OMAP2420)
346 omap_mbox_unregister(&mbox_iva_info); 433 omap_mbox_unregister(&mbox_iva_info);
347#endif 434#endif
348 omap_mbox_unregister(&mbox_dsp_info); 435
436 if (cpu_is_omap44xx()) {
437 omap_mbox_unregister(&mbox_2_info);
438 omap_mbox_unregister(&mbox_1_info);
439 } else
440 omap_mbox_unregister(&mbox_dsp_info);
349 iounmap(mbox_base); 441 iounmap(mbox_base);
350 return 0; 442 return 0;
351} 443}
@@ -354,7 +446,7 @@ static struct platform_driver omap2_mbox_driver = {
354 .probe = omap2_mbox_probe, 446 .probe = omap2_mbox_probe,
355 .remove = __devexit_p(omap2_mbox_remove), 447 .remove = __devexit_p(omap2_mbox_remove),
356 .driver = { 448 .driver = {
357 .name = "omap2-mailbox", 449 .name = DRV_NAME,
358 }, 450 },
359}; 451};
360 452
@@ -372,6 +464,6 @@ module_init(omap2_mbox_init);
372module_exit(omap2_mbox_exit); 464module_exit(omap2_mbox_exit);
373 465
374MODULE_LICENSE("GPL v2"); 466MODULE_LICENSE("GPL v2");
375MODULE_DESCRIPTION("omap mailbox: omap2/3 architecture specific functions"); 467MODULE_DESCRIPTION("omap mailbox: omap2/3/4 architecture specific functions");
376MODULE_AUTHOR("Hiroshi DOYU <Hiroshi.DOYU@nokia.com>, Paul Mundt"); 468MODULE_AUTHOR("Hiroshi DOYU <Hiroshi.DOYU@nokia.com>, Paul Mundt");
377MODULE_ALIAS("platform:omap2-mailbox"); 469MODULE_ALIAS("platform:"DRV_NAME);
diff --git a/arch/arm/mach-omap2/mcbsp.c b/arch/arm/mach-omap2/mcbsp.c
index a846aa1ebb4d..baa451733850 100644
--- a/arch/arm/mach-omap2/mcbsp.c
+++ b/arch/arm/mach-omap2/mcbsp.c
@@ -18,10 +18,10 @@
18#include <linux/platform_device.h> 18#include <linux/platform_device.h>
19 19
20#include <mach/irqs.h> 20#include <mach/irqs.h>
21#include <mach/dma.h> 21#include <plat/dma.h>
22#include <mach/mux.h> 22#include <plat/mux.h>
23#include <mach/cpu.h> 23#include <plat/cpu.h>
24#include <mach/mcbsp.h> 24#include <plat/mcbsp.h>
25 25
26static void omap2_mcbsp2_mux_setup(void) 26static void omap2_mcbsp2_mux_setup(void)
27{ 27{
diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c
index c9c59a2db4e2..0c3c72d934bf 100644
--- a/arch/arm/mach-omap2/mmc-twl4030.c
+++ b/arch/arm/mach-omap2/mmc-twl4030.c
@@ -20,9 +20,9 @@
20#include <linux/regulator/consumer.h> 20#include <linux/regulator/consumer.h>
21 21
22#include <mach/hardware.h> 22#include <mach/hardware.h>
23#include <mach/control.h> 23#include <plat/control.h>
24#include <mach/mmc.h> 24#include <plat/mmc.h>
25#include <mach/board.h> 25#include <plat/board.h>
26 26
27#include "mmc-twl4030.h" 27#include "mmc-twl4030.h"
28 28
@@ -213,7 +213,7 @@ static int twl4030_mmc_get_context_loss(struct device *dev)
213static int twl_mmc1_set_power(struct device *dev, int slot, int power_on, 213static int twl_mmc1_set_power(struct device *dev, int slot, int power_on,
214 int vdd) 214 int vdd)
215{ 215{
216 u32 reg; 216 u32 reg, prog_io;
217 int ret = 0; 217 int ret = 0;
218 struct twl_mmc_controller *c = &hsmmc[0]; 218 struct twl_mmc_controller *c = &hsmmc[0];
219 struct omap_mmc_platform_data *mmc = dev->platform_data; 219 struct omap_mmc_platform_data *mmc = dev->platform_data;
@@ -245,7 +245,14 @@ static int twl_mmc1_set_power(struct device *dev, int slot, int power_on,
245 } 245 }
246 246
247 reg = omap_ctrl_readl(control_pbias_offset); 247 reg = omap_ctrl_readl(control_pbias_offset);
248 reg |= OMAP2_PBIASSPEEDCTRL0; 248 if (cpu_is_omap3630()) {
249 /* Set MMC I/O to 52Mhz */
250 prog_io = omap_ctrl_readl(OMAP343X_CONTROL_PROG_IO1);
251 prog_io |= OMAP3630_PRG_SDMMC1_SPEEDCTRL;
252 omap_ctrl_writel(prog_io, OMAP343X_CONTROL_PROG_IO1);
253 } else {
254 reg |= OMAP2_PBIASSPEEDCTRL0;
255 }
249 reg &= ~OMAP2_PBIASLITEPWRDNZ0; 256 reg &= ~OMAP2_PBIASLITEPWRDNZ0;
250 omap_ctrl_writel(reg, control_pbias_offset); 257 omap_ctrl_writel(reg, control_pbias_offset);
251 258
@@ -489,6 +496,12 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers)
489 /* on-chip level shifting via PBIAS0/PBIAS1 */ 496 /* on-chip level shifting via PBIAS0/PBIAS1 */
490 mmc->slots[0].set_power = twl_mmc1_set_power; 497 mmc->slots[0].set_power = twl_mmc1_set_power;
491 mmc->slots[0].set_sleep = twl_mmc1_set_sleep; 498 mmc->slots[0].set_sleep = twl_mmc1_set_sleep;
499
500 /* Omap3630 HSMMC1 supports only 4-bit */
501 if (cpu_is_omap3630() && c->wires > 4) {
502 c->wires = 4;
503 mmc->slots[0].wires = c->wires;
504 }
492 break; 505 break;
493 case 2: 506 case 2:
494 if (c->ext_clock) 507 if (c->ext_clock)
diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c
index b5fac32aae70..c18a94eca641 100644
--- a/arch/arm/mach-omap2/mux.c
+++ b/arch/arm/mach-omap2/mux.c
@@ -30,8 +30,8 @@
30 30
31#include <asm/system.h> 31#include <asm/system.h>
32 32
33#include <mach/control.h> 33#include <plat/control.h>
34#include <mach/mux.h> 34#include <plat/mux.h>
35 35
36#ifdef CONFIG_OMAP_MUX 36#ifdef CONFIG_OMAP_MUX
37 37
@@ -532,6 +532,14 @@ MUX_CFG_34XX("AG4_3430_MMC2_DAT2", 0x160,
532 OMAP34XX_MUX_MODE0 | OMAP34XX_PIN_INPUT_PULLUP) 532 OMAP34XX_MUX_MODE0 | OMAP34XX_PIN_INPUT_PULLUP)
533MUX_CFG_34XX("AF4_3430_MMC2_DAT3", 0x162, 533MUX_CFG_34XX("AF4_3430_MMC2_DAT3", 0x162,
534 OMAP34XX_MUX_MODE0 | OMAP34XX_PIN_INPUT_PULLUP) 534 OMAP34XX_MUX_MODE0 | OMAP34XX_PIN_INPUT_PULLUP)
535MUX_CFG_34XX("AE4_3430_MMC2_DAT4", 0x164,
536 OMAP34XX_MUX_MODE0 | OMAP34XX_PIN_INPUT_PULLUP)
537MUX_CFG_34XX("AH3_3430_MMC2_DAT5", 0x166,
538 OMAP34XX_MUX_MODE0 | OMAP34XX_PIN_INPUT_PULLUP)
539MUX_CFG_34XX("AF3_3430_MMC2_DAT6", 0x168,
540 OMAP34XX_MUX_MODE0 | OMAP34XX_PIN_INPUT_PULLUP)
541MUX_CFG_34XX("AE3_3430_MMC2_DAT7", 0x16A,
542 OMAP34XX_MUX_MODE0 | OMAP34XX_PIN_INPUT_PULLUP)
535 543
536/* MMC3 */ 544/* MMC3 */
537MUX_CFG_34XX("AF10_3430_MMC3_CLK", 0x5d8, 545MUX_CFG_34XX("AF10_3430_MMC3_CLK", 0x5d8,
@@ -551,6 +559,13 @@ MUX_CFG_34XX("AF13_3430_MMC3_DAT3", 0x5e2,
551MUX_CFG_34XX("AF26_34XX_SYS_NIRQ", 0x1E0, 559MUX_CFG_34XX("AF26_34XX_SYS_NIRQ", 0x1E0,
552 OMAP3_WAKEUP_EN | OMAP34XX_PIN_INPUT_PULLUP | 560 OMAP3_WAKEUP_EN | OMAP34XX_PIN_INPUT_PULLUP |
553 OMAP34XX_MUX_MODE0) 561 OMAP34XX_MUX_MODE0)
562/* EHCI GPIO's on OMAP3EVM (Rev >= E) */
563MUX_CFG_34XX("AH14_34XX_GPIO21", 0x5ea,
564 OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT_PULLUP)
565MUX_CFG_34XX("AF9_34XX_GPIO22", 0x5ec,
566 OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT_PULLUP)
567MUX_CFG_34XX("U3_34XX_GPIO61", 0x0c8,
568 OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT_PULLUP)
554}; 569};
555 570
556#define OMAP34XX_PINS_SZ ARRAY_SIZE(omap34xx_pins) 571#define OMAP34XX_PINS_SZ ARRAY_SIZE(omap34xx_pins)
diff --git a/arch/arm/mach-omap2/omap-smp.c b/arch/arm/mach-omap2/omap-smp.c
index 48ee295db275..4890bcf4dadd 100644
--- a/arch/arm/mach-omap2/omap-smp.c
+++ b/arch/arm/mach-omap2/omap-smp.c
@@ -24,13 +24,14 @@
24#include <asm/localtimer.h> 24#include <asm/localtimer.h>
25#include <asm/smp_scu.h> 25#include <asm/smp_scu.h>
26#include <mach/hardware.h> 26#include <mach/hardware.h>
27#include <plat/common.h>
27 28
28/* Registers used for communicating startup information */ 29/* Registers used for communicating startup information */
29#define OMAP4_AUXCOREBOOT_REG0 (OMAP44XX_VA_WKUPGEN_BASE + 0x800) 30static void __iomem *omap4_auxcoreboot_reg0;
30#define OMAP4_AUXCOREBOOT_REG1 (OMAP44XX_VA_WKUPGEN_BASE + 0x804) 31static void __iomem *omap4_auxcoreboot_reg1;
31 32
32/* SCU base address */ 33/* SCU base address */
33static void __iomem *scu_base = OMAP44XX_VA_SCU_BASE; 34static void __iomem *scu_base;
34 35
35/* 36/*
36 * Use SCU config register to count number of cores 37 * Use SCU config register to count number of cores
@@ -53,8 +54,7 @@ void __cpuinit platform_secondary_init(unsigned int cpu)
53 * core (e.g. timer irq), then they will not have been enabled 54 * core (e.g. timer irq), then they will not have been enabled
54 * for us: do so 55 * for us: do so
55 */ 56 */
56 57 gic_cpu_init(0, gic_cpu_base_addr);
57 gic_cpu_init(0, OMAP2_IO_ADDRESS(OMAP44XX_GIC_CPU_BASE));
58 58
59 /* 59 /*
60 * Synchronise with the boot thread. 60 * Synchronise with the boot thread.
@@ -79,7 +79,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
79 * the AuxCoreBoot1 register is updated with cpu state 79 * the AuxCoreBoot1 register is updated with cpu state
80 * A barrier is added to ensure that write buffer is drained 80 * A barrier is added to ensure that write buffer is drained
81 */ 81 */
82 __raw_writel(cpu, OMAP4_AUXCOREBOOT_REG1); 82 __raw_writel(cpu, omap4_auxcoreboot_reg1);
83 smp_wmb(); 83 smp_wmb();
84 84
85 timeout = jiffies + (1 * HZ); 85 timeout = jiffies + (1 * HZ);
@@ -104,7 +104,7 @@ static void __init wakeup_secondary(void)
104 * A barrier is added to ensure that write buffer is drained 104 * A barrier is added to ensure that write buffer is drained
105 */ 105 */
106 __raw_writel(virt_to_phys(omap_secondary_startup), \ 106 __raw_writel(virt_to_phys(omap_secondary_startup), \
107 OMAP4_AUXCOREBOOT_REG0); 107 omap4_auxcoreboot_reg0);
108 smp_wmb(); 108 smp_wmb();
109 109
110 /* 110 /*
@@ -120,7 +120,13 @@ static void __init wakeup_secondary(void)
120 */ 120 */
121void __init smp_init_cpus(void) 121void __init smp_init_cpus(void)
122{ 122{
123 unsigned int i, ncores = get_core_count(); 123 unsigned int i, ncores;
124
125 /* Never released */
126 scu_base = ioremap(OMAP44XX_SCU_BASE, SZ_256);
127 BUG_ON(!scu_base);
128
129 ncores = get_core_count();
124 130
125 for (i = 0; i < ncores; i++) 131 for (i = 0; i < ncores; i++)
126 set_cpu_possible(i, true); 132 set_cpu_possible(i, true);
@@ -130,6 +136,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
130{ 136{
131 unsigned int ncores = get_core_count(); 137 unsigned int ncores = get_core_count();
132 unsigned int cpu = smp_processor_id(); 138 unsigned int cpu = smp_processor_id();
139 void __iomem *omap4_wkupgen_base;
133 int i; 140 int i;
134 141
135 /* sanity check */ 142 /* sanity check */
@@ -161,6 +168,12 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
161 for (i = 0; i < max_cpus; i++) 168 for (i = 0; i < max_cpus; i++)
162 set_cpu_present(i, true); 169 set_cpu_present(i, true);
163 170
171 /* Never released */
172 omap4_wkupgen_base = ioremap(OMAP44XX_WKUPGEN_BASE, SZ_4K);
173 BUG_ON(!omap4_wkupgen_base);
174 omap4_auxcoreboot_reg0 = omap4_wkupgen_base + 0x800;
175 omap4_auxcoreboot_reg1 = omap4_wkupgen_base + 0x804;
176
164 if (max_cpus > 1) { 177 if (max_cpus > 1) {
165 /* 178 /*
166 * Enable the local timer or broadcast device for the 179 * Enable the local timer or broadcast device for the
diff --git a/arch/arm/mach-omap2/omap3-iommu.c b/arch/arm/mach-omap2/omap3-iommu.c
index 194189c746c2..fbbcb5c83367 100644
--- a/arch/arm/mach-omap2/omap3-iommu.c
+++ b/arch/arm/mach-omap2/omap3-iommu.c
@@ -12,49 +12,52 @@
12 12
13#include <linux/platform_device.h> 13#include <linux/platform_device.h>
14 14
15#include <mach/iommu.h> 15#include <plat/iommu.h>
16 16
17#define OMAP3_MMU1_BASE 0x480bd400 17struct iommu_device {
18#define OMAP3_MMU2_BASE 0x5d000000 18 resource_size_t base;
19#define OMAP3_MMU1_IRQ 24 19 int irq;
20#define OMAP3_MMU2_IRQ 28 20 struct iommu_platform_data pdata;
21 21 struct resource res[2];
22
23static unsigned long iommu_base[] __initdata = {
24 OMAP3_MMU1_BASE,
25 OMAP3_MMU2_BASE,
26};
27
28static int iommu_irq[] __initdata = {
29 OMAP3_MMU1_IRQ,
30 OMAP3_MMU2_IRQ,
31}; 22};
32 23
33static const struct iommu_platform_data omap3_iommu_pdata[] __initconst = { 24static struct iommu_device devices[] = {
34 { 25 {
35 .name = "isp", 26 .base = 0x480bd400,
36 .nr_tlb_entries = 8, 27 .irq = 24,
37 .clk_name = "cam_ick", 28 .pdata = {
29 .name = "isp",
30 .nr_tlb_entries = 8,
31 .clk_name = "cam_ick",
32 },
38 }, 33 },
39#if defined(CONFIG_MPU_BRIDGE_IOMMU) 34#if defined(CONFIG_MPU_BRIDGE_IOMMU)
40 { 35 {
41 .name = "iva2", 36 .base = 0x5d000000,
42 .nr_tlb_entries = 32, 37 .irq = 28,
43 .clk_name = "iva2_ck", 38 .pdata = {
39 .name = "iva2",
40 .nr_tlb_entries = 32,
41 .clk_name = "iva2_ck",
42 },
44 }, 43 },
45#endif 44#endif
46}; 45};
47#define NR_IOMMU_DEVICES ARRAY_SIZE(omap3_iommu_pdata) 46#define NR_IOMMU_DEVICES ARRAY_SIZE(devices)
48 47
49static struct platform_device *omap3_iommu_pdev[NR_IOMMU_DEVICES]; 48static struct platform_device *omap3_iommu_pdev[NR_IOMMU_DEVICES];
50 49
51static int __init omap3_iommu_init(void) 50static int __init omap3_iommu_init(void)
52{ 51{
53 int i, err; 52 int i, err;
53 struct resource res[] = {
54 { .flags = IORESOURCE_MEM },
55 { .flags = IORESOURCE_IRQ },
56 };
54 57
55 for (i = 0; i < NR_IOMMU_DEVICES; i++) { 58 for (i = 0; i < NR_IOMMU_DEVICES; i++) {
56 struct platform_device *pdev; 59 struct platform_device *pdev;
57 struct resource res[2]; 60 const struct iommu_device *d = &devices[i];
58 61
59 pdev = platform_device_alloc("omap-iommu", i); 62 pdev = platform_device_alloc("omap-iommu", i);
60 if (!pdev) { 63 if (!pdev) {
@@ -62,19 +65,16 @@ static int __init omap3_iommu_init(void)
62 goto err_out; 65 goto err_out;
63 } 66 }
64 67
65 memset(res, 0, sizeof(res)); 68 res[0].start = d->base;
66 res[0].start = iommu_base[i]; 69 res[0].end = d->base + MMU_REG_SIZE - 1;
67 res[0].end = iommu_base[i] + MMU_REG_SIZE - 1; 70 res[1].start = res[1].end = d->irq;
68 res[0].flags = IORESOURCE_MEM;
69 res[1].start = res[1].end = iommu_irq[i];
70 res[1].flags = IORESOURCE_IRQ;
71 71
72 err = platform_device_add_resources(pdev, res, 72 err = platform_device_add_resources(pdev, res,
73 ARRAY_SIZE(res)); 73 ARRAY_SIZE(res));
74 if (err) 74 if (err)
75 goto err_out; 75 goto err_out;
76 err = platform_device_add_data(pdev, &omap3_iommu_pdata[i], 76 err = platform_device_add_data(pdev, &d->pdata,
77 sizeof(omap3_iommu_pdata[0])); 77 sizeof(d->pdata));
78 if (err) 78 if (err)
79 goto err_out; 79 goto err_out;
80 err = platform_device_add(pdev); 80 err = platform_device_add(pdev);
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index d2e0f1c95961..633b216a8b26 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -45,11 +45,11 @@
45#include <linux/mutex.h> 45#include <linux/mutex.h>
46#include <linux/bootmem.h> 46#include <linux/bootmem.h>
47 47
48#include <mach/cpu.h> 48#include <plat/cpu.h>
49#include <mach/clockdomain.h> 49#include <plat/clockdomain.h>
50#include <mach/powerdomain.h> 50#include <plat/powerdomain.h>
51#include <mach/clock.h> 51#include <plat/clock.h>
52#include <mach/omap_hwmod.h> 52#include <plat/omap_hwmod.h>
53 53
54#include "cm.h" 54#include "cm.h"
55 55
@@ -496,6 +496,7 @@ static void __iomem *_find_mpu_rt_base(struct omap_hwmod *oh, u8 index)
496 struct omap_hwmod_addr_space *mem; 496 struct omap_hwmod_addr_space *mem;
497 int i; 497 int i;
498 int found = 0; 498 int found = 0;
499 void __iomem *va_start;
499 500
500 if (!oh || oh->slaves_cnt == 0) 501 if (!oh || oh->slaves_cnt == 0)
501 return NULL; 502 return NULL;
@@ -509,16 +510,20 @@ static void __iomem *_find_mpu_rt_base(struct omap_hwmod *oh, u8 index)
509 } 510 }
510 } 511 }
511 512
512 /* XXX use ioremap() instead? */ 513 if (found) {
513 514 va_start = ioremap(mem->pa_start, mem->pa_end - mem->pa_start);
514 if (found) 515 if (!va_start) {
516 pr_err("omap_hwmod: %s: Could not ioremap\n", oh->name);
517 return NULL;
518 }
515 pr_debug("omap_hwmod: %s: MPU register target at va %p\n", 519 pr_debug("omap_hwmod: %s: MPU register target at va %p\n",
516 oh->name, OMAP2_IO_ADDRESS(mem->pa_start)); 520 oh->name, va_start);
517 else 521 } else {
518 pr_debug("omap_hwmod: %s: no MPU register target found\n", 522 pr_debug("omap_hwmod: %s: no MPU register target found\n",
519 oh->name); 523 oh->name);
524 }
520 525
521 return (found) ? OMAP2_IO_ADDRESS(mem->pa_start) : NULL; 526 return (found) ? va_start : NULL;
522} 527}
523 528
524/** 529/**
@@ -1148,6 +1153,7 @@ int omap_hwmod_unregister(struct omap_hwmod *oh)
1148 pr_debug("omap_hwmod: %s: unregistering\n", oh->name); 1153 pr_debug("omap_hwmod: %s: unregistering\n", oh->name);
1149 1154
1150 mutex_lock(&omap_hwmod_mutex); 1155 mutex_lock(&omap_hwmod_mutex);
1156 iounmap(oh->_rt_va);
1151 list_del(&oh->node); 1157 list_del(&oh->node);
1152 mutex_unlock(&omap_hwmod_mutex); 1158 mutex_unlock(&omap_hwmod_mutex);
1153 1159
diff --git a/arch/arm/mach-omap2/omap_hwmod_2420.h b/arch/arm/mach-omap2/omap_hwmod_2420.h
index 767e4965ac4e..a9ca1b99a301 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2420.h
+++ b/arch/arm/mach-omap2/omap_hwmod_2420.h
@@ -16,10 +16,10 @@
16 16
17#ifdef CONFIG_ARCH_OMAP2420 17#ifdef CONFIG_ARCH_OMAP2420
18 18
19#include <mach/omap_hwmod.h> 19#include <plat/omap_hwmod.h>
20#include <mach/irqs.h> 20#include <mach/irqs.h>
21#include <mach/cpu.h> 21#include <plat/cpu.h>
22#include <mach/dma.h> 22#include <plat/dma.h>
23 23
24#include "prm-regbits-24xx.h" 24#include "prm-regbits-24xx.h"
25 25
diff --git a/arch/arm/mach-omap2/omap_hwmod_2430.h b/arch/arm/mach-omap2/omap_hwmod_2430.h
index a412be6420ec..59a208bea6c2 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2430.h
+++ b/arch/arm/mach-omap2/omap_hwmod_2430.h
@@ -16,10 +16,10 @@
16 16
17#ifdef CONFIG_ARCH_OMAP2430 17#ifdef CONFIG_ARCH_OMAP2430
18 18
19#include <mach/omap_hwmod.h> 19#include <plat/omap_hwmod.h>
20#include <mach/irqs.h> 20#include <mach/irqs.h>
21#include <mach/cpu.h> 21#include <plat/cpu.h>
22#include <mach/dma.h> 22#include <plat/dma.h>
23 23
24#include "prm-regbits-24xx.h" 24#include "prm-regbits-24xx.h"
25 25
diff --git a/arch/arm/mach-omap2/omap_hwmod_34xx.h b/arch/arm/mach-omap2/omap_hwmod_34xx.h
index 1e069f831575..b6076b9c364e 100644
--- a/arch/arm/mach-omap2/omap_hwmod_34xx.h
+++ b/arch/arm/mach-omap2/omap_hwmod_34xx.h
@@ -14,10 +14,10 @@
14 14
15#ifdef CONFIG_ARCH_OMAP34XX 15#ifdef CONFIG_ARCH_OMAP34XX
16 16
17#include <mach/omap_hwmod.h> 17#include <plat/omap_hwmod.h>
18#include <mach/irqs.h> 18#include <mach/irqs.h>
19#include <mach/cpu.h> 19#include <plat/cpu.h>
20#include <mach/dma.h> 20#include <plat/dma.h>
21 21
22#include "prm-regbits-34xx.h" 22#include "prm-regbits-34xx.h"
23 23
diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c
index 2fc4d6abbd0a..8baa30d2acfb 100644
--- a/arch/arm/mach-omap2/pm-debug.c
+++ b/arch/arm/mach-omap2/pm-debug.c
@@ -26,10 +26,10 @@
26#include <linux/io.h> 26#include <linux/io.h>
27#include <linux/module.h> 27#include <linux/module.h>
28 28
29#include <mach/clock.h> 29#include <plat/clock.h>
30#include <mach/board.h> 30#include <plat/board.h>
31#include <mach/powerdomain.h> 31#include <plat/powerdomain.h>
32#include <mach/clockdomain.h> 32#include <plat/clockdomain.h>
33 33
34#include "prm.h" 34#include "prm.h"
35#include "cm.h" 35#include "cm.h"
@@ -51,7 +51,8 @@ int omap2_pm_debug;
51 regs[reg_count++].val = __raw_readl(reg) 51 regs[reg_count++].val = __raw_readl(reg)
52#define DUMP_INTC_REG(reg, off) \ 52#define DUMP_INTC_REG(reg, off) \
53 regs[reg_count].name = #reg; \ 53 regs[reg_count].name = #reg; \
54 regs[reg_count++].val = __raw_readl(OMAP2_IO_ADDRESS(0x480fe000 + (off))) 54 regs[reg_count++].val = \
55 __raw_readl(OMAP2_L4_IO_ADDRESS(0x480fe000 + (off)))
55 56
56static int __init pm_dbg_init(void); 57static int __init pm_dbg_init(void);
57 58
@@ -526,6 +527,29 @@ static int __init pwrdms_setup(struct powerdomain *pwrdm, void *dir)
526 return 0; 527 return 0;
527} 528}
528 529
530static int option_get(void *data, u64 *val)
531{
532 u32 *option = data;
533
534 *val = *option;
535
536 return 0;
537}
538
539static int option_set(void *data, u64 val)
540{
541 u32 *option = data;
542
543 *option = val;
544
545 if (option == &enable_off_mode)
546 omap3_pm_off_mode_enable(val);
547
548 return 0;
549}
550
551DEFINE_SIMPLE_ATTRIBUTE(pm_dbg_option_fops, option_get, option_set, "%llu\n");
552
529static int __init pm_dbg_init(void) 553static int __init pm_dbg_init(void)
530{ 554{
531 int i; 555 int i;
@@ -568,6 +592,12 @@ static int __init pm_dbg_init(void)
568 592
569 } 593 }
570 594
595 (void) debugfs_create_file("enable_off_mode", S_IRUGO | S_IWUGO, d,
596 &enable_off_mode, &pm_dbg_option_fops);
597 (void) debugfs_create_file("sleep_while_idle", S_IRUGO | S_IWUGO, d,
598 &sleep_while_idle, &pm_dbg_option_fops);
599 (void) debugfs_create_file("wakeup_timer_seconds", S_IRUGO | S_IWUGO, d,
600 &wakeup_timer_seconds, &pm_dbg_option_fops);
571 pm_dbg_init_done = 1; 601 pm_dbg_init_done = 1;
572 602
573 return 0; 603 return 0;
diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h
index 8400f5768923..0bf345db7147 100644
--- a/arch/arm/mach-omap2/pm.h
+++ b/arch/arm/mach-omap2/pm.h
@@ -11,11 +11,24 @@
11#ifndef __ARCH_ARM_MACH_OMAP2_PM_H 11#ifndef __ARCH_ARM_MACH_OMAP2_PM_H
12#define __ARCH_ARM_MACH_OMAP2_PM_H 12#define __ARCH_ARM_MACH_OMAP2_PM_H
13 13
14#include <mach/powerdomain.h> 14#include <plat/powerdomain.h>
15
16extern u32 enable_off_mode;
17extern u32 sleep_while_idle;
18
19extern void *omap3_secure_ram_storage;
20extern void omap3_pm_off_mode_enable(int);
21extern void omap_sram_idle(void);
22extern int omap3_can_sleep(void);
23extern int set_pwrdm_state(struct powerdomain *pwrdm, u32 state);
24extern int omap3_idle_init(void);
15 25
16extern int omap3_pm_get_suspend_state(struct powerdomain *pwrdm); 26extern int omap3_pm_get_suspend_state(struct powerdomain *pwrdm);
17extern int omap3_pm_set_suspend_state(struct powerdomain *pwrdm, int state); 27extern int omap3_pm_set_suspend_state(struct powerdomain *pwrdm, int state);
18 28
29extern u32 wakeup_timer_seconds;
30extern struct omap_dm_timer *gptimer_wakeup;
31
19#ifdef CONFIG_PM_DEBUG 32#ifdef CONFIG_PM_DEBUG
20extern void omap2_pm_dump(int mode, int resume, unsigned int us); 33extern void omap2_pm_dump(int mode, int resume, unsigned int us);
21extern int omap2_pm_debug; 34extern int omap2_pm_debug;
@@ -36,6 +49,7 @@ extern void omap24xx_cpu_suspend(u32 dll_ctrl, void __iomem *sdrc_dlla_ctrl,
36 void __iomem *sdrc_power); 49 void __iomem *sdrc_power);
37extern void omap34xx_cpu_suspend(u32 *addr, int save_state); 50extern void omap34xx_cpu_suspend(u32 *addr, int save_state);
38extern void save_secure_ram_context(u32 *addr); 51extern void save_secure_ram_context(u32 *addr);
52extern void omap3_save_scratchpad_contents(void);
39 53
40extern unsigned int omap24xx_idle_loop_suspend_sz; 54extern unsigned int omap24xx_idle_loop_suspend_sz;
41extern unsigned int omap34xx_suspend_sz; 55extern unsigned int omap34xx_suspend_sz;
diff --git a/arch/arm/mach-omap2/pm24xx.c b/arch/arm/mach-omap2/pm24xx.c
index bff5c4e89742..cba05b9f041f 100644
--- a/arch/arm/mach-omap2/pm24xx.c
+++ b/arch/arm/mach-omap2/pm24xx.c
@@ -36,12 +36,12 @@
36#include <asm/mach-types.h> 36#include <asm/mach-types.h>
37 37
38#include <mach/irqs.h> 38#include <mach/irqs.h>
39#include <mach/clock.h> 39#include <plat/clock.h>
40#include <mach/sram.h> 40#include <plat/sram.h>
41#include <mach/control.h> 41#include <plat/control.h>
42#include <mach/mux.h> 42#include <plat/mux.h>
43#include <mach/dma.h> 43#include <plat/dma.h>
44#include <mach/board.h> 44#include <plat/board.h>
45 45
46#include "prm.h" 46#include "prm.h"
47#include "prm-regbits-24xx.h" 47#include "prm-regbits-24xx.h"
@@ -50,8 +50,8 @@
50#include "sdrc.h" 50#include "sdrc.h"
51#include "pm.h" 51#include "pm.h"
52 52
53#include <mach/powerdomain.h> 53#include <plat/powerdomain.h>
54#include <mach/clockdomain.h> 54#include <plat/clockdomain.h>
55 55
56static void (*omap2_sram_idle)(void); 56static void (*omap2_sram_idle)(void);
57static void (*omap2_sram_suspend)(u32 dllctrl, void __iomem *sdrc_dlla_ctrl, 57static void (*omap2_sram_suspend)(u32 dllctrl, void __iomem *sdrc_dlla_ctrl,
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 89463190923a..81ed252a0f8a 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -5,6 +5,9 @@
5 * Tony Lindgren <tony@atomide.com> 5 * Tony Lindgren <tony@atomide.com>
6 * Jouni Hogander 6 * Jouni Hogander
7 * 7 *
8 * Copyright (C) 2007 Texas Instruments, Inc.
9 * Rajendra Nayak <rnayak@ti.com>
10 *
8 * Copyright (C) 2005 Texas Instruments, Inc. 11 * Copyright (C) 2005 Texas Instruments, Inc.
9 * Richard Woodruff <r-woodruff2@ti.com> 12 * Richard Woodruff <r-woodruff2@ti.com>
10 * 13 *
@@ -22,12 +25,20 @@
22#include <linux/list.h> 25#include <linux/list.h>
23#include <linux/err.h> 26#include <linux/err.h>
24#include <linux/gpio.h> 27#include <linux/gpio.h>
28#include <linux/clk.h>
29
30#include <plat/sram.h>
31#include <plat/clockdomain.h>
32#include <plat/powerdomain.h>
33#include <plat/control.h>
34#include <plat/serial.h>
35#include <plat/sdrc.h>
36#include <plat/prcm.h>
37#include <plat/gpmc.h>
38#include <plat/dma.h>
39#include <plat/dmtimer.h>
25 40
26#include <mach/sram.h> 41#include <asm/tlbflush.h>
27#include <mach/clockdomain.h>
28#include <mach/powerdomain.h>
29#include <mach/control.h>
30#include <mach/serial.h>
31 42
32#include "cm.h" 43#include "cm.h"
33#include "cm-regbits-34xx.h" 44#include "cm-regbits-34xx.h"
@@ -35,6 +46,16 @@
35 46
36#include "prm.h" 47#include "prm.h"
37#include "pm.h" 48#include "pm.h"
49#include "sdrc.h"
50
51/* Scratchpad offsets */
52#define OMAP343X_TABLE_ADDRESS_OFFSET 0x31
53#define OMAP343X_TABLE_VALUE_OFFSET 0x30
54#define OMAP343X_CONTROL_REG_VALUE_OFFSET 0x32
55
56u32 enable_off_mode;
57u32 sleep_while_idle;
58u32 wakeup_timer_seconds;
38 59
39struct power_state { 60struct power_state {
40 struct powerdomain *pwrdm; 61 struct powerdomain *pwrdm;
@@ -49,7 +70,112 @@ static LIST_HEAD(pwrst_list);
49 70
50static void (*_omap_sram_idle)(u32 *addr, int save_state); 71static void (*_omap_sram_idle)(u32 *addr, int save_state);
51 72
52static struct powerdomain *mpu_pwrdm; 73static int (*_omap_save_secure_sram)(u32 *addr);
74
75static struct powerdomain *mpu_pwrdm, *neon_pwrdm;
76static struct powerdomain *core_pwrdm, *per_pwrdm;
77static struct powerdomain *cam_pwrdm;
78
79static inline void omap3_per_save_context(void)
80{
81 omap_gpio_save_context();
82}
83
84static inline void omap3_per_restore_context(void)
85{
86 omap_gpio_restore_context();
87}
88
89static void omap3_enable_io_chain(void)
90{
91 int timeout = 0;
92
93 if (omap_rev() >= OMAP3430_REV_ES3_1) {
94 prm_set_mod_reg_bits(OMAP3430_EN_IO_CHAIN, WKUP_MOD, PM_WKEN);
95 /* Do a readback to assure write has been done */
96 prm_read_mod_reg(WKUP_MOD, PM_WKEN);
97
98 while (!(prm_read_mod_reg(WKUP_MOD, PM_WKST) &
99 OMAP3430_ST_IO_CHAIN)) {
100 timeout++;
101 if (timeout > 1000) {
102 printk(KERN_ERR "Wake up daisy chain "
103 "activation failed.\n");
104 return;
105 }
106 prm_set_mod_reg_bits(OMAP3430_ST_IO_CHAIN,
107 WKUP_MOD, PM_WKST);
108 }
109 }
110}
111
112static void omap3_disable_io_chain(void)
113{
114 if (omap_rev() >= OMAP3430_REV_ES3_1)
115 prm_clear_mod_reg_bits(OMAP3430_EN_IO_CHAIN, WKUP_MOD, PM_WKEN);
116}
117
118static void omap3_core_save_context(void)
119{
120 u32 control_padconf_off;
121
122 /* Save the padconf registers */
123 control_padconf_off = omap_ctrl_readl(OMAP343X_CONTROL_PADCONF_OFF);
124 control_padconf_off |= START_PADCONF_SAVE;
125 omap_ctrl_writel(control_padconf_off, OMAP343X_CONTROL_PADCONF_OFF);
126 /* wait for the save to complete */
127 while (!omap_ctrl_readl(OMAP343X_CONTROL_GENERAL_PURPOSE_STATUS)
128 & PADCONF_SAVE_DONE)
129 ;
130 /* Save the Interrupt controller context */
131 omap_intc_save_context();
132 /* Save the GPMC context */
133 omap3_gpmc_save_context();
134 /* Save the system control module context, padconf already save above*/
135 omap3_control_save_context();
136 omap_dma_global_context_save();
137}
138
139static void omap3_core_restore_context(void)
140{
141 /* Restore the control module context, padconf restored by h/w */
142 omap3_control_restore_context();
143 /* Restore the GPMC context */
144 omap3_gpmc_restore_context();
145 /* Restore the interrupt controller context */
146 omap_intc_restore_context();
147 omap_dma_global_context_restore();
148}
149
150/*
151 * FIXME: This function should be called before entering off-mode after
152 * OMAP3 secure services have been accessed. Currently it is only called
153 * once during boot sequence, but this works as we are not using secure
154 * services.
155 */
156static void omap3_save_secure_ram_context(u32 target_mpu_state)
157{
158 u32 ret;
159
160 if (omap_type() != OMAP2_DEVICE_TYPE_GP) {
161 /*
162 * MPU next state must be set to POWER_ON temporarily,
163 * otherwise the WFI executed inside the ROM code
164 * will hang the system.
165 */
166 pwrdm_set_next_pwrst(mpu_pwrdm, PWRDM_POWER_ON);
167 ret = _omap_save_secure_sram((u32 *)
168 __pa(omap3_secure_ram_storage));
169 pwrdm_set_next_pwrst(mpu_pwrdm, target_mpu_state);
170 /* Following is for error tracking, it should not happen */
171 if (ret) {
172 printk(KERN_ERR "save_secure_sram() returns %08x\n",
173 ret);
174 while (1)
175 ;
176 }
177 }
178}
53 179
54/* 180/*
55 * PRCM Interrupt Handler Helper Function 181 * PRCM Interrupt Handler Helper Function
@@ -161,7 +287,36 @@ static irqreturn_t prcm_interrupt_handler (int irq, void *dev_id)
161 return IRQ_HANDLED; 287 return IRQ_HANDLED;
162} 288}
163 289
164static void omap_sram_idle(void) 290static void restore_control_register(u32 val)
291{
292 __asm__ __volatile__ ("mcr p15, 0, %0, c1, c0, 0" : : "r" (val));
293}
294
295/* Function to restore the table entry that was modified for enabling MMU */
296static void restore_table_entry(void)
297{
298 u32 *scratchpad_address;
299 u32 previous_value, control_reg_value;
300 u32 *address;
301
302 scratchpad_address = OMAP2_L4_IO_ADDRESS(OMAP343X_SCRATCHPAD);
303
304 /* Get address of entry that was modified */
305 address = (u32 *)__raw_readl(scratchpad_address +
306 OMAP343X_TABLE_ADDRESS_OFFSET);
307 /* Get the previous value which needs to be restored */
308 previous_value = __raw_readl(scratchpad_address +
309 OMAP343X_TABLE_VALUE_OFFSET);
310 address = __va(address);
311 *address = previous_value;
312 flush_tlb_all();
313 control_reg_value = __raw_readl(scratchpad_address
314 + OMAP343X_CONTROL_REG_VALUE_OFFSET);
315 /* This will enable caches and prediction */
316 restore_control_register(control_reg_value);
317}
318
319void omap_sram_idle(void)
165{ 320{
166 /* Variable to tell what needs to be saved and restored 321 /* Variable to tell what needs to be saved and restored
167 * in omap_sram_idle*/ 322 * in omap_sram_idle*/
@@ -169,17 +324,32 @@ static void omap_sram_idle(void)
169 /* save_state = 1 => Only L1 and logic lost */ 324 /* save_state = 1 => Only L1 and logic lost */
170 /* save_state = 2 => Only L2 lost */ 325 /* save_state = 2 => Only L2 lost */
171 /* save_state = 3 => L1, L2 and logic lost */ 326 /* save_state = 3 => L1, L2 and logic lost */
172 int save_state = 0, mpu_next_state; 327 int save_state = 0;
328 int mpu_next_state = PWRDM_POWER_ON;
329 int per_next_state = PWRDM_POWER_ON;
330 int core_next_state = PWRDM_POWER_ON;
331 int core_prev_state, per_prev_state;
332 u32 sdrc_pwr = 0;
333 int per_state_modified = 0;
173 334
174 if (!_omap_sram_idle) 335 if (!_omap_sram_idle)
175 return; 336 return;
176 337
338 pwrdm_clear_all_prev_pwrst(mpu_pwrdm);
339 pwrdm_clear_all_prev_pwrst(neon_pwrdm);
340 pwrdm_clear_all_prev_pwrst(core_pwrdm);
341 pwrdm_clear_all_prev_pwrst(per_pwrdm);
342
177 mpu_next_state = pwrdm_read_next_pwrst(mpu_pwrdm); 343 mpu_next_state = pwrdm_read_next_pwrst(mpu_pwrdm);
178 switch (mpu_next_state) { 344 switch (mpu_next_state) {
345 case PWRDM_POWER_ON:
179 case PWRDM_POWER_RET: 346 case PWRDM_POWER_RET:
180 /* No need to save context */ 347 /* No need to save context */
181 save_state = 0; 348 save_state = 0;
182 break; 349 break;
350 case PWRDM_POWER_OFF:
351 save_state = 3;
352 break;
183 default: 353 default:
184 /* Invalid state */ 354 /* Invalid state */
185 printk(KERN_ERR "Invalid mpu state in sram_idle\n"); 355 printk(KERN_ERR "Invalid mpu state in sram_idle\n");
@@ -187,68 +357,115 @@ static void omap_sram_idle(void)
187 } 357 }
188 pwrdm_pre_transition(); 358 pwrdm_pre_transition();
189 359
190 omap2_gpio_prepare_for_retention(); 360 /* NEON control */
191 omap_uart_prepare_idle(0); 361 if (pwrdm_read_pwrst(neon_pwrdm) == PWRDM_POWER_ON)
192 omap_uart_prepare_idle(1); 362 pwrdm_set_next_pwrst(neon_pwrdm, mpu_next_state);
193 omap_uart_prepare_idle(2); 363
364 /* PER */
365 per_next_state = pwrdm_read_next_pwrst(per_pwrdm);
366 core_next_state = pwrdm_read_next_pwrst(core_pwrdm);
367 if (per_next_state < PWRDM_POWER_ON) {
368 omap_uart_prepare_idle(2);
369 omap2_gpio_prepare_for_retention();
370 if (per_next_state == PWRDM_POWER_OFF) {
371 if (core_next_state == PWRDM_POWER_ON) {
372 per_next_state = PWRDM_POWER_RET;
373 pwrdm_set_next_pwrst(per_pwrdm, per_next_state);
374 per_state_modified = 1;
375 } else
376 omap3_per_save_context();
377 }
378 }
379
380 if (pwrdm_read_pwrst(cam_pwrdm) == PWRDM_POWER_ON)
381 omap2_clkdm_deny_idle(mpu_pwrdm->pwrdm_clkdms[0]);
382
383 /* CORE */
384 if (core_next_state < PWRDM_POWER_ON) {
385 omap_uart_prepare_idle(0);
386 omap_uart_prepare_idle(1);
387 if (core_next_state == PWRDM_POWER_OFF) {
388 omap3_core_save_context();
389 omap3_prcm_save_context();
390 }
391 /* Enable IO-PAD and IO-CHAIN wakeups */
392 prm_set_mod_reg_bits(OMAP3430_EN_IO, WKUP_MOD, PM_WKEN);
393 omap3_enable_io_chain();
394 }
395
396 /*
397 * On EMU/HS devices ROM code restores a SRDC value
398 * from scratchpad which has automatic self refresh on timeout
399 * of AUTO_CNT = 1 enabled. This takes care of errata 1.142.
400 * Hence store/restore the SDRC_POWER register here.
401 */
402 if (omap_rev() >= OMAP3430_REV_ES3_0 &&
403 omap_type() != OMAP2_DEVICE_TYPE_GP &&
404 core_next_state == PWRDM_POWER_OFF)
405 sdrc_pwr = sdrc_read_reg(SDRC_POWER);
194 406
195 _omap_sram_idle(NULL, save_state); 407 /*
408 * omap3_arm_context is the location where ARM registers
409 * get saved. The restore path then reads from this
410 * location and restores them back.
411 */
412 _omap_sram_idle(omap3_arm_context, save_state);
196 cpu_init(); 413 cpu_init();
197 414
198 omap_uart_resume_idle(2); 415 /* Restore normal SDRC POWER settings */
199 omap_uart_resume_idle(1); 416 if (omap_rev() >= OMAP3430_REV_ES3_0 &&
200 omap_uart_resume_idle(0); 417 omap_type() != OMAP2_DEVICE_TYPE_GP &&
201 omap2_gpio_resume_after_retention(); 418 core_next_state == PWRDM_POWER_OFF)
419 sdrc_write_reg(sdrc_pwr, SDRC_POWER);
420
421 /* Restore table entry modified during MMU restoration */
422 if (pwrdm_read_prev_pwrst(mpu_pwrdm) == PWRDM_POWER_OFF)
423 restore_table_entry();
424
425 /* CORE */
426 if (core_next_state < PWRDM_POWER_ON) {
427 core_prev_state = pwrdm_read_prev_pwrst(core_pwrdm);
428 if (core_prev_state == PWRDM_POWER_OFF) {
429 omap3_core_restore_context();
430 omap3_prcm_restore_context();
431 omap3_sram_restore_context();
432 omap2_sms_restore_context();
433 }
434 omap_uart_resume_idle(0);
435 omap_uart_resume_idle(1);
436 if (core_next_state == PWRDM_POWER_OFF)
437 prm_clear_mod_reg_bits(OMAP3430_AUTO_OFF,
438 OMAP3430_GR_MOD,
439 OMAP3_PRM_VOLTCTRL_OFFSET);
440 }
202 441
203 pwrdm_post_transition(); 442 /* PER */
443 if (per_next_state < PWRDM_POWER_ON) {
444 per_prev_state = pwrdm_read_prev_pwrst(per_pwrdm);
445 if (per_prev_state == PWRDM_POWER_OFF)
446 omap3_per_restore_context();
447 omap2_gpio_resume_after_retention();
448 omap_uart_resume_idle(2);
449 if (per_state_modified)
450 pwrdm_set_next_pwrst(per_pwrdm, PWRDM_POWER_OFF);
451 }
204 452
205} 453 /* Disable IO-PAD and IO-CHAIN wakeup */
454 if (core_next_state < PWRDM_POWER_ON) {
455 prm_clear_mod_reg_bits(OMAP3430_EN_IO, WKUP_MOD, PM_WKEN);
456 omap3_disable_io_chain();
457 }
206 458
207/* 459 pwrdm_post_transition();
208 * Check if functional clocks are enabled before entering
209 * sleep. This function could be behind CONFIG_PM_DEBUG
210 * when all drivers are configuring their sysconfig registers
211 * properly and using their clocks properly.
212 */
213static int omap3_fclks_active(void)
214{
215 u32 fck_core1 = 0, fck_core3 = 0, fck_sgx = 0, fck_dss = 0,
216 fck_cam = 0, fck_per = 0, fck_usbhost = 0;
217 460
218 fck_core1 = cm_read_mod_reg(CORE_MOD, 461 omap2_clkdm_allow_idle(mpu_pwrdm->pwrdm_clkdms[0]);
219 CM_FCLKEN1);
220 if (omap_rev() > OMAP3430_REV_ES1_0) {
221 fck_core3 = cm_read_mod_reg(CORE_MOD,
222 OMAP3430ES2_CM_FCLKEN3);
223 fck_sgx = cm_read_mod_reg(OMAP3430ES2_SGX_MOD,
224 CM_FCLKEN);
225 fck_usbhost = cm_read_mod_reg(OMAP3430ES2_USBHOST_MOD,
226 CM_FCLKEN);
227 } else
228 fck_sgx = cm_read_mod_reg(GFX_MOD,
229 OMAP3430ES2_CM_FCLKEN3);
230 fck_dss = cm_read_mod_reg(OMAP3430_DSS_MOD,
231 CM_FCLKEN);
232 fck_cam = cm_read_mod_reg(OMAP3430_CAM_MOD,
233 CM_FCLKEN);
234 fck_per = cm_read_mod_reg(OMAP3430_PER_MOD,
235 CM_FCLKEN);
236
237 /* Ignore UART clocks. These are handled by UART core (serial.c) */
238 fck_core1 &= ~(OMAP3430_EN_UART1 | OMAP3430_EN_UART2);
239 fck_per &= ~OMAP3430_EN_UART3;
240
241 if (fck_core1 | fck_core3 | fck_sgx | fck_dss |
242 fck_cam | fck_per | fck_usbhost)
243 return 1;
244 return 0;
245} 462}
246 463
247static int omap3_can_sleep(void) 464int omap3_can_sleep(void)
248{ 465{
249 if (!omap_uart_can_sleep()) 466 if (!sleep_while_idle)
250 return 0; 467 return 0;
251 if (omap3_fclks_active()) 468 if (!omap_uart_can_sleep())
252 return 0; 469 return 0;
253 return 1; 470 return 1;
254} 471}
@@ -256,7 +473,7 @@ static int omap3_can_sleep(void)
256/* This sets pwrdm state (other than mpu & core. Currently only ON & 473/* This sets pwrdm state (other than mpu & core. Currently only ON &
257 * RET are supported. Function is assuming that clkdm doesn't have 474 * RET are supported. Function is assuming that clkdm doesn't have
258 * hw_sup mode enabled. */ 475 * hw_sup mode enabled. */
259static int set_pwrdm_state(struct powerdomain *pwrdm, u32 state) 476int set_pwrdm_state(struct powerdomain *pwrdm, u32 state)
260{ 477{
261 u32 cur_state; 478 u32 cur_state;
262 int sleep_switch = 0; 479 int sleep_switch = 0;
@@ -306,7 +523,7 @@ static void omap3_pm_idle(void)
306 if (!omap3_can_sleep()) 523 if (!omap3_can_sleep())
307 goto out; 524 goto out;
308 525
309 if (omap_irq_pending()) 526 if (omap_irq_pending() || need_resched())
310 goto out; 527 goto out;
311 528
312 omap_sram_idle(); 529 omap_sram_idle();
@@ -319,6 +536,22 @@ out:
319#ifdef CONFIG_SUSPEND 536#ifdef CONFIG_SUSPEND
320static suspend_state_t suspend_state; 537static suspend_state_t suspend_state;
321 538
539static void omap2_pm_wakeup_on_timer(u32 seconds)
540{
541 u32 tick_rate, cycles;
542
543 if (!seconds)
544 return;
545
546 tick_rate = clk_get_rate(omap_dm_timer_get_fclk(gptimer_wakeup));
547 cycles = tick_rate * seconds;
548 omap_dm_timer_stop(gptimer_wakeup);
549 omap_dm_timer_set_load_start(gptimer_wakeup, 0, 0xffffffff - cycles);
550
551 pr_info("PM: Resume timer in %d secs (%d ticks at %d ticks/sec.)\n",
552 seconds, cycles, tick_rate);
553}
554
322static int omap3_pm_prepare(void) 555static int omap3_pm_prepare(void)
323{ 556{
324 disable_hlt(); 557 disable_hlt();
@@ -330,6 +563,9 @@ static int omap3_pm_suspend(void)
330 struct power_state *pwrst; 563 struct power_state *pwrst;
331 int state, ret = 0; 564 int state, ret = 0;
332 565
566 if (wakeup_timer_seconds)
567 omap2_pm_wakeup_on_timer(wakeup_timer_seconds);
568
333 /* Read current next_pwrsts */ 569 /* Read current next_pwrsts */
334 list_for_each_entry(pwrst, &pwrst_list, node) 570 list_for_each_entry(pwrst, &pwrst_list, node)
335 pwrst->saved_state = pwrdm_read_next_pwrst(pwrst->pwrdm); 571 pwrst->saved_state = pwrdm_read_next_pwrst(pwrst->pwrdm);
@@ -690,6 +926,22 @@ static void __init prcm_setup_regs(void)
690 omap3_d2d_idle(); 926 omap3_d2d_idle();
691} 927}
692 928
929void omap3_pm_off_mode_enable(int enable)
930{
931 struct power_state *pwrst;
932 u32 state;
933
934 if (enable)
935 state = PWRDM_POWER_OFF;
936 else
937 state = PWRDM_POWER_RET;
938
939 list_for_each_entry(pwrst, &pwrst_list, node) {
940 pwrst->next_state = state;
941 set_pwrdm_state(pwrst->pwrdm, state);
942 }
943}
944
693int omap3_pm_get_suspend_state(struct powerdomain *pwrdm) 945int omap3_pm_get_suspend_state(struct powerdomain *pwrdm)
694{ 946{
695 struct power_state *pwrst; 947 struct power_state *pwrst;
@@ -749,6 +1001,15 @@ static int __init clkdms_setup(struct clockdomain *clkdm, void *unused)
749 return 0; 1001 return 0;
750} 1002}
751 1003
1004void omap_push_sram_idle(void)
1005{
1006 _omap_sram_idle = omap_sram_push(omap34xx_cpu_suspend,
1007 omap34xx_cpu_suspend_sz);
1008 if (omap_type() != OMAP2_DEVICE_TYPE_GP)
1009 _omap_save_secure_sram = omap_sram_push(save_secure_ram_context,
1010 save_secure_ram_context_sz);
1011}
1012
752static int __init omap3_pm_init(void) 1013static int __init omap3_pm_init(void)
753{ 1014{
754 struct power_state *pwrst, *tmp; 1015 struct power_state *pwrst, *tmp;
@@ -786,15 +1047,47 @@ static int __init omap3_pm_init(void)
786 goto err2; 1047 goto err2;
787 } 1048 }
788 1049
789 _omap_sram_idle = omap_sram_push(omap34xx_cpu_suspend, 1050 neon_pwrdm = pwrdm_lookup("neon_pwrdm");
790 omap34xx_cpu_suspend_sz); 1051 per_pwrdm = pwrdm_lookup("per_pwrdm");
1052 core_pwrdm = pwrdm_lookup("core_pwrdm");
1053 cam_pwrdm = pwrdm_lookup("cam_pwrdm");
791 1054
1055 omap_push_sram_idle();
792#ifdef CONFIG_SUSPEND 1056#ifdef CONFIG_SUSPEND
793 suspend_set_ops(&omap_pm_ops); 1057 suspend_set_ops(&omap_pm_ops);
794#endif /* CONFIG_SUSPEND */ 1058#endif /* CONFIG_SUSPEND */
795 1059
796 pm_idle = omap3_pm_idle; 1060 pm_idle = omap3_pm_idle;
1061 omap3_idle_init();
1062
1063 pwrdm_add_wkdep(neon_pwrdm, mpu_pwrdm);
1064 /*
1065 * REVISIT: This wkdep is only necessary when GPIO2-6 are enabled for
1066 * IO-pad wakeup. Otherwise it will unnecessarily waste power
1067 * waking up PER with every CORE wakeup - see
1068 * http://marc.info/?l=linux-omap&m=121852150710062&w=2
1069 */
1070 pwrdm_add_wkdep(per_pwrdm, core_pwrdm);
1071
1072 if (omap_type() != OMAP2_DEVICE_TYPE_GP) {
1073 omap3_secure_ram_storage =
1074 kmalloc(0x803F, GFP_KERNEL);
1075 if (!omap3_secure_ram_storage)
1076 printk(KERN_ERR "Memory allocation failed when"
1077 "allocating for secure sram context\n");
1078
1079 local_irq_disable();
1080 local_fiq_disable();
1081
1082 omap_dma_global_context_save();
1083 omap3_save_secure_ram_context(PWRDM_POWER_ON);
1084 omap_dma_global_context_restore();
1085
1086 local_irq_enable();
1087 local_fiq_enable();
1088 }
797 1089
1090 omap3_save_scratchpad_contents();
798err1: 1091err1:
799 return ret; 1092 return ret;
800err2: 1093err2:
diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
index f00289abd30f..b6990e377783 100644
--- a/arch/arm/mach-omap2/powerdomain.c
+++ b/arch/arm/mach-omap2/powerdomain.c
@@ -31,9 +31,9 @@
31#include "prm.h" 31#include "prm.h"
32#include "prm-regbits-34xx.h" 32#include "prm-regbits-34xx.h"
33 33
34#include <mach/cpu.h> 34#include <plat/cpu.h>
35#include <mach/powerdomain.h> 35#include <plat/powerdomain.h>
36#include <mach/clockdomain.h> 36#include <plat/clockdomain.h>
37 37
38#include "pm.h" 38#include "pm.h"
39 39
diff --git a/arch/arm/mach-omap2/powerdomains.h b/arch/arm/mach-omap2/powerdomains.h
index 691470ea4c6a..057b2e3e2c35 100644
--- a/arch/arm/mach-omap2/powerdomains.h
+++ b/arch/arm/mach-omap2/powerdomains.h
@@ -63,7 +63,7 @@
63 * XXX encode hardware fixed wakeup dependencies -- esp. for 3430 CORE 63 * XXX encode hardware fixed wakeup dependencies -- esp. for 3430 CORE
64 */ 64 */
65 65
66#include <mach/powerdomain.h> 66#include <plat/powerdomain.h>
67 67
68#include "prcm-common.h" 68#include "prcm-common.h"
69#include "prm.h" 69#include "prm.h"
diff --git a/arch/arm/mach-omap2/powerdomains24xx.h b/arch/arm/mach-omap2/powerdomains24xx.h
index 9f08dc3f7fd2..bd249a495aa9 100644
--- a/arch/arm/mach-omap2/powerdomains24xx.h
+++ b/arch/arm/mach-omap2/powerdomains24xx.h
@@ -20,7 +20,7 @@
20 * the array in mach-omap2/powerdomains.h. 20 * the array in mach-omap2/powerdomains.h.
21 */ 21 */
22 22
23#include <mach/powerdomain.h> 23#include <plat/powerdomain.h>
24 24
25#include "prcm-common.h" 25#include "prcm-common.h"
26#include "prm.h" 26#include "prm.h"
diff --git a/arch/arm/mach-omap2/powerdomains34xx.h b/arch/arm/mach-omap2/powerdomains34xx.h
index 4dcf94b800ab..fd09b0827df0 100644
--- a/arch/arm/mach-omap2/powerdomains34xx.h
+++ b/arch/arm/mach-omap2/powerdomains34xx.h
@@ -20,7 +20,7 @@
20 * the array in mach-omap2/powerdomains.h. 20 * the array in mach-omap2/powerdomains.h.
21 */ 21 */
22 22
23#include <mach/powerdomain.h> 23#include <plat/powerdomain.h>
24 24
25#include "prcm-common.h" 25#include "prcm-common.h"
26#include "prm.h" 26#include "prm.h"
@@ -338,7 +338,13 @@ static struct powerdomain usbhost_pwrdm = {
338 .sleepdep_srcs = dss_per_usbhost_sleepdeps, 338 .sleepdep_srcs = dss_per_usbhost_sleepdeps,
339 .pwrsts = PWRSTS_OFF_RET_ON, 339 .pwrsts = PWRSTS_OFF_RET_ON,
340 .pwrsts_logic_ret = PWRDM_POWER_RET, 340 .pwrsts_logic_ret = PWRDM_POWER_RET,
341 .flags = PWRDM_HAS_HDWR_SAR, /* for USBHOST ctrlr only */ 341 /*
342 * REVISIT: Enabling usb host save and restore mechanism seems to
343 * leave the usb host domain permanently in ACTIVE mode after
344 * changing the usb host power domain state from OFF to active once.
345 * Disabling for now.
346 */
347 /*.flags = PWRDM_HAS_HDWR_SAR,*/ /* for USBHOST ctrlr only */
342 .banks = 1, 348 .banks = 1,
343 .pwrsts_mem_ret = { 349 .pwrsts_mem_ret = {
344 [0] = PWRDM_POWER_RET, /* MEMRETSTATE */ 350 [0] = PWRDM_POWER_RET, /* MEMRETSTATE */
diff --git a/arch/arm/mach-omap2/prcm.c b/arch/arm/mach-omap2/prcm.c
index ced555a4cd1a..029d376198d4 100644
--- a/arch/arm/mach-omap2/prcm.c
+++ b/arch/arm/mach-omap2/prcm.c
@@ -7,6 +7,9 @@
7 * 7 *
8 * Written by Tony Lindgren <tony.lindgren@nokia.com> 8 * Written by Tony Lindgren <tony.lindgren@nokia.com>
9 * 9 *
10 * Copyright (C) 2007 Texas Instruments, Inc.
11 * Rajendra Nayak <rnayak@ti.com>
12 *
10 * Some pieces of code Copyright (C) 2005 Texas Instruments, Inc. 13 * Some pieces of code Copyright (C) 2005 Texas Instruments, Inc.
11 * 14 *
12 * This program is free software; you can redistribute it and/or modify 15 * This program is free software; you can redistribute it and/or modify
@@ -19,10 +22,13 @@
19#include <linux/io.h> 22#include <linux/io.h>
20#include <linux/delay.h> 23#include <linux/delay.h>
21 24
22#include <mach/common.h> 25#include <plat/common.h>
23#include <mach/prcm.h> 26#include <plat/prcm.h>
27#include <plat/irqs.h>
28#include <plat/control.h>
24 29
25#include "clock.h" 30#include "clock.h"
31#include "cm.h"
26#include "prm.h" 32#include "prm.h"
27#include "prm-regbits-24xx.h" 33#include "prm-regbits-24xx.h"
28 34
@@ -31,6 +37,89 @@ static void __iomem *cm_base;
31 37
32#define MAX_MODULE_ENABLE_WAIT 100000 38#define MAX_MODULE_ENABLE_WAIT 100000
33 39
40struct omap3_prcm_regs {
41 u32 control_padconf_sys_nirq;
42 u32 iva2_cm_clksel1;
43 u32 iva2_cm_clksel2;
44 u32 cm_sysconfig;
45 u32 sgx_cm_clksel;
46 u32 wkup_cm_clksel;
47 u32 dss_cm_clksel;
48 u32 cam_cm_clksel;
49 u32 per_cm_clksel;
50 u32 emu_cm_clksel;
51 u32 emu_cm_clkstctrl;
52 u32 pll_cm_autoidle2;
53 u32 pll_cm_clksel4;
54 u32 pll_cm_clksel5;
55 u32 pll_cm_clken;
56 u32 pll_cm_clken2;
57 u32 cm_polctrl;
58 u32 iva2_cm_fclken;
59 u32 iva2_cm_clken_pll;
60 u32 core_cm_fclken1;
61 u32 core_cm_fclken3;
62 u32 sgx_cm_fclken;
63 u32 wkup_cm_fclken;
64 u32 dss_cm_fclken;
65 u32 cam_cm_fclken;
66 u32 per_cm_fclken;
67 u32 usbhost_cm_fclken;
68 u32 core_cm_iclken1;
69 u32 core_cm_iclken2;
70 u32 core_cm_iclken3;
71 u32 sgx_cm_iclken;
72 u32 wkup_cm_iclken;
73 u32 dss_cm_iclken;
74 u32 cam_cm_iclken;
75 u32 per_cm_iclken;
76 u32 usbhost_cm_iclken;
77 u32 iva2_cm_autiidle2;
78 u32 mpu_cm_autoidle2;
79 u32 pll_cm_autoidle;
80 u32 iva2_cm_clkstctrl;
81 u32 mpu_cm_clkstctrl;
82 u32 core_cm_clkstctrl;
83 u32 sgx_cm_clkstctrl;
84 u32 dss_cm_clkstctrl;
85 u32 cam_cm_clkstctrl;
86 u32 per_cm_clkstctrl;
87 u32 neon_cm_clkstctrl;
88 u32 usbhost_cm_clkstctrl;
89 u32 core_cm_autoidle1;
90 u32 core_cm_autoidle2;
91 u32 core_cm_autoidle3;
92 u32 wkup_cm_autoidle;
93 u32 dss_cm_autoidle;
94 u32 cam_cm_autoidle;
95 u32 per_cm_autoidle;
96 u32 usbhost_cm_autoidle;
97 u32 sgx_cm_sleepdep;
98 u32 dss_cm_sleepdep;
99 u32 cam_cm_sleepdep;
100 u32 per_cm_sleepdep;
101 u32 usbhost_cm_sleepdep;
102 u32 cm_clkout_ctrl;
103 u32 prm_clkout_ctrl;
104 u32 sgx_pm_wkdep;
105 u32 dss_pm_wkdep;
106 u32 cam_pm_wkdep;
107 u32 per_pm_wkdep;
108 u32 neon_pm_wkdep;
109 u32 usbhost_pm_wkdep;
110 u32 core_pm_mpugrpsel1;
111 u32 iva2_pm_ivagrpsel1;
112 u32 core_pm_mpugrpsel3;
113 u32 core_pm_ivagrpsel3;
114 u32 wkup_pm_mpugrpsel;
115 u32 wkup_pm_ivagrpsel;
116 u32 per_pm_mpugrpsel;
117 u32 per_pm_ivagrpsel;
118 u32 wkup_pm_wken;
119};
120
121struct omap3_prcm_regs prcm_context;
122
34u32 omap_prcm_get_reset_sources(void) 123u32 omap_prcm_get_reset_sources(void)
35{ 124{
36 /* XXX This presumably needs modification for 34XX */ 125 /* XXX This presumably needs modification for 34XX */
@@ -46,9 +135,18 @@ void omap_prcm_arch_reset(char mode)
46 135
47 if (cpu_is_omap24xx()) 136 if (cpu_is_omap24xx())
48 prcm_offs = WKUP_MOD; 137 prcm_offs = WKUP_MOD;
49 else if (cpu_is_omap34xx()) 138 else if (cpu_is_omap34xx()) {
139 u32 l;
140
50 prcm_offs = OMAP3430_GR_MOD; 141 prcm_offs = OMAP3430_GR_MOD;
51 else 142 l = ('B' << 24) | ('M' << 16) | mode;
143 /* Reserve the first word in scratchpad for communicating
144 * with the boot ROM. A pointer to a data structure
145 * describing the boot process can be stored there,
146 * cf. OMAP34xx TRM, Initialization / Software Booting
147 * Configuration. */
148 omap_writel(l, OMAP343X_SCRATCHPAD + 4);
149 } else
52 WARN_ON(1); 150 WARN_ON(1);
53 151
54 prm_set_mod_reg_bits(OMAP_RST_DPLL3, prcm_offs, RM_RSTCTRL); 152 prm_set_mod_reg_bits(OMAP_RST_DPLL3, prcm_offs, RM_RSTCTRL);
@@ -168,3 +266,308 @@ void __init omap2_set_globals_prcm(struct omap_globals *omap2_globals)
168 prm_base = omap2_globals->prm; 266 prm_base = omap2_globals->prm;
169 cm_base = omap2_globals->cm; 267 cm_base = omap2_globals->cm;
170} 268}
269
270#ifdef CONFIG_ARCH_OMAP3
271void omap3_prcm_save_context(void)
272{
273 prcm_context.control_padconf_sys_nirq =
274 omap_ctrl_readl(OMAP343X_CONTROL_PADCONF_SYSNIRQ);
275 prcm_context.iva2_cm_clksel1 =
276 cm_read_mod_reg(OMAP3430_IVA2_MOD, CM_CLKSEL1);
277 prcm_context.iva2_cm_clksel2 =
278 cm_read_mod_reg(OMAP3430_IVA2_MOD, CM_CLKSEL2);
279 prcm_context.cm_sysconfig = __raw_readl(OMAP3430_CM_SYSCONFIG);
280 prcm_context.sgx_cm_clksel =
281 cm_read_mod_reg(OMAP3430ES2_SGX_MOD, CM_CLKSEL);
282 prcm_context.wkup_cm_clksel = cm_read_mod_reg(WKUP_MOD, CM_CLKSEL);
283 prcm_context.dss_cm_clksel =
284 cm_read_mod_reg(OMAP3430_DSS_MOD, CM_CLKSEL);
285 prcm_context.cam_cm_clksel =
286 cm_read_mod_reg(OMAP3430_CAM_MOD, CM_CLKSEL);
287 prcm_context.per_cm_clksel =
288 cm_read_mod_reg(OMAP3430_PER_MOD, CM_CLKSEL);
289 prcm_context.emu_cm_clksel =
290 cm_read_mod_reg(OMAP3430_EMU_MOD, CM_CLKSEL1);
291 prcm_context.emu_cm_clkstctrl =
292 cm_read_mod_reg(OMAP3430_EMU_MOD, CM_CLKSTCTRL);
293 prcm_context.pll_cm_autoidle2 =
294 cm_read_mod_reg(PLL_MOD, CM_AUTOIDLE2);
295 prcm_context.pll_cm_clksel4 =
296 cm_read_mod_reg(PLL_MOD, OMAP3430ES2_CM_CLKSEL4);
297 prcm_context.pll_cm_clksel5 =
298 cm_read_mod_reg(PLL_MOD, OMAP3430ES2_CM_CLKSEL5);
299 prcm_context.pll_cm_clken =
300 cm_read_mod_reg(PLL_MOD, CM_CLKEN);
301 prcm_context.pll_cm_clken2 =
302 cm_read_mod_reg(PLL_MOD, OMAP3430ES2_CM_CLKEN2);
303 prcm_context.cm_polctrl = __raw_readl(OMAP3430_CM_POLCTRL);
304 prcm_context.iva2_cm_fclken =
305 cm_read_mod_reg(OMAP3430_IVA2_MOD, CM_FCLKEN);
306 prcm_context.iva2_cm_clken_pll = cm_read_mod_reg(OMAP3430_IVA2_MOD,
307 OMAP3430_CM_CLKEN_PLL);
308 prcm_context.core_cm_fclken1 =
309 cm_read_mod_reg(CORE_MOD, CM_FCLKEN1);
310 prcm_context.core_cm_fclken3 =
311 cm_read_mod_reg(CORE_MOD, OMAP3430ES2_CM_FCLKEN3);
312 prcm_context.sgx_cm_fclken =
313 cm_read_mod_reg(OMAP3430ES2_SGX_MOD, CM_FCLKEN);
314 prcm_context.wkup_cm_fclken =
315 cm_read_mod_reg(WKUP_MOD, CM_FCLKEN);
316 prcm_context.dss_cm_fclken =
317 cm_read_mod_reg(OMAP3430_DSS_MOD, CM_FCLKEN);
318 prcm_context.cam_cm_fclken =
319 cm_read_mod_reg(OMAP3430_CAM_MOD, CM_FCLKEN);
320 prcm_context.per_cm_fclken =
321 cm_read_mod_reg(OMAP3430_PER_MOD, CM_FCLKEN);
322 prcm_context.usbhost_cm_fclken =
323 cm_read_mod_reg(OMAP3430ES2_USBHOST_MOD, CM_FCLKEN);
324 prcm_context.core_cm_iclken1 =
325 cm_read_mod_reg(CORE_MOD, CM_ICLKEN1);
326 prcm_context.core_cm_iclken2 =
327 cm_read_mod_reg(CORE_MOD, CM_ICLKEN2);
328 prcm_context.core_cm_iclken3 =
329 cm_read_mod_reg(CORE_MOD, CM_ICLKEN3);
330 prcm_context.sgx_cm_iclken =
331 cm_read_mod_reg(OMAP3430ES2_SGX_MOD, CM_ICLKEN);
332 prcm_context.wkup_cm_iclken =
333 cm_read_mod_reg(WKUP_MOD, CM_ICLKEN);
334 prcm_context.dss_cm_iclken =
335 cm_read_mod_reg(OMAP3430_DSS_MOD, CM_ICLKEN);
336 prcm_context.cam_cm_iclken =
337 cm_read_mod_reg(OMAP3430_CAM_MOD, CM_ICLKEN);
338 prcm_context.per_cm_iclken =
339 cm_read_mod_reg(OMAP3430_PER_MOD, CM_ICLKEN);
340 prcm_context.usbhost_cm_iclken =
341 cm_read_mod_reg(OMAP3430ES2_USBHOST_MOD, CM_ICLKEN);
342 prcm_context.iva2_cm_autiidle2 =
343 cm_read_mod_reg(OMAP3430_IVA2_MOD, CM_AUTOIDLE2);
344 prcm_context.mpu_cm_autoidle2 =
345 cm_read_mod_reg(MPU_MOD, CM_AUTOIDLE2);
346 prcm_context.pll_cm_autoidle =
347 cm_read_mod_reg(PLL_MOD, CM_AUTOIDLE);
348 prcm_context.iva2_cm_clkstctrl =
349 cm_read_mod_reg(OMAP3430_IVA2_MOD, CM_CLKSTCTRL);
350 prcm_context.mpu_cm_clkstctrl =
351 cm_read_mod_reg(MPU_MOD, CM_CLKSTCTRL);
352 prcm_context.core_cm_clkstctrl =
353 cm_read_mod_reg(CORE_MOD, CM_CLKSTCTRL);
354 prcm_context.sgx_cm_clkstctrl =
355 cm_read_mod_reg(OMAP3430ES2_SGX_MOD, CM_CLKSTCTRL);
356 prcm_context.dss_cm_clkstctrl =
357 cm_read_mod_reg(OMAP3430_DSS_MOD, CM_CLKSTCTRL);
358 prcm_context.cam_cm_clkstctrl =
359 cm_read_mod_reg(OMAP3430_CAM_MOD, CM_CLKSTCTRL);
360 prcm_context.per_cm_clkstctrl =
361 cm_read_mod_reg(OMAP3430_PER_MOD, CM_CLKSTCTRL);
362 prcm_context.neon_cm_clkstctrl =
363 cm_read_mod_reg(OMAP3430_NEON_MOD, CM_CLKSTCTRL);
364 prcm_context.usbhost_cm_clkstctrl =
365 cm_read_mod_reg(OMAP3430ES2_USBHOST_MOD, CM_CLKSTCTRL);
366 prcm_context.core_cm_autoidle1 =
367 cm_read_mod_reg(CORE_MOD, CM_AUTOIDLE1);
368 prcm_context.core_cm_autoidle2 =
369 cm_read_mod_reg(CORE_MOD, CM_AUTOIDLE2);
370 prcm_context.core_cm_autoidle3 =
371 cm_read_mod_reg(CORE_MOD, CM_AUTOIDLE3);
372 prcm_context.wkup_cm_autoidle =
373 cm_read_mod_reg(WKUP_MOD, CM_AUTOIDLE);
374 prcm_context.dss_cm_autoidle =
375 cm_read_mod_reg(OMAP3430_DSS_MOD, CM_AUTOIDLE);
376 prcm_context.cam_cm_autoidle =
377 cm_read_mod_reg(OMAP3430_CAM_MOD, CM_AUTOIDLE);
378 prcm_context.per_cm_autoidle =
379 cm_read_mod_reg(OMAP3430_PER_MOD, CM_AUTOIDLE);
380 prcm_context.usbhost_cm_autoidle =
381 cm_read_mod_reg(OMAP3430ES2_USBHOST_MOD, CM_AUTOIDLE);
382 prcm_context.sgx_cm_sleepdep =
383 cm_read_mod_reg(OMAP3430ES2_SGX_MOD, OMAP3430_CM_SLEEPDEP);
384 prcm_context.dss_cm_sleepdep =
385 cm_read_mod_reg(OMAP3430_DSS_MOD, OMAP3430_CM_SLEEPDEP);
386 prcm_context.cam_cm_sleepdep =
387 cm_read_mod_reg(OMAP3430_CAM_MOD, OMAP3430_CM_SLEEPDEP);
388 prcm_context.per_cm_sleepdep =
389 cm_read_mod_reg(OMAP3430_PER_MOD, OMAP3430_CM_SLEEPDEP);
390 prcm_context.usbhost_cm_sleepdep =
391 cm_read_mod_reg(OMAP3430ES2_USBHOST_MOD, OMAP3430_CM_SLEEPDEP);
392 prcm_context.cm_clkout_ctrl = cm_read_mod_reg(OMAP3430_CCR_MOD,
393 OMAP3_CM_CLKOUT_CTRL_OFFSET);
394 prcm_context.prm_clkout_ctrl = prm_read_mod_reg(OMAP3430_CCR_MOD,
395 OMAP3_PRM_CLKOUT_CTRL_OFFSET);
396 prcm_context.sgx_pm_wkdep =
397 prm_read_mod_reg(OMAP3430ES2_SGX_MOD, PM_WKDEP);
398 prcm_context.dss_pm_wkdep =
399 prm_read_mod_reg(OMAP3430_DSS_MOD, PM_WKDEP);
400 prcm_context.cam_pm_wkdep =
401 prm_read_mod_reg(OMAP3430_CAM_MOD, PM_WKDEP);
402 prcm_context.per_pm_wkdep =
403 prm_read_mod_reg(OMAP3430_PER_MOD, PM_WKDEP);
404 prcm_context.neon_pm_wkdep =
405 prm_read_mod_reg(OMAP3430_NEON_MOD, PM_WKDEP);
406 prcm_context.usbhost_pm_wkdep =
407 prm_read_mod_reg(OMAP3430ES2_USBHOST_MOD, PM_WKDEP);
408 prcm_context.core_pm_mpugrpsel1 =
409 prm_read_mod_reg(CORE_MOD, OMAP3430_PM_MPUGRPSEL1);
410 prcm_context.iva2_pm_ivagrpsel1 =
411 prm_read_mod_reg(OMAP3430_IVA2_MOD, OMAP3430_PM_IVAGRPSEL1);
412 prcm_context.core_pm_mpugrpsel3 =
413 prm_read_mod_reg(CORE_MOD, OMAP3430ES2_PM_MPUGRPSEL3);
414 prcm_context.core_pm_ivagrpsel3 =
415 prm_read_mod_reg(CORE_MOD, OMAP3430ES2_PM_IVAGRPSEL3);
416 prcm_context.wkup_pm_mpugrpsel =
417 prm_read_mod_reg(WKUP_MOD, OMAP3430_PM_MPUGRPSEL);
418 prcm_context.wkup_pm_ivagrpsel =
419 prm_read_mod_reg(WKUP_MOD, OMAP3430_PM_IVAGRPSEL);
420 prcm_context.per_pm_mpugrpsel =
421 prm_read_mod_reg(OMAP3430_PER_MOD, OMAP3430_PM_MPUGRPSEL);
422 prcm_context.per_pm_ivagrpsel =
423 prm_read_mod_reg(OMAP3430_PER_MOD, OMAP3430_PM_IVAGRPSEL);
424 prcm_context.wkup_pm_wken = prm_read_mod_reg(WKUP_MOD, PM_WKEN);
425 return;
426}
427
428void omap3_prcm_restore_context(void)
429{
430 omap_ctrl_writel(prcm_context.control_padconf_sys_nirq,
431 OMAP343X_CONTROL_PADCONF_SYSNIRQ);
432 cm_write_mod_reg(prcm_context.iva2_cm_clksel1, OMAP3430_IVA2_MOD,
433 CM_CLKSEL1);
434 cm_write_mod_reg(prcm_context.iva2_cm_clksel2, OMAP3430_IVA2_MOD,
435 CM_CLKSEL2);
436 __raw_writel(prcm_context.cm_sysconfig, OMAP3430_CM_SYSCONFIG);
437 cm_write_mod_reg(prcm_context.sgx_cm_clksel, OMAP3430ES2_SGX_MOD,
438 CM_CLKSEL);
439 cm_write_mod_reg(prcm_context.wkup_cm_clksel, WKUP_MOD, CM_CLKSEL);
440 cm_write_mod_reg(prcm_context.dss_cm_clksel, OMAP3430_DSS_MOD,
441 CM_CLKSEL);
442 cm_write_mod_reg(prcm_context.cam_cm_clksel, OMAP3430_CAM_MOD,
443 CM_CLKSEL);
444 cm_write_mod_reg(prcm_context.per_cm_clksel, OMAP3430_PER_MOD,
445 CM_CLKSEL);
446 cm_write_mod_reg(prcm_context.emu_cm_clksel, OMAP3430_EMU_MOD,
447 CM_CLKSEL1);
448 cm_write_mod_reg(prcm_context.emu_cm_clkstctrl, OMAP3430_EMU_MOD,
449 CM_CLKSTCTRL);
450 cm_write_mod_reg(prcm_context.pll_cm_autoidle2, PLL_MOD,
451 CM_AUTOIDLE2);
452 cm_write_mod_reg(prcm_context.pll_cm_clksel4, PLL_MOD,
453 OMAP3430ES2_CM_CLKSEL4);
454 cm_write_mod_reg(prcm_context.pll_cm_clksel5, PLL_MOD,
455 OMAP3430ES2_CM_CLKSEL5);
456 cm_write_mod_reg(prcm_context.pll_cm_clken, PLL_MOD, CM_CLKEN);
457 cm_write_mod_reg(prcm_context.pll_cm_clken2, PLL_MOD,
458 OMAP3430ES2_CM_CLKEN2);
459 __raw_writel(prcm_context.cm_polctrl, OMAP3430_CM_POLCTRL);
460 cm_write_mod_reg(prcm_context.iva2_cm_fclken, OMAP3430_IVA2_MOD,
461 CM_FCLKEN);
462 cm_write_mod_reg(prcm_context.iva2_cm_clken_pll, OMAP3430_IVA2_MOD,
463 OMAP3430_CM_CLKEN_PLL);
464 cm_write_mod_reg(prcm_context.core_cm_fclken1, CORE_MOD, CM_FCLKEN1);
465 cm_write_mod_reg(prcm_context.core_cm_fclken3, CORE_MOD,
466 OMAP3430ES2_CM_FCLKEN3);
467 cm_write_mod_reg(prcm_context.sgx_cm_fclken, OMAP3430ES2_SGX_MOD,
468 CM_FCLKEN);
469 cm_write_mod_reg(prcm_context.wkup_cm_fclken, WKUP_MOD, CM_FCLKEN);
470 cm_write_mod_reg(prcm_context.dss_cm_fclken, OMAP3430_DSS_MOD,
471 CM_FCLKEN);
472 cm_write_mod_reg(prcm_context.cam_cm_fclken, OMAP3430_CAM_MOD,
473 CM_FCLKEN);
474 cm_write_mod_reg(prcm_context.per_cm_fclken, OMAP3430_PER_MOD,
475 CM_FCLKEN);
476 cm_write_mod_reg(prcm_context.usbhost_cm_fclken,
477 OMAP3430ES2_USBHOST_MOD, CM_FCLKEN);
478 cm_write_mod_reg(prcm_context.core_cm_iclken1, CORE_MOD, CM_ICLKEN1);
479 cm_write_mod_reg(prcm_context.core_cm_iclken2, CORE_MOD, CM_ICLKEN2);
480 cm_write_mod_reg(prcm_context.core_cm_iclken3, CORE_MOD, CM_ICLKEN3);
481 cm_write_mod_reg(prcm_context.sgx_cm_iclken, OMAP3430ES2_SGX_MOD,
482 CM_ICLKEN);
483 cm_write_mod_reg(prcm_context.wkup_cm_iclken, WKUP_MOD, CM_ICLKEN);
484 cm_write_mod_reg(prcm_context.dss_cm_iclken, OMAP3430_DSS_MOD,
485 CM_ICLKEN);
486 cm_write_mod_reg(prcm_context.cam_cm_iclken, OMAP3430_CAM_MOD,
487 CM_ICLKEN);
488 cm_write_mod_reg(prcm_context.per_cm_iclken, OMAP3430_PER_MOD,
489 CM_ICLKEN);
490 cm_write_mod_reg(prcm_context.usbhost_cm_iclken,
491 OMAP3430ES2_USBHOST_MOD, CM_ICLKEN);
492 cm_write_mod_reg(prcm_context.iva2_cm_autiidle2, OMAP3430_IVA2_MOD,
493 CM_AUTOIDLE2);
494 cm_write_mod_reg(prcm_context.mpu_cm_autoidle2, MPU_MOD, CM_AUTOIDLE2);
495 cm_write_mod_reg(prcm_context.pll_cm_autoidle, PLL_MOD, CM_AUTOIDLE);
496 cm_write_mod_reg(prcm_context.iva2_cm_clkstctrl, OMAP3430_IVA2_MOD,
497 CM_CLKSTCTRL);
498 cm_write_mod_reg(prcm_context.mpu_cm_clkstctrl, MPU_MOD, CM_CLKSTCTRL);
499 cm_write_mod_reg(prcm_context.core_cm_clkstctrl, CORE_MOD,
500 CM_CLKSTCTRL);
501 cm_write_mod_reg(prcm_context.sgx_cm_clkstctrl, OMAP3430ES2_SGX_MOD,
502 CM_CLKSTCTRL);
503 cm_write_mod_reg(prcm_context.dss_cm_clkstctrl, OMAP3430_DSS_MOD,
504 CM_CLKSTCTRL);
505 cm_write_mod_reg(prcm_context.cam_cm_clkstctrl, OMAP3430_CAM_MOD,
506 CM_CLKSTCTRL);
507 cm_write_mod_reg(prcm_context.per_cm_clkstctrl, OMAP3430_PER_MOD,
508 CM_CLKSTCTRL);
509 cm_write_mod_reg(prcm_context.neon_cm_clkstctrl, OMAP3430_NEON_MOD,
510 CM_CLKSTCTRL);
511 cm_write_mod_reg(prcm_context.usbhost_cm_clkstctrl,
512 OMAP3430ES2_USBHOST_MOD, CM_CLKSTCTRL);
513 cm_write_mod_reg(prcm_context.core_cm_autoidle1, CORE_MOD,
514 CM_AUTOIDLE1);
515 cm_write_mod_reg(prcm_context.core_cm_autoidle2, CORE_MOD,
516 CM_AUTOIDLE2);
517 cm_write_mod_reg(prcm_context.core_cm_autoidle3, CORE_MOD,
518 CM_AUTOIDLE3);
519 cm_write_mod_reg(prcm_context.wkup_cm_autoidle, WKUP_MOD, CM_AUTOIDLE);
520 cm_write_mod_reg(prcm_context.dss_cm_autoidle, OMAP3430_DSS_MOD,
521 CM_AUTOIDLE);
522 cm_write_mod_reg(prcm_context.cam_cm_autoidle, OMAP3430_CAM_MOD,
523 CM_AUTOIDLE);
524 cm_write_mod_reg(prcm_context.per_cm_autoidle, OMAP3430_PER_MOD,
525 CM_AUTOIDLE);
526 cm_write_mod_reg(prcm_context.usbhost_cm_autoidle,
527 OMAP3430ES2_USBHOST_MOD, CM_AUTOIDLE);
528 cm_write_mod_reg(prcm_context.sgx_cm_sleepdep, OMAP3430ES2_SGX_MOD,
529 OMAP3430_CM_SLEEPDEP);
530 cm_write_mod_reg(prcm_context.dss_cm_sleepdep, OMAP3430_DSS_MOD,
531 OMAP3430_CM_SLEEPDEP);
532 cm_write_mod_reg(prcm_context.cam_cm_sleepdep, OMAP3430_CAM_MOD,
533 OMAP3430_CM_SLEEPDEP);
534 cm_write_mod_reg(prcm_context.per_cm_sleepdep, OMAP3430_PER_MOD,
535 OMAP3430_CM_SLEEPDEP);
536 cm_write_mod_reg(prcm_context.usbhost_cm_sleepdep,
537 OMAP3430ES2_USBHOST_MOD, OMAP3430_CM_SLEEPDEP);
538 cm_write_mod_reg(prcm_context.cm_clkout_ctrl, OMAP3430_CCR_MOD,
539 OMAP3_CM_CLKOUT_CTRL_OFFSET);
540 prm_write_mod_reg(prcm_context.prm_clkout_ctrl, OMAP3430_CCR_MOD,
541 OMAP3_PRM_CLKOUT_CTRL_OFFSET);
542 prm_write_mod_reg(prcm_context.sgx_pm_wkdep, OMAP3430ES2_SGX_MOD,
543 PM_WKDEP);
544 prm_write_mod_reg(prcm_context.dss_pm_wkdep, OMAP3430_DSS_MOD,
545 PM_WKDEP);
546 prm_write_mod_reg(prcm_context.cam_pm_wkdep, OMAP3430_CAM_MOD,
547 PM_WKDEP);
548 prm_write_mod_reg(prcm_context.per_pm_wkdep, OMAP3430_PER_MOD,
549 PM_WKDEP);
550 prm_write_mod_reg(prcm_context.neon_pm_wkdep, OMAP3430_NEON_MOD,
551 PM_WKDEP);
552 prm_write_mod_reg(prcm_context.usbhost_pm_wkdep,
553 OMAP3430ES2_USBHOST_MOD, PM_WKDEP);
554 prm_write_mod_reg(prcm_context.core_pm_mpugrpsel1, CORE_MOD,
555 OMAP3430_PM_MPUGRPSEL1);
556 prm_write_mod_reg(prcm_context.iva2_pm_ivagrpsel1, OMAP3430_IVA2_MOD,
557 OMAP3430_PM_IVAGRPSEL1);
558 prm_write_mod_reg(prcm_context.core_pm_mpugrpsel3, CORE_MOD,
559 OMAP3430ES2_PM_MPUGRPSEL3);
560 prm_write_mod_reg(prcm_context.core_pm_ivagrpsel3, CORE_MOD,
561 OMAP3430ES2_PM_IVAGRPSEL3);
562 prm_write_mod_reg(prcm_context.wkup_pm_mpugrpsel, WKUP_MOD,
563 OMAP3430_PM_MPUGRPSEL);
564 prm_write_mod_reg(prcm_context.wkup_pm_ivagrpsel, WKUP_MOD,
565 OMAP3430_PM_IVAGRPSEL);
566 prm_write_mod_reg(prcm_context.per_pm_mpugrpsel, OMAP3430_PER_MOD,
567 OMAP3430_PM_MPUGRPSEL);
568 prm_write_mod_reg(prcm_context.per_pm_ivagrpsel, OMAP3430_PER_MOD,
569 OMAP3430_PM_IVAGRPSEL);
570 prm_write_mod_reg(prcm_context.wkup_pm_wken, WKUP_MOD, PM_WKEN);
571 return;
572}
573#endif
diff --git a/arch/arm/mach-omap2/prm-regbits-34xx.h b/arch/arm/mach-omap2/prm-regbits-34xx.h
index 9fd03a2ec95c..8f21bae6dc1c 100644
--- a/arch/arm/mach-omap2/prm-regbits-34xx.h
+++ b/arch/arm/mach-omap2/prm-regbits-34xx.h
@@ -365,6 +365,7 @@
365/* PM_PREPWSTST_GFX specific bits */ 365/* PM_PREPWSTST_GFX specific bits */
366 366
367/* PM_WKEN_WKUP specific bits */ 367/* PM_WKEN_WKUP specific bits */
368#define OMAP3430_EN_IO_CHAIN (1 << 16)
368#define OMAP3430_EN_IO (1 << 8) 369#define OMAP3430_EN_IO (1 << 8)
369#define OMAP3430_EN_GPIO1 (1 << 3) 370#define OMAP3430_EN_GPIO1 (1 << 3)
370 371
@@ -373,6 +374,7 @@
373/* PM_IVA2GRPSEL_WKUP specific bits */ 374/* PM_IVA2GRPSEL_WKUP specific bits */
374 375
375/* PM_WKST_WKUP specific bits */ 376/* PM_WKST_WKUP specific bits */
377#define OMAP3430_ST_IO_CHAIN (1 << 16)
376#define OMAP3430_ST_IO (1 << 8) 378#define OMAP3430_ST_IO (1 << 8)
377 379
378/* PRM_CLKSEL */ 380/* PRM_CLKSEL */
diff --git a/arch/arm/mach-omap2/prm.h b/arch/arm/mach-omap2/prm.h
index 03c467c35f54..a117f853ea39 100644
--- a/arch/arm/mach-omap2/prm.h
+++ b/arch/arm/mach-omap2/prm.h
@@ -17,11 +17,11 @@
17#include "prcm-common.h" 17#include "prcm-common.h"
18 18
19#define OMAP2420_PRM_REGADDR(module, reg) \ 19#define OMAP2420_PRM_REGADDR(module, reg) \
20 OMAP2_IO_ADDRESS(OMAP2420_PRM_BASE + (module) + (reg)) 20 OMAP2_L4_IO_ADDRESS(OMAP2420_PRM_BASE + (module) + (reg))
21#define OMAP2430_PRM_REGADDR(module, reg) \ 21#define OMAP2430_PRM_REGADDR(module, reg) \
22 OMAP2_IO_ADDRESS(OMAP2430_PRM_BASE + (module) + (reg)) 22 OMAP2_L4_IO_ADDRESS(OMAP2430_PRM_BASE + (module) + (reg))
23#define OMAP34XX_PRM_REGADDR(module, reg) \ 23#define OMAP34XX_PRM_REGADDR(module, reg) \
24 OMAP2_IO_ADDRESS(OMAP3430_PRM_BASE + (module) + (reg)) 24 OMAP2_L4_IO_ADDRESS(OMAP3430_PRM_BASE + (module) + (reg))
25 25
26/* 26/*
27 * Architecture-specific global PRM registers 27 * Architecture-specific global PRM registers
diff --git a/arch/arm/mach-omap2/sdram-hynix-h8mbx00u0mer-0em.h b/arch/arm/mach-omap2/sdram-hynix-h8mbx00u0mer-0em.h
new file mode 100644
index 000000000000..8bfaf342a028
--- /dev/null
+++ b/arch/arm/mach-omap2/sdram-hynix-h8mbx00u0mer-0em.h
@@ -0,0 +1,51 @@
1/*
2 * SDRC register values for the Hynix H8MBX00U0MER-0EM
3 *
4 * Copyright (C) 2009 Texas Instruments, Inc.
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
11#ifndef __ARCH_ARM_MACH_OMAP2_SDRAM_HYNIX_H8MBX00U0MER0EM
12#define __ARCH_ARM_MACH_OMAP2_SDRAM_HYNIX_H8MBX00U0MER0EM
13
14#include <plat/sdrc.h>
15
16/* Hynix H8MBX00U0MER-0EM */
17static struct omap_sdrc_params h8mbx00u0mer0em_sdrc_params[] = {
18 [0] = {
19 .rate = 200000000,
20 .actim_ctrla = 0xa2e1b4c6,
21 .actim_ctrlb = 0x0002131c,
22 .rfr_ctrl = 0x0005e601,
23 .mr = 0x00000032,
24 },
25 [1] = {
26 .rate = 166000000,
27 .actim_ctrla = 0x629db4c6,
28 .actim_ctrlb = 0x00012214,
29 .rfr_ctrl = 0x0004dc01,
30 .mr = 0x00000032,
31 },
32 [2] = {
33 .rate = 100000000,
34 .actim_ctrla = 0x51912284,
35 .actim_ctrlb = 0x0002120e,
36 .rfr_ctrl = 0x0002d101,
37 .mr = 0x00000022,
38 },
39 [3] = {
40 .rate = 83000000,
41 .actim_ctrla = 0x31512283,
42 .actim_ctrlb = 0x0001220a,
43 .rfr_ctrl = 0x00025501,
44 .mr = 0x00000022,
45 },
46 [4] = {
47 .rate = 0
48 },
49};
50
51#endif
diff --git a/arch/arm/mach-omap2/sdram-micron-mt46h32m32lf-6.h b/arch/arm/mach-omap2/sdram-micron-mt46h32m32lf-6.h
index 02e1c2d4705f..a391b4939f74 100644
--- a/arch/arm/mach-omap2/sdram-micron-mt46h32m32lf-6.h
+++ b/arch/arm/mach-omap2/sdram-micron-mt46h32m32lf-6.h
@@ -14,7 +14,7 @@
14#ifndef ARCH_ARM_MACH_OMAP2_SDRAM_MICRON_MT46H32M32LF 14#ifndef ARCH_ARM_MACH_OMAP2_SDRAM_MICRON_MT46H32M32LF
15#define ARCH_ARM_MACH_OMAP2_SDRAM_MICRON_MT46H32M32LF 15#define ARCH_ARM_MACH_OMAP2_SDRAM_MICRON_MT46H32M32LF
16 16
17#include <mach/sdrc.h> 17#include <plat/sdrc.h>
18 18
19/* Micron MT46H32M32LF-6 */ 19/* Micron MT46H32M32LF-6 */
20/* XXX Using ARE = 0x1 (no autorefresh burst) -- can this be changed? */ 20/* XXX Using ARE = 0x1 (no autorefresh burst) -- can this be changed? */
diff --git a/arch/arm/mach-omap2/sdram-qimonda-hyb18m512160af-6.h b/arch/arm/mach-omap2/sdram-qimonda-hyb18m512160af-6.h
index 3751d293cb1f..0e518a72831f 100644
--- a/arch/arm/mach-omap2/sdram-qimonda-hyb18m512160af-6.h
+++ b/arch/arm/mach-omap2/sdram-qimonda-hyb18m512160af-6.h
@@ -14,7 +14,7 @@
14#ifndef ARCH_ARM_MACH_OMAP2_SDRAM_QIMONDA_HYB18M512160AF6 14#ifndef ARCH_ARM_MACH_OMAP2_SDRAM_QIMONDA_HYB18M512160AF6
15#define ARCH_ARM_MACH_OMAP2_SDRAM_QIMONDA_HYB18M512160AF6 15#define ARCH_ARM_MACH_OMAP2_SDRAM_QIMONDA_HYB18M512160AF6
16 16
17#include <mach/sdrc.h> 17#include <plat/sdrc.h>
18 18
19/* Qimonda HYB18M512160AF-6 */ 19/* Qimonda HYB18M512160AF-6 */
20static struct omap_sdrc_params hyb18m512160af6_sdrc_params[] = { 20static struct omap_sdrc_params hyb18m512160af6_sdrc_params[] = {
diff --git a/arch/arm/mach-omap2/sdrc.c b/arch/arm/mach-omap2/sdrc.c
index 9e3bd4fa7810..9a592199321c 100644
--- a/arch/arm/mach-omap2/sdrc.c
+++ b/arch/arm/mach-omap2/sdrc.c
@@ -23,13 +23,13 @@
23#include <linux/clk.h> 23#include <linux/clk.h>
24#include <linux/io.h> 24#include <linux/io.h>
25 25
26#include <mach/common.h> 26#include <plat/common.h>
27#include <mach/clock.h> 27#include <plat/clock.h>
28#include <mach/sram.h> 28#include <plat/sram.h>
29 29
30#include "prm.h" 30#include "prm.h"
31 31
32#include <mach/sdrc.h> 32#include <plat/sdrc.h>
33#include "sdrc.h" 33#include "sdrc.h"
34 34
35static struct omap_sdrc_params *sdrc_init_params_cs0, *sdrc_init_params_cs1; 35static struct omap_sdrc_params *sdrc_init_params_cs0, *sdrc_init_params_cs1;
@@ -37,12 +37,38 @@ static struct omap_sdrc_params *sdrc_init_params_cs0, *sdrc_init_params_cs1;
37void __iomem *omap2_sdrc_base; 37void __iomem *omap2_sdrc_base;
38void __iomem *omap2_sms_base; 38void __iomem *omap2_sms_base;
39 39
40struct omap2_sms_regs {
41 u32 sms_sysconfig;
42};
43
44static struct omap2_sms_regs sms_context;
45
40/* SDRC_POWER register bits */ 46/* SDRC_POWER register bits */
41#define SDRC_POWER_EXTCLKDIS_SHIFT 3 47#define SDRC_POWER_EXTCLKDIS_SHIFT 3
42#define SDRC_POWER_PWDENA_SHIFT 2 48#define SDRC_POWER_PWDENA_SHIFT 2
43#define SDRC_POWER_PAGEPOLICY_SHIFT 0 49#define SDRC_POWER_PAGEPOLICY_SHIFT 0
44 50
45/** 51/**
52 * omap2_sms_save_context - Save SMS registers
53 *
54 * Save SMS registers that need to be restored after off mode.
55 */
56void omap2_sms_save_context(void)
57{
58 sms_context.sms_sysconfig = sms_read_reg(SMS_SYSCONFIG);
59}
60
61/**
62 * omap2_sms_restore_context - Restore SMS registers
63 *
64 * Restore SMS registers that need to be Restored after off mode.
65 */
66void omap2_sms_restore_context(void)
67{
68 sms_write_reg(sms_context.sms_sysconfig, SMS_SYSCONFIG);
69}
70
71/**
46 * omap2_sdrc_get_params - return SDRC register values for a given clock rate 72 * omap2_sdrc_get_params - return SDRC register values for a given clock rate
47 * @r: SDRC clock rate (in Hz) 73 * @r: SDRC clock rate (in Hz)
48 * @sdrc_cs0: chip select 0 ram timings ** 74 * @sdrc_cs0: chip select 0 ram timings **
@@ -132,4 +158,5 @@ void __init omap2_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
132 l = (1 << SDRC_POWER_EXTCLKDIS_SHIFT) | 158 l = (1 << SDRC_POWER_EXTCLKDIS_SHIFT) |
133 (1 << SDRC_POWER_PAGEPOLICY_SHIFT); 159 (1 << SDRC_POWER_PAGEPOLICY_SHIFT);
134 sdrc_write_reg(l, SDRC_POWER); 160 sdrc_write_reg(l, SDRC_POWER);
161 omap2_sms_save_context();
135} 162}
diff --git a/arch/arm/mach-omap2/sdrc.h b/arch/arm/mach-omap2/sdrc.h
index 0837eda5f2b6..48207b018989 100644
--- a/arch/arm/mach-omap2/sdrc.h
+++ b/arch/arm/mach-omap2/sdrc.h
@@ -15,7 +15,7 @@
15 */ 15 */
16#undef DEBUG 16#undef DEBUG
17 17
18#include <mach/sdrc.h> 18#include <plat/sdrc.h>
19 19
20#ifndef __ASSEMBLER__ 20#ifndef __ASSEMBLER__
21extern void __iomem *omap2_sdrc_base; 21extern void __iomem *omap2_sdrc_base;
@@ -48,9 +48,12 @@ static inline u32 sms_read_reg(u16 reg)
48 return __raw_readl(OMAP_SMS_REGADDR(reg)); 48 return __raw_readl(OMAP_SMS_REGADDR(reg));
49} 49}
50#else 50#else
51#define OMAP242X_SDRC_REGADDR(reg) OMAP2_IO_ADDRESS(OMAP2420_SDRC_BASE + (reg)) 51#define OMAP242X_SDRC_REGADDR(reg) \
52#define OMAP243X_SDRC_REGADDR(reg) OMAP2_IO_ADDRESS(OMAP243X_SDRC_BASE + (reg)) 52 OMAP2_L3_IO_ADDRESS(OMAP2420_SDRC_BASE + (reg))
53#define OMAP34XX_SDRC_REGADDR(reg) OMAP2_IO_ADDRESS(OMAP343X_SDRC_BASE + (reg)) 53#define OMAP243X_SDRC_REGADDR(reg) \
54 OMAP2_L3_IO_ADDRESS(OMAP243X_SDRC_BASE + (reg))
55#define OMAP34XX_SDRC_REGADDR(reg) \
56 OMAP2_L3_IO_ADDRESS(OMAP343X_SDRC_BASE + (reg))
54#endif /* __ASSEMBLER__ */ 57#endif /* __ASSEMBLER__ */
55 58
56#endif 59#endif
diff --git a/arch/arm/mach-omap2/sdrc2xxx.c b/arch/arm/mach-omap2/sdrc2xxx.c
index feaec7eaf6bd..0f4d27aef44d 100644
--- a/arch/arm/mach-omap2/sdrc2xxx.c
+++ b/arch/arm/mach-omap2/sdrc2xxx.c
@@ -24,13 +24,13 @@
24#include <linux/clk.h> 24#include <linux/clk.h>
25#include <linux/io.h> 25#include <linux/io.h>
26 26
27#include <mach/common.h> 27#include <plat/common.h>
28#include <mach/clock.h> 28#include <plat/clock.h>
29#include <mach/sram.h> 29#include <plat/sram.h>
30 30
31#include "prm.h" 31#include "prm.h"
32#include "clock.h" 32#include "clock.h"
33#include <mach/sdrc.h> 33#include <plat/sdrc.h>
34#include "sdrc.h" 34#include "sdrc.h"
35 35
36/* Memory timing, DLL mode flags */ 36/* Memory timing, DLL mode flags */
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index 54dfeb5d5667..2e17b57f5b23 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -24,10 +24,10 @@
24#include <linux/clk.h> 24#include <linux/clk.h>
25#include <linux/io.h> 25#include <linux/io.h>
26 26
27#include <mach/common.h> 27#include <plat/common.h>
28#include <mach/board.h> 28#include <plat/board.h>
29#include <mach/clock.h> 29#include <plat/clock.h>
30#include <mach/control.h> 30#include <plat/control.h>
31 31
32#include "prm.h" 32#include "prm.h"
33#include "pm.h" 33#include "pm.h"
@@ -73,7 +73,6 @@ static LIST_HEAD(uart_list);
73 73
74static struct plat_serial8250_port serial_platform_data0[] = { 74static struct plat_serial8250_port serial_platform_data0[] = {
75 { 75 {
76 .membase = OMAP2_IO_ADDRESS(OMAP_UART1_BASE),
77 .mapbase = OMAP_UART1_BASE, 76 .mapbase = OMAP_UART1_BASE,
78 .irq = 72, 77 .irq = 72,
79 .flags = UPF_BOOT_AUTOCONF, 78 .flags = UPF_BOOT_AUTOCONF,
@@ -87,7 +86,6 @@ static struct plat_serial8250_port serial_platform_data0[] = {
87 86
88static struct plat_serial8250_port serial_platform_data1[] = { 87static struct plat_serial8250_port serial_platform_data1[] = {
89 { 88 {
90 .membase = OMAP2_IO_ADDRESS(OMAP_UART2_BASE),
91 .mapbase = OMAP_UART2_BASE, 89 .mapbase = OMAP_UART2_BASE,
92 .irq = 73, 90 .irq = 73,
93 .flags = UPF_BOOT_AUTOCONF, 91 .flags = UPF_BOOT_AUTOCONF,
@@ -101,7 +99,6 @@ static struct plat_serial8250_port serial_platform_data1[] = {
101 99
102static struct plat_serial8250_port serial_platform_data2[] = { 100static struct plat_serial8250_port serial_platform_data2[] = {
103 { 101 {
104 .membase = OMAP2_IO_ADDRESS(OMAP_UART3_BASE),
105 .mapbase = OMAP_UART3_BASE, 102 .mapbase = OMAP_UART3_BASE,
106 .irq = 74, 103 .irq = 74,
107 .flags = UPF_BOOT_AUTOCONF, 104 .flags = UPF_BOOT_AUTOCONF,
@@ -116,7 +113,6 @@ static struct plat_serial8250_port serial_platform_data2[] = {
116#ifdef CONFIG_ARCH_OMAP4 113#ifdef CONFIG_ARCH_OMAP4
117static struct plat_serial8250_port serial_platform_data3[] = { 114static struct plat_serial8250_port serial_platform_data3[] = {
118 { 115 {
119 .membase = OMAP2_IO_ADDRESS(OMAP_UART4_BASE),
120 .mapbase = OMAP_UART4_BASE, 116 .mapbase = OMAP_UART4_BASE,
121 .irq = 70, 117 .irq = 70,
122 .flags = UPF_BOOT_AUTOCONF, 118 .flags = UPF_BOOT_AUTOCONF,
@@ -159,8 +155,6 @@ static inline void __init omap_uart_reset(struct omap_uart_state *uart)
159 155
160#if defined(CONFIG_PM) && defined(CONFIG_ARCH_OMAP3) 156#if defined(CONFIG_PM) && defined(CONFIG_ARCH_OMAP3)
161 157
162static int enable_off_mode; /* to be removed by full off-mode patches */
163
164static void omap_uart_save_context(struct omap_uart_state *uart) 158static void omap_uart_save_context(struct omap_uart_state *uart)
165{ 159{
166 u16 lcr = 0; 160 u16 lcr = 0;
@@ -539,7 +533,7 @@ static inline void omap_uart_idle_init(struct omap_uart_state *uart) {}
539#define DEV_CREATE_FILE(dev, attr) 533#define DEV_CREATE_FILE(dev, attr)
540#endif /* CONFIG_PM */ 534#endif /* CONFIG_PM */
541 535
542static struct omap_uart_state omap_uart[OMAP_MAX_NR_PORTS] = { 536static struct omap_uart_state omap_uart[] = {
543 { 537 {
544 .pdev = { 538 .pdev = {
545 .name = "serial8250", 539 .name = "serial8250",
@@ -589,12 +583,22 @@ void __init omap_serial_early_init(void)
589 * if not needed. 583 * if not needed.
590 */ 584 */
591 585
592 for (i = 0; i < OMAP_MAX_NR_PORTS; i++) { 586 for (i = 0; i < ARRAY_SIZE(omap_uart); i++) {
593 struct omap_uart_state *uart = &omap_uart[i]; 587 struct omap_uart_state *uart = &omap_uart[i];
594 struct platform_device *pdev = &uart->pdev; 588 struct platform_device *pdev = &uart->pdev;
595 struct device *dev = &pdev->dev; 589 struct device *dev = &pdev->dev;
596 struct plat_serial8250_port *p = dev->platform_data; 590 struct plat_serial8250_port *p = dev->platform_data;
597 591
592 /*
593 * Module 4KB + L4 interconnect 4KB
594 * Static mapping, never released
595 */
596 p->membase = ioremap(p->mapbase, SZ_8K);
597 if (!p->membase) {
598 printk(KERN_ERR "ioremap failed for uart%i\n", i + 1);
599 continue;
600 }
601
598 sprintf(name, "uart%d_ick", i+1); 602 sprintf(name, "uart%d_ick", i+1);
599 uart->ick = clk_get(NULL, name); 603 uart->ick = clk_get(NULL, name);
600 if (IS_ERR(uart->ick)) { 604 if (IS_ERR(uart->ick)) {
@@ -631,7 +635,7 @@ void __init omap_serial_init(void)
631{ 635{
632 int i; 636 int i;
633 637
634 for (i = 0; i < OMAP_MAX_NR_PORTS; i++) { 638 for (i = 0; i < ARRAY_SIZE(omap_uart); i++) {
635 struct omap_uart_state *uart = &omap_uart[i]; 639 struct omap_uart_state *uart = &omap_uart[i];
636 struct platform_device *pdev = &uart->pdev; 640 struct platform_device *pdev = &uart->pdev;
637 struct device *dev = &pdev->dev; 641 struct device *dev = &pdev->dev;
diff --git a/arch/arm/mach-omap2/sleep24xx.S b/arch/arm/mach-omap2/sleep24xx.S
index 130aadbfa083..c7780cc8d919 100644
--- a/arch/arm/mach-omap2/sleep24xx.S
+++ b/arch/arm/mach-omap2/sleep24xx.S
@@ -29,7 +29,7 @@
29#include <asm/assembler.h> 29#include <asm/assembler.h>
30#include <mach/io.h> 30#include <mach/io.h>
31 31
32#include <mach/omap24xx.h> 32#include <plat/omap24xx.h>
33 33
34#include "sdrc.h" 34#include "sdrc.h"
35 35
diff --git a/arch/arm/mach-omap2/sleep34xx.S b/arch/arm/mach-omap2/sleep34xx.S
index e5e2553e79a6..15268f8b61de 100644
--- a/arch/arm/mach-omap2/sleep34xx.S
+++ b/arch/arm/mach-omap2/sleep34xx.S
@@ -27,22 +27,35 @@
27#include <linux/linkage.h> 27#include <linux/linkage.h>
28#include <asm/assembler.h> 28#include <asm/assembler.h>
29#include <mach/io.h> 29#include <mach/io.h>
30#include <mach/control.h> 30#include <plat/control.h>
31 31
32#include "cm.h"
32#include "prm.h" 33#include "prm.h"
33#include "sdrc.h" 34#include "sdrc.h"
34 35
35#define PM_PREPWSTST_CORE_V OMAP34XX_PRM_REGADDR(CORE_MOD, \ 36#define PM_PREPWSTST_CORE_V OMAP34XX_PRM_REGADDR(CORE_MOD, \
36 OMAP3430_PM_PREPWSTST) 37 OMAP3430_PM_PREPWSTST)
38#define PM_PREPWSTST_CORE_P 0x48306AE8
37#define PM_PREPWSTST_MPU_V OMAP34XX_PRM_REGADDR(MPU_MOD, \ 39#define PM_PREPWSTST_MPU_V OMAP34XX_PRM_REGADDR(MPU_MOD, \
38 OMAP3430_PM_PREPWSTST) 40 OMAP3430_PM_PREPWSTST)
39#define PM_PWSTCTRL_MPU_P OMAP34XX_PRM_REGADDR(MPU_MOD, PM_PWSTCTRL) 41#define PM_PWSTCTRL_MPU_P OMAP3430_PRM_BASE + MPU_MOD + PM_PWSTCTRL
42#define CM_IDLEST1_CORE_V OMAP34XX_CM_REGADDR(CORE_MOD, CM_IDLEST1)
43#define SRAM_BASE_P 0x40200000
44#define CONTROL_STAT 0x480022F0
40#define SCRATCHPAD_MEM_OFFS 0x310 /* Move this as correct place is 45#define SCRATCHPAD_MEM_OFFS 0x310 /* Move this as correct place is
41 * available */ 46 * available */
42#define SCRATCHPAD_BASE_P OMAP343X_CTRL_REGADDR(\ 47#define SCRATCHPAD_BASE_P (OMAP343X_CTRL_BASE + OMAP343X_CONTROL_MEM_WKUP\
43 OMAP343X_CONTROL_MEM_WKUP +\ 48 + SCRATCHPAD_MEM_OFFS)
44 SCRATCHPAD_MEM_OFFS)
45#define SDRC_POWER_V OMAP34XX_SDRC_REGADDR(SDRC_POWER) 49#define SDRC_POWER_V OMAP34XX_SDRC_REGADDR(SDRC_POWER)
50#define SDRC_SYSCONFIG_P (OMAP343X_SDRC_BASE + SDRC_SYSCONFIG)
51#define SDRC_MR_0_P (OMAP343X_SDRC_BASE + SDRC_MR_0)
52#define SDRC_EMR2_0_P (OMAP343X_SDRC_BASE + SDRC_EMR2_0)
53#define SDRC_MANUAL_0_P (OMAP343X_SDRC_BASE + SDRC_MANUAL_0)
54#define SDRC_MR_1_P (OMAP343X_SDRC_BASE + SDRC_MR_1)
55#define SDRC_EMR2_1_P (OMAP343X_SDRC_BASE + SDRC_EMR2_1)
56#define SDRC_MANUAL_1_P (OMAP343X_SDRC_BASE + SDRC_MANUAL_1)
57#define SDRC_DLLA_STATUS_V OMAP34XX_SDRC_REGADDR(SDRC_DLLA_STATUS)
58#define SDRC_DLLA_CTRL_V OMAP34XX_SDRC_REGADDR(SDRC_DLLA_CTRL)
46 59
47 .text 60 .text
48/* Function call to get the restore pointer for resume from OFF */ 61/* Function call to get the restore pointer for resume from OFF */
@@ -51,7 +64,93 @@ ENTRY(get_restore_pointer)
51 adr r0, restore 64 adr r0, restore
52 ldmfd sp!, {pc} @ restore regs and return 65 ldmfd sp!, {pc} @ restore regs and return
53ENTRY(get_restore_pointer_sz) 66ENTRY(get_restore_pointer_sz)
54 .word . - get_restore_pointer_sz 67 .word . - get_restore_pointer
68
69 .text
70/* Function call to get the restore pointer for for ES3 to resume from OFF */
71ENTRY(get_es3_restore_pointer)
72 stmfd sp!, {lr} @ save registers on stack
73 adr r0, restore_es3
74 ldmfd sp!, {pc} @ restore regs and return
75ENTRY(get_es3_restore_pointer_sz)
76 .word . - get_es3_restore_pointer
77
78ENTRY(es3_sdrc_fix)
79 ldr r4, sdrc_syscfg @ get config addr
80 ldr r5, [r4] @ get value
81 tst r5, #0x100 @ is part access blocked
82 it eq
83 biceq r5, r5, #0x100 @ clear bit if set
84 str r5, [r4] @ write back change
85 ldr r4, sdrc_mr_0 @ get config addr
86 ldr r5, [r4] @ get value
87 str r5, [r4] @ write back change
88 ldr r4, sdrc_emr2_0 @ get config addr
89 ldr r5, [r4] @ get value
90 str r5, [r4] @ write back change
91 ldr r4, sdrc_manual_0 @ get config addr
92 mov r5, #0x2 @ autorefresh command
93 str r5, [r4] @ kick off refreshes
94 ldr r4, sdrc_mr_1 @ get config addr
95 ldr r5, [r4] @ get value
96 str r5, [r4] @ write back change
97 ldr r4, sdrc_emr2_1 @ get config addr
98 ldr r5, [r4] @ get value
99 str r5, [r4] @ write back change
100 ldr r4, sdrc_manual_1 @ get config addr
101 mov r5, #0x2 @ autorefresh command
102 str r5, [r4] @ kick off refreshes
103 bx lr
104sdrc_syscfg:
105 .word SDRC_SYSCONFIG_P
106sdrc_mr_0:
107 .word SDRC_MR_0_P
108sdrc_emr2_0:
109 .word SDRC_EMR2_0_P
110sdrc_manual_0:
111 .word SDRC_MANUAL_0_P
112sdrc_mr_1:
113 .word SDRC_MR_1_P
114sdrc_emr2_1:
115 .word SDRC_EMR2_1_P
116sdrc_manual_1:
117 .word SDRC_MANUAL_1_P
118ENTRY(es3_sdrc_fix_sz)
119 .word . - es3_sdrc_fix
120
121/* Function to call rom code to save secure ram context */
122ENTRY(save_secure_ram_context)
123 stmfd sp!, {r1-r12, lr} @ save registers on stack
124save_secure_ram_debug:
125 /* b save_secure_ram_debug */ @ enable to debug save code
126 adr r3, api_params @ r3 points to parameters
127 str r0, [r3,#0x4] @ r0 has sdram address
128 ldr r12, high_mask
129 and r3, r3, r12
130 ldr r12, sram_phy_addr_mask
131 orr r3, r3, r12
132 mov r0, #25 @ set service ID for PPA
133 mov r12, r0 @ copy secure service ID in r12
134 mov r1, #0 @ set task id for ROM code in r1
135 mov r2, #4 @ set some flags in r2, r6
136 mov r6, #0xff
137 mcr p15, 0, r0, c7, c10, 4 @ data write barrier
138 mcr p15, 0, r0, c7, c10, 5 @ data memory barrier
139 .word 0xE1600071 @ call SMI monitor (smi #1)
140 nop
141 nop
142 nop
143 nop
144 ldmfd sp!, {r1-r12, pc}
145sram_phy_addr_mask:
146 .word SRAM_BASE_P
147high_mask:
148 .word 0xffff
149api_params:
150 .word 0x4, 0x0, 0x0, 0x1, 0x1
151ENTRY(save_secure_ram_context_sz)
152 .word . - save_secure_ram_context
153
55/* 154/*
56 * Forces OMAP into idle state 155 * Forces OMAP into idle state
57 * 156 *
@@ -92,11 +191,29 @@ loop:
92 nop 191 nop
93 nop 192 nop
94 nop 193 nop
95 bl i_dll_wait 194 bl wait_sdrc_ok
96 195
97 ldmfd sp!, {r0-r12, pc} @ restore regs and return 196 ldmfd sp!, {r0-r12, pc} @ restore regs and return
197restore_es3:
198 /*b restore_es3*/ @ Enable to debug restore code
199 ldr r5, pm_prepwstst_core_p
200 ldr r4, [r5]
201 and r4, r4, #0x3
202 cmp r4, #0x0 @ Check if previous power state of CORE is OFF
203 bne restore
204 adr r0, es3_sdrc_fix
205 ldr r1, sram_base
206 ldr r2, es3_sdrc_fix_sz
207 mov r2, r2, ror #2
208copy_to_sram:
209 ldmia r0!, {r3} @ val = *src
210 stmia r1!, {r3} @ *dst = val
211 subs r2, r2, #0x1 @ num_words--
212 bne copy_to_sram
213 ldr r1, sram_base
214 blx r1
98restore: 215restore:
99 /* b restore*/ @ Enable to debug restore code 216 /* b restore*/ @ Enable to debug restore code
100 /* Check what was the reason for mpu reset and store the reason in r9*/ 217 /* Check what was the reason for mpu reset and store the reason in r9*/
101 /* 1 - Only L1 and logic lost */ 218 /* 1 - Only L1 and logic lost */
102 /* 2 - Only L2 lost - In this case, we wont be here */ 219 /* 2 - Only L2 lost - In this case, we wont be here */
@@ -108,9 +225,44 @@ restore:
108 moveq r9, #0x3 @ MPU OFF => L1 and L2 lost 225 moveq r9, #0x3 @ MPU OFF => L1 and L2 lost
109 movne r9, #0x1 @ Only L1 and L2 lost => avoid L2 invalidation 226 movne r9, #0x1 @ Only L1 and L2 lost => avoid L2 invalidation
110 bne logic_l1_restore 227 bne logic_l1_restore
228 ldr r0, control_stat
229 ldr r1, [r0]
230 and r1, #0x700
231 cmp r1, #0x300
232 beq l2_inv_gp
233 mov r0, #40 @ set service ID for PPA
234 mov r12, r0 @ copy secure Service ID in r12
235 mov r1, #0 @ set task id for ROM code in r1
236 mov r2, #4 @ set some flags in r2, r6
237 mov r6, #0xff
238 adr r3, l2_inv_api_params @ r3 points to dummy parameters
239 mcr p15, 0, r0, c7, c10, 4 @ data write barrier
240 mcr p15, 0, r0, c7, c10, 5 @ data memory barrier
241 .word 0xE1600071 @ call SMI monitor (smi #1)
242 /* Write to Aux control register to set some bits */
243 mov r0, #42 @ set service ID for PPA
244 mov r12, r0 @ copy secure Service ID in r12
245 mov r1, #0 @ set task id for ROM code in r1
246 mov r2, #4 @ set some flags in r2, r6
247 mov r6, #0xff
248 adr r3, write_aux_control_params @ r3 points to parameters
249 mcr p15, 0, r0, c7, c10, 4 @ data write barrier
250 mcr p15, 0, r0, c7, c10, 5 @ data memory barrier
251 .word 0xE1600071 @ call SMI monitor (smi #1)
252
253 b logic_l1_restore
254l2_inv_api_params:
255 .word 0x1, 0x00
256write_aux_control_params:
257 .word 0x1, 0x72
258l2_inv_gp:
111 /* Execute smi to invalidate L2 cache */ 259 /* Execute smi to invalidate L2 cache */
112 mov r12, #0x1 @ set up to invalide L2 260 mov r12, #0x1 @ set up to invalide L2
113smi: .word 0xE1600070 @ Call SMI monitor (smieq) 261smi: .word 0xE1600070 @ Call SMI monitor (smieq)
262 /* Write to Aux control register to set some bits */
263 mov r0, #0x72
264 mov r12, #0x3
265 .word 0xE1600070 @ Call SMI monitor (smieq)
114logic_l1_restore: 266logic_l1_restore:
115 mov r1, #0 267 mov r1, #0
116 /* Invalidate all instruction caches to PoU 268 /* Invalidate all instruction caches to PoU
@@ -391,33 +543,55 @@ skip_l2_inval:
391 nop 543 nop
392 nop 544 nop
393 nop 545 nop
394 bl i_dll_wait 546 bl wait_sdrc_ok
395 /* restore regs and return */ 547 /* restore regs and return */
396 ldmfd sp!, {r0-r12, pc} 548 ldmfd sp!, {r0-r12, pc}
397 549
398i_dll_wait: 550/* Make sure SDRC accesses are ok */
399 ldr r4, clk_stabilize_delay 551wait_sdrc_ok:
552 ldr r4, cm_idlest1_core
553 ldr r5, [r4]
554 and r5, r5, #0x2
555 cmp r5, #0
556 bne wait_sdrc_ok
557 ldr r4, sdrc_power
558 ldr r5, [r4]
559 bic r5, r5, #0x40
560 str r5, [r4]
561wait_dll_lock:
562 /* Is dll in lock mode? */
563 ldr r4, sdrc_dlla_ctrl
564 ldr r5, [r4]
565 tst r5, #0x4
566 bxne lr
567 /* wait till dll locks */
568 ldr r4, sdrc_dlla_status
569 ldr r5, [r4]
570 and r5, r5, #0x4
571 cmp r5, #0x4
572 bne wait_dll_lock
573 bx lr
400 574
401i_dll_delay: 575cm_idlest1_core:
402 subs r4, r4, #0x1 576 .word CM_IDLEST1_CORE_V
403 bne i_dll_delay 577sdrc_dlla_status:
404 ldr r4, sdrc_power 578 .word SDRC_DLLA_STATUS_V
405 ldr r5, [r4] 579sdrc_dlla_ctrl:
406 bic r5, r5, #0x40 580 .word SDRC_DLLA_CTRL_V
407 str r5, [r4]
408 bx lr
409pm_prepwstst_core: 581pm_prepwstst_core:
410 .word PM_PREPWSTST_CORE_V 582 .word PM_PREPWSTST_CORE_V
583pm_prepwstst_core_p:
584 .word PM_PREPWSTST_CORE_P
411pm_prepwstst_mpu: 585pm_prepwstst_mpu:
412 .word PM_PREPWSTST_MPU_V 586 .word PM_PREPWSTST_MPU_V
413pm_pwstctrl_mpu: 587pm_pwstctrl_mpu:
414 .word PM_PWSTCTRL_MPU_P 588 .word PM_PWSTCTRL_MPU_P
415scratchpad_base: 589scratchpad_base:
416 .word SCRATCHPAD_BASE_P 590 .word SCRATCHPAD_BASE_P
591sram_base:
592 .word SRAM_BASE_P + 0x8000
417sdrc_power: 593sdrc_power:
418 .word SDRC_POWER_V 594 .word SDRC_POWER_V
419context_mem:
420 .word 0x803E3E14
421clk_stabilize_delay: 595clk_stabilize_delay:
422 .word 0x000001FF 596 .word 0x000001FF
423assoc_mask: 597assoc_mask:
@@ -432,5 +606,7 @@ table_entry:
432 .word 0x00000C02 606 .word 0x00000C02
433cache_pred_disable_mask: 607cache_pred_disable_mask:
434 .word 0xFFFFE7FB 608 .word 0xFFFFE7FB
609control_stat:
610 .word CONTROL_STAT
435ENTRY(omap34xx_cpu_suspend_sz) 611ENTRY(omap34xx_cpu_suspend_sz)
436 .word . - omap34xx_cpu_suspend 612 .word . - omap34xx_cpu_suspend
diff --git a/arch/arm/mach-omap2/sram242x.S b/arch/arm/mach-omap2/sram242x.S
index 9b62208658bc..92e6e1a12af8 100644
--- a/arch/arm/mach-omap2/sram242x.S
+++ b/arch/arm/mach-omap2/sram242x.S
@@ -128,7 +128,7 @@ omap242x_sdi_prcm_voltctrl:
128prcm_mask_val: 128prcm_mask_val:
129 .word 0xFFFF3FFC 129 .word 0xFFFF3FFC
130omap242x_sdi_timer_32ksynct_cr: 130omap242x_sdi_timer_32ksynct_cr:
131 .word OMAP2_IO_ADDRESS(OMAP2420_32KSYNCT_BASE + 0x010) 131 .word OMAP2_L4_IO_ADDRESS(OMAP2420_32KSYNCT_BASE + 0x010)
132ENTRY(omap242x_sram_ddr_init_sz) 132ENTRY(omap242x_sram_ddr_init_sz)
133 .word . - omap242x_sram_ddr_init 133 .word . - omap242x_sram_ddr_init
134 134
@@ -224,7 +224,7 @@ omap242x_srs_prcm_voltctrl:
224ddr_prcm_mask_val: 224ddr_prcm_mask_val:
225 .word 0xFFFF3FFC 225 .word 0xFFFF3FFC
226omap242x_srs_timer_32ksynct: 226omap242x_srs_timer_32ksynct:
227 .word OMAP2_IO_ADDRESS(OMAP2420_32KSYNCT_BASE + 0x010) 227 .word OMAP2_L4_IO_ADDRESS(OMAP2420_32KSYNCT_BASE + 0x010)
228 228
229ENTRY(omap242x_sram_reprogram_sdrc_sz) 229ENTRY(omap242x_sram_reprogram_sdrc_sz)
230 .word . - omap242x_sram_reprogram_sdrc 230 .word . - omap242x_sram_reprogram_sdrc
diff --git a/arch/arm/mach-omap2/sram243x.S b/arch/arm/mach-omap2/sram243x.S
index df2cd9277c00..ab4973695c71 100644
--- a/arch/arm/mach-omap2/sram243x.S
+++ b/arch/arm/mach-omap2/sram243x.S
@@ -128,7 +128,7 @@ omap243x_sdi_prcm_voltctrl:
128prcm_mask_val: 128prcm_mask_val:
129 .word 0xFFFF3FFC 129 .word 0xFFFF3FFC
130omap243x_sdi_timer_32ksynct_cr: 130omap243x_sdi_timer_32ksynct_cr:
131 .word OMAP2_IO_ADDRESS(OMAP2430_32KSYNCT_BASE + 0x010) 131 .word OMAP2_L4_IO_ADDRESS(OMAP2430_32KSYNCT_BASE + 0x010)
132ENTRY(omap243x_sram_ddr_init_sz) 132ENTRY(omap243x_sram_ddr_init_sz)
133 .word . - omap243x_sram_ddr_init 133 .word . - omap243x_sram_ddr_init
134 134
@@ -224,7 +224,7 @@ omap243x_srs_prcm_voltctrl:
224ddr_prcm_mask_val: 224ddr_prcm_mask_val:
225 .word 0xFFFF3FFC 225 .word 0xFFFF3FFC
226omap243x_srs_timer_32ksynct: 226omap243x_srs_timer_32ksynct:
227 .word OMAP2_IO_ADDRESS(OMAP2430_32KSYNCT_BASE + 0x010) 227 .word OMAP2_L4_IO_ADDRESS(OMAP2430_32KSYNCT_BASE + 0x010)
228 228
229ENTRY(omap243x_sram_reprogram_sdrc_sz) 229ENTRY(omap243x_sram_reprogram_sdrc_sz)
230 .word . - omap243x_sram_reprogram_sdrc 230 .word . - omap243x_sram_reprogram_sdrc
diff --git a/arch/arm/mach-omap2/timer-gp.c b/arch/arm/mach-omap2/timer-gp.c
index e2338c0aebcf..cd04deaa88c5 100644
--- a/arch/arm/mach-omap2/timer-gp.c
+++ b/arch/arm/mach-omap2/timer-gp.c
@@ -37,7 +37,7 @@
37#include <linux/clockchips.h> 37#include <linux/clockchips.h>
38 38
39#include <asm/mach/time.h> 39#include <asm/mach/time.h>
40#include <mach/dmtimer.h> 40#include <plat/dmtimer.h>
41#include <asm/localtimer.h> 41#include <asm/localtimer.h>
42 42
43/* MAX_GPTIMER_ID: number of GPTIMERs on the chip */ 43/* MAX_GPTIMER_ID: number of GPTIMERs on the chip */
@@ -47,6 +47,7 @@ static struct omap_dm_timer *gptimer;
47static struct clock_event_device clockevent_gpt; 47static struct clock_event_device clockevent_gpt;
48static u8 __initdata gptimer_id = 1; 48static u8 __initdata gptimer_id = 1;
49static u8 __initdata inited; 49static u8 __initdata inited;
50struct omap_dm_timer *gptimer_wakeup;
50 51
51static irqreturn_t omap2_gp_timer_interrupt(int irq, void *dev_id) 52static irqreturn_t omap2_gp_timer_interrupt(int irq, void *dev_id)
52{ 53{
@@ -134,6 +135,7 @@ static void __init omap2_gp_clockevent_init(void)
134 135
135 gptimer = omap_dm_timer_request_specific(gptimer_id); 136 gptimer = omap_dm_timer_request_specific(gptimer_id);
136 BUG_ON(gptimer == NULL); 137 BUG_ON(gptimer == NULL);
138 gptimer_wakeup = gptimer;
137 139
138#if defined(CONFIG_OMAP_32K_TIMER) 140#if defined(CONFIG_OMAP_32K_TIMER)
139 src = OMAP_TIMER_SRC_32_KHZ; 141 src = OMAP_TIMER_SRC_32_KHZ;
@@ -231,7 +233,8 @@ static void __init omap2_gp_clocksource_init(void)
231static void __init omap2_gp_timer_init(void) 233static void __init omap2_gp_timer_init(void)
232{ 234{
233#ifdef CONFIG_LOCAL_TIMERS 235#ifdef CONFIG_LOCAL_TIMERS
234 twd_base = OMAP2_IO_ADDRESS(OMAP44XX_LOCAL_TWD_BASE); 236 twd_base = ioremap(OMAP44XX_LOCAL_TWD_BASE, SZ_256);
237 BUG_ON(!twd_base);
235#endif 238#endif
236 omap_dm_timer_init(); 239 omap_dm_timer_init();
237 240
diff --git a/arch/arm/mach-omap2/usb-ehci.c b/arch/arm/mach-omap2/usb-ehci.c
new file mode 100644
index 000000000000..e448abd5ec5d
--- /dev/null
+++ b/arch/arm/mach-omap2/usb-ehci.c
@@ -0,0 +1,192 @@
1/*
2 * linux/arch/arm/mach-omap2/usb-ehci.c
3 *
4 * This file will contain the board specific details for the
5 * Synopsys EHCI host controller on OMAP3430
6 *
7 * Copyright (C) 2007 Texas Instruments
8 * Author: Vikram Pandita <vikram.pandita@ti.com>
9 *
10 * Generalization by:
11 * Felipe Balbi <felipe.balbi@nokia.com>
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License version 2 as
15 * published by the Free Software Foundation.
16 */
17
18#include <linux/types.h>
19#include <linux/errno.h>
20#include <linux/delay.h>
21#include <linux/platform_device.h>
22#include <linux/clk.h>
23#include <asm/io.h>
24#include <plat/mux.h>
25
26#include <mach/hardware.h>
27#include <mach/irqs.h>
28#include <plat/usb.h>
29
30#if defined(CONFIG_USB_EHCI_HCD) || defined(CONFIG_USB_EHCI_HCD_MODULE)
31
32static struct resource ehci_resources[] = {
33 {
34 .start = OMAP34XX_EHCI_BASE,
35 .end = OMAP34XX_EHCI_BASE + SZ_1K - 1,
36 .flags = IORESOURCE_MEM,
37 },
38 {
39 .start = OMAP34XX_UHH_CONFIG_BASE,
40 .end = OMAP34XX_UHH_CONFIG_BASE + SZ_1K - 1,
41 .flags = IORESOURCE_MEM,
42 },
43 {
44 .start = OMAP34XX_USBTLL_BASE,
45 .end = OMAP34XX_USBTLL_BASE + SZ_4K - 1,
46 .flags = IORESOURCE_MEM,
47 },
48 { /* general IRQ */
49 .start = INT_34XX_EHCI_IRQ,
50 .flags = IORESOURCE_IRQ,
51 }
52};
53
54static u64 ehci_dmamask = ~(u32)0;
55static struct platform_device ehci_device = {
56 .name = "ehci-omap",
57 .id = 0,
58 .dev = {
59 .dma_mask = &ehci_dmamask,
60 .coherent_dma_mask = 0xffffffff,
61 .platform_data = NULL,
62 },
63 .num_resources = ARRAY_SIZE(ehci_resources),
64 .resource = ehci_resources,
65};
66
67/* MUX settings for EHCI pins */
68/*
69 * setup_ehci_io_mux - initialize IO pad mux for USBHOST
70 */
71static void setup_ehci_io_mux(enum ehci_hcd_omap_mode *port_mode)
72{
73 switch (port_mode[0]) {
74 case EHCI_HCD_OMAP_MODE_PHY:
75 omap_cfg_reg(Y9_3430_USB1HS_PHY_STP);
76 omap_cfg_reg(Y8_3430_USB1HS_PHY_CLK);
77 omap_cfg_reg(AA14_3430_USB1HS_PHY_DIR);
78 omap_cfg_reg(AA11_3430_USB1HS_PHY_NXT);
79 omap_cfg_reg(W13_3430_USB1HS_PHY_DATA0);
80 omap_cfg_reg(W12_3430_USB1HS_PHY_DATA1);
81 omap_cfg_reg(W11_3430_USB1HS_PHY_DATA2);
82 omap_cfg_reg(Y11_3430_USB1HS_PHY_DATA3);
83 omap_cfg_reg(W9_3430_USB1HS_PHY_DATA4);
84 omap_cfg_reg(Y12_3430_USB1HS_PHY_DATA5);
85 omap_cfg_reg(W8_3430_USB1HS_PHY_DATA6);
86 omap_cfg_reg(Y13_3430_USB1HS_PHY_DATA7);
87 break;
88 case EHCI_HCD_OMAP_MODE_TLL:
89 omap_cfg_reg(Y9_3430_USB1HS_TLL_STP);
90 omap_cfg_reg(Y8_3430_USB1HS_TLL_CLK);
91 omap_cfg_reg(AA14_3430_USB1HS_TLL_DIR);
92 omap_cfg_reg(AA11_3430_USB1HS_TLL_NXT);
93 omap_cfg_reg(W13_3430_USB1HS_TLL_DATA0);
94 omap_cfg_reg(W12_3430_USB1HS_TLL_DATA1);
95 omap_cfg_reg(W11_3430_USB1HS_TLL_DATA2);
96 omap_cfg_reg(Y11_3430_USB1HS_TLL_DATA3);
97 omap_cfg_reg(W9_3430_USB1HS_TLL_DATA4);
98 omap_cfg_reg(Y12_3430_USB1HS_TLL_DATA5);
99 omap_cfg_reg(W8_3430_USB1HS_TLL_DATA6);
100 omap_cfg_reg(Y13_3430_USB1HS_TLL_DATA7);
101 break;
102 case EHCI_HCD_OMAP_MODE_UNKNOWN:
103 /* FALLTHROUGH */
104 default:
105 break;
106 }
107
108 switch (port_mode[1]) {
109 case EHCI_HCD_OMAP_MODE_PHY:
110 omap_cfg_reg(AA10_3430_USB2HS_PHY_STP);
111 omap_cfg_reg(AA8_3430_USB2HS_PHY_CLK);
112 omap_cfg_reg(AA9_3430_USB2HS_PHY_DIR);
113 omap_cfg_reg(AB11_3430_USB2HS_PHY_NXT);
114 omap_cfg_reg(AB10_3430_USB2HS_PHY_DATA0);
115 omap_cfg_reg(AB9_3430_USB2HS_PHY_DATA1);
116 omap_cfg_reg(W3_3430_USB2HS_PHY_DATA2);
117 omap_cfg_reg(T4_3430_USB2HS_PHY_DATA3);
118 omap_cfg_reg(T3_3430_USB2HS_PHY_DATA4);
119 omap_cfg_reg(R3_3430_USB2HS_PHY_DATA5);
120 omap_cfg_reg(R4_3430_USB2HS_PHY_DATA6);
121 omap_cfg_reg(T2_3430_USB2HS_PHY_DATA7);
122 break;
123 case EHCI_HCD_OMAP_MODE_TLL:
124 omap_cfg_reg(AA10_3430_USB2HS_TLL_STP);
125 omap_cfg_reg(AA8_3430_USB2HS_TLL_CLK);
126 omap_cfg_reg(AA9_3430_USB2HS_TLL_DIR);
127 omap_cfg_reg(AB11_3430_USB2HS_TLL_NXT);
128 omap_cfg_reg(AB10_3430_USB2HS_TLL_DATA0);
129 omap_cfg_reg(AB9_3430_USB2HS_TLL_DATA1);
130 omap_cfg_reg(W3_3430_USB2HS_TLL_DATA2);
131 omap_cfg_reg(T4_3430_USB2HS_TLL_DATA3);
132 omap_cfg_reg(T3_3430_USB2HS_TLL_DATA4);
133 omap_cfg_reg(R3_3430_USB2HS_TLL_DATA5);
134 omap_cfg_reg(R4_3430_USB2HS_TLL_DATA6);
135 omap_cfg_reg(T2_3430_USB2HS_TLL_DATA7);
136 break;
137 case EHCI_HCD_OMAP_MODE_UNKNOWN:
138 /* FALLTHROUGH */
139 default:
140 break;
141 }
142
143 switch (port_mode[2]) {
144 case EHCI_HCD_OMAP_MODE_PHY:
145 printk(KERN_WARNING "Port3 can't be used in PHY mode\n");
146 break;
147 case EHCI_HCD_OMAP_MODE_TLL:
148 omap_cfg_reg(AB3_3430_USB3HS_TLL_STP);
149 omap_cfg_reg(AA6_3430_USB3HS_TLL_CLK);
150 omap_cfg_reg(AA3_3430_USB3HS_TLL_DIR);
151 omap_cfg_reg(Y3_3430_USB3HS_TLL_NXT);
152 omap_cfg_reg(AA5_3430_USB3HS_TLL_DATA0);
153 omap_cfg_reg(Y4_3430_USB3HS_TLL_DATA1);
154 omap_cfg_reg(Y5_3430_USB3HS_TLL_DATA2);
155 omap_cfg_reg(W5_3430_USB3HS_TLL_DATA3);
156 omap_cfg_reg(AB12_3430_USB3HS_TLL_DATA4);
157 omap_cfg_reg(AB13_3430_USB3HS_TLL_DATA5);
158 omap_cfg_reg(AA13_3430_USB3HS_TLL_DATA6);
159 omap_cfg_reg(AA12_3430_USB3HS_TLL_DATA7);
160 break;
161 case EHCI_HCD_OMAP_MODE_UNKNOWN:
162 /* FALLTHROUGH */
163 default:
164 break;
165 }
166
167 return;
168}
169
170void __init usb_ehci_init(struct ehci_hcd_omap_platform_data *pdata)
171{
172 platform_device_add_data(&ehci_device, pdata, sizeof(*pdata));
173
174 /* Setup Pin IO MUX for EHCI */
175 if (cpu_is_omap34xx())
176 setup_ehci_io_mux(pdata->port_mode);
177
178 if (platform_device_register(&ehci_device) < 0) {
179 printk(KERN_ERR "Unable to register HS-USB (EHCI) device\n");
180 return;
181 }
182}
183
184#else
185
186void __init usb_ehci_init(struct ehci_hcd_omap_platform_data *pdata)
187
188{
189}
190
191#endif /* CONFIG_USB_EHCI_HCD */
192
diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c
index 1145a2562b0f..a80441dd19b8 100644
--- a/arch/arm/mach-omap2/usb-musb.c
+++ b/arch/arm/mach-omap2/usb-musb.c
@@ -28,8 +28,8 @@
28 28
29#include <mach/hardware.h> 29#include <mach/hardware.h>
30#include <mach/irqs.h> 30#include <mach/irqs.h>
31#include <mach/mux.h> 31#include <plat/mux.h>
32#include <mach/usb.h> 32#include <plat/usb.h>
33 33
34#ifdef CONFIG_USB_MUSB_SOC 34#ifdef CONFIG_USB_MUSB_SOC
35 35
diff --git a/arch/arm/mach-omap2/usb-tusb6010.c b/arch/arm/mach-omap2/usb-tusb6010.c
index 8622c24cd270..10a2013c1104 100644
--- a/arch/arm/mach-omap2/usb-tusb6010.c
+++ b/arch/arm/mach-omap2/usb-tusb6010.c
@@ -16,8 +16,8 @@
16 16
17#include <linux/usb/musb.h> 17#include <linux/usb/musb.h>
18 18
19#include <mach/gpmc.h> 19#include <plat/gpmc.h>
20#include <mach/mux.h> 20#include <plat/mux.h>
21 21
22 22
23static u8 async_cs, sync_cs; 23static u8 async_cs, sync_cs;
diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
index a6f8eab14ba5..d89c6adbe8bc 100644
--- a/arch/arm/mach-pxa/Kconfig
+++ b/arch/arm/mach-pxa/Kconfig
@@ -2,34 +2,105 @@ if ARCH_PXA
2 2
3menu "Intel PXA2xx/PXA3xx Implementations" 3menu "Intel PXA2xx/PXA3xx Implementations"
4 4
5if PXA3xx 5comment "Intel/Marvell Dev Platforms (sorted by hardware release time)"
6 6
7menu "Supported PXA3xx Processor Variants" 7config ARCH_LUBBOCK
8 bool "Intel DBPXA250 Development Platform (aka Lubbock)"
9 select PXA25x
10 select SA1111
11 select PXA_HAVE_BOARD_IRQS
8 12
9config CPU_PXA300 13config MACH_MAINSTONE
10 bool "PXA300 (codename Monahans-L)" 14 bool "Intel HCDDBBVA0 Development Platform (aka Mainstone)"
15 select PXA27x
16 select HAVE_PWM
17 select PXA_HAVE_BOARD_IRQS
11 18
12config CPU_PXA310 19config MACH_ZYLONITE
13 bool "PXA310 (codename Monahans-LV)" 20 bool
21 select PXA3xx
22 select PXA_SSP
23 select HAVE_PWM
24 select PXA_HAVE_BOARD_IRQS
25
26config MACH_ZYLONITE300
27 bool "PXA3xx Development Platform (aka Zylonite) PXA300/310"
14 select CPU_PXA300 28 select CPU_PXA300
29 select CPU_PXA310
30 select MACH_ZYLONITE
15 31
16config CPU_PXA320 32config MACH_ZYLONITE320
17 bool "PXA320 (codename Monahans-P)" 33 bool "PXA3xx Development Platform (aka Zylonite) PXA320"
34 select CPU_PXA320
35 select MACH_ZYLONITE
18 36
19config CPU_PXA930 37config MACH_LITTLETON
20 bool "PXA930 (codename Tavor-P)" 38 bool "PXA3xx Form Factor Platform (aka Littleton)"
39 select PXA3xx
40 select PXA_SSP
21 41
22config CPU_PXA935 42config MACH_TAVOREVB
23 bool "PXA935 (codename Tavor-P65)" 43 bool "PXA930 Evaluation Board (aka TavorEVB)"
44 select PXA3xx
24 select CPU_PXA930 45 select CPU_PXA930
25 46
26config CPU_PXA950 47config MACH_SAAR
27 bool "PXA950 (codename Tavor-PV2)" 48 bool "PXA930 Handheld Platform (aka SAAR)"
49 select PXA3xx
28 select CPU_PXA930 50 select CPU_PXA930
29 51
30endmenu 52comment "Third Party Dev Platforms (sorted by vendor name)"
31 53
32endif 54config ARCH_PXA_IDP
55 bool "Accelent Xscale IDP"
56 select PXA25x
57
58config ARCH_VIPER
59 bool "Arcom/Eurotech VIPER SBC"
60 select PXA25x
61 select ISA
62 select I2C_GPIO
63 select HAVE_PWM
64 select PXA_HAVE_BOARD_IRQS
65 select PXA_HAVE_ISA_IRQS
66
67config MACH_BALLOON3
68 bool "Balloon 3 board"
69 select PXA27x
70 select IWMMXT
71 select PXA_HAVE_BOARD_IRQS
72
73config MACH_CSB726
74 bool "Enable Cogent CSB726 System On a Module"
75 select PXA27x
76 select IWMMXT
77 help
78 Say Y here if you intend to run this kernel on a Cogent
79 CSB726 System On Module.
80
81config CSB726_CSB701
82 bool "Enable support for CSB701 baseboard"
83 depends on MACH_CSB726
84
85config MACH_ARMCORE
86 bool "CompuLab CM-X255/CM-X270 modules"
87 select PXA27x
88 select IWMMXT
89 select PXA25x
90 select PXA_SSP
91
92config MACH_EM_X270
93 bool "CompuLab EM-x270 platform"
94 select PXA27x
95
96config MACH_EXEDA
97 bool "CompuLab eXeda platform"
98 select PXA27x
99
100config MACH_CM_X300
101 bool "CompuLab CM-X300 modules"
102 select PXA3xx
103 select CPU_PXA300
33 104
34config ARCH_GUMSTIX 105config ARCH_GUMSTIX
35 bool "Gumstix XScale 255 boards" 106 bool "Gumstix XScale 255 boards"
@@ -62,185 +133,24 @@ config MACH_STARGATE2
62 select IWMMXT 133 select IWMMXT
63 select PXA_HAVE_BOARD_IRQS 134 select PXA_HAVE_BOARD_IRQS
64 135
65config ARCH_LUBBOCK 136config MACH_XCEP
66 bool "Intel DBPXA250 Development Platform" 137 bool "Iskratel Electronics XCEP"
67 select PXA25x
68 select SA1111
69 select PXA_HAVE_BOARD_IRQS
70
71config MACH_LOGICPD_PXA270
72 bool "LogicPD PXA270 Card Engine Development Platform"
73 select PXA27x
74 select HAVE_PWM
75 select PXA_HAVE_BOARD_IRQS
76
77config MACH_MAINSTONE
78 bool "Intel HCDDBBVA0 Development Platform"
79 select PXA27x
80 select HAVE_PWM
81 select PXA_HAVE_BOARD_IRQS
82
83config MACH_MP900C
84 bool "Nec Mobilepro 900/c"
85 select PXA25x
86
87config MACH_BALLOON3
88 bool "Balloon 3 board"
89 select PXA27x
90 select IWMMXT
91 select PXA_HAVE_BOARD_IRQS
92
93config ARCH_PXA_IDP
94 bool "Accelent Xscale IDP"
95 select PXA25x
96
97config PXA_SHARPSL
98 bool "SHARP Zaurus SL-5600, SL-C7xx and SL-Cxx00 Models"
99 select SHARP_SCOOP
100 select SHARP_PARAM
101 help
102 Say Y here if you intend to run this kernel on a
103 Sharp Zaurus SL-5600 (Poodle), SL-C700 (Corgi),
104 SL-C750 (Shepherd), SL-C760 (Husky), SL-C1000 (Akita),
105 SL-C3000 (Spitz), SL-C3100 (Borzoi) or SL-C6000x (Tosa)
106 handheld computer.
107
108config SHARPSL_PM
109 bool
110 select APM_EMULATION
111
112config CORGI_SSP_DEPRECATED
113 bool
114 select PXA_SSP
115 help
116 This option will include corgi_ssp.c and corgi_lcd.c
117 that corgi_ts.c and other legacy drivers (corgi_bl.c
118 and sharpsl_pm.c) may depend on.
119
120config MACH_POODLE
121 bool "Enable Sharp SL-5600 (Poodle) Support"
122 depends on PXA_SHARPSL
123 select PXA25x 138 select PXA25x
124 select SHARP_LOCOMO 139 select MTD
140 select MTD_PARTITIONS
141 select MTD_PHYSMAP
142 select MTD_CFI_INTELEXT
143 select MTD_CFI
144 select MTD_CHAR
145 select SMC91X
125 select PXA_SSP 146 select PXA_SSP
126
127config MACH_CORGI
128 bool "Enable Sharp SL-C700 (Corgi) Support"
129 depends on PXA_SHARPSL
130 select PXA25x
131 select PXA_SHARP_C7xx
132
133config MACH_SHEPHERD
134 bool "Enable Sharp SL-C750 (Shepherd) Support"
135 depends on PXA_SHARPSL
136 select PXA25x
137 select PXA_SHARP_C7xx
138
139config MACH_HUSKY
140 bool "Enable Sharp SL-C760 (Husky) Support"
141 depends on PXA_SHARPSL
142 select PXA25x
143 select PXA_SHARP_C7xx
144
145config MACH_AKITA
146 bool "Enable Sharp SL-1000 (Akita) Support"
147 depends on PXA_SHARPSL
148 select PXA27x
149 select PXA_SHARP_Cxx00
150 select MACH_SPITZ
151 select I2C
152 select I2C_PXA
153
154config MACH_SPITZ
155 bool "Enable Sharp Zaurus SL-3000 (Spitz) Support"
156 depends on PXA_SHARPSL
157 select PXA27x
158 select PXA_SHARP_Cxx00
159
160config MACH_BORZOI
161 bool "Enable Sharp Zaurus SL-3100 (Borzoi) Support"
162 depends on PXA_SHARPSL
163 select PXA27x
164 select PXA_SHARP_Cxx00
165
166config MACH_TOSA
167 bool "Enable Sharp SL-6000x (Tosa) Support"
168 depends on PXA_SHARPSL
169 select PXA25x
170 select PXA_HAVE_BOARD_IRQS
171
172config ARCH_VIPER
173 bool "Arcom/Eurotech VIPER SBC"
174 select PXA25x
175 select ISA
176 select I2C_GPIO
177 select HAVE_PWM
178 select PXA_HAVE_BOARD_IRQS
179 select PXA_HAVE_ISA_IRQS
180
181config ARCH_PXA_ESERIES
182 bool "PXA based Toshiba e-series PDAs"
183 select PXA25x
184 select PXA_HAVE_BOARD_IRQS
185
186config MACH_E330
187 bool "Toshiba e330"
188 default y
189 depends on ARCH_PXA_ESERIES
190 help
191 Say Y here if you intend to run this kernel on a Toshiba
192 e330 family PDA.
193
194config MACH_E350
195 bool "Toshiba e350"
196 default y
197 depends on ARCH_PXA_ESERIES
198 help
199 Say Y here if you intend to run this kernel on a Toshiba
200 e350 family PDA.
201
202config MACH_E740
203 bool "Toshiba e740"
204 default y
205 depends on ARCH_PXA_ESERIES
206 select FB_W100
207 help
208 Say Y here if you intend to run this kernel on a Toshiba
209 e740 family PDA.
210
211config MACH_E750
212 bool "Toshiba e750"
213 default y
214 depends on ARCH_PXA_ESERIES
215 select FB_W100
216 help
217 Say Y here if you intend to run this kernel on a Toshiba
218 e750 family PDA.
219
220config MACH_E400
221 bool "Toshiba e400"
222 default y
223 depends on ARCH_PXA_ESERIES
224 help 147 help
225 Say Y here if you intend to run this kernel on a Toshiba 148 PXA255 based Single Board Computer with SMC 91C111 ethernet chip and 64 MB of flash.
226 e400 family PDA. 149 Tuned for usage in Libera instruments for particle accelerators.
227
228config MACH_E800
229 bool "Toshiba e800"
230 default y
231 depends on ARCH_PXA_ESERIES
232 select FB_W100
233 help
234 Say Y here if you intend to run this kernel on a Toshiba
235 e800 family PDA.
236 150
237config TRIZEPS_PXA 151config TRIZEPS_PXA
238 bool "PXA based Keith und Koep Trizeps DIMM-Modules" 152 bool "PXA based Keith und Koep Trizeps DIMM-Modules"
239 153
240config MACH_H5000
241 bool "HP iPAQ h5000"
242 select PXA25x
243
244config MACH_TRIZEPS4 154config MACH_TRIZEPS4
245 bool "Keith und Koep Trizeps4 DIMM-Module" 155 bool "Keith und Koep Trizeps4 DIMM-Module"
246 depends on TRIZEPS_PXA 156 depends on TRIZEPS_PXA
@@ -274,13 +184,38 @@ config TRIZEPS_PCMCIA
274 help 184 help
275 Enable PCMCIA support for Trizeps modules 185 Enable PCMCIA support for Trizeps modules
276 186
277config MACH_EM_X270 187config MACH_LOGICPD_PXA270
278 bool "CompuLab EM-x270 platform" 188 bool "LogicPD PXA270 Card Engine Development Platform"
279 select PXA27x 189 select PXA27x
190 select HAVE_PWM
191 select PXA_HAVE_BOARD_IRQS
280 192
281config MACH_EXEDA 193config MACH_PCM027
282 bool "CompuLab eXeda platform" 194 bool "Phytec phyCORE-PXA270 CPU module (PCM-027)"
283 select PXA27x 195 select PXA27x
196 select IWMMXT
197 select PXA_SSP
198 select PXA_HAVE_BOARD_IRQS
199
200config MACH_PCM990_BASEBOARD
201 bool "PHYTEC PCM-990 development board"
202 select HAVE_PWM
203 depends on MACH_PCM027
204
205choice
206 prompt "display on pcm990"
207 depends on MACH_PCM990_BASEBOARD
208
209config PCM990_DISPLAY_SHARP
210 bool "sharp lq084v1dg21 stn display"
211
212config PCM990_DISPLAY_NEC
213 bool "nec nl6448bc20_18d tft display"
214
215config PCM990_DISPLAY_NONE
216 bool "no display"
217
218endchoice
284 219
285config MACH_COLIBRI 220config MACH_COLIBRI
286 bool "Toradex Colibri PXA270" 221 bool "Toradex Colibri PXA270"
@@ -290,45 +225,15 @@ config MACH_COLIBRI300
290 bool "Toradex Colibri PXA300/310" 225 bool "Toradex Colibri PXA300/310"
291 select PXA3xx 226 select PXA3xx
292 select CPU_PXA300 227 select CPU_PXA300
228 select CPU_PXA310
229 select HAVE_PWM
293 230
294config MACH_COLIBRI320 231config MACH_COLIBRI320
295 bool "Toradex Colibri PXA320" 232 bool "Toradex Colibri PXA320"
296 select PXA3xx 233 select PXA3xx
297 select CPU_PXA320 234 select CPU_PXA320
298 235
299config MACH_ZYLONITE 236comment "End-user Products (sorted by vendor name)"
300 bool "PXA3xx Development Platform (aka Zylonite)"
301 select PXA3xx
302 select PXA_SSP
303 select HAVE_PWM
304 select PXA_HAVE_BOARD_IRQS
305
306config MACH_LITTLETON
307 bool "PXA3xx Form Factor Platform (aka Littleton)"
308 select PXA3xx
309 select PXA_SSP
310
311config MACH_TAVOREVB
312 bool "PXA930 Evaluation Board (aka TavorEVB)"
313 select PXA3xx
314 select CPU_PXA930
315
316config MACH_SAAR
317 bool "PXA930 Handheld Platform (aka SAAR)"
318 select PXA3xx
319 select CPU_PXA930
320
321config MACH_ARMCORE
322 bool "CompuLab CM-X255/CM-X270 modules"
323 select PXA27x
324 select IWMMXT
325 select PXA25x
326 select PXA_SSP
327
328config MACH_CM_X300
329 bool "CompuLab CM-X300 modules"
330 select PXA3xx
331 select CPU_PXA300
332 237
333config MACH_H4700 238config MACH_H4700
334 bool "HP iPAQ hx4700" 239 bool "HP iPAQ hx4700"
@@ -338,6 +243,15 @@ config MACH_H4700
338 select HAVE_PWM 243 select HAVE_PWM
339 select PXA_HAVE_BOARD_IRQS 244 select PXA_HAVE_BOARD_IRQS
340 245
246config MACH_H5000
247 bool "HP iPAQ h5000"
248 select PXA25x
249
250config MACH_HIMALAYA
251 bool "HTC Himalaya Support"
252 select CPU_PXA26x
253 select FB_W100
254
341config MACH_MAGICIAN 255config MACH_MAGICIAN
342 bool "Enable HTC Magician Support" 256 bool "Enable HTC Magician Support"
343 select PXA27x 257 select PXA27x
@@ -346,11 +260,6 @@ config MACH_MAGICIAN
346 select HAVE_PWM 260 select HAVE_PWM
347 select PXA_HAVE_BOARD_IRQS 261 select PXA_HAVE_BOARD_IRQS
348 262
349config MACH_HIMALAYA
350 bool "HTC Himalaya Support"
351 select CPU_PXA26x
352 select FB_W100
353
354config MACH_MIOA701 263config MACH_MIOA701
355 bool "Mitac Mio A701 Support" 264 bool "Mitac Mio A701 Support"
356 select PXA27x 265 select PXA27x
@@ -362,13 +271,47 @@ config MACH_MIOA701
362 MIO A701. Currently there is only basic support 271 MIO A701. Currently there is only basic support
363 for this PDA. 272 for this PDA.
364 273
365config MACH_PCM027 274config PXA_EZX
366 bool "Phytec phyCORE-PXA270 CPU module (PCM-027)" 275 bool "Motorola EZX Platform"
367 select PXA27x 276 select PXA27x
368 select IWMMXT 277 select IWMMXT
369 select PXA_SSP 278 select HAVE_PWM
370 select PXA_HAVE_BOARD_IRQS 279 select PXA_HAVE_BOARD_IRQS
371 280
281config MACH_EZX_A780
282 bool "Motorola EZX A780"
283 default y
284 depends on PXA_EZX
285
286config MACH_EZX_E680
287 bool "Motorola EZX E680"
288 default y
289 depends on PXA_EZX
290
291config MACH_EZX_A1200
292 bool "Motorola EZX A1200"
293 default y
294 depends on PXA_EZX
295
296config MACH_EZX_A910
297 bool "Motorola EZX A910"
298 default y
299 depends on PXA_EZX
300
301config MACH_EZX_E6
302 bool "Motorola EZX E6"
303 default y
304 depends on PXA_EZX
305
306config MACH_EZX_E2
307 bool "Motorola EZX E2"
308 default y
309 depends on PXA_EZX
310
311config MACH_MP900C
312 bool "Nec Mobilepro 900/c"
313 select PXA25x
314
372config ARCH_PXA_PALM 315config ARCH_PXA_PALM
373 bool "PXA based Palm PDAs" 316 bool "PXA based Palm PDAs"
374 select HAVE_PWM 317 select HAVE_PWM
@@ -421,109 +364,172 @@ config MACH_PALMZ72
421 Say Y here if you intend to run this kernel on Palm Zire 72 364 Say Y here if you intend to run this kernel on Palm Zire 72
422 handheld computer. 365 handheld computer.
423 366
424config MACH_TREO680 367config MACH_PALMLD
425 bool "Palm Treo 680" 368 bool "Palm LifeDrive"
426 default y 369 default y
427 depends on ARCH_PXA_PALM 370 depends on ARCH_PXA_PALM
428 select PXA27x 371 select PXA27x
429 select IWMMXT 372 select IWMMXT
430 help 373 help
431 Say Y here if you intend to run this kernel on Palm Treo 680 374 Say Y here if you intend to run this kernel on a Palm LifeDrive
375 handheld computer.
376
377config PALM_TREO
378 bool
379 depends on ARCH_PXA_PALM
380
381config MACH_CENTRO
382 bool "Palm Centro 685 (GSM)"
383 default y
384 depends on ARCH_PXA_PALM
385 select PXA27x
386 select IWMMXT
387 select PALM_TREO
388 help
389 Say Y here if you intend to run this kernel on Palm Centro 685 (GSM)
432 smartphone. 390 smartphone.
433 391
434config MACH_PALMLD 392config MACH_TREO680
435 bool "Palm LifeDrive" 393 bool "Palm Treo 680"
436 default y 394 default y
437 depends on ARCH_PXA_PALM 395 depends on ARCH_PXA_PALM
438 select PXA27x 396 select PXA27x
439 select IWMMXT 397 select IWMMXT
398 select PALM_TREO
440 help 399 help
441 Say Y here if you intend to run this kernel on a Palm LifeDrive 400 Say Y here if you intend to run this kernel on Palm Treo 680
401 smartphone.
402
403config PXA_SHARPSL
404 bool "SHARP Zaurus SL-5600, SL-C7xx and SL-Cxx00 Models"
405 select SHARP_SCOOP
406 select SHARP_PARAM
407 help
408 Say Y here if you intend to run this kernel on a
409 Sharp Zaurus SL-5600 (Poodle), SL-C700 (Corgi),
410 SL-C750 (Shepherd), SL-C760 (Husky), SL-C1000 (Akita),
411 SL-C3000 (Spitz), SL-C3100 (Borzoi) or SL-C6000x (Tosa)
442 handheld computer. 412 handheld computer.
443 413
444config MACH_PCM990_BASEBOARD 414config SHARPSL_PM
445 bool "PHYTEC PCM-990 development board" 415 bool
446 select HAVE_PWM 416 select APM_EMULATION
447 depends on MACH_PCM027
448 417
449choice 418config CORGI_SSP_DEPRECATED
450 prompt "display on pcm990" 419 bool
451 depends on MACH_PCM990_BASEBOARD 420 select PXA_SSP
421 help
422 This option will include corgi_ssp.c and corgi_lcd.c
423 that corgi_ts.c and other legacy drivers (corgi_bl.c
424 and sharpsl_pm.c) may depend on.
452 425
453config PCM990_DISPLAY_SHARP 426config MACH_POODLE
454 bool "sharp lq084v1dg21 stn display" 427 bool "Enable Sharp SL-5600 (Poodle) Support"
428 depends on PXA_SHARPSL
429 select PXA25x
430 select SHARP_LOCOMO
431 select PXA_SSP
455 432
456config PCM990_DISPLAY_NEC 433config MACH_CORGI
457 bool "nec nl6448bc20_18d tft display" 434 bool "Enable Sharp SL-C700 (Corgi) Support"
435 depends on PXA_SHARPSL
436 select PXA25x
437 select PXA_SHARP_C7xx
458 438
459config PCM990_DISPLAY_NONE 439config MACH_SHEPHERD
460 bool "no display" 440 bool "Enable Sharp SL-C750 (Shepherd) Support"
441 depends on PXA_SHARPSL
442 select PXA25x
443 select PXA_SHARP_C7xx
461 444
462endchoice 445config MACH_HUSKY
446 bool "Enable Sharp SL-C760 (Husky) Support"
447 depends on PXA_SHARPSL
448 select PXA25x
449 select PXA_SHARP_C7xx
463 450
464config MACH_CSB726 451config MACH_AKITA
465 bool "Enable Cogent CSB726 System On a Module" 452 bool "Enable Sharp SL-1000 (Akita) Support"
453 depends on PXA_SHARPSL
466 select PXA27x 454 select PXA27x
467 select IWMMXT 455 select PXA_SHARP_Cxx00
468 help 456 select MACH_SPITZ
469 Say Y here if you intend to run this kernel on a Cogent 457 select I2C
470 CSB726 System On Module. 458 select I2C_PXA
471 459
472config CSB726_CSB701 460config MACH_SPITZ
473 bool "Enable supprot for CSB701 baseboard" 461 bool "Enable Sharp Zaurus SL-3000 (Spitz) Support"
474 depends on MACH_CSB726 462 depends on PXA_SHARPSL
463 select PXA27x
464 select PXA_SHARP_Cxx00
475 465
476config PXA_EZX 466config MACH_BORZOI
477 bool "Motorola EZX Platform" 467 bool "Enable Sharp Zaurus SL-3100 (Borzoi) Support"
468 depends on PXA_SHARPSL
478 select PXA27x 469 select PXA27x
479 select IWMMXT 470 select PXA_SHARP_Cxx00
480 select HAVE_PWM 471
472config MACH_TOSA
473 bool "Enable Sharp SL-6000x (Tosa) Support"
474 depends on PXA_SHARPSL
475 select PXA25x
481 select PXA_HAVE_BOARD_IRQS 476 select PXA_HAVE_BOARD_IRQS
482 477
483config MACH_EZX_A780 478config ARCH_PXA_ESERIES
484 bool "Motorola EZX A780" 479 bool "PXA based Toshiba e-series PDAs"
485 default y 480 select PXA25x
486 depends on PXA_EZX 481 select PXA_HAVE_BOARD_IRQS
487 482
488config MACH_EZX_E680 483config MACH_E330
489 bool "Motorola EZX E680" 484 bool "Toshiba e330"
490 default y 485 default y
491 depends on PXA_EZX 486 depends on ARCH_PXA_ESERIES
487 help
488 Say Y here if you intend to run this kernel on a Toshiba
489 e330 family PDA.
492 490
493config MACH_EZX_A1200 491config MACH_E350
494 bool "Motorola EZX A1200" 492 bool "Toshiba e350"
495 default y 493 default y
496 depends on PXA_EZX 494 depends on ARCH_PXA_ESERIES
495 help
496 Say Y here if you intend to run this kernel on a Toshiba
497 e350 family PDA.
497 498
498config MACH_EZX_A910 499config MACH_E740
499 bool "Motorola EZX A910" 500 bool "Toshiba e740"
500 default y 501 default y
501 depends on PXA_EZX 502 depends on ARCH_PXA_ESERIES
503 select FB_W100
504 help
505 Say Y here if you intend to run this kernel on a Toshiba
506 e740 family PDA.
502 507
503config MACH_EZX_E6 508config MACH_E750
504 bool "Motorola EZX E6" 509 bool "Toshiba e750"
505 default y 510 default y
506 depends on PXA_EZX 511 depends on ARCH_PXA_ESERIES
512 select FB_W100
513 help
514 Say Y here if you intend to run this kernel on a Toshiba
515 e750 family PDA.
507 516
508config MACH_EZX_E2 517config MACH_E400
509 bool "Motorola EZX E2" 518 bool "Toshiba e400"
510 default y 519 default y
511 depends on PXA_EZX 520 depends on ARCH_PXA_ESERIES
521 help
522 Say Y here if you intend to run this kernel on a Toshiba
523 e400 family PDA.
512 524
513config MACH_XCEP 525config MACH_E800
514 bool "Iskratel Electronics XCEP" 526 bool "Toshiba e800"
515 select PXA25x 527 default y
516 select MTD 528 depends on ARCH_PXA_ESERIES
517 select MTD_PARTITIONS 529 select FB_W100
518 select MTD_PHYSMAP
519 select MTD_CFI_INTELEXT
520 select MTD_CFI
521 select MTD_CHAR
522 select SMC91X
523 select PXA_SSP
524 help 530 help
525 PXA255 based Single Board Computer with SMC 91C111 ethernet chip and 64 MB of flash. 531 Say Y here if you intend to run this kernel on a Toshiba
526 Tuned for usage in Libera instruments for particle accelerators. 532 e800 family PDA.
527 533
528endmenu 534endmenu
529 535
@@ -551,6 +557,42 @@ config PXA3xx
551 help 557 help
552 Select code specific to PXA3xx variants 558 Select code specific to PXA3xx variants
553 559
560config CPU_PXA300
561 bool
562 select PXA3xx
563 help
564 PXA300 (codename Monahans-L)
565
566config CPU_PXA310
567 bool
568 select CPU_PXA300
569 help
570 PXA310 (codename Monahans-LV)
571
572config CPU_PXA320
573 bool
574 select PXA3xx
575 help
576 PXA320 (codename Monahans-P)
577
578config CPU_PXA930
579 bool
580 select PXA3xx
581 help
582 PXA930 (codename Tavor-P)
583
584config CPU_PXA935
585 bool
586 select CPU_PXA930
587 help
588 PXA935 (codename Tavor-P65)
589
590config CPU_PXA950
591 bool
592 select CPU_PXA930
593 help
594 PXA950 (codename Tavor-PV2)
595
554config PXA_SHARP_C7xx 596config PXA_SHARP_C7xx
555 bool 597 bool
556 select PXA_SSP 598 select PXA_SSP
diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile
index f10e152bfc27..b5d29e60a341 100644
--- a/arch/arm/mach-pxa/Makefile
+++ b/arch/arm/mach-pxa/Makefile
@@ -24,33 +24,63 @@ obj-$(CONFIG_CPU_PXA300) += pxa300.o
24obj-$(CONFIG_CPU_PXA320) += pxa320.o 24obj-$(CONFIG_CPU_PXA320) += pxa320.o
25obj-$(CONFIG_CPU_PXA930) += pxa930.o 25obj-$(CONFIG_CPU_PXA930) += pxa930.o
26 26
27# Specific board support 27# NOTE: keep the order of boards in accordance to their order in Kconfig
28obj-$(CONFIG_ARCH_GUMSTIX) += gumstix.o 28
29obj-$(CONFIG_GUMSTIX_AM200EPD) += am200epd.o 29# Intel/Marvell Dev Platforms
30obj-$(CONFIG_GUMSTIX_AM300EPD) += am300epd.o
31obj-$(CONFIG_ARCH_LUBBOCK) += lubbock.o 30obj-$(CONFIG_ARCH_LUBBOCK) += lubbock.o
32obj-$(CONFIG_MACH_LOGICPD_PXA270) += lpd270.o
33obj-$(CONFIG_MACH_MAINSTONE) += mainstone.o 31obj-$(CONFIG_MACH_MAINSTONE) += mainstone.o
34obj-$(CONFIG_MACH_BALLOON3) += balloon3.o 32obj-$(CONFIG_MACH_ZYLONITE300) += zylonite.o zylonite_pxa300.o
35obj-$(CONFIG_MACH_MP900C) += mp900.o 33obj-$(CONFIG_MACH_ZYLONITE320) += zylonite.o zylonite_pxa320.o
34obj-$(CONFIG_MACH_LITTLETON) += littleton.o
35obj-$(CONFIG_MACH_TAVOREVB) += tavorevb.o
36obj-$(CONFIG_MACH_SAAR) += saar.o
37
38# 3rd Party Dev Platforms
36obj-$(CONFIG_ARCH_PXA_IDP) += idp.o 39obj-$(CONFIG_ARCH_PXA_IDP) += idp.o
40obj-$(CONFIG_ARCH_VIPER) += viper.o
41obj-$(CONFIG_MACH_BALLOON3) += balloon3.o
42obj-$(CONFIG_MACH_CSB726) += csb726.o
43obj-$(CONFIG_CSB726_CSB701) += csb701.o
44obj-$(CONFIG_MACH_ARMCORE) += cm-x2xx.o cm-x255.o cm-x270.o
45ifeq ($(CONFIG_PCI),y)
46obj-$(CONFIG_MACH_ARMCORE) += cm-x2xx-pci.o
47endif
48obj-$(CONFIG_MACH_EM_X270) += em-x270.o
49obj-$(CONFIG_MACH_CM_X300) += cm-x300.o
50obj-$(CONFIG_ARCH_GUMSTIX) += gumstix.o
51obj-$(CONFIG_GUMSTIX_AM200EPD) += am200epd.o
52obj-$(CONFIG_GUMSTIX_AM300EPD) += am300epd.o
53obj-$(CONFIG_MACH_INTELMOTE2) += imote2.o
54obj-$(CONFIG_MACH_STARGATE2) += stargate2.o
55obj-$(CONFIG_MACH_XCEP) += xcep.o
37obj-$(CONFIG_MACH_TRIZEPS4) += trizeps4.o 56obj-$(CONFIG_MACH_TRIZEPS4) += trizeps4.o
57obj-$(CONFIG_MACH_LOGICPD_PXA270) += lpd270.o
58obj-$(CONFIG_MACH_PCM027) += pcm027.o
59obj-$(CONFIG_MACH_PCM990_BASEBOARD) += pcm990-baseboard.o
38obj-$(CONFIG_MACH_COLIBRI) += colibri-pxa270.o 60obj-$(CONFIG_MACH_COLIBRI) += colibri-pxa270.o
39obj-$(CONFIG_MACH_COLIBRI300) += colibri-pxa3xx.o colibri-pxa300.o 61obj-$(CONFIG_MACH_COLIBRI300) += colibri-pxa3xx.o colibri-pxa300.o
40obj-$(CONFIG_MACH_COLIBRI320) += colibri-pxa3xx.o colibri-pxa320.o 62obj-$(CONFIG_MACH_COLIBRI320) += colibri-pxa3xx.o colibri-pxa320.o
63
64# End-user Products
65obj-$(CONFIG_MACH_H4700) += hx4700.o
41obj-$(CONFIG_MACH_H5000) += h5000.o 66obj-$(CONFIG_MACH_H5000) += h5000.o
67obj-$(CONFIG_MACH_HIMALAYA) += himalaya.o
68obj-$(CONFIG_MACH_MAGICIAN) += magician.o
69obj-$(CONFIG_MACH_MIOA701) += mioa701.o mioa701_bootresume.o
70obj-$(CONFIG_PXA_EZX) += ezx.o
71obj-$(CONFIG_MACH_MP900C) += mp900.o
72obj-$(CONFIG_MACH_PALMTE2) += palmte2.o
73obj-$(CONFIG_MACH_PALMTC) += palmtc.o
74obj-$(CONFIG_MACH_PALMT5) += palmt5.o
75obj-$(CONFIG_MACH_PALMTX) += palmtx.o
76obj-$(CONFIG_MACH_PALMZ72) += palmz72.o
77obj-$(CONFIG_MACH_PALMLD) += palmld.o
78obj-$(CONFIG_PALM_TREO) += palmtreo.o
42obj-$(CONFIG_PXA_SHARP_C7xx) += corgi.o sharpsl_pm.o corgi_pm.o 79obj-$(CONFIG_PXA_SHARP_C7xx) += corgi.o sharpsl_pm.o corgi_pm.o
43obj-$(CONFIG_PXA_SHARP_Cxx00) += spitz.o sharpsl_pm.o spitz_pm.o 80obj-$(CONFIG_PXA_SHARP_Cxx00) += spitz.o sharpsl_pm.o spitz_pm.o
44obj-$(CONFIG_CORGI_SSP_DEPRECATED) += corgi_ssp.o corgi_lcd.o 81obj-$(CONFIG_CORGI_SSP_DEPRECATED) += corgi_ssp.o corgi_lcd.o
45obj-$(CONFIG_MACH_POODLE) += poodle.o 82obj-$(CONFIG_MACH_POODLE) += poodle.o
46obj-$(CONFIG_MACH_PCM027) += pcm027.o
47obj-$(CONFIG_MACH_PCM990_BASEBOARD) += pcm990-baseboard.o
48obj-$(CONFIG_MACH_TOSA) += tosa.o 83obj-$(CONFIG_MACH_TOSA) += tosa.o
49obj-$(CONFIG_MACH_EM_X270) += em-x270.o
50obj-$(CONFIG_MACH_H4700) += hx4700.o
51obj-$(CONFIG_MACH_MAGICIAN) += magician.o
52obj-$(CONFIG_MACH_HIMALAYA) += himalaya.o
53obj-$(CONFIG_MACH_MIOA701) += mioa701.o mioa701_bootresume.o
54obj-$(CONFIG_ARCH_PXA_ESERIES) += eseries.o 84obj-$(CONFIG_ARCH_PXA_ESERIES) += eseries.o
55obj-$(CONFIG_MACH_E330) += e330.o 85obj-$(CONFIG_MACH_E330) += e330.o
56obj-$(CONFIG_MACH_E350) += e350.o 86obj-$(CONFIG_MACH_E350) += e350.o
@@ -58,34 +88,6 @@ obj-$(CONFIG_MACH_E740) += e740.o
58obj-$(CONFIG_MACH_E750) += e750.o 88obj-$(CONFIG_MACH_E750) += e750.o
59obj-$(CONFIG_MACH_E400) += e400.o 89obj-$(CONFIG_MACH_E400) += e400.o
60obj-$(CONFIG_MACH_E800) += e800.o 90obj-$(CONFIG_MACH_E800) += e800.o
61obj-$(CONFIG_MACH_PALMTE2) += palmte2.o
62obj-$(CONFIG_MACH_PALMTC) += palmtc.o
63obj-$(CONFIG_MACH_PALMT5) += palmt5.o
64obj-$(CONFIG_MACH_PALMTX) += palmtx.o
65obj-$(CONFIG_MACH_PALMLD) += palmld.o
66obj-$(CONFIG_MACH_PALMZ72) += palmz72.o
67obj-$(CONFIG_MACH_TREO680) += treo680.o
68obj-$(CONFIG_ARCH_VIPER) += viper.o
69
70ifeq ($(CONFIG_MACH_ZYLONITE),y)
71 obj-y += zylonite.o
72 obj-$(CONFIG_CPU_PXA300) += zylonite_pxa300.o
73 obj-$(CONFIG_CPU_PXA320) += zylonite_pxa320.o
74endif
75obj-$(CONFIG_MACH_LITTLETON) += littleton.o
76obj-$(CONFIG_MACH_TAVOREVB) += tavorevb.o
77obj-$(CONFIG_MACH_SAAR) += saar.o
78
79obj-$(CONFIG_MACH_ARMCORE) += cm-x2xx.o cm-x255.o cm-x270.o
80obj-$(CONFIG_MACH_CM_X300) += cm-x300.o
81obj-$(CONFIG_PXA_EZX) += ezx.o
82
83obj-$(CONFIG_MACH_XCEP) += xcep.o
84
85obj-$(CONFIG_MACH_INTELMOTE2) += imote2.o
86obj-$(CONFIG_MACH_STARGATE2) += stargate2.o
87obj-$(CONFIG_MACH_CSB726) += csb726.o
88obj-$(CONFIG_CSB726_CSB701) += csb701.o
89 91
90# Support for blinky lights 92# Support for blinky lights
91led-y := leds.o 93led-y := leds.o
@@ -95,8 +97,4 @@ led-$(CONFIG_ARCH_PXA_IDP) += leds-idp.o
95 97
96obj-$(CONFIG_LEDS) += $(led-y) 98obj-$(CONFIG_LEDS) += $(led-y)
97 99
98ifeq ($(CONFIG_PCI),y)
99obj-$(CONFIG_MACH_ARMCORE) += cm-x2xx-pci.o
100endif
101
102obj-$(CONFIG_TOSA_BT) += tosa-bt.o 100obj-$(CONFIG_TOSA_BT) += tosa-bt.o
diff --git a/arch/arm/mach-pxa/balloon3.c b/arch/arm/mach-pxa/balloon3.c
index f23138b8fca3..b8cd07ca9380 100644
--- a/arch/arm/mach-pxa/balloon3.c
+++ b/arch/arm/mach-pxa/balloon3.c
@@ -306,6 +306,10 @@ static void __init balloon3_init(void)
306 */ 306 */
307 ARB_CNTRL = ARB_CORE_PARK | 0x234; 307 ARB_CNTRL = ARB_CORE_PARK | 0x234;
308 308
309 pxa_set_ffuart_info(NULL);
310 pxa_set_btuart_info(NULL);
311 pxa_set_stuart_info(NULL);
312
309 pxa_set_i2c_info(NULL); 313 pxa_set_i2c_info(NULL);
310 if (balloon3_has(BALLOON3_FEATURE_AUDIO)) 314 if (balloon3_has(BALLOON3_FEATURE_AUDIO))
311 pxa_set_ac97_info(NULL); 315 pxa_set_ac97_info(NULL);
diff --git a/arch/arm/mach-pxa/cm-x2xx.c b/arch/arm/mach-pxa/cm-x2xx.c
index b50ef39eabfc..bff6e78f033d 100644
--- a/arch/arm/mach-pxa/cm-x2xx.c
+++ b/arch/arm/mach-pxa/cm-x2xx.c
@@ -453,6 +453,10 @@ static inline void cmx2xx_init_ac97(void) {}
453 453
454static void __init cmx2xx_init(void) 454static void __init cmx2xx_init(void)
455{ 455{
456 pxa_set_ffuart_info(NULL);
457 pxa_set_btuart_info(NULL);
458 pxa_set_stuart_info(NULL);
459
456 cmx2xx_pm_init(); 460 cmx2xx_pm_init();
457 461
458 if (cpu_is_pxa25x()) 462 if (cpu_is_pxa25x())
diff --git a/arch/arm/mach-pxa/cm-x300.c b/arch/arm/mach-pxa/cm-x300.c
index 102916f1e465..d37cfa132a65 100644
--- a/arch/arm/mach-pxa/cm-x300.c
+++ b/arch/arm/mach-pxa/cm-x300.c
@@ -3,9 +3,10 @@
3 * 3 *
4 * Support for the CompuLab CM-X300 modules 4 * Support for the CompuLab CM-X300 modules
5 * 5 *
6 * Copyright (C) 2008 CompuLab Ltd. 6 * Copyright (C) 2008,2009 CompuLab Ltd.
7 * 7 *
8 * Mike Rapoport <mike@compulab.co.il> 8 * Mike Rapoport <mike@compulab.co.il>
9 * Igor Grinberg <grinberg@compulab.co.il>
9 * 10 *
10 * This program is free software; you can redistribute it and/or modify 11 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as 12 * it under the terms of the GNU General Public License version 2 as
@@ -16,30 +17,41 @@
16#include <linux/kernel.h> 17#include <linux/kernel.h>
17#include <linux/interrupt.h> 18#include <linux/interrupt.h>
18#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/delay.h>
19#include <linux/platform_device.h> 21#include <linux/platform_device.h>
20 22
21#include <linux/gpio.h> 23#include <linux/gpio.h>
22#include <linux/dm9000.h> 24#include <linux/dm9000.h>
23#include <linux/leds.h> 25#include <linux/leds.h>
24#include <linux/rtc-v3020.h> 26#include <linux/rtc-v3020.h>
27#include <linux/pwm_backlight.h>
25 28
26#include <linux/i2c.h> 29#include <linux/i2c.h>
27#include <linux/i2c/pca953x.h> 30#include <linux/i2c/pca953x.h>
28 31
32#include <linux/mfd/da903x.h>
33
34#include <linux/spi/spi.h>
35#include <linux/spi/spi_gpio.h>
36#include <linux/spi/tdo24m.h>
37
29#include <asm/mach-types.h> 38#include <asm/mach-types.h>
30#include <asm/mach/arch.h> 39#include <asm/mach/arch.h>
31#include <asm/setup.h> 40#include <asm/setup.h>
32 41
33#include <mach/pxa300.h> 42#include <mach/pxa300.h>
43#include <mach/pxa27x-udc.h>
34#include <mach/pxafb.h> 44#include <mach/pxafb.h>
35#include <mach/mmc.h> 45#include <mach/mmc.h>
36#include <mach/ohci.h> 46#include <mach/ohci.h>
37#include <plat/i2c.h> 47#include <plat/i2c.h>
38#include <mach/pxa3xx_nand.h> 48#include <plat/pxa3xx_nand.h>
49#include <mach/audio.h>
39 50
40#include <asm/mach/map.h> 51#include <asm/mach/map.h>
41 52
42#include "generic.h" 53#include "generic.h"
54#include "devices.h"
43 55
44#define CM_X300_ETH_PHYS 0x08000010 56#define CM_X300_ETH_PHYS 0x08000010
45 57
@@ -53,7 +65,7 @@
53#define GPIO97_RTC_RD (97) 65#define GPIO97_RTC_RD (97)
54#define GPIO98_RTC_IO (98) 66#define GPIO98_RTC_IO (98)
55 67
56static mfp_cfg_t cm_x300_mfp_cfg[] __initdata = { 68static mfp_cfg_t cm_x3xx_mfp_cfg[] __initdata = {
57 /* LCD */ 69 /* LCD */
58 GPIO54_LCD_LDD_0, 70 GPIO54_LCD_LDD_0,
59 GPIO55_LCD_LDD_1, 71 GPIO55_LCD_LDD_1,
@@ -137,7 +149,6 @@ static mfp_cfg_t cm_x300_mfp_cfg[] __initdata = {
137 GPIO36_UART1_DTR, 149 GPIO36_UART1_DTR,
138 150
139 /* GPIOs */ 151 /* GPIOs */
140 GPIO79_GPIO, /* LED */
141 GPIO82_GPIO | MFP_PULL_HIGH, /* MMC CD */ 152 GPIO82_GPIO | MFP_PULL_HIGH, /* MMC CD */
142 GPIO85_GPIO, /* MMC WP */ 153 GPIO85_GPIO, /* MMC WP */
143 GPIO99_GPIO, /* Ethernet IRQ */ 154 GPIO99_GPIO, /* Ethernet IRQ */
@@ -151,6 +162,50 @@ static mfp_cfg_t cm_x300_mfp_cfg[] __initdata = {
151 /* Standard I2C */ 162 /* Standard I2C */
152 GPIO21_I2C_SCL, 163 GPIO21_I2C_SCL,
153 GPIO22_I2C_SDA, 164 GPIO22_I2C_SDA,
165
166 /* PWM Backlight */
167 GPIO19_PWM2_OUT,
168};
169
170static mfp_cfg_t cm_x3xx_rev_lt130_mfp_cfg[] __initdata = {
171 /* GPIOs */
172 GPIO79_GPIO, /* LED */
173 GPIO77_GPIO, /* WiFi reset */
174 GPIO78_GPIO, /* BT reset */
175};
176
177static mfp_cfg_t cm_x3xx_rev_ge130_mfp_cfg[] __initdata = {
178 /* GPIOs */
179 GPIO76_GPIO, /* LED */
180 GPIO71_GPIO, /* WiFi reset */
181 GPIO70_GPIO, /* BT reset */
182};
183
184static mfp_cfg_t cm_x310_mfp_cfg[] __initdata = {
185 /* USB PORT 2 */
186 ULPI_STP,
187 ULPI_NXT,
188 ULPI_DIR,
189 GPIO30_ULPI_DATA_OUT_0,
190 GPIO31_ULPI_DATA_OUT_1,
191 GPIO32_ULPI_DATA_OUT_2,
192 GPIO33_ULPI_DATA_OUT_3,
193 GPIO34_ULPI_DATA_OUT_4,
194 GPIO35_ULPI_DATA_OUT_5,
195 GPIO36_ULPI_DATA_OUT_6,
196 GPIO37_ULPI_DATA_OUT_7,
197 GPIO38_ULPI_CLK,
198 /* external PHY reset pin */
199 GPIO127_GPIO,
200
201 /* USB PORT 3 */
202 GPIO77_USB_P3_1,
203 GPIO78_USB_P3_2,
204 GPIO79_USB_P3_3,
205 GPIO80_USB_P3_4,
206 GPIO81_USB_P3_5,
207 GPIO82_USB_P3_6,
208 GPIO0_2_USBH_PEN,
154}; 209};
155 210
156#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE) 211#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
@@ -195,17 +250,18 @@ static void __init cm_x300_init_dm9000(void)
195static inline void cm_x300_init_dm9000(void) {} 250static inline void cm_x300_init_dm9000(void) {}
196#endif 251#endif
197 252
253/* LCD */
198#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) 254#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
199static struct pxafb_mode_info cm_x300_lcd_modes[] = { 255static struct pxafb_mode_info cm_x300_lcd_modes[] = {
200 [0] = { 256 [0] = {
201 .pixclock = 38000, 257 .pixclock = 38250,
202 .bpp = 16, 258 .bpp = 16,
203 .xres = 480, 259 .xres = 480,
204 .yres = 640, 260 .yres = 640,
205 .hsync_len = 8, 261 .hsync_len = 8,
206 .vsync_len = 2, 262 .vsync_len = 2,
207 .left_margin = 8, 263 .left_margin = 8,
208 .upper_margin = 0, 264 .upper_margin = 2,
209 .right_margin = 24, 265 .right_margin = 24,
210 .lower_margin = 4, 266 .lower_margin = 4,
211 .cmap_greyscale = 0, 267 .cmap_greyscale = 0,
@@ -227,7 +283,7 @@ static struct pxafb_mode_info cm_x300_lcd_modes[] = {
227 283
228static struct pxafb_mach_info cm_x300_lcd = { 284static struct pxafb_mach_info cm_x300_lcd = {
229 .modes = cm_x300_lcd_modes, 285 .modes = cm_x300_lcd_modes,
230 .num_modes = 2, 286 .num_modes = ARRAY_SIZE(cm_x300_lcd_modes),
231 .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL, 287 .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL,
232}; 288};
233 289
@@ -239,6 +295,87 @@ static void __init cm_x300_init_lcd(void)
239static inline void cm_x300_init_lcd(void) {} 295static inline void cm_x300_init_lcd(void) {}
240#endif 296#endif
241 297
298#if defined(CONFIG_BACKLIGHT_PWM) || defined(CONFIG_BACKLIGHT_PWM_MODULE)
299static struct platform_pwm_backlight_data cm_x300_backlight_data = {
300 .pwm_id = 2,
301 .max_brightness = 100,
302 .dft_brightness = 100,
303 .pwm_period_ns = 10000,
304};
305
306static struct platform_device cm_x300_backlight_device = {
307 .name = "pwm-backlight",
308 .dev = {
309 .parent = &pxa27x_device_pwm0.dev,
310 .platform_data = &cm_x300_backlight_data,
311 },
312};
313
314static void cm_x300_init_bl(void)
315{
316 platform_device_register(&cm_x300_backlight_device);
317}
318#else
319static inline void cm_x300_init_bl(void) {}
320#endif
321
322#if defined(CONFIG_SPI_GPIO) || defined(CONFIG_SPI_GPIO_MODULE)
323#define GPIO_LCD_BASE (144)
324#define GPIO_LCD_DIN (GPIO_LCD_BASE + 8) /* aux_gpio3_0 */
325#define GPIO_LCD_DOUT (GPIO_LCD_BASE + 9) /* aux_gpio3_1 */
326#define GPIO_LCD_SCL (GPIO_LCD_BASE + 10) /* aux_gpio3_2 */
327#define GPIO_LCD_CS (GPIO_LCD_BASE + 11) /* aux_gpio3_3 */
328#define LCD_SPI_BUS_NUM (1)
329
330static struct spi_gpio_platform_data cm_x300_spi_gpio_pdata = {
331 .sck = GPIO_LCD_SCL,
332 .mosi = GPIO_LCD_DIN,
333 .miso = GPIO_LCD_DOUT,
334 .num_chipselect = 1,
335};
336
337static struct platform_device cm_x300_spi_gpio = {
338 .name = "spi_gpio",
339 .id = LCD_SPI_BUS_NUM,
340 .dev = {
341 .platform_data = &cm_x300_spi_gpio_pdata,
342 },
343};
344
345static struct tdo24m_platform_data cm_x300_tdo24m_pdata = {
346 .model = TDO35S,
347};
348
349static struct spi_board_info cm_x300_spi_devices[] __initdata = {
350 {
351 .modalias = "tdo24m",
352 .max_speed_hz = 1000000,
353 .bus_num = LCD_SPI_BUS_NUM,
354 .chip_select = 0,
355 .controller_data = (void *) GPIO_LCD_CS,
356 .platform_data = &cm_x300_tdo24m_pdata,
357 },
358};
359
360static void __init cm_x300_init_spi(void)
361{
362 spi_register_board_info(cm_x300_spi_devices,
363 ARRAY_SIZE(cm_x300_spi_devices));
364 platform_device_register(&cm_x300_spi_gpio);
365}
366#else
367static inline void cm_x300_init_spi(void) {}
368#endif
369
370#if defined(CONFIG_SND_PXA2XX_LIB_AC97)
371static void __init cm_x300_init_ac97(void)
372{
373 pxa_set_ac97_info(NULL);
374}
375#else
376static inline void cm_x300_init_ac97(void) {}
377#endif
378
242#if defined(CONFIG_MTD_NAND_PXA3xx) || defined(CONFIG_MTD_NAND_PXA3xx_MODULE) 379#if defined(CONFIG_MTD_NAND_PXA3xx) || defined(CONFIG_MTD_NAND_PXA3xx_MODULE)
243static struct mtd_partition cm_x300_nand_partitions[] = { 380static struct mtd_partition cm_x300_nand_partitions[] = {
244 [0] = { 381 [0] = {
@@ -333,9 +470,19 @@ static inline void cm_x300_init_mmc(void) {}
333#endif 470#endif
334 471
335#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) 472#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
473static int cm_x300_ohci_init(struct device *dev)
474{
475 if (cpu_is_pxa300())
476 UP2OCR = UP2OCR_HXS
477 | UP2OCR_HXOE | UP2OCR_DMPDE | UP2OCR_DPPDE;
478
479 return 0;
480}
481
336static struct pxaohci_platform_data cm_x300_ohci_platform_data = { 482static struct pxaohci_platform_data cm_x300_ohci_platform_data = {
337 .port_mode = PMM_PERPORT_MODE, 483 .port_mode = PMM_PERPORT_MODE,
338 .flags = ENABLE_PORT1 | ENABLE_PORT2 | POWER_CONTROL_LOW, 484 .flags = ENABLE_PORT_ALL | POWER_CONTROL_LOW,
485 .init = cm_x300_ohci_init,
339}; 486};
340 487
341static void __init cm_x300_init_ohci(void) 488static void __init cm_x300_init_ohci(void)
@@ -351,7 +498,6 @@ static struct gpio_led cm_x300_leds[] = {
351 [0] = { 498 [0] = {
352 .name = "cm-x300:green", 499 .name = "cm-x300:green",
353 .default_trigger = "heartbeat", 500 .default_trigger = "heartbeat",
354 .gpio = 79,
355 .active_low = 1, 501 .active_low = 1,
356 }, 502 },
357}; 503};
@@ -371,6 +517,11 @@ static struct platform_device cm_x300_led_device = {
371 517
372static void __init cm_x300_init_leds(void) 518static void __init cm_x300_init_leds(void)
373{ 519{
520 if (system_rev < 130)
521 cm_x300_leds[0].gpio = 79;
522 else
523 cm_x300_leds[0].gpio = 76;
524
374 platform_device_register(&cm_x300_led_device); 525 platform_device_register(&cm_x300_led_device);
375} 526}
376#else 527#else
@@ -433,11 +584,94 @@ static void __init cm_x300_init_rtc(void)
433static inline void cm_x300_init_rtc(void) {} 584static inline void cm_x300_init_rtc(void) {}
434#endif 585#endif
435 586
436static void __init cm_x300_init(void) 587/* DA9030 */
588struct da903x_subdev_info cm_x300_da9030_subdevs[] = {
589 {
590 .name = "da903x-backlight",
591 .id = DA9030_ID_WLED,
592 }
593};
594
595static struct da903x_platform_data cm_x300_da9030_info = {
596 .num_subdevs = ARRAY_SIZE(cm_x300_da9030_subdevs),
597 .subdevs = cm_x300_da9030_subdevs,
598};
599
600static struct i2c_board_info cm_x300_pmic_info = {
601 I2C_BOARD_INFO("da9030", 0x49),
602 .irq = IRQ_GPIO(0),
603 .platform_data = &cm_x300_da9030_info,
604};
605
606static struct i2c_pxa_platform_data cm_x300_pwr_i2c_info = {
607 .use_pio = 1,
608};
609
610static void __init cm_x300_init_da9030(void)
611{
612 pxa3xx_set_i2c_power_info(&cm_x300_pwr_i2c_info);
613 i2c_register_board_info(1, &cm_x300_pmic_info, 1);
614}
615
616static void __init cm_x300_init_wi2wi(void)
617{
618 int bt_reset, wlan_en;
619 int err;
620
621 if (system_rev < 130) {
622 wlan_en = 77;
623 bt_reset = 78;
624 } else {
625 wlan_en = 71;
626 bt_reset = 70;
627 }
628
629 /* Libertas and CSR reset */
630 err = gpio_request(wlan_en, "wlan en");
631 if (err) {
632 pr_err("CM-X300: failed to request wlan en gpio: %d\n", err);
633 } else {
634 gpio_direction_output(wlan_en, 1);
635 gpio_free(wlan_en);
636 }
637
638 err = gpio_request(bt_reset, "bt reset");
639 if (err) {
640 pr_err("CM-X300: failed to request bt reset gpio: %d\n", err);
641 } else {
642 gpio_direction_output(bt_reset, 1);
643 udelay(10);
644 gpio_set_value(bt_reset, 0);
645 udelay(10);
646 gpio_set_value(bt_reset, 1);
647 gpio_free(bt_reset);
648 }
649}
650
651/* MFP */
652static void __init cm_x300_init_mfp(void)
437{ 653{
438 /* board-processor specific GPIO initialization */ 654 /* board-processor specific GPIO initialization */
439 pxa3xx_mfp_config(ARRAY_AND_SIZE(cm_x300_mfp_cfg)); 655 pxa3xx_mfp_config(ARRAY_AND_SIZE(cm_x3xx_mfp_cfg));
656
657 if (system_rev < 130)
658 pxa3xx_mfp_config(ARRAY_AND_SIZE(cm_x3xx_rev_lt130_mfp_cfg));
659 else
660 pxa3xx_mfp_config(ARRAY_AND_SIZE(cm_x3xx_rev_ge130_mfp_cfg));
661
662 if (cpu_is_pxa310())
663 pxa3xx_mfp_config(ARRAY_AND_SIZE(cm_x310_mfp_cfg));
664}
665
666static void __init cm_x300_init(void)
667{
668 cm_x300_init_mfp();
669
670 pxa_set_ffuart_info(NULL);
671 pxa_set_btuart_info(NULL);
672 pxa_set_stuart_info(NULL);
440 673
674 cm_x300_init_da9030();
441 cm_x300_init_dm9000(); 675 cm_x300_init_dm9000();
442 cm_x300_init_lcd(); 676 cm_x300_init_lcd();
443 cm_x300_init_ohci(); 677 cm_x300_init_ohci();
@@ -445,7 +679,11 @@ static void __init cm_x300_init(void)
445 cm_x300_init_nand(); 679 cm_x300_init_nand();
446 cm_x300_init_leds(); 680 cm_x300_init_leds();
447 cm_x300_init_i2c(); 681 cm_x300_init_i2c();
682 cm_x300_init_spi();
448 cm_x300_init_rtc(); 683 cm_x300_init_rtc();
684 cm_x300_init_ac97();
685 cm_x300_init_wi2wi();
686 cm_x300_init_bl();
449} 687}
450 688
451static void __init cm_x300_fixup(struct machine_desc *mdesc, struct tag *tags, 689static void __init cm_x300_fixup(struct machine_desc *mdesc, struct tag *tags,
diff --git a/arch/arm/mach-pxa/colibri-pxa270.c b/arch/arm/mach-pxa/colibri-pxa270.c
index 01bcfaae75bc..061c45316de8 100644
--- a/arch/arm/mach-pxa/colibri-pxa270.c
+++ b/arch/arm/mach-pxa/colibri-pxa270.c
@@ -130,6 +130,9 @@ static struct platform_device *colibri_pxa270_devices[] __initdata = {
130static void __init colibri_pxa270_init(void) 130static void __init colibri_pxa270_init(void)
131{ 131{
132 pxa2xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa270_pin_config)); 132 pxa2xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa270_pin_config));
133 pxa_set_ffuart_info(NULL);
134 pxa_set_btuart_info(NULL);
135 pxa_set_stuart_info(NULL);
133 platform_add_devices(ARRAY_AND_SIZE(colibri_pxa270_devices)); 136 platform_add_devices(ARRAY_AND_SIZE(colibri_pxa270_devices));
134} 137}
135 138
diff --git a/arch/arm/mach-pxa/colibri-pxa300.c b/arch/arm/mach-pxa/colibri-pxa300.c
index 37c239c56568..45c23fd6df31 100644
--- a/arch/arm/mach-pxa/colibri-pxa300.c
+++ b/arch/arm/mach-pxa/colibri-pxa300.c
@@ -170,6 +170,10 @@ static inline void colibri_pxa310_init_ac97(void) {}
170 170
171void __init colibri_pxa300_init(void) 171void __init colibri_pxa300_init(void)
172{ 172{
173 pxa_set_ffuart_info(NULL);
174 pxa_set_btuart_info(NULL);
175 pxa_set_stuart_info(NULL);
176
173 colibri_pxa300_init_eth(); 177 colibri_pxa300_init_eth();
174 colibri_pxa300_init_ohci(); 178 colibri_pxa300_init_ohci();
175 colibri_pxa3xx_init_nand(); 179 colibri_pxa3xx_init_nand();
diff --git a/arch/arm/mach-pxa/colibri-pxa320.c b/arch/arm/mach-pxa/colibri-pxa320.c
index ec0e14b96682..ae835fad7d10 100644
--- a/arch/arm/mach-pxa/colibri-pxa320.c
+++ b/arch/arm/mach-pxa/colibri-pxa320.c
@@ -199,6 +199,10 @@ static void __init colibri_pxa320_init_uart(void)
199 199
200void __init colibri_pxa320_init(void) 200void __init colibri_pxa320_init(void)
201{ 201{
202 pxa_set_ffuart_info(NULL);
203 pxa_set_btuart_info(NULL);
204 pxa_set_stuart_info(NULL);
205
202 colibri_pxa320_init_eth(); 206 colibri_pxa320_init_eth();
203 colibri_pxa320_init_ohci(); 207 colibri_pxa320_init_ohci();
204 colibri_pxa3xx_init_nand(); 208 colibri_pxa3xx_init_nand();
diff --git a/arch/arm/mach-pxa/colibri-pxa3xx.c b/arch/arm/mach-pxa/colibri-pxa3xx.c
index efebaf4d734d..e6c0a2287eb8 100644
--- a/arch/arm/mach-pxa/colibri-pxa3xx.c
+++ b/arch/arm/mach-pxa/colibri-pxa3xx.c
@@ -25,7 +25,7 @@
25#include <mach/colibri.h> 25#include <mach/colibri.h>
26#include <mach/mmc.h> 26#include <mach/mmc.h>
27#include <mach/pxafb.h> 27#include <mach/pxafb.h>
28#include <mach/pxa3xx_nand.h> 28#include <plat/pxa3xx_nand.h>
29 29
30#include "generic.h" 30#include "generic.h"
31#include "devices.h" 31#include "devices.h"
diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c
index b536b5a5a10d..74446cf8ae69 100644
--- a/arch/arm/mach-pxa/corgi.c
+++ b/arch/arm/mach-pxa/corgi.c
@@ -671,6 +671,10 @@ static void __init corgi_init(void)
671 671
672 pxa2xx_mfp_config(ARRAY_AND_SIZE(corgi_pin_config)); 672 pxa2xx_mfp_config(ARRAY_AND_SIZE(corgi_pin_config));
673 673
674 pxa_set_ffuart_info(NULL);
675 pxa_set_btuart_info(NULL);
676 pxa_set_stuart_info(NULL);
677
674 corgi_init_spi(); 678 corgi_init_spi();
675 679
676 pxa_set_udc_info(&udc_info); 680 pxa_set_udc_info(&udc_info);
diff --git a/arch/arm/mach-pxa/corgi_pm.c b/arch/arm/mach-pxa/corgi_pm.c
index a093282fe4db..d4a0733e905b 100644
--- a/arch/arm/mach-pxa/corgi_pm.c
+++ b/arch/arm/mach-pxa/corgi_pm.c
@@ -214,8 +214,8 @@ static struct sharpsl_charger_machinfo corgi_pm_machinfo = {
214 .fatal_acin_volt = SHARPSL_FATAL_ACIN_VOLT, 214 .fatal_acin_volt = SHARPSL_FATAL_ACIN_VOLT,
215 .fatal_noacin_volt= SHARPSL_FATAL_NOACIN_VOLT, 215 .fatal_noacin_volt= SHARPSL_FATAL_NOACIN_VOLT,
216 .bat_levels = 40, 216 .bat_levels = 40,
217 .bat_levels_noac = spitz_battery_levels_noac, 217 .bat_levels_noac = sharpsl_battery_levels_noac,
218 .bat_levels_acin = spitz_battery_levels_acin, 218 .bat_levels_acin = sharpsl_battery_levels_acin,
219 .status_high_acin = 188, 219 .status_high_acin = 188,
220 .status_low_acin = 178, 220 .status_low_acin = 178,
221 .status_high_noac = 185, 221 .status_high_noac = 185,
diff --git a/arch/arm/mach-pxa/cpufreq-pxa2xx.c b/arch/arm/mach-pxa/cpufreq-pxa2xx.c
index 983cc8c20081..9e4d9816726a 100644
--- a/arch/arm/mach-pxa/cpufreq-pxa2xx.c
+++ b/arch/arm/mach-pxa/cpufreq-pxa2xx.c
@@ -447,6 +447,7 @@ static __init int pxa_cpufreq_init(struct cpufreq_policy *policy)
447 pxa27x_freq_table[i].frequency = freq; 447 pxa27x_freq_table[i].frequency = freq;
448 pxa27x_freq_table[i].index = i; 448 pxa27x_freq_table[i].index = i;
449 } 449 }
450 pxa27x_freq_table[i].index = i;
450 pxa27x_freq_table[i].frequency = CPUFREQ_TABLE_END; 451 pxa27x_freq_table[i].frequency = CPUFREQ_TABLE_END;
451 452
452 /* 453 /*
diff --git a/arch/arm/mach-pxa/cpufreq-pxa3xx.c b/arch/arm/mach-pxa/cpufreq-pxa3xx.c
index 67f34a8d8e60..149cdd9aee4d 100644
--- a/arch/arm/mach-pxa/cpufreq-pxa3xx.c
+++ b/arch/arm/mach-pxa/cpufreq-pxa3xx.c
@@ -102,7 +102,7 @@ static int setup_freqs_table(struct cpufreq_policy *policy,
102 table[i].index = i; 102 table[i].index = i;
103 table[i].frequency = freqs[i].cpufreq_mhz * 1000; 103 table[i].frequency = freqs[i].cpufreq_mhz * 1000;
104 } 104 }
105 table[num].frequency = i; 105 table[num].index = i;
106 table[num].frequency = CPUFREQ_TABLE_END; 106 table[num].frequency = CPUFREQ_TABLE_END;
107 107
108 pxa3xx_freqs = freqs; 108 pxa3xx_freqs = freqs;
diff --git a/arch/arm/mach-pxa/csb726.c b/arch/arm/mach-pxa/csb726.c
index 965480eb4fe6..88575b87bd33 100644
--- a/arch/arm/mach-pxa/csb726.c
+++ b/arch/arm/mach-pxa/csb726.c
@@ -268,6 +268,9 @@ static void __init csb726_init(void)
268/* MSC2 = 0x06697ff4; *//* none/SM501 */ 268/* MSC2 = 0x06697ff4; *//* none/SM501 */
269 MSC2 = (MSC2 & ~0xffff) | 0x7ff4; /* SM501 */ 269 MSC2 = (MSC2 & ~0xffff) | 0x7ff4; /* SM501 */
270 270
271 pxa_set_ffuart_info(NULL);
272 pxa_set_btuart_info(NULL);
273 pxa_set_stuart_info(NULL);
271 pxa_set_i2c_info(NULL); 274 pxa_set_i2c_info(NULL);
272 pxa27x_set_i2c_power_info(NULL); 275 pxa27x_set_i2c_power_info(NULL);
273 pxa_set_mci_info(&csb726_mci); 276 pxa_set_mci_info(&csb726_mci);
diff --git a/arch/arm/mach-pxa/devices.c b/arch/arm/mach-pxa/devices.c
index 46fabe1cca11..3395463bb5a6 100644
--- a/arch/arm/mach-pxa/devices.c
+++ b/arch/arm/mach-pxa/devices.c
@@ -4,17 +4,18 @@
4#include <linux/platform_device.h> 4#include <linux/platform_device.h>
5#include <linux/dma-mapping.h> 5#include <linux/dma-mapping.h>
6 6
7#include <mach/hardware.h>
7#include <mach/udc.h> 8#include <mach/udc.h>
8#include <mach/pxafb.h> 9#include <mach/pxafb.h>
9#include <mach/mmc.h> 10#include <mach/mmc.h>
10#include <mach/irda.h> 11#include <mach/irda.h>
11#include <plat/i2c.h>
12#include <mach/ohci.h> 12#include <mach/ohci.h>
13#include <mach/pxa27x_keypad.h> 13#include <mach/pxa27x_keypad.h>
14#include <mach/pxa2xx_spi.h> 14#include <mach/pxa2xx_spi.h>
15#include <mach/camera.h> 15#include <mach/camera.h>
16#include <mach/audio.h> 16#include <mach/audio.h>
17#include <mach/pxa3xx_nand.h> 17#include <plat/i2c.h>
18#include <plat/pxa3xx_nand.h>
18 19
19#include "devices.h" 20#include "devices.h"
20#include "generic.h" 21#include "generic.h"
@@ -167,13 +168,18 @@ static struct resource pxa_resource_ffuart[] = {
167 } 168 }
168}; 169};
169 170
170struct platform_device pxa_device_ffuart= { 171struct platform_device pxa_device_ffuart = {
171 .name = "pxa2xx-uart", 172 .name = "pxa2xx-uart",
172 .id = 0, 173 .id = 0,
173 .resource = pxa_resource_ffuart, 174 .resource = pxa_resource_ffuart,
174 .num_resources = ARRAY_SIZE(pxa_resource_ffuart), 175 .num_resources = ARRAY_SIZE(pxa_resource_ffuart),
175}; 176};
176 177
178void __init pxa_set_ffuart_info(void *info)
179{
180 pxa_register_device(&pxa_device_ffuart, info);
181}
182
177static struct resource pxa_resource_btuart[] = { 183static struct resource pxa_resource_btuart[] = {
178 { 184 {
179 .start = 0x40200000, 185 .start = 0x40200000,
@@ -193,6 +199,11 @@ struct platform_device pxa_device_btuart = {
193 .num_resources = ARRAY_SIZE(pxa_resource_btuart), 199 .num_resources = ARRAY_SIZE(pxa_resource_btuart),
194}; 200};
195 201
202void __init pxa_set_btuart_info(void *info)
203{
204 pxa_register_device(&pxa_device_btuart, info);
205}
206
196static struct resource pxa_resource_stuart[] = { 207static struct resource pxa_resource_stuart[] = {
197 { 208 {
198 .start = 0x40700000, 209 .start = 0x40700000,
@@ -212,6 +223,11 @@ struct platform_device pxa_device_stuart = {
212 .num_resources = ARRAY_SIZE(pxa_resource_stuart), 223 .num_resources = ARRAY_SIZE(pxa_resource_stuart),
213}; 224};
214 225
226void __init pxa_set_stuart_info(void *info)
227{
228 pxa_register_device(&pxa_device_stuart, info);
229}
230
215static struct resource pxa_resource_hwuart[] = { 231static struct resource pxa_resource_hwuart[] = {
216 { 232 {
217 .start = 0x41600000, 233 .start = 0x41600000,
@@ -231,6 +247,14 @@ struct platform_device pxa_device_hwuart = {
231 .num_resources = ARRAY_SIZE(pxa_resource_hwuart), 247 .num_resources = ARRAY_SIZE(pxa_resource_hwuart),
232}; 248};
233 249
250void __init pxa_set_hwuart_info(void *info)
251{
252 if (cpu_is_pxa255())
253 pxa_register_device(&pxa_device_hwuart, info);
254 else
255 pr_info("UART: Ignoring attempt to register HWUART on non-PXA255 hardware");
256}
257
234static struct resource pxai2c_resources[] = { 258static struct resource pxai2c_resources[] = {
235 { 259 {
236 .start = 0x40301680, 260 .start = 0x40301680,
diff --git a/arch/arm/mach-pxa/e330.c b/arch/arm/mach-pxa/e330.c
index 74d3f8987c5c..8fde3387279d 100644
--- a/arch/arm/mach-pxa/e330.c
+++ b/arch/arm/mach-pxa/e330.c
@@ -55,6 +55,9 @@ static struct platform_device *devices[] __initdata = {
55 55
56static void __init e330_init(void) 56static void __init e330_init(void)
57{ 57{
58 pxa_set_ffuart_info(NULL);
59 pxa_set_btuart_info(NULL);
60 pxa_set_stuart_info(NULL);
58 eseries_register_clks(); 61 eseries_register_clks();
59 eseries_get_tmio_gpios(); 62 eseries_get_tmio_gpios();
60 platform_add_devices(devices, ARRAY_SIZE(devices)); 63 platform_add_devices(devices, ARRAY_SIZE(devices));
diff --git a/arch/arm/mach-pxa/e350.c b/arch/arm/mach-pxa/e350.c
index 080036272131..f50f055f5720 100644
--- a/arch/arm/mach-pxa/e350.c
+++ b/arch/arm/mach-pxa/e350.c
@@ -56,6 +56,9 @@ static struct platform_device *devices[] __initdata = {
56 56
57static void __init e350_init(void) 57static void __init e350_init(void)
58{ 58{
59 pxa_set_ffuart_info(NULL);
60 pxa_set_btuart_info(NULL);
61 pxa_set_stuart_info(NULL);
59 eseries_register_clks(); 62 eseries_register_clks();
60 eseries_get_tmio_gpios(); 63 eseries_get_tmio_gpios();
61 platform_add_devices(devices, ARRAY_SIZE(devices)); 64 platform_add_devices(devices, ARRAY_SIZE(devices));
diff --git a/arch/arm/mach-pxa/e400.c b/arch/arm/mach-pxa/e400.c
index ed9c0c3f64a2..55b950f12844 100644
--- a/arch/arm/mach-pxa/e400.c
+++ b/arch/arm/mach-pxa/e400.c
@@ -130,6 +130,9 @@ static struct platform_device *devices[] __initdata = {
130static void __init e400_init(void) 130static void __init e400_init(void)
131{ 131{
132 pxa2xx_mfp_config(ARRAY_AND_SIZE(e400_pin_config)); 132 pxa2xx_mfp_config(ARRAY_AND_SIZE(e400_pin_config));
133 pxa_set_ffuart_info(NULL);
134 pxa_set_btuart_info(NULL);
135 pxa_set_stuart_info(NULL);
133 /* Fixme - e400 may have a switched clock */ 136 /* Fixme - e400 may have a switched clock */
134 eseries_register_clks(); 137 eseries_register_clks();
135 eseries_get_tmio_gpios(); 138 eseries_get_tmio_gpios();
diff --git a/arch/arm/mach-pxa/e740.c b/arch/arm/mach-pxa/e740.c
index 49acdfa6650d..94b23a9e3877 100644
--- a/arch/arm/mach-pxa/e740.c
+++ b/arch/arm/mach-pxa/e740.c
@@ -192,6 +192,9 @@ static struct platform_device *devices[] __initdata = {
192static void __init e740_init(void) 192static void __init e740_init(void)
193{ 193{
194 pxa2xx_mfp_config(ARRAY_AND_SIZE(e740_pin_config)); 194 pxa2xx_mfp_config(ARRAY_AND_SIZE(e740_pin_config));
195 pxa_set_ffuart_info(NULL);
196 pxa_set_btuart_info(NULL);
197 pxa_set_stuart_info(NULL);
195 eseries_register_clks(); 198 eseries_register_clks();
196 clk_add_alias("CLK_CK48M", e740_t7l66xb_device.name, 199 clk_add_alias("CLK_CK48M", e740_t7l66xb_device.name,
197 "UDCCLK", &pxa25x_device_udc.dev), 200 "UDCCLK", &pxa25x_device_udc.dev),
diff --git a/arch/arm/mach-pxa/e750.c b/arch/arm/mach-pxa/e750.c
index 4052ece3ef49..5eccbce73a33 100644
--- a/arch/arm/mach-pxa/e750.c
+++ b/arch/arm/mach-pxa/e750.c
@@ -194,6 +194,9 @@ static struct platform_device *devices[] __initdata = {
194static void __init e750_init(void) 194static void __init e750_init(void)
195{ 195{
196 pxa2xx_mfp_config(ARRAY_AND_SIZE(e750_pin_config)); 196 pxa2xx_mfp_config(ARRAY_AND_SIZE(e750_pin_config));
197 pxa_set_ffuart_info(NULL);
198 pxa_set_btuart_info(NULL);
199 pxa_set_stuart_info(NULL);
197 clk_add_alias("CLK_CK3P6MI", e750_tc6393xb_device.name, 200 clk_add_alias("CLK_CK3P6MI", e750_tc6393xb_device.name,
198 "GPIO11_CLK", NULL), 201 "GPIO11_CLK", NULL),
199 eseries_get_tmio_gpios(); 202 eseries_get_tmio_gpios();
diff --git a/arch/arm/mach-pxa/e800.c b/arch/arm/mach-pxa/e800.c
index 9866c7b9e784..aad129bed199 100644
--- a/arch/arm/mach-pxa/e800.c
+++ b/arch/arm/mach-pxa/e800.c
@@ -195,6 +195,9 @@ static struct platform_device *devices[] __initdata = {
195 195
196static void __init e800_init(void) 196static void __init e800_init(void)
197{ 197{
198 pxa_set_ffuart_info(NULL);
199 pxa_set_btuart_info(NULL);
200 pxa_set_stuart_info(NULL);
198 clk_add_alias("CLK_CK3P6MI", e800_tc6393xb_device.name, 201 clk_add_alias("CLK_CK3P6MI", e800_tc6393xb_device.name,
199 "GPIO11_CLK", NULL), 202 "GPIO11_CLK", NULL),
200 eseries_get_tmio_gpios(); 203 eseries_get_tmio_gpios();
diff --git a/arch/arm/mach-pxa/em-x270.c b/arch/arm/mach-pxa/em-x270.c
index aec7f4214b14..1c0de808b54d 100644
--- a/arch/arm/mach-pxa/em-x270.c
+++ b/arch/arm/mach-pxa/em-x270.c
@@ -967,7 +967,7 @@ static inline void em_x270_init_gpio_keys(void) {}
967#if defined(CONFIG_VIDEO_PXA27x) || defined(CONFIG_VIDEO_PXA27x_MODULE) 967#if defined(CONFIG_VIDEO_PXA27x) || defined(CONFIG_VIDEO_PXA27x_MODULE)
968static struct regulator *em_x270_camera_ldo; 968static struct regulator *em_x270_camera_ldo;
969 969
970static int em_x270_sensor_init(struct device *dev) 970static int em_x270_sensor_init(void)
971{ 971{
972 int ret; 972 int ret;
973 973
@@ -996,7 +996,6 @@ static int em_x270_sensor_init(struct device *dev)
996} 996}
997 997
998struct pxacamera_platform_data em_x270_camera_platform_data = { 998struct pxacamera_platform_data em_x270_camera_platform_data = {
999 .init = em_x270_sensor_init,
1000 .flags = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 | 999 .flags = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
1001 PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN, 1000 PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
1002 .mclk_10khz = 2600, 1001 .mclk_10khz = 2600,
@@ -1049,8 +1048,10 @@ static struct platform_device em_x270_camera = {
1049 1048
1050static void __init em_x270_init_camera(void) 1049static void __init em_x270_init_camera(void)
1051{ 1050{
1052 pxa_set_camera_info(&em_x270_camera_platform_data); 1051 if (em_x270_sensor_init() == 0) {
1053 platform_device_register(&em_x270_camera); 1052 pxa_set_camera_info(&em_x270_camera_platform_data);
1053 platform_device_register(&em_x270_camera);
1054 }
1054} 1055}
1055#else 1056#else
1056static inline void em_x270_init_camera(void) {} 1057static inline void em_x270_init_camera(void) {}
@@ -1286,6 +1287,10 @@ static void __init em_x270_init(void)
1286{ 1287{
1287 pxa2xx_mfp_config(ARRAY_AND_SIZE(common_pin_config)); 1288 pxa2xx_mfp_config(ARRAY_AND_SIZE(common_pin_config));
1288 1289
1290 pxa_set_ffuart_info(NULL);
1291 pxa_set_btuart_info(NULL);
1292 pxa_set_stuart_info(NULL);
1293
1289#ifdef CONFIG_PM 1294#ifdef CONFIG_PM
1290 pxa27x_set_pwrmode(PWRMODE_DEEPSLEEP); 1295 pxa27x_set_pwrmode(PWRMODE_DEEPSLEEP);
1291#endif 1296#endif
diff --git a/arch/arm/mach-pxa/ezx.c b/arch/arm/mach-pxa/ezx.c
index 588b265e5755..626c82b13970 100644
--- a/arch/arm/mach-pxa/ezx.c
+++ b/arch/arm/mach-pxa/ezx.c
@@ -17,7 +17,11 @@
17#include <linux/delay.h> 17#include <linux/delay.h>
18#include <linux/pwm_backlight.h> 18#include <linux/pwm_backlight.h>
19#include <linux/input.h> 19#include <linux/input.h>
20#include <linux/gpio.h>
20#include <linux/gpio_keys.h> 21#include <linux/gpio_keys.h>
22#include <linux/leds-lp3944.h>
23
24#include <media/soc_camera.h>
21 25
22#include <asm/setup.h> 26#include <asm/setup.h>
23#include <asm/mach-types.h> 27#include <asm/mach-types.h>
@@ -29,6 +33,7 @@
29#include <plat/i2c.h> 33#include <plat/i2c.h>
30#include <mach/hardware.h> 34#include <mach/hardware.h>
31#include <mach/pxa27x_keypad.h> 35#include <mach/pxa27x_keypad.h>
36#include <mach/camera.h>
32 37
33#include "devices.h" 38#include "devices.h"
34#include "generic.h" 39#include "generic.h"
@@ -38,6 +43,9 @@
38#define GPIO15_A910_FLIP_LID 15 43#define GPIO15_A910_FLIP_LID 15
39#define GPIO12_E680_LOCK_SWITCH 12 44#define GPIO12_E680_LOCK_SWITCH 12
40#define GPIO15_E6_LOCK_SWITCH 15 45#define GPIO15_E6_LOCK_SWITCH 15
46#define GPIO50_nCAM_EN 50
47#define GPIO19_GEN1_CAM_RST 19
48#define GPIO28_GEN2_CAM_RST 28
41 49
42static struct platform_pwm_backlight_data ezx_backlight_data = { 50static struct platform_pwm_backlight_data ezx_backlight_data = {
43 .pwm_id = 0, 51 .pwm_id = 0,
@@ -191,8 +199,8 @@ static unsigned long gen1_pin_config[] __initdata = {
191 GPIO94_CIF_DD_5, 199 GPIO94_CIF_DD_5,
192 GPIO17_CIF_DD_6, 200 GPIO17_CIF_DD_6,
193 GPIO108_CIF_DD_7, 201 GPIO108_CIF_DD_7,
194 GPIO50_GPIO, /* CAM_EN */ 202 GPIO50_GPIO | MFP_LPM_DRIVE_HIGH, /* CAM_EN */
195 GPIO19_GPIO, /* CAM_RST */ 203 GPIO19_GPIO | MFP_LPM_DRIVE_HIGH, /* CAM_RST */
196 204
197 /* EMU */ 205 /* EMU */
198 GPIO120_GPIO, /* EMU_MUX1 */ 206 GPIO120_GPIO, /* EMU_MUX1 */
@@ -248,8 +256,8 @@ static unsigned long gen2_pin_config[] __initdata = {
248 GPIO48_CIF_DD_5, 256 GPIO48_CIF_DD_5,
249 GPIO93_CIF_DD_6, 257 GPIO93_CIF_DD_6,
250 GPIO12_CIF_DD_7, 258 GPIO12_CIF_DD_7,
251 GPIO50_GPIO, /* CAM_EN */ 259 GPIO50_GPIO | MFP_LPM_DRIVE_HIGH, /* CAM_EN */
252 GPIO28_GPIO, /* CAM_RST */ 260 GPIO28_GPIO | MFP_LPM_DRIVE_HIGH, /* CAM_RST */
253 GPIO17_GPIO, /* CAM_FLASH */ 261 GPIO17_GPIO, /* CAM_FLASH */
254}; 262};
255#endif 263#endif
@@ -683,6 +691,81 @@ static struct platform_device a780_gpio_keys = {
683 }, 691 },
684}; 692};
685 693
694/* camera */
695static int a780_camera_init(void)
696{
697 int err;
698
699 /*
700 * GPIO50_nCAM_EN is active low
701 * GPIO19_GEN1_CAM_RST is active on rising edge
702 */
703 err = gpio_request(GPIO50_nCAM_EN, "nCAM_EN");
704 if (err) {
705 pr_err("%s: Failed to request nCAM_EN\n", __func__);
706 goto fail;
707 }
708
709 err = gpio_request(GPIO19_GEN1_CAM_RST, "CAM_RST");
710 if (err) {
711 pr_err("%s: Failed to request CAM_RST\n", __func__);
712 goto fail_gpio_cam_rst;
713 }
714
715 gpio_direction_output(GPIO50_nCAM_EN, 1);
716 gpio_direction_output(GPIO19_GEN1_CAM_RST, 0);
717
718 return 0;
719
720fail_gpio_cam_rst:
721 gpio_free(GPIO50_nCAM_EN);
722fail:
723 return err;
724}
725
726static int a780_camera_power(struct device *dev, int on)
727{
728 gpio_set_value(GPIO50_nCAM_EN, !on);
729 return 0;
730}
731
732static int a780_camera_reset(struct device *dev)
733{
734 gpio_set_value(GPIO19_GEN1_CAM_RST, 0);
735 msleep(10);
736 gpio_set_value(GPIO19_GEN1_CAM_RST, 1);
737
738 return 0;
739}
740
741struct pxacamera_platform_data a780_pxacamera_platform_data = {
742 .flags = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
743 PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
744 .mclk_10khz = 5000,
745};
746
747static struct i2c_board_info a780_camera_i2c_board_info = {
748 I2C_BOARD_INFO("mt9m111", 0x5d),
749};
750
751static struct soc_camera_link a780_iclink = {
752 .bus_id = 0,
753 .flags = SOCAM_SENSOR_INVERT_PCLK,
754 .i2c_adapter_id = 0,
755 .board_info = &a780_camera_i2c_board_info,
756 .module_name = "mt9m111",
757 .power = a780_camera_power,
758 .reset = a780_camera_reset,
759};
760
761static struct platform_device a780_camera = {
762 .name = "soc-camera-pdrv",
763 .id = 0,
764 .dev = {
765 .platform_data = &a780_iclink,
766 },
767};
768
686static struct platform_device *a780_devices[] __initdata = { 769static struct platform_device *a780_devices[] __initdata = {
687 &a780_gpio_keys, 770 &a780_gpio_keys,
688}; 771};
@@ -693,12 +776,21 @@ static void __init a780_init(void)
693 pxa2xx_mfp_config(ARRAY_AND_SIZE(gen1_pin_config)); 776 pxa2xx_mfp_config(ARRAY_AND_SIZE(gen1_pin_config));
694 pxa2xx_mfp_config(ARRAY_AND_SIZE(a780_pin_config)); 777 pxa2xx_mfp_config(ARRAY_AND_SIZE(a780_pin_config));
695 778
779 pxa_set_ffuart_info(NULL);
780 pxa_set_btuart_info(NULL);
781 pxa_set_stuart_info(NULL);
782
696 pxa_set_i2c_info(NULL); 783 pxa_set_i2c_info(NULL);
697 784
698 set_pxa_fb_info(&ezx_fb_info_1); 785 set_pxa_fb_info(&ezx_fb_info_1);
699 786
700 pxa_set_keypad_info(&a780_keypad_platform_data); 787 pxa_set_keypad_info(&a780_keypad_platform_data);
701 788
789 if (a780_camera_init() == 0) {
790 pxa_set_camera_info(&a780_pxacamera_platform_data);
791 platform_device_register(&a780_camera);
792 }
793
702 platform_add_devices(ARRAY_AND_SIZE(ezx_devices)); 794 platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
703 platform_add_devices(ARRAY_AND_SIZE(a780_devices)); 795 platform_add_devices(ARRAY_AND_SIZE(a780_devices));
704} 796}
@@ -754,6 +846,10 @@ static void __init e680_init(void)
754 pxa2xx_mfp_config(ARRAY_AND_SIZE(gen1_pin_config)); 846 pxa2xx_mfp_config(ARRAY_AND_SIZE(gen1_pin_config));
755 pxa2xx_mfp_config(ARRAY_AND_SIZE(e680_pin_config)); 847 pxa2xx_mfp_config(ARRAY_AND_SIZE(e680_pin_config));
756 848
849 pxa_set_ffuart_info(NULL);
850 pxa_set_btuart_info(NULL);
851 pxa_set_stuart_info(NULL);
852
757 pxa_set_i2c_info(NULL); 853 pxa_set_i2c_info(NULL);
758 i2c_register_board_info(0, ARRAY_AND_SIZE(e680_i2c_board_info)); 854 i2c_register_board_info(0, ARRAY_AND_SIZE(e680_i2c_board_info));
759 855
@@ -816,6 +912,10 @@ static void __init a1200_init(void)
816 pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config)); 912 pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config));
817 pxa2xx_mfp_config(ARRAY_AND_SIZE(a1200_pin_config)); 913 pxa2xx_mfp_config(ARRAY_AND_SIZE(a1200_pin_config));
818 914
915 pxa_set_ffuart_info(NULL);
916 pxa_set_btuart_info(NULL);
917 pxa_set_stuart_info(NULL);
918
819 pxa_set_i2c_info(NULL); 919 pxa_set_i2c_info(NULL);
820 i2c_register_board_info(0, ARRAY_AND_SIZE(a1200_i2c_board_info)); 920 i2c_register_board_info(0, ARRAY_AND_SIZE(a1200_i2c_board_info));
821 921
@@ -864,6 +964,131 @@ static struct platform_device a910_gpio_keys = {
864 }, 964 },
865}; 965};
866 966
967/* camera */
968static int a910_camera_init(void)
969{
970 int err;
971
972 /*
973 * GPIO50_nCAM_EN is active low
974 * GPIO28_GEN2_CAM_RST is active on rising edge
975 */
976 err = gpio_request(GPIO50_nCAM_EN, "nCAM_EN");
977 if (err) {
978 pr_err("%s: Failed to request nCAM_EN\n", __func__);
979 goto fail;
980 }
981
982 err = gpio_request(GPIO28_GEN2_CAM_RST, "CAM_RST");
983 if (err) {
984 pr_err("%s: Failed to request CAM_RST\n", __func__);
985 goto fail_gpio_cam_rst;
986 }
987
988 gpio_direction_output(GPIO50_nCAM_EN, 1);
989 gpio_direction_output(GPIO28_GEN2_CAM_RST, 0);
990
991 return 0;
992
993fail_gpio_cam_rst:
994 gpio_free(GPIO50_nCAM_EN);
995fail:
996 return err;
997}
998
999static int a910_camera_power(struct device *dev, int on)
1000{
1001 gpio_set_value(GPIO50_nCAM_EN, !on);
1002 return 0;
1003}
1004
1005static int a910_camera_reset(struct device *dev)
1006{
1007 gpio_set_value(GPIO28_GEN2_CAM_RST, 0);
1008 msleep(10);
1009 gpio_set_value(GPIO28_GEN2_CAM_RST, 1);
1010
1011 return 0;
1012}
1013
1014struct pxacamera_platform_data a910_pxacamera_platform_data = {
1015 .flags = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
1016 PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
1017 .mclk_10khz = 5000,
1018};
1019
1020static struct i2c_board_info a910_camera_i2c_board_info = {
1021 I2C_BOARD_INFO("mt9m111", 0x5d),
1022};
1023
1024static struct soc_camera_link a910_iclink = {
1025 .bus_id = 0,
1026 .i2c_adapter_id = 0,
1027 .board_info = &a910_camera_i2c_board_info,
1028 .module_name = "mt9m111",
1029 .power = a910_camera_power,
1030 .reset = a910_camera_reset,
1031};
1032
1033static struct platform_device a910_camera = {
1034 .name = "soc-camera-pdrv",
1035 .id = 0,
1036 .dev = {
1037 .platform_data = &a910_iclink,
1038 },
1039};
1040
1041/* leds-lp3944 */
1042static struct lp3944_platform_data a910_lp3944_leds = {
1043 .leds_size = LP3944_LEDS_MAX,
1044 .leds = {
1045 [0] = {
1046 .name = "a910:red:",
1047 .status = LP3944_LED_STATUS_OFF,
1048 .type = LP3944_LED_TYPE_LED,
1049 },
1050 [1] = {
1051 .name = "a910:green:",
1052 .status = LP3944_LED_STATUS_OFF,
1053 .type = LP3944_LED_TYPE_LED,
1054 },
1055 [2] {
1056 .name = "a910:blue:",
1057 .status = LP3944_LED_STATUS_OFF,
1058 .type = LP3944_LED_TYPE_LED,
1059 },
1060 /* Leds 3 and 4 are used as display power switches */
1061 [3] = {
1062 .name = "a910::cli_display",
1063 .status = LP3944_LED_STATUS_OFF,
1064 .type = LP3944_LED_TYPE_LED_INVERTED
1065 },
1066 [4] = {
1067 .name = "a910::main_display",
1068 .status = LP3944_LED_STATUS_ON,
1069 .type = LP3944_LED_TYPE_LED_INVERTED
1070 },
1071 [5] = { .type = LP3944_LED_TYPE_NONE },
1072 [6] = {
1073 .name = "a910::torch",
1074 .status = LP3944_LED_STATUS_OFF,
1075 .type = LP3944_LED_TYPE_LED,
1076 },
1077 [7] = {
1078 .name = "a910::flash",
1079 .status = LP3944_LED_STATUS_OFF,
1080 .type = LP3944_LED_TYPE_LED_INVERTED,
1081 },
1082 },
1083};
1084
1085static struct i2c_board_info __initdata a910_i2c_board_info[] = {
1086 {
1087 I2C_BOARD_INFO("lp3944", 0x60),
1088 .platform_data = &a910_lp3944_leds,
1089 },
1090};
1091
867static struct platform_device *a910_devices[] __initdata = { 1092static struct platform_device *a910_devices[] __initdata = {
868 &a910_gpio_keys, 1093 &a910_gpio_keys,
869}; 1094};
@@ -874,12 +1099,22 @@ static void __init a910_init(void)
874 pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config)); 1099 pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config));
875 pxa2xx_mfp_config(ARRAY_AND_SIZE(a910_pin_config)); 1100 pxa2xx_mfp_config(ARRAY_AND_SIZE(a910_pin_config));
876 1101
1102 pxa_set_ffuart_info(NULL);
1103 pxa_set_btuart_info(NULL);
1104 pxa_set_stuart_info(NULL);
1105
877 pxa_set_i2c_info(NULL); 1106 pxa_set_i2c_info(NULL);
1107 i2c_register_board_info(0, ARRAY_AND_SIZE(a910_i2c_board_info));
878 1108
879 set_pxa_fb_info(&ezx_fb_info_2); 1109 set_pxa_fb_info(&ezx_fb_info_2);
880 1110
881 pxa_set_keypad_info(&a910_keypad_platform_data); 1111 pxa_set_keypad_info(&a910_keypad_platform_data);
882 1112
1113 if (a910_camera_init() == 0) {
1114 pxa_set_camera_info(&a910_pxacamera_platform_data);
1115 platform_device_register(&a910_camera);
1116 }
1117
883 platform_add_devices(ARRAY_AND_SIZE(ezx_devices)); 1118 platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
884 platform_add_devices(ARRAY_AND_SIZE(a910_devices)); 1119 platform_add_devices(ARRAY_AND_SIZE(a910_devices));
885} 1120}
@@ -935,6 +1170,10 @@ static void __init e6_init(void)
935 pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config)); 1170 pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config));
936 pxa2xx_mfp_config(ARRAY_AND_SIZE(e6_pin_config)); 1171 pxa2xx_mfp_config(ARRAY_AND_SIZE(e6_pin_config));
937 1172
1173 pxa_set_ffuart_info(NULL);
1174 pxa_set_btuart_info(NULL);
1175 pxa_set_stuart_info(NULL);
1176
938 pxa_set_i2c_info(NULL); 1177 pxa_set_i2c_info(NULL);
939 i2c_register_board_info(0, ARRAY_AND_SIZE(e6_i2c_board_info)); 1178 i2c_register_board_info(0, ARRAY_AND_SIZE(e6_i2c_board_info));
940 1179
@@ -971,6 +1210,10 @@ static void __init e2_init(void)
971 pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config)); 1210 pxa2xx_mfp_config(ARRAY_AND_SIZE(gen2_pin_config));
972 pxa2xx_mfp_config(ARRAY_AND_SIZE(e2_pin_config)); 1211 pxa2xx_mfp_config(ARRAY_AND_SIZE(e2_pin_config));
973 1212
1213 pxa_set_ffuart_info(NULL);
1214 pxa_set_btuart_info(NULL);
1215 pxa_set_stuart_info(NULL);
1216
974 pxa_set_i2c_info(NULL); 1217 pxa_set_i2c_info(NULL);
975 i2c_register_board_info(0, ARRAY_AND_SIZE(e2_i2c_board_info)); 1218 i2c_register_board_info(0, ARRAY_AND_SIZE(e2_i2c_board_info));
976 1219
diff --git a/arch/arm/mach-pxa/generic.h b/arch/arm/mach-pxa/generic.h
index 485fede83d97..890fb90a672f 100644
--- a/arch/arm/mach-pxa/generic.h
+++ b/arch/arm/mach-pxa/generic.h
@@ -67,3 +67,8 @@ extern struct sysdev_class pxa_irq_sysclass;
67extern struct sysdev_class pxa_gpio_sysclass; 67extern struct sysdev_class pxa_gpio_sysclass;
68extern struct sysdev_class pxa2xx_mfp_sysclass; 68extern struct sysdev_class pxa2xx_mfp_sysclass;
69extern struct sysdev_class pxa3xx_mfp_sysclass; 69extern struct sysdev_class pxa3xx_mfp_sysclass;
70
71void __init pxa_set_ffuart_info(void *info);
72void __init pxa_set_btuart_info(void *info);
73void __init pxa_set_stuart_info(void *info);
74void __init pxa_set_hwuart_info(void *info);
diff --git a/arch/arm/mach-pxa/gumstix.c b/arch/arm/mach-pxa/gumstix.c
index 1708c0109844..96c345129135 100644
--- a/arch/arm/mach-pxa/gumstix.c
+++ b/arch/arm/mach-pxa/gumstix.c
@@ -211,6 +211,11 @@ static void __init gumstix_init(void)
211{ 211{
212 pxa2xx_mfp_config(ARRAY_AND_SIZE(gumstix_pin_config)); 212 pxa2xx_mfp_config(ARRAY_AND_SIZE(gumstix_pin_config));
213 213
214 pxa_set_ffuart_info(NULL);
215 pxa_set_btuart_info(NULL);
216 pxa_set_stuart_info(NULL);
217 pxa_set_hwuart_info(NULL);
218
214 gumstix_bluetooth_init(); 219 gumstix_bluetooth_init();
215 gumstix_udc_init(); 220 gumstix_udc_init();
216 gumstix_mmc_init(); 221 gumstix_mmc_init();
diff --git a/arch/arm/mach-pxa/h5000.c b/arch/arm/mach-pxa/h5000.c
index f3d220c32e07..c1cab0871c99 100644
--- a/arch/arm/mach-pxa/h5000.c
+++ b/arch/arm/mach-pxa/h5000.c
@@ -193,6 +193,9 @@ static void __init h5000_init(void)
193 fix_msc(); 193 fix_msc();
194 194
195 pxa2xx_mfp_config(ARRAY_AND_SIZE(h5000_pin_config)); 195 pxa2xx_mfp_config(ARRAY_AND_SIZE(h5000_pin_config));
196 pxa_set_ffuart_info(NULL);
197 pxa_set_btuart_info(NULL);
198 pxa_set_stuart_info(NULL);
196 pxa_set_udc_info(&h5000_udc_mach_info); 199 pxa_set_udc_info(&h5000_udc_mach_info);
197 platform_add_devices(ARRAY_AND_SIZE(devices)); 200 platform_add_devices(ARRAY_AND_SIZE(devices));
198} 201}
diff --git a/arch/arm/mach-pxa/himalaya.c b/arch/arm/mach-pxa/himalaya.c
index cea99fe65b97..f9a2e4b0f090 100644
--- a/arch/arm/mach-pxa/himalaya.c
+++ b/arch/arm/mach-pxa/himalaya.c
@@ -150,6 +150,9 @@ static void __init himalaya_lcd_init(void)
150 150
151static void __init himalaya_init(void) 151static void __init himalaya_init(void)
152{ 152{
153 pxa_set_ffuart_info(NULL);
154 pxa_set_btuart_info(NULL);
155 pxa_set_stuart_info(NULL);
153 himalaya_lcd_init(); 156 himalaya_lcd_init();
154 platform_add_devices(devices, ARRAY_SIZE(devices)); 157 platform_add_devices(devices, ARRAY_SIZE(devices));
155} 158}
diff --git a/arch/arm/mach-pxa/hx4700.c b/arch/arm/mach-pxa/hx4700.c
index 83bd3c6e3884..848c861dd23f 100644
--- a/arch/arm/mach-pxa/hx4700.c
+++ b/arch/arm/mach-pxa/hx4700.c
@@ -820,6 +820,7 @@ static struct platform_device *devices[] __initdata = {
820 &gpio_keys, 820 &gpio_keys,
821 &backlight, 821 &backlight,
822 &w3220, 822 &w3220,
823 &hx4700_lcd,
823 &egpio, 824 &egpio,
824 &bq24022, 825 &bq24022,
825 &gpio_vbus, 826 &gpio_vbus,
@@ -849,6 +850,10 @@ static void __init hx4700_init(void)
849 pxa2xx_mfp_config(ARRAY_AND_SIZE(hx4700_pin_config)); 850 pxa2xx_mfp_config(ARRAY_AND_SIZE(hx4700_pin_config));
850 hx4700_gpio_request(ARRAY_AND_SIZE(global_gpios)); 851 hx4700_gpio_request(ARRAY_AND_SIZE(global_gpios));
851 852
853 pxa_set_ffuart_info(NULL);
854 pxa_set_btuart_info(NULL);
855 pxa_set_stuart_info(NULL);
856
852 platform_add_devices(devices, ARRAY_SIZE(devices)); 857 platform_add_devices(devices, ARRAY_SIZE(devices));
853 858
854 pxa_set_ficp_info(&ficp_info); 859 pxa_set_ficp_info(&ficp_info);
diff --git a/arch/arm/mach-pxa/idp.c b/arch/arm/mach-pxa/idp.c
index b6486ef20b17..5c9e11d74f49 100644
--- a/arch/arm/mach-pxa/idp.c
+++ b/arch/arm/mach-pxa/idp.c
@@ -179,6 +179,9 @@ static void __init idp_init(void)
179 printk("idp_init()\n"); 179 printk("idp_init()\n");
180 180
181 pxa2xx_mfp_config(ARRAY_AND_SIZE(idp_pin_config)); 181 pxa2xx_mfp_config(ARRAY_AND_SIZE(idp_pin_config));
182 pxa_set_ffuart_info(NULL);
183 pxa_set_btuart_info(NULL);
184 pxa_set_stuart_info(NULL);
182 185
183 platform_device_register(&smc91x_device); 186 platform_device_register(&smc91x_device);
184 //platform_device_register(&mst_audio_device); 187 //platform_device_register(&mst_audio_device);
diff --git a/arch/arm/mach-pxa/imote2.c b/arch/arm/mach-pxa/imote2.c
index 2a4945db31c5..5b0862df61ab 100644
--- a/arch/arm/mach-pxa/imote2.c
+++ b/arch/arm/mach-pxa/imote2.c
@@ -554,8 +554,12 @@ static struct i2c_pxa_platform_data i2c_pdata = {
554 554
555static void __init imote2_init(void) 555static void __init imote2_init(void)
556{ 556{
557
558 pxa2xx_mfp_config(ARRAY_AND_SIZE(imote2_pin_config)); 557 pxa2xx_mfp_config(ARRAY_AND_SIZE(imote2_pin_config));
558
559 pxa_set_ffuart_info(NULL);
560 pxa_set_btuart_info(NULL);
561 pxa_set_stuart_info(NULL);
562
559 /* SPI chip select directions - all other directions should 563 /* SPI chip select directions - all other directions should
560 * be handled by drivers.*/ 564 * be handled by drivers.*/
561 gpio_direction_output(37, 0); 565 gpio_direction_output(37, 0);
diff --git a/arch/arm/mach-pxa/include/mach/hardware.h b/arch/arm/mach-pxa/include/mach/hardware.h
index aa3d9f70a08a..50f1297bf5ac 100644
--- a/arch/arm/mach-pxa/include/mach/hardware.h
+++ b/arch/arm/mach-pxa/include/mach/hardware.h
@@ -105,6 +105,7 @@
105 * 105 *
106 * PXA935 A0 0x56056931 0x1E653013 106 * PXA935 A0 0x56056931 0x1E653013
107 * PXA935 B0 0x56056936 0x6E653013 107 * PXA935 B0 0x56056936 0x6E653013
108 * PXA935 B1 0x56056938 0x8E653013
108 */ 109 */
109#ifdef CONFIG_PXA25x 110#ifdef CONFIG_PXA25x
110#define __cpu_is_pxa210(id) \ 111#define __cpu_is_pxa210(id) \
@@ -283,7 +284,7 @@
283 _id == 0x3; \ 284 _id == 0x3; \
284 }) 285 })
285 286
286#define __cpu_is_pxa9xx(id) \ 287#define __cpu_is_pxa93x(id) \
287 ({ \ 288 ({ \
288 unsigned int _id = (id) >> 4 & 0xfff; \ 289 unsigned int _id = (id) >> 4 & 0xfff; \
289 _id == 0x683 || _id == 0x693; \ 290 _id == 0x683 || _id == 0x693; \
@@ -299,9 +300,9 @@
299 __cpu_is_pxa3xx(read_cpuid_id()); \ 300 __cpu_is_pxa3xx(read_cpuid_id()); \
300 }) 301 })
301 302
302#define cpu_is_pxa9xx() \ 303#define cpu_is_pxa93x() \
303 ({ \ 304 ({ \
304 __cpu_is_pxa9xx(read_cpuid_id()); \ 305 __cpu_is_pxa93x(read_cpuid_id()); \
305 }) 306 })
306/* 307/*
307 * return current memory and LCD clock frequency in units of 10kHz 308 * return current memory and LCD clock frequency in units of 10kHz
diff --git a/arch/arm/mach-pxa/include/mach/palmtreo.h b/arch/arm/mach-pxa/include/mach/palmtreo.h
new file mode 100644
index 000000000000..2d3f14e3be29
--- /dev/null
+++ b/arch/arm/mach-pxa/include/mach/palmtreo.h
@@ -0,0 +1,67 @@
1/*
2 * GPIOs and interrupts for Palm Treo smartphones
3 *
4 * currently supported:
5 * Palm Treo 680 (GSM)
6 * Palm Centro 685 (GSM)
7 *
8 * Author: Tomas Cech <sleep_walker@suse.cz>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 *
14 * find more info at www.hackndev.com
15 *
16 */
17
18#ifndef _INCLUDE_TREO_H_
19#define _INCLUDE_TREO_H_
20
21/* GPIOs */
22#define GPIO_NR_TREO_POWER_DETECT 0
23#define GPIO_NR_TREO_AMP_EN 27
24#define GPIO_NR_TREO_GREEN_LED 20
25#define GPIO_NR_TREO_RED_LED 79
26#define GPIO_NR_TREO_SD_DETECT_N 113
27#define GPIO_NR_TREO_EP_DETECT_N 116
28#define GPIO_NR_TREO_USB_DETECT 1
29#define GPIO_NR_TREO_USB_PULLUP 114
30#define GPIO_NR_TREO_GSM_POWER 40
31#define GPIO_NR_TREO_GSM_RESET 87
32#define GPIO_NR_TREO_GSM_WAKE 57
33#define GPIO_NR_TREO_GSM_HOST_WAKE 14
34#define GPIO_NR_TREO_GSM_TRIGGER 10
35#define GPIO_NR_TREO_IR_EN 115
36#define GPIO_NR_TREO_IR_TXD 47
37#define GPIO_NR_TREO_BL_POWER 38
38#define GPIO_NR_TREO_LCD_POWER 25
39
40/* Treo680 specific GPIOs */
41#ifdef CONFIG_MACH_TREO680
42#define GPIO_NR_TREO680_SD_READONLY 33
43#define GPIO_NR_TREO680_SD_POWER 42
44#define GPIO_NR_TREO680_VIBRATE_EN 44
45#define GPIO_NR_TREO680_KEYB_BL 24
46#define GPIO_NR_TREO680_BT_EN 43
47#endif /* CONFIG_MACH_TREO680 */
48
49/* Centro685 specific GPIOs */
50#define GPIO_NR_CENTRO_SD_POWER 21
51#define GPIO_NR_CENTRO_VIBRATE_EN 22
52#define GPIO_NR_CENTRO_KEYB_BL 33
53#define GPIO_NR_CENTRO_BT_EN 80
54
55/* Various addresses */
56#define TREO_PHYS_RAM_START 0xa0000000
57#define TREO_PHYS_IO_START 0x40000000
58#define TREO_STR_BASE 0xa2000000
59
60/* BACKLIGHT */
61#define TREO_MAX_INTENSITY 254
62#define TREO_DEFAULT_INTENSITY 160
63#define TREO_LIMIT_MASK 0x7F
64#define TREO_PRESCALER 63
65#define TREO_PERIOD_NS 3500
66
67#endif
diff --git a/arch/arm/mach-pxa/include/mach/pxafb.h b/arch/arm/mach-pxa/include/mach/pxafb.h
index f73061c90b5e..160ec83f51a6 100644
--- a/arch/arm/mach-pxa/include/mach/pxafb.h
+++ b/arch/arm/mach-pxa/include/mach/pxafb.h
@@ -76,7 +76,8 @@ struct pxafb_mode_info {
76 u_char bpp; 76 u_char bpp;
77 u_int cmap_greyscale:1, 77 u_int cmap_greyscale:1,
78 depth:8, 78 depth:8,
79 unused:23; 79 transparency:1,
80 unused:22;
80 81
81 /* Parallel Mode Timing */ 82 /* Parallel Mode Timing */
82 u_char hsync_len; 83 u_char hsync_len;
diff --git a/arch/arm/mach-pxa/include/mach/regs-u2d.h b/arch/arm/mach-pxa/include/mach/regs-u2d.h
new file mode 100644
index 000000000000..44b0b20b69a4
--- /dev/null
+++ b/arch/arm/mach-pxa/include/mach/regs-u2d.h
@@ -0,0 +1,199 @@
1#ifndef __ASM_ARCH_PXA3xx_U2D_H
2#define __ASM_ARCH_PXA3xx_U2D_H
3
4#include <mach/bitfield.h>
5
6/*
7 * USB2 device controller registers and bits definitions
8 */
9#define U2DCR (0x0000) /* U2D Control Register */
10#define U2DCR_NDC (1 << 31) /* NAK During Config */
11#define U2DCR_HSTC (0x7 << 28) /* High Speed Timeout Calibration */
12#define U2DCR_SPEOREN (1 << 27) /* Short Packet EOR INTR generation Enable */
13#define U2DCR_FSTC (0x7 << 24) /* Full Speed Timeout Calibration */
14#define U2DCR_UCLKOVR (1 << 22) /* UTM Clock Override */
15#define U2DCR_ABP (1 << 21) /* Application Bus Power */
16#define U2DCR_ADD (1 << 20) /* Application Device Disconnect */
17#define U2DCR_CC (1 << 19) /* Configuration Change */
18#define U2DCR_HS (1 << 18) /* High Speed USB Detection */
19#define U2DCR_SMAC (1 << 17) /* Switch Endpoint Memory to Active Configuration */
20#define U2DCR_DWRE (1 << 16) /* Device Remote Wake-up Feature */
21#define U2DCR_ACN (0xf << 12) /* Active U2D Configuration Number */
22#define U2DCR_AIN (0xf << 8) /* Active U2D Interface Number */
23#define U2DCR_AAISN (0xf << 4) /* Active U2D Alternate Interface Setting Number */
24#define U2DCR_EMCE (1 << 3) /* Endpoint Memory Configuration Error */
25#define U2DCR_UDR (1 << 2) /* U2D Resume */
26#define U2DCR_UDA (1 << 1) /* U2D Active */
27#define U2DCR_UDE (1 << 0) /* U2D Enable */
28
29#define U2DICR (0x0004) /* U2D Interrupt Control Register */
30#define U2DISR (0x000C) /* U2D Interrupt Status Register */
31#define U2DINT_CC (1 << 31) /* Interrupt - Configuration Change */
32#define U2DINT_SOF (1 << 30) /* Interrupt - SOF */
33#define U2DINT_USOF (1 << 29) /* Interrupt - micro SOF */
34#define U2DINT_RU (1 << 28) /* Interrupt - Resume */
35#define U2DINT_SU (1 << 27) /* Interrupt - Suspend */
36#define U2DINT_RS (1 << 26) /* Interrupt - Reset */
37#define U2DINT_DPE (1 << 25) /* Interrupt - Data Packet Error */
38#define U2DINT_FIFOERR (0x4) /* Interrupt - endpoint FIFO error */
39#define U2DINT_PACKETCMP (0x2) /* Interrupt - endpoint packet complete */
40#define U2DINT_SPACKETCMP (0x1) /* Interrupt - endpoint short packet complete */
41
42#define U2DFNR (0x0014) /* U2D Frame Number Register */
43
44#define U2DINT(n, intr) (((intr) & 0x07) << (((n) & 0x07) * 3))
45#define U2DICR2 (0x0008) /* U2D Interrupt Control Register 2 */
46#define U2DISR2 (0x0010) /* U2D Interrupt Status Register 2 */
47
48#define U2DOTGCR (0x0020) /* U2D OTG Control Register */
49#define U2DOTGCR_OTGEN (1 << 31) /* On-The-Go Enable */
50#define U2DOTGCR_AALTHNP (1 << 30) /* A-device Alternate Host Negotiation Protocal Port Support */
51#define U2DOTGCR_AHNP (1 << 29) /* A-device Host Negotiation Protocal Support */
52#define U2DOTGCR_BHNP (1 << 28) /* B-device Host Negotiation Protocal Enable */
53
54#ifdef CONFIG_CPU_PXA930
55#define U2DOTGCR_LPA (1 << 15) /* ULPI low power mode active */
56#define U2DOTGCR_IESI (1 << 13) /* OTG interrupt Enable */
57#define U2DOTGCR_ISSI (1 << 12) /* OTG interrupt status */
58#endif
59
60#define U2DOTGCR_CKAF (1 << 5) /* Carkit Mode Alternate Function Select */
61#define U2DOTGCR_UTMID (1 << 4) /* UTMI Interface Disable */
62#define U2DOTGCR_ULAF (1 << 3) /* ULPI Mode Alternate Function Select */
63#define U2DOTGCR_SMAF (1 << 2) /* Serial Mode Alternate Function Select */
64#define U2DOTGCR_RTSM (1 << 1) /* Return to Synchronous Mode (ULPI Mode) */
65#define U2DOTGCR_ULE (1 << 0) /* ULPI Wrapper Enable */
66
67#define U2DOTGICR (0x0024) /* U2D OTG Interrupt Control Register */
68#define U2DOTGISR (0x0028) /* U2D OTG Interrupt Status Register */
69
70#define U2DOTGINT_SF (1 << 17) /* OTG Set Feature Command Received */
71#define U2DOTGINT_SI (1 << 16) /* OTG Interrupt */
72#define U2DOTGINT_RLS1 (1 << 14) /* RXCMD Linestate[1] Change Interrupt Rise */
73#define U2DOTGINT_RLS0 (1 << 13) /* RXCMD Linestate[0] Change Interrupt Rise */
74#define U2DOTGINT_RID (1 << 12) /* RXCMD OTG ID Change Interrupt Rise */
75#define U2DOTGINT_RSE (1 << 11) /* RXCMD OTG Session End Interrupt Rise */
76#define U2DOTGINT_RSV (1 << 10) /* RXCMD OTG Session Valid Interrupt Rise */
77#define U2DOTGINT_RVV (1 << 9) /* RXCMD OTG Vbus Valid Interrupt Rise */
78#define U2DOTGINT_RCK (1 << 8) /* RXCMD Carkit Interrupt Rise */
79#define U2DOTGINT_FLS1 (1 << 6) /* RXCMD Linestate[1] Change Interrupt Fall */
80#define U2DOTGINT_FLS0 (1 << 5) /* RXCMD Linestate[0] Change Interrupt Fall */
81#define U2DOTGINT_FID (1 << 4) /* RXCMD OTG ID Change Interrupt Fall */
82#define U2DOTGINT_FSE (1 << 3) /* RXCMD OTG Session End Interrupt Fall */
83#define U2DOTGINT_FSV (1 << 2) /* RXCMD OTG Session Valid Interrupt Fall */
84#define U2DOTGINT_FVV (1 << 1) /* RXCMD OTG Vbus Valid Interrupt Fall */
85#define U2DOTGINT_FCK (1 << 0) /* RXCMD Carkit Interrupt Fall */
86
87#define U2DOTGUSR (0x002C) /* U2D OTG ULPI Status Register */
88#define U2DOTGUSR_LPA (1 << 31) /* ULPI Low Power Mode Active */
89#define U2DOTGUSR_S6A (1 << 30) /* ULPI Serial Mode (6-pin) Active */
90#define U2DOTGUSR_S3A (1 << 29) /* ULPI Serial Mode (3-pin) Active */
91#define U2DOTGUSR_CKA (1 << 28) /* ULPI Car Kit Mode Active */
92#define U2DOTGUSR_LS1 (1 << 6) /* RXCMD Linestate 1 Status */
93#define U2DOTGUSR_LS0 (1 << 5) /* RXCMD Linestate 0 Status */
94#define U2DOTGUSR_ID (1 << 4) /* OTG IDGnd Status */
95#define U2DOTGUSR_SE (1 << 3) /* OTG Session End Status */
96#define U2DOTGUSR_SV (1 << 2) /* OTG Session Valid Status */
97#define U2DOTGUSR_VV (1 << 1) /* OTG Vbus Valid Status */
98#define U2DOTGUSR_CK (1 << 0) /* Carkit Interrupt Status */
99
100#define U2DOTGUCR (0x0030) /* U2D OTG ULPI Control Register */
101#define U2DOTGUCR_RUN (1 << 25) /* RUN */
102#define U2DOTGUCR_RNW (1 << 24) /* Read or Write operation */
103#define U2DOTGUCR_ADDR (0x3f << 16) /* Address of the ULPI PHY register */
104#define U2DOTGUCR_WDATA (0xff << 8) /* The data for a WRITE command */
105#define U2DOTGUCR_RDATA (0xff << 0) /* The data for a READ command */
106
107#define U2DP3CR (0x0034) /* U2D Port 3 Control Register */
108#define U2DP3CR_P2SS (0x3 << 8) /* Host Port 2 Serial Mode Select */
109#define U2DP3CR_P3SS (0x7 << 4) /* Host Port 3 Serial Mode Select */
110#define U2DP3CR_VPVMBEN (0x1 << 2) /* Host Port 3 Vp/Vm Block Enable */
111#define U2DP3CR_CFG (0x3 << 0) /* Host Port 3 Configuration */
112
113#define U2DCSR0 (0x0100) /* U2D Control/Status Register - Endpoint 0 */
114#define U2DCSR0_IPA (1 << 8) /* IN Packet Adjusted */
115#define U2DCSR0_SA (1 << 7) /* SETUP Active */
116#define U2DCSR0_RNE (1 << 6) /* Receive FIFO Not Empty */
117#define U2DCSR0_FST (1 << 5) /* Force Stall */
118#define U2DCSR0_SST (1 << 4) /* Send Stall */
119#define U2DCSR0_DME (1 << 3) /* DMA Enable */
120#define U2DCSR0_FTF (1 << 2) /* Flush Transmit FIFO */
121#define U2DCSR0_IPR (1 << 1) /* IN Packet Ready */
122#define U2DCSR0_OPC (1 << 0) /* OUT Packet Complete */
123
124#define U2DCSR(x) (0x0100 + ((x) << 2)) /* U2D Control/Status Register - Endpoint x */
125#define U2DCSR_BF (1 << 10) /* Buffer Full, for OUT eps */
126#define U2DCSR_BE (1 << 10) /* Buffer Empty, for IN eps */
127#define U2DCSR_DPE (1 << 9) /* Data Packet Error, for ISO eps only */
128#define U2DCSR_FEF (1 << 8) /* Flush Endpoint FIFO */
129#define U2DCSR_SP (1 << 7) /* Short Packet Control/Status, for OUT eps only, readonly */
130#define U2DCSR_BNE (1 << 6) /* Buffer Not Empty, for OUT eps */
131#define U2DCSR_BNF (1 << 6) /* Buffer Not Full, for IN eps */
132#define U2DCSR_FST (1 << 5) /* Force STALL, write 1 set */
133#define U2DCSR_SST (1 << 4) /* Sent STALL, write 1 clear */
134#define U2DCSR_DME (1 << 3) /* DMA Enable */
135#define U2DCSR_TRN (1 << 2) /* Tx/Rx NAK, write 1 clear */
136#define U2DCSR_PC (1 << 1) /* Packet Complete, write 1 clear */
137#define U2DCSR_FS (1 << 0) /* FIFO needs Service */
138
139#define U2DBCR0 (0x0200) /* U2D Byte Count Register - Endpoint 0 */
140#define U2DBCR(x) (0x0200 + ((x) << 2)) /* U2D Byte Count Register - Endpoint x */
141
142#define U2DDR0 (0x0300) /* U2D Data Register - Endpoint 0 */
143
144#define U2DEPCR(x) (0x0400 + ((x) << 2)) /* U2D Configuration Register - Endpoint x */
145#define U2DEPCR_EE (1 << 0) /* Endpoint Enable */
146#define U2DEPCR_BS_MASK (0x3FE) /* Buffer Size, BS*8=FIFO size, max 8184B = 8KB */
147
148#define U2DSCA (0x0500) /* U2D Setup Command Address */
149#define U2DSCA_VALUE (0x0120)
150
151#define U2DEN0 (0x0504) /* U2D Endpoint Information Register - Endpoint 0 */
152#define U2DEN(x) (0x0504 + ((x) << 2)) /* U2D Endpoint Information Register - Endpoint x */
153
154/* U2DMA registers */
155#define U2DMACSR0 (0x1000) /* U2DMA Control/Status Register - Channel 0 */
156#define U2DMACSR(x) (0x1000 + ((x) << 2)) /* U2DMA Control/Status Register - Channel x */
157#define U2DMACSR_RUN (1 << 31) /* Run Bit (read / write) */
158#define U2DMACSR_STOPIRQEN (1 << 29) /* Stop Interrupt Enable (read / write) */
159#define U2DMACSR_EORIRQEN (1 << 28) /* End of Receive Interrupt Enable (R/W) */
160#define U2DMACSR_EORJMPEN (1 << 27) /* Jump to next descriptor on EOR */
161#define U2DMACSR_EORSTOPEN (1 << 26) /* STOP on an EOR */
162#define U2DMACSR_RASIRQEN (1 << 23) /* Request After Cnannel Stopped Interrupt Enable */
163#define U2DMACSR_MASKRUN (1 << 22) /* Mask Run */
164#define U2DMACSR_SCEMC (3 << 18) /* System Bus Split Completion Error Message Class */
165#define U2DMACSR_SCEMI (0x1f << 13) /* System Bus Split Completion Error Message Index */
166#define U2DMACSR_BUSERRTYPE (7 << 10) /* PX Bus Error Type */
167#define U2DMACSR_EORINTR (1 << 9) /* End Of Receive */
168#define U2DMACSR_REQPEND (1 << 8) /* Request Pending */
169#define U2DMACSR_RASINTR (1 << 4) /* Request After Channel Stopped (read / write 1 clear) */#define U2DMACSR_STOPINTR (1 << 3) /* Stop Interrupt (read only) */
170#define U2DMACSR_ENDINTR (1 << 2) /* End Interrupt (read / write 1 clear) */
171#define U2DMACSR_STARTINTR (1 << 1) /* Start Interrupt (read / write 1 clear) */
172#define U2DMACSR_BUSERRINTR (1 << 0) /* Bus Error Interrupt (read / write 1 clear) */
173
174#define U2DMACR (0x1080) /* U2DMA Control Register */
175#define U2DMAINT (0x10F0) /* U2DMA Interrupt Register */
176
177#define U2DMABR0 (0x1100) /* U2DMA Branch Register - Channel 0 */
178#define U2DMABR(x) (0x1100 + (x) << 2) /* U2DMA Branch Register - Channel x */
179
180#define U2DMADADR0 (0x1200) /* U2DMA Descriptor Address Register - Channel 0 */
181#define U2DMADADR(x) (0x1200 + (x) * 0x10) /* U2DMA Descriptor Address Register - Channel x */
182
183#define U2DMADADR_STOP (1U << 0)
184
185#define U2DMASADR0 (0x1204) /* U2DMA Source Address Register - Channel 0 */
186#define U2DMASADR(x) (0x1204 + (x) * 0x10) /* U2DMA Source Address Register - Channel x */
187#define U2DMATADR0 (0x1208) /* U2DMA Target Address Register - Channel 0 */
188#define U2DMATADR(x) (0x1208 + (x) * 0x10) /* U2DMA Target Address Register - Channel x */
189
190#define U2DMACMDR0 (0x120C) /* U2DMA Command Address Register - Channel 0 */
191#define U2DMACMDR(x) (0x120C + (x) * 0x10) /* U2DMA Command Address Register - Channel x */
192
193#define U2DMACMDR_XFRDIS (1 << 31) /* Transfer Direction */
194#define U2DMACMDR_STARTIRQEN (1 << 22) /* Start Interrupt Enable */
195#define U2DMACMDR_ENDIRQEN (1 << 21) /* End Interrupt Enable */
196#define U2DMACMDR_PACKCOMP (1 << 13) /* Packet Complete */
197#define U2DMACMDR_LEN (0x07ff) /* length mask (max = 2K - 1) */
198
199#endif /* __ASM_ARCH_PXA3xx_U2D_H */
diff --git a/arch/arm/mach-pxa/include/mach/treo680.h b/arch/arm/mach-pxa/include/mach/treo680.h
deleted file mode 100644
index af443b24d99a..000000000000
--- a/arch/arm/mach-pxa/include/mach/treo680.h
+++ /dev/null
@@ -1,49 +0,0 @@
1/*
2 * GPIOs and interrupts for Palm Treo 680 smartphone
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 */
9
10#ifndef _INCLUDE_TREO680_H_
11#define _INCLUDE_TREO680_H_
12
13/* GPIOs */
14#define GPIO_NR_TREO680_POWER_DETECT 0
15#define GPIO_NR_TREO680_AMP_EN 27
16#define GPIO_NR_TREO680_KEYB_BL 24
17#define GPIO_NR_TREO680_VIBRATE_EN 44
18#define GPIO_NR_TREO680_GREEN_LED 20
19#define GPIO_NR_TREO680_RED_LED 79
20#define GPIO_NR_TREO680_SD_DETECT_N 113
21#define GPIO_NR_TREO680_SD_READONLY 33
22#define GPIO_NR_TREO680_EP_DETECT_N 116
23#define GPIO_NR_TREO680_SD_POWER 42
24#define GPIO_NR_TREO680_USB_DETECT 1
25#define GPIO_NR_TREO680_USB_PULLUP 114
26#define GPIO_NR_TREO680_GSM_POWER 40
27#define GPIO_NR_TREO680_GSM_RESET 87
28#define GPIO_NR_TREO680_GSM_WAKE 57
29#define GPIO_NR_TREO680_GSM_HOST_WAKE 14
30#define GPIO_NR_TREO680_GSM_TRIGGER 10
31#define GPIO_NR_TREO680_BT_EN 43
32#define GPIO_NR_TREO680_IR_EN 115
33#define GPIO_NR_TREO680_IR_TXD 47
34#define GPIO_NR_TREO680_BL_POWER 38
35#define GPIO_NR_TREO680_LCD_POWER 25
36
37/* Various addresses */
38#define TREO680_PHYS_RAM_START 0xa0000000
39#define TREO680_PHYS_IO_START 0x40000000
40#define TREO680_STR_BASE 0xa2000000
41
42/* BACKLIGHT */
43#define TREO680_MAX_INTENSITY 254
44#define TREO680_DEFAULT_INTENSITY 160
45#define TREO680_LIMIT_MASK 0x7F
46#define TREO680_PRESCALER 63
47#define TREO680_PERIOD_NS 3500
48
49#endif
diff --git a/arch/arm/mach-pxa/littleton.c b/arch/arm/mach-pxa/littleton.c
index 13848955d133..f28c1715b910 100644
--- a/arch/arm/mach-pxa/littleton.c
+++ b/arch/arm/mach-pxa/littleton.c
@@ -44,10 +44,10 @@
44#include <mach/ssp.h> 44#include <mach/ssp.h>
45#include <mach/mmc.h> 45#include <mach/mmc.h>
46#include <mach/pxa2xx_spi.h> 46#include <mach/pxa2xx_spi.h>
47#include <plat/i2c.h>
48#include <mach/pxa27x_keypad.h> 47#include <mach/pxa27x_keypad.h>
49#include <mach/pxa3xx_nand.h>
50#include <mach/littleton.h> 48#include <mach/littleton.h>
49#include <plat/i2c.h>
50#include <plat/pxa3xx_nand.h>
51 51
52#include "generic.h" 52#include "generic.h"
53 53
@@ -413,6 +413,10 @@ static void __init littleton_init(void)
413 /* initialize MFP configurations */ 413 /* initialize MFP configurations */
414 pxa3xx_mfp_config(ARRAY_AND_SIZE(littleton_mfp_cfg)); 414 pxa3xx_mfp_config(ARRAY_AND_SIZE(littleton_mfp_cfg));
415 415
416 pxa_set_ffuart_info(NULL);
417 pxa_set_btuart_info(NULL);
418 pxa_set_stuart_info(NULL);
419
416 /* 420 /*
417 * Note: we depend bootloader set the correct 421 * Note: we depend bootloader set the correct
418 * value to MSC register for SMC91x. 422 * value to MSC register for SMC91x.
diff --git a/arch/arm/mach-pxa/lpd270.c b/arch/arm/mach-pxa/lpd270.c
index d64395f26a3e..1373c22dbb83 100644
--- a/arch/arm/mach-pxa/lpd270.c
+++ b/arch/arm/mach-pxa/lpd270.c
@@ -455,6 +455,10 @@ static void __init lpd270_init(void)
455{ 455{
456 pxa2xx_mfp_config(ARRAY_AND_SIZE(lpd270_pin_config)); 456 pxa2xx_mfp_config(ARRAY_AND_SIZE(lpd270_pin_config));
457 457
458 pxa_set_ffuart_info(NULL);
459 pxa_set_btuart_info(NULL);
460 pxa_set_stuart_info(NULL);
461
458 lpd270_flash_data[0].width = (BOOT_DEF & 1) ? 2 : 4; 462 lpd270_flash_data[0].width = (BOOT_DEF & 1) ? 2 : 4;
459 lpd270_flash_data[1].width = 4; 463 lpd270_flash_data[1].width = 4;
460 464
diff --git a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c
index c6a94d3fdd61..98ee7e590299 100644
--- a/arch/arm/mach-pxa/lubbock.c
+++ b/arch/arm/mach-pxa/lubbock.c
@@ -518,6 +518,10 @@ static void __init lubbock_init(void)
518 518
519 pxa2xx_mfp_config(ARRAY_AND_SIZE(lubbock_pin_config)); 519 pxa2xx_mfp_config(ARRAY_AND_SIZE(lubbock_pin_config));
520 520
521 pxa_set_ffuart_info(NULL);
522 pxa_set_btuart_info(NULL);
523 pxa_set_stuart_info(NULL);
524
521 clk_add_alias("SA1111_CLK", NULL, "GPIO11_CLK", NULL); 525 clk_add_alias("SA1111_CLK", NULL, "GPIO11_CLK", NULL);
522 pxa_set_udc_info(&udc_info); 526 pxa_set_udc_info(&udc_info);
523 set_pxa_fb_info(&sharp_lm8v31); 527 set_pxa_fb_info(&sharp_lm8v31);
diff --git a/arch/arm/mach-pxa/magician.c b/arch/arm/mach-pxa/magician.c
index 5360c07f5138..8a38d604dc77 100644
--- a/arch/arm/mach-pxa/magician.c
+++ b/arch/arm/mach-pxa/magician.c
@@ -742,6 +742,10 @@ static void __init magician_init(void)
742 742
743 pxa2xx_mfp_config(ARRAY_AND_SIZE(magician_pin_config)); 743 pxa2xx_mfp_config(ARRAY_AND_SIZE(magician_pin_config));
744 744
745 pxa_set_ffuart_info(NULL);
746 pxa_set_btuart_info(NULL);
747 pxa_set_stuart_info(NULL);
748
745 platform_add_devices(ARRAY_AND_SIZE(devices)); 749 platform_add_devices(ARRAY_AND_SIZE(devices));
746 750
747 err = gpio_request(GPIO83_MAGICIAN_nIR_EN, "nIR_EN"); 751 err = gpio_request(GPIO83_MAGICIAN_nIR_EN, "nIR_EN");
diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c
index a4eeae345e64..851ee0fc32e2 100644
--- a/arch/arm/mach-pxa/mainstone.c
+++ b/arch/arm/mach-pxa/mainstone.c
@@ -576,6 +576,10 @@ static void __init mainstone_init(void)
576 576
577 pxa2xx_mfp_config(ARRAY_AND_SIZE(mainstone_pin_config)); 577 pxa2xx_mfp_config(ARRAY_AND_SIZE(mainstone_pin_config));
578 578
579 pxa_set_ffuart_info(NULL);
580 pxa_set_btuart_info(NULL);
581 pxa_set_stuart_info(NULL);
582
579 mst_flash_data[0].width = (BOOT_DEF & 1) ? 2 : 4; 583 mst_flash_data[0].width = (BOOT_DEF & 1) ? 2 : 4;
580 mst_flash_data[1].width = 4; 584 mst_flash_data[1].width = 4;
581 585
diff --git a/arch/arm/mach-pxa/mioa701.c b/arch/arm/mach-pxa/mioa701.c
index 3cab452e5567..2466a44d8fda 100644
--- a/arch/arm/mach-pxa/mioa701.c
+++ b/arch/arm/mach-pxa/mioa701.c
@@ -798,6 +798,9 @@ static void __init mioa701_machine_init(void)
798 UP2OCR = UP2OCR_HXOE; 798 UP2OCR = UP2OCR_HXOE;
799 799
800 pxa2xx_mfp_config(ARRAY_AND_SIZE(mioa701_pin_config)); 800 pxa2xx_mfp_config(ARRAY_AND_SIZE(mioa701_pin_config));
801 pxa_set_ffuart_info(NULL);
802 pxa_set_btuart_info(NULL);
803 pxa_set_stuart_info(NULL);
801 mio_gpio_request(ARRAY_AND_SIZE(global_gpios)); 804 mio_gpio_request(ARRAY_AND_SIZE(global_gpios));
802 bootstrap_init(); 805 bootstrap_init();
803 set_pxa_fb_info(&mioa701_pxafb_info); 806 set_pxa_fb_info(&mioa701_pxafb_info);
diff --git a/arch/arm/mach-pxa/mp900.c b/arch/arm/mach-pxa/mp900.c
index a65713ce019e..6d4503927a76 100644
--- a/arch/arm/mach-pxa/mp900.c
+++ b/arch/arm/mach-pxa/mp900.c
@@ -84,6 +84,9 @@ static struct platform_device *devices[] __initdata = {
84static void __init mp900c_init(void) 84static void __init mp900c_init(void)
85{ 85{
86 printk(KERN_INFO "MobilePro 900/C machine init\n"); 86 printk(KERN_INFO "MobilePro 900/C machine init\n");
87 pxa_set_ffuart_info(NULL);
88 pxa_set_btuart_info(NULL);
89 pxa_set_stuart_info(NULL);
87 platform_add_devices(devices, ARRAY_SIZE(devices)); 90 platform_add_devices(devices, ARRAY_SIZE(devices));
88} 91}
89 92
diff --git a/arch/arm/mach-pxa/palmld.c b/arch/arm/mach-pxa/palmld.c
index 1ad029dd4438..59140217890a 100644
--- a/arch/arm/mach-pxa/palmld.c
+++ b/arch/arm/mach-pxa/palmld.c
@@ -530,6 +530,10 @@ static void __init palmld_init(void)
530{ 530{
531 pxa2xx_mfp_config(ARRAY_AND_SIZE(palmld_pin_config)); 531 pxa2xx_mfp_config(ARRAY_AND_SIZE(palmld_pin_config));
532 532
533 pxa_set_ffuart_info(NULL);
534 pxa_set_btuart_info(NULL);
535 pxa_set_stuart_info(NULL);
536
533 palmld_pm_init(); 537 palmld_pm_init();
534 set_pxa_fb_info(&palmld_lcd_screen); 538 set_pxa_fb_info(&palmld_lcd_screen);
535 pxa_set_mci_info(&palmld_mci_platform_data); 539 pxa_set_mci_info(&palmld_mci_platform_data);
diff --git a/arch/arm/mach-pxa/palmt5.c b/arch/arm/mach-pxa/palmt5.c
index 2dd7ce28556b..7f89ca20f13a 100644
--- a/arch/arm/mach-pxa/palmt5.c
+++ b/arch/arm/mach-pxa/palmt5.c
@@ -419,6 +419,10 @@ static void __init palmt5_init(void)
419{ 419{
420 pxa2xx_mfp_config(ARRAY_AND_SIZE(palmt5_pin_config)); 420 pxa2xx_mfp_config(ARRAY_AND_SIZE(palmt5_pin_config));
421 421
422 pxa_set_ffuart_info(NULL);
423 pxa_set_btuart_info(NULL);
424 pxa_set_stuart_info(NULL);
425
422 palmt5_pm_init(); 426 palmt5_pm_init();
423 set_pxa_fb_info(&palmt5_lcd_screen); 427 set_pxa_fb_info(&palmt5_lcd_screen);
424 pxa_set_mci_info(&palmt5_mci_platform_data); 428 pxa_set_mci_info(&palmt5_mci_platform_data);
diff --git a/arch/arm/mach-pxa/palmtc.c b/arch/arm/mach-pxa/palmtc.c
index 0b92291a58f6..308417592007 100644
--- a/arch/arm/mach-pxa/palmtc.c
+++ b/arch/arm/mach-pxa/palmtc.c
@@ -416,6 +416,11 @@ static void __init palmtc_init(void)
416{ 416{
417 pxa2xx_mfp_config(ARRAY_AND_SIZE(palmtc_pin_config)); 417 pxa2xx_mfp_config(ARRAY_AND_SIZE(palmtc_pin_config));
418 418
419 pxa_set_ffuart_info(NULL);
420 pxa_set_btuart_info(NULL);
421 pxa_set_stuart_info(NULL);
422 pxa_set_hwuart_info(NULL);
423
419 set_pxa_fb_info(&palmtc_lcd_screen); 424 set_pxa_fb_info(&palmtc_lcd_screen);
420 pxa_set_mci_info(&palmtc_mci_platform_data); 425 pxa_set_mci_info(&palmtc_mci_platform_data);
421 pxa_set_udc_info(&palmtc_udc_info); 426 pxa_set_udc_info(&palmtc_udc_info);
diff --git a/arch/arm/mach-pxa/palmte2.c b/arch/arm/mach-pxa/palmte2.c
index 277c4062e3c6..265d62bae7de 100644
--- a/arch/arm/mach-pxa/palmte2.c
+++ b/arch/arm/mach-pxa/palmte2.c
@@ -373,6 +373,10 @@ static void __init palmte2_init(void)
373{ 373{
374 pxa2xx_mfp_config(ARRAY_AND_SIZE(palmte2_pin_config)); 374 pxa2xx_mfp_config(ARRAY_AND_SIZE(palmte2_pin_config));
375 375
376 pxa_set_ffuart_info(NULL);
377 pxa_set_btuart_info(NULL);
378 pxa_set_stuart_info(NULL);
379
376 set_pxa_fb_info(&palmte2_lcd_screen); 380 set_pxa_fb_info(&palmte2_lcd_screen);
377 pxa_set_mci_info(&palmte2_mci_platform_data); 381 pxa_set_mci_info(&palmte2_mci_platform_data);
378 palmte2_udc_init(); 382 palmte2_udc_init();
diff --git a/arch/arm/mach-pxa/treo680.c b/arch/arm/mach-pxa/palmtreo.c
index fe085076fbf2..606eb7e8a17e 100644
--- a/arch/arm/mach-pxa/treo680.c
+++ b/arch/arm/mach-pxa/palmtreo.c
@@ -1,5 +1,9 @@
1/* 1/*
2 * Hardware definitions for Palm Treo 680 2 * Hardware definitions for Palm Treo smartphones
3 *
4 * currently supported:
5 * Palm Treo 680 (GSM)
6 * Palm Centro 685 (GSM)
3 * 7 *
4 * Author: Tomas Cech <sleep_walker@suse.cz> 8 * Author: Tomas Cech <sleep_walker@suse.cz>
5 * 9 *
@@ -31,7 +35,7 @@
31#include <mach/pxa27x.h> 35#include <mach/pxa27x.h>
32#include <mach/pxa27x-udc.h> 36#include <mach/pxa27x-udc.h>
33#include <mach/audio.h> 37#include <mach/audio.h>
34#include <mach/treo680.h> 38#include <mach/palmtreo.h>
35#include <mach/mmc.h> 39#include <mach/mmc.h>
36#include <mach/pxafb.h> 40#include <mach/pxafb.h>
37#include <mach/irda.h> 41#include <mach/irda.h>
@@ -50,7 +54,7 @@
50/****************************************************************************** 54/******************************************************************************
51 * Pin configuration 55 * Pin configuration
52 ******************************************************************************/ 56 ******************************************************************************/
53static unsigned long treo680_pin_config[] __initdata = { 57static unsigned long treo_pin_config[] __initdata = {
54 /* MMC */ 58 /* MMC */
55 GPIO32_MMC_CLK, 59 GPIO32_MMC_CLK,
56 GPIO92_MMC_DAT_0, 60 GPIO92_MMC_DAT_0,
@@ -58,7 +62,6 @@ static unsigned long treo680_pin_config[] __initdata = {
58 GPIO110_MMC_DAT_2, 62 GPIO110_MMC_DAT_2,
59 GPIO111_MMC_DAT_3, 63 GPIO111_MMC_DAT_3,
60 GPIO112_MMC_CMD, 64 GPIO112_MMC_CMD,
61 GPIO33_GPIO, /* SD read only */
62 GPIO113_GPIO, /* SD detect */ 65 GPIO113_GPIO, /* SD detect */
63 66
64 /* AC97 */ 67 /* AC97 */
@@ -80,12 +83,10 @@ static unsigned long treo680_pin_config[] __initdata = {
80 GPIO1_GPIO | WAKEUP_ON_EDGE_BOTH, /* usb detect */ 83 GPIO1_GPIO | WAKEUP_ON_EDGE_BOTH, /* usb detect */
81 84
82 /* MATRIX KEYPAD */ 85 /* MATRIX KEYPAD */
83 GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH,
84 GPIO101_KP_MKIN_1, 86 GPIO101_KP_MKIN_1,
85 GPIO102_KP_MKIN_2, 87 GPIO102_KP_MKIN_2,
86 GPIO97_KP_MKIN_3, 88 GPIO97_KP_MKIN_3,
87 GPIO98_KP_MKIN_4, 89 GPIO98_KP_MKIN_4,
88 GPIO99_KP_MKIN_5,
89 GPIO91_KP_MKIN_6, 90 GPIO91_KP_MKIN_6,
90 GPIO13_KP_MKIN_7, 91 GPIO13_KP_MKIN_7,
91 GPIO103_KP_MKOUT_0 | MFP_LPM_DRIVE_HIGH, 92 GPIO103_KP_MKOUT_0 | MFP_LPM_DRIVE_HIGH,
@@ -150,19 +151,57 @@ static unsigned long treo680_pin_config[] __initdata = {
150 GPIO11_GPIO | WAKEUP_ON_EDGE_BOTH, /* bluetooth host wake up */ 151 GPIO11_GPIO | WAKEUP_ON_EDGE_BOTH, /* bluetooth host wake up */
151}; 152};
152 153
154#ifdef CONFIG_MACH_TREO680
155static unsigned long treo680_pin_config[] __initdata = {
156 GPIO33_GPIO, /* SD read only */
157
158 /* MATRIX KEYPAD - different wake up source */
159 GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH,
160 GPIO99_KP_MKIN_5,
161};
162#endif /* CONFIG_MACH_TREO680 */
163
164#ifdef CONFIG_MACH_CENTRO
165static unsigned long centro685_pin_config[] __initdata = {
166 /* Bluetooth attached to BT UART*/
167 MFP_CFG_OUT(GPIO80, AF0, DRIVE_LOW), /* power: LOW = off */
168 GPIO42_BTUART_RXD,
169 GPIO43_BTUART_TXD,
170 GPIO44_BTUART_CTS,
171 GPIO45_BTUART_RTS,
172
173 /* MATRIX KEYPAD - different wake up source */
174 GPIO100_KP_MKIN_0,
175 GPIO99_KP_MKIN_5 | WAKEUP_ON_LEVEL_HIGH,
176};
177#endif /* CONFIG_MACH_CENTRO */
178
153/****************************************************************************** 179/******************************************************************************
154 * SD/MMC card controller 180 * SD/MMC card controller
155 ******************************************************************************/ 181 ******************************************************************************/
182#ifdef CONFIG_MACH_TREO680
156static struct pxamci_platform_data treo680_mci_platform_data = { 183static struct pxamci_platform_data treo680_mci_platform_data = {
157 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, 184 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
158 .gpio_card_detect = GPIO_NR_TREO680_SD_DETECT_N, 185 .gpio_card_detect = GPIO_NR_TREO_SD_DETECT_N,
159 .gpio_card_ro = GPIO_NR_TREO680_SD_READONLY, 186 .gpio_card_ro = GPIO_NR_TREO680_SD_READONLY,
160 .gpio_power = GPIO_NR_TREO680_SD_POWER, 187 .gpio_power = GPIO_NR_TREO680_SD_POWER,
161}; 188};
189#endif /* CONFIG_MACH_TREO680 */
190
191#ifdef CONFIG_MACH_CENTRO
192static struct pxamci_platform_data centro_mci_platform_data = {
193 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
194 .gpio_card_detect = GPIO_NR_TREO_SD_DETECT_N,
195 .gpio_card_ro = -1,
196 .gpio_power = GPIO_NR_CENTRO_SD_POWER,
197 .gpio_power_invert = 1,
198};
199#endif /* CONFIG_MACH_CENTRO */
162 200
163/****************************************************************************** 201/******************************************************************************
164 * GPIO keyboard 202 * GPIO keyboard
165 ******************************************************************************/ 203 ******************************************************************************/
204#ifdef CONFIG_MACH_TREO680
166static unsigned int treo680_matrix_keys[] = { 205static unsigned int treo680_matrix_keys[] = {
167 KEY(0, 0, KEY_F8), /* Red/Off/Power */ 206 KEY(0, 0, KEY_F8), /* Red/Off/Power */
168 KEY(0, 1, KEY_LEFT), 207 KEY(0, 1, KEY_LEFT),
@@ -232,92 +271,167 @@ static struct pxa27x_keypad_platform_data treo680_keypad_platform_data = {
232 271
233 .debounce_interval = 30, 272 .debounce_interval = 30,
234}; 273};
274#endif /* CONFIG_MACH_TREO680 */
275
276#ifdef CONFIG_MACH_CENTRO
277static unsigned int centro_matrix_keys[] = {
278 KEY(0, 0, KEY_F9), /* Home */
279 KEY(0, 1, KEY_LEFT),
280 KEY(0, 2, KEY_LEFTCTRL), /* Alternate */
281 KEY(0, 3, KEY_L),
282 KEY(0, 4, KEY_A),
283 KEY(0, 5, KEY_Q),
284 KEY(0, 6, KEY_P),
285
286 KEY(1, 0, KEY_RIGHTCTRL), /* Menu */
287 KEY(1, 1, KEY_RIGHT),
288 KEY(1, 2, KEY_LEFTSHIFT), /* Left shift */
289 KEY(1, 3, KEY_Z),
290 KEY(1, 4, KEY_S),
291 KEY(1, 5, KEY_W),
292
293 KEY(2, 0, KEY_F1), /* Phone */
294 KEY(2, 1, KEY_UP),
295 KEY(2, 2, KEY_0),
296 KEY(2, 3, KEY_X),
297 KEY(2, 4, KEY_D),
298 KEY(2, 5, KEY_E),
299
300 KEY(3, 0, KEY_F10), /* Calendar */
301 KEY(3, 1, KEY_DOWN),
302 KEY(3, 2, KEY_SPACE),
303 KEY(3, 3, KEY_C),
304 KEY(3, 4, KEY_F),
305 KEY(3, 5, KEY_R),
306
307 KEY(4, 0, KEY_F12), /* Mail */
308 KEY(4, 1, KEY_KPENTER),
309 KEY(4, 2, KEY_RIGHTALT), /* Alt */
310 KEY(4, 3, KEY_V),
311 KEY(4, 4, KEY_G),
312 KEY(4, 5, KEY_T),
313
314 KEY(5, 0, KEY_F8), /* Red/Off/Power */
315 KEY(5, 1, KEY_PAGEUP), /* Side up */
316 KEY(5, 2, KEY_DOT),
317 KEY(5, 3, KEY_B),
318 KEY(5, 4, KEY_H),
319 KEY(5, 5, KEY_Y),
320
321 KEY(6, 0, KEY_TAB), /* Side Activate */
322 KEY(6, 1, KEY_PAGEDOWN), /* Side down */
323 KEY(6, 2, KEY_ENTER),
324 KEY(6, 3, KEY_N),
325 KEY(6, 4, KEY_J),
326 KEY(6, 5, KEY_U),
327
328 KEY(7, 0, KEY_F6), /* Green/Call */
329 KEY(7, 1, KEY_O),
330 KEY(7, 2, KEY_BACKSPACE),
331 KEY(7, 3, KEY_M),
332 KEY(7, 4, KEY_K),
333 KEY(7, 5, KEY_I),
334};
335
336static struct pxa27x_keypad_platform_data centro_keypad_platform_data = {
337 .matrix_key_rows = 8,
338 .matrix_key_cols = 7,
339 .matrix_key_map = centro_matrix_keys,
340 .matrix_key_map_size = ARRAY_SIZE(centro_matrix_keys),
341 .direct_key_map = { KEY_CONNECT },
342 .direct_key_num = 1,
343
344 .debounce_interval = 30,
345};
346#endif /* CONFIG_MACH_CENTRO */
235 347
236/****************************************************************************** 348/******************************************************************************
237 * aSoC audio 349 * aSoC audio
238 ******************************************************************************/ 350 ******************************************************************************/
239 351
240static pxa2xx_audio_ops_t treo680_ac97_pdata = { 352static pxa2xx_audio_ops_t treo_ac97_pdata = {
241 .reset_gpio = 95, 353 .reset_gpio = 95,
242}; 354};
243 355
244/****************************************************************************** 356/******************************************************************************
245 * Backlight 357 * Backlight
246 ******************************************************************************/ 358 ******************************************************************************/
247static int treo680_backlight_init(struct device *dev) 359static int treo_backlight_init(struct device *dev)
248{ 360{
249 int ret; 361 int ret;
250 362
251 ret = gpio_request(GPIO_NR_TREO680_BL_POWER, "BL POWER"); 363 ret = gpio_request(GPIO_NR_TREO_BL_POWER, "BL POWER");
252 if (ret) 364 if (ret)
253 goto err; 365 goto err;
254 ret = gpio_direction_output(GPIO_NR_TREO680_BL_POWER, 0); 366 ret = gpio_direction_output(GPIO_NR_TREO_BL_POWER, 0);
255 if (ret) 367 if (ret)
256 goto err2; 368 goto err2;
257 369
258 return 0; 370 return 0;
259 371
260err2: 372err2:
261 gpio_free(GPIO_NR_TREO680_BL_POWER); 373 gpio_free(GPIO_NR_TREO_BL_POWER);
262err: 374err:
263 return ret; 375 return ret;
264} 376}
265 377
266static int treo680_backlight_notify(int brightness) 378static int treo_backlight_notify(int brightness)
267{ 379{
268 gpio_set_value(GPIO_NR_TREO680_BL_POWER, brightness); 380 gpio_set_value(GPIO_NR_TREO_BL_POWER, brightness);
269 return TREO680_MAX_INTENSITY - brightness; 381 return TREO_MAX_INTENSITY - brightness;
270}; 382};
271 383
272static void treo680_backlight_exit(struct device *dev) 384static void treo_backlight_exit(struct device *dev)
273{ 385{
274 gpio_free(GPIO_NR_TREO680_BL_POWER); 386 gpio_free(GPIO_NR_TREO_BL_POWER);
275} 387}
276 388
277static struct platform_pwm_backlight_data treo680_backlight_data = { 389static struct platform_pwm_backlight_data treo_backlight_data = {
278 .pwm_id = 0, 390 .pwm_id = 0,
279 .max_brightness = TREO680_MAX_INTENSITY, 391 .max_brightness = TREO_MAX_INTENSITY,
280 .dft_brightness = TREO680_DEFAULT_INTENSITY, 392 .dft_brightness = TREO_DEFAULT_INTENSITY,
281 .pwm_period_ns = TREO680_PERIOD_NS, 393 .pwm_period_ns = TREO_PERIOD_NS,
282 .init = treo680_backlight_init, 394 .init = treo_backlight_init,
283 .notify = treo680_backlight_notify, 395 .notify = treo_backlight_notify,
284 .exit = treo680_backlight_exit, 396 .exit = treo_backlight_exit,
285}; 397};
286 398
287static struct platform_device treo680_backlight = { 399static struct platform_device treo_backlight = {
288 .name = "pwm-backlight", 400 .name = "pwm-backlight",
289 .dev = { 401 .dev = {
290 .parent = &pxa27x_device_pwm0.dev, 402 .parent = &pxa27x_device_pwm0.dev,
291 .platform_data = &treo680_backlight_data, 403 .platform_data = &treo_backlight_data,
292 }, 404 },
293}; 405};
294 406
295/****************************************************************************** 407/******************************************************************************
296 * IrDA 408 * IrDA
297 ******************************************************************************/ 409 ******************************************************************************/
298static struct pxaficp_platform_data treo680_ficp_info = { 410static struct pxaficp_platform_data treo_ficp_info = {
299 .gpio_pwdown = GPIO_NR_TREO680_IR_EN, 411 .gpio_pwdown = GPIO_NR_TREO_IR_EN,
300 .transceiver_cap = IR_SIRMODE | IR_OFF, 412 .transceiver_cap = IR_SIRMODE | IR_OFF,
301}; 413};
302 414
303/****************************************************************************** 415/******************************************************************************
304 * UDC 416 * UDC
305 ******************************************************************************/ 417 ******************************************************************************/
306static struct pxa2xx_udc_mach_info treo680_udc_info __initdata = { 418static struct pxa2xx_udc_mach_info treo_udc_info __initdata = {
307 .gpio_vbus = GPIO_NR_TREO680_USB_DETECT, 419 .gpio_vbus = GPIO_NR_TREO_USB_DETECT,
308 .gpio_vbus_inverted = 1, 420 .gpio_vbus_inverted = 1,
309 .gpio_pullup = GPIO_NR_TREO680_USB_PULLUP, 421 .gpio_pullup = GPIO_NR_TREO_USB_PULLUP,
310}; 422};
311 423
312 424
313/****************************************************************************** 425/******************************************************************************
314 * USB host 426 * USB host
315 ******************************************************************************/ 427 ******************************************************************************/
428#ifdef CONFIG_MACH_TREO680
316static struct pxaohci_platform_data treo680_ohci_info = { 429static struct pxaohci_platform_data treo680_ohci_info = {
317 .port_mode = PMM_PERPORT_MODE, 430 .port_mode = PMM_PERPORT_MODE,
318 .flags = ENABLE_PORT1 | ENABLE_PORT3, 431 .flags = ENABLE_PORT1 | ENABLE_PORT3,
319 .power_budget = 0, 432 .power_budget = 0,
320}; 433};
434#endif /* CONFIG_MACH_TREO680 */
321 435
322/****************************************************************************** 436/******************************************************************************
323 * Power supply 437 * Power supply
@@ -326,41 +440,41 @@ static int power_supply_init(struct device *dev)
326{ 440{
327 int ret; 441 int ret;
328 442
329 ret = gpio_request(GPIO_NR_TREO680_POWER_DETECT, "CABLE_STATE_AC"); 443 ret = gpio_request(GPIO_NR_TREO_POWER_DETECT, "CABLE_STATE_AC");
330 if (ret) 444 if (ret)
331 goto err1; 445 goto err1;
332 ret = gpio_direction_input(GPIO_NR_TREO680_POWER_DETECT); 446 ret = gpio_direction_input(GPIO_NR_TREO_POWER_DETECT);
333 if (ret) 447 if (ret)
334 goto err2; 448 goto err2;
335 449
336 return 0; 450 return 0;
337 451
338err2: 452err2:
339 gpio_free(GPIO_NR_TREO680_POWER_DETECT); 453 gpio_free(GPIO_NR_TREO_POWER_DETECT);
340err1: 454err1:
341 return ret; 455 return ret;
342} 456}
343 457
344static int treo680_is_ac_online(void) 458static int treo_is_ac_online(void)
345{ 459{
346 return gpio_get_value(GPIO_NR_TREO680_POWER_DETECT); 460 return gpio_get_value(GPIO_NR_TREO_POWER_DETECT);
347} 461}
348 462
349static void power_supply_exit(struct device *dev) 463static void power_supply_exit(struct device *dev)
350{ 464{
351 gpio_free(GPIO_NR_TREO680_POWER_DETECT); 465 gpio_free(GPIO_NR_TREO_POWER_DETECT);
352} 466}
353 467
354static char *treo680_supplicants[] = { 468static char *treo_supplicants[] = {
355 "main-battery", 469 "main-battery",
356}; 470};
357 471
358static struct pda_power_pdata power_supply_info = { 472static struct pda_power_pdata power_supply_info = {
359 .init = power_supply_init, 473 .init = power_supply_init,
360 .is_ac_online = treo680_is_ac_online, 474 .is_ac_online = treo_is_ac_online,
361 .exit = power_supply_exit, 475 .exit = power_supply_exit,
362 .supplied_to = treo680_supplicants, 476 .supplied_to = treo_supplicants,
363 .num_supplicants = ARRAY_SIZE(treo680_supplicants), 477 .num_supplicants = ARRAY_SIZE(treo_supplicants),
364}; 478};
365 479
366static struct platform_device power_supply = { 480static struct platform_device power_supply = {
@@ -374,7 +488,8 @@ static struct platform_device power_supply = {
374/****************************************************************************** 488/******************************************************************************
375 * Vibra and LEDs 489 * Vibra and LEDs
376 ******************************************************************************/ 490 ******************************************************************************/
377static struct gpio_led gpio_leds[] = { 491#ifdef CONFIG_MACH_TREO680
492static struct gpio_led treo680_gpio_leds[] = {
378 { 493 {
379 .name = "treo680:vibra:vibra", 494 .name = "treo680:vibra:vibra",
380 .default_trigger = "none", 495 .default_trigger = "none",
@@ -383,34 +498,68 @@ static struct gpio_led gpio_leds[] = {
383 { 498 {
384 .name = "treo680:green:led", 499 .name = "treo680:green:led",
385 .default_trigger = "mmc0", 500 .default_trigger = "mmc0",
386 .gpio = GPIO_NR_TREO680_GREEN_LED, 501 .gpio = GPIO_NR_TREO_GREEN_LED,
387 }, 502 },
388 { 503 {
389 .name = "treo680:keybbl:keybbl", 504 .name = "treo680:white:keybbl",
390 .default_trigger = "none", 505 .default_trigger = "none",
391 .gpio = GPIO_NR_TREO680_KEYB_BL, 506 .gpio = GPIO_NR_TREO680_KEYB_BL,
392 }, 507 },
393}; 508};
394 509
395static struct gpio_led_platform_data gpio_led_info = { 510static struct gpio_led_platform_data treo680_gpio_led_info = {
396 .leds = gpio_leds, 511 .leds = treo680_gpio_leds,
397 .num_leds = ARRAY_SIZE(gpio_leds), 512 .num_leds = ARRAY_SIZE(treo680_gpio_leds),
398}; 513};
399 514
400static struct platform_device treo680_leds = { 515static struct platform_device treo680_leds = {
401 .name = "leds-gpio", 516 .name = "leds-gpio",
402 .id = -1, 517 .id = -1,
403 .dev = { 518 .dev = {
404 .platform_data = &gpio_led_info, 519 .platform_data = &treo680_gpio_led_info,
405 } 520 }
406}; 521};
522#endif /* CONFIG_MACH_TREO680 */
407 523
524#ifdef CONFIG_MACH_CENTRO
525static struct gpio_led centro_gpio_leds[] = {
526 {
527 .name = "centro:vibra:vibra",
528 .default_trigger = "none",
529 .gpio = GPIO_NR_CENTRO_VIBRATE_EN,
530 },
531 {
532 .name = "centro:green:led",
533 .default_trigger = "mmc0",
534 .gpio = GPIO_NR_TREO_GREEN_LED,
535 },
536 {
537 .name = "centro:white:keybbl",
538 .default_trigger = "none",
539 .active_low = 1,
540 .gpio = GPIO_NR_CENTRO_KEYB_BL,
541 },
542};
543
544static struct gpio_led_platform_data centro_gpio_led_info = {
545 .leds = centro_gpio_leds,
546 .num_leds = ARRAY_SIZE(centro_gpio_leds),
547};
548
549static struct platform_device centro_leds = {
550 .name = "leds-gpio",
551 .id = -1,
552 .dev = {
553 .platform_data = &centro_gpio_led_info,
554 }
555};
556#endif /* CONFIG_MACH_CENTRO */
408 557
409/****************************************************************************** 558/******************************************************************************
410 * Framebuffer 559 * Framebuffer
411 ******************************************************************************/ 560 ******************************************************************************/
412/* TODO: add support for 324x324 */ 561/* TODO: add support for 324x324 */
413static struct pxafb_mode_info treo680_lcd_modes[] = { 562static struct pxafb_mode_info treo_lcd_modes[] = {
414{ 563{
415 .pixclock = 86538, 564 .pixclock = 86538,
416 .xres = 320, 565 .xres = 320,
@@ -427,21 +576,21 @@ static struct pxafb_mode_info treo680_lcd_modes[] = {
427}, 576},
428}; 577};
429 578
430static void treo680_lcd_power(int on, struct fb_var_screeninfo *info) 579static void treo_lcd_power(int on, struct fb_var_screeninfo *info)
431{ 580{
432 gpio_set_value(GPIO_NR_TREO680_BL_POWER, on); 581 gpio_set_value(GPIO_NR_TREO_BL_POWER, on);
433} 582}
434 583
435static struct pxafb_mach_info treo680_lcd_screen = { 584static struct pxafb_mach_info treo_lcd_screen = {
436 .modes = treo680_lcd_modes, 585 .modes = treo_lcd_modes,
437 .num_modes = ARRAY_SIZE(treo680_lcd_modes), 586 .num_modes = ARRAY_SIZE(treo_lcd_modes),
438 .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL, 587 .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL,
439}; 588};
440 589
441/****************************************************************************** 590/******************************************************************************
442 * Power management - standby 591 * Power management - standby
443 ******************************************************************************/ 592 ******************************************************************************/
444static void __init treo680_pm_init(void) 593static void __init treo_pm_init(void)
445{ 594{
446 static u32 resume[] = { 595 static u32 resume[] = {
447 0xe3a00101, /* mov r0, #0x40000000 */ 596 0xe3a00101, /* mov r0, #0x40000000 */
@@ -450,70 +599,118 @@ static void __init treo680_pm_init(void)
450 }; 599 };
451 600
452 /* this is where the bootloader jumps */ 601 /* this is where the bootloader jumps */
453 memcpy(phys_to_virt(TREO680_STR_BASE), resume, sizeof(resume)); 602 memcpy(phys_to_virt(TREO_STR_BASE), resume, sizeof(resume));
454} 603}
455 604
456/****************************************************************************** 605/******************************************************************************
457 * Machine init 606 * Machine init
458 ******************************************************************************/ 607 ******************************************************************************/
459static struct platform_device *devices[] __initdata = { 608static struct platform_device *treo_devices[] __initdata = {
460 &treo680_backlight, 609 &treo_backlight,
461 &treo680_leds,
462 &power_supply, 610 &power_supply,
463}; 611};
464 612
613#ifdef CONFIG_MACH_TREO680
614static struct platform_device *treo680_devices[] __initdata = {
615 &treo680_leds,
616};
617#endif /* CONFIG_MACH_TREO680 */
618
619#ifdef CONFIG_MACH_CENTRO
620static struct platform_device *centro_devices[] __initdata = {
621 &centro_leds,
622};
623#endif /* CONFIG_MACH_CENTRO */
624
465/* setup udc GPIOs initial state */ 625/* setup udc GPIOs initial state */
466static void __init treo680_udc_init(void) 626static void __init treo_udc_init(void)
467{ 627{
468 if (!gpio_request(GPIO_NR_TREO680_USB_PULLUP, "UDC Vbus")) { 628 if (!gpio_request(GPIO_NR_TREO_USB_PULLUP, "UDC Vbus")) {
469 gpio_direction_output(GPIO_NR_TREO680_USB_PULLUP, 1); 629 gpio_direction_output(GPIO_NR_TREO_USB_PULLUP, 1);
470 gpio_free(GPIO_NR_TREO680_USB_PULLUP); 630 gpio_free(GPIO_NR_TREO_USB_PULLUP);
471 } 631 }
472} 632}
473 633
474static void __init treo680_lcd_power_init(void) 634static void __init treo_lcd_power_init(void)
475{ 635{
476 int ret; 636 int ret;
477 637
478 ret = gpio_request(GPIO_NR_TREO680_LCD_POWER, "LCD POWER"); 638 ret = gpio_request(GPIO_NR_TREO_LCD_POWER, "LCD POWER");
479 if (ret) { 639 if (ret) {
480 pr_err("Treo680: LCD power GPIO request failed!\n"); 640 pr_err("Treo680: LCD power GPIO request failed!\n");
481 return; 641 return;
482 } 642 }
483 643
484 ret = gpio_direction_output(GPIO_NR_TREO680_LCD_POWER, 0); 644 ret = gpio_direction_output(GPIO_NR_TREO_LCD_POWER, 0);
485 if (ret) { 645 if (ret) {
486 pr_err("Treo680: setting LCD power GPIO direction failed!\n"); 646 pr_err("Treo680: setting LCD power GPIO direction failed!\n");
487 gpio_free(GPIO_NR_TREO680_LCD_POWER); 647 gpio_free(GPIO_NR_TREO_LCD_POWER);
488 return; 648 return;
489 } 649 }
490 650
491 treo680_lcd_screen.pxafb_lcd_power = treo680_lcd_power; 651 treo_lcd_screen.pxafb_lcd_power = treo_lcd_power;
492} 652}
493 653
654static void __init treo_init(void)
655{
656 pxa_set_ffuart_info(NULL);
657 pxa_set_btuart_info(NULL);
658 pxa_set_stuart_info(NULL);
659
660 treo_pm_init();
661 pxa2xx_mfp_config(ARRAY_AND_SIZE(treo_pin_config));
662 treo_lcd_power_init();
663 set_pxa_fb_info(&treo_lcd_screen);
664 treo_udc_init();
665 pxa_set_udc_info(&treo_udc_info);
666 pxa_set_ac97_info(&treo_ac97_pdata);
667 pxa_set_ficp_info(&treo_ficp_info);
668
669 platform_add_devices(ARRAY_AND_SIZE(treo_devices));
670}
671
672#ifdef CONFIG_MACH_TREO680
494static void __init treo680_init(void) 673static void __init treo680_init(void)
495{ 674{
496 treo680_pm_init(); 675 treo_init();
497 pxa2xx_mfp_config(ARRAY_AND_SIZE(treo680_pin_config)); 676 pxa2xx_mfp_config(ARRAY_AND_SIZE(treo680_pin_config));
498 pxa_set_keypad_info(&treo680_keypad_platform_data);
499 treo680_lcd_power_init();
500 set_pxa_fb_info(&treo680_lcd_screen);
501 pxa_set_mci_info(&treo680_mci_platform_data); 677 pxa_set_mci_info(&treo680_mci_platform_data);
502 treo680_udc_init(); 678 pxa_set_keypad_info(&treo680_keypad_platform_data);
503 pxa_set_udc_info(&treo680_udc_info);
504 pxa_set_ac97_info(&treo680_ac97_pdata);
505 pxa_set_ficp_info(&treo680_ficp_info);
506 pxa_set_ohci_info(&treo680_ohci_info); 679 pxa_set_ohci_info(&treo680_ohci_info);
507 680
508 platform_add_devices(devices, ARRAY_SIZE(devices)); 681 platform_add_devices(ARRAY_AND_SIZE(treo680_devices));
509} 682}
510 683
511MACHINE_START(TREO680, "Palm Treo 680") 684MACHINE_START(TREO680, "Palm Treo 680")
512 .phys_io = TREO680_PHYS_IO_START, 685 .phys_io = TREO_PHYS_IO_START,
513 .io_pg_offst = io_p2v(0x40000000), 686 .io_pg_offst = io_p2v(0x40000000),
514 .boot_params = 0xa0000100, 687 .boot_params = 0xa0000100,
515 .map_io = pxa_map_io, 688 .map_io = pxa_map_io,
516 .init_irq = pxa27x_init_irq, 689 .init_irq = pxa27x_init_irq,
517 .timer = &pxa_timer, 690 .timer = &pxa_timer,
518 .init_machine = treo680_init, 691 .init_machine = treo680_init,
692MACHINE_END
693#endif /* CONFIG_MACH_TREO680 */
694
695#ifdef CONFIG_MACH_CENTRO
696static void __init centro_init(void)
697{
698 treo_init();
699 pxa2xx_mfp_config(ARRAY_AND_SIZE(centro685_pin_config));
700 pxa_set_mci_info(&centro_mci_platform_data);
701
702 pxa_set_keypad_info(&centro_keypad_platform_data);
703
704 platform_add_devices(ARRAY_AND_SIZE(centro_devices));
705}
706
707MACHINE_START(CENTRO, "Palm Centro 685")
708 .phys_io = TREO_PHYS_IO_START,
709 .io_pg_offst = io_p2v(0x40000000),
710 .boot_params = 0xa0000100,
711 .map_io = pxa_map_io,
712 .init_irq = pxa27x_init_irq,
713 .timer = &pxa_timer,
714 .init_machine = centro_init,
519MACHINE_END 715MACHINE_END
716#endif /* CONFIG_MACH_CENTRO */
diff --git a/arch/arm/mach-pxa/palmtx.c b/arch/arm/mach-pxa/palmtx.c
index 76a2b37eaf30..7bf18c2f002f 100644
--- a/arch/arm/mach-pxa/palmtx.c
+++ b/arch/arm/mach-pxa/palmtx.c
@@ -570,6 +570,10 @@ static void __init palmtx_init(void)
570{ 570{
571 pxa2xx_mfp_config(ARRAY_AND_SIZE(palmtx_pin_config)); 571 pxa2xx_mfp_config(ARRAY_AND_SIZE(palmtx_pin_config));
572 572
573 pxa_set_ffuart_info(NULL);
574 pxa_set_btuart_info(NULL);
575 pxa_set_stuart_info(NULL);
576
573 palmtx_pm_init(); 577 palmtx_pm_init();
574 set_pxa_fb_info(&palmtx_lcd_screen); 578 set_pxa_fb_info(&palmtx_lcd_screen);
575 pxa_set_mci_info(&palmtx_mci_platform_data); 579 pxa_set_mci_info(&palmtx_mci_platform_data);
diff --git a/arch/arm/mach-pxa/palmz72.c b/arch/arm/mach-pxa/palmz72.c
index c2bf493c5f53..d787ac7cfdd8 100644
--- a/arch/arm/mach-pxa/palmz72.c
+++ b/arch/arm/mach-pxa/palmz72.c
@@ -491,6 +491,10 @@ static void __init palmz72_init(void)
491{ 491{
492 pxa2xx_mfp_config(ARRAY_AND_SIZE(palmz72_pin_config)); 492 pxa2xx_mfp_config(ARRAY_AND_SIZE(palmz72_pin_config));
493 493
494 pxa_set_ffuart_info(NULL);
495 pxa_set_btuart_info(NULL);
496 pxa_set_stuart_info(NULL);
497
494 set_pxa_fb_info(&palmz72_lcd_screen); 498 set_pxa_fb_info(&palmz72_lcd_screen);
495 pxa_set_mci_info(&palmz72_mci_platform_data); 499 pxa_set_mci_info(&palmz72_mci_platform_data);
496 palmz72_udc_init(); 500 palmz72_udc_init();
diff --git a/arch/arm/mach-pxa/pcm027.c b/arch/arm/mach-pxa/pcm027.c
index 6abfa2979c61..2190af066470 100644
--- a/arch/arm/mach-pxa/pcm027.c
+++ b/arch/arm/mach-pxa/pcm027.c
@@ -227,6 +227,10 @@ static void __init pcm027_init(void)
227 227
228 pxa2xx_mfp_config(pcm027_pin_config, ARRAY_SIZE(pcm027_pin_config)); 228 pxa2xx_mfp_config(pcm027_pin_config, ARRAY_SIZE(pcm027_pin_config));
229 229
230 pxa_set_ffuart_info(NULL);
231 pxa_set_btuart_info(NULL);
232 pxa_set_stuart_info(NULL);
233
230 platform_add_devices(devices, ARRAY_SIZE(devices)); 234 platform_add_devices(devices, ARRAY_SIZE(devices));
231 235
232 /* at last call the baseboard to initialize itself */ 236 /* at last call the baseboard to initialize itself */
diff --git a/arch/arm/mach-pxa/pcm990-baseboard.c b/arch/arm/mach-pxa/pcm990-baseboard.c
index bbda57078e0f..d5255ae74fe3 100644
--- a/arch/arm/mach-pxa/pcm990-baseboard.c
+++ b/arch/arm/mach-pxa/pcm990-baseboard.c
@@ -359,19 +359,12 @@ static unsigned long pcm990_camera_pin_config[] = {
359 GPIO44_CIF_LV, 359 GPIO44_CIF_LV,
360}; 360};
361 361
362static int pcm990_pxacamera_init(struct device *dev)
363{
364 pxa2xx_mfp_config(ARRAY_AND_SIZE(pcm990_camera_pin_config));
365 return 0;
366}
367
368/* 362/*
369 * CICR4: PCLK_EN: Pixel clock is supplied by the sensor 363 * CICR4: PCLK_EN: Pixel clock is supplied by the sensor
370 * MCLK_EN: Master clock is generated by PXA 364 * MCLK_EN: Master clock is generated by PXA
371 * PCP: Data sampled on the falling edge of pixel clock 365 * PCP: Data sampled on the falling edge of pixel clock
372 */ 366 */
373struct pxacamera_platform_data pcm990_pxacamera_platform_data = { 367struct pxacamera_platform_data pcm990_pxacamera_platform_data = {
374 .init = pcm990_pxacamera_init,
375 .flags = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 | PXA_CAMERA_DATAWIDTH_10 | 368 .flags = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 | PXA_CAMERA_DATAWIDTH_10 |
376 PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN/* | PXA_CAMERA_PCP*/, 369 PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN/* | PXA_CAMERA_PCP*/,
377 .mclk_10khz = 1000, 370 .mclk_10khz = 1000,
@@ -532,6 +525,7 @@ void __init pcm990_baseboard_init(void)
532 pxa_set_ac97_info(NULL); 525 pxa_set_ac97_info(NULL);
533 526
534#if defined(CONFIG_VIDEO_PXA27x) || defined(CONFIG_VIDEO_PXA27x_MODULE) 527#if defined(CONFIG_VIDEO_PXA27x) || defined(CONFIG_VIDEO_PXA27x_MODULE)
528 pxa2xx_mfp_config(ARRAY_AND_SIZE(pcm990_camera_pin_config));
535 pxa_set_camera_info(&pcm990_pxacamera_platform_data); 529 pxa_set_camera_info(&pcm990_pxacamera_platform_data);
536 530
537 i2c_register_board_info(0, ARRAY_AND_SIZE(pcm990_i2c_devices)); 531 i2c_register_board_info(0, ARRAY_AND_SIZE(pcm990_i2c_devices));
diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c
index a186994f77fb..e5eeb3a62d01 100644
--- a/arch/arm/mach-pxa/poodle.c
+++ b/arch/arm/mach-pxa/poodle.c
@@ -449,6 +449,10 @@ static void __init poodle_init(void)
449 449
450 pxa2xx_mfp_config(ARRAY_AND_SIZE(poodle_pin_config)); 450 pxa2xx_mfp_config(ARRAY_AND_SIZE(poodle_pin_config));
451 451
452 pxa_set_ffuart_info(NULL);
453 pxa_set_btuart_info(NULL);
454 pxa_set_stuart_info(NULL);
455
452 platform_scoop_config = &poodle_pcmcia_config; 456 platform_scoop_config = &poodle_pcmcia_config;
453 457
454 ret = platform_add_devices(devices, ARRAY_SIZE(devices)); 458 ret = platform_add_devices(devices, ARRAY_SIZE(devices));
diff --git a/arch/arm/mach-pxa/pxa25x.c b/arch/arm/mach-pxa/pxa25x.c
index 77c2693cfeef..2c1b0b70d01d 100644
--- a/arch/arm/mach-pxa/pxa25x.c
+++ b/arch/arm/mach-pxa/pxa25x.c
@@ -322,9 +322,6 @@ void __init pxa26x_init_irq(void)
322 322
323static struct platform_device *pxa25x_devices[] __initdata = { 323static struct platform_device *pxa25x_devices[] __initdata = {
324 &pxa25x_device_udc, 324 &pxa25x_device_udc,
325 &pxa_device_ffuart,
326 &pxa_device_btuart,
327 &pxa_device_stuart,
328 &pxa_device_i2s, 325 &pxa_device_i2s,
329 &sa1100_device_rtc, 326 &sa1100_device_rtc,
330 &pxa25x_device_ssp, 327 &pxa25x_device_ssp,
@@ -372,10 +369,8 @@ static int __init pxa25x_init(void)
372 } 369 }
373 370
374 /* Only add HWUART for PXA255/26x; PXA210/250 do not have it. */ 371 /* Only add HWUART for PXA255/26x; PXA210/250 do not have it. */
375 if (cpu_is_pxa255()) { 372 if (cpu_is_pxa255())
376 clks_register(&pxa25x_hwuart_clkreg, 1); 373 clks_register(&pxa25x_hwuart_clkreg, 1);
377 ret = platform_device_register(&pxa_device_hwuart);
378 }
379 374
380 return ret; 375 return ret;
381} 376}
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c
index ec68cc16b4e3..6a0b73167e03 100644
--- a/arch/arm/mach-pxa/pxa27x.c
+++ b/arch/arm/mach-pxa/pxa27x.c
@@ -364,9 +364,6 @@ void __init pxa27x_set_i2c_power_info(struct i2c_pxa_platform_data *info)
364 364
365static struct platform_device *devices[] __initdata = { 365static struct platform_device *devices[] __initdata = {
366 &pxa27x_device_udc, 366 &pxa27x_device_udc,
367 &pxa_device_ffuart,
368 &pxa_device_btuart,
369 &pxa_device_stuart,
370 &pxa_device_i2s, 367 &pxa_device_i2s,
371 &sa1100_device_rtc, 368 &sa1100_device_rtc,
372 &pxa_device_rtc, 369 &pxa_device_rtc,
diff --git a/arch/arm/mach-pxa/pxa3xx.c b/arch/arm/mach-pxa/pxa3xx.c
index 09b7b1a10cad..fcb0721f4669 100644
--- a/arch/arm/mach-pxa/pxa3xx.c
+++ b/arch/arm/mach-pxa/pxa3xx.c
@@ -30,6 +30,7 @@
30#include <mach/pm.h> 30#include <mach/pm.h>
31#include <mach/dma.h> 31#include <mach/dma.h>
32#include <mach/ssp.h> 32#include <mach/ssp.h>
33#include <mach/regs-intc.h>
33#include <plat/i2c.h> 34#include <plat/i2c.h>
34 35
35#include "generic.h" 36#include "generic.h"
@@ -45,6 +46,9 @@
45#define ACCR_D0CS (1 << 26) 46#define ACCR_D0CS (1 << 26)
46#define ACCR_PCCE (1 << 11) 47#define ACCR_PCCE (1 << 11)
47 48
49#define PECR_IE(n) ((1 << ((n) * 2)) << 28)
50#define PECR_IS(n) ((1 << ((n) * 2)) << 29)
51
48/* crystal frequency to static memory controller multiplier (SMCFS) */ 52/* crystal frequency to static memory controller multiplier (SMCFS) */
49static unsigned char smcfs_mult[8] = { 6, 0, 8, 0, 0, 16, }; 53static unsigned char smcfs_mult[8] = { 6, 0, 8, 0, 0, 16, };
50 54
@@ -237,6 +241,7 @@ static DEFINE_PXA3_CKEN(pxa3xx_stuart, STUART, 14857000, 1);
237static DEFINE_PXA3_CKEN(pxa3xx_i2c, I2C, 32842000, 0); 241static DEFINE_PXA3_CKEN(pxa3xx_i2c, I2C, 32842000, 0);
238static DEFINE_PXA3_CKEN(pxa3xx_udc, UDC, 48000000, 5); 242static DEFINE_PXA3_CKEN(pxa3xx_udc, UDC, 48000000, 5);
239static DEFINE_PXA3_CKEN(pxa3xx_usbh, USBH, 48000000, 0); 243static DEFINE_PXA3_CKEN(pxa3xx_usbh, USBH, 48000000, 0);
244static DEFINE_PXA3_CKEN(pxa3xx_u2d, USB2, 48000000, 0);
240static DEFINE_PXA3_CKEN(pxa3xx_keypad, KEYPAD, 32768, 0); 245static DEFINE_PXA3_CKEN(pxa3xx_keypad, KEYPAD, 32768, 0);
241static DEFINE_PXA3_CKEN(pxa3xx_ssp1, SSP1, 13000000, 0); 246static DEFINE_PXA3_CKEN(pxa3xx_ssp1, SSP1, 13000000, 0);
242static DEFINE_PXA3_CKEN(pxa3xx_ssp2, SSP2, 13000000, 0); 247static DEFINE_PXA3_CKEN(pxa3xx_ssp2, SSP2, 13000000, 0);
@@ -261,6 +266,7 @@ static struct clk_lookup pxa3xx_clkregs[] = {
261 INIT_CLKREG(&clk_pxa3xx_i2c, "pxa2xx-i2c.0", NULL), 266 INIT_CLKREG(&clk_pxa3xx_i2c, "pxa2xx-i2c.0", NULL),
262 INIT_CLKREG(&clk_pxa3xx_udc, "pxa27x-udc", NULL), 267 INIT_CLKREG(&clk_pxa3xx_udc, "pxa27x-udc", NULL),
263 INIT_CLKREG(&clk_pxa3xx_usbh, "pxa27x-ohci", NULL), 268 INIT_CLKREG(&clk_pxa3xx_usbh, "pxa27x-ohci", NULL),
269 INIT_CLKREG(&clk_pxa3xx_u2d, NULL, "U2DCLK"),
264 INIT_CLKREG(&clk_pxa3xx_keypad, "pxa27x-keypad", NULL), 270 INIT_CLKREG(&clk_pxa3xx_keypad, "pxa27x-keypad", NULL),
265 INIT_CLKREG(&clk_pxa3xx_ssp1, "pxa27x-ssp.0", NULL), 271 INIT_CLKREG(&clk_pxa3xx_ssp1, "pxa27x-ssp.0", NULL),
266 INIT_CLKREG(&clk_pxa3xx_ssp2, "pxa27x-ssp.1", NULL), 272 INIT_CLKREG(&clk_pxa3xx_ssp2, "pxa27x-ssp.1", NULL),
@@ -530,6 +536,43 @@ static inline void pxa3xx_init_pm(void) {}
530#define pxa3xx_set_wake NULL 536#define pxa3xx_set_wake NULL
531#endif 537#endif
532 538
539static void pxa_ack_ext_wakeup(unsigned int irq)
540{
541 PECR |= PECR_IS(irq - IRQ_WAKEUP0);
542}
543
544static void pxa_mask_ext_wakeup(unsigned int irq)
545{
546 ICMR2 &= ~(1 << ((irq - PXA_IRQ(0)) & 0x1f));
547 PECR &= ~PECR_IE(irq - IRQ_WAKEUP0);
548}
549
550static void pxa_unmask_ext_wakeup(unsigned int irq)
551{
552 ICMR2 |= 1 << ((irq - PXA_IRQ(0)) & 0x1f);
553 PECR |= PECR_IE(irq - IRQ_WAKEUP0);
554}
555
556static struct irq_chip pxa_ext_wakeup_chip = {
557 .name = "WAKEUP",
558 .ack = pxa_ack_ext_wakeup,
559 .mask = pxa_mask_ext_wakeup,
560 .unmask = pxa_unmask_ext_wakeup,
561};
562
563static void __init pxa_init_ext_wakeup_irq(set_wake_t fn)
564{
565 int irq;
566
567 for (irq = IRQ_WAKEUP0; irq <= IRQ_WAKEUP1; irq++) {
568 set_irq_chip(irq, &pxa_ext_wakeup_chip);
569 set_irq_handler(irq, handle_edge_irq);
570 set_irq_flags(irq, IRQF_VALID);
571 }
572
573 pxa_ext_wakeup_chip.set_wake = fn;
574}
575
533void __init pxa3xx_init_irq(void) 576void __init pxa3xx_init_irq(void)
534{ 577{
535 /* enable CP6 access */ 578 /* enable CP6 access */
@@ -539,6 +582,7 @@ void __init pxa3xx_init_irq(void)
539 __asm__ __volatile__("mcr p15, 0, %0, c15, c1, 0\n": :"r"(value)); 582 __asm__ __volatile__("mcr p15, 0, %0, c15, c1, 0\n": :"r"(value));
540 583
541 pxa_init_irq(56, pxa3xx_set_wake); 584 pxa_init_irq(56, pxa3xx_set_wake);
585 pxa_init_ext_wakeup_irq(pxa3xx_set_wake);
542 pxa_init_gpio(IRQ_GPIO_2_x, 2, 127, NULL); 586 pxa_init_gpio(IRQ_GPIO_2_x, 2, 127, NULL);
543} 587}
544 588
@@ -553,9 +597,6 @@ void __init pxa3xx_set_i2c_power_info(struct i2c_pxa_platform_data *info)
553 597
554static struct platform_device *devices[] __initdata = { 598static struct platform_device *devices[] __initdata = {
555 &pxa27x_device_udc, 599 &pxa27x_device_udc,
556 &pxa_device_ffuart,
557 &pxa_device_btuart,
558 &pxa_device_stuart,
559 &pxa_device_i2s, 600 &pxa_device_i2s,
560 &sa1100_device_rtc, 601 &sa1100_device_rtc,
561 &pxa_device_rtc, 602 &pxa_device_rtc,
diff --git a/arch/arm/mach-pxa/saar.c b/arch/arm/mach-pxa/saar.c
index 8241a63ea589..115b6f234bdd 100644
--- a/arch/arm/mach-pxa/saar.c
+++ b/arch/arm/mach-pxa/saar.c
@@ -22,9 +22,13 @@
22#include <linux/i2c.h> 22#include <linux/i2c.h>
23#include <linux/smc91x.h> 23#include <linux/smc91x.h>
24#include <linux/mfd/da903x.h> 24#include <linux/mfd/da903x.h>
25#include <linux/mtd/mtd.h>
26#include <linux/mtd/partitions.h>
27#include <linux/mtd/onenand.h>
25 28
26#include <asm/mach-types.h> 29#include <asm/mach-types.h>
27#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
31#include <asm/mach/flash.h>
28 32
29#include <mach/pxa930.h> 33#include <mach/pxa930.h>
30#include <plat/i2c.h> 34#include <plat/i2c.h>
@@ -33,7 +37,7 @@
33#include "devices.h" 37#include "devices.h"
34#include "generic.h" 38#include "generic.h"
35 39
36#define GPIO_LCD_RESET (16) 40#define GPIO_LCD_RESET (16)
37 41
38/* SAAR MFP configurations */ 42/* SAAR MFP configurations */
39static mfp_cfg_t saar_mfp_cfg[] __initdata = { 43static mfp_cfg_t saar_mfp_cfg[] __initdata = {
@@ -56,6 +60,31 @@ static mfp_cfg_t saar_mfp_cfg[] __initdata = {
56 /* Ethernet */ 60 /* Ethernet */
57 DF_nCS1_nCS3, 61 DF_nCS1_nCS3,
58 GPIO97_GPIO, 62 GPIO97_GPIO,
63
64 /* DFI */
65 DF_INT_RnB_ND_INT_RnB,
66 DF_nRE_nOE_ND_nRE,
67 DF_nWE_ND_nWE,
68 DF_CLE_nOE_ND_CLE,
69 DF_nADV1_ALE_ND_ALE,
70 DF_nADV2_ALE_nCS3,
71 DF_nCS0_ND_nCS0,
72 DF_IO0_ND_IO0,
73 DF_IO1_ND_IO1,
74 DF_IO2_ND_IO2,
75 DF_IO3_ND_IO3,
76 DF_IO4_ND_IO4,
77 DF_IO5_ND_IO5,
78 DF_IO6_ND_IO6,
79 DF_IO7_ND_IO7,
80 DF_IO8_ND_IO8,
81 DF_IO9_ND_IO9,
82 DF_IO10_ND_IO10,
83 DF_IO11_ND_IO11,
84 DF_IO12_ND_IO12,
85 DF_IO13_ND_IO13,
86 DF_IO14_ND_IO14,
87 DF_IO15_ND_IO15,
59}; 88};
60 89
61#define SAAR_ETH_PHYS (0x14000000) 90#define SAAR_ETH_PHYS (0x14000000)
@@ -451,10 +480,15 @@ static inline void saar_init_lcd(void) {}
451#endif 480#endif
452 481
453#if defined(CONFIG_I2C_PXA) || defined(CONFIG_I2C_PXA_MODULE) 482#if defined(CONFIG_I2C_PXA) || defined(CONFIG_I2C_PXA_MODULE)
483static struct da9034_backlight_pdata saar_da9034_backlight = {
484 .output_current = 4, /* 4mA */
485};
486
454static struct da903x_subdev_info saar_da9034_subdevs[] = { 487static struct da903x_subdev_info saar_da9034_subdevs[] = {
455 [0] = { 488 [0] = {
456 .name = "da903x-backlight", 489 .name = "da903x-backlight",
457 .id = DA9034_ID_WLED, 490 .id = DA9034_ID_WLED,
491 .platform_data = &saar_da9034_backlight,
458 }, 492 },
459}; 493};
460 494
@@ -480,12 +514,81 @@ static void __init saar_init_i2c(void)
480#else 514#else
481static inline void saar_init_i2c(void) {} 515static inline void saar_init_i2c(void) {}
482#endif 516#endif
517
518#if defined(CONFIG_MTD_ONENAND) || defined(CONFIG_MTD_ONENAND_MODULE)
519static struct mtd_partition saar_onenand_partitions[] = {
520 {
521 .name = "bootloader",
522 .offset = 0,
523 .size = SZ_1M,
524 .mask_flags = MTD_WRITEABLE,
525 }, {
526 .name = "reserved",
527 .offset = MTDPART_OFS_APPEND,
528 .size = SZ_128K,
529 .mask_flags = MTD_WRITEABLE,
530 }, {
531 .name = "reserved",
532 .offset = MTDPART_OFS_APPEND,
533 .size = SZ_8M,
534 .mask_flags = MTD_WRITEABLE,
535 }, {
536 .name = "kernel",
537 .offset = MTDPART_OFS_APPEND,
538 .size = (SZ_2M + SZ_1M),
539 .mask_flags = 0,
540 }, {
541 .name = "filesystem",
542 .offset = MTDPART_OFS_APPEND,
543 .size = SZ_48M,
544 .mask_flags = 0,
545 }
546};
547
548static struct onenand_platform_data saar_onenand_info = {
549 .parts = saar_onenand_partitions,
550 .nr_parts = ARRAY_SIZE(saar_onenand_partitions),
551};
552
553#define SMC_CS0_PHYS_BASE (0x10000000)
554
555static struct resource saar_resource_onenand[] = {
556 [0] = {
557 .start = SMC_CS0_PHYS_BASE,
558 .end = SMC_CS0_PHYS_BASE + SZ_1M,
559 .flags = IORESOURCE_MEM,
560 },
561};
562
563static struct platform_device saar_device_onenand = {
564 .name = "onenand-flash",
565 .id = -1,
566 .dev = {
567 .platform_data = &saar_onenand_info,
568 },
569 .resource = saar_resource_onenand,
570 .num_resources = ARRAY_SIZE(saar_resource_onenand),
571};
572
573static void __init saar_init_onenand(void)
574{
575 platform_device_register(&saar_device_onenand);
576}
577#else
578static void __init saar_init_onenand(void) {}
579#endif
580
483static void __init saar_init(void) 581static void __init saar_init(void)
484{ 582{
485 /* initialize MFP configurations */ 583 /* initialize MFP configurations */
486 pxa3xx_mfp_config(ARRAY_AND_SIZE(saar_mfp_cfg)); 584 pxa3xx_mfp_config(ARRAY_AND_SIZE(saar_mfp_cfg));
487 585
586 pxa_set_ffuart_info(NULL);
587 pxa_set_btuart_info(NULL);
588 pxa_set_stuart_info(NULL);
589
488 platform_device_register(&smc91x_device); 590 platform_device_register(&smc91x_device);
591 saar_init_onenand();
489 592
490 saar_init_i2c(); 593 saar_init_i2c();
491 saar_init_lcd(); 594 saar_init_lcd();
diff --git a/arch/arm/mach-pxa/sharpsl.h b/arch/arm/mach-pxa/sharpsl.h
index 55259f4756c8..1439785d3979 100644
--- a/arch/arm/mach-pxa/sharpsl.h
+++ b/arch/arm/mach-pxa/sharpsl.h
@@ -42,8 +42,8 @@ void corgi_lcdtg_hw_init(int mode);
42#define MAX1111_BATT_TEMP 2u 42#define MAX1111_BATT_TEMP 2u
43#define MAX1111_ACIN_VOLT 6u 43#define MAX1111_ACIN_VOLT 6u
44 44
45extern struct battery_thresh spitz_battery_levels_acin[]; 45extern struct battery_thresh sharpsl_battery_levels_acin[];
46extern struct battery_thresh spitz_battery_levels_noac[]; 46extern struct battery_thresh sharpsl_battery_levels_noac[];
47int sharpsl_pm_pxa_read_max1111(int channel); 47int sharpsl_pm_pxa_read_max1111(int channel);
48 48
49 49
diff --git a/arch/arm/mach-pxa/sharpsl_pm.c b/arch/arm/mach-pxa/sharpsl_pm.c
index 629e05d1196e..67229a1ef55c 100644
--- a/arch/arm/mach-pxa/sharpsl_pm.c
+++ b/arch/arm/mach-pxa/sharpsl_pm.c
@@ -78,7 +78,7 @@ DEFINE_LED_TRIGGER(sharpsl_charge_led_trigger);
78 78
79 79
80 80
81struct battery_thresh spitz_battery_levels_acin[] = { 81struct battery_thresh sharpsl_battery_levels_acin[] = {
82 { 213, 100}, 82 { 213, 100},
83 { 212, 98}, 83 { 212, 98},
84 { 211, 95}, 84 { 211, 95},
@@ -121,7 +121,7 @@ struct battery_thresh spitz_battery_levels_acin[] = {
121 { 0, 0}, 121 { 0, 0},
122}; 122};
123 123
124struct battery_thresh spitz_battery_levels_noac[] = { 124struct battery_thresh sharpsl_battery_levels_noac[] = {
125 { 213, 100}, 125 { 213, 100},
126 { 212, 98}, 126 { 212, 98},
127 { 211, 95}, 127 { 211, 95},
@@ -165,19 +165,20 @@ struct battery_thresh spitz_battery_levels_noac[] = {
165}; 165};
166 166
167/* MAX1111 Commands */ 167/* MAX1111 Commands */
168#define MAXCTRL_PD0 1u << 0 168#define MAXCTRL_PD0 (1u << 0)
169#define MAXCTRL_PD1 1u << 1 169#define MAXCTRL_PD1 (1u << 1)
170#define MAXCTRL_SGL 1u << 2 170#define MAXCTRL_SGL (1u << 2)
171#define MAXCTRL_UNI 1u << 3 171#define MAXCTRL_UNI (1u << 3)
172#define MAXCTRL_SEL_SH 4 172#define MAXCTRL_SEL_SH 4
173#define MAXCTRL_STR 1u << 7 173#define MAXCTRL_STR (1u << 7)
174 174
175/* 175/*
176 * Read MAX1111 ADC 176 * Read MAX1111 ADC
177 */ 177 */
178int sharpsl_pm_pxa_read_max1111(int channel) 178int sharpsl_pm_pxa_read_max1111(int channel)
179{ 179{
180 if (machine_is_tosa()) // Ugly, better move this function into another module 180 /* Ugly, better move this function into another module */
181 if (machine_is_tosa())
181 return 0; 182 return 0;
182 183
183#ifdef CONFIG_CORGI_SSP_DEPRECATED 184#ifdef CONFIG_CORGI_SSP_DEPRECATED
@@ -238,7 +239,7 @@ EXPORT_SYMBOL(sharpsl_battery_kick);
238 239
239static void sharpsl_battery_thread(struct work_struct *private_) 240static void sharpsl_battery_thread(struct work_struct *private_)
240{ 241{
241 int voltage, percent, apm_status, i = 0; 242 int voltage, percent, apm_status, i;
242 243
243 if (!sharpsl_pm.machinfo) 244 if (!sharpsl_pm.machinfo)
244 return; 245 return;
@@ -250,15 +251,14 @@ static void sharpsl_battery_thread(struct work_struct *private_)
250 && time_after(jiffies, sharpsl_pm.charge_start_time + SHARPSL_CHARGE_ON_TIME_INTERVAL)) 251 && time_after(jiffies, sharpsl_pm.charge_start_time + SHARPSL_CHARGE_ON_TIME_INTERVAL))
251 schedule_delayed_work(&toggle_charger, 0); 252 schedule_delayed_work(&toggle_charger, 0);
252 253
253 while(1) { 254 for (i = 0; i < 5; i++) {
254 voltage = sharpsl_pm.machinfo->read_devdata(SHARPSL_BATT_VOLT); 255 voltage = sharpsl_pm.machinfo->read_devdata(SHARPSL_BATT_VOLT);
255 256 if (voltage > 0)
256 if (voltage > 0) break;
257 if (i++ > 5) {
258 voltage = sharpsl_pm.machinfo->bat_levels_noac[0].voltage;
259 dev_warn(sharpsl_pm.dev, "Warning: Cannot read main battery!\n");
260 break; 257 break;
261 } 258 }
259 if (voltage <= 0) {
260 voltage = sharpsl_pm.machinfo->bat_levels_noac[0].voltage;
261 dev_warn(sharpsl_pm.dev, "Warning: Cannot read main battery!\n");
262 } 262 }
263 263
264 voltage = sharpsl_average_value(voltage); 264 voltage = sharpsl_average_value(voltage);
@@ -266,8 +266,10 @@ static void sharpsl_battery_thread(struct work_struct *private_)
266 percent = get_percentage(voltage); 266 percent = get_percentage(voltage);
267 267
268 /* At low battery voltages, the voltage has a tendency to start 268 /* At low battery voltages, the voltage has a tendency to start
269 creeping back up so we try to avoid this here */ 269 creeping back up so we try to avoid this here */
270 if ((sharpsl_pm.battstat.ac_status == APM_AC_ONLINE) || (apm_status == APM_BATTERY_STATUS_HIGH) || percent <= sharpsl_pm.battstat.mainbat_percent) { 270 if ((sharpsl_pm.battstat.ac_status == APM_AC_ONLINE)
271 || (apm_status == APM_BATTERY_STATUS_HIGH)
272 || percent <= sharpsl_pm.battstat.mainbat_percent) {
271 sharpsl_pm.battstat.mainbat_voltage = voltage; 273 sharpsl_pm.battstat.mainbat_voltage = voltage;
272 sharpsl_pm.battstat.mainbat_status = apm_status; 274 sharpsl_pm.battstat.mainbat_status = apm_status;
273 sharpsl_pm.battstat.mainbat_percent = percent; 275 sharpsl_pm.battstat.mainbat_percent = percent;
@@ -279,8 +281,8 @@ static void sharpsl_battery_thread(struct work_struct *private_)
279#ifdef CONFIG_BACKLIGHT_CORGI 281#ifdef CONFIG_BACKLIGHT_CORGI
280 /* If battery is low. limit backlight intensity to save power. */ 282 /* If battery is low. limit backlight intensity to save power. */
281 if ((sharpsl_pm.battstat.ac_status != APM_AC_ONLINE) 283 if ((sharpsl_pm.battstat.ac_status != APM_AC_ONLINE)
282 && ((sharpsl_pm.battstat.mainbat_status == APM_BATTERY_STATUS_LOW) || 284 && ((sharpsl_pm.battstat.mainbat_status == APM_BATTERY_STATUS_LOW)
283 (sharpsl_pm.battstat.mainbat_status == APM_BATTERY_STATUS_CRITICAL))) { 285 || (sharpsl_pm.battstat.mainbat_status == APM_BATTERY_STATUS_CRITICAL))) {
284 if (!(sharpsl_pm.flags & SHARPSL_BL_LIMIT)) { 286 if (!(sharpsl_pm.flags & SHARPSL_BL_LIMIT)) {
285 sharpsl_pm.machinfo->backlight_limit(1); 287 sharpsl_pm.machinfo->backlight_limit(1);
286 sharpsl_pm.flags |= SHARPSL_BL_LIMIT; 288 sharpsl_pm.flags |= SHARPSL_BL_LIMIT;
@@ -293,8 +295,8 @@ static void sharpsl_battery_thread(struct work_struct *private_)
293 295
294 /* Suspend if critical battery level */ 296 /* Suspend if critical battery level */
295 if ((sharpsl_pm.battstat.ac_status != APM_AC_ONLINE) 297 if ((sharpsl_pm.battstat.ac_status != APM_AC_ONLINE)
296 && (sharpsl_pm.battstat.mainbat_status == APM_BATTERY_STATUS_CRITICAL) 298 && (sharpsl_pm.battstat.mainbat_status == APM_BATTERY_STATUS_CRITICAL)
297 && !(sharpsl_pm.flags & SHARPSL_APM_QUEUED)) { 299 && !(sharpsl_pm.flags & SHARPSL_APM_QUEUED)) {
298 sharpsl_pm.flags |= SHARPSL_APM_QUEUED; 300 sharpsl_pm.flags |= SHARPSL_APM_QUEUED;
299 dev_err(sharpsl_pm.dev, "Fatal Off\n"); 301 dev_err(sharpsl_pm.dev, "Fatal Off\n");
300 apm_queue_event(APM_CRITICAL_SUSPEND); 302 apm_queue_event(APM_CRITICAL_SUSPEND);
@@ -346,7 +348,7 @@ static void sharpsl_charge_error(void)
346 348
347static void sharpsl_charge_toggle(struct work_struct *private_) 349static void sharpsl_charge_toggle(struct work_struct *private_)
348{ 350{
349 dev_dbg(sharpsl_pm.dev, "Toogling Charger at time: %lx\n", jiffies); 351 dev_dbg(sharpsl_pm.dev, "Toggling Charger at time: %lx\n", jiffies);
350 352
351 if (!sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_ACIN)) { 353 if (!sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_ACIN)) {
352 sharpsl_charge_off(); 354 sharpsl_charge_off();
@@ -368,7 +370,7 @@ static void sharpsl_ac_timer(unsigned long data)
368{ 370{
369 int acin = sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_ACIN); 371 int acin = sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_ACIN);
370 372
371 dev_dbg(sharpsl_pm.dev, "AC Status: %d\n",acin); 373 dev_dbg(sharpsl_pm.dev, "AC Status: %d\n", acin);
372 374
373 sharpsl_average_clear(); 375 sharpsl_average_clear();
374 if (acin && (sharpsl_pm.charge_mode != CHRG_ON)) 376 if (acin && (sharpsl_pm.charge_mode != CHRG_ON))
@@ -472,14 +474,14 @@ static int sharpsl_average_value(int ad)
472 sharpsl_ad[sharpsl_ad_index] = ad; 474 sharpsl_ad[sharpsl_ad_index] = ad;
473 sharpsl_ad_index++; 475 sharpsl_ad_index++;
474 if (sharpsl_ad_index >= SHARPSL_CNV_VALUE_NUM) { 476 if (sharpsl_ad_index >= SHARPSL_CNV_VALUE_NUM) {
475 for (i=0; i < (SHARPSL_CNV_VALUE_NUM-1); i++) 477 for (i = 0; i < (SHARPSL_CNV_VALUE_NUM-1); i++)
476 sharpsl_ad[i] = sharpsl_ad[i+1]; 478 sharpsl_ad[i] = sharpsl_ad[i+1];
477 sharpsl_ad_index = SHARPSL_CNV_VALUE_NUM - 1; 479 sharpsl_ad_index = SHARPSL_CNV_VALUE_NUM - 1;
478 } 480 }
479 for (i=0; i < sharpsl_ad_index; i++) 481 for (i = 0; i < sharpsl_ad_index; i++)
480 ad_val += sharpsl_ad[i]; 482 ad_val += sharpsl_ad[i];
481 483
482 return (ad_val / sharpsl_ad_index); 484 return ad_val / sharpsl_ad_index;
483} 485}
484 486
485/* 487/*
@@ -492,8 +494,8 @@ static int get_select_val(int *val)
492 494
493 /* Find MAX val */ 495 /* Find MAX val */
494 temp = val[0]; 496 temp = val[0];
495 j=0; 497 j = 0;
496 for (i=1; i<5; i++) { 498 for (i = 1; i < 5; i++) {
497 if (temp < val[i]) { 499 if (temp < val[i]) {
498 temp = val[i]; 500 temp = val[i];
499 j = i; 501 j = i;
@@ -502,21 +504,21 @@ static int get_select_val(int *val)
502 504
503 /* Find MIN val */ 505 /* Find MIN val */
504 temp = val[4]; 506 temp = val[4];
505 k=4; 507 k = 4;
506 for (i=3; i>=0; i--) { 508 for (i = 3; i >= 0; i--) {
507 if (temp > val[i]) { 509 if (temp > val[i]) {
508 temp = val[i]; 510 temp = val[i];
509 k = i; 511 k = i;
510 } 512 }
511 } 513 }
512 514
513 for (i=0; i<5; i++) 515 for (i = 0; i < 5; i++)
514 if (i != j && i != k ) 516 if (i != j && i != k)
515 sum += val[i]; 517 sum += val[i];
516 518
517 dev_dbg(sharpsl_pm.dev, "Average: %d from values: %d, %d, %d, %d, %d\n", sum/3, val[0], val[1], val[2], val[3], val[4]); 519 dev_dbg(sharpsl_pm.dev, "Average: %d from values: %d, %d, %d, %d, %d\n", sum/3, val[0], val[1], val[2], val[3], val[4]);
518 520
519 return (sum/3); 521 return sum/3;
520} 522}
521 523
522static int sharpsl_check_battery_temp(void) 524static int sharpsl_check_battery_temp(void)
@@ -524,7 +526,7 @@ static int sharpsl_check_battery_temp(void)
524 int val, i, buff[5]; 526 int val, i, buff[5];
525 527
526 /* Check battery temperature */ 528 /* Check battery temperature */
527 for (i=0; i<5; i++) { 529 for (i = 0; i < 5; i++) {
528 mdelay(SHARPSL_CHECK_BATTERY_WAIT_TIME_TEMP); 530 mdelay(SHARPSL_CHECK_BATTERY_WAIT_TIME_TEMP);
529 sharpsl_pm.machinfo->measure_temp(1); 531 sharpsl_pm.machinfo->measure_temp(1);
530 mdelay(SHARPSL_CHECK_BATTERY_WAIT_TIME_TEMP); 532 mdelay(SHARPSL_CHECK_BATTERY_WAIT_TIME_TEMP);
@@ -557,7 +559,7 @@ static int sharpsl_check_battery_voltage(void)
557 sharpsl_pm.machinfo->discharge1(1); 559 sharpsl_pm.machinfo->discharge1(1);
558 560
559 /* Check battery voltage */ 561 /* Check battery voltage */
560 for (i=0; i<5; i++) { 562 for (i = 0; i < 5; i++) {
561 buff[i] = sharpsl_pm.machinfo->read_devdata(SHARPSL_BATT_VOLT); 563 buff[i] = sharpsl_pm.machinfo->read_devdata(SHARPSL_BATT_VOLT);
562 mdelay(SHARPSL_CHECK_BATTERY_WAIT_TIME_VOLT); 564 mdelay(SHARPSL_CHECK_BATTERY_WAIT_TIME_VOLT);
563 } 565 }
@@ -581,16 +583,16 @@ static int sharpsl_ac_check(void)
581{ 583{
582 int temp, i, buff[5]; 584 int temp, i, buff[5];
583 585
584 for (i=0; i<5; i++) { 586 for (i = 0; i < 5; i++) {
585 buff[i] = sharpsl_pm.machinfo->read_devdata(SHARPSL_ACIN_VOLT); 587 buff[i] = sharpsl_pm.machinfo->read_devdata(SHARPSL_ACIN_VOLT);
586 mdelay(SHARPSL_CHECK_BATTERY_WAIT_TIME_ACIN); 588 mdelay(SHARPSL_CHECK_BATTERY_WAIT_TIME_ACIN);
587 } 589 }
588 590
589 temp = get_select_val(buff); 591 temp = get_select_val(buff);
590 dev_dbg(sharpsl_pm.dev, "AC Voltage: %d\n",temp); 592 dev_dbg(sharpsl_pm.dev, "AC Voltage: %d\n", temp);
591 593
592 if ((temp > sharpsl_pm.machinfo->charge_acin_high) || (temp < sharpsl_pm.machinfo->charge_acin_low)) { 594 if ((temp > sharpsl_pm.machinfo->charge_acin_high) || (temp < sharpsl_pm.machinfo->charge_acin_low)) {
593 dev_err(sharpsl_pm.dev, "Error: AC check failed.\n"); 595 dev_err(sharpsl_pm.dev, "Error: AC check failed: voltage %d.\n", temp);
594 return -1; 596 return -1;
595 } 597 }
596 598
@@ -624,9 +626,9 @@ static int sharpsl_pm_resume(struct platform_device *pdev)
624 626
625static void corgi_goto_sleep(unsigned long alarm_time, unsigned int alarm_enable, suspend_state_t state) 627static void corgi_goto_sleep(unsigned long alarm_time, unsigned int alarm_enable, suspend_state_t state)
626{ 628{
627 dev_dbg(sharpsl_pm.dev, "Time is: %08x\n",RCNR); 629 dev_dbg(sharpsl_pm.dev, "Time is: %08x\n", RCNR);
628 630
629 dev_dbg(sharpsl_pm.dev, "Offline Charge Activate = %d\n",sharpsl_pm.flags & SHARPSL_DO_OFFLINE_CHRG); 631 dev_dbg(sharpsl_pm.dev, "Offline Charge Activate = %d\n", sharpsl_pm.flags & SHARPSL_DO_OFFLINE_CHRG);
630 /* not charging and AC-IN! */ 632 /* not charging and AC-IN! */
631 633
632 if ((sharpsl_pm.flags & SHARPSL_DO_OFFLINE_CHRG) && (sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_ACIN))) { 634 if ((sharpsl_pm.flags & SHARPSL_DO_OFFLINE_CHRG) && (sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_ACIN))) {
@@ -644,12 +646,12 @@ static void corgi_goto_sleep(unsigned long alarm_time, unsigned int alarm_enable
644 if ((sharpsl_pm.charge_mode == CHRG_ON) && ((alarm_enable && ((alarm_time - RCNR) > (SHARPSL_BATCHK_TIME_SUSPEND + 30))) || !alarm_enable)) { 646 if ((sharpsl_pm.charge_mode == CHRG_ON) && ((alarm_enable && ((alarm_time - RCNR) > (SHARPSL_BATCHK_TIME_SUSPEND + 30))) || !alarm_enable)) {
645 RTSR &= RTSR_ALE; 647 RTSR &= RTSR_ALE;
646 RTAR = RCNR + SHARPSL_BATCHK_TIME_SUSPEND; 648 RTAR = RCNR + SHARPSL_BATCHK_TIME_SUSPEND;
647 dev_dbg(sharpsl_pm.dev, "Charging alarm at: %08x\n",RTAR); 649 dev_dbg(sharpsl_pm.dev, "Charging alarm at: %08x\n", RTAR);
648 sharpsl_pm.flags |= SHARPSL_ALARM_ACTIVE; 650 sharpsl_pm.flags |= SHARPSL_ALARM_ACTIVE;
649 } else if (alarm_enable) { 651 } else if (alarm_enable) {
650 RTSR &= RTSR_ALE; 652 RTSR &= RTSR_ALE;
651 RTAR = alarm_time; 653 RTAR = alarm_time;
652 dev_dbg(sharpsl_pm.dev, "User alarm at: %08x\n",RTAR); 654 dev_dbg(sharpsl_pm.dev, "User alarm at: %08x\n", RTAR);
653 } else { 655 } else {
654 dev_dbg(sharpsl_pm.dev, "No alarms set.\n"); 656 dev_dbg(sharpsl_pm.dev, "No alarms set.\n");
655 } 657 }
@@ -658,19 +660,18 @@ static void corgi_goto_sleep(unsigned long alarm_time, unsigned int alarm_enable
658 660
659 sharpsl_pm.machinfo->postsuspend(); 661 sharpsl_pm.machinfo->postsuspend();
660 662
661 dev_dbg(sharpsl_pm.dev, "Corgi woken up from suspend: %08x\n",PEDR); 663 dev_dbg(sharpsl_pm.dev, "Corgi woken up from suspend: %08x\n", PEDR);
662} 664}
663 665
664static int corgi_enter_suspend(unsigned long alarm_time, unsigned int alarm_enable, suspend_state_t state) 666static int corgi_enter_suspend(unsigned long alarm_time, unsigned int alarm_enable, suspend_state_t state)
665{ 667{
666 if (!sharpsl_pm.machinfo->should_wakeup(!(sharpsl_pm.flags & SHARPSL_ALARM_ACTIVE) && alarm_enable) ) 668 if (!sharpsl_pm.machinfo->should_wakeup(!(sharpsl_pm.flags & SHARPSL_ALARM_ACTIVE) && alarm_enable)) {
667 {
668 if (!(sharpsl_pm.flags & SHARPSL_ALARM_ACTIVE)) { 669 if (!(sharpsl_pm.flags & SHARPSL_ALARM_ACTIVE)) {
669 dev_dbg(sharpsl_pm.dev, "No user triggered wakeup events and not charging. Strange. Suspend.\n"); 670 dev_dbg(sharpsl_pm.dev, "No user triggered wakeup events and not charging. Strange. Suspend.\n");
670 corgi_goto_sleep(alarm_time, alarm_enable, state); 671 corgi_goto_sleep(alarm_time, alarm_enable, state);
671 return 1; 672 return 1;
672 } 673 }
673 if(sharpsl_off_charge_battery()) { 674 if (sharpsl_off_charge_battery()) {
674 dev_dbg(sharpsl_pm.dev, "Charging. Suspend...\n"); 675 dev_dbg(sharpsl_pm.dev, "Charging. Suspend...\n");
675 corgi_goto_sleep(alarm_time, alarm_enable, state); 676 corgi_goto_sleep(alarm_time, alarm_enable, state);
676 return 1; 677 return 1;
@@ -697,7 +698,7 @@ static int corgi_pxa_pm_enter(suspend_state_t state)
697 698
698 corgi_goto_sleep(alarm_time, alarm_status, state); 699 corgi_goto_sleep(alarm_time, alarm_status, state);
699 700
700 while (corgi_enter_suspend(alarm_time,alarm_status,state)) 701 while (corgi_enter_suspend(alarm_time, alarm_status, state))
701 {} 702 {}
702 703
703 if (sharpsl_pm.machinfo->earlyresume) 704 if (sharpsl_pm.machinfo->earlyresume)
@@ -732,7 +733,7 @@ static int sharpsl_fatal_check(void)
732 sharpsl_pm.machinfo->discharge1(1); 733 sharpsl_pm.machinfo->discharge1(1);
733 734
734 /* Check battery : check inserting battery ? */ 735 /* Check battery : check inserting battery ? */
735 for (i=0; i<5; i++) { 736 for (i = 0; i < 5; i++) {
736 buff[i] = sharpsl_pm.machinfo->read_devdata(SHARPSL_BATT_VOLT); 737 buff[i] = sharpsl_pm.machinfo->read_devdata(SHARPSL_BATT_VOLT);
737 mdelay(SHARPSL_CHECK_BATTERY_WAIT_TIME_VOLT); 738 mdelay(SHARPSL_CHECK_BATTERY_WAIT_TIME_VOLT);
738 } 739 }
@@ -812,7 +813,7 @@ static int sharpsl_off_charge_battery(void)
812 mdelay(SHARPSL_CHARGE_CO_CHECK_TIME); 813 mdelay(SHARPSL_CHARGE_CO_CHECK_TIME);
813 814
814 time = RCNR; 815 time = RCNR;
815 while(1) { 816 while (1) {
816 /* Check if any wakeup event had occurred */ 817 /* Check if any wakeup event had occurred */
817 if (sharpsl_pm.machinfo->charger_wakeup() != 0) 818 if (sharpsl_pm.machinfo->charger_wakeup() != 0)
818 return 0; 819 return 0;
@@ -835,9 +836,9 @@ static int sharpsl_off_charge_battery(void)
835 mdelay(SHARPSL_CHARGE_CO_CHECK_TIME); 836 mdelay(SHARPSL_CHARGE_CO_CHECK_TIME);
836 837
837 time = RCNR; 838 time = RCNR;
838 while(1) { 839 while (1) {
839 /* Check if any wakeup event had occurred */ 840 /* Check if any wakeup event had occurred */
840 if (sharpsl_pm.machinfo->charger_wakeup() != 0) 841 if (sharpsl_pm.machinfo->charger_wakeup())
841 return 0; 842 return 0;
842 /* Check for timeout */ 843 /* Check for timeout */
843 if ((RCNR-time) > SHARPSL_WAIT_CO_TIME) { 844 if ((RCNR-time) > SHARPSL_WAIT_CO_TIME) {
@@ -864,12 +865,12 @@ static int sharpsl_off_charge_battery(void)
864 865
865static ssize_t battery_percentage_show(struct device *dev, struct device_attribute *attr, char *buf) 866static ssize_t battery_percentage_show(struct device *dev, struct device_attribute *attr, char *buf)
866{ 867{
867 return sprintf(buf, "%d\n",sharpsl_pm.battstat.mainbat_percent); 868 return sprintf(buf, "%d\n", sharpsl_pm.battstat.mainbat_percent);
868} 869}
869 870
870static ssize_t battery_voltage_show(struct device *dev, struct device_attribute *attr, char *buf) 871static ssize_t battery_voltage_show(struct device *dev, struct device_attribute *attr, char *buf)
871{ 872{
872 return sprintf(buf, "%d\n",sharpsl_pm.battstat.mainbat_voltage); 873 return sprintf(buf, "%d\n", sharpsl_pm.battstat.mainbat_voltage);
873} 874}
874 875
875static DEVICE_ATTR(battery_percentage, 0444, battery_percentage_show, NULL); 876static DEVICE_ATTR(battery_percentage, 0444, battery_percentage_show, NULL);
@@ -943,8 +944,7 @@ static int __init sharpsl_pm_probe(struct platform_device *pdev)
943 } 944 }
944 } 945 }
945 946
946 if (sharpsl_pm.machinfo->batfull_irq) 947 if (sharpsl_pm.machinfo->batfull_irq) {
947 {
948 /* Register interrupt handler. */ 948 /* Register interrupt handler. */
949 if (request_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_batfull), sharpsl_chrg_full_isr, IRQF_DISABLED | IRQF_TRIGGER_RISING, "CO", sharpsl_chrg_full_isr)) { 949 if (request_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_batfull), sharpsl_chrg_full_isr, IRQF_DISABLED | IRQF_TRIGGER_RISING, "CO", sharpsl_chrg_full_isr)) {
950 dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", IRQ_GPIO(sharpsl_pm.machinfo->gpio_batfull)); 950 dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", IRQ_GPIO(sharpsl_pm.machinfo->gpio_batfull));
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c
index 3da45d051743..4b50f144fa48 100644
--- a/arch/arm/mach-pxa/spitz.c
+++ b/arch/arm/mach-pxa/spitz.c
@@ -768,6 +768,10 @@ static void __init common_init(void)
768 768
769 pxa2xx_mfp_config(ARRAY_AND_SIZE(spitz_pin_config)); 769 pxa2xx_mfp_config(ARRAY_AND_SIZE(spitz_pin_config));
770 770
771 pxa_set_ffuart_info(NULL);
772 pxa_set_btuart_info(NULL);
773 pxa_set_stuart_info(NULL);
774
771 spitz_init_spi(); 775 spitz_init_spi();
772 776
773 platform_add_devices(devices, ARRAY_SIZE(devices)); 777 platform_add_devices(devices, ARRAY_SIZE(devices));
@@ -802,10 +806,12 @@ static void __init spitz_init(void)
802{ 806{
803 spitz_ficp_platform_data.gpio_pwdown = SPITZ_GPIO_IR_ON; 807 spitz_ficp_platform_data.gpio_pwdown = SPITZ_GPIO_IR_ON;
804 808
809#ifdef CONFIG_MACH_BORZOI
805 if (machine_is_borzoi()) { 810 if (machine_is_borzoi()) {
806 sharpsl_nand_platform_data.badblock_pattern = &sharpsl_akita_bbt; 811 sharpsl_nand_platform_data.badblock_pattern = &sharpsl_akita_bbt;
807 sharpsl_nand_platform_data.ecc_layout = &akita_oobinfo; 812 sharpsl_nand_platform_data.ecc_layout = &akita_oobinfo;
808 } 813 }
814#endif
809 815
810 platform_scoop_config = &spitz_pcmcia_config; 816 platform_scoop_config = &spitz_pcmcia_config;
811 817
diff --git a/arch/arm/mach-pxa/spitz_pm.c b/arch/arm/mach-pxa/spitz_pm.c
index 724ffb030317..fc5a70c40358 100644
--- a/arch/arm/mach-pxa/spitz_pm.c
+++ b/arch/arm/mach-pxa/spitz_pm.c
@@ -103,7 +103,7 @@ static void spitz_presuspend(void)
103 PFER = GPIO_bit(SPITZ_GPIO_KEY_INT) | GPIO_bit(SPITZ_GPIO_RESET); 103 PFER = GPIO_bit(SPITZ_GPIO_KEY_INT) | GPIO_bit(SPITZ_GPIO_RESET);
104 PWER = GPIO_bit(SPITZ_GPIO_KEY_INT) | GPIO_bit(SPITZ_GPIO_RESET) | PWER_RTC; 104 PWER = GPIO_bit(SPITZ_GPIO_KEY_INT) | GPIO_bit(SPITZ_GPIO_RESET) | PWER_RTC;
105 PKWR = GPIO_bit(SPITZ_GPIO_SYNC) | GPIO_bit(SPITZ_GPIO_KEY_INT) | GPIO_bit(SPITZ_GPIO_RESET); 105 PKWR = GPIO_bit(SPITZ_GPIO_SYNC) | GPIO_bit(SPITZ_GPIO_KEY_INT) | GPIO_bit(SPITZ_GPIO_RESET);
106 PKSR = 0xffffffff; // clear 106 PKSR = 0xffffffff; /* clear */
107 107
108 /* nRESET_OUT Disable */ 108 /* nRESET_OUT Disable */
109 PSLR |= PSLR_SL_ROD; 109 PSLR |= PSLR_SL_ROD;
@@ -149,7 +149,7 @@ static int spitz_should_wakeup(unsigned int resume_on_alarm)
149 if (resume_on_alarm && (PEDR & PWER_RTC)) 149 if (resume_on_alarm && (PEDR & PWER_RTC))
150 is_resume |= PWER_RTC; 150 is_resume |= PWER_RTC;
151 151
152 dev_dbg(sharpsl_pm.dev, "is_resume: %x\n",is_resume); 152 dev_dbg(sharpsl_pm.dev, "is_resume: %x\n", is_resume);
153 return is_resume; 153 return is_resume;
154} 154}
155 155
@@ -160,7 +160,7 @@ static unsigned long spitz_charger_wakeup(void)
160 160
161unsigned long spitzpm_read_devdata(int type) 161unsigned long spitzpm_read_devdata(int type)
162{ 162{
163 switch(type) { 163 switch (type) {
164 case SHARPSL_STATUS_ACIN: 164 case SHARPSL_STATUS_ACIN:
165 return (((~GPLR(SPITZ_GPIO_AC_IN)) & GPIO_bit(SPITZ_GPIO_AC_IN)) != 0); 165 return (((~GPLR(SPITZ_GPIO_AC_IN)) & GPIO_bit(SPITZ_GPIO_AC_IN)) != 0);
166 case SHARPSL_STATUS_LOCK: 166 case SHARPSL_STATUS_LOCK:
@@ -199,7 +199,7 @@ struct sharpsl_charger_machinfo spitz_pm_machinfo = {
199#if defined(CONFIG_LCD_CORGI) 199#if defined(CONFIG_LCD_CORGI)
200 .backlight_limit = corgi_lcd_limit_intensity, 200 .backlight_limit = corgi_lcd_limit_intensity,
201#elif defined(CONFIG_BACKLIGHT_CORGI) 201#elif defined(CONFIG_BACKLIGHT_CORGI)
202 .backlight_limit = corgibl_limit_intensity, 202 .backlight_limit = corgibl_limit_intensity,
203#endif 203#endif
204 .charge_on_volt = SHARPSL_CHARGE_ON_VOLT, 204 .charge_on_volt = SHARPSL_CHARGE_ON_VOLT,
205 .charge_on_temp = SHARPSL_CHARGE_ON_TEMP, 205 .charge_on_temp = SHARPSL_CHARGE_ON_TEMP,
@@ -208,8 +208,8 @@ struct sharpsl_charger_machinfo spitz_pm_machinfo = {
208 .fatal_acin_volt = SHARPSL_FATAL_ACIN_VOLT, 208 .fatal_acin_volt = SHARPSL_FATAL_ACIN_VOLT,
209 .fatal_noacin_volt= SHARPSL_FATAL_NOACIN_VOLT, 209 .fatal_noacin_volt= SHARPSL_FATAL_NOACIN_VOLT,
210 .bat_levels = 40, 210 .bat_levels = 40,
211 .bat_levels_noac = spitz_battery_levels_noac, 211 .bat_levels_noac = sharpsl_battery_levels_noac,
212 .bat_levels_acin = spitz_battery_levels_acin, 212 .bat_levels_acin = sharpsl_battery_levels_acin,
213 .status_high_acin = 188, 213 .status_high_acin = 188,
214 .status_low_acin = 178, 214 .status_low_acin = 178,
215 .status_high_noac = 185, 215 .status_high_noac = 185,
@@ -241,7 +241,7 @@ static int __devinit spitzpm_init(void)
241 241
242static void spitzpm_exit(void) 242static void spitzpm_exit(void)
243{ 243{
244 platform_device_unregister(spitzpm_device); 244 platform_device_unregister(spitzpm_device);
245} 245}
246 246
247module_init(spitzpm_init); 247module_init(spitzpm_init);
diff --git a/arch/arm/mach-pxa/ssp.c b/arch/arm/mach-pxa/ssp.c
index 965e38c6bafe..9ebe658590fa 100644
--- a/arch/arm/mach-pxa/ssp.c
+++ b/arch/arm/mach-pxa/ssp.c
@@ -342,8 +342,9 @@ void ssp_free(struct ssp_device *ssp)
342} 342}
343EXPORT_SYMBOL(ssp_free); 343EXPORT_SYMBOL(ssp_free);
344 344
345static int __devinit ssp_probe(struct platform_device *pdev, int type) 345static int __devinit ssp_probe(struct platform_device *pdev)
346{ 346{
347 const struct platform_device_id *id = platform_get_device_id(pdev);
347 struct resource *res; 348 struct resource *res;
348 struct ssp_device *ssp; 349 struct ssp_device *ssp;
349 int ret = 0; 350 int ret = 0;
@@ -413,7 +414,7 @@ static int __devinit ssp_probe(struct platform_device *pdev, int type)
413 */ 414 */
414 ssp->port_id = pdev->id + 1; 415 ssp->port_id = pdev->id + 1;
415 ssp->use_count = 0; 416 ssp->use_count = 0;
416 ssp->type = type; 417 ssp->type = (int)id->driver_data;
417 418
418 mutex_lock(&ssp_lock); 419 mutex_lock(&ssp_lock);
419 list_add(&ssp->node, &ssp_list); 420 list_add(&ssp->node, &ssp_list);
@@ -457,75 +458,31 @@ static int __devexit ssp_remove(struct platform_device *pdev)
457 return 0; 458 return 0;
458} 459}
459 460
460static int __devinit pxa25x_ssp_probe(struct platform_device *pdev) 461static const struct platform_device_id ssp_id_table[] = {
461{ 462 { "pxa25x-ssp", PXA25x_SSP },
462 return ssp_probe(pdev, PXA25x_SSP); 463 { "pxa25x-nssp", PXA25x_NSSP },
463} 464 { "pxa27x-ssp", PXA27x_SSP },
464 465 { },
465static int __devinit pxa25x_nssp_probe(struct platform_device *pdev)
466{
467 return ssp_probe(pdev, PXA25x_NSSP);
468}
469
470static int __devinit pxa27x_ssp_probe(struct platform_device *pdev)
471{
472 return ssp_probe(pdev, PXA27x_SSP);
473}
474
475static struct platform_driver pxa25x_ssp_driver = {
476 .driver = {
477 .name = "pxa25x-ssp",
478 },
479 .probe = pxa25x_ssp_probe,
480 .remove = __devexit_p(ssp_remove),
481}; 466};
482 467
483static struct platform_driver pxa25x_nssp_driver = { 468static struct platform_driver ssp_driver = {
484 .driver = { 469 .probe = ssp_probe,
485 .name = "pxa25x-nssp",
486 },
487 .probe = pxa25x_nssp_probe,
488 .remove = __devexit_p(ssp_remove), 470 .remove = __devexit_p(ssp_remove),
489};
490
491static struct platform_driver pxa27x_ssp_driver = {
492 .driver = { 471 .driver = {
493 .name = "pxa27x-ssp", 472 .owner = THIS_MODULE,
473 .name = "pxa2xx-ssp",
494 }, 474 },
495 .probe = pxa27x_ssp_probe, 475 .id_table = ssp_id_table,
496 .remove = __devexit_p(ssp_remove),
497}; 476};
498 477
499static int __init pxa_ssp_init(void) 478static int __init pxa_ssp_init(void)
500{ 479{
501 int ret = 0; 480 return platform_driver_register(&ssp_driver);
502
503 ret = platform_driver_register(&pxa25x_ssp_driver);
504 if (ret) {
505 printk(KERN_ERR "failed to register pxa25x_ssp_driver");
506 return ret;
507 }
508
509 ret = platform_driver_register(&pxa25x_nssp_driver);
510 if (ret) {
511 printk(KERN_ERR "failed to register pxa25x_nssp_driver");
512 return ret;
513 }
514
515 ret = platform_driver_register(&pxa27x_ssp_driver);
516 if (ret) {
517 printk(KERN_ERR "failed to register pxa27x_ssp_driver");
518 return ret;
519 }
520
521 return ret;
522} 481}
523 482
524static void __exit pxa_ssp_exit(void) 483static void __exit pxa_ssp_exit(void)
525{ 484{
526 platform_driver_unregister(&pxa25x_ssp_driver); 485 platform_driver_unregister(&ssp_driver);
527 platform_driver_unregister(&pxa25x_nssp_driver);
528 platform_driver_unregister(&pxa27x_ssp_driver);
529} 486}
530 487
531arch_initcall(pxa_ssp_init); 488arch_initcall(pxa_ssp_init);
diff --git a/arch/arm/mach-pxa/stargate2.c b/arch/arm/mach-pxa/stargate2.c
index 3b205b69f3fb..a98a434f0111 100644
--- a/arch/arm/mach-pxa/stargate2.c
+++ b/arch/arm/mach-pxa/stargate2.c
@@ -760,6 +760,10 @@ static void __init stargate2_init(void)
760 760
761 pxa2xx_mfp_config(ARRAY_AND_SIZE(stargate2_pin_config)); 761 pxa2xx_mfp_config(ARRAY_AND_SIZE(stargate2_pin_config));
762 762
763 pxa_set_ffuart_info(NULL);
764 pxa_set_btuart_info(NULL);
765 pxa_set_stuart_info(NULL);
766
763 /* spi chip selects */ 767 /* spi chip selects */
764 gpio_direction_output(37, 0); 768 gpio_direction_output(37, 0);
765 gpio_direction_output(24, 0); 769 gpio_direction_output(24, 0);
diff --git a/arch/arm/mach-pxa/tavorevb.c b/arch/arm/mach-pxa/tavorevb.c
index b75353a2ec75..f02dcb5b4e97 100644
--- a/arch/arm/mach-pxa/tavorevb.c
+++ b/arch/arm/mach-pxa/tavorevb.c
@@ -477,6 +477,10 @@ static void __init tavorevb_init(void)
477 /* initialize MFP configurations */ 477 /* initialize MFP configurations */
478 pxa3xx_mfp_config(ARRAY_AND_SIZE(tavorevb_mfp_cfg)); 478 pxa3xx_mfp_config(ARRAY_AND_SIZE(tavorevb_mfp_cfg));
479 479
480 pxa_set_ffuart_info(NULL);
481 pxa_set_btuart_info(NULL);
482 pxa_set_stuart_info(NULL);
483
480 platform_device_register(&smc91x_device); 484 platform_device_register(&smc91x_device);
481 485
482 tavorevb_init_lcd(); 486 tavorevb_init_lcd();
diff --git a/arch/arm/mach-pxa/tosa.c b/arch/arm/mach-pxa/tosa.c
index e81a52673d49..c854c168a451 100644
--- a/arch/arm/mach-pxa/tosa.c
+++ b/arch/arm/mach-pxa/tosa.c
@@ -825,6 +825,11 @@ static void __init tosa_init(void)
825 int dummy; 825 int dummy;
826 826
827 pxa2xx_mfp_config(ARRAY_AND_SIZE(tosa_pin_config)); 827 pxa2xx_mfp_config(ARRAY_AND_SIZE(tosa_pin_config));
828
829 pxa_set_ffuart_info(NULL);
830 pxa_set_btuart_info(NULL);
831 pxa_set_stuart_info(NULL);
832
828 gpio_set_wake(MFP_PIN_GPIO1, 1); 833 gpio_set_wake(MFP_PIN_GPIO1, 1);
829 /* We can't pass to gpio-keys since it will drop the Reset altfunc */ 834 /* We can't pass to gpio-keys since it will drop the Reset altfunc */
830 835
diff --git a/arch/arm/mach-pxa/trizeps4.c b/arch/arm/mach-pxa/trizeps4.c
index 3981e0356d12..0aa858ebc573 100644
--- a/arch/arm/mach-pxa/trizeps4.c
+++ b/arch/arm/mach-pxa/trizeps4.c
@@ -524,6 +524,10 @@ static void __init trizeps4_init(void)
524 ARRAY_SIZE(trizeps4_devices)); 524 ARRAY_SIZE(trizeps4_devices));
525 } 525 }
526 526
527 pxa_set_ffuart_info(NULL);
528 pxa_set_btuart_info(NULL);
529 pxa_set_stuart_info(NULL);
530
527 if (0) /* dont know how to determine LCD */ 531 if (0) /* dont know how to determine LCD */
528 set_pxa_fb_info(&sharp_lcd); 532 set_pxa_fb_info(&sharp_lcd);
529 else 533 else
diff --git a/arch/arm/mach-pxa/viper.c b/arch/arm/mach-pxa/viper.c
index d33c232b686c..cf0d71b7797e 100644
--- a/arch/arm/mach-pxa/viper.c
+++ b/arch/arm/mach-pxa/viper.c
@@ -301,15 +301,6 @@ static void __init viper_init_irq(void)
301 set_irq_chained_handler(gpio_to_irq(VIPER_CPLD_GPIO), 301 set_irq_chained_handler(gpio_to_irq(VIPER_CPLD_GPIO),
302 viper_irq_handler); 302 viper_irq_handler);
303 set_irq_type(gpio_to_irq(VIPER_CPLD_GPIO), IRQ_TYPE_EDGE_BOTH); 303 set_irq_type(gpio_to_irq(VIPER_CPLD_GPIO), IRQ_TYPE_EDGE_BOTH);
304
305#ifndef CONFIG_SERIAL_PXA
306 /*
307 * 8250 doesn't support IRQ_TYPE being passed as part
308 * of the plat_serial8250_port structure...
309 */
310 set_irq_type(gpio_to_irq(VIPER_UARTA_GPIO), IRQ_TYPE_EDGE_RISING);
311 set_irq_type(gpio_to_irq(VIPER_UARTB_GPIO), IRQ_TYPE_EDGE_RISING);
312#endif
313} 304}
314 305
315/* Flat Panel */ 306/* Flat Panel */
@@ -539,6 +530,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
539 { 530 {
540 .mapbase = VIPER_UARTA_PHYS, 531 .mapbase = VIPER_UARTA_PHYS,
541 .irq = gpio_to_irq(VIPER_UARTA_GPIO), 532 .irq = gpio_to_irq(VIPER_UARTA_GPIO),
533 .irqflags = IRQF_TRIGGER_RISING,
542 .uartclk = 1843200, 534 .uartclk = 1843200,
543 .regshift = 1, 535 .regshift = 1,
544 .iotype = UPIO_MEM, 536 .iotype = UPIO_MEM,
@@ -548,6 +540,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
548 { 540 {
549 .mapbase = VIPER_UARTB_PHYS, 541 .mapbase = VIPER_UARTB_PHYS,
550 .irq = gpio_to_irq(VIPER_UARTB_GPIO), 542 .irq = gpio_to_irq(VIPER_UARTB_GPIO),
543 .irqflags = IRQF_TRIGGER_RISING,
551 .uartclk = 1843200, 544 .uartclk = 1843200,
552 .regshift = 1, 545 .regshift = 1,
553 .iotype = UPIO_MEM, 546 .iotype = UPIO_MEM,
@@ -908,6 +901,10 @@ static void __init viper_init(void)
908 901
909 pxa2xx_mfp_config(ARRAY_AND_SIZE(viper_pin_config)); 902 pxa2xx_mfp_config(ARRAY_AND_SIZE(viper_pin_config));
910 903
904 pxa_set_ffuart_info(NULL);
905 pxa_set_btuart_info(NULL);
906 pxa_set_stuart_info(NULL);
907
911 /* Wake-up serial console */ 908 /* Wake-up serial console */
912 viper_init_serial_gpio(); 909 viper_init_serial_gpio();
913 910
diff --git a/arch/arm/mach-pxa/xcep.c b/arch/arm/mach-pxa/xcep.c
index 3fd79cbb36c8..d3b4e3f2e033 100644
--- a/arch/arm/mach-pxa/xcep.c
+++ b/arch/arm/mach-pxa/xcep.c
@@ -165,6 +165,11 @@ static void __init xcep_init(void)
165{ 165{
166 pxa2xx_mfp_config(ARRAY_AND_SIZE(xcep_pin_config)); 166 pxa2xx_mfp_config(ARRAY_AND_SIZE(xcep_pin_config));
167 167
168 pxa_set_ffuart_info(NULL);
169 pxa_set_btuart_info(NULL);
170 pxa_set_stuart_info(NULL);
171 pxa_set_hwuart_info(NULL);
172
168 /* See Intel XScale Developer's Guide for details */ 173 /* See Intel XScale Developer's Guide for details */
169 /* Set RDF and RDN to appropriate values (chip select 3 (smc91x)) */ 174 /* Set RDF and RDN to appropriate values (chip select 3 (smc91x)) */
170 MSC1 = (MSC1 & 0xffff) | 0xD5540000; 175 MSC1 = (MSC1 & 0xffff) | 0xD5540000;
diff --git a/arch/arm/mach-pxa/zylonite.c b/arch/arm/mach-pxa/zylonite.c
index 09784d3954e4..b66e9e2d06e7 100644
--- a/arch/arm/mach-pxa/zylonite.c
+++ b/arch/arm/mach-pxa/zylonite.c
@@ -31,7 +31,7 @@
31#include <mach/mmc.h> 31#include <mach/mmc.h>
32#include <mach/ohci.h> 32#include <mach/ohci.h>
33#include <mach/pxa27x_keypad.h> 33#include <mach/pxa27x_keypad.h>
34#include <mach/pxa3xx_nand.h> 34#include <plat/pxa3xx_nand.h>
35 35
36#include "devices.h" 36#include "devices.h"
37#include "generic.h" 37#include "generic.h"
@@ -444,6 +444,10 @@ static inline void zylonite_init_ohci(void) {}
444 444
445static void __init zylonite_init(void) 445static void __init zylonite_init(void)
446{ 446{
447 pxa_set_ffuart_info(NULL);
448 pxa_set_btuart_info(NULL);
449 pxa_set_stuart_info(NULL);
450
447 /* board-processor specific initialization */ 451 /* board-processor specific initialization */
448 zylonite_pxa300_init(); 452 zylonite_pxa300_init();
449 zylonite_pxa320_init(); 453 zylonite_pxa320_init();
diff --git a/arch/arm/mach-s3c2400/include/mach/map.h b/arch/arm/mach-s3c2400/include/mach/map.h
index 1535540edc82..3fd889200e99 100644
--- a/arch/arm/mach-s3c2400/include/mach/map.h
+++ b/arch/arm/mach-s3c2400/include/mach/map.h
@@ -1,6 +1,6 @@
1/* arch/arm/mach-s3c2400/include/mach/map.h 1/* arch/arm/mach-s3c2400/include/mach/map.h
2 * 2 *
3 * Copyright 2003,2007 Simtec Electronics 3 * Copyright 2003-2007 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk> 5 * Ben Dooks <ben@simtec.co.uk>
6 * 6 *
diff --git a/arch/arm/mach-s3c2410/Kconfig b/arch/arm/mach-s3c2410/Kconfig
index 3d4e9da3fa52..dd1fcc7e6708 100644
--- a/arch/arm/mach-s3c2410/Kconfig
+++ b/arch/arm/mach-s3c2410/Kconfig
@@ -81,6 +81,14 @@ config ARCH_H1940
81 help 81 help
82 Say Y here if you are using the HP IPAQ H1940 82 Say Y here if you are using the HP IPAQ H1940
83 83
84config H1940BT
85 tristate "Control the state of H1940 bluetooth chip"
86 depends on ARCH_H1940
87 select RFKILL
88 help
89 This is a simple driver that is able to control
90 the state of built in bluetooth chip on h1940.
91
84config PM_H1940 92config PM_H1940
85 bool 93 bool
86 help 94 help
diff --git a/arch/arm/mach-s3c2410/Makefile b/arch/arm/mach-s3c2410/Makefile
index 2ab5ba4b266f..0d468e96e83e 100644
--- a/arch/arm/mach-s3c2410/Makefile
+++ b/arch/arm/mach-s3c2410/Makefile
@@ -21,7 +21,8 @@ obj-$(CONFIG_S3C2410_PLLTABLE) += pll.o
21# Machine support 21# Machine support
22 22
23obj-$(CONFIG_ARCH_SMDK2410) += mach-smdk2410.o 23obj-$(CONFIG_ARCH_SMDK2410) += mach-smdk2410.o
24obj-$(CONFIG_ARCH_H1940) += mach-h1940.o h1940-bluetooth.o 24obj-$(CONFIG_ARCH_H1940) += mach-h1940.o
25obj-$(CONFIG_H1940BT) += h1940-bluetooth.o
25obj-$(CONFIG_PM_H1940) += pm-h1940.o 26obj-$(CONFIG_PM_H1940) += pm-h1940.o
26obj-$(CONFIG_MACH_N30) += mach-n30.o 27obj-$(CONFIG_MACH_N30) += mach-n30.o
27obj-$(CONFIG_ARCH_BAST) += mach-bast.o usb-simtec.o 28obj-$(CONFIG_ARCH_BAST) += mach-bast.o usb-simtec.o
diff --git a/arch/arm/mach-s3c2410/bast-irq.c b/arch/arm/mach-s3c2410/bast-irq.c
index 9a37c87152b0..217b102866d0 100644
--- a/arch/arm/mach-s3c2410/bast-irq.c
+++ b/arch/arm/mach-s3c2410/bast-irq.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/mach-s3c2410/bast-irq.c 1/* linux/arch/arm/mach-s3c2410/bast-irq.c
2 * 2 *
3 * Copyright (c) 2003,2005 Simtec Electronics 3 * Copyright 2003-2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * http://www.simtec.co.uk/products/EB2410ITX/ 6 * http://www.simtec.co.uk/products/EB2410ITX/
@@ -141,7 +141,7 @@ static __init int bast_irq_init(void)
141 unsigned int i; 141 unsigned int i;
142 142
143 if (machine_is_bast()) { 143 if (machine_is_bast()) {
144 printk(KERN_INFO "BAST PC104 IRQ routing, (c) 2005 Simtec Electronics\n"); 144 printk(KERN_INFO "BAST PC104 IRQ routing, Copyright 2005 Simtec Electronics\n");
145 145
146 /* zap all the IRQs */ 146 /* zap all the IRQs */
147 147
diff --git a/arch/arm/mach-s3c2410/cpu-freq.c b/arch/arm/mach-s3c2410/cpu-freq.c
index 9d1186877d08..75189df995ae 100644
--- a/arch/arm/mach-s3c2410/cpu-freq.c
+++ b/arch/arm/mach-s3c2410/cpu-freq.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/mach-s3c2410/cpu-freq.c 1/* linux/arch/arm/mach-s3c2410/cpu-freq.c
2 * 2 *
3 * Copyright (c) 2006,2008 Simtec Electronics 3 * Copyright (c) 2006-2008 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk> 5 * Ben Dooks <ben@simtec.co.uk>
6 * 6 *
diff --git a/arch/arm/mach-s3c2410/h1940-bluetooth.c b/arch/arm/mach-s3c2410/h1940-bluetooth.c
index 5aabf117cbb0..b7d1f8d27bc2 100644
--- a/arch/arm/mach-s3c2410/h1940-bluetooth.c
+++ b/arch/arm/mach-s3c2410/h1940-bluetooth.c
@@ -17,6 +17,7 @@
17#include <linux/ctype.h> 17#include <linux/ctype.h>
18#include <linux/leds.h> 18#include <linux/leds.h>
19#include <linux/gpio.h> 19#include <linux/gpio.h>
20#include <linux/rfkill.h>
20 21
21#include <mach/regs-gpio.h> 22#include <mach/regs-gpio.h>
22#include <mach/hardware.h> 23#include <mach/hardware.h>
@@ -24,21 +25,10 @@
24 25
25#define DRV_NAME "h1940-bt" 26#define DRV_NAME "h1940-bt"
26 27
27#ifdef CONFIG_LEDS_H1940
28DEFINE_LED_TRIGGER(bt_led_trigger);
29#endif
30
31static int state;
32
33/* Bluetooth control */ 28/* Bluetooth control */
34static void h1940bt_enable(int on) 29static void h1940bt_enable(int on)
35{ 30{
36 if (on) { 31 if (on) {
37#ifdef CONFIG_LEDS_H1940
38 /* flashing Blue */
39 led_trigger_event(bt_led_trigger, LED_HALF);
40#endif
41
42 /* Power on the chip */ 32 /* Power on the chip */
43 h1940_latch_control(0, H1940_LATCH_BLUETOOTH_POWER); 33 h1940_latch_control(0, H1940_LATCH_BLUETOOTH_POWER);
44 /* Reset the chip */ 34 /* Reset the chip */
@@ -46,48 +36,31 @@ static void h1940bt_enable(int on)
46 s3c2410_gpio_setpin(S3C2410_GPH(1), 1); 36 s3c2410_gpio_setpin(S3C2410_GPH(1), 1);
47 mdelay(10); 37 mdelay(10);
48 s3c2410_gpio_setpin(S3C2410_GPH(1), 0); 38 s3c2410_gpio_setpin(S3C2410_GPH(1), 0);
49
50 state = 1;
51 } 39 }
52 else { 40 else {
53#ifdef CONFIG_LEDS_H1940
54 led_trigger_event(bt_led_trigger, 0);
55#endif
56
57 s3c2410_gpio_setpin(S3C2410_GPH(1), 1); 41 s3c2410_gpio_setpin(S3C2410_GPH(1), 1);
58 mdelay(10); 42 mdelay(10);
59 s3c2410_gpio_setpin(S3C2410_GPH(1), 0); 43 s3c2410_gpio_setpin(S3C2410_GPH(1), 0);
60 mdelay(10); 44 mdelay(10);
61 h1940_latch_control(H1940_LATCH_BLUETOOTH_POWER, 0); 45 h1940_latch_control(H1940_LATCH_BLUETOOTH_POWER, 0);
62
63 state = 0;
64 } 46 }
65} 47}
66 48
67static ssize_t h1940bt_show(struct device *dev, struct device_attribute *attr, char *buf) 49static int h1940bt_set_block(void *data, bool blocked)
68{ 50{
69 return snprintf(buf, PAGE_SIZE, "%d\n", state); 51 h1940bt_enable(!blocked);
52 return 0;
70} 53}
71 54
72static ssize_t h1940bt_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) 55static const struct rfkill_ops h1940bt_rfkill_ops = {
73{ 56 .set_block = h1940bt_set_block,
74 int new_state; 57};
75 char *endp;
76
77 new_state = simple_strtoul(buf, &endp, 0);
78 if (*endp && !isspace(*endp))
79 return -EINVAL;
80
81 h1940bt_enable(new_state);
82
83 return count;
84}
85static DEVICE_ATTR(enable, 0644,
86 h1940bt_show,
87 h1940bt_store);
88 58
89static int __init h1940bt_probe(struct platform_device *pdev) 59static int __init h1940bt_probe(struct platform_device *pdev)
90{ 60{
61 struct rfkill *rfk;
62 int ret = 0;
63
91 /* Configures BT serial port GPIOs */ 64 /* Configures BT serial port GPIOs */
92 s3c2410_gpio_cfgpin(S3C2410_GPH(0), S3C2410_GPH0_nCTS0); 65 s3c2410_gpio_cfgpin(S3C2410_GPH(0), S3C2410_GPH0_nCTS0);
93 s3c2410_gpio_pullup(S3C2410_GPH(0), 1); 66 s3c2410_gpio_pullup(S3C2410_GPH(0), 1);
@@ -98,21 +71,44 @@ static int __init h1940bt_probe(struct platform_device *pdev)
98 s3c2410_gpio_cfgpin(S3C2410_GPH(3), S3C2410_GPH3_RXD0); 71 s3c2410_gpio_cfgpin(S3C2410_GPH(3), S3C2410_GPH3_RXD0);
99 s3c2410_gpio_pullup(S3C2410_GPH(3), 1); 72 s3c2410_gpio_pullup(S3C2410_GPH(3), 1);
100 73
101#ifdef CONFIG_LEDS_H1940
102 led_trigger_register_simple("h1940-bluetooth", &bt_led_trigger);
103#endif
104 74
105 /* disable BT by default */ 75 rfk = rfkill_alloc(DRV_NAME, &pdev->dev, RFKILL_TYPE_BLUETOOTH,
106 h1940bt_enable(0); 76 &h1940bt_rfkill_ops, NULL);
77 if (!rfk) {
78 ret = -ENOMEM;
79 goto err_rfk_alloc;
80 }
81
82 rfkill_set_led_trigger_name(rfk, "h1940-bluetooth");
83
84 ret = rfkill_register(rfk);
85 if (ret)
86 goto err_rfkill;
87
88 platform_set_drvdata(pdev, rfk);
89
90 return 0;
107 91
108 return device_create_file(&pdev->dev, &dev_attr_enable); 92err_rfkill:
93 rfkill_destroy(rfk);
94err_rfk_alloc:
95 return ret;
109} 96}
110 97
111static int h1940bt_remove(struct platform_device *pdev) 98static int h1940bt_remove(struct platform_device *pdev)
112{ 99{
113#ifdef CONFIG_LEDS_H1940 100 struct rfkill *rfk = platform_get_drvdata(pdev);
114 led_trigger_unregister_simple(bt_led_trigger); 101
115#endif 102 platform_set_drvdata(pdev, NULL);
103
104 if (rfk) {
105 rfkill_unregister(rfk);
106 rfkill_destroy(rfk);
107 }
108 rfk = NULL;
109
110 h1940bt_enable(0);
111
116 return 0; 112 return 0;
117} 113}
118 114
diff --git a/arch/arm/mach-s3c2410/include/mach/bast-cpld.h b/arch/arm/mach-s3c2410/include/mach/bast-cpld.h
index 20493b048360..bee2a7a932a0 100644
--- a/arch/arm/mach-s3c2410/include/mach/bast-cpld.h
+++ b/arch/arm/mach-s3c2410/include/mach/bast-cpld.h
@@ -1,6 +1,6 @@
1/* arch/arm/mach-s3c2410/include/mach/bast-cpld.h 1/* arch/arm/mach-s3c2410/include/mach/bast-cpld.h
2 * 2 *
3 * Copyright (c) 2003,2004 Simtec Electronics 3 * Copyright (c) 2003-2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * BAST - CPLD control constants 6 * BAST - CPLD control constants
diff --git a/arch/arm/mach-s3c2410/include/mach/bast-irq.h b/arch/arm/mach-s3c2410/include/mach/bast-irq.h
index 501c202b53cf..cac428c42e7f 100644
--- a/arch/arm/mach-s3c2410/include/mach/bast-irq.h
+++ b/arch/arm/mach-s3c2410/include/mach/bast-irq.h
@@ -1,6 +1,6 @@
1/* arch/arm/mach-s3c2410/include/mach/bast-irq.h 1/* arch/arm/mach-s3c2410/include/mach/bast-irq.h
2 * 2 *
3 * Copyright (c) 2003,2004 Simtec Electronics 3 * Copyright (c) 2003-2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * Machine BAST - IRQ Number definitions 6 * Machine BAST - IRQ Number definitions
diff --git a/arch/arm/mach-s3c2410/include/mach/bast-map.h b/arch/arm/mach-s3c2410/include/mach/bast-map.h
index c2c5baf07345..6e7dc9d0cf0e 100644
--- a/arch/arm/mach-s3c2410/include/mach/bast-map.h
+++ b/arch/arm/mach-s3c2410/include/mach/bast-map.h
@@ -1,6 +1,6 @@
1/* arch/arm/mach-s3c2410/include/mach/bast-map.h 1/* arch/arm/mach-s3c2410/include/mach/bast-map.h
2 * 2 *
3 * Copyright (c) 2003,2004 Simtec Electronics 3 * Copyright (c) 2003-2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * Machine BAST - Memory map definitions 6 * Machine BAST - Memory map definitions
diff --git a/arch/arm/mach-s3c2410/include/mach/bast-pmu.h b/arch/arm/mach-s3c2410/include/mach/bast-pmu.h
index 61684cb8ce59..4c38b39b741d 100644
--- a/arch/arm/mach-s3c2410/include/mach/bast-pmu.h
+++ b/arch/arm/mach-s3c2410/include/mach/bast-pmu.h
@@ -1,6 +1,6 @@
1/* arch/arm/mach-s3c2410/include/mach/bast-pmu.h 1/* arch/arm/mach-s3c2410/include/mach/bast-pmu.h
2 * 2 *
3 * Copyright (c) 2003,2004 Simtec Electronics 3 * Copyright (c) 2003-2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * Vincent Sanders <vince@simtec.co.uk> 5 * Vincent Sanders <vince@simtec.co.uk>
6 * 6 *
diff --git a/arch/arm/mach-s3c2410/include/mach/dma.h b/arch/arm/mach-s3c2410/include/mach/dma.h
index 92e2687009ea..08ac5f96c012 100644
--- a/arch/arm/mach-s3c2410/include/mach/dma.h
+++ b/arch/arm/mach-s3c2410/include/mach/dma.h
@@ -1,6 +1,6 @@
1/* arch/arm/mach-s3c2410/include/mach/dma.h 1/* arch/arm/mach-s3c2410/include/mach/dma.h
2 * 2 *
3 * Copyright (C) 2003,2004,2006 Simtec Electronics 3 * Copyright (C) 2003-2006 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * Samsung S3C24XX DMA support 6 * Samsung S3C24XX DMA support
diff --git a/arch/arm/mach-s3c2410/include/mach/gpio-fns.h b/arch/arm/mach-s3c2410/include/mach/gpio-fns.h
index 801dff13858d..035a493952db 100644
--- a/arch/arm/mach-s3c2410/include/mach/gpio-fns.h
+++ b/arch/arm/mach-s3c2410/include/mach/gpio-fns.h
@@ -1,6 +1,6 @@
1/* arch/arm/mach-s3c2410/include/mach/gpio-fns.h 1/* arch/arm/mach-s3c2410/include/mach/gpio-fns.h
2 * 2 *
3 * Copyright (c) 2003,2009 Simtec Electronics 3 * Copyright (c) 2003-2009 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * S3C2410 - hardware 6 * S3C2410 - hardware
diff --git a/arch/arm/mach-s3c2410/include/mach/osiris-map.h b/arch/arm/mach-s3c2410/include/mach/osiris-map.h
index 639eff523d4e..17380f848428 100644
--- a/arch/arm/mach-s3c2410/include/mach/osiris-map.h
+++ b/arch/arm/mach-s3c2410/include/mach/osiris-map.h
@@ -1,6 +1,6 @@
1/* arch/arm/mach-s3c2410/include/mach/osiris-map.h 1/* arch/arm/mach-s3c2410/include/mach/osiris-map.h
2 * 2 *
3 * (c) 2005 Simtec Electronics 3 * Copyright 2005 Simtec Electronics
4 * http://www.simtec.co.uk/products/ 4 * http://www.simtec.co.uk/products/
5 * Ben Dooks <ben@simtec.co.uk> 5 * Ben Dooks <ben@simtec.co.uk>
6 * 6 *
diff --git a/arch/arm/mach-s3c2410/include/mach/regs-clock.h b/arch/arm/mach-s3c2410/include/mach/regs-clock.h
index 2a5d90e957fb..9a0d169be137 100644
--- a/arch/arm/mach-s3c2410/include/mach/regs-clock.h
+++ b/arch/arm/mach-s3c2410/include/mach/regs-clock.h
@@ -1,7 +1,7 @@
1/* arch/arm/mach-s3c2410/include/mach/regs-clock.h 1/* arch/arm/mach-s3c2410/include/mach/regs-clock.h
2 * 2 *
3 * Copyright (c) 2003,2004,2005,2006 Simtec Electronics <linux@simtec.co.uk> 3 * Copyright (c) 2003-2006 Simtec Electronics <linux@simtec.co.uk>
4 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 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 7 * it under the terms of the GNU General Public License version 2 as
diff --git a/arch/arm/mach-s3c2410/include/mach/regs-gpio.h b/arch/arm/mach-s3c2410/include/mach/regs-gpio.h
index f6e8eec879c8..ebc85c6dadbf 100644
--- a/arch/arm/mach-s3c2410/include/mach/regs-gpio.h
+++ b/arch/arm/mach-s3c2410/include/mach/regs-gpio.h
@@ -1,7 +1,7 @@
1/* arch/arm/mach-s3c2410/include/mach/regs-gpio.h 1/* arch/arm/mach-s3c2410/include/mach/regs-gpio.h
2 * 2 *
3 * Copyright (c) 2003,2004 Simtec Electronics <linux@simtec.co.uk> 3 * Copyright (c) 2003-2004 Simtec Electronics <linux@simtec.co.uk>
4 * http://www.simtec.co.uk/products/SWLINUX/ 4 * http://www.simtec.co.uk/products/SWLINUX/
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 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 7 * it under the terms of the GNU General Public License version 2 as
diff --git a/arch/arm/mach-s3c2410/include/mach/regs-power.h b/arch/arm/mach-s3c2410/include/mach/regs-power.h
index 2d36353f57d7..4932b87bdf3d 100644
--- a/arch/arm/mach-s3c2410/include/mach/regs-power.h
+++ b/arch/arm/mach-s3c2410/include/mach/regs-power.h
@@ -1,7 +1,7 @@
1/* arch/arm/mach-s3c2410/include/mach/regs-power.h 1/* arch/arm/mach-s3c2410/include/mach/regs-power.h
2 * 2 *
3 * Copyright (c) 2003,2004,2005,2006 Simtec Electronics <linux@simtec.co.uk> 3 * Copyright (c) 2003-2006 Simtec Electronics <linux@simtec.co.uk>
4 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 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 7 * it under the terms of the GNU General Public License version 2 as
diff --git a/arch/arm/mach-s3c2410/include/mach/uncompress.h b/arch/arm/mach-s3c2410/include/mach/uncompress.h
index c9432103750d..72f756c5e504 100644
--- a/arch/arm/mach-s3c2410/include/mach/uncompress.h
+++ b/arch/arm/mach-s3c2410/include/mach/uncompress.h
@@ -1,7 +1,6 @@
1
2/* arch/arm/mach-s3c2410/include/mach/uncompress.h 1/* arch/arm/mach-s3c2410/include/mach/uncompress.h
3 * 2 *
4 * Copyright (c) 2003, 2007 Simtec Electronics 3 * Copyright (c) 2003-2007 Simtec Electronics
5 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
6 * Ben Dooks <ben@simtec.co.uk> 5 * Ben Dooks <ben@simtec.co.uk>
7 * 6 *
diff --git a/arch/arm/mach-s3c2410/include/mach/vr1000-irq.h b/arch/arm/mach-s3c2410/include/mach/vr1000-irq.h
index f53f85b4ad8b..47add133b8ee 100644
--- a/arch/arm/mach-s3c2410/include/mach/vr1000-irq.h
+++ b/arch/arm/mach-s3c2410/include/mach/vr1000-irq.h
@@ -1,6 +1,6 @@
1/* arch/arm/mach-s3c2410/include/mach/vr1000-irq.h 1/* arch/arm/mach-s3c2410/include/mach/vr1000-irq.h
2 * 2 *
3 * Copyright (c) 2003,2004 Simtec Electronics 3 * Copyright (c) 2003-2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * Machine VR1000 - IRQ Number definitions 6 * Machine VR1000 - IRQ Number definitions
diff --git a/arch/arm/mach-s3c2410/mach-bast.c b/arch/arm/mach-s3c2410/mach-bast.c
index 647c9adb018f..4c79ac8a6c33 100644
--- a/arch/arm/mach-s3c2410/mach-bast.c
+++ b/arch/arm/mach-s3c2410/mach-bast.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/mach-s3c2410/mach-bast.c 1/* linux/arch/arm/mach-s3c2410/mach-bast.c
2 * 2 *
3 * Copyright (c) 2003-2005,2008 Simtec Electronics 3 * Copyright 2003-2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * http://www.simtec.co.uk/products/EB2410ITX/ 6 * http://www.simtec.co.uk/products/EB2410ITX/
@@ -61,11 +61,12 @@
61#include <plat/devs.h> 61#include <plat/devs.h>
62#include <plat/cpu.h> 62#include <plat/cpu.h>
63#include <plat/cpu-freq.h> 63#include <plat/cpu-freq.h>
64#include <plat/audio-simtec.h>
64 65
65#include "usb-simtec.h" 66#include "usb-simtec.h"
66#include "nor-simtec.h" 67#include "nor-simtec.h"
67 68
68#define COPYRIGHT ", (c) 2004-2005 Simtec Electronics" 69#define COPYRIGHT ", Copyright 2004-2008 Simtec Electronics"
69 70
70/* macros for virtual address mods for the io space entries */ 71/* macros for virtual address mods for the io space entries */
71#define VA_C5(item) ((unsigned long)(item) + BAST_VAM_CS5) 72#define VA_C5(item) ((unsigned long)(item) + BAST_VAM_CS5)
@@ -247,7 +248,7 @@ static int chip0_map[] = { 1 };
247static int chip1_map[] = { 2 }; 248static int chip1_map[] = { 2 };
248static int chip2_map[] = { 3 }; 249static int chip2_map[] = { 3 };
249 250
250static struct mtd_partition bast_default_nand_part[] = { 251static struct mtd_partition __initdata bast_default_nand_part[] = {
251 [0] = { 252 [0] = {
252 .name = "Boot Agent", 253 .name = "Boot Agent",
253 .size = SZ_16K, 254 .size = SZ_16K,
@@ -273,7 +274,7 @@ static struct mtd_partition bast_default_nand_part[] = {
273 * socket. 274 * socket.
274*/ 275*/
275 276
276static struct s3c2410_nand_set bast_nand_sets[] = { 277static struct s3c2410_nand_set __initdata bast_nand_sets[] = {
277 [0] = { 278 [0] = {
278 .name = "SmartMedia", 279 .name = "SmartMedia",
279 .nr_chips = 1, 280 .nr_chips = 1,
@@ -323,7 +324,7 @@ static void bast_nand_select(struct s3c2410_nand_set *set, int slot)
323 __raw_writeb(tmp, BAST_VA_CTRL2); 324 __raw_writeb(tmp, BAST_VA_CTRL2);
324} 325}
325 326
326static struct s3c2410_platform_nand bast_nand_info = { 327static struct s3c2410_platform_nand __initdata bast_nand_info = {
327 .tacls = 30, 328 .tacls = 30,
328 .twrph0 = 60, 329 .twrph0 = 60,
329 .twrph1 = 60, 330 .twrph1 = 60,
@@ -608,6 +609,11 @@ static struct s3c_cpufreq_board __initdata bast_cpufreq = {
608 .need_io = 1, 609 .need_io = 1,
609}; 610};
610 611
612static struct s3c24xx_audio_simtec_pdata __initdata bast_audio = {
613 .have_mic = 1,
614 .have_lout = 1,
615};
616
611static void __init bast_map_io(void) 617static void __init bast_map_io(void)
612{ 618{
613 /* initialise the clocks */ 619 /* initialise the clocks */
@@ -625,7 +631,6 @@ static void __init bast_map_io(void)
625 631
626 s3c24xx_register_clocks(bast_clocks, ARRAY_SIZE(bast_clocks)); 632 s3c24xx_register_clocks(bast_clocks, ARRAY_SIZE(bast_clocks));
627 633
628 s3c_device_nand.dev.platform_data = &bast_nand_info;
629 s3c_device_hwmon.dev.platform_data = &bast_hwmon_info; 634 s3c_device_hwmon.dev.platform_data = &bast_hwmon_info;
630 635
631 s3c24xx_init_io(bast_iodesc, ARRAY_SIZE(bast_iodesc)); 636 s3c24xx_init_io(bast_iodesc, ARRAY_SIZE(bast_iodesc));
@@ -639,6 +644,7 @@ static void __init bast_init(void)
639 sysdev_register(&bast_pm_sysdev); 644 sysdev_register(&bast_pm_sysdev);
640 645
641 s3c_i2c0_set_platdata(&bast_i2c_info); 646 s3c_i2c0_set_platdata(&bast_i2c_info);
647 s3c_nand_set_platdata(&bast_nand_info);
642 s3c24xx_fb_set_platdata(&bast_fb_info); 648 s3c24xx_fb_set_platdata(&bast_fb_info);
643 platform_add_devices(bast_devices, ARRAY_SIZE(bast_devices)); 649 platform_add_devices(bast_devices, ARRAY_SIZE(bast_devices));
644 650
@@ -647,6 +653,7 @@ static void __init bast_init(void)
647 653
648 usb_simtec_init(); 654 usb_simtec_init();
649 nor_simtec_init(); 655 nor_simtec_init();
656 simtec_audio_add(NULL, true, &bast_audio);
650 657
651 s3c_cpufreq_setboard(&bast_cpufreq); 658 s3c_cpufreq_setboard(&bast_cpufreq);
652} 659}
diff --git a/arch/arm/mach-s3c2410/mach-h1940.c b/arch/arm/mach-s3c2410/mach-h1940.c
index d9cd5ddecf4a..49053254c98d 100644
--- a/arch/arm/mach-s3c2410/mach-h1940.c
+++ b/arch/arm/mach-s3c2410/mach-h1940.c
@@ -21,6 +21,11 @@
21#include <linux/serial_core.h> 21#include <linux/serial_core.h>
22#include <linux/platform_device.h> 22#include <linux/platform_device.h>
23#include <linux/io.h> 23#include <linux/io.h>
24#include <linux/gpio.h>
25#include <linux/pwm_backlight.h>
26#include <video/platform_lcd.h>
27
28#include <linux/mmc/host.h>
24 29
25#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
26#include <asm/mach/map.h> 31#include <asm/mach/map.h>
@@ -32,9 +37,12 @@
32 37
33#include <plat/regs-serial.h> 38#include <plat/regs-serial.h>
34#include <mach/regs-lcd.h> 39#include <mach/regs-lcd.h>
35#include <mach/regs-gpio.h>
36#include <mach/regs-clock.h> 40#include <mach/regs-clock.h>
37 41
42#include <mach/regs-gpio.h>
43#include <mach/gpio-fns.h>
44#include <mach/gpio-nrs.h>
45
38#include <mach/h1940.h> 46#include <mach/h1940.h>
39#include <mach/h1940-latch.h> 47#include <mach/h1940-latch.h>
40#include <mach/fb.h> 48#include <mach/fb.h>
@@ -46,6 +54,7 @@
46#include <plat/cpu.h> 54#include <plat/cpu.h>
47#include <plat/pll.h> 55#include <plat/pll.h>
48#include <plat/pm.h> 56#include <plat/pm.h>
57#include <plat/mci.h>
49 58
50static struct map_desc h1940_iodesc[] __initdata = { 59static struct map_desc h1940_iodesc[] __initdata = {
51 [0] = { 60 [0] = {
@@ -171,16 +180,90 @@ static struct s3c2410fb_mach_info h1940_fb_info __initdata = {
171 .gpdup_mask= 0xffffffff, 180 .gpdup_mask= 0xffffffff,
172}; 181};
173 182
174static struct platform_device s3c_device_leds = { 183static struct platform_device h1940_device_leds = {
175 .name = "h1940-leds", 184 .name = "h1940-leds",
176 .id = -1, 185 .id = -1,
177}; 186};
178 187
179static struct platform_device s3c_device_bluetooth = { 188static struct platform_device h1940_device_bluetooth = {
180 .name = "h1940-bt", 189 .name = "h1940-bt",
181 .id = -1, 190 .id = -1,
182}; 191};
183 192
193static struct s3c24xx_mci_pdata h1940_mmc_cfg = {
194 .gpio_detect = S3C2410_GPF(5),
195 .gpio_wprotect = S3C2410_GPH(8),
196 .set_power = NULL,
197 .ocr_avail = MMC_VDD_32_33,
198};
199
200static int h1940_backlight_init(struct device *dev)
201{
202 gpio_request(S3C2410_GPB(0), "Backlight");
203
204 s3c2410_gpio_setpin(S3C2410_GPB(0), 0);
205 s3c2410_gpio_pullup(S3C2410_GPB(0), 0);
206 s3c2410_gpio_cfgpin(S3C2410_GPB(0), S3C2410_GPB0_TOUT0);
207
208 return 0;
209}
210
211static void h1940_backlight_exit(struct device *dev)
212{
213 s3c2410_gpio_cfgpin(S3C2410_GPB(0), 1/*S3C2410_GPB0_OUTP*/);
214}
215
216static struct platform_pwm_backlight_data backlight_data = {
217 .pwm_id = 0,
218 .max_brightness = 100,
219 .dft_brightness = 50,
220 /* tcnt = 0x31 */
221 .pwm_period_ns = 36296,
222 .init = h1940_backlight_init,
223 .exit = h1940_backlight_exit,
224};
225
226static struct platform_device h1940_backlight = {
227 .name = "pwm-backlight",
228 .dev = {
229 .parent = &s3c_device_timer[0].dev,
230 .platform_data = &backlight_data,
231 },
232 .id = -1,
233};
234
235static void h1940_lcd_power_set(struct plat_lcd_data *pd,
236 unsigned int power)
237{
238 int value;
239
240 if (!power) {
241 /* set to 3ec */
242 s3c2410_gpio_setpin(S3C2410_GPC(0), 0);
243 /* wait for 3ac */
244 do {
245 value = s3c2410_gpio_getpin(S3C2410_GPC(6));
246 } while (value);
247 /* set to 38c */
248 s3c2410_gpio_setpin(S3C2410_GPC(5), 0);
249 } else {
250 /* Set to 3ac */
251 s3c2410_gpio_setpin(S3C2410_GPC(5), 1);
252 /* Set to 3ad */
253 s3c2410_gpio_setpin(S3C2410_GPC(0), 1);
254 }
255}
256
257static struct plat_lcd_data h1940_lcd_power_data = {
258 .set_power = h1940_lcd_power_set,
259};
260
261static struct platform_device h1940_lcd_powerdev = {
262 .name = "platform-lcd",
263 .dev.parent = &s3c_device_lcd.dev,
264 .dev.platform_data = &h1940_lcd_power_data,
265};
266
184static struct platform_device *h1940_devices[] __initdata = { 267static struct platform_device *h1940_devices[] __initdata = {
185 &s3c_device_usb, 268 &s3c_device_usb,
186 &s3c_device_lcd, 269 &s3c_device_lcd,
@@ -188,8 +271,13 @@ static struct platform_device *h1940_devices[] __initdata = {
188 &s3c_device_i2c0, 271 &s3c_device_i2c0,
189 &s3c_device_iis, 272 &s3c_device_iis,
190 &s3c_device_usbgadget, 273 &s3c_device_usbgadget,
191 &s3c_device_leds, 274 &h1940_device_leds,
192 &s3c_device_bluetooth, 275 &h1940_device_bluetooth,
276 &s3c_device_sdi,
277 &s3c_device_rtc,
278 &s3c_device_timer[0],
279 &h1940_backlight,
280 &h1940_lcd_powerdev,
193}; 281};
194 282
195static void __init h1940_map_io(void) 283static void __init h1940_map_io(void)
@@ -219,6 +307,8 @@ static void __init h1940_init(void)
219 s3c24xx_udc_set_platdata(&h1940_udc_cfg); 307 s3c24xx_udc_set_platdata(&h1940_udc_cfg);
220 s3c_i2c0_set_platdata(NULL); 308 s3c_i2c0_set_platdata(NULL);
221 309
310 s3c_device_sdi.dev.platform_data = &h1940_mmc_cfg;
311
222 /* Turn off suspend on both USB ports, and switch the 312 /* Turn off suspend on both USB ports, and switch the
223 * selectable USB port to USB device mode. */ 313 * selectable USB port to USB device mode. */
224 314
@@ -231,6 +321,11 @@ static void __init h1940_init(void)
231 | (0x03 << S3C24XX_PLLCON_SDIVSHIFT); 321 | (0x03 << S3C24XX_PLLCON_SDIVSHIFT);
232 writel(tmp, S3C2410_UPLLCON); 322 writel(tmp, S3C2410_UPLLCON);
233 323
324 gpio_request(S3C2410_GPC(0), "LCD power");
325 gpio_request(S3C2410_GPC(5), "LCD power");
326 gpio_request(S3C2410_GPC(6), "LCD power");
327
328
234 platform_add_devices(h1940_devices, ARRAY_SIZE(h1940_devices)); 329 platform_add_devices(h1940_devices, ARRAY_SIZE(h1940_devices));
235} 330}
236 331
diff --git a/arch/arm/mach-s3c2410/mach-n30.c b/arch/arm/mach-s3c2410/mach-n30.c
index 0f6ed61af415..0405712c2263 100644
--- a/arch/arm/mach-s3c2410/mach-n30.c
+++ b/arch/arm/mach-s3c2410/mach-n30.c
@@ -338,7 +338,7 @@ static struct platform_device *n35_devices[] __initdata = {
338 &n35_button_device, 338 &n35_button_device,
339}; 339};
340 340
341static struct s3c2410_platform_i2c n30_i2ccfg = { 341static struct s3c2410_platform_i2c __initdata n30_i2ccfg = {
342 .flags = 0, 342 .flags = 0,
343 .slave_addr = 0x10, 343 .slave_addr = 0x10,
344 .frequency = 10*1000, 344 .frequency = 10*1000,
@@ -500,8 +500,8 @@ static void __init n30_init_irq(void)
500static void __init n30_init(void) 500static void __init n30_init(void)
501{ 501{
502 s3c24xx_fb_set_platdata(&n30_fb_info); 502 s3c24xx_fb_set_platdata(&n30_fb_info);
503 s3c_device_i2c0.dev.platform_data = &n30_i2ccfg;
504 s3c24xx_udc_set_platdata(&n30_udc_cfg); 503 s3c24xx_udc_set_platdata(&n30_udc_cfg);
504 s3c_i2c0_set_platdata(&n30_i2ccfg);
505 505
506 /* Turn off suspend on both USB ports, and switch the 506 /* Turn off suspend on both USB ports, and switch the
507 * selectable USB port to USB device mode. */ 507 * selectable USB port to USB device mode. */
diff --git a/arch/arm/mach-s3c2410/mach-qt2410.c b/arch/arm/mach-s3c2410/mach-qt2410.c
index 2cc9849eb448..ab092bcda393 100644
--- a/arch/arm/mach-s3c2410/mach-qt2410.c
+++ b/arch/arm/mach-s3c2410/mach-qt2410.c
@@ -258,7 +258,7 @@ static struct platform_device *qt2410_devices[] __initdata = {
258 &qt2410_led, 258 &qt2410_led,
259}; 259};
260 260
261static struct mtd_partition qt2410_nand_part[] = { 261static struct mtd_partition __initdata qt2410_nand_part[] = {
262 [0] = { 262 [0] = {
263 .name = "U-Boot", 263 .name = "U-Boot",
264 .size = 0x30000, 264 .size = 0x30000,
@@ -286,7 +286,7 @@ static struct mtd_partition qt2410_nand_part[] = {
286 }, 286 },
287}; 287};
288 288
289static struct s3c2410_nand_set qt2410_nand_sets[] = { 289static struct s3c2410_nand_set __initdata qt2410_nand_sets[] = {
290 [0] = { 290 [0] = {
291 .name = "NAND", 291 .name = "NAND",
292 .nr_chips = 1, 292 .nr_chips = 1,
@@ -299,7 +299,7 @@ static struct s3c2410_nand_set qt2410_nand_sets[] = {
299 * chips and beyond. 299 * chips and beyond.
300 */ 300 */
301 301
302static struct s3c2410_platform_nand qt2410_nand_info = { 302static struct s3c2410_platform_nand __initdata qt2410_nand_info = {
303 .tacls = 20, 303 .tacls = 20,
304 .twrph0 = 60, 304 .twrph0 = 60,
305 .twrph1 = 20, 305 .twrph1 = 20,
@@ -331,7 +331,7 @@ static void __init qt2410_map_io(void)
331 331
332static void __init qt2410_machine_init(void) 332static void __init qt2410_machine_init(void)
333{ 333{
334 s3c_device_nand.dev.platform_data = &qt2410_nand_info; 334 s3c_nand_set_platdata(&qt2410_nand_info);
335 335
336 switch (tft_type) { 336 switch (tft_type) {
337 case 'p': /* production */ 337 case 'p': /* production */
diff --git a/arch/arm/mach-s3c2410/mach-vr1000.c b/arch/arm/mach-s3c2410/mach-vr1000.c
index 1628cc773a2c..0d61fb577170 100644
--- a/arch/arm/mach-s3c2410/mach-vr1000.c
+++ b/arch/arm/mach-s3c2410/mach-vr1000.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/mach-s3c2410/mach-vr1000.c 1/* linux/arch/arm/mach-s3c2410/mach-vr1000.c
2 * 2 *
3 * Copyright (c) 2003-2005,2008 Simtec Electronics 3 * Copyright (c) 2003-2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * Machine support for Thorcom VR1000 board. Designed for Thorcom by 6 * Machine support for Thorcom VR1000 board. Designed for Thorcom by
@@ -49,6 +49,7 @@
49#include <plat/devs.h> 49#include <plat/devs.h>
50#include <plat/cpu.h> 50#include <plat/cpu.h>
51#include <plat/iic.h> 51#include <plat/iic.h>
52#include <plat/audio-simtec.h>
52 53
53#include "usb-simtec.h" 54#include "usb-simtec.h"
54#include "nor-simtec.h" 55#include "nor-simtec.h"
@@ -393,6 +394,7 @@ static void __init vr1000_init(void)
393 ARRAY_SIZE(vr1000_i2c_devs)); 394 ARRAY_SIZE(vr1000_i2c_devs));
394 395
395 nor_simtec_init(); 396 nor_simtec_init();
397 simtec_audio_add(NULL, true, NULL);
396} 398}
397 399
398MACHINE_START(VR1000, "Thorcom-VR1000") 400MACHINE_START(VR1000, "Thorcom-VR1000")
diff --git a/arch/arm/mach-s3c2410/pll.c b/arch/arm/mach-s3c2410/pll.c
index f178c2fd9d85..8338865e11c0 100644
--- a/arch/arm/mach-s3c2410/pll.c
+++ b/arch/arm/mach-s3c2410/pll.c
@@ -1,6 +1,6 @@
1/* arch/arm/mach-s3c2410/pll.c 1/* arch/arm/mach-s3c2410/pll.c
2 * 2 *
3 * Copyright (c) 2006,2007 Simtec Electronics 3 * Copyright (c) 2006-2007 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk> 5 * Ben Dooks <ben@simtec.co.uk>
6 * Vincent Sanders <vince@arm.linux.org.uk> 6 * Vincent Sanders <vince@arm.linux.org.uk>
diff --git a/arch/arm/mach-s3c2410/usb-simtec.c b/arch/arm/mach-s3c2410/usb-simtec.c
index 50e25fc5f8ab..6b9d0d83a6f9 100644
--- a/arch/arm/mach-s3c2410/usb-simtec.c
+++ b/arch/arm/mach-s3c2410/usb-simtec.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/mach-s3c2410/usb-simtec.c 1/* linux/arch/arm/mach-s3c2410/usb-simtec.c
2 * 2 *
3 * Copyright (c) 2004,2005 Simtec Electronics 3 * Copyright 2004-2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * http://www.simtec.co.uk/products/EB2410ITX/ 6 * http://www.simtec.co.uk/products/EB2410ITX/
@@ -108,7 +108,7 @@ int usb_simtec_init(void)
108{ 108{
109 int ret; 109 int ret;
110 110
111 printk("USB Power Control, (c) 2004 Simtec Electronics\n"); 111 printk("USB Power Control, Copyright 2004 Simtec Electronics\n");
112 112
113 ret = gpio_request(S3C2410_GPB(4), "USB power control"); 113 ret = gpio_request(S3C2410_GPB(4), "USB power control");
114 if (ret < 0) { 114 if (ret < 0) {
diff --git a/arch/arm/mach-s3c2412/mach-jive.c b/arch/arm/mach-s3c2412/mach-jive.c
index 8df506eac903..c9fa3fca486c 100644
--- a/arch/arm/mach-s3c2412/mach-jive.c
+++ b/arch/arm/mach-s3c2412/mach-jive.c
@@ -96,7 +96,7 @@ static struct s3c2410_uartcfg jive_uartcfgs[] = {
96 * 0x017d0000-0x02bd0000 : cramfs B 96 * 0x017d0000-0x02bd0000 : cramfs B
97 * 0x02bd0000-0x03fd0000 : yaffs 97 * 0x02bd0000-0x03fd0000 : yaffs
98 */ 98 */
99static struct mtd_partition jive_imageA_nand_part[] = { 99static struct mtd_partition __initdata jive_imageA_nand_part[] = {
100 100
101#ifdef CONFIG_MACH_JIVE_SHOW_BOOTLOADER 101#ifdef CONFIG_MACH_JIVE_SHOW_BOOTLOADER
102 /* Don't allow access to the bootloader from linux */ 102 /* Don't allow access to the bootloader from linux */
@@ -154,7 +154,7 @@ static struct mtd_partition jive_imageA_nand_part[] = {
154 }, 154 },
155}; 155};
156 156
157static struct mtd_partition jive_imageB_nand_part[] = { 157static struct mtd_partition __initdata jive_imageB_nand_part[] = {
158 158
159#ifdef CONFIG_MACH_JIVE_SHOW_BOOTLOADER 159#ifdef CONFIG_MACH_JIVE_SHOW_BOOTLOADER
160 /* Don't allow access to the bootloader from linux */ 160 /* Don't allow access to the bootloader from linux */
@@ -213,7 +213,7 @@ static struct mtd_partition jive_imageB_nand_part[] = {
213 }, 213 },
214}; 214};
215 215
216static struct s3c2410_nand_set jive_nand_sets[] = { 216static struct s3c2410_nand_set __initdata jive_nand_sets[] = {
217 [0] = { 217 [0] = {
218 .name = "flash", 218 .name = "flash",
219 .nr_chips = 1, 219 .nr_chips = 1,
@@ -222,7 +222,7 @@ static struct s3c2410_nand_set jive_nand_sets[] = {
222 }, 222 },
223}; 223};
224 224
225static struct s3c2410_platform_nand jive_nand_info = { 225static struct s3c2410_platform_nand __initdata jive_nand_info = {
226 /* set taken from osiris nand timings, possibly still conservative */ 226 /* set taken from osiris nand timings, possibly still conservative */
227 .tacls = 30, 227 .tacls = 30,
228 .twrph0 = 55, 228 .twrph0 = 55,
@@ -631,7 +631,8 @@ static void __init jive_machine_init(void)
631 631
632 s3c_pm_init(); 632 s3c_pm_init();
633 633
634 s3c_device_nand.dev.platform_data = &jive_nand_info; 634 /** TODO - check that this is after the cmdline option! */
635 s3c_nand_set_platdata(&jive_nand_info);
635 636
636 /* initialise the spi */ 637 /* initialise the spi */
637 638
diff --git a/arch/arm/mach-s3c2412/mach-vstms.c b/arch/arm/mach-s3c2412/mach-vstms.c
index 11e8ad49fc7b..a6ba591b26bb 100644
--- a/arch/arm/mach-s3c2412/mach-vstms.c
+++ b/arch/arm/mach-s3c2412/mach-vstms.c
@@ -76,7 +76,7 @@ static struct s3c2410_uartcfg vstms_uartcfgs[] __initdata = {
76 } 76 }
77}; 77};
78 78
79static struct mtd_partition vstms_nand_part[] = { 79static struct mtd_partition __initdata vstms_nand_part[] = {
80 [0] = { 80 [0] = {
81 .name = "Boot Agent", 81 .name = "Boot Agent",
82 .size = 0x7C000, 82 .size = 0x7C000,
@@ -99,7 +99,7 @@ static struct mtd_partition vstms_nand_part[] = {
99 }, 99 },
100}; 100};
101 101
102static struct s3c2410_nand_set vstms_nand_sets[] = { 102static struct s3c2410_nand_set __initdata vstms_nand_sets[] = {
103 [0] = { 103 [0] = {
104 .name = "NAND", 104 .name = "NAND",
105 .nr_chips = 1, 105 .nr_chips = 1,
@@ -112,7 +112,7 @@ static struct s3c2410_nand_set vstms_nand_sets[] = {
112 * chips and beyond. 112 * chips and beyond.
113*/ 113*/
114 114
115static struct s3c2410_platform_nand vstms_nand_info = { 115static struct s3c2410_platform_nand __initdata vstms_nand_info = {
116 .tacls = 20, 116 .tacls = 20,
117 .twrph0 = 60, 117 .twrph0 = 60,
118 .twrph1 = 20, 118 .twrph1 = 20,
@@ -143,8 +143,6 @@ static void __init vstms_fixup(struct machine_desc *desc,
143 143
144static void __init vstms_map_io(void) 144static void __init vstms_map_io(void)
145{ 145{
146 s3c_device_nand.dev.platform_data = &vstms_nand_info;
147
148 s3c24xx_init_io(vstms_iodesc, ARRAY_SIZE(vstms_iodesc)); 146 s3c24xx_init_io(vstms_iodesc, ARRAY_SIZE(vstms_iodesc));
149 s3c24xx_init_clocks(12000000); 147 s3c24xx_init_clocks(12000000);
150 s3c24xx_init_uarts(vstms_uartcfgs, ARRAY_SIZE(vstms_uartcfgs)); 148 s3c24xx_init_uarts(vstms_uartcfgs, ARRAY_SIZE(vstms_uartcfgs));
@@ -153,6 +151,8 @@ static void __init vstms_map_io(void)
153static void __init vstms_init(void) 151static void __init vstms_init(void)
154{ 152{
155 s3c_i2c0_set_platdata(NULL); 153 s3c_i2c0_set_platdata(NULL);
154 s3c_nand_set_platdata(&vstms_nand_info);
155
156 platform_add_devices(vstms_devices, ARRAY_SIZE(vstms_devices)); 156 platform_add_devices(vstms_devices, ARRAY_SIZE(vstms_devices));
157} 157}
158 158
diff --git a/arch/arm/mach-s3c2440/Kconfig b/arch/arm/mach-s3c2440/Kconfig
index a8b69d77571b..cf10e14b7b49 100644
--- a/arch/arm/mach-s3c2440/Kconfig
+++ b/arch/arm/mach-s3c2440/Kconfig
@@ -53,6 +53,19 @@ config MACH_OSIRIS
53 Say Y here if you are using the Simtec IM2440D20 module, also 53 Say Y here if you are using the Simtec IM2440D20 module, also
54 known as the Osiris. 54 known as the Osiris.
55 55
56config MACH_OSIRIS_DVS
57 tristate "Simtec IM2440D20 (OSIRIS) Dynamic Voltage Scaling driver"
58 depends on MACH_OSIRIS
59 select TPS65010
60 help
61 Say Y/M here if you want to have dynamic voltage scaling support
62 on the Simtec IM2440D20 (OSIRIS) module via the TPS65011.
63
64 The DVS driver alters the voltage supplied to the ARM core
65 depending on the frequency it is running at. The driver itself
66 does not do any of the frequency alteration, which is left up
67 to the cpufreq driver.
68
56config MACH_RX3715 69config MACH_RX3715
57 bool "HP iPAQ rx3715" 70 bool "HP iPAQ rx3715"
58 select CPU_S3C2440 71 select CPU_S3C2440
diff --git a/arch/arm/mach-s3c2440/Makefile b/arch/arm/mach-s3c2440/Makefile
index bfadcf684a2a..5f3224531885 100644
--- a/arch/arm/mach-s3c2440/Makefile
+++ b/arch/arm/mach-s3c2440/Makefile
@@ -23,3 +23,7 @@ obj-$(CONFIG_ARCH_S3C2440) += mach-smdk2440.o
23obj-$(CONFIG_MACH_NEXCODER_2440) += mach-nexcoder.o 23obj-$(CONFIG_MACH_NEXCODER_2440) += mach-nexcoder.o
24obj-$(CONFIG_MACH_AT2440EVB) += mach-at2440evb.o 24obj-$(CONFIG_MACH_AT2440EVB) += mach-at2440evb.o
25obj-$(CONFIG_MACH_MINI2440) += mach-mini2440.o 25obj-$(CONFIG_MACH_MINI2440) += mach-mini2440.o
26
27# extra machine support
28
29obj-$(CONFIG_MACH_OSIRIS_DVS) += mach-osiris-dvs.o
diff --git a/arch/arm/mach-s3c2440/irq.c b/arch/arm/mach-s3c2440/irq.c
index 63c5ab65727f..0c049b95c378 100644
--- a/arch/arm/mach-s3c2440/irq.c
+++ b/arch/arm/mach-s3c2440/irq.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/mach-s3c2440/irq.c 1/* linux/arch/arm/mach-s3c2440/irq.c
2 * 2 *
3 * Copyright (c) 2003,2004 Simtec Electronics 3 * Copyright (c) 2003-2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
diff --git a/arch/arm/mach-s3c2440/mach-anubis.c b/arch/arm/mach-s3c2440/mach-anubis.c
index 68f3870991bf..62a4c3eba97f 100644
--- a/arch/arm/mach-s3c2440/mach-anubis.c
+++ b/arch/arm/mach-s3c2440/mach-anubis.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/mach-s3c2440/mach-anubis.c 1/* linux/arch/arm/mach-s3c2440/mach-anubis.c
2 * 2 *
3 * Copyright (c) 2003-2005,2008 Simtec Electronics 3 * Copyright 2003-2009 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk> 5 * Ben Dooks <ben@simtec.co.uk>
6 * 6 *
@@ -53,8 +53,9 @@
53#include <plat/clock.h> 53#include <plat/clock.h>
54#include <plat/devs.h> 54#include <plat/devs.h>
55#include <plat/cpu.h> 55#include <plat/cpu.h>
56#include <plat/audio-simtec.h>
56 57
57#define COPYRIGHT ", (c) 2005 Simtec Electronics" 58#define COPYRIGHT ", Copyright 2005-2009 Simtec Electronics"
58 59
59static struct map_desc anubis_iodesc[] __initdata = { 60static struct map_desc anubis_iodesc[] __initdata = {
60 /* ISA IO areas */ 61 /* ISA IO areas */
@@ -138,7 +139,7 @@ static int external_map[] = { 2 };
138static int chip0_map[] = { 0 }; 139static int chip0_map[] = { 0 };
139static int chip1_map[] = { 1 }; 140static int chip1_map[] = { 1 };
140 141
141static struct mtd_partition anubis_default_nand_part[] = { 142static struct mtd_partition __initdata anubis_default_nand_part[] = {
142 [0] = { 143 [0] = {
143 .name = "Boot Agent", 144 .name = "Boot Agent",
144 .size = SZ_16K, 145 .size = SZ_16K,
@@ -161,7 +162,7 @@ static struct mtd_partition anubis_default_nand_part[] = {
161 } 162 }
162}; 163};
163 164
164static struct mtd_partition anubis_default_nand_part_large[] = { 165static struct mtd_partition __initdata anubis_default_nand_part_large[] = {
165 [0] = { 166 [0] = {
166 .name = "Boot Agent", 167 .name = "Boot Agent",
167 .size = SZ_128K, 168 .size = SZ_128K,
@@ -191,7 +192,7 @@ static struct mtd_partition anubis_default_nand_part_large[] = {
191 * socket. 192 * socket.
192*/ 193*/
193 194
194static struct s3c2410_nand_set anubis_nand_sets[] = { 195static struct s3c2410_nand_set __initdata anubis_nand_sets[] = {
195 [1] = { 196 [1] = {
196 .name = "External", 197 .name = "External",
197 .nr_chips = 1, 198 .nr_chips = 1,
@@ -233,7 +234,7 @@ static void anubis_nand_select(struct s3c2410_nand_set *set, int slot)
233 __raw_writeb(tmp, ANUBIS_VA_CTRL1); 234 __raw_writeb(tmp, ANUBIS_VA_CTRL1);
234} 235}
235 236
236static struct s3c2410_platform_nand anubis_nand_info = { 237static struct s3c2410_platform_nand __initdata anubis_nand_info = {
237 .tacls = 25, 238 .tacls = 25,
238 .twrph0 = 55, 239 .twrph0 = 55,
239 .twrph1 = 40, 240 .twrph1 = 40,
@@ -437,6 +438,17 @@ static struct i2c_board_info anubis_i2c_devs[] __initdata = {
437 } 438 }
438}; 439};
439 440
441/* Audio setup */
442static struct s3c24xx_audio_simtec_pdata __initdata anubis_audio = {
443 .have_mic = 1,
444 .have_lout = 1,
445 .output_cdclk = 1,
446 .use_mpllin = 1,
447 .amp_gpio = S3C2410_GPB(2),
448 .amp_gain[0] = S3C2410_GPD(10),
449 .amp_gain[1] = S3C2410_GPD(11),
450};
451
440static void __init anubis_map_io(void) 452static void __init anubis_map_io(void)
441{ 453{
442 /* initialise the clocks */ 454 /* initialise the clocks */
@@ -454,8 +466,6 @@ static void __init anubis_map_io(void)
454 466
455 s3c24xx_register_clocks(anubis_clocks, ARRAY_SIZE(anubis_clocks)); 467 s3c24xx_register_clocks(anubis_clocks, ARRAY_SIZE(anubis_clocks));
456 468
457 s3c_device_nand.dev.platform_data = &anubis_nand_info;
458
459 s3c24xx_init_io(anubis_iodesc, ARRAY_SIZE(anubis_iodesc)); 469 s3c24xx_init_io(anubis_iodesc, ARRAY_SIZE(anubis_iodesc));
460 s3c24xx_init_clocks(0); 470 s3c24xx_init_clocks(0);
461 s3c24xx_init_uarts(anubis_uartcfgs, ARRAY_SIZE(anubis_uartcfgs)); 471 s3c24xx_init_uarts(anubis_uartcfgs, ARRAY_SIZE(anubis_uartcfgs));
@@ -476,6 +486,9 @@ static void __init anubis_map_io(void)
476static void __init anubis_init(void) 486static void __init anubis_init(void)
477{ 487{
478 s3c_i2c0_set_platdata(NULL); 488 s3c_i2c0_set_platdata(NULL);
489 s3c_nand_set_platdata(&anubis_nand_info);
490 simtec_audio_add(NULL, false, &anubis_audio);
491
479 platform_add_devices(anubis_devices, ARRAY_SIZE(anubis_devices)); 492 platform_add_devices(anubis_devices, ARRAY_SIZE(anubis_devices));
480 493
481 i2c_register_board_info(0, anubis_i2c_devs, 494 i2c_register_board_info(0, anubis_i2c_devs,
diff --git a/arch/arm/mach-s3c2440/mach-at2440evb.c b/arch/arm/mach-s3c2440/mach-at2440evb.c
index dfc7010935da..aa69290e04c6 100644
--- a/arch/arm/mach-s3c2440/mach-at2440evb.c
+++ b/arch/arm/mach-s3c2440/mach-at2440evb.c
@@ -96,7 +96,7 @@ static struct s3c2410_uartcfg at2440evb_uartcfgs[] __initdata = {
96 96
97/* NAND Flash on AT2440EVB board */ 97/* NAND Flash on AT2440EVB board */
98 98
99static struct mtd_partition at2440evb_default_nand_part[] = { 99static struct mtd_partition __initdata at2440evb_default_nand_part[] = {
100 [0] = { 100 [0] = {
101 .name = "Boot Agent", 101 .name = "Boot Agent",
102 .size = SZ_256K, 102 .size = SZ_256K,
@@ -114,7 +114,7 @@ static struct mtd_partition at2440evb_default_nand_part[] = {
114 }, 114 },
115}; 115};
116 116
117static struct s3c2410_nand_set at2440evb_nand_sets[] = { 117static struct s3c2410_nand_set __initdata at2440evb_nand_sets[] = {
118 [0] = { 118 [0] = {
119 .name = "nand", 119 .name = "nand",
120 .nr_chips = 1, 120 .nr_chips = 1,
@@ -123,7 +123,7 @@ static struct s3c2410_nand_set at2440evb_nand_sets[] = {
123 }, 123 },
124}; 124};
125 125
126static struct s3c2410_platform_nand at2440evb_nand_info = { 126static struct s3c2410_platform_nand __initdata at2440evb_nand_info = {
127 .tacls = 25, 127 .tacls = 25,
128 .twrph0 = 55, 128 .twrph0 = 55,
129 .twrph1 = 40, 129 .twrph1 = 40,
@@ -216,8 +216,6 @@ static struct platform_device *at2440evb_devices[] __initdata = {
216 216
217static void __init at2440evb_map_io(void) 217static void __init at2440evb_map_io(void)
218{ 218{
219 s3c_device_nand.dev.platform_data = &at2440evb_nand_info;
220 s3c_device_sdi.name = "s3c2440-sdi";
221 s3c_device_sdi.dev.platform_data = &at2440evb_mci_pdata; 219 s3c_device_sdi.dev.platform_data = &at2440evb_mci_pdata;
222 220
223 s3c24xx_init_io(at2440evb_iodesc, ARRAY_SIZE(at2440evb_iodesc)); 221 s3c24xx_init_io(at2440evb_iodesc, ARRAY_SIZE(at2440evb_iodesc));
@@ -228,6 +226,7 @@ static void __init at2440evb_map_io(void)
228static void __init at2440evb_init(void) 226static void __init at2440evb_init(void)
229{ 227{
230 s3c24xx_fb_set_platdata(&at2440evb_fb_info); 228 s3c24xx_fb_set_platdata(&at2440evb_fb_info);
229 s3c_nand_set_platdata(&at2440evb_nand_info);
231 s3c_i2c0_set_platdata(NULL); 230 s3c_i2c0_set_platdata(NULL);
232 231
233 platform_add_devices(at2440evb_devices, ARRAY_SIZE(at2440evb_devices)); 232 platform_add_devices(at2440evb_devices, ARRAY_SIZE(at2440evb_devices));
diff --git a/arch/arm/mach-s3c2440/mach-mini2440.c b/arch/arm/mach-s3c2440/mach-mini2440.c
index 1c3382fefdd2..547d4fc99131 100644
--- a/arch/arm/mach-s3c2440/mach-mini2440.c
+++ b/arch/arm/mach-s3c2440/mach-mini2440.c
@@ -532,7 +532,6 @@ static void __init mini2440_map_io(void)
532 s3c24xx_init_clocks(12000000); 532 s3c24xx_init_clocks(12000000);
533 s3c24xx_init_uarts(mini2440_uartcfgs, ARRAY_SIZE(mini2440_uartcfgs)); 533 s3c24xx_init_uarts(mini2440_uartcfgs, ARRAY_SIZE(mini2440_uartcfgs));
534 534
535 s3c_device_nand.dev.platform_data = &mini2440_nand_info;
536 s3c_device_sdi.dev.platform_data = &mini2440_mmc_cfg; 535 s3c_device_sdi.dev.platform_data = &mini2440_mmc_cfg;
537} 536}
538 537
@@ -677,8 +676,11 @@ static void __init mini2440_init(void)
677 printk("\n"); 676 printk("\n");
678 s3c24xx_fb_set_platdata(&mini2440_fb_info); 677 s3c24xx_fb_set_platdata(&mini2440_fb_info);
679 } 678 }
679
680 s3c24xx_udc_set_platdata(&mini2440_udc_cfg); 680 s3c24xx_udc_set_platdata(&mini2440_udc_cfg);
681 s3c_nand_set_platdata(&mini2440_nand_info);
681 s3c_i2c0_set_platdata(NULL); 682 s3c_i2c0_set_platdata(NULL);
683
682 i2c_register_board_info(0, mini2440_i2c_devs, 684 i2c_register_board_info(0, mini2440_i2c_devs,
683 ARRAY_SIZE(mini2440_i2c_devs)); 685 ARRAY_SIZE(mini2440_i2c_devs));
684 686
diff --git a/arch/arm/mach-s3c2440/mach-osiris-dvs.c b/arch/arm/mach-s3c2440/mach-osiris-dvs.c
new file mode 100644
index 000000000000..ad2792dfbee1
--- /dev/null
+++ b/arch/arm/mach-s3c2440/mach-osiris-dvs.c
@@ -0,0 +1,194 @@
1/* linux/arch/arm/mach-s3c2440/mach-osiris-dvs.c
2 *
3 * Copyright (c) 2009 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * Simtec Osiris Dynamic Voltage Scaling support.
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 version 2 as
11 * published by the Free Software Foundation.
12*/
13
14#include <linux/kernel.h>
15#include <linux/module.h>
16#include <linux/platform_device.h>
17#include <linux/cpufreq.h>
18#include <linux/gpio.h>
19
20#include <linux/i2c/tps65010.h>
21
22#include <plat/cpu-freq.h>
23
24#define OSIRIS_GPIO_DVS S3C2410_GPB(5)
25
26static bool dvs_en;
27
28static void osiris_dvs_tps_setdvs(bool on)
29{
30 unsigned vregs1 = 0, vdcdc2 = 0;
31
32 if (!on) {
33 vdcdc2 = TPS_VCORE_DISCH | TPS_LP_COREOFF;
34 vregs1 = TPS_LDO1_OFF; /* turn off in low-power mode */
35 }
36
37 dvs_en = on;
38 vdcdc2 |= TPS_VCORE_1_3V | TPS_VCORE_LP_1_0V;
39 vregs1 |= TPS_LDO2_ENABLE | TPS_LDO1_ENABLE;
40
41 tps65010_config_vregs1(vregs1);
42 tps65010_config_vdcdc2(vdcdc2);
43}
44
45static bool is_dvs(struct s3c_freq *f)
46{
47 /* at the moment, we assume ARMCLK = HCLK => DVS */
48 return f->armclk == f->hclk;
49}
50
51/* keep track of current state */
52static bool cur_dvs = false;
53
54static int osiris_dvs_notify(struct notifier_block *nb,
55 unsigned long val, void *data)
56{
57 struct cpufreq_freqs *cf = data;
58 struct s3c_cpufreq_freqs *freqs = to_s3c_cpufreq(cf);
59 bool old_dvs = is_dvs(&freqs->old);
60 bool new_dvs = is_dvs(&freqs->new);
61 int ret = 0;
62
63 if (!dvs_en)
64 return 0;
65
66 printk(KERN_DEBUG "%s: old %ld,%ld new %ld,%ld\n", __func__,
67 freqs->old.armclk, freqs->old.hclk,
68 freqs->new.armclk, freqs->new.hclk);
69
70 switch (val) {
71 case CPUFREQ_PRECHANGE:
72 if (old_dvs & !new_dvs ||
73 cur_dvs & !new_dvs) {
74 pr_debug("%s: exiting dvs\n", __func__);
75 cur_dvs = false;
76 gpio_set_value(OSIRIS_GPIO_DVS, 1);
77 }
78 break;
79 case CPUFREQ_POSTCHANGE:
80 if (!old_dvs & new_dvs ||
81 !cur_dvs & new_dvs) {
82 pr_debug("entering dvs\n");
83 cur_dvs = true;
84 gpio_set_value(OSIRIS_GPIO_DVS, 0);
85 }
86 break;
87 }
88
89 return ret;
90}
91
92static struct notifier_block osiris_dvs_nb = {
93 .notifier_call = osiris_dvs_notify,
94};
95
96static int __devinit osiris_dvs_probe(struct platform_device *pdev)
97{
98 int ret;
99
100 dev_info(&pdev->dev, "initialising\n");
101
102 ret = gpio_request(OSIRIS_GPIO_DVS, "osiris-dvs");
103 if (ret) {
104 dev_err(&pdev->dev, "cannot claim gpio\n");
105 goto err_nogpio;
106 }
107
108 /* start with dvs disabled */
109 gpio_direction_output(OSIRIS_GPIO_DVS, 1);
110
111 ret = cpufreq_register_notifier(&osiris_dvs_nb,
112 CPUFREQ_TRANSITION_NOTIFIER);
113 if (ret) {
114 dev_err(&pdev->dev, "failed to register with cpufreq\n");
115 goto err_nofreq;
116 }
117
118 osiris_dvs_tps_setdvs(true);
119
120 return 0;
121
122err_nofreq:
123 gpio_free(OSIRIS_GPIO_DVS);
124
125err_nogpio:
126 return ret;
127}
128
129static int __devexit osiris_dvs_remove(struct platform_device *pdev)
130{
131 dev_info(&pdev->dev, "exiting\n");
132
133 /* disable any current dvs */
134 gpio_set_value(OSIRIS_GPIO_DVS, 1);
135 osiris_dvs_tps_setdvs(false);
136
137 cpufreq_unregister_notifier(&osiris_dvs_nb,
138 CPUFREQ_TRANSITION_NOTIFIER);
139
140 gpio_free(OSIRIS_GPIO_DVS);
141
142 return 0;
143}
144
145/* the CONFIG_PM block is so small, it isn't worth actaully compiling it
146 * out if the configuration isn't set. */
147
148static int osiris_dvs_suspend(struct device *dev)
149{
150 gpio_set_value(OSIRIS_GPIO_DVS, 1);
151 osiris_dvs_tps_setdvs(false);
152 cur_dvs = false;
153
154 return 0;
155}
156
157static int osiris_dvs_resume(struct device *dev)
158{
159 osiris_dvs_tps_setdvs(true);
160 return 0;
161}
162
163static const struct dev_pm_ops osiris_dvs_pm = {
164 .suspend = osiris_dvs_suspend,
165 .resume = osiris_dvs_resume,
166};
167
168static struct platform_driver osiris_dvs_driver = {
169 .probe = osiris_dvs_probe,
170 .remove = __devexit_p(osiris_dvs_remove),
171 .driver = {
172 .name = "osiris-dvs",
173 .owner = THIS_MODULE,
174 .pm = &osiris_dvs_pm,
175 },
176};
177
178static int __init osiris_dvs_init(void)
179{
180 return platform_driver_register(&osiris_dvs_driver);
181}
182
183static void __exit osiris_dvs_exit(void)
184{
185 platform_driver_unregister(&osiris_dvs_driver);
186}
187
188module_init(osiris_dvs_init);
189module_exit(osiris_dvs_exit);
190
191MODULE_DESCRIPTION("Simtec OSIRIS DVS support");
192MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>");
193MODULE_LICENSE("GPL");
194MODULE_ALIAS("platform:osiris-dvs");
diff --git a/arch/arm/mach-s3c2440/mach-osiris.c b/arch/arm/mach-s3c2440/mach-osiris.c
index 2105a41281a4..015dfb2a80da 100644
--- a/arch/arm/mach-s3c2440/mach-osiris.c
+++ b/arch/arm/mach-s3c2440/mach-osiris.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/mach-s3c2440/mach-osiris.c 1/* linux/arch/arm/mach-s3c2440/mach-osiris.c
2 * 2 *
3 * Copyright (c) 2005,2008 Simtec Electronics 3 * Copyright (c) 2005-2008 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk> 5 * Ben Dooks <ben@simtec.co.uk>
6 * 6 *
@@ -23,6 +23,8 @@
23#include <linux/i2c.h> 23#include <linux/i2c.h>
24#include <linux/io.h> 24#include <linux/io.h>
25 25
26#include <linux/i2c/tps65010.h>
27
26#include <asm/mach/arch.h> 28#include <asm/mach/arch.h>
27#include <asm/mach/map.h> 29#include <asm/mach/map.h>
28#include <asm/mach/irq.h> 30#include <asm/mach/irq.h>
@@ -148,7 +150,7 @@ static int external_map[] = { 2 };
148static int chip0_map[] = { 0 }; 150static int chip0_map[] = { 0 };
149static int chip1_map[] = { 1 }; 151static int chip1_map[] = { 1 };
150 152
151static struct mtd_partition osiris_default_nand_part[] = { 153static struct mtd_partition __initdata osiris_default_nand_part[] = {
152 [0] = { 154 [0] = {
153 .name = "Boot Agent", 155 .name = "Boot Agent",
154 .size = SZ_16K, 156 .size = SZ_16K,
@@ -171,7 +173,7 @@ static struct mtd_partition osiris_default_nand_part[] = {
171 } 173 }
172}; 174};
173 175
174static struct mtd_partition osiris_default_nand_part_large[] = { 176static struct mtd_partition __initdata osiris_default_nand_part_large[] = {
175 [0] = { 177 [0] = {
176 .name = "Boot Agent", 178 .name = "Boot Agent",
177 .size = SZ_128K, 179 .size = SZ_128K,
@@ -201,7 +203,7 @@ static struct mtd_partition osiris_default_nand_part_large[] = {
201 * socket. 203 * socket.
202*/ 204*/
203 205
204static struct s3c2410_nand_set osiris_nand_sets[] = { 206static struct s3c2410_nand_set __initdata osiris_nand_sets[] = {
205 [1] = { 207 [1] = {
206 .name = "External", 208 .name = "External",
207 .nr_chips = 1, 209 .nr_chips = 1,
@@ -243,7 +245,7 @@ static void osiris_nand_select(struct s3c2410_nand_set *set, int slot)
243 __raw_writeb(tmp, OSIRIS_VA_CTRL0); 245 __raw_writeb(tmp, OSIRIS_VA_CTRL0);
244} 246}
245 247
246static struct s3c2410_platform_nand osiris_nand_info = { 248static struct s3c2410_platform_nand __initdata osiris_nand_info = {
247 .tacls = 25, 249 .tacls = 25,
248 .twrph0 = 60, 250 .twrph0 = 60,
249 .twrph1 = 60, 251 .twrph1 = 60,
@@ -326,12 +328,44 @@ static struct sys_device osiris_pm_sysdev = {
326 .cls = &osiris_pm_sysclass, 328 .cls = &osiris_pm_sysclass,
327}; 329};
328 330
331/* Link for DVS driver to TPS65011 */
332
333static void osiris_tps_release(struct device *dev)
334{
335 /* static device, do not need to release anything */
336}
337
338static struct platform_device osiris_tps_device = {
339 .name = "osiris-dvs",
340 .id = -1,
341 .dev.release = osiris_tps_release,
342};
343
344static int osiris_tps_setup(struct i2c_client *client, void *context)
345{
346 osiris_tps_device.dev.parent = &client->dev;
347 return platform_device_register(&osiris_tps_device);
348}
349
350static int osiris_tps_remove(struct i2c_client *client, void *context)
351{
352 platform_device_unregister(&osiris_tps_device);
353 return 0;
354}
355
356static struct tps65010_board osiris_tps_board = {
357 .base = -1, /* GPIO can go anywhere at the moment */
358 .setup = osiris_tps_setup,
359 .teardown = osiris_tps_remove,
360};
361
329/* I2C devices fitted. */ 362/* I2C devices fitted. */
330 363
331static struct i2c_board_info osiris_i2c_devs[] __initdata = { 364static struct i2c_board_info osiris_i2c_devs[] __initdata = {
332 { 365 {
333 I2C_BOARD_INFO("tps65011", 0x48), 366 I2C_BOARD_INFO("tps65011", 0x48),
334 .irq = IRQ_EINT20, 367 .irq = IRQ_EINT20,
368 .platform_data = &osiris_tps_board,
335 }, 369 },
336}; 370};
337 371
@@ -377,8 +411,6 @@ static void __init osiris_map_io(void)
377 411
378 s3c24xx_register_clocks(osiris_clocks, ARRAY_SIZE(osiris_clocks)); 412 s3c24xx_register_clocks(osiris_clocks, ARRAY_SIZE(osiris_clocks));
379 413
380 s3c_device_nand.dev.platform_data = &osiris_nand_info;
381
382 s3c24xx_init_io(osiris_iodesc, ARRAY_SIZE(osiris_iodesc)); 414 s3c24xx_init_io(osiris_iodesc, ARRAY_SIZE(osiris_iodesc));
383 s3c24xx_init_clocks(0); 415 s3c24xx_init_clocks(0);
384 s3c24xx_init_uarts(osiris_uartcfgs, ARRAY_SIZE(osiris_uartcfgs)); 416 s3c24xx_init_uarts(osiris_uartcfgs, ARRAY_SIZE(osiris_uartcfgs));
@@ -408,6 +440,7 @@ static void __init osiris_init(void)
408 sysdev_register(&osiris_pm_sysdev); 440 sysdev_register(&osiris_pm_sysdev);
409 441
410 s3c_i2c0_set_platdata(NULL); 442 s3c_i2c0_set_platdata(NULL);
443 s3c_nand_set_platdata(&osiris_nand_info);
411 444
412 s3c_cpufreq_setboard(&osiris_cpufreq); 445 s3c_cpufreq_setboard(&osiris_cpufreq);
413 446
diff --git a/arch/arm/mach-s3c2440/mach-rx3715.c b/arch/arm/mach-s3c2440/mach-rx3715.c
index bc8d8d1ebd1a..a952a13afb1f 100644
--- a/arch/arm/mach-s3c2440/mach-rx3715.c
+++ b/arch/arm/mach-s3c2440/mach-rx3715.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/mach-s3c2440/mach-rx3715.c 1/* linux/arch/arm/mach-s3c2440/mach-rx3715.c
2 * 2 *
3 * Copyright (c) 2003,2004 Simtec Electronics 3 * Copyright (c) 2003-2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * http://www.handhelds.org/projects/rx3715.html 6 * http://www.handhelds.org/projects/rx3715.html
@@ -149,7 +149,7 @@ static struct s3c2410fb_mach_info rx3715_fb_info __initdata = {
149 .gpdup_mask = 0xffffffff, 149 .gpdup_mask = 0xffffffff,
150}; 150};
151 151
152static struct mtd_partition rx3715_nand_part[] = { 152static struct mtd_partition __initdata rx3715_nand_part[] = {
153 [0] = { 153 [0] = {
154 .name = "Whole Flash", 154 .name = "Whole Flash",
155 .offset = 0, 155 .offset = 0,
@@ -158,7 +158,7 @@ static struct mtd_partition rx3715_nand_part[] = {
158 } 158 }
159}; 159};
160 160
161static struct s3c2410_nand_set rx3715_nand_sets[] = { 161static struct s3c2410_nand_set __initdata rx3715_nand_sets[] = {
162 [0] = { 162 [0] = {
163 .name = "Internal", 163 .name = "Internal",
164 .nr_chips = 1, 164 .nr_chips = 1,
@@ -167,7 +167,7 @@ static struct s3c2410_nand_set rx3715_nand_sets[] = {
167 }, 167 },
168}; 168};
169 169
170static struct s3c2410_platform_nand rx3715_nand_info = { 170static struct s3c2410_platform_nand __initdata rx3715_nand_info = {
171 .tacls = 25, 171 .tacls = 25,
172 .twrph0 = 50, 172 .twrph0 = 50,
173 .twrph1 = 15, 173 .twrph1 = 15,
@@ -186,8 +186,6 @@ static struct platform_device *rx3715_devices[] __initdata = {
186 186
187static void __init rx3715_map_io(void) 187static void __init rx3715_map_io(void)
188{ 188{
189 s3c_device_nand.dev.platform_data = &rx3715_nand_info;
190
191 s3c24xx_init_io(rx3715_iodesc, ARRAY_SIZE(rx3715_iodesc)); 189 s3c24xx_init_io(rx3715_iodesc, ARRAY_SIZE(rx3715_iodesc));
192 s3c24xx_init_clocks(16934000); 190 s3c24xx_init_clocks(16934000);
193 s3c24xx_init_uarts(rx3715_uartcfgs, ARRAY_SIZE(rx3715_uartcfgs)); 191 s3c24xx_init_uarts(rx3715_uartcfgs, ARRAY_SIZE(rx3715_uartcfgs));
@@ -205,6 +203,7 @@ static void __init rx3715_init_machine(void)
205#endif 203#endif
206 s3c_pm_init(); 204 s3c_pm_init();
207 205
206 s3c_nand_set_platdata(&rx3715_nand_info);
208 s3c24xx_fb_set_platdata(&rx3715_fb_info); 207 s3c24xx_fb_set_platdata(&rx3715_fb_info);
209 platform_add_devices(rx3715_devices, ARRAY_SIZE(rx3715_devices)); 208 platform_add_devices(rx3715_devices, ARRAY_SIZE(rx3715_devices));
210} 209}
diff --git a/arch/arm/mach-s3c2440/mach-smdk2440.c b/arch/arm/mach-s3c2440/mach-smdk2440.c
index db6eafbd4d90..ec13e748ccc5 100644
--- a/arch/arm/mach-s3c2440/mach-smdk2440.c
+++ b/arch/arm/mach-s3c2440/mach-smdk2440.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/mach-s3c2440/mach-smdk2440.c 1/* linux/arch/arm/mach-s3c2440/mach-smdk2440.c
2 * 2 *
3 * Copyright (c) 2004,2005 Simtec Electronics 3 * Copyright (c) 2004-2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * http://www.fluff.org/ben/smdk2440/ 6 * http://www.fluff.org/ben/smdk2440/
diff --git a/arch/arm/mach-s3c2442/mach-gta02.c b/arch/arm/mach-s3c2442/mach-gta02.c
index 0fb385bd9cd9..f76d6ff4aeb9 100644
--- a/arch/arm/mach-s3c2442/mach-gta02.c
+++ b/arch/arm/mach-s3c2442/mach-gta02.c
@@ -423,7 +423,7 @@ static struct i2c_board_info gta02_i2c_devs[] __initdata = {
423 }, 423 },
424}; 424};
425 425
426static struct s3c2410_nand_set gta02_nand_sets[] = { 426static struct s3c2410_nand_set __initdata gta02_nand_sets[] = {
427 [0] = { 427 [0] = {
428 /* 428 /*
429 * This name is also hard-coded in the boot loaders, so 429 * This name is also hard-coded in the boot loaders, so
@@ -442,7 +442,7 @@ static struct s3c2410_nand_set gta02_nand_sets[] = {
442 * data sheet (K5D2G13ACM-D075 MCP Memory). 442 * data sheet (K5D2G13ACM-D075 MCP Memory).
443 */ 443 */
444 444
445static struct s3c2410_platform_nand gta02_nand_info = { 445static struct s3c2410_platform_nand __initdata gta02_nand_info = {
446 .tacls = 0, 446 .tacls = 0,
447 .twrph0 = 25, 447 .twrph0 = 25,
448 .twrph1 = 15, 448 .twrph1 = 15,
@@ -621,9 +621,9 @@ static void __init gta02_machine_init(void)
621#endif 621#endif
622 622
623 s3c_device_usb.dev.platform_data = &gta02_usb_info; 623 s3c_device_usb.dev.platform_data = &gta02_usb_info;
624 s3c_device_nand.dev.platform_data = &gta02_nand_info;
625 624
626 s3c24xx_udc_set_platdata(&gta02_udc_cfg); 625 s3c24xx_udc_set_platdata(&gta02_udc_cfg);
626 s3c_nand_set_platdata(&gta02_nand_info);
627 s3c_i2c0_set_platdata(NULL); 627 s3c_i2c0_set_platdata(NULL);
628 628
629 i2c_register_board_info(0, gta02_i2c_devs, ARRAY_SIZE(gta02_i2c_devs)); 629 i2c_register_board_info(0, gta02_i2c_devs, ARRAY_SIZE(gta02_i2c_devs));
diff --git a/arch/arm/mach-s3c24a0/include/mach/map.h b/arch/arm/mach-s3c24a0/include/mach/map.h
index 79e4d93ea2b6..d88c8b24fe34 100644
--- a/arch/arm/mach-s3c24a0/include/mach/map.h
+++ b/arch/arm/mach-s3c24a0/include/mach/map.h
@@ -1,6 +1,6 @@
1/* linux/arch/arm/mach-s3c24a0/include/mach/map.h 1/* linux/arch/arm/mach-s3c24a0/include/mach/map.h
2 * 2 *
3 * Copyright 2003,2007 Simtec Electronics 3 * Copyright 2003-2007 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk> 5 * Ben Dooks <ben@simtec.co.uk>
6 * 6 *
diff --git a/arch/arm/mach-s3c24a0/include/mach/regs-clock.h b/arch/arm/mach-s3c24a0/include/mach/regs-clock.h
index af2abd756c30..be0af518b488 100644
--- a/arch/arm/mach-s3c24a0/include/mach/regs-clock.h
+++ b/arch/arm/mach-s3c24a0/include/mach/regs-clock.h
@@ -1,7 +1,7 @@
1/* linux/arch/arm/mach-s3c24a0/include/mach/regs-clock.h 1/* linux/arch/arm/mach-s3c24a0/include/mach/regs-clock.h
2 * 2 *
3 * Copyright (c) 2003,2004,2005,2006 Simtec Electronics <linux@simtec.co.uk> 3 * Copyright (c) 2003-2006 Simtec Electronics <linux@simtec.co.uk>
4 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 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 7 * it under the terms of the GNU General Public License version 2 as
diff --git a/arch/arm/mach-s3c6400/include/mach/map.h b/arch/arm/mach-s3c6400/include/mach/map.h
index fc8b223bad4f..106ee13581e2 100644
--- a/arch/arm/mach-s3c6400/include/mach/map.h
+++ b/arch/arm/mach-s3c6400/include/mach/map.h
@@ -48,6 +48,8 @@
48#define S3C64XX_PA_IIS1 (0x7F003000) 48#define S3C64XX_PA_IIS1 (0x7F003000)
49#define S3C64XX_PA_TIMER (0x7F006000) 49#define S3C64XX_PA_TIMER (0x7F006000)
50#define S3C64XX_PA_IIC0 (0x7F004000) 50#define S3C64XX_PA_IIC0 (0x7F004000)
51#define S3C64XX_PA_PCM0 (0x7F009000)
52#define S3C64XX_PA_PCM1 (0x7F00A000)
51#define S3C64XX_PA_IISV4 (0x7F00D000) 53#define S3C64XX_PA_IISV4 (0x7F00D000)
52#define S3C64XX_PA_IIC1 (0x7F00F000) 54#define S3C64XX_PA_IIC1 (0x7F00F000)
53 55
@@ -64,6 +66,9 @@
64 66
65#define S3C64XX_PA_USBHOST (0x74300000) 67#define S3C64XX_PA_USBHOST (0x74300000)
66 68
69#define S3C64XX_PA_USB_HSPHY (0x7C100000)
70#define S3C64XX_VA_USB_HSPHY S3C_ADDR_CPU(0x00200000)
71
67/* place VICs close together */ 72/* place VICs close together */
68#define S3C_VA_VIC0 (S3C_VA_IRQ + 0x00) 73#define S3C_VA_VIC0 (S3C_VA_IRQ + 0x00)
69#define S3C_VA_VIC1 (S3C_VA_IRQ + 0x10000) 74#define S3C_VA_VIC1 (S3C_VA_IRQ + 0x10000)
@@ -79,5 +84,6 @@
79#define S3C_PA_FB S3C64XX_PA_FB 84#define S3C_PA_FB S3C64XX_PA_FB
80#define S3C_PA_USBHOST S3C64XX_PA_USBHOST 85#define S3C_PA_USBHOST S3C64XX_PA_USBHOST
81#define S3C_PA_USB_HSOTG S3C64XX_PA_USB_HSOTG 86#define S3C_PA_USB_HSOTG S3C64XX_PA_USB_HSOTG
87#define S3C_VA_USB_HSPHY S3C64XX_VA_USB_HSPHY
82 88
83#endif /* __ASM_ARCH_6400_MAP_H */ 89#endif /* __ASM_ARCH_6400_MAP_H */
diff --git a/arch/arm/mach-s3c6400/include/mach/regs-fb.h b/arch/arm/mach-s3c6400/include/mach/regs-fb.h
index 47019795ce06..f56611526c63 100644
--- a/arch/arm/mach-s3c6400/include/mach/regs-fb.h
+++ b/arch/arm/mach-s3c6400/include/mach/regs-fb.h
@@ -1,195 +1,30 @@
1/* arch/arm/mach-s3c6400/include/mach/regs-fb.h 1/*
2 *
3 * Copyright 2008 Openmoko, Inc. 2 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics 3 * Copyright 2008 Simtec Electronics
5 * http://armlinux.simtec.co.uk/ 4 * Copyright 2009 Samsung Electronics Co.
6 * Ben Dooks <ben@simtec.co.uk>
7 *
8 * S3C64XX - new-style framebuffer register definitions
9 * 5 *
10 * This is the register set for the new style framebuffer interface 6 * Pawel Osciak <p.osciak@samsung.com>
11 * found from the S3C2443 onwards and specifically the S3C64XX series 7 * Based on plat-s3c/include/plat/regs-fb.h by Ben Dooks <ben@simtec.co.uk>
12 * S3C6400 and S3C6410.
13 * 8 *
14 * The file contains the cpu specific items which change between whichever 9 * Framebuffer register definitions for Samsung S3C64xx.
15 * architecture is selected. See <plat/regs-fb.h> for the core definitions
16 * that are the same.
17 * 10 *
18 * This program is free software; you can redistribute it and/or modify 11 * This program is free software; you can redistribute it and/or modify
19 * it under the terms of the GNU General Public License version 2 as 12 * it under the terms of the GNU General Public License version 2 as
20 * published by the Free Software Foundation. 13 * published by the Free Software Foundation.
21*/ 14*/
22 15
23/* include the core definitions here, in case we really do need to 16#ifndef __ASM_ARCH_MACH_REGS_FB_H
24 * override them at a later date. 17#define __ASM_ARCH_MACH_REGS_FB_H __FILE__
25*/
26
27#include <plat/regs-fb.h>
28
29#define S3C_FB_MAX_WIN (5) /* number of hardware windows available. */
30#define VIDCON1_FSTATUS_EVEN (1 << 15)
31
32/* Video timing controls */
33#define VIDTCON0 (0x10)
34#define VIDTCON1 (0x14)
35#define VIDTCON2 (0x18)
36
37/* Window position controls */
38
39#define WINCON(_win) (0x20 + ((_win) * 4))
40
41/* OSD1 and OSD4 do not have register D */
42
43#define VIDOSD_A(_win) (0x40 + ((_win) * 16))
44#define VIDOSD_B(_win) (0x44 + ((_win) * 16))
45#define VIDOSD_C(_win) (0x48 + ((_win) * 16))
46#define VIDOSD_D(_win) (0x4C + ((_win) * 16))
47
48/* Video buffer addresses */
49
50#define VIDW_BUF_START(_buff) (0xA0 + ((_buff) * 8))
51#define VIDW_BUF_START1(_buff) (0xA4 + ((_buff) * 8))
52#define VIDW_BUF_END(_buff) (0xD0 + ((_buff) * 8))
53#define VIDW_BUF_END1(_buff) (0xD4 + ((_buff) * 8))
54#define VIDW_BUF_SIZE(_buff) (0x100 + ((_buff) * 4))
55
56#define VIDINTCON0 (0x130)
57
58#define WxKEYCONy(_win, _con) ((0x140 + ((_win) * 8)) + ((_con) * 4))
59
60/* WINCONx */
61
62#define WINCONx_CSCWIDTH_MASK (0x3 << 26)
63#define WINCONx_CSCWIDTH_SHIFT (26)
64#define WINCONx_CSCWIDTH_WIDE (0x0 << 26)
65#define WINCONx_CSCWIDTH_NARROW (0x3 << 26)
66
67#define WINCONx_ENLOCAL (1 << 22)
68#define WINCONx_BUFSTATUS (1 << 21)
69#define WINCONx_BUFSEL (1 << 20)
70#define WINCONx_BUFAUTOEN (1 << 19)
71#define WINCONx_YCbCr (1 << 13)
72
73#define WINCON1_LOCALSEL_CAMIF (1 << 23)
74
75#define WINCON2_LOCALSEL_CAMIF (1 << 23)
76#define WINCON2_BLD_PIX (1 << 6)
77
78#define WINCON2_ALPHA_SEL (1 << 1)
79#define WINCON2_BPPMODE_MASK (0xf << 2)
80#define WINCON2_BPPMODE_SHIFT (2)
81#define WINCON2_BPPMODE_1BPP (0x0 << 2)
82#define WINCON2_BPPMODE_2BPP (0x1 << 2)
83#define WINCON2_BPPMODE_4BPP (0x2 << 2)
84#define WINCON2_BPPMODE_8BPP_1232 (0x4 << 2)
85#define WINCON2_BPPMODE_16BPP_565 (0x5 << 2)
86#define WINCON2_BPPMODE_16BPP_A1555 (0x6 << 2)
87#define WINCON2_BPPMODE_16BPP_I1555 (0x7 << 2)
88#define WINCON2_BPPMODE_18BPP_666 (0x8 << 2)
89#define WINCON2_BPPMODE_18BPP_A1665 (0x9 << 2)
90#define WINCON2_BPPMODE_19BPP_A1666 (0xa << 2)
91#define WINCON2_BPPMODE_24BPP_888 (0xb << 2)
92#define WINCON2_BPPMODE_24BPP_A1887 (0xc << 2)
93#define WINCON2_BPPMODE_25BPP_A1888 (0xd << 2)
94#define WINCON2_BPPMODE_28BPP_A4888 (0xd << 2)
95
96#define WINCON3_BLD_PIX (1 << 6)
97
98#define WINCON3_ALPHA_SEL (1 << 1)
99#define WINCON3_BPPMODE_MASK (0xf << 2)
100#define WINCON3_BPPMODE_SHIFT (2)
101#define WINCON3_BPPMODE_1BPP (0x0 << 2)
102#define WINCON3_BPPMODE_2BPP (0x1 << 2)
103#define WINCON3_BPPMODE_4BPP (0x2 << 2)
104#define WINCON3_BPPMODE_16BPP_565 (0x5 << 2)
105#define WINCON3_BPPMODE_16BPP_A1555 (0x6 << 2)
106#define WINCON3_BPPMODE_16BPP_I1555 (0x7 << 2)
107#define WINCON3_BPPMODE_18BPP_666 (0x8 << 2)
108#define WINCON3_BPPMODE_18BPP_A1665 (0x9 << 2)
109#define WINCON3_BPPMODE_19BPP_A1666 (0xa << 2)
110#define WINCON3_BPPMODE_24BPP_888 (0xb << 2)
111#define WINCON3_BPPMODE_24BPP_A1887 (0xc << 2)
112#define WINCON3_BPPMODE_25BPP_A1888 (0xd << 2)
113#define WINCON3_BPPMODE_28BPP_A4888 (0xd << 2)
114
115#define VIDINTCON0_FIFIOSEL_WINDOW2 (0x10 << 5)
116#define VIDINTCON0_FIFIOSEL_WINDOW3 (0x20 << 5)
117#define VIDINTCON0_FIFIOSEL_WINDOW4 (0x40 << 5)
118
119#define DITHMODE (0x170)
120#define WINxMAP(_win) (0x180 + ((_win) * 4))
121
122
123#define DITHMODE_R_POS_MASK (0x3 << 5)
124#define DITHMODE_R_POS_SHIFT (5)
125#define DITHMODE_R_POS_8BIT (0x0 << 5)
126#define DITHMODE_R_POS_6BIT (0x1 << 5)
127#define DITHMODE_R_POS_5BIT (0x2 << 5)
128
129#define DITHMODE_G_POS_MASK (0x3 << 3)
130#define DITHMODE_G_POS_SHIFT (3)
131#define DITHMODE_G_POS_8BIT (0x0 << 3)
132#define DITHMODE_G_POS_6BIT (0x1 << 3)
133#define DITHMODE_G_POS_5BIT (0x2 << 3)
134
135#define DITHMODE_B_POS_MASK (0x3 << 1)
136#define DITHMODE_B_POS_SHIFT (1)
137#define DITHMODE_B_POS_8BIT (0x0 << 1)
138#define DITHMODE_B_POS_6BIT (0x1 << 1)
139#define DITHMODE_B_POS_5BIT (0x2 << 1)
140 18
141#define DITHMODE_DITH_EN (1 << 0) 19#include <plat/regs-fb-v4.h>
142
143#define WPALCON (0x1A0)
144
145#define WPALCON_W4PAL_16BPP_A555 (1 << 8)
146#define WPALCON_W3PAL_16BPP_A555 (1 << 7)
147#define WPALCON_W2PAL_16BPP_A555 (1 << 6)
148 20
149/* Palette registers */ 21/* Palette registers */
150
151#define WIN2_PAL(_entry) (0x300 + ((_entry) * 2)) 22#define WIN2_PAL(_entry) (0x300 + ((_entry) * 2))
152#define WIN3_PAL(_entry) (0x320 + ((_entry) * 2)) 23#define WIN3_PAL(_entry) (0x320 + ((_entry) * 2))
153#define WIN4_PAL(_entry) (0x340 + ((_entry) * 2)) 24#define WIN4_PAL(_entry) (0x340 + ((_entry) * 2))
154#define WIN0_PAL(_entry) (0x400 + ((_entry) * 4)) 25#define WIN0_PAL(_entry) (0x400 + ((_entry) * 4))
155#define WIN1_PAL(_entry) (0x800 + ((_entry) * 4)) 26#define WIN1_PAL(_entry) (0x800 + ((_entry) * 4))
156 27
157/* system specific implementation code for palette sizes, and other
158 * information that changes depending on which architecture is being
159 * compiled.
160*/
161
162/* return true if window _win has OSD register D */
163#define s3c_fb_has_osd_d(_win) ((_win) != 4 && (_win) != 0)
164
165static inline unsigned int s3c_fb_win_pal_size(unsigned int win)
166{
167 if (win < 2)
168 return 256;
169 if (win < 4)
170 return 16;
171 if (win == 4)
172 return 4;
173
174 BUG(); /* shouldn't get here */
175}
176
177static inline int s3c_fb_validate_win_bpp(unsigned int win, unsigned int bpp)
178{
179 /* all windows can do 1/2 bpp */
180
181 if ((bpp == 25 || bpp == 19) && win == 0)
182 return 0; /* win 0 does not have 19 or 25bpp modes */
183
184 if (bpp == 4 && win == 4)
185 return 0;
186
187 if (bpp == 8 && (win >= 3))
188 return 0; /* win 3/4 cannot do 8bpp in any mode */
189
190 return 1;
191}
192
193static inline unsigned int s3c_fb_pal_reg(unsigned int window, int reg) 28static inline unsigned int s3c_fb_pal_reg(unsigned int window, int reg)
194{ 29{
195 switch (window) { 30 switch (window) {
@@ -203,57 +38,4 @@ static inline unsigned int s3c_fb_pal_reg(unsigned int window, int reg)
203 BUG(); 38 BUG();
204} 39}
205 40
206static inline int s3c_fb_pal_is16(unsigned int window) 41#endif /* __ASM_ARCH_MACH_REGS_FB_H */
207{
208 return window > 1;
209}
210
211struct s3c_fb_palette {
212 struct fb_bitfield r;
213 struct fb_bitfield g;
214 struct fb_bitfield b;
215 struct fb_bitfield a;
216};
217
218static inline void s3c_fb_init_palette(unsigned int window,
219 struct s3c_fb_palette *palette)
220{
221 if (window < 2) {
222 /* Windows 0/1 are 8/8/8 or A/8/8/8 */
223 palette->r.offset = 16;
224 palette->r.length = 8;
225 palette->g.offset = 8;
226 palette->g.length = 8;
227 palette->b.offset = 0;
228 palette->b.length = 8;
229 } else {
230 /* currently we assume RGB 5/6/5 */
231 palette->r.offset = 11;
232 palette->r.length = 5;
233 palette->g.offset = 5;
234 palette->g.length = 6;
235 palette->b.offset = 0;
236 palette->b.length = 5;
237 }
238}
239
240/* Notes on per-window bpp settings
241 *
242 * Value Win0 Win1 Win2 Win3 Win 4
243 * 0000 1(P) 1(P) 1(P) 1(P) 1(P)
244 * 0001 2(P) 2(P) 2(P) 2(P) 2(P)
245 * 0010 4(P) 4(P) 4(P) 4(P) -none-
246 * 0011 8(P) 8(P) -none- -none- -none-
247 * 0100 -none- 8(A232) 8(A232) -none- -none-
248 * 0101 16(565) 16(565) 16(565) 16(565) 16(565)
249 * 0110 -none- 16(A555) 16(A555) 16(A555) 16(A555)
250 * 0111 16(I555) 16(I565) 16(I555) 16(I555) 16(I555)
251 * 1000 18(666) 18(666) 18(666) 18(666) 18(666)
252 * 1001 -none- 18(A665) 18(A665) 18(A665) 16(A665)
253 * 1010 -none- 19(A666) 19(A666) 19(A666) 19(A666)
254 * 1011 24(888) 24(888) 24(888) 24(888) 24(888)
255 * 1100 -none- 24(A887) 24(A887) 24(A887) 24(A887)
256 * 1101 -none- 25(A888) 25(A888) 25(A888) 25(A888)
257 * 1110 -none- -none- -none- -none- -none-
258 * 1111 -none- -none- -none- -none- -none-
259*/
diff --git a/arch/arm/mach-s3c6400/s3c6400.c b/arch/arm/mach-s3c6400/s3c6400.c
index b42bdd0f2138..d876ee503671 100644
--- a/arch/arm/mach-s3c6400/s3c6400.c
+++ b/arch/arm/mach-s3c6400/s3c6400.c
@@ -45,6 +45,7 @@ void __init s3c6400_map_io(void)
45 45
46 s3c6400_default_sdhci0(); 46 s3c6400_default_sdhci0();
47 s3c6400_default_sdhci1(); 47 s3c6400_default_sdhci1();
48 s3c6400_default_sdhci2();
48 49
49 /* the i2c devices are directly compatible with s3c2440 */ 50 /* the i2c devices are directly compatible with s3c2440 */
50 s3c_i2c0_setname("s3c2440-i2c"); 51 s3c_i2c0_setname("s3c2440-i2c");
diff --git a/arch/arm/mach-s3c6410/cpu.c b/arch/arm/mach-s3c6410/cpu.c
index 9b67c663d9d8..522c08691952 100644
--- a/arch/arm/mach-s3c6410/cpu.c
+++ b/arch/arm/mach-s3c6410/cpu.c
@@ -58,6 +58,7 @@ void __init s3c6410_map_io(void)
58 /* initialise device information early */ 58 /* initialise device information early */
59 s3c6410_default_sdhci0(); 59 s3c6410_default_sdhci0();
60 s3c6410_default_sdhci1(); 60 s3c6410_default_sdhci1();
61 s3c6410_default_sdhci2();
61 62
62 /* the i2c devices are directly compatible with s3c2440 */ 63 /* the i2c devices are directly compatible with s3c2440 */
63 s3c_i2c0_setname("s3c2440-i2c"); 64 s3c_i2c0_setname("s3c2440-i2c");
diff --git a/arch/arm/mach-s3c6410/mach-hmt.c b/arch/arm/mach-s3c6410/mach-hmt.c
index c5741056193f..cdd4b5378552 100644
--- a/arch/arm/mach-s3c6410/mach-hmt.c
+++ b/arch/arm/mach-s3c6410/mach-hmt.c
@@ -250,7 +250,7 @@ static void __init hmt_machine_init(void)
250{ 250{
251 s3c_i2c0_set_platdata(NULL); 251 s3c_i2c0_set_platdata(NULL);
252 s3c_fb_set_platdata(&hmt_lcd_pdata); 252 s3c_fb_set_platdata(&hmt_lcd_pdata);
253 s3c_device_nand.dev.platform_data = &hmt_nand_info; 253 s3c_nand_set_platdata(&hmt_nand_info);
254 254
255 gpio_request(S3C64XX_GPC(7), "usb power"); 255 gpio_request(S3C64XX_GPC(7), "usb power");
256 gpio_direction_output(S3C64XX_GPC(7), 0); 256 gpio_direction_output(S3C64XX_GPC(7), 0);
diff --git a/arch/arm/mach-s3c6410/mach-smdk6410.c b/arch/arm/mach-s3c6410/mach-smdk6410.c
index 9f1a21462620..480d297c1de2 100644
--- a/arch/arm/mach-s3c6410/mach-smdk6410.c
+++ b/arch/arm/mach-s3c6410/mach-smdk6410.c
@@ -25,6 +25,7 @@
25#include <linux/gpio.h> 25#include <linux/gpio.h>
26#include <linux/delay.h> 26#include <linux/delay.h>
27#include <linux/smsc911x.h> 27#include <linux/smsc911x.h>
28#include <linux/regulator/fixed.h>
28 29
29#ifdef CONFIG_SMDK6410_WM1190_EV1 30#ifdef CONFIG_SMDK6410_WM1190_EV1
30#include <linux/mfd/wm8350/core.h> 31#include <linux/mfd/wm8350/core.h>
@@ -184,6 +185,43 @@ static struct platform_device smdk6410_smsc911x = {
184 }, 185 },
185}; 186};
186 187
188#ifdef CONFIG_REGULATOR
189static struct regulator_consumer_supply smdk6410_b_pwr_5v_consumers[] = {
190 {
191 /* WM8580 */
192 .supply = "PVDD",
193 .dev_name = "0-001b",
194 },
195 {
196 /* WM8580 */
197 .supply = "AVDD",
198 .dev_name = "0-001b",
199 },
200};
201
202static struct regulator_init_data smdk6410_b_pwr_5v_data = {
203 .constraints = {
204 .always_on = 1,
205 },
206 .num_consumer_supplies = ARRAY_SIZE(smdk6410_b_pwr_5v_consumers),
207 .consumer_supplies = smdk6410_b_pwr_5v_consumers,
208};
209
210static struct fixed_voltage_config smdk6410_b_pwr_5v_pdata = {
211 .supply_name = "B_PWR_5V",
212 .microvolts = 5000000,
213 .init_data = &smdk6410_b_pwr_5v_data,
214};
215
216static struct platform_device smdk6410_b_pwr_5v = {
217 .name = "reg-fixed-voltage",
218 .id = -1,
219 .dev = {
220 .platform_data = &smdk6410_b_pwr_5v_pdata,
221 },
222};
223#endif
224
187static struct map_desc smdk6410_iodesc[] = {}; 225static struct map_desc smdk6410_iodesc[] = {};
188 226
189static struct platform_device *smdk6410_devices[] __initdata = { 227static struct platform_device *smdk6410_devices[] __initdata = {
@@ -198,6 +236,10 @@ static struct platform_device *smdk6410_devices[] __initdata = {
198 &s3c_device_fb, 236 &s3c_device_fb,
199 &s3c_device_usb, 237 &s3c_device_usb,
200 &s3c_device_usb_hsotg, 238 &s3c_device_usb_hsotg,
239
240#ifdef CONFIG_REGULATOR
241 &smdk6410_b_pwr_5v,
242#endif
201 &smdk6410_lcd_powerdev, 243 &smdk6410_lcd_powerdev,
202 244
203 &smdk6410_smsc911x, 245 &smdk6410_smsc911x,
@@ -232,6 +274,14 @@ static struct regulator_init_data wm8350_dcdc3_data = {
232}; 274};
233 275
234/* USB, EXT, PCM, ADC/DAC, USB, MMC */ 276/* USB, EXT, PCM, ADC/DAC, USB, MMC */
277static struct regulator_consumer_supply wm8350_dcdc4_consumers[] = {
278 {
279 /* WM8580 */
280 .supply = "DVDD",
281 .dev_name = "0-001b",
282 },
283};
284
235static struct regulator_init_data wm8350_dcdc4_data = { 285static struct regulator_init_data wm8350_dcdc4_data = {
236 .constraints = { 286 .constraints = {
237 .name = "PVDD_HI/PVDD_EXT/PVDD_SYS/PVCCM2MTV", 287 .name = "PVDD_HI/PVDD_EXT/PVDD_SYS/PVCCM2MTV",
@@ -239,6 +289,8 @@ static struct regulator_init_data wm8350_dcdc4_data = {
239 .max_uV = 3000000, 289 .max_uV = 3000000,
240 .always_on = 1, 290 .always_on = 1,
241 }, 291 },
292 .num_consumer_supplies = ARRAY_SIZE(wm8350_dcdc4_consumers),
293 .consumer_supplies = wm8350_dcdc4_consumers,
242}; 294};
243 295
244/* ARM core */ 296/* ARM core */
diff --git a/arch/arm/mach-s5pc100/Kconfig b/arch/arm/mach-s5pc100/Kconfig
index b1a4ba504416..0dd2b8c6eabe 100644
--- a/arch/arm/mach-s5pc100/Kconfig
+++ b/arch/arm/mach-s5pc100/Kconfig
@@ -14,9 +14,23 @@ config CPU_S5PC100
14 help 14 help
15 Enable S5PC100 CPU support 15 Enable S5PC100 CPU support
16 16
17config S5PC100_SETUP_SDHCI
18 bool
19 select S5PC1XX_SETUP_SDHCI_GPIO
20 help
21 Internal helper functions for S5PC100 based SDHCI systems
22
17config MACH_SMDKC100 23config MACH_SMDKC100
18 bool "SMDKC100" 24 bool "SMDKC100"
19 select CPU_S5PC100 25 select CPU_S5PC100
26 select S3C_DEV_FB
27 select S3C_DEV_I2C1
28 select S3C_DEV_HSMMC
29 select S3C_DEV_HSMMC1
30 select S3C_DEV_HSMMC2
31 select S5PC1XX_SETUP_I2C0
20 select S5PC1XX_SETUP_I2C1 32 select S5PC1XX_SETUP_I2C1
33 select S5PC1XX_SETUP_FB_24BPP
34 select S5PC100_SETUP_SDHCI
21 help 35 help
22 Machine support for the Samsung SMDKC100 36 Machine support for the Samsung SMDKC100
diff --git a/arch/arm/mach-s5pc100/Makefile b/arch/arm/mach-s5pc100/Makefile
index afc89b381d7a..809ff10f768f 100644
--- a/arch/arm/mach-s5pc100/Makefile
+++ b/arch/arm/mach-s5pc100/Makefile
@@ -13,5 +13,9 @@ obj- :=
13 13
14obj-$(CONFIG_CPU_S5PC100) += cpu.o 14obj-$(CONFIG_CPU_S5PC100) += cpu.o
15 15
16# Helper and device support
17
18obj-$(CONFIG_S5PC100_SETUP_SDHCI) += setup-sdhci.o
19
16# machine support 20# machine support
17obj-$(CONFIG_MACH_SMDKC100) += mach-smdkc100.o 21obj-$(CONFIG_MACH_SMDKC100) += mach-smdkc100.o
diff --git a/arch/arm/mach-s5pc100/cpu.c b/arch/arm/mach-s5pc100/cpu.c
index 0e718890da32..d79e7574a852 100644
--- a/arch/arm/mach-s5pc100/cpu.c
+++ b/arch/arm/mach-s5pc100/cpu.c
@@ -22,6 +22,8 @@
22#include <linux/serial_core.h> 22#include <linux/serial_core.h>
23#include <linux/platform_device.h> 23#include <linux/platform_device.h>
24 24
25#include <asm/proc-fns.h>
26
25#include <asm/mach/arch.h> 27#include <asm/mach/arch.h>
26#include <asm/mach/map.h> 28#include <asm/mach/map.h>
27#include <asm/mach/irq.h> 29#include <asm/mach/irq.h>
@@ -32,6 +34,7 @@
32 34
33#include <plat/cpu-freq.h> 35#include <plat/cpu-freq.h>
34#include <plat/regs-serial.h> 36#include <plat/regs-serial.h>
37#include <plat/regs-power.h>
35 38
36#include <plat/cpu.h> 39#include <plat/cpu.h>
37#include <plat/devs.h> 40#include <plat/devs.h>
@@ -45,6 +48,23 @@
45static struct map_desc s5pc100_iodesc[] __initdata = { 48static struct map_desc s5pc100_iodesc[] __initdata = {
46}; 49};
47 50
51static void s5pc100_idle(void)
52{
53 unsigned long tmp;
54
55 tmp = __raw_readl(S5PC100_PWR_CFG);
56 tmp &= ~S5PC100_PWRCFG_CFG_DEEP_IDLE;
57 tmp &= ~S5PC100_PWRCFG_CFG_WFI_MASK;
58 tmp |= S5PC100_PWRCFG_CFG_WFI_DEEP_IDLE;
59 __raw_writel(tmp, S5PC100_PWR_CFG);
60
61 tmp = __raw_readl(S5PC100_OTHERS);
62 tmp |= S5PC100_PMU_INT_DISABLE;
63 __raw_writel(tmp, S5PC100_OTHERS);
64
65 cpu_do_idle();
66}
67
48/* s5pc100_map_io 68/* s5pc100_map_io
49 * 69 *
50 * register the standard cpu IO areas 70 * register the standard cpu IO areas
@@ -55,6 +75,13 @@ void __init s5pc100_map_io(void)
55 iotable_init(s5pc100_iodesc, ARRAY_SIZE(s5pc100_iodesc)); 75 iotable_init(s5pc100_iodesc, ARRAY_SIZE(s5pc100_iodesc));
56 76
57 /* initialise device information early */ 77 /* initialise device information early */
78 s5pc100_default_sdhci0();
79 s5pc100_default_sdhci1();
80 s5pc100_default_sdhci2();
81
82 /* the i2c devices are directly compatible with s3c2440 */
83 s3c_i2c0_setname("s3c2440-i2c");
84 s3c_i2c1_setname("s3c2440-i2c");
58} 85}
59 86
60void __init s5pc100_init_clocks(int xtal) 87void __init s5pc100_init_clocks(int xtal)
@@ -93,5 +120,7 @@ int __init s5pc100_init(void)
93{ 120{
94 printk(KERN_DEBUG "S5PC100: Initialising architecture\n"); 121 printk(KERN_DEBUG "S5PC100: Initialising architecture\n");
95 122
123 s5pc1xx_idle = s5pc100_idle;
124
96 return sysdev_register(&s5pc100_sysdev); 125 return sysdev_register(&s5pc100_sysdev);
97} 126}
diff --git a/arch/arm/mach-s5pc100/include/mach/gpio.h b/arch/arm/mach-s5pc100/include/mach/gpio.h
index c74fc93d7d15..2c4cbe8ee6b7 100644
--- a/arch/arm/mach-s5pc100/include/mach/gpio.h
+++ b/arch/arm/mach-s5pc100/include/mach/gpio.h
@@ -18,40 +18,45 @@
18#define gpio_to_irq __gpio_to_irq 18#define gpio_to_irq __gpio_to_irq
19 19
20/* GPIO bank sizes */ 20/* GPIO bank sizes */
21#define S5PC1XX_GPIO_A0_NR (8) 21#define S5PC100_GPIO_A0_NR (8)
22#define S5PC1XX_GPIO_A1_NR (5) 22#define S5PC100_GPIO_A1_NR (5)
23#define S5PC1XX_GPIO_B_NR (8) 23#define S5PC100_GPIO_B_NR (8)
24#define S5PC1XX_GPIO_C_NR (5) 24#define S5PC100_GPIO_C_NR (5)
25#define S5PC1XX_GPIO_D_NR (7) 25#define S5PC100_GPIO_D_NR (7)
26#define S5PC1XX_GPIO_E0_NR (8) 26#define S5PC100_GPIO_E0_NR (8)
27#define S5PC1XX_GPIO_E1_NR (6) 27#define S5PC100_GPIO_E1_NR (6)
28#define S5PC1XX_GPIO_F0_NR (8) 28#define S5PC100_GPIO_F0_NR (8)
29#define S5PC1XX_GPIO_F1_NR (8) 29#define S5PC100_GPIO_F1_NR (8)
30#define S5PC1XX_GPIO_F2_NR (8) 30#define S5PC100_GPIO_F2_NR (8)
31#define S5PC1XX_GPIO_F3_NR (4) 31#define S5PC100_GPIO_F3_NR (4)
32#define S5PC1XX_GPIO_G0_NR (8) 32#define S5PC100_GPIO_G0_NR (8)
33#define S5PC1XX_GPIO_G1_NR (3) 33#define S5PC100_GPIO_G1_NR (3)
34#define S5PC1XX_GPIO_G2_NR (7) 34#define S5PC100_GPIO_G2_NR (7)
35#define S5PC1XX_GPIO_G3_NR (7) 35#define S5PC100_GPIO_G3_NR (7)
36#define S5PC1XX_GPIO_H0_NR (8) 36#define S5PC100_GPIO_H0_NR (8)
37#define S5PC1XX_GPIO_H1_NR (8) 37#define S5PC100_GPIO_H1_NR (8)
38#define S5PC1XX_GPIO_H2_NR (8) 38#define S5PC100_GPIO_H2_NR (8)
39#define S5PC1XX_GPIO_H3_NR (8) 39#define S5PC100_GPIO_H3_NR (8)
40#define S5PC1XX_GPIO_I_NR (8) 40#define S5PC100_GPIO_I_NR (8)
41#define S5PC1XX_GPIO_J0_NR (8) 41#define S5PC100_GPIO_J0_NR (8)
42#define S5PC1XX_GPIO_J1_NR (5) 42#define S5PC100_GPIO_J1_NR (5)
43#define S5PC1XX_GPIO_J2_NR (8) 43#define S5PC100_GPIO_J2_NR (8)
44#define S5PC1XX_GPIO_J3_NR (8) 44#define S5PC100_GPIO_J3_NR (8)
45#define S5PC1XX_GPIO_J4_NR (4) 45#define S5PC100_GPIO_J4_NR (4)
46#define S5PC1XX_GPIO_K0_NR (8) 46#define S5PC100_GPIO_K0_NR (8)
47#define S5PC1XX_GPIO_K1_NR (6) 47#define S5PC100_GPIO_K1_NR (6)
48#define S5PC1XX_GPIO_K2_NR (8) 48#define S5PC100_GPIO_K2_NR (8)
49#define S5PC1XX_GPIO_K3_NR (8) 49#define S5PC100_GPIO_K3_NR (8)
50#define S5PC1XX_GPIO_MP00_NR (8) 50#define S5PC100_GPIO_L0_NR (8)
51#define S5PC1XX_GPIO_MP01_NR (8) 51#define S5PC100_GPIO_L1_NR (8)
52#define S5PC1XX_GPIO_MP02_NR (8) 52#define S5PC100_GPIO_L2_NR (8)
53#define S5PC1XX_GPIO_MP03_NR (8) 53#define S5PC100_GPIO_L3_NR (8)
54#define S5PC1XX_GPIO_MP04_NR (5) 54#define S5PC100_GPIO_L4_NR (8)
55#define S5PC100_GPIO_MP00_NR (8)
56#define S5PC100_GPIO_MP01_NR (8)
57#define S5PC100_GPIO_MP02_NR (8)
58#define S5PC100_GPIO_MP03_NR (8)
59#define S5PC100_GPIO_MP04_NR (5)
55 60
56/* GPIO bank numbes */ 61/* GPIO bank numbes */
57 62
@@ -64,83 +69,94 @@
64 ((__gpio##_START) + (__gpio##_NR) + CONFIG_S3C_GPIO_SPACE + 1) 69 ((__gpio##_START) + (__gpio##_NR) + CONFIG_S3C_GPIO_SPACE + 1)
65 70
66enum s3c_gpio_number { 71enum s3c_gpio_number {
67 S5PC1XX_GPIO_A0_START = 0, 72 S5PC100_GPIO_A0_START = 0,
68 S5PC1XX_GPIO_A1_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_A0), 73 S5PC100_GPIO_A1_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_A0),
69 S5PC1XX_GPIO_B_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_A1), 74 S5PC100_GPIO_B_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_A1),
70 S5PC1XX_GPIO_C_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_B), 75 S5PC100_GPIO_C_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_B),
71 S5PC1XX_GPIO_D_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_C), 76 S5PC100_GPIO_D_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_C),
72 S5PC1XX_GPIO_E0_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_D), 77 S5PC100_GPIO_E0_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_D),
73 S5PC1XX_GPIO_E1_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_E0), 78 S5PC100_GPIO_E1_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_E0),
74 S5PC1XX_GPIO_F0_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_E1), 79 S5PC100_GPIO_F0_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_E1),
75 S5PC1XX_GPIO_F1_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_F0), 80 S5PC100_GPIO_F1_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_F0),
76 S5PC1XX_GPIO_F2_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_F1), 81 S5PC100_GPIO_F2_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_F1),
77 S5PC1XX_GPIO_F3_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_F2), 82 S5PC100_GPIO_F3_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_F2),
78 S5PC1XX_GPIO_G0_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_F3), 83 S5PC100_GPIO_G0_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_F3),
79 S5PC1XX_GPIO_G1_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_G0), 84 S5PC100_GPIO_G1_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_G0),
80 S5PC1XX_GPIO_G2_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_G1), 85 S5PC100_GPIO_G2_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_G1),
81 S5PC1XX_GPIO_G3_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_G2), 86 S5PC100_GPIO_G3_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_G2),
82 S5PC1XX_GPIO_H0_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_G3), 87 S5PC100_GPIO_H0_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_G3),
83 S5PC1XX_GPIO_H1_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_H0), 88 S5PC100_GPIO_H1_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_H0),
84 S5PC1XX_GPIO_H2_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_H1), 89 S5PC100_GPIO_H2_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_H1),
85 S5PC1XX_GPIO_H3_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_H2), 90 S5PC100_GPIO_H3_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_H2),
86 S5PC1XX_GPIO_I_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_H3), 91 S5PC100_GPIO_I_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_H3),
87 S5PC1XX_GPIO_J0_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_I), 92 S5PC100_GPIO_J0_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_I),
88 S5PC1XX_GPIO_J1_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_J0), 93 S5PC100_GPIO_J1_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_J0),
89 S5PC1XX_GPIO_J2_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_J1), 94 S5PC100_GPIO_J2_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_J1),
90 S5PC1XX_GPIO_J3_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_J2), 95 S5PC100_GPIO_J3_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_J2),
91 S5PC1XX_GPIO_J4_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_J3), 96 S5PC100_GPIO_J4_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_J3),
92 S5PC1XX_GPIO_K0_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_J4), 97 S5PC100_GPIO_K0_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_J4),
93 S5PC1XX_GPIO_K1_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_K0), 98 S5PC100_GPIO_K1_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_K0),
94 S5PC1XX_GPIO_K2_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_K1), 99 S5PC100_GPIO_K2_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_K1),
95 S5PC1XX_GPIO_K3_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_K2), 100 S5PC100_GPIO_K3_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_K2),
96 S5PC1XX_GPIO_MP00_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_K3), 101 S5PC100_GPIO_L0_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_K3),
97 S5PC1XX_GPIO_MP01_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_MP00), 102 S5PC100_GPIO_L1_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_L0),
98 S5PC1XX_GPIO_MP02_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_MP01), 103 S5PC100_GPIO_L2_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_L1),
99 S5PC1XX_GPIO_MP03_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_MP02), 104 S5PC100_GPIO_L3_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_L2),
100 S5PC1XX_GPIO_MP04_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_MP03), 105 S5PC100_GPIO_L4_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_L3),
106 S5PC100_GPIO_MP00_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_L4),
107 S5PC100_GPIO_MP01_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_MP00),
108 S5PC100_GPIO_MP02_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_MP01),
109 S5PC100_GPIO_MP03_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_MP02),
110 S5PC100_GPIO_MP04_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_MP03),
111 S5PC100_GPIO_END = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_MP04),
101}; 112};
102 113
103/* S5PC1XX GPIO number definitions. */ 114/* S5PC100 GPIO number definitions. */
104#define S5PC1XX_GPA0(_nr) (S5PC1XX_GPIO_A0_START + (_nr)) 115#define S5PC100_GPA0(_nr) (S5PC100_GPIO_A0_START + (_nr))
105#define S5PC1XX_GPA1(_nr) (S5PC1XX_GPIO_A1_START + (_nr)) 116#define S5PC100_GPA1(_nr) (S5PC100_GPIO_A1_START + (_nr))
106#define S5PC1XX_GPB(_nr) (S5PC1XX_GPIO_B_START + (_nr)) 117#define S5PC100_GPB(_nr) (S5PC100_GPIO_B_START + (_nr))
107#define S5PC1XX_GPC(_nr) (S5PC1XX_GPIO_C_START + (_nr)) 118#define S5PC100_GPC(_nr) (S5PC100_GPIO_C_START + (_nr))
108#define S5PC1XX_GPD(_nr) (S5PC1XX_GPIO_D_START + (_nr)) 119#define S5PC100_GPD(_nr) (S5PC100_GPIO_D_START + (_nr))
109#define S5PC1XX_GPE0(_nr) (S5PC1XX_GPIO_E0_START + (_nr)) 120#define S5PC100_GPE0(_nr) (S5PC100_GPIO_E0_START + (_nr))
110#define S5PC1XX_GPE1(_nr) (S5PC1XX_GPIO_E1_START + (_nr)) 121#define S5PC100_GPE1(_nr) (S5PC100_GPIO_E1_START + (_nr))
111#define S5PC1XX_GPF0(_nr) (S5PC1XX_GPIO_F0_START + (_nr)) 122#define S5PC100_GPF0(_nr) (S5PC100_GPIO_F0_START + (_nr))
112#define S5PC1XX_GPF1(_nr) (S5PC1XX_GPIO_F1_START + (_nr)) 123#define S5PC100_GPF1(_nr) (S5PC100_GPIO_F1_START + (_nr))
113#define S5PC1XX_GPF2(_nr) (S5PC1XX_GPIO_F2_START + (_nr)) 124#define S5PC100_GPF2(_nr) (S5PC100_GPIO_F2_START + (_nr))
114#define S5PC1XX_GPF3(_nr) (S5PC1XX_GPIO_F3_START + (_nr)) 125#define S5PC100_GPF3(_nr) (S5PC100_GPIO_F3_START + (_nr))
115#define S5PC1XX_GPG0(_nr) (S5PC1XX_GPIO_G0_START + (_nr)) 126#define S5PC100_GPG0(_nr) (S5PC100_GPIO_G0_START + (_nr))
116#define S5PC1XX_GPG1(_nr) (S5PC1XX_GPIO_G1_START + (_nr)) 127#define S5PC100_GPG1(_nr) (S5PC100_GPIO_G1_START + (_nr))
117#define S5PC1XX_GPG2(_nr) (S5PC1XX_GPIO_G2_START + (_nr)) 128#define S5PC100_GPG2(_nr) (S5PC100_GPIO_G2_START + (_nr))
118#define S5PC1XX_GPG3(_nr) (S5PC1XX_GPIO_G3_START + (_nr)) 129#define S5PC100_GPG3(_nr) (S5PC100_GPIO_G3_START + (_nr))
119#define S5PC1XX_GPH0(_nr) (S5PC1XX_GPIO_H0_START + (_nr)) 130#define S5PC100_GPH0(_nr) (S5PC100_GPIO_H0_START + (_nr))
120#define S5PC1XX_GPH1(_nr) (S5PC1XX_GPIO_H1_START + (_nr)) 131#define S5PC100_GPH1(_nr) (S5PC100_GPIO_H1_START + (_nr))
121#define S5PC1XX_GPH2(_nr) (S5PC1XX_GPIO_H2_START + (_nr)) 132#define S5PC100_GPH2(_nr) (S5PC100_GPIO_H2_START + (_nr))
122#define S5PC1XX_GPH3(_nr) (S5PC1XX_GPIO_H3_START + (_nr)) 133#define S5PC100_GPH3(_nr) (S5PC100_GPIO_H3_START + (_nr))
123#define S5PC1XX_GPI(_nr) (S5PC1XX_GPIO_I_START + (_nr)) 134#define S5PC100_GPI(_nr) (S5PC100_GPIO_I_START + (_nr))
124#define S5PC1XX_GPJ0(_nr) (S5PC1XX_GPIO_J0_START + (_nr)) 135#define S5PC100_GPJ0(_nr) (S5PC100_GPIO_J0_START + (_nr))
125#define S5PC1XX_GPJ1(_nr) (S5PC1XX_GPIO_J1_START + (_nr)) 136#define S5PC100_GPJ1(_nr) (S5PC100_GPIO_J1_START + (_nr))
126#define S5PC1XX_GPJ2(_nr) (S5PC1XX_GPIO_J2_START + (_nr)) 137#define S5PC100_GPJ2(_nr) (S5PC100_GPIO_J2_START + (_nr))
127#define S5PC1XX_GPJ3(_nr) (S5PC1XX_GPIO_J3_START + (_nr)) 138#define S5PC100_GPJ3(_nr) (S5PC100_GPIO_J3_START + (_nr))
128#define S5PC1XX_GPJ4(_nr) (S5PC1XX_GPIO_J4_START + (_nr)) 139#define S5PC100_GPJ4(_nr) (S5PC100_GPIO_J4_START + (_nr))
129#define S5PC1XX_GPK0(_nr) (S5PC1XX_GPIO_K0_START + (_nr)) 140#define S5PC100_GPK0(_nr) (S5PC100_GPIO_K0_START + (_nr))
130#define S5PC1XX_GPK1(_nr) (S5PC1XX_GPIO_K1_START + (_nr)) 141#define S5PC100_GPK1(_nr) (S5PC100_GPIO_K1_START + (_nr))
131#define S5PC1XX_GPK2(_nr) (S5PC1XX_GPIO_K2_START + (_nr)) 142#define S5PC100_GPK2(_nr) (S5PC100_GPIO_K2_START + (_nr))
132#define S5PC1XX_GPK3(_nr) (S5PC1XX_GPIO_K3_START + (_nr)) 143#define S5PC100_GPK3(_nr) (S5PC100_GPIO_K3_START + (_nr))
133#define S5PC1XX_MP00(_nr) (S5PC1XX_GPIO_MP00_START + (_nr)) 144#define S5PC100_GPL0(_nr) (S5PC100_GPIO_L0_START + (_nr))
134#define S5PC1XX_MP01(_nr) (S5PC1XX_GPIO_MP01_START + (_nr)) 145#define S5PC100_GPL1(_nr) (S5PC100_GPIO_L1_START + (_nr))
135#define S5PC1XX_MP02(_nr) (S5PC1XX_GPIO_MP02_START + (_nr)) 146#define S5PC100_GPL2(_nr) (S5PC100_GPIO_L2_START + (_nr))
136#define S5PC1XX_MP03(_nr) (S5PC1XX_GPIO_MP03_START + (_nr)) 147#define S5PC100_GPL3(_nr) (S5PC100_GPIO_L3_START + (_nr))
137#define S5PC1XX_MP04(_nr) (S5PC1XX_GPIO_MP04_START + (_nr)) 148#define S5PC100_GPL4(_nr) (S5PC100_GPIO_L4_START + (_nr))
149#define S5PC100_MP00(_nr) (S5PC100_GPIO_MP00_START + (_nr))
150#define S5PC100_MP01(_nr) (S5PC100_GPIO_MP01_START + (_nr))
151#define S5PC100_MP02(_nr) (S5PC100_GPIO_MP02_START + (_nr))
152#define S5PC100_MP03(_nr) (S5PC100_GPIO_MP03_START + (_nr))
153#define S5PC100_MP04(_nr) (S5PC100_GPIO_MP04_START + (_nr))
154#define S5PC100_MP05(_nr) (S5PC100_GPIO_MP05_START + (_nr))
138 155
139/* the end of the S5PC1XX specific gpios */ 156/* It used the end of the S5PC1XX gpios */
140#define S5PC1XX_GPIO_END (S5PC1XX_MP04(S5PC1XX_GPIO_MP04_NR) + 1) 157#define S3C_GPIO_END S5PC100_GPIO_END
141#define S3C_GPIO_END S5PC1XX_GPIO_END
142 158
143/* define the number of gpios we need to the one after the MP04() range */ 159/* define the number of gpios we need to the one after the MP04() range */
144#define ARCH_NR_GPIOS (S5PC1XX_MP04(S5PC1XX_GPIO_MP04_NR) + 1) 160#define ARCH_NR_GPIOS (S5PC100_GPIO_END + 1)
145 161
146#include <asm-generic/gpio.h> 162#include <asm-generic/gpio.h>
diff --git a/arch/arm/mach-s5pc100/include/mach/irqs.h b/arch/arm/mach-s5pc100/include/mach/irqs.h
index 622720dba289..b53fa48a52c6 100644
--- a/arch/arm/mach-s5pc100/include/mach/irqs.h
+++ b/arch/arm/mach-s5pc100/include/mach/irqs.h
@@ -11,4 +11,9 @@
11 11
12#include <plat/irqs.h> 12#include <plat/irqs.h>
13 13
14/* LCD */
15#define IRQ_LCD_FIFO IRQ_LCD0
16#define IRQ_LCD_VSYNC IRQ_LCD1
17#define IRQ_LCD_SYSTEM IRQ_LCD2
18
14#endif /* __ASM_ARCH_IRQ_H */ 19#endif /* __ASM_ARCH_IRQ_H */
diff --git a/arch/arm/mach-s5pc100/include/mach/map.h b/arch/arm/mach-s5pc100/include/mach/map.h
index 9e9f39130b2c..4681ebe8bef6 100644
--- a/arch/arm/mach-s5pc100/include/mach/map.h
+++ b/arch/arm/mach-s5pc100/include/mach/map.h
@@ -17,6 +17,19 @@
17 17
18#include <plat/map-base.h> 18#include <plat/map-base.h>
19 19
20/*
21 * map-base.h has already defined virtual memory address
22 * S3C_VA_IRQ S3C_ADDR(0x00000000) irq controller(s)
23 * S3C_VA_SYS S3C_ADDR(0x00100000) system control
24 * S3C_VA_MEM S3C_ADDR(0x00200000) system control (not used)
25 * S3C_VA_TIMER S3C_ADDR(0x00300000) timer block
26 * S3C_VA_WATCHDOG S3C_ADDR(0x00400000) watchdog
27 * S3C_VA_UART S3C_ADDR(0x01000000) UART
28 *
29 * S5PC100 specific virtual memory address can be defined here
30 * S5PC1XX_VA_GPIO S3C_ADDR(0x00500000) GPIO
31 *
32 */
20 33
21/* Chip ID */ 34/* Chip ID */
22#define S5PC100_PA_CHIPID (0xE0000000) 35#define S5PC100_PA_CHIPID (0xE0000000)
@@ -24,13 +37,20 @@
24#define S5PC1XX_VA_CHIPID S3C_VA_SYS 37#define S5PC1XX_VA_CHIPID S3C_VA_SYS
25 38
26/* System */ 39/* System */
27#define S5PC100_PA_SYS (0xE0100000) 40#define S5PC100_PA_CLK (0xE0100000)
28#define S5PC100_PA_CLK (S5PC100_PA_SYS + 0x0) 41#define S5PC100_PA_CLK_OTHER (0xE0200000)
29#define S5PC100_PA_PWR (S5PC100_PA_SYS + 0x8000) 42#define S5PC100_PA_PWR (0xE0108000)
30#define S5PC1XX_PA_CLK S5PC100_PA_CLK 43#define S5PC1XX_PA_CLK S5PC100_PA_CLK
31#define S5PC1XX_PA_PWR S5PC100_PA_PWR 44#define S5PC1XX_PA_PWR S5PC100_PA_PWR
45#define S5PC1XX_PA_CLK_OTHER S5PC100_PA_CLK_OTHER
32#define S5PC1XX_VA_CLK (S3C_VA_SYS + 0x10000) 46#define S5PC1XX_VA_CLK (S3C_VA_SYS + 0x10000)
33#define S5PC1XX_VA_PWR (S3C_VA_SYS + 0x20000) 47#define S5PC1XX_VA_PWR (S3C_VA_SYS + 0x20000)
48#define S5PC1XX_VA_CLK_OTHER (S3C_VA_SYS + 0x30000)
49
50/* GPIO */
51#define S5PC100_PA_GPIO (0xE0300000)
52#define S5PC1XX_PA_GPIO S5PC100_PA_GPIO
53#define S5PC1XX_VA_GPIO S3C_ADDR(0x00500000)
34 54
35/* Interrupt */ 55/* Interrupt */
36#define S5PC100_PA_VIC (0xE4000000) 56#define S5PC100_PA_VIC (0xE4000000)
@@ -40,23 +60,64 @@
40#define S5PC1XX_PA_VIC(x) (S5PC100_PA_VIC + ((x) * S5PC100_PA_VIC_OFFSET)) 60#define S5PC1XX_PA_VIC(x) (S5PC100_PA_VIC + ((x) * S5PC100_PA_VIC_OFFSET))
41#define S5PC1XX_VA_VIC(x) (S5PC100_VA_VIC + ((x) * S5PC100_VA_VIC_OFFSET)) 61#define S5PC1XX_VA_VIC(x) (S5PC100_VA_VIC + ((x) * S5PC100_VA_VIC_OFFSET))
42 62
63/* DMA */
64#define S5PC100_PA_MDMA (0xE8100000)
65#define S5PC100_PA_PDMA0 (0xE9000000)
66#define S5PC100_PA_PDMA1 (0xE9200000)
67
43/* Timer */ 68/* Timer */
44#define S5PC100_PA_TIMER (0xEA000000) 69#define S5PC100_PA_TIMER (0xEA000000)
45#define S5PC1XX_PA_TIMER S5PC100_PA_TIMER 70#define S5PC1XX_PA_TIMER S5PC100_PA_TIMER
46#define S5PC1XX_VA_TIMER S3C_VA_TIMER 71#define S5PC1XX_VA_TIMER S3C_VA_TIMER
47 72
73/* RTC */
74#define S5PC100_PA_RTC (0xEA300000)
75
48/* UART */ 76/* UART */
49#define S5PC100_PA_UART (0xEC000000) 77#define S5PC100_PA_UART (0xEC000000)
50#define S5PC1XX_PA_UART S5PC100_PA_UART 78#define S5PC1XX_PA_UART S5PC100_PA_UART
51#define S5PC1XX_VA_UART S3C_VA_UART 79#define S5PC1XX_VA_UART S3C_VA_UART
52 80
53/* IIC */ 81/* I2C */
54#define S5PC100_PA_IIC (0xEC100000) 82#define S5PC100_PA_I2C (0xEC100000)
83#define S5PC100_PA_I2C1 (0xEC200000)
84
85/* USB HS OTG */
86#define S5PC100_PA_USB_HSOTG (0xED200000)
87#define S5PC100_PA_USB_HSPHY (0xED300000)
88
89/* SD/MMC */
90#define S5PC100_PA_HSMMC(x) (0xED800000 + ((x) * 0x100000))
91#define S5PC100_PA_HSMMC0 S5PC100_PA_HSMMC(0)
92#define S5PC100_PA_HSMMC1 S5PC100_PA_HSMMC(1)
93#define S5PC100_PA_HSMMC2 S5PC100_PA_HSMMC(2)
94
95/* LCD */
96#define S5PC100_PA_FB (0xEE000000)
97
98/* Multimedia */
99#define S5PC100_PA_G2D (0xEE800000)
100#define S5PC100_PA_JPEG (0xEE500000)
101#define S5PC100_PA_ROTATOR (0xEE100000)
102#define S5PC100_PA_G3D (0xEF000000)
103
104/* I2S */
105#define S5PC100_PA_I2S0 (0xF2000000)
106#define S5PC100_PA_I2S1 (0xF2100000)
107#define S5PC100_PA_I2S2 (0xF2200000)
108
109/* KEYPAD */
110#define S5PC100_PA_KEYPAD (0xF3100000)
111
112/* ADC & TouchScreen */
113#define S5PC100_PA_TSADC (0xF3000000)
55 114
56/* ETC */ 115/* ETC */
57#define S5PC100_PA_SDRAM (0x20000000) 116#define S5PC100_PA_SDRAM (0x20000000)
117#define S5PC1XX_PA_SDRAM S5PC100_PA_SDRAM
58 118
59/* compatibility defines. */ 119/* compatibility defines. */
120#define S3C_PA_RTC S5PC100_PA_RTC
60#define S3C_PA_UART S5PC100_PA_UART 121#define S3C_PA_UART S5PC100_PA_UART
61#define S3C_PA_UART0 (S5PC100_PA_UART + 0x0) 122#define S3C_PA_UART0 (S5PC100_PA_UART + 0x0)
62#define S3C_PA_UART1 (S5PC100_PA_UART + 0x400) 123#define S3C_PA_UART1 (S5PC100_PA_UART + 0x400)
@@ -67,9 +128,23 @@
67#define S3C_VA_UART2 (S3C_VA_UART + 0x800) 128#define S3C_VA_UART2 (S3C_VA_UART + 0x800)
68#define S3C_VA_UART3 (S3C_VA_UART + 0xC00) 129#define S3C_VA_UART3 (S3C_VA_UART + 0xC00)
69#define S3C_UART_OFFSET 0x400 130#define S3C_UART_OFFSET 0x400
131#define S3C_VA_UARTx(x) (S3C_VA_UART + ((x) * S3C_UART_OFFSET))
132#define S3C_PA_FB S5PC100_PA_FB
133#define S3C_PA_G2D S5PC100_PA_G2D
134#define S3C_PA_G3D S5PC100_PA_G3D
135#define S3C_PA_JPEG S5PC100_PA_JPEG
136#define S3C_PA_ROTATOR S5PC100_PA_ROTATOR
70#define S3C_VA_VIC0 (S3C_VA_IRQ + 0x0) 137#define S3C_VA_VIC0 (S3C_VA_IRQ + 0x0)
71#define S3C_VA_VIC1 (S3C_VA_IRQ + 0x10000) 138#define S3C_VA_VIC1 (S3C_VA_IRQ + 0x10000)
72#define S3C_VA_VIC2 (S3C_VA_IRQ + 0x20000) 139#define S3C_VA_VIC2 (S3C_VA_IRQ + 0x20000)
73#define S3C_PA_IIC S5PC100_PA_IIC 140#define S3C_PA_IIC S5PC100_PA_I2C
141#define S3C_PA_IIC1 S5PC100_PA_I2C1
142#define S3C_PA_USB_HSOTG S5PC100_PA_USB_HSOTG
143#define S3C_PA_USB_HSPHY S5PC100_PA_USB_HSPHY
144#define S3C_PA_HSMMC0 S5PC100_PA_HSMMC0
145#define S3C_PA_HSMMC1 S5PC100_PA_HSMMC1
146#define S3C_PA_HSMMC2 S5PC100_PA_HSMMC2
147#define S3C_PA_KEYPAD S5PC100_PA_KEYPAD
148#define S3C_PA_TSADC S5PC100_PA_TSADC
74 149
75#endif /* __ASM_ARCH_C100_MAP_H */ 150#endif /* __ASM_ARCH_C100_MAP_H */
diff --git a/arch/arm/mach-s5pc100/include/mach/regs-fb.h b/arch/arm/mach-s5pc100/include/mach/regs-fb.h
new file mode 100644
index 000000000000..1732cd28c765
--- /dev/null
+++ b/arch/arm/mach-s5pc100/include/mach/regs-fb.h
@@ -0,0 +1,139 @@
1/* arch/arm/mach-s5pc100/include/mach/regs-fb.h
2 *
3 * Copyright 2009 Samsung Electronics Co.
4 * Pawel Osciak <p.osciak@samsung.com>
5 *
6 * Framebuffer register definitions for Samsung S5PC100.
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#ifndef __ASM_ARCH_REGS_FB_H
14#define __ASM_ARCH_REGS_FB_H __FILE__
15
16#include <plat/regs-fb-v4.h>
17
18/* VP1 interface timing control */
19#define VP1CON0 (0x118)
20#define VP1_RATECON_EN (1 << 31)
21#define VP1_CLKRATE_MASK (0xff)
22
23#define VP1CON1 (0x11c)
24#define VP1_VTREGCON_EN (1 << 31)
25#define VP1_VBPD_MASK (0xfff)
26#define VP1_VBPD_SHIFT (16)
27
28
29#define WPALCON_H (0x19c)
30#define WPALCON_L (0x1a0)
31
32/* Pallete contro for WPAL0 and WPAL1 is the same as in S3C64xx, but
33 * different for WPAL2-4
34 */
35/* In WPALCON_L (aka WPALCON) */
36#define WPALCON_W1PAL_32BPP_A888 (0x7 << 3)
37#define WPALCON_W0PAL_32BPP_A888 (0x7 << 0)
38
39/* To set W2PAL-W4PAL consist of one bit from WPALCON_L and two from WPALCON_H,
40 * e.g. W2PAL[2..0] is made of (WPALCON_H[10..9], WPALCON_L[6]).
41 */
42#define WPALCON_L_WxPAL_L_MASK (0x1)
43#define WPALCON_L_W2PAL_L_SHIFT (6)
44#define WPALCON_L_W3PAL_L_SHIFT (7)
45#define WPALCON_L_W4PAL_L_SHIFT (8)
46
47#define WPALCON_L_WxPAL_H_MASK (0x3)
48#define WPALCON_H_W2PAL_H_SHIFT (9)
49#define WPALCON_H_W3PAL_H_SHIFT (13)
50#define WPALCON_H_W4PAL_H_SHIFT (17)
51
52/* Per-window alpha value registers */
53/* For window 0 8-bit alpha values are in VIDW0ALPHAx,
54 * for windows 1-4 alpha values consist of two parts, the 4 low bits are
55 * taken from VIDWxALPHAx and 4 high bits are from VIDOSDxC,
56 * e.g. WIN1_ALPHA0_B[7..0] = (VIDOSD1C[3..0], VIDW1ALPHA0[3..0])
57 */
58#define VIDWxALPHA0(_win) (0x200 + (_win * 8))
59#define VIDWxALPHA1(_win) (0x204 + (_win * 8))
60
61/* Only for window 0 in VIDW0ALPHAx. */
62#define VIDW0ALPHAx_R(_x) ((_x) << 16)
63#define VIDW0ALPHAx_R_MASK (0xff << 16)
64#define VIDW0ALPHAx_R_SHIFT (16)
65#define VIDW0ALPHAx_G(_x) ((_x) << 8)
66#define VIDW0ALPHAx_G_MASK (0xff << 8)
67#define VIDW0ALPHAx_G_SHIFT (8)
68#define VIDW0ALPHAx_B(_x) ((_x) << 0)
69#define VIDW0ALPHAx_B_MASK (0xff << 0)
70#define VIDW0ALPHAx_B_SHIFT (0)
71
72/* Low 4 bits of alpha0-1 for windows 1-4 */
73#define VIDW14ALPHAx_R_L(_x) ((_x) << 16)
74#define VIDW14ALPHAx_R_L_MASK (0xf << 16)
75#define VIDW14ALPHAx_R_L_SHIFT (16)
76#define VIDW14ALPHAx_G_L(_x) ((_x) << 8)
77#define VIDW14ALPHAx_G_L_MASK (0xf << 8)
78#define VIDW14ALPHAx_G_L_SHIFT (8)
79#define VIDW14ALPHAx_B_L(_x) ((_x) << 0)
80#define VIDW14ALPHAx_B_L_MASK (0xf << 0)
81#define VIDW14ALPHAx_B_L_SHIFT (0)
82
83
84/* Per-window blending equation control registers */
85#define BLENDEQx(_win) (0x244 + ((_win) * 4))
86#define BLENDEQ1 (0x244)
87#define BLENDEQ2 (0x248)
88#define BLENDEQ3 (0x24c)
89#define BLENDEQ4 (0x250)
90
91#define BLENDEQx_Q_FUNC(_x) ((_x) << 18)
92#define BLENDEQx_Q_FUNC_MASK (0xf << 18)
93#define BLENDEQx_P_FUNC(_x) ((_x) << 12)
94#define BLENDEQx_P_FUNC_MASK (0xf << 12)
95#define BLENDEQx_B_FUNC(_x) ((_x) << 6)
96#define BLENDEQx_B_FUNC_MASK (0xf << 6)
97#define BLENDEQx_A_FUNC(_x) ((_x) << 0)
98#define BLENDEQx_A_FUNC_MASK (0xf << 0)
99
100#define BLENDCON (0x260)
101#define BLENDCON_8BIT_ALPHA (1 << 0)
102
103/* Per-window palette base addresses (start of palette memory).
104 * Each window palette area consists of 256 32-bit entries.
105 * START is the first address (entry 0th), END is the address of 255th entry.
106 */
107#define WIN0_PAL_BASE (0x2400)
108#define WIN0_PAL_END (0x27fc)
109#define WIN1_PAL_BASE (0x2800)
110#define WIN1_PAL_END (0x2bfc)
111#define WIN2_PAL_BASE (0x2c00)
112#define WIN2_PAL_END (0x2ffc)
113#define WIN3_PAL_BASE (0x3000)
114#define WIN3_PAL_END (0x33fc)
115#define WIN4_PAL_BASE (0x3400)
116#define WIN4_PAL_END (0x37fc)
117
118#define WIN0_PAL(_entry) (WIN0_PAL_BASE + ((_entry) * 4))
119#define WIN1_PAL(_entry) (WIN1_PAL_BASE + ((_entry) * 4))
120#define WIN2_PAL(_entry) (WIN2_PAL_BASE + ((_entry) * 4))
121#define WIN3_PAL(_entry) (WIN3_PAL_BASE + ((_entry) * 4))
122#define WIN4_PAL(_entry) (WIN4_PAL_BASE + ((_entry) * 4))
123
124static inline unsigned int s3c_fb_pal_reg(unsigned int window, int reg)
125{
126 switch (window) {
127 case 0: return WIN0_PAL(reg);
128 case 1: return WIN1_PAL(reg);
129 case 2: return WIN2_PAL(reg);
130 case 3: return WIN3_PAL(reg);
131 case 4: return WIN4_PAL(reg);
132 }
133
134 BUG();
135}
136
137
138#endif /* __ASM_ARCH_REGS_FB_H */
139
diff --git a/arch/arm/mach-s5pc100/include/mach/system.h b/arch/arm/mach-s5pc100/include/mach/system.h
index e39014375470..f0d31a2a598c 100644
--- a/arch/arm/mach-s5pc100/include/mach/system.h
+++ b/arch/arm/mach-s5pc100/include/mach/system.h
@@ -11,14 +11,21 @@
11#ifndef __ASM_ARCH_SYSTEM_H 11#ifndef __ASM_ARCH_SYSTEM_H
12#define __ASM_ARCH_SYSTEM_H __FILE__ 12#define __ASM_ARCH_SYSTEM_H __FILE__
13 13
14#include <linux/io.h>
15#include <mach/map.h>
16#include <plat/regs-clock.h>
17
18void (*s5pc1xx_idle)(void);
19
14static void arch_idle(void) 20static void arch_idle(void)
15{ 21{
16 /* nothing here yet */ 22 if (s5pc1xx_idle)
23 s5pc1xx_idle();
17} 24}
18 25
19static void arch_reset(char mode, const char *cmd) 26static void arch_reset(char mode, const char *cmd)
20{ 27{
21 /* nothing here yet */ 28 __raw_writel(S5PC100_SWRESET_RESETVAL, S5PC100_SWRESET);
29 return;
22} 30}
23
24#endif /* __ASM_ARCH_IRQ_H */ 31#endif /* __ASM_ARCH_IRQ_H */
diff --git a/arch/arm/mach-s5pc100/mach-smdkc100.c b/arch/arm/mach-s5pc100/mach-smdkc100.c
index 214093cd7632..ae3c52cd0ebb 100644
--- a/arch/arm/mach-s5pc100/mach-smdkc100.c
+++ b/arch/arm/mach-s5pc100/mach-smdkc100.c
@@ -27,16 +27,22 @@
27#include <asm/mach/map.h> 27#include <asm/mach/map.h>
28 28
29#include <mach/map.h> 29#include <mach/map.h>
30#include <mach/regs-fb.h>
31#include <video/platform_lcd.h>
30 32
31#include <asm/irq.h> 33#include <asm/irq.h>
32#include <asm/mach-types.h> 34#include <asm/mach-types.h>
33 35
34#include <plat/regs-serial.h> 36#include <plat/regs-serial.h>
37#include <plat/gpio-cfg.h>
38#include <plat/regs-gpio.h>
35 39
36#include <plat/clock.h> 40#include <plat/clock.h>
37#include <plat/devs.h> 41#include <plat/devs.h>
38#include <plat/cpu.h> 42#include <plat/cpu.h>
39#include <plat/s5pc100.h> 43#include <plat/s5pc100.h>
44#include <plat/fb.h>
45#include <plat/iic.h>
40 46
41#define UCON (S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK) 47#define UCON (S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK)
42#define ULCON (S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB) 48#define ULCON (S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB)
@@ -73,9 +79,78 @@ static struct s3c2410_uartcfg smdkc100_uartcfgs[] __initdata = {
73 }, 79 },
74}; 80};
75 81
82/* I2C0 */
83static struct i2c_board_info i2c_devs0[] __initdata = {
84};
85
86/* I2C1 */
87static struct i2c_board_info i2c_devs1[] __initdata = {
88};
89
90/* LCD power controller */
91static void smdkc100_lcd_power_set(struct plat_lcd_data *pd,
92 unsigned int power)
93{
94 /* backlight */
95 gpio_direction_output(S5PC100_GPD(0), power);
96
97 if (power) {
98 /* module reset */
99 gpio_direction_output(S5PC100_GPH0(6), 1);
100 mdelay(100);
101 gpio_direction_output(S5PC100_GPH0(6), 0);
102 mdelay(10);
103 gpio_direction_output(S5PC100_GPH0(6), 1);
104 mdelay(10);
105 }
106}
107
108static struct plat_lcd_data smdkc100_lcd_power_data = {
109 .set_power = smdkc100_lcd_power_set,
110};
111
112static struct platform_device smdkc100_lcd_powerdev = {
113 .name = "platform-lcd",
114 .dev.parent = &s3c_device_fb.dev,
115 .dev.platform_data = &smdkc100_lcd_power_data,
116};
117
118/* Frame Buffer */
119static struct s3c_fb_pd_win smdkc100_fb_win0 = {
120 /* this is to ensure we use win0 */
121 .win_mode = {
122 .refresh = 70,
123 .pixclock = (8+13+3+800)*(7+5+1+480),
124 .left_margin = 8,
125 .right_margin = 13,
126 .upper_margin = 7,
127 .lower_margin = 5,
128 .hsync_len = 3,
129 .vsync_len = 1,
130 .xres = 800,
131 .yres = 480,
132 },
133 .max_bpp = 32,
134 .default_bpp = 16,
135};
136
137static struct s3c_fb_platdata smdkc100_lcd_pdata __initdata = {
138 .win[0] = &smdkc100_fb_win0,
139 .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
140 .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
141 .setup_gpio = s5pc100_fb_gpio_setup_24bpp,
142};
143
76static struct map_desc smdkc100_iodesc[] = {}; 144static struct map_desc smdkc100_iodesc[] = {};
77 145
78static struct platform_device *smdkc100_devices[] __initdata = { 146static struct platform_device *smdkc100_devices[] __initdata = {
147 &s3c_device_i2c0,
148 &s3c_device_i2c1,
149 &s3c_device_fb,
150 &s3c_device_hsmmc0,
151 &s3c_device_hsmmc1,
152 &s3c_device_hsmmc2,
153 &smdkc100_lcd_powerdev,
79}; 154};
80 155
81static void __init smdkc100_map_io(void) 156static void __init smdkc100_map_io(void)
@@ -87,12 +162,24 @@ static void __init smdkc100_map_io(void)
87 162
88static void __init smdkc100_machine_init(void) 163static void __init smdkc100_machine_init(void)
89{ 164{
165 /* I2C */
166 s3c_i2c0_set_platdata(NULL);
167 s3c_i2c1_set_platdata(NULL);
168 i2c_register_board_info(0, i2c_devs0, ARRAY_SIZE(i2c_devs0));
169 i2c_register_board_info(1, i2c_devs1, ARRAY_SIZE(i2c_devs1));
170
171 s3c_fb_set_platdata(&smdkc100_lcd_pdata);
172
173 /* LCD init */
174 gpio_request(S5PC100_GPD(0), "GPD");
175 gpio_request(S5PC100_GPH0(6), "GPH0");
176 smdkc100_lcd_power_set(&smdkc100_lcd_power_data, 0);
90 platform_add_devices(smdkc100_devices, ARRAY_SIZE(smdkc100_devices)); 177 platform_add_devices(smdkc100_devices, ARRAY_SIZE(smdkc100_devices));
91} 178}
92 179
93MACHINE_START(SMDKC100, "SMDKC100") 180MACHINE_START(SMDKC100, "SMDKC100")
94 /* Maintainer: Byungho Min <bhmin@samsung.com> */ 181 /* Maintainer: Byungho Min <bhmin@samsung.com> */
95 .phys_io = S5PC1XX_PA_UART & 0xfff00000, 182 .phys_io = S5PC100_PA_UART & 0xfff00000,
96 .io_pg_offst = (((u32)S5PC1XX_VA_UART) >> 18) & 0xfffc, 183 .io_pg_offst = (((u32)S5PC1XX_VA_UART) >> 18) & 0xfffc,
97 .boot_params = S5PC100_PA_SDRAM + 0x100, 184 .boot_params = S5PC100_PA_SDRAM + 0x100,
98 185
diff --git a/arch/arm/mach-s5pc100/setup-sdhci.c b/arch/arm/mach-s5pc100/setup-sdhci.c
new file mode 100644
index 000000000000..4385986a3da0
--- /dev/null
+++ b/arch/arm/mach-s5pc100/setup-sdhci.c
@@ -0,0 +1,65 @@
1/* linux/arch/arm/mach-s5pc100/setup-sdhci.c
2 *
3 * Copyright 2008 Samsung Electronics
4 *
5 * S5PC100 - Helper functions for settign up SDHCI device(s) (HSMMC)
6 *
7 * Based on mach-s3c6410/setup-sdhci.c
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 version 2 as
11 * published by the Free Software Foundation.
12*/
13
14#include <linux/kernel.h>
15#include <linux/types.h>
16#include <linux/interrupt.h>
17#include <linux/platform_device.h>
18#include <linux/io.h>
19
20#include <linux/mmc/card.h>
21#include <linux/mmc/host.h>
22
23#include <plat/regs-sdhci.h>
24#include <plat/sdhci.h>
25
26/* clock sources for the mmc bus clock, order as for the ctrl2[5..4] */
27
28char *s5pc100_hsmmc_clksrcs[4] = {
29 [0] = "hsmmc",
30 [1] = "hsmmc",
31 /* [2] = "mmc_bus", not yet succesfuuly used yet */
32 /* [3] = "48m", - note not succesfully used yet */
33};
34
35
36void s5pc100_setup_sdhci0_cfg_card(struct platform_device *dev,
37 void __iomem *r,
38 struct mmc_ios *ios,
39 struct mmc_card *card)
40{
41 u32 ctrl2, ctrl3;
42
43 /* don't need to alter anything acording to card-type */
44
45 writel(S3C64XX_SDHCI_CONTROL4_DRIVE_9mA, r + S3C64XX_SDHCI_CONTROL4);
46
47 ctrl2 = readl(r + S3C_SDHCI_CONTROL2);
48 ctrl2 &= S3C_SDHCI_CTRL2_SELBASECLK_MASK;
49 ctrl2 |= (S3C64XX_SDHCI_CTRL2_ENSTAASYNCCLR |
50 S3C64XX_SDHCI_CTRL2_ENCMDCNFMSK |
51 S3C_SDHCI_CTRL2_ENFBCLKRX |
52 S3C_SDHCI_CTRL2_DFCNT_NONE |
53 S3C_SDHCI_CTRL2_ENCLKOUTHOLD);
54
55 if (ios->clock < 25 * 1000000)
56 ctrl3 = (S3C_SDHCI_CTRL3_FCSEL3 |
57 S3C_SDHCI_CTRL3_FCSEL2 |
58 S3C_SDHCI_CTRL3_FCSEL1 |
59 S3C_SDHCI_CTRL3_FCSEL0);
60 else
61 ctrl3 = (S3C_SDHCI_CTRL3_FCSEL1 | S3C_SDHCI_CTRL3_FCSEL0);
62
63 writel(ctrl2, r + S3C_SDHCI_CONTROL2);
64 writel(ctrl3, r + S3C_SDHCI_CONTROL3);
65}
diff --git a/arch/arm/mach-sa1100/Kconfig b/arch/arm/mach-sa1100/Kconfig
index 4e5c07f4e456..03a7f3857c5e 100644
--- a/arch/arm/mach-sa1100/Kconfig
+++ b/arch/arm/mach-sa1100/Kconfig
@@ -53,23 +53,23 @@ config SA1100_COLLIE
53 53
54config SA1100_H3100 54config SA1100_H3100
55 bool "Compaq iPAQ H3100" 55 bool "Compaq iPAQ H3100"
56 select HTC_EGPIO
56 help 57 help
57 Say Y here if you intend to run this kernel on the Compaq iPAQ 58 Say Y here if you intend to run this kernel on the Compaq iPAQ
58 H3100 handheld computer. Information about this machine and the 59 H3100 handheld computer. Information about this machine and the
59 Linux port to this machine can be found at: 60 Linux port to this machine can be found at:
60 61
61 <http://www.handhelds.org/Compaq/index.html#iPAQ_H3100> 62 <http://www.handhelds.org/Compaq/index.html#iPAQ_H3100>
62 <http://www.compaq.com/products/handhelds/pocketpc/>
63 63
64config SA1100_H3600 64config SA1100_H3600
65 bool "Compaq iPAQ H3600/H3700" 65 bool "Compaq iPAQ H3600/H3700"
66 select HTC_EGPIO
66 help 67 help
67 Say Y here if you intend to run this kernel on the Compaq iPAQ 68 Say Y here if you intend to run this kernel on the Compaq iPAQ
68 H3600 handheld computer. Information about this machine and the 69 H3600 handheld computer. Information about this machine and the
69 Linux port to this machine can be found at: 70 Linux port to this machine can be found at:
70 71
71 <http://www.handhelds.org/Compaq/index.html#iPAQ_H3600> 72 <http://www.handhelds.org/Compaq/index.html#iPAQ_H3600>
72 <http://www.compaq.com/products/handhelds/pocketpc/>
73 73
74config SA1100_BADGE4 74config SA1100_BADGE4
75 bool "HP Labs BadgePAD 4" 75 bool "HP Labs BadgePAD 4"
diff --git a/arch/arm/mach-sa1100/Makefile b/arch/arm/mach-sa1100/Makefile
index bb7b8198d0c4..89349c1dd7a6 100644
--- a/arch/arm/mach-sa1100/Makefile
+++ b/arch/arm/mach-sa1100/Makefile
@@ -25,8 +25,8 @@ led-$(CONFIG_SA1100_CERF) += leds-cerf.o
25 25
26obj-$(CONFIG_SA1100_COLLIE) += collie.o 26obj-$(CONFIG_SA1100_COLLIE) += collie.o
27 27
28obj-$(CONFIG_SA1100_H3100) += h3600.o 28obj-$(CONFIG_SA1100_H3100) += h3100.o h3xxx.o
29obj-$(CONFIG_SA1100_H3600) += h3600.o 29obj-$(CONFIG_SA1100_H3600) += h3600.o h3xxx.o
30 30
31obj-$(CONFIG_SA1100_HACKKIT) += hackkit.o 31obj-$(CONFIG_SA1100_HACKKIT) += hackkit.o
32led-$(CONFIG_SA1100_HACKKIT) += leds-hackkit.o 32led-$(CONFIG_SA1100_HACKKIT) += leds-hackkit.o
diff --git a/arch/arm/mach-sa1100/assabet.c b/arch/arm/mach-sa1100/assabet.c
index 55e64477a876..169e5b87dbff 100644
--- a/arch/arm/mach-sa1100/assabet.c
+++ b/arch/arm/mach-sa1100/assabet.c
@@ -249,10 +249,10 @@ static void __init assabet_init(void)
249#endif 249#endif
250 } 250 }
251 251
252 sa11x0_set_flash_data(&assabet_flash_data, assabet_flash_resources, 252 sa11x0_register_mtd(&assabet_flash_data, assabet_flash_resources,
253 ARRAY_SIZE(assabet_flash_resources)); 253 ARRAY_SIZE(assabet_flash_resources));
254 sa11x0_set_irda_data(&assabet_irda_data); 254 sa11x0_register_irda(&assabet_irda_data);
255 sa11x0_set_mcp_data(&assabet_mcp_data); 255 sa11x0_register_mcp(&assabet_mcp_data);
256} 256}
257 257
258/* 258/*
diff --git a/arch/arm/mach-sa1100/badge4.c b/arch/arm/mach-sa1100/badge4.c
index ab5883b39ddf..051ec0f0023c 100644
--- a/arch/arm/mach-sa1100/badge4.c
+++ b/arch/arm/mach-sa1100/badge4.c
@@ -212,7 +212,7 @@ static int __init badge4_init(void)
212 /* maybe turn on 5v0 from the start */ 212 /* maybe turn on 5v0 from the start */
213 badge4_set_5V(BADGE4_5V_INITIALLY, five_v_on); 213 badge4_set_5V(BADGE4_5V_INITIALLY, five_v_on);
214 214
215 sa11x0_set_flash_data(&badge4_flash_data, &badge4_flash_resource, 1); 215 sa11x0_register_mtd(&badge4_flash_data, &badge4_flash_resource, 1);
216 216
217 return 0; 217 return 0;
218} 218}
diff --git a/arch/arm/mach-sa1100/cerf.c b/arch/arm/mach-sa1100/cerf.c
index fd3ad9cfc912..bc950ef418af 100644
--- a/arch/arm/mach-sa1100/cerf.c
+++ b/arch/arm/mach-sa1100/cerf.c
@@ -129,8 +129,8 @@ static struct mcp_plat_data cerf_mcp_data = {
129static void __init cerf_init(void) 129static void __init cerf_init(void)
130{ 130{
131 platform_add_devices(cerf_devices, ARRAY_SIZE(cerf_devices)); 131 platform_add_devices(cerf_devices, ARRAY_SIZE(cerf_devices));
132 sa11x0_set_flash_data(&cerf_flash_data, &cerf_flash_resource, 1); 132 sa11x0_register_mtd(&cerf_flash_data, &cerf_flash_resource, 1);
133 sa11x0_set_mcp_data(&cerf_mcp_data); 133 sa11x0_register_mcp(&cerf_mcp_data);
134} 134}
135 135
136MACHINE_START(CERF, "Intrinsyc CerfBoard/CerfCube") 136MACHINE_START(CERF, "Intrinsyc CerfBoard/CerfCube")
diff --git a/arch/arm/mach-sa1100/collie.c b/arch/arm/mach-sa1100/collie.c
index bbf2ebcc3066..9982c5c28edf 100644
--- a/arch/arm/mach-sa1100/collie.c
+++ b/arch/arm/mach-sa1100/collie.c
@@ -26,6 +26,7 @@
26#include <linux/mtd/partitions.h> 26#include <linux/mtd/partitions.h>
27#include <linux/timer.h> 27#include <linux/timer.h>
28#include <linux/gpio.h> 28#include <linux/gpio.h>
29#include <linux/pda_power.h>
29 30
30#include <mach/hardware.h> 31#include <mach/hardware.h>
31#include <asm/mach-types.h> 32#include <asm/mach-types.h>
@@ -56,6 +57,7 @@ static struct resource collie_scoop_resources[] = {
56static struct scoop_config collie_scoop_setup = { 57static struct scoop_config collie_scoop_setup = {
57 .io_dir = COLLIE_SCOOP_IO_DIR, 58 .io_dir = COLLIE_SCOOP_IO_DIR,
58 .io_out = COLLIE_SCOOP_IO_OUT, 59 .io_out = COLLIE_SCOOP_IO_OUT,
60 .gpio_base = COLLIE_SCOOP_GPIO_BASE,
59}; 61};
60 62
61struct platform_device colliescoop_device = { 63struct platform_device colliescoop_device = {
@@ -85,6 +87,70 @@ static struct scoop_pcmcia_config collie_pcmcia_config = {
85static struct mcp_plat_data collie_mcp_data = { 87static struct mcp_plat_data collie_mcp_data = {
86 .mccr0 = MCCR0_ADM | MCCR0_ExtClk, 88 .mccr0 = MCCR0_ADM | MCCR0_ExtClk,
87 .sclk_rate = 9216000, 89 .sclk_rate = 9216000,
90 .gpio_base = COLLIE_TC35143_GPIO_BASE,
91};
92
93/*
94 * Collie AC IN
95 */
96static int collie_power_init(struct device *dev)
97{
98 int ret = gpio_request(COLLIE_GPIO_AC_IN, "ac in");
99 if (ret)
100 goto err_gpio_req;
101
102 ret = gpio_direction_input(COLLIE_GPIO_AC_IN);
103 if (ret)
104 goto err_gpio_in;
105
106 return 0;
107
108err_gpio_in:
109 gpio_free(COLLIE_GPIO_AC_IN);
110err_gpio_req:
111 return ret;
112}
113
114static void collie_power_exit(struct device *dev)
115{
116 gpio_free(COLLIE_GPIO_AC_IN);
117}
118
119static int collie_power_ac_online(void)
120{
121 return gpio_get_value(COLLIE_GPIO_AC_IN) == 2;
122}
123
124static char *collie_ac_supplied_to[] = {
125 "main-battery",
126 "backup-battery",
127};
128
129static struct pda_power_pdata collie_power_data = {
130 .init = collie_power_init,
131 .is_ac_online = collie_power_ac_online,
132 .exit = collie_power_exit,
133 .supplied_to = collie_ac_supplied_to,
134 .num_supplicants = ARRAY_SIZE(collie_ac_supplied_to),
135};
136
137static struct resource collie_power_resource[] = {
138 {
139 .name = "ac",
140 .start = gpio_to_irq(COLLIE_GPIO_AC_IN),
141 .end = gpio_to_irq(COLLIE_GPIO_AC_IN),
142 .flags = IORESOURCE_IRQ |
143 IORESOURCE_IRQ_HIGHEDGE |
144 IORESOURCE_IRQ_LOWEDGE,
145 },
146};
147
148static struct platform_device collie_power_device = {
149 .name = "pda-power",
150 .id = -1,
151 .dev.platform_data = &collie_power_data,
152 .resource = collie_power_resource,
153 .num_resources = ARRAY_SIZE(collie_power_resource),
88}; 154};
89 155
90#ifdef CONFIG_SHARP_LOCOMO 156#ifdef CONFIG_SHARP_LOCOMO
@@ -178,6 +244,7 @@ struct platform_device collie_locomo_device = {
178static struct platform_device *devices[] __initdata = { 244static struct platform_device *devices[] __initdata = {
179 &collie_locomo_device, 245 &collie_locomo_device,
180 &colliescoop_device, 246 &colliescoop_device,
247 &collie_power_device,
181}; 248};
182 249
183static struct mtd_partition collie_partitions[] = { 250static struct mtd_partition collie_partitions[] = {
@@ -248,22 +315,24 @@ static void __init collie_init(void)
248 GPDR = GPIO_LDD8 | GPIO_LDD9 | GPIO_LDD10 | GPIO_LDD11 | GPIO_LDD12 | 315 GPDR = GPIO_LDD8 | GPIO_LDD9 | GPIO_LDD10 | GPIO_LDD11 | GPIO_LDD12 |
249 GPIO_LDD13 | GPIO_LDD14 | GPIO_LDD15 | GPIO_SSP_TXD | 316 GPIO_LDD13 | GPIO_LDD14 | GPIO_LDD15 | GPIO_SSP_TXD |
250 GPIO_SSP_SCLK | GPIO_SSP_SFRM | GPIO_SDLC_SCLK | 317 GPIO_SSP_SCLK | GPIO_SSP_SFRM | GPIO_SDLC_SCLK |
251 COLLIE_GPIO_UCB1x00_RESET | COLLIE_GPIO_nMIC_ON | 318 _COLLIE_GPIO_UCB1x00_RESET | _COLLIE_GPIO_nMIC_ON |
252 COLLIE_GPIO_nREMOCON_ON | GPIO_32_768kHz; 319 _COLLIE_GPIO_nREMOCON_ON | GPIO_32_768kHz;
253 320
254 PPDR = PPC_LDD0 | PPC_LDD1 | PPC_LDD2 | PPC_LDD3 | PPC_LDD4 | PPC_LDD5 | 321 PPDR = PPC_LDD0 | PPC_LDD1 | PPC_LDD2 | PPC_LDD3 | PPC_LDD4 | PPC_LDD5 |
255 PPC_LDD6 | PPC_LDD7 | PPC_L_PCLK | PPC_L_LCLK | PPC_L_FCLK | PPC_L_BIAS | 322 PPC_LDD6 | PPC_LDD7 | PPC_L_PCLK | PPC_L_LCLK | PPC_L_FCLK | PPC_L_BIAS |
256 PPC_TXD1 | PPC_TXD2 | PPC_TXD3 | PPC_TXD4 | PPC_SCLK | PPC_SFRM; 323 PPC_TXD1 | PPC_TXD2 | PPC_TXD3 | PPC_TXD4 | PPC_SCLK | PPC_SFRM;
257 324
258 PWER = COLLIE_GPIO_AC_IN | COLLIE_GPIO_CO | COLLIE_GPIO_ON_KEY | 325 PWER = _COLLIE_GPIO_AC_IN | _COLLIE_GPIO_CO | _COLLIE_GPIO_ON_KEY |
259 COLLIE_GPIO_WAKEUP | COLLIE_GPIO_nREMOCON_INT | PWER_RTC; 326 _COLLIE_GPIO_WAKEUP | _COLLIE_GPIO_nREMOCON_INT | PWER_RTC;
260 327
261 PGSR = COLLIE_GPIO_nREMOCON_ON; 328 PGSR = _COLLIE_GPIO_nREMOCON_ON;
262 329
263 PSDR = PPC_RXD1 | PPC_RXD2 | PPC_RXD3 | PPC_RXD4; 330 PSDR = PPC_RXD1 | PPC_RXD2 | PPC_RXD3 | PPC_RXD4;
264 331
265 PCFR = PCFR_OPDE; 332 PCFR = PCFR_OPDE;
266 333
334 GPSR |= _COLLIE_GPIO_UCB1x00_RESET;
335
267 336
268 platform_scoop_config = &collie_pcmcia_config; 337 platform_scoop_config = &collie_pcmcia_config;
269 338
@@ -272,9 +341,9 @@ static void __init collie_init(void)
272 printk(KERN_WARNING "collie: Unable to register LoCoMo device\n"); 341 printk(KERN_WARNING "collie: Unable to register LoCoMo device\n");
273 } 342 }
274 343
275 sa11x0_set_flash_data(&collie_flash_data, collie_flash_resources, 344 sa11x0_register_mtd(&collie_flash_data, collie_flash_resources,
276 ARRAY_SIZE(collie_flash_resources)); 345 ARRAY_SIZE(collie_flash_resources));
277 sa11x0_set_mcp_data(&collie_mcp_data); 346 sa11x0_register_mcp(&collie_mcp_data);
278 347
279 sharpsl_save_param(); 348 sharpsl_save_param();
280} 349}
diff --git a/arch/arm/mach-sa1100/generic.c b/arch/arm/mach-sa1100/generic.c
index 23cfdd593954..9faea1511c1f 100644
--- a/arch/arm/mach-sa1100/generic.c
+++ b/arch/arm/mach-sa1100/generic.c
@@ -162,6 +162,17 @@ static void sa1100_power_off(void)
162 PMCR = PMCR_SF; 162 PMCR = PMCR_SF;
163} 163}
164 164
165static void sa11x0_register_device(struct platform_device *dev, void *data)
166{
167 int err;
168 dev->dev.platform_data = data;
169 err = platform_device_register(dev);
170 if (err)
171 printk(KERN_ERR "Unable to register device %s: %d\n",
172 dev->name, err);
173}
174
175
165static struct resource sa11x0udc_resources[] = { 176static struct resource sa11x0udc_resources[] = {
166 [0] = { 177 [0] = {
167 .start = 0x80000000, 178 .start = 0x80000000,
@@ -234,9 +245,9 @@ static struct platform_device sa11x0mcp_device = {
234 .resource = sa11x0mcp_resources, 245 .resource = sa11x0mcp_resources,
235}; 246};
236 247
237void sa11x0_set_mcp_data(struct mcp_plat_data *data) 248void sa11x0_register_mcp(struct mcp_plat_data *data)
238{ 249{
239 sa11x0mcp_device.dev.platform_data = data; 250 sa11x0_register_device(&sa11x0mcp_device, data);
240} 251}
241 252
242static struct resource sa11x0ssp_resources[] = { 253static struct resource sa11x0ssp_resources[] = {
@@ -293,13 +304,13 @@ static struct platform_device sa11x0mtd_device = {
293 .id = -1, 304 .id = -1,
294}; 305};
295 306
296void sa11x0_set_flash_data(struct flash_platform_data *flash, 307void sa11x0_register_mtd(struct flash_platform_data *flash,
297 struct resource *res, int nr) 308 struct resource *res, int nr)
298{ 309{
299 flash->name = "sa1100"; 310 flash->name = "sa1100";
300 sa11x0mtd_device.dev.platform_data = flash;
301 sa11x0mtd_device.resource = res; 311 sa11x0mtd_device.resource = res;
302 sa11x0mtd_device.num_resources = nr; 312 sa11x0mtd_device.num_resources = nr;
313 sa11x0_register_device(&sa11x0mtd_device, flash);
303} 314}
304 315
305static struct resource sa11x0ir_resources[] = { 316static struct resource sa11x0ir_resources[] = {
@@ -329,9 +340,9 @@ static struct platform_device sa11x0ir_device = {
329 .resource = sa11x0ir_resources, 340 .resource = sa11x0ir_resources,
330}; 341};
331 342
332void sa11x0_set_irda_data(struct irda_platform_data *irda) 343void sa11x0_register_irda(struct irda_platform_data *irda)
333{ 344{
334 sa11x0ir_device.dev.platform_data = irda; 345 sa11x0_register_device(&sa11x0ir_device, irda);
335} 346}
336 347
337static struct platform_device sa11x0rtc_device = { 348static struct platform_device sa11x0rtc_device = {
@@ -343,21 +354,15 @@ static struct platform_device *sa11x0_devices[] __initdata = {
343 &sa11x0udc_device, 354 &sa11x0udc_device,
344 &sa11x0uart1_device, 355 &sa11x0uart1_device,
345 &sa11x0uart3_device, 356 &sa11x0uart3_device,
346 &sa11x0mcp_device,
347 &sa11x0ssp_device, 357 &sa11x0ssp_device,
348 &sa11x0pcmcia_device, 358 &sa11x0pcmcia_device,
349 &sa11x0fb_device, 359 &sa11x0fb_device,
350 &sa11x0mtd_device,
351 &sa11x0rtc_device, 360 &sa11x0rtc_device,
352}; 361};
353 362
354static int __init sa1100_init(void) 363static int __init sa1100_init(void)
355{ 364{
356 pm_power_off = sa1100_power_off; 365 pm_power_off = sa1100_power_off;
357
358 if (sa11x0ir_device.dev.platform_data)
359 platform_device_register(&sa11x0ir_device);
360
361 return platform_add_devices(sa11x0_devices, ARRAY_SIZE(sa11x0_devices)); 366 return platform_add_devices(sa11x0_devices, ARRAY_SIZE(sa11x0_devices));
362} 367}
363 368
diff --git a/arch/arm/mach-sa1100/generic.h b/arch/arm/mach-sa1100/generic.h
index 793c2e6c991f..ec03f187c52b 100644
--- a/arch/arm/mach-sa1100/generic.h
+++ b/arch/arm/mach-sa1100/generic.h
@@ -32,14 +32,11 @@ extern unsigned int sa11x0_ppcr_to_freq(unsigned int idx);
32struct flash_platform_data; 32struct flash_platform_data;
33struct resource; 33struct resource;
34 34
35extern void sa11x0_set_flash_data(struct flash_platform_data *flash, 35void sa11x0_register_mtd(struct flash_platform_data *flash,
36 struct resource *res, int nr); 36 struct resource *res, int nr);
37
38struct sa11x0_ssp_plat_ops;
39extern void sa11x0_set_ssp_data(struct sa11x0_ssp_plat_ops *ops);
40 37
41struct irda_platform_data; 38struct irda_platform_data;
42void sa11x0_set_irda_data(struct irda_platform_data *irda); 39void sa11x0_register_irda(struct irda_platform_data *irda);
43 40
44struct mcp_plat_data; 41struct mcp_plat_data;
45void sa11x0_set_mcp_data(struct mcp_plat_data *data); 42void sa11x0_register_mcp(struct mcp_plat_data *data);
diff --git a/arch/arm/mach-sa1100/h3100.c b/arch/arm/mach-sa1100/h3100.c
new file mode 100644
index 000000000000..0c7cea0dc013
--- /dev/null
+++ b/arch/arm/mach-sa1100/h3100.c
@@ -0,0 +1,95 @@
1/*
2 * Support for Compaq iPAQ H3100 handheld computer
3 *
4 * Copyright (c) 2000,1 Compaq Computer Corporation. (Author: Jamey Hicks)
5 * Copyright (c) 2009 Dmitry Artamonow <mad_soft@inbox.ru>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 */
12
13#include <linux/init.h>
14#include <linux/kernel.h>
15#include <linux/gpio.h>
16
17#include <asm/mach-types.h>
18#include <asm/mach/arch.h>
19#include <asm/mach/irda.h>
20
21#include <mach/h3xxx.h>
22
23#include "generic.h"
24
25/*
26 * helper for sa1100fb
27 */
28static void h3100_lcd_power(int enable)
29{
30 if (!gpio_request(H3XXX_EGPIO_LCD_ON, "LCD ON")) {
31 gpio_set_value(H3100_GPIO_LCD_3V_ON, enable);
32 gpio_direction_output(H3XXX_EGPIO_LCD_ON, enable);
33 gpio_free(H3XXX_EGPIO_LCD_ON);
34 } else {
35 pr_err("%s: can't request H3XXX_EGPIO_LCD_ON\n", __func__);
36 }
37}
38
39
40static void __init h3100_map_io(void)
41{
42 h3xxx_map_io();
43
44 sa1100fb_lcd_power = h3100_lcd_power;
45
46 /* Older bootldrs put GPIO2-9 in alternate mode on the
47 assumption that they are used for video */
48 GAFR &= ~0x000001fb;
49}
50
51/*
52 * This turns the IRDA power on or off on the Compaq H3100
53 */
54static int h3100_irda_set_power(struct device *dev, unsigned int state)
55{
56 gpio_set_value(H3100_GPIO_IR_ON, state);
57 return 0;
58}
59
60static void h3100_irda_set_speed(struct device *dev, unsigned int speed)
61{
62 gpio_set_value(H3100_GPIO_IR_FSEL, !(speed < 4000000));
63}
64
65static struct irda_platform_data h3100_irda_data = {
66 .set_power = h3100_irda_set_power,
67 .set_speed = h3100_irda_set_speed,
68};
69
70static struct gpio_default_state h3100_default_gpio[] = {
71 { H3100_GPIO_IR_ON, GPIO_MODE_OUT0, "IrDA power" },
72 { H3100_GPIO_IR_FSEL, GPIO_MODE_OUT0, "IrDA fsel" },
73 { H3XXX_GPIO_COM_DCD, GPIO_MODE_IN, "COM DCD" },
74 { H3XXX_GPIO_COM_CTS, GPIO_MODE_IN, "COM CTS" },
75 { H3XXX_GPIO_COM_RTS, GPIO_MODE_OUT0, "COM RTS" },
76 { H3100_GPIO_LCD_3V_ON, GPIO_MODE_OUT0, "LCD 3v" },
77};
78
79static void __init h3100_mach_init(void)
80{
81 h3xxx_init_gpio(h3100_default_gpio, ARRAY_SIZE(h3100_default_gpio));
82 h3xxx_mach_init();
83 sa11x0_register_irda(&h3100_irda_data);
84}
85
86MACHINE_START(H3100, "Compaq iPAQ H3100")
87 .phys_io = 0x80000000,
88 .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc,
89 .boot_params = 0xc0000100,
90 .map_io = h3100_map_io,
91 .init_irq = sa1100_init_irq,
92 .timer = &sa1100_timer,
93 .init_machine = h3100_mach_init,
94MACHINE_END
95
diff --git a/arch/arm/mach-sa1100/h3600.c b/arch/arm/mach-sa1100/h3600.c
index 0eb2f159578b..af3b71459f8d 100644
--- a/arch/arm/mach-sa1100/h3600.c
+++ b/arch/arm/mach-sa1100/h3600.c
@@ -1,421 +1,127 @@
1/* 1/*
2 * Hardware definitions for Compaq iPAQ H3xxx Handheld Computers 2 * Support for Compaq iPAQ H3600 handheld computer
3 * 3 *
4 * Copyright 2000,1 Compaq Computer Corporation. 4 * Copyright (c) 2000,1 Compaq Computer Corporation. (Author: Jamey Hicks)
5 * Copyright (c) 2009 Dmitry Artamonow <mad_soft@inbox.ru>
5 * 6 *
6 * Use consistent with the GNU GPL is permitted, 7 * This program is free software; you can redistribute it and/or modify
7 * provided that this copyright notice is 8 * it under the terms of the GNU General Public License version 2 as
8 * preserved in its entirety in all copies and derived works. 9 * published by the Free Software Foundation.
9 *
10 * COMPAQ COMPUTER CORPORATION MAKES NO WARRANTIES, EXPRESSED OR IMPLIED,
11 * AS TO THE USEFULNESS OR CORRECTNESS OF THIS CODE OR ITS
12 * FITNESS FOR ANY PARTICULAR PURPOSE.
13 *
14 * Author: Jamey Hicks.
15 *
16 * History:
17 *
18 * 2001-10-?? Andrew Christian Added support for iPAQ H3800
19 * and abstracted EGPIO interface.
20 * 10 *
21 */ 11 */
22#include <linux/module.h> 12
23#include <linux/init.h> 13#include <linux/init.h>
24#include <linux/kernel.h> 14#include <linux/kernel.h>
25#include <linux/tty.h> 15#include <linux/gpio.h>
26#include <linux/pm.h>
27#include <linux/device.h>
28#include <linux/mtd/mtd.h>
29#include <linux/mtd/partitions.h>
30#include <linux/serial_core.h>
31 16
32#include <asm/irq.h>
33#include <mach/hardware.h>
34#include <asm/mach-types.h> 17#include <asm/mach-types.h>
35#include <asm/setup.h>
36
37#include <asm/mach/irq.h>
38#include <asm/mach/arch.h> 18#include <asm/mach/arch.h>
39#include <asm/mach/flash.h>
40#include <asm/mach/irda.h> 19#include <asm/mach/irda.h>
41#include <asm/mach/map.h>
42#include <asm/mach/serial_sa1100.h>
43 20
44#include <mach/h3600.h> 21#include <mach/h3xxx.h>
45#include <mach/h3600_gpio.h>
46 22
47#include "generic.h" 23#include "generic.h"
48 24
49void (*assign_h3600_egpio)(enum ipaq_egpio_type x, int level);
50EXPORT_SYMBOL(assign_h3600_egpio);
51
52static struct mtd_partition h3xxx_partitions[] = {
53 {
54 .name = "H3XXX boot firmware",
55 .size = 0x00040000,
56 .offset = 0,
57 .mask_flags = MTD_WRITEABLE, /* force read-only */
58 }, {
59 .name = "H3XXX rootfs",
60 .size = MTDPART_SIZ_FULL,
61 .offset = 0x00040000,
62 }
63};
64
65static void h3xxx_set_vpp(int vpp)
66{
67 assign_h3600_egpio(IPAQ_EGPIO_VPP_ON, vpp);
68}
69
70static struct flash_platform_data h3xxx_flash_data = {
71 .map_name = "cfi_probe",
72 .set_vpp = h3xxx_set_vpp,
73 .parts = h3xxx_partitions,
74 .nr_parts = ARRAY_SIZE(h3xxx_partitions),
75};
76
77static struct resource h3xxx_flash_resource = {
78 .start = SA1100_CS0_PHYS,
79 .end = SA1100_CS0_PHYS + SZ_32M - 1,
80 .flags = IORESOURCE_MEM,
81};
82
83/* 25/*
84 * This turns the IRDA power on or off on the Compaq H3600 26 * helper for sa1100fb
85 */
86static int h3600_irda_set_power(struct device *dev, unsigned int state)
87{
88 assign_h3600_egpio( IPAQ_EGPIO_IR_ON, state );
89
90 return 0;
91}
92
93static void h3600_irda_set_speed(struct device *dev, unsigned int speed)
94{
95 assign_h3600_egpio(IPAQ_EGPIO_IR_FSEL, !(speed < 4000000));
96}
97
98static struct irda_platform_data h3600_irda_data = {
99 .set_power = h3600_irda_set_power,
100 .set_speed = h3600_irda_set_speed,
101};
102
103static void h3xxx_mach_init(void)
104{
105 sa11x0_set_flash_data(&h3xxx_flash_data, &h3xxx_flash_resource, 1);
106 sa11x0_set_irda_data(&h3600_irda_data);
107}
108
109/*
110 * low-level UART features
111 */ 27 */
112 28static void h3600_lcd_power(int enable)
113static void h3600_uart_set_mctrl(struct uart_port *port, u_int mctrl)
114{ 29{
115 if (port->mapbase == _Ser3UTCR0) { 30 if (gpio_request(H3XXX_EGPIO_LCD_ON, "LCD power")) {
116 if (mctrl & TIOCM_RTS) 31 pr_err("%s: can't request H3XXX_EGPIO_LCD_ON\n", __func__);
117 GPCR = GPIO_H3600_COM_RTS; 32 goto err1;
118 else
119 GPSR = GPIO_H3600_COM_RTS;
120 } 33 }
121} 34 if (gpio_request(H3600_EGPIO_LCD_PCI, "LCD control")) {
122 35 pr_err("%s: can't request H3XXX_EGPIO_LCD_PCI\n", __func__);
123static u_int h3600_uart_get_mctrl(struct uart_port *port) 36 goto err2;
124{ 37 }
125 u_int ret = TIOCM_CD | TIOCM_CTS | TIOCM_DSR; 38 if (gpio_request(H3600_EGPIO_LCD_5V_ON, "LCD 5v")) {
126 39 pr_err("%s: can't request H3XXX_EGPIO_LCD_5V_ON\n", __func__);
127 if (port->mapbase == _Ser3UTCR0) { 40 goto err3;
128 int gplr = GPLR; 41 }
129 /* DCD and CTS bits are inverted in GPLR by RS232 transceiver */ 42 if (gpio_request(H3600_EGPIO_LVDD_ON, "LCD 9v/-6.5v")) {
130 if (gplr & GPIO_H3600_COM_DCD) 43 pr_err("%s: can't request H3600_EGPIO_LVDD_ON\n", __func__);
131 ret &= ~TIOCM_CD; 44 goto err4;
132 if (gplr & GPIO_H3600_COM_CTS)
133 ret &= ~TIOCM_CTS;
134 } 45 }
135 46
136 return ret; 47 gpio_direction_output(H3XXX_EGPIO_LCD_ON, enable);
137} 48 gpio_direction_output(H3600_EGPIO_LCD_PCI, enable);
49 gpio_direction_output(H3600_EGPIO_LCD_5V_ON, enable);
50 gpio_direction_output(H3600_EGPIO_LVDD_ON, enable);
138 51
139static void h3600_uart_pm(struct uart_port *port, u_int state, u_int oldstate) 52 gpio_free(H3600_EGPIO_LVDD_ON);
140{ 53err4: gpio_free(H3600_EGPIO_LCD_5V_ON);
141 if (port->mapbase == _Ser2UTCR0) { /* TODO: REMOVE THIS */ 54err3: gpio_free(H3600_EGPIO_LCD_PCI);
142 assign_h3600_egpio(IPAQ_EGPIO_IR_ON, !state); 55err2: gpio_free(H3XXX_EGPIO_LCD_ON);
143 } else if (port->mapbase == _Ser3UTCR0) { 56err1: return;
144 assign_h3600_egpio(IPAQ_EGPIO_RS232_ON, !state);
145 }
146} 57}
147 58
148/* 59static void __init h3600_map_io(void)
149 * Enable/Disable wake up events for this serial port.
150 * Obviously, we only support this on the normal COM port.
151 */
152static int h3600_uart_set_wake(struct uart_port *port, u_int enable)
153{ 60{
154 int err = -EINVAL; 61 h3xxx_map_io();
155 62
156 if (port->mapbase == _Ser3UTCR0) { 63 sa1100fb_lcd_power = h3600_lcd_power;
157 if (enable)
158 PWER |= PWER_GPIO23 | PWER_GPIO25; /* DCD and CTS */
159 else
160 PWER &= ~(PWER_GPIO23 | PWER_GPIO25); /* DCD and CTS */
161 err = 0;
162 }
163 return err;
164} 64}
165 65
166static struct sa1100_port_fns h3600_port_fns __initdata = {
167 .set_mctrl = h3600_uart_set_mctrl,
168 .get_mctrl = h3600_uart_get_mctrl,
169 .pm = h3600_uart_pm,
170 .set_wake = h3600_uart_set_wake,
171};
172
173/* 66/*
174 * helper for sa1100fb 67 * This turns the IRDA power on or off on the Compaq H3600
175 */ 68 */
176static void h3xxx_lcd_power(int enable) 69static int h3600_irda_set_power(struct device *dev, unsigned int state)
177{ 70{
178 assign_h3600_egpio(IPAQ_EGPIO_LCD_POWER, enable); 71 gpio_set_value(H3600_EGPIO_IR_ON, state);
72 return 0;
179} 73}
180 74
181static struct map_desc h3600_io_desc[] __initdata = { 75static void h3600_irda_set_speed(struct device *dev, unsigned int speed)
182 { /* static memory bank 2 CS#2 */
183 .virtual = H3600_BANK_2_VIRT,
184 .pfn = __phys_to_pfn(SA1100_CS2_PHYS),
185 .length = 0x02800000,
186 .type = MT_DEVICE
187 }, { /* static memory bank 4 CS#4 */
188 .virtual = H3600_BANK_4_VIRT,
189 .pfn = __phys_to_pfn(SA1100_CS4_PHYS),
190 .length = 0x00800000,
191 .type = MT_DEVICE
192 }, { /* EGPIO 0 CS#5 */
193 .virtual = H3600_EGPIO_VIRT,
194 .pfn = __phys_to_pfn(H3600_EGPIO_PHYS),
195 .length = 0x01000000,
196 .type = MT_DEVICE
197 }
198};
199
200/*
201 * Common map_io initialization
202 */
203
204static void __init h3xxx_map_io(void)
205{ 76{
206 sa1100_map_io(); 77 gpio_set_value(H3600_EGPIO_IR_FSEL, !(speed < 4000000));
207 iotable_init(h3600_io_desc, ARRAY_SIZE(h3600_io_desc));
208
209 sa1100_register_uart_fns(&h3600_port_fns);
210 sa1100_register_uart(0, 3); /* Common serial port */
211// sa1100_register_uart(1, 1); /* Microcontroller on 3100/3600 */
212
213 /* Ensure those pins are outputs and driving low */
214 PPDR |= PPC_TXD4 | PPC_SCLK | PPC_SFRM;
215 PPSR &= ~(PPC_TXD4 | PPC_SCLK | PPC_SFRM);
216
217 /* Configure suspend conditions */
218 PGSR = 0;
219 PWER = PWER_GPIO0 | PWER_RTC;
220 PCFR = PCFR_OPDE;
221 PSDR = 0;
222
223 sa1100fb_lcd_power = h3xxx_lcd_power;
224} 78}
225 79
226/************************* H3100 *************************/ 80static int h3600_irda_startup(struct device *dev)
227
228#ifdef CONFIG_SA1100_H3100
229
230#define H3100_EGPIO (*(volatile unsigned int *)H3600_EGPIO_VIRT)
231static unsigned int h3100_egpio = 0;
232
233static void h3100_control_egpio(enum ipaq_egpio_type x, int setp)
234{ 81{
235 unsigned int egpio = 0; 82 int err = gpio_request(H3600_EGPIO_IR_ON, "IrDA power");
236 long gpio = 0; 83 if (err)
237 unsigned long flags; 84 goto err1;
238 85 err = gpio_direction_output(H3600_EGPIO_IR_ON, 0);
239 switch (x) { 86 if (err)
240 case IPAQ_EGPIO_LCD_POWER: 87 goto err2;
241 egpio |= EGPIO_H3600_LCD_ON; 88 err = gpio_request(H3600_EGPIO_IR_FSEL, "IrDA fsel");
242 gpio |= GPIO_H3100_LCD_3V_ON; 89 if (err)
243 break; 90 goto err2;
244 case IPAQ_EGPIO_LCD_ENABLE: 91 err = gpio_direction_output(H3600_EGPIO_IR_FSEL, 0);
245 break; 92 if (err)
246 case IPAQ_EGPIO_CODEC_NRESET: 93 goto err3;
247 egpio |= EGPIO_H3600_CODEC_NRESET; 94 return 0;
248 break;
249 case IPAQ_EGPIO_AUDIO_ON:
250 gpio |= GPIO_H3100_AUD_PWR_ON
251 | GPIO_H3100_AUD_ON;
252 break;
253 case IPAQ_EGPIO_QMUTE:
254 gpio |= GPIO_H3100_QMUTE;
255 break;
256 case IPAQ_EGPIO_OPT_NVRAM_ON:
257 egpio |= EGPIO_H3600_OPT_NVRAM_ON;
258 break;
259 case IPAQ_EGPIO_OPT_ON:
260 egpio |= EGPIO_H3600_OPT_ON;
261 break;
262 case IPAQ_EGPIO_CARD_RESET:
263 egpio |= EGPIO_H3600_CARD_RESET;
264 break;
265 case IPAQ_EGPIO_OPT_RESET:
266 egpio |= EGPIO_H3600_OPT_RESET;
267 break;
268 case IPAQ_EGPIO_IR_ON:
269 gpio |= GPIO_H3100_IR_ON;
270 break;
271 case IPAQ_EGPIO_IR_FSEL:
272 gpio |= GPIO_H3100_IR_FSEL;
273 break;
274 case IPAQ_EGPIO_RS232_ON:
275 egpio |= EGPIO_H3600_RS232_ON;
276 break;
277 case IPAQ_EGPIO_VPP_ON:
278 egpio |= EGPIO_H3600_VPP_ON;
279 break;
280 }
281 95
282 if (egpio || gpio) { 96err3: gpio_free(H3600_EGPIO_IR_FSEL);
283 local_irq_save(flags); 97err2: gpio_free(H3600_EGPIO_IR_ON);
284 if (setp) { 98err1: return err;
285 h3100_egpio |= egpio;
286 GPSR = gpio;
287 } else {
288 h3100_egpio &= ~egpio;
289 GPCR = gpio;
290 }
291 H3100_EGPIO = h3100_egpio;
292 local_irq_restore(flags);
293 }
294} 99}
295 100
296#define H3100_DIRECT_EGPIO (GPIO_H3100_BT_ON \ 101static void h3600_irda_shutdown(struct device *dev)
297 | GPIO_H3100_GPIO3 \
298 | GPIO_H3100_QMUTE \
299 | GPIO_H3100_LCD_3V_ON \
300 | GPIO_H3100_AUD_ON \
301 | GPIO_H3100_AUD_PWR_ON \
302 | GPIO_H3100_IR_ON \
303 | GPIO_H3100_IR_FSEL)
304
305static void __init h3100_map_io(void)
306{ 102{
307 h3xxx_map_io(); 103 gpio_free(H3600_EGPIO_IR_ON);
308 104 gpio_free(H3600_EGPIO_IR_FSEL);
309 /* Initialize h3100-specific values here */
310 GPCR = 0x0fffffff; /* All outputs are set low by default */
311 GPDR = GPIO_H3600_COM_RTS | GPIO_H3600_L3_CLOCK |
312 GPIO_H3600_L3_MODE | GPIO_H3600_L3_DATA |
313 GPIO_H3600_CLK_SET1 | GPIO_H3600_CLK_SET0 |
314 H3100_DIRECT_EGPIO;
315
316 /* Older bootldrs put GPIO2-9 in alternate mode on the
317 assumption that they are used for video */
318 GAFR &= ~H3100_DIRECT_EGPIO;
319
320 H3100_EGPIO = h3100_egpio;
321 assign_h3600_egpio = h3100_control_egpio;
322} 105}
323 106
324MACHINE_START(H3100, "Compaq iPAQ H3100") 107static struct irda_platform_data h3600_irda_data = {
325 .phys_io = 0x80000000, 108 .set_power = h3600_irda_set_power,
326 .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc, 109 .set_speed = h3600_irda_set_speed,
327 .boot_params = 0xc0000100, 110 .startup = h3600_irda_startup,
328 .map_io = h3100_map_io, 111 .shutdown = h3600_irda_shutdown,
329 .init_irq = sa1100_init_irq, 112};
330 .timer = &sa1100_timer,
331 .init_machine = h3xxx_mach_init,
332MACHINE_END
333
334#endif /* CONFIG_SA1100_H3100 */
335
336/************************* H3600 *************************/
337
338#ifdef CONFIG_SA1100_H3600
339
340#define H3600_EGPIO (*(volatile unsigned int *)H3600_EGPIO_VIRT)
341static unsigned int h3600_egpio = EGPIO_H3600_RS232_ON;
342
343static void h3600_control_egpio(enum ipaq_egpio_type x, int setp)
344{
345 unsigned int egpio = 0;
346 unsigned long flags;
347
348 switch (x) {
349 case IPAQ_EGPIO_LCD_POWER:
350 egpio |= EGPIO_H3600_LCD_ON |
351 EGPIO_H3600_LCD_PCI |
352 EGPIO_H3600_LCD_5V_ON |
353 EGPIO_H3600_LVDD_ON;
354 break;
355 case IPAQ_EGPIO_LCD_ENABLE:
356 break;
357 case IPAQ_EGPIO_CODEC_NRESET:
358 egpio |= EGPIO_H3600_CODEC_NRESET;
359 break;
360 case IPAQ_EGPIO_AUDIO_ON:
361 egpio |= EGPIO_H3600_AUD_AMP_ON |
362 EGPIO_H3600_AUD_PWR_ON;
363 break;
364 case IPAQ_EGPIO_QMUTE:
365 egpio |= EGPIO_H3600_QMUTE;
366 break;
367 case IPAQ_EGPIO_OPT_NVRAM_ON:
368 egpio |= EGPIO_H3600_OPT_NVRAM_ON;
369 break;
370 case IPAQ_EGPIO_OPT_ON:
371 egpio |= EGPIO_H3600_OPT_ON;
372 break;
373 case IPAQ_EGPIO_CARD_RESET:
374 egpio |= EGPIO_H3600_CARD_RESET;
375 break;
376 case IPAQ_EGPIO_OPT_RESET:
377 egpio |= EGPIO_H3600_OPT_RESET;
378 break;
379 case IPAQ_EGPIO_IR_ON:
380 egpio |= EGPIO_H3600_IR_ON;
381 break;
382 case IPAQ_EGPIO_IR_FSEL:
383 egpio |= EGPIO_H3600_IR_FSEL;
384 break;
385 case IPAQ_EGPIO_RS232_ON:
386 egpio |= EGPIO_H3600_RS232_ON;
387 break;
388 case IPAQ_EGPIO_VPP_ON:
389 egpio |= EGPIO_H3600_VPP_ON;
390 break;
391 }
392 113
393 if (egpio) { 114static struct gpio_default_state h3600_default_gpio[] = {
394 local_irq_save(flags); 115 { H3XXX_GPIO_COM_DCD, GPIO_MODE_IN, "COM DCD" },
395 if (setp) 116 { H3XXX_GPIO_COM_CTS, GPIO_MODE_IN, "COM CTS" },
396 h3600_egpio |= egpio; 117 { H3XXX_GPIO_COM_RTS, GPIO_MODE_OUT0, "COM RTS" },
397 else 118};
398 h3600_egpio &= ~egpio;
399 H3600_EGPIO = h3600_egpio;
400 local_irq_restore(flags);
401 }
402}
403 119
404static void __init h3600_map_io(void) 120static void __init h3600_mach_init(void)
405{ 121{
406 h3xxx_map_io(); 122 h3xxx_init_gpio(h3600_default_gpio, ARRAY_SIZE(h3600_default_gpio));
407 123 h3xxx_mach_init();
408 /* Initialize h3600-specific values here */ 124 sa11x0_register_irda(&h3600_irda_data);
409
410 GPCR = 0x0fffffff; /* All outputs are set low by default */
411 GPDR = GPIO_H3600_COM_RTS | GPIO_H3600_L3_CLOCK |
412 GPIO_H3600_L3_MODE | GPIO_H3600_L3_DATA |
413 GPIO_H3600_CLK_SET1 | GPIO_H3600_CLK_SET0 |
414 GPIO_LDD15 | GPIO_LDD14 | GPIO_LDD13 | GPIO_LDD12 |
415 GPIO_LDD11 | GPIO_LDD10 | GPIO_LDD9 | GPIO_LDD8;
416
417 H3600_EGPIO = h3600_egpio; /* Maintains across sleep? */
418 assign_h3600_egpio = h3600_control_egpio;
419} 125}
420 126
421MACHINE_START(H3600, "Compaq iPAQ H3600") 127MACHINE_START(H3600, "Compaq iPAQ H3600")
@@ -425,8 +131,6 @@ MACHINE_START(H3600, "Compaq iPAQ H3600")
425 .map_io = h3600_map_io, 131 .map_io = h3600_map_io,
426 .init_irq = sa1100_init_irq, 132 .init_irq = sa1100_init_irq,
427 .timer = &sa1100_timer, 133 .timer = &sa1100_timer,
428 .init_machine = h3xxx_mach_init, 134 .init_machine = h3600_mach_init,
429MACHINE_END 135MACHINE_END
430 136
431#endif /* CONFIG_SA1100_H3600 */
432
diff --git a/arch/arm/mach-sa1100/h3xxx.c b/arch/arm/mach-sa1100/h3xxx.c
new file mode 100644
index 000000000000..b0784c974c2d
--- /dev/null
+++ b/arch/arm/mach-sa1100/h3xxx.c
@@ -0,0 +1,313 @@
1/*
2 * Support for Compaq iPAQ H3100 and H3600 handheld computers (common code)
3 *
4 * Copyright (c) 2000,1 Compaq Computer Corporation. (Author: Jamey Hicks)
5 * Copyright (c) 2009 Dmitry Artamonow <mad_soft@inbox.ru>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 */
12
13#include <linux/kernel.h>
14#include <linux/gpio.h>
15#include <linux/gpio_keys.h>
16#include <linux/input.h>
17#include <linux/mfd/htc-egpio.h>
18#include <linux/mtd/mtd.h>
19#include <linux/mtd/partitions.h>
20#include <linux/platform_device.h>
21#include <linux/serial_core.h>
22
23#include <asm/mach/flash.h>
24#include <asm/mach/map.h>
25#include <asm/mach/serial_sa1100.h>
26
27#include <mach/h3xxx.h>
28
29#include "generic.h"
30
31void h3xxx_init_gpio(struct gpio_default_state *s, size_t n)
32{
33 while (n--) {
34 const char *name = s->name;
35 int err;
36
37 if (!name)
38 name = "[init]";
39 err = gpio_request(s->gpio, name);
40 if (err) {
41 printk(KERN_ERR "gpio%u: unable to request: %d\n",
42 s->gpio, err);
43 continue;
44 }
45 if (s->mode >= 0) {
46 err = gpio_direction_output(s->gpio, s->mode);
47 } else {
48 err = gpio_direction_input(s->gpio);
49 }
50 if (err) {
51 printk(KERN_ERR "gpio%u: unable to set direction: %d\n",
52 s->gpio, err);
53 continue;
54 }
55 if (!s->name)
56 gpio_free(s->gpio);
57 s++;
58 }
59}
60
61
62/*
63 * H3xxx flash support
64 */
65static struct mtd_partition h3xxx_partitions[] = {
66 {
67 .name = "H3XXX boot firmware",
68 .size = 0x00040000,
69 .offset = 0,
70 .mask_flags = MTD_WRITEABLE, /* force read-only */
71 }, {
72 .name = "H3XXX rootfs",
73 .size = MTDPART_SIZ_FULL,
74 .offset = 0x00040000,
75 }
76};
77
78static void h3xxx_set_vpp(int vpp)
79{
80 gpio_set_value(H3XXX_EGPIO_VPP_ON, vpp);
81}
82
83static int h3xxx_flash_init(void)
84{
85 int err = gpio_request(H3XXX_EGPIO_VPP_ON, "Flash Vpp");
86 if (err) {
87 pr_err("%s: can't request H3XXX_EGPIO_VPP_ON\n", __func__);
88 return err;
89 }
90
91 err = gpio_direction_output(H3XXX_EGPIO_VPP_ON, 0);
92 if (err)
93 gpio_free(H3XXX_EGPIO_VPP_ON);
94
95 return err;
96}
97
98static void h3xxx_flash_exit(void)
99{
100 gpio_free(H3XXX_EGPIO_VPP_ON);
101}
102
103static struct flash_platform_data h3xxx_flash_data = {
104 .map_name = "cfi_probe",
105 .set_vpp = h3xxx_set_vpp,
106 .init = h3xxx_flash_init,
107 .exit = h3xxx_flash_exit,
108 .parts = h3xxx_partitions,
109 .nr_parts = ARRAY_SIZE(h3xxx_partitions),
110};
111
112static struct resource h3xxx_flash_resource = {
113 .start = SA1100_CS0_PHYS,
114 .end = SA1100_CS0_PHYS + SZ_32M - 1,
115 .flags = IORESOURCE_MEM,
116};
117
118
119/*
120 * H3xxx uart support
121 */
122static void h3xxx_uart_set_mctrl(struct uart_port *port, u_int mctrl)
123{
124 if (port->mapbase == _Ser3UTCR0) {
125 gpio_set_value(H3XXX_GPIO_COM_RTS, !(mctrl & TIOCM_RTS));
126 }
127}
128
129static u_int h3xxx_uart_get_mctrl(struct uart_port *port)
130{
131 u_int ret = TIOCM_CD | TIOCM_CTS | TIOCM_DSR;
132
133 if (port->mapbase == _Ser3UTCR0) {
134 /*
135 * DCD and CTS bits are inverted in GPLR by RS232 transceiver
136 */
137 if (gpio_get_value(H3XXX_GPIO_COM_DCD))
138 ret &= ~TIOCM_CD;
139 if (gpio_get_value(H3XXX_GPIO_COM_CTS))
140 ret &= ~TIOCM_CTS;
141 }
142
143 return ret;
144}
145
146static void h3xxx_uart_pm(struct uart_port *port, u_int state, u_int oldstate)
147{
148 if (port->mapbase == _Ser3UTCR0) {
149 if (!gpio_request(H3XXX_EGPIO_RS232_ON, "RS232 transceiver")) {
150 gpio_direction_output(H3XXX_EGPIO_RS232_ON, !state);
151 gpio_free(H3XXX_EGPIO_RS232_ON);
152 } else {
153 pr_err("%s: can't request H3XXX_EGPIO_RS232_ON\n",
154 __func__);
155 }
156 }
157}
158
159/*
160 * Enable/Disable wake up events for this serial port.
161 * Obviously, we only support this on the normal COM port.
162 */
163static int h3xxx_uart_set_wake(struct uart_port *port, u_int enable)
164{
165 int err = -EINVAL;
166
167 if (port->mapbase == _Ser3UTCR0) {
168 if (enable)
169 PWER |= PWER_GPIO23 | PWER_GPIO25; /* DCD and CTS */
170 else
171 PWER &= ~(PWER_GPIO23 | PWER_GPIO25); /* DCD and CTS */
172 err = 0;
173 }
174 return err;
175}
176
177static struct sa1100_port_fns h3xxx_port_fns __initdata = {
178 .set_mctrl = h3xxx_uart_set_mctrl,
179 .get_mctrl = h3xxx_uart_get_mctrl,
180 .pm = h3xxx_uart_pm,
181 .set_wake = h3xxx_uart_set_wake,
182};
183
184/*
185 * EGPIO
186 */
187
188static struct resource egpio_resources[] = {
189 [0] = {
190 .start = H3600_EGPIO_PHYS,
191 .end = H3600_EGPIO_PHYS + 0x4 - 1,
192 .flags = IORESOURCE_MEM,
193 },
194};
195
196static struct htc_egpio_chip egpio_chips[] = {
197 [0] = {
198 .reg_start = 0,
199 .gpio_base = H3XXX_EGPIO_BASE,
200 .num_gpios = 16,
201 .direction = HTC_EGPIO_OUTPUT,
202 .initial_values = 0x0080, /* H3XXX_EGPIO_RS232_ON */
203 },
204};
205
206static struct htc_egpio_platform_data egpio_info = {
207 .reg_width = 16,
208 .bus_width = 16,
209 .chip = egpio_chips,
210 .num_chips = ARRAY_SIZE(egpio_chips),
211};
212
213static struct platform_device h3xxx_egpio = {
214 .name = "htc-egpio",
215 .id = -1,
216 .resource = egpio_resources,
217 .num_resources = ARRAY_SIZE(egpio_resources),
218 .dev = {
219 .platform_data = &egpio_info,
220 },
221};
222
223/*
224 * GPIO keys
225 */
226
227static struct gpio_keys_button h3xxx_button_table[] = {
228 {
229 .code = KEY_POWER,
230 .gpio = H3XXX_GPIO_PWR_BUTTON,
231 .desc = "Power Button",
232 .active_low = 1,
233 .type = EV_KEY,
234 .wakeup = 1,
235 }, {
236 .code = KEY_ENTER,
237 .gpio = H3XXX_GPIO_ACTION_BUTTON,
238 .active_low = 1,
239 .desc = "Action button",
240 .type = EV_KEY,
241 .wakeup = 0,
242 },
243};
244
245static struct gpio_keys_platform_data h3xxx_keys_data = {
246 .buttons = h3xxx_button_table,
247 .nbuttons = ARRAY_SIZE(h3xxx_button_table),
248};
249
250static struct platform_device h3xxx_keys = {
251 .name = "gpio-keys",
252 .id = -1,
253 .dev = {
254 .platform_data = &h3xxx_keys_data,
255 },
256};
257
258static struct platform_device *h3xxx_devices[] = {
259 &h3xxx_egpio,
260 &h3xxx_keys,
261};
262
263void __init h3xxx_mach_init(void)
264{
265 sa1100_register_uart_fns(&h3xxx_port_fns);
266 sa11x0_register_mtd(&h3xxx_flash_data, &h3xxx_flash_resource, 1);
267 platform_add_devices(h3xxx_devices, ARRAY_SIZE(h3xxx_devices));
268}
269
270static struct map_desc h3600_io_desc[] __initdata = {
271 { /* static memory bank 2 CS#2 */
272 .virtual = H3600_BANK_2_VIRT,
273 .pfn = __phys_to_pfn(SA1100_CS2_PHYS),
274 .length = 0x02800000,
275 .type = MT_DEVICE
276 }, { /* static memory bank 4 CS#4 */
277 .virtual = H3600_BANK_4_VIRT,
278 .pfn = __phys_to_pfn(SA1100_CS4_PHYS),
279 .length = 0x00800000,
280 .type = MT_DEVICE
281 }, { /* EGPIO 0 CS#5 */
282 .virtual = H3600_EGPIO_VIRT,
283 .pfn = __phys_to_pfn(H3600_EGPIO_PHYS),
284 .length = 0x01000000,
285 .type = MT_DEVICE
286 }
287};
288
289/*
290 * Common map_io initialization
291 */
292
293void __init h3xxx_map_io(void)
294{
295 sa1100_map_io();
296 iotable_init(h3600_io_desc, ARRAY_SIZE(h3600_io_desc));
297
298 sa1100_register_uart(0, 3); /* Common serial port */
299// sa1100_register_uart(1, 1); /* Microcontroller on 3100/3600 */
300
301 /* Ensure those pins are outputs and driving low */
302 PPDR |= PPC_TXD4 | PPC_SCLK | PPC_SFRM;
303 PPSR &= ~(PPC_TXD4 | PPC_SCLK | PPC_SFRM);
304
305 /* Configure suspend conditions */
306 PGSR = 0;
307 PCFR = PCFR_OPDE;
308 PSDR = 0;
309
310 GPCR = 0x0fffffff; /* All outputs are set low by default */
311 GPDR = 0; /* Configure all GPIOs as input */
312}
313
diff --git a/arch/arm/mach-sa1100/hackkit.c b/arch/arm/mach-sa1100/hackkit.c
index e7056c0b562c..51568dfc8e97 100644
--- a/arch/arm/mach-sa1100/hackkit.c
+++ b/arch/arm/mach-sa1100/hackkit.c
@@ -187,7 +187,7 @@ static struct resource hackkit_flash_resource = {
187 187
188static void __init hackkit_init(void) 188static void __init hackkit_init(void)
189{ 189{
190 sa11x0_set_flash_data(&hackkit_flash_data, &hackkit_flash_resource, 1); 190 sa11x0_register_mtd(&hackkit_flash_data, &hackkit_flash_resource, 1);
191} 191}
192 192
193/********************************************************************** 193/**********************************************************************
diff --git a/arch/arm/mach-sa1100/include/mach/collie.h b/arch/arm/mach-sa1100/include/mach/collie.h
index 9efb569cdb60..71a0b3fdcc8c 100644
--- a/arch/arm/mach-sa1100/include/mach/collie.h
+++ b/arch/arm/mach-sa1100/include/mach/collie.h
@@ -25,29 +25,39 @@
25#define COLLIE_GPIO_VPEN (COLLIE_SCOOP_GPIO_BASE + 7) 25#define COLLIE_GPIO_VPEN (COLLIE_SCOOP_GPIO_BASE + 7)
26#define COLLIE_SCP_LB_VOL_CHG SCOOP_GPCR_PA19 26#define COLLIE_SCP_LB_VOL_CHG SCOOP_GPCR_PA19
27 27
28#define COLLIE_SCOOP_IO_DIR ( COLLIE_SCP_MUTE_L | COLLIE_SCP_MUTE_R | \ 28#define COLLIE_SCOOP_IO_DIR (COLLIE_SCP_MUTE_L | COLLIE_SCP_MUTE_R | \
29 COLLIE_SCP_5VON | COLLIE_SCP_AMP_ON | \ 29 COLLIE_SCP_5VON | COLLIE_SCP_AMP_ON | \
30 COLLIE_SCP_LB_VOL_CHG ) 30 COLLIE_SCP_LB_VOL_CHG)
31#define COLLIE_SCOOP_IO_OUT ( COLLIE_SCP_MUTE_L | COLLIE_SCP_MUTE_R ) 31#define COLLIE_SCOOP_IO_OUT (COLLIE_SCP_MUTE_L | COLLIE_SCP_MUTE_R)
32 32
33/* GPIOs for which the generic definition doesn't say much */ 33/* GPIOs for gpiolib */
34 34
35#define COLLIE_GPIO_ON_KEY GPIO_GPIO (0) 35#define COLLIE_GPIO_ON_KEY (0)
36#define COLLIE_GPIO_AC_IN GPIO_GPIO (1) 36#define COLLIE_GPIO_AC_IN (1)
37#define COLLIE_GPIO_SDIO_INT GPIO_GPIO (11) 37#define COLLIE_GPIO_SDIO_INT (11)
38#define COLLIE_GPIO_CF_IRQ GPIO_GPIO (14) 38#define COLLIE_GPIO_CF_IRQ (14)
39#define COLLIE_GPIO_nREMOCON_INT GPIO_GPIO (15) 39#define COLLIE_GPIO_nREMOCON_INT (15)
40#define COLLIE_GPIO_UCB1x00_RESET GPIO_GPIO (16) 40#define COLLIE_GPIO_UCB1x00_RESET (16)
41#define COLLIE_GPIO_nMIC_ON GPIO_GPIO (17) 41#define COLLIE_GPIO_nMIC_ON (17)
42#define COLLIE_GPIO_nREMOCON_ON GPIO_GPIO (18) 42#define COLLIE_GPIO_nREMOCON_ON (18)
43#define COLLIE_GPIO_CO GPIO_GPIO (20) 43#define COLLIE_GPIO_CO (20)
44#define COLLIE_GPIO_MCP_CLK GPIO_GPIO (21) 44#define COLLIE_GPIO_MCP_CLK (21)
45#define COLLIE_GPIO_CF_CD GPIO_GPIO (22) 45#define COLLIE_GPIO_CF_CD (22)
46#define COLLIE_GPIO_UCB1x00_IRQ GPIO_GPIO (23) 46#define COLLIE_GPIO_UCB1x00_IRQ (23)
47#define COLLIE_GPIO_WAKEUP GPIO_GPIO (24) 47#define COLLIE_GPIO_WAKEUP (24)
48#define COLLIE_GPIO_GA_INT GPIO_GPIO (25) 48#define COLLIE_GPIO_GA_INT (25)
49#define COLLIE_GPIO_MAIN_BAT_LOW GPIO_GPIO (26) 49#define COLLIE_GPIO_MAIN_BAT_LOW (26)
50 50
51/* GPIO definitions for direct register access */
52
53#define _COLLIE_GPIO_ON_KEY GPIO_GPIO(0)
54#define _COLLIE_GPIO_AC_IN GPIO_GPIO(1)
55#define _COLLIE_GPIO_nREMOCON_INT GPIO_GPIO(15)
56#define _COLLIE_GPIO_UCB1x00_RESET GPIO_GPIO(16)
57#define _COLLIE_GPIO_nMIC_ON GPIO_GPIO(17)
58#define _COLLIE_GPIO_nREMOCON_ON GPIO_GPIO(18)
59#define _COLLIE_GPIO_CO GPIO_GPIO(20)
60#define _COLLIE_GPIO_WAKEUP GPIO_GPIO(24)
51/* Interrupts */ 61/* Interrupts */
52 62
53#define COLLIE_IRQ_GPIO_ON_KEY IRQ_GPIO0 63#define COLLIE_IRQ_GPIO_ON_KEY IRQ_GPIO0
@@ -70,19 +80,20 @@
70#define COLLIE_LCM_IRQ_GPIO_nSD_WP IRQ_LOCOMO_GPIO14 80#define COLLIE_LCM_IRQ_GPIO_nSD_WP IRQ_LOCOMO_GPIO14
71 81
72/* GPIO's on the TC35143AF (Toshiba Analog Frontend) */ 82/* GPIO's on the TC35143AF (Toshiba Analog Frontend) */
73#define COLLIE_TC35143_GPIO_VERSION0 UCB_IO_0 /* GPIO0=Version */ 83#define COLLIE_TC35143_GPIO_BASE (GPIO_MAX + 13)
74#define COLLIE_TC35143_GPIO_TBL_CHK UCB_IO_1 /* GPIO1=TBL_CHK */ 84#define COLLIE_TC35143_GPIO_VERSION0 UCB_IO_0
75#define COLLIE_TC35143_GPIO_VPEN_ON UCB_IO_2 /* GPIO2=VPNE_ON */ 85#define COLLIE_TC35143_GPIO_TBL_CHK UCB_IO_1
76#define COLLIE_TC35143_GPIO_IR_ON UCB_IO_3 /* GPIO3=IR_ON */ 86#define COLLIE_TC35143_GPIO_VPEN_ON UCB_IO_2
77#define COLLIE_TC35143_GPIO_AMP_ON UCB_IO_4 /* GPIO4=AMP_ON */ 87#define COLLIE_TC35143_GPIO_IR_ON UCB_IO_3
78#define COLLIE_TC35143_GPIO_VERSION1 UCB_IO_5 /* GPIO5=Version */ 88#define COLLIE_TC35143_GPIO_AMP_ON UCB_IO_4
79#define COLLIE_TC35143_GPIO_FS8KLPF UCB_IO_5 /* GPIO5=fs 8k LPF */ 89#define COLLIE_TC35143_GPIO_VERSION1 UCB_IO_5
80#define COLLIE_TC35143_GPIO_BUZZER_BIAS UCB_IO_6 /* GPIO6=BUZZER BIAS */ 90#define COLLIE_TC35143_GPIO_FS8KLPF UCB_IO_5
81#define COLLIE_TC35143_GPIO_MBAT_ON UCB_IO_7 /* GPIO7=MBAT_ON */ 91#define COLLIE_TC35143_GPIO_BUZZER_BIAS UCB_IO_6
82#define COLLIE_TC35143_GPIO_BBAT_ON UCB_IO_8 /* GPIO8=BBAT_ON */ 92#define COLLIE_GPIO_MBAT_ON (COLLIE_TC35143_GPIO_BASE + 7)
83#define COLLIE_TC35143_GPIO_TMP_ON UCB_IO_9 /* GPIO9=TMP_ON */ 93#define COLLIE_GPIO_BBAT_ON (COLLIE_TC35143_GPIO_BASE + 8)
84#define COLLIE_TC35143_GPIO_IN ( UCB_IO_0 | UCB_IO_2 | UCB_IO_5 ) 94#define COLLIE_GPIO_TMP_ON (COLLIE_TC35143_GPIO_BASE + 9)
85#define COLLIE_TC35143_GPIO_OUT ( UCB_IO_1 | UCB_IO_3 | UCB_IO_4 | UCB_IO_6 | \ 95#define COLLIE_TC35143_GPIO_IN (UCB_IO_0 | UCB_IO_2 | UCB_IO_5)
86 UCB_IO_7 | UCB_IO_8 | UCB_IO_9 ) 96#define COLLIE_TC35143_GPIO_OUT (UCB_IO_1 | UCB_IO_3 | UCB_IO_4 \
97 | UCB_IO_6)
87 98
88#endif 99#endif
diff --git a/arch/arm/mach-sa1100/include/mach/gpio.h b/arch/arm/mach-sa1100/include/mach/gpio.h
index 582a0c92da53..7befc104e9a9 100644
--- a/arch/arm/mach-sa1100/include/mach/gpio.h
+++ b/arch/arm/mach-sa1100/include/mach/gpio.h
@@ -49,20 +49,9 @@ static inline void gpio_set_value(unsigned gpio, int value)
49 49
50#define gpio_cansleep __gpio_cansleep 50#define gpio_cansleep __gpio_cansleep
51 51
52static inline unsigned gpio_to_irq(unsigned gpio) 52#define gpio_to_irq(gpio) ((gpio < 11) ? (IRQ_GPIO0 + gpio) : \
53{ 53 (IRQ_GPIO11 - 11 + gpio))
54 if (gpio < 11) 54#define irq_to_gpio(irq) ((irq < IRQ_GPIO11_27) ? (irq - IRQ_GPIO0) : \
55 return IRQ_GPIO0 + gpio; 55 (irq - IRQ_GPIO11 + 11))
56 else
57 return IRQ_GPIO11 - 11 + gpio;
58}
59
60static inline unsigned irq_to_gpio(unsigned irq)
61{
62 if (irq < IRQ_GPIO11_27)
63 return irq - IRQ_GPIO0;
64 else
65 return irq - IRQ_GPIO11 + 11;
66}
67 56
68#endif 57#endif
diff --git a/arch/arm/mach-sa1100/include/mach/h3600.h b/arch/arm/mach-sa1100/include/mach/h3600.h
deleted file mode 100644
index 2827faa47421..000000000000
--- a/arch/arm/mach-sa1100/include/mach/h3600.h
+++ /dev/null
@@ -1,100 +0,0 @@
1/*
2 *
3 * Definitions for H3600 Handheld Computer
4 *
5 * Copyright 2000 Compaq Computer Corporation.
6 *
7 * Use consistent with the GNU GPL is permitted,
8 * provided that this copyright notice is
9 * preserved in its entirety in all copies and derived works.
10 *
11 * COMPAQ COMPUTER CORPORATION MAKES NO WARRANTIES, EXPRESSED OR IMPLIED,
12 * AS TO THE USEFULNESS OR CORRECTNESS OF THIS CODE OR ITS
13 * FITNESS FOR ANY PARTICULAR PURPOSE.
14 *
15 * Author: Jamey Hicks.
16 *
17 * History:
18 *
19 * 2001-10-?? Andrew Christian Added support for iPAQ H3800
20 *
21 */
22
23#ifndef _INCLUDE_H3600_H_
24#define _INCLUDE_H3600_H_
25
26typedef int __bitwise pm_request_t;
27
28#define PM_SUSPEND ((__force pm_request_t) 1) /* enter D1-D3 */
29#define PM_RESUME ((__force pm_request_t) 2) /* enter D0 */
30
31/* generalized support for H3xxx series Compaq Pocket PC's */
32#define machine_is_h3xxx() (machine_is_h3100() || machine_is_h3600())
33
34/* Physical memory regions corresponding to chip selects */
35#define H3600_EGPIO_PHYS (SA1100_CS5_PHYS + 0x01000000)
36#define H3600_BANK_2_PHYS SA1100_CS2_PHYS
37#define H3600_BANK_4_PHYS SA1100_CS4_PHYS
38
39/* Virtual memory regions corresponding to chip selects 2 & 4 (used on sleeves) */
40#define H3600_EGPIO_VIRT 0xf0000000
41#define H3600_BANK_2_VIRT 0xf1000000
42#define H3600_BANK_4_VIRT 0xf3800000
43
44/*
45 Machine-independent GPIO definitions
46 --- these are common across all current iPAQ platforms
47*/
48
49#define GPIO_H3600_NPOWER_BUTTON GPIO_GPIO (0) /* Also known as the "off button" */
50
51#define GPIO_H3600_PCMCIA_CD1 GPIO_GPIO (10)
52#define GPIO_H3600_PCMCIA_IRQ1 GPIO_GPIO (11)
53
54/* UDA1341 L3 Interface */
55#define GPIO_H3600_L3_DATA GPIO_GPIO (14)
56#define GPIO_H3600_L3_MODE GPIO_GPIO (15)
57#define GPIO_H3600_L3_CLOCK GPIO_GPIO (16)
58
59#define GPIO_H3600_PCMCIA_CD0 GPIO_GPIO (17)
60#define GPIO_H3600_SYS_CLK GPIO_GPIO (19)
61#define GPIO_H3600_PCMCIA_IRQ0 GPIO_GPIO (21)
62
63#define GPIO_H3600_COM_DCD GPIO_GPIO (23)
64#define GPIO_H3600_OPT_IRQ GPIO_GPIO (24)
65#define GPIO_H3600_COM_CTS GPIO_GPIO (25)
66#define GPIO_H3600_COM_RTS GPIO_GPIO (26)
67
68#define IRQ_GPIO_H3600_NPOWER_BUTTON IRQ_GPIO0
69#define IRQ_GPIO_H3600_PCMCIA_CD1 IRQ_GPIO10
70#define IRQ_GPIO_H3600_PCMCIA_IRQ1 IRQ_GPIO11
71#define IRQ_GPIO_H3600_PCMCIA_CD0 IRQ_GPIO17
72#define IRQ_GPIO_H3600_PCMCIA_IRQ0 IRQ_GPIO21
73#define IRQ_GPIO_H3600_COM_DCD IRQ_GPIO23
74#define IRQ_GPIO_H3600_OPT_IRQ IRQ_GPIO24
75#define IRQ_GPIO_H3600_COM_CTS IRQ_GPIO25
76
77
78#ifndef __ASSEMBLY__
79
80enum ipaq_egpio_type {
81 IPAQ_EGPIO_LCD_POWER, /* Power to the LCD panel */
82 IPAQ_EGPIO_CODEC_NRESET, /* Clear to reset the audio codec (remember to return high) */
83 IPAQ_EGPIO_AUDIO_ON, /* Audio power */
84 IPAQ_EGPIO_QMUTE, /* Audio muting */
85 IPAQ_EGPIO_OPT_NVRAM_ON, /* Non-volatile RAM on extension sleeves (SPI interface) */
86 IPAQ_EGPIO_OPT_ON, /* Power to extension sleeves */
87 IPAQ_EGPIO_CARD_RESET, /* Reset PCMCIA cards on extension sleeve (???) */
88 IPAQ_EGPIO_OPT_RESET, /* Reset option pack (???) */
89 IPAQ_EGPIO_IR_ON, /* IR sensor/emitter power */
90 IPAQ_EGPIO_IR_FSEL, /* IR speed selection 1->fast, 0->slow */
91 IPAQ_EGPIO_RS232_ON, /* Maxim RS232 chip power */
92 IPAQ_EGPIO_VPP_ON, /* Turn on power to flash programming */
93 IPAQ_EGPIO_LCD_ENABLE, /* Enable/disable LCD controller */
94};
95
96extern void (*assign_h3600_egpio)(enum ipaq_egpio_type x, int level);
97
98#endif /* ASSEMBLY */
99
100#endif /* _INCLUDE_H3600_H_ */
diff --git a/arch/arm/mach-sa1100/include/mach/h3600_gpio.h b/arch/arm/mach-sa1100/include/mach/h3600_gpio.h
deleted file mode 100644
index a36ca76d018b..000000000000
--- a/arch/arm/mach-sa1100/include/mach/h3600_gpio.h
+++ /dev/null
@@ -1,77 +0,0 @@
1/*
2 *
3 * Definitions for H3600 Handheld Computer
4 *
5 * Copyright 2000 Compaq Computer Corporation.
6 *
7 * Use consistent with the GNU GPL is permitted,
8 * provided that this copyright notice is
9 * preserved in its entirety in all copies and derived works.
10 *
11 * COMPAQ COMPUTER CORPORATION MAKES NO WARRANTIES, EXPRESSED OR IMPLIED,
12 * AS TO THE USEFULNESS OR CORRECTNESS OF THIS CODE OR ITS
13 * FITNESS FOR ANY PARTICULAR PURPOSE.
14 *
15 * Author: Jamey Hicks.
16 *
17 * History:
18 *
19 * 2001-10-?? Andrew Christian Added support for iPAQ H3800
20 *
21 */
22
23#ifndef _INCLUDE_H3600_GPIO_H_
24#define _INCLUDE_H3600_GPIO_H_
25
26/*
27 * GPIO lines that are common across ALL iPAQ models are in "h3600.h"
28 * This file contains machine-specific definitions
29 */
30
31#define GPIO_H3600_SUSPEND GPIO_GPIO (0)
32/* GPIO[2:9] used by LCD on H3600/3800, used as GPIO on H3100 */
33#define GPIO_H3100_BT_ON GPIO_GPIO (2)
34#define GPIO_H3100_GPIO3 GPIO_GPIO (3)
35#define GPIO_H3100_QMUTE GPIO_GPIO (4)
36#define GPIO_H3100_LCD_3V_ON GPIO_GPIO (5)
37#define GPIO_H3100_AUD_ON GPIO_GPIO (6)
38#define GPIO_H3100_AUD_PWR_ON GPIO_GPIO (7)
39#define GPIO_H3100_IR_ON GPIO_GPIO (8)
40#define GPIO_H3100_IR_FSEL GPIO_GPIO (9)
41
42/* for H3600, audio sample rate clock generator */
43#define GPIO_H3600_CLK_SET0 GPIO_GPIO (12)
44#define GPIO_H3600_CLK_SET1 GPIO_GPIO (13)
45
46#define GPIO_H3600_ACTION_BUTTON GPIO_GPIO (18)
47#define GPIO_H3600_SOFT_RESET GPIO_GPIO (20) /* Also known as BATT_FAULT */
48#define GPIO_H3600_OPT_LOCK GPIO_GPIO (22)
49#define GPIO_H3600_OPT_DET GPIO_GPIO (27)
50
51/****************************************************/
52
53#define IRQ_GPIO_H3600_ACTION_BUTTON IRQ_GPIO18
54#define IRQ_GPIO_H3600_OPT_DET IRQ_GPIO27
55
56/* H3100 / 3600 EGPIO pins */
57#define EGPIO_H3600_VPP_ON (1 << 0)
58#define EGPIO_H3600_CARD_RESET (1 << 1) /* reset the attached pcmcia/compactflash card. active high. */
59#define EGPIO_H3600_OPT_RESET (1 << 2) /* reset the attached option pack. active high. */
60#define EGPIO_H3600_CODEC_NRESET (1 << 3) /* reset the onboard UDA1341. active low. */
61#define EGPIO_H3600_OPT_NVRAM_ON (1 << 4) /* apply power to optionpack nvram, active high. */
62#define EGPIO_H3600_OPT_ON (1 << 5) /* full power to option pack. active high. */
63#define EGPIO_H3600_LCD_ON (1 << 6) /* enable 3.3V to LCD. active high. */
64#define EGPIO_H3600_RS232_ON (1 << 7) /* UART3 transceiver force on. Active high. */
65
66/* H3600 only EGPIO pins */
67#define EGPIO_H3600_LCD_PCI (1 << 8) /* LCD control IC enable. active high. */
68#define EGPIO_H3600_IR_ON (1 << 9) /* apply power to IR module. active high. */
69#define EGPIO_H3600_AUD_AMP_ON (1 << 10) /* apply power to audio power amp. active high. */
70#define EGPIO_H3600_AUD_PWR_ON (1 << 11) /* apply power to reset of audio circuit. active high. */
71#define EGPIO_H3600_QMUTE (1 << 12) /* mute control for onboard UDA1341. active high. */
72#define EGPIO_H3600_IR_FSEL (1 << 13) /* IR speed select: 1->fast, 0->slow */
73#define EGPIO_H3600_LCD_5V_ON (1 << 14) /* enable 5V to LCD. active high. */
74#define EGPIO_H3600_LVDD_ON (1 << 15) /* enable 9V and -6.5V to LCD. */
75
76
77#endif /* _INCLUDE_H3600_GPIO_H_ */
diff --git a/arch/arm/mach-sa1100/include/mach/h3xxx.h b/arch/arm/mach-sa1100/include/mach/h3xxx.h
new file mode 100644
index 000000000000..7d9df16f04a2
--- /dev/null
+++ b/arch/arm/mach-sa1100/include/mach/h3xxx.h
@@ -0,0 +1,94 @@
1/*
2 * Definitions for Compaq iPAQ H3100 and H3600 handheld computers
3 *
4 * (c) 2000 Compaq Computer Corporation. (Author: Jamey Hicks)
5 * (c) 2009 Dmitry Artamonow <mad_soft@inbox.ru>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 */
12
13#ifndef _INCLUDE_H3XXX_H_
14#define _INCLUDE_H3XXX_H_
15
16/* Physical memory regions corresponding to chip selects */
17#define H3600_EGPIO_PHYS (SA1100_CS5_PHYS + 0x01000000)
18#define H3600_BANK_2_PHYS SA1100_CS2_PHYS
19#define H3600_BANK_4_PHYS SA1100_CS4_PHYS
20
21/* Virtual memory regions corresponding to chip selects 2 & 4 (used on sleeves) */
22#define H3600_EGPIO_VIRT 0xf0000000
23#define H3600_BANK_2_VIRT 0xf1000000
24#define H3600_BANK_4_VIRT 0xf3800000
25
26/*
27 * gpiolib numbers for all iPAQs
28 */
29#define H3XXX_GPIO_PWR_BUTTON 0
30#define H3XXX_GPIO_PCMCIA_CD1 10
31#define H3XXX_GPIO_PCMCIA_IRQ1 11
32#define H3XXX_GPIO_PCMCIA_CD0 17
33#define H3XXX_GPIO_ACTION_BUTTON 18
34#define H3XXX_GPIO_SYS_CLK 19
35#define H3XXX_GPIO_PCMCIA_IRQ0 21
36#define H3XXX_GPIO_COM_DCD 23
37#define H3XXX_GPIO_OPTION 24
38#define H3XXX_GPIO_COM_CTS 25
39#define H3XXX_GPIO_COM_RTS 26
40
41/* machine-specific gpios */
42
43#define H3100_GPIO_BT_ON 2
44#define H3100_GPIO_QMUTE 4
45#define H3100_GPIO_LCD_3V_ON 5
46#define H3100_GPIO_AUD_ON 6
47#define H3100_GPIO_AUD_PWR_ON 7
48#define H3100_GPIO_IR_ON 8
49#define H3100_GPIO_IR_FSEL 9
50
51#define H3600_GPIO_CLK_SET0 12 /* audio sample rate clock generator */
52#define H3600_GPIO_CLK_SET1 13
53#define H3600_GPIO_SOFT_RESET 20 /* also known as BATT_FAULT */
54#define H3600_GPIO_OPT_LOCK 22
55#define H3600_GPIO_OPT_DET 27
56
57
58/* H3100 / 3600 EGPIO pins */
59#define H3XXX_EGPIO_BASE (GPIO_MAX + 1)
60
61#define H3XXX_EGPIO_VPP_ON (H3XXX_EGPIO_BASE + 0)
62#define H3XXX_EGPIO_CARD_RESET (H3XXX_EGPIO_BASE + 1) /* reset the attached pcmcia/compactflash card. active high. */
63#define H3XXX_EGPIO_OPT_RESET (H3XXX_EGPIO_BASE + 2) /* reset the attached option pack. active high. */
64#define H3XXX_EGPIO_CODEC_NRESET (H3XXX_EGPIO_BASE + 3) /* reset the onboard UDA1341. active low. */
65#define H3XXX_EGPIO_OPT_NVRAM_ON (H3XXX_EGPIO_BASE + 4) /* apply power to optionpack nvram, active high. */
66#define H3XXX_EGPIO_OPT_ON (H3XXX_EGPIO_BASE + 5) /* full power to option pack. active high. */
67#define H3XXX_EGPIO_LCD_ON (H3XXX_EGPIO_BASE + 6) /* enable 3.3V to LCD. active high. */
68#define H3XXX_EGPIO_RS232_ON (H3XXX_EGPIO_BASE + 7) /* UART3 transceiver force on. Active high. */
69
70/* H3600 only EGPIO pins */
71#define H3600_EGPIO_LCD_PCI (H3XXX_EGPIO_BASE + 8) /* LCD control IC enable. active high. */
72#define H3600_EGPIO_IR_ON (H3XXX_EGPIO_BASE + 9) /* apply power to IR module. active high. */
73#define H3600_EGPIO_AUD_AMP_ON (H3XXX_EGPIO_BASE + 10) /* apply power to audio power amp. active high. */
74#define H3600_EGPIO_AUD_PWR_ON (H3XXX_EGPIO_BASE + 11) /* apply power to reset of audio circuit. active high. */
75#define H3600_EGPIO_QMUTE (H3XXX_EGPIO_BASE + 12) /* mute control for onboard UDA1341. active high. */
76#define H3600_EGPIO_IR_FSEL (H3XXX_EGPIO_BASE + 13) /* IR speed select: 1->fast, 0->slow */
77#define H3600_EGPIO_LCD_5V_ON (H3XXX_EGPIO_BASE + 14) /* enable 5V to LCD. active high. */
78#define H3600_EGPIO_LVDD_ON (H3XXX_EGPIO_BASE + 15) /* enable 9V and -6.5V to LCD. */
79
80struct gpio_default_state {
81 int gpio;
82 int mode;
83 const char *name;
84};
85
86#define GPIO_MODE_IN -1
87#define GPIO_MODE_OUT0 0
88#define GPIO_MODE_OUT1 1
89
90void h3xxx_init_gpio(struct gpio_default_state *s, size_t n);
91void __init h3xxx_map_io(void);
92void __init h3xxx_mach_init(void);
93
94#endif /* _INCLUDE_H3XXX_H_ */
diff --git a/arch/arm/mach-sa1100/include/mach/mcp.h b/arch/arm/mach-sa1100/include/mach/mcp.h
index fb8b09a57ad7..ed1a331508a7 100644
--- a/arch/arm/mach-sa1100/include/mach/mcp.h
+++ b/arch/arm/mach-sa1100/include/mach/mcp.h
@@ -16,6 +16,7 @@ struct mcp_plat_data {
16 u32 mccr0; 16 u32 mccr0;
17 u32 mccr1; 17 u32 mccr1;
18 unsigned int sclk_rate; 18 unsigned int sclk_rate;
19 int gpio_base;
19}; 20};
20 21
21#endif 22#endif
diff --git a/arch/arm/mach-sa1100/jornada720.c b/arch/arm/mach-sa1100/jornada720.c
index fd776bb666cd..13ebd2d99bfd 100644
--- a/arch/arm/mach-sa1100/jornada720.c
+++ b/arch/arm/mach-sa1100/jornada720.c
@@ -354,7 +354,7 @@ static struct resource jornada720_flash_resource = {
354 354
355static void __init jornada720_mach_init(void) 355static void __init jornada720_mach_init(void)
356{ 356{
357 sa11x0_set_flash_data(&jornada720_flash_data, &jornada720_flash_resource, 1); 357 sa11x0_register_mtd(&jornada720_flash_data, &jornada720_flash_resource, 1);
358} 358}
359 359
360MACHINE_START(JORNADA720, "HP Jornada 720") 360MACHINE_START(JORNADA720, "HP Jornada 720")
diff --git a/arch/arm/mach-sa1100/lart.c b/arch/arm/mach-sa1100/lart.c
index 1f940df0e5af..68069d6dc07a 100644
--- a/arch/arm/mach-sa1100/lart.c
+++ b/arch/arm/mach-sa1100/lart.c
@@ -28,7 +28,7 @@ static struct mcp_plat_data lart_mcp_data = {
28 28
29static void __init lart_init(void) 29static void __init lart_init(void)
30{ 30{
31 sa11x0_set_mcp_data(&lart_mcp_data); 31 sa11x0_register_mcp(&lart_mcp_data);
32} 32}
33 33
34static struct map_desc lart_io_desc[] __initdata = { 34static struct map_desc lart_io_desc[] __initdata = {
diff --git a/arch/arm/mach-sa1100/pleb.c b/arch/arm/mach-sa1100/pleb.c
index e1458bc1868e..1ccd6018d3a3 100644
--- a/arch/arm/mach-sa1100/pleb.c
+++ b/arch/arm/mach-sa1100/pleb.c
@@ -109,7 +109,7 @@ static struct flash_platform_data pleb_flash_data = {
109 109
110static void __init pleb_init(void) 110static void __init pleb_init(void)
111{ 111{
112 sa11x0_set_flash_data(&pleb_flash_data, pleb_flash_resources, 112 sa11x0_register_mtd(&pleb_flash_data, pleb_flash_resources,
113 ARRAY_SIZE(pleb_flash_resources)); 113 ARRAY_SIZE(pleb_flash_resources));
114 114
115 115
diff --git a/arch/arm/mach-sa1100/shannon.c b/arch/arm/mach-sa1100/shannon.c
index ddd917d1083d..85e82bb73d7e 100644
--- a/arch/arm/mach-sa1100/shannon.c
+++ b/arch/arm/mach-sa1100/shannon.c
@@ -59,8 +59,8 @@ static struct mcp_plat_data shannon_mcp_data = {
59 59
60static void __init shannon_init(void) 60static void __init shannon_init(void)
61{ 61{
62 sa11x0_set_flash_data(&shannon_flash_data, &shannon_flash_resource, 1); 62 sa11x0_register_mtd(&shannon_flash_data, &shannon_flash_resource, 1);
63 sa11x0_set_mcp_data(&shannon_mcp_data); 63 sa11x0_register_mcp(&shannon_mcp_data);
64} 64}
65 65
66static void __init shannon_map_io(void) 66static void __init shannon_map_io(void)
diff --git a/arch/arm/mach-sa1100/simpad.c b/arch/arm/mach-sa1100/simpad.c
index 3c74534f7fee..49cfd64663ac 100644
--- a/arch/arm/mach-sa1100/simpad.c
+++ b/arch/arm/mach-sa1100/simpad.c
@@ -166,9 +166,9 @@ static void __init simpad_map_io(void)
166 PCFR = 0; 166 PCFR = 0;
167 PSDR = 0; 167 PSDR = 0;
168 168
169 sa11x0_set_flash_data(&simpad_flash_data, simpad_flash_resources, 169 sa11x0_register_mtd(&simpad_flash_data, simpad_flash_resources,
170 ARRAY_SIZE(simpad_flash_resources)); 170 ARRAY_SIZE(simpad_flash_resources));
171 sa11x0_set_mcp_data(&simpad_mcp_data); 171 sa11x0_register_mcp(&simpad_mcp_data);
172} 172}
173 173
174static void simpad_power_off(void) 174static void simpad_power_off(void)
diff --git a/arch/arm/mach-u300/Makefile b/arch/arm/mach-u300/Makefile
index 885b5c027c1e..fab46fe9a71f 100644
--- a/arch/arm/mach-u300/Makefile
+++ b/arch/arm/mach-u300/Makefile
@@ -12,3 +12,4 @@ obj-$(CONFIG_MMC) += mmc.o
12obj-$(CONFIG_SPI_PL022) += spi.o 12obj-$(CONFIG_SPI_PL022) += spi.o
13obj-$(CONFIG_MACH_U300_SPIDUMMY) += dummyspichip.o 13obj-$(CONFIG_MACH_U300_SPIDUMMY) += dummyspichip.o
14obj-$(CONFIG_I2C_STU300) += i2c.o 14obj-$(CONFIG_I2C_STU300) += i2c.o
15obj-$(CONFIG_REGULATOR_AB3100) += regulator.o
diff --git a/arch/arm/mach-u300/i2c.c b/arch/arm/mach-u300/i2c.c
index 10be1f888b27..c73ed06b6065 100644
--- a/arch/arm/mach-u300/i2c.c
+++ b/arch/arm/mach-u300/i2c.c
@@ -9,13 +9,257 @@
9 */ 9 */
10#include <linux/kernel.h> 10#include <linux/kernel.h>
11#include <linux/i2c.h> 11#include <linux/i2c.h>
12#include <linux/mfd/ab3100.h>
13#include <linux/regulator/machine.h>
14#include <linux/amba/bus.h>
12#include <mach/irqs.h> 15#include <mach/irqs.h>
13 16
17/*
18 * Initial settings of ab3100 registers.
19 * Common for below LDO regulator settings are that
20 * bit 7-5 controls voltage. Bit 4 turns regulator ON(1) or OFF(0).
21 * Bit 3-2 controls sleep enable and bit 1-0 controls sleep mode.
22 */
23
24/* LDO_A 0x16: 2.75V, ON, SLEEP_A, SLEEP OFF GND */
25#define LDO_A_SETTING 0x16
26/* LDO_C 0x10: 2.65V, ON, SLEEP_A or B, SLEEP full power */
27#define LDO_C_SETTING 0x10
28/* LDO_D 0x10: 2.65V, ON, sleep mode not used */
29#define LDO_D_SETTING 0x10
30/* LDO_E 0x10: 1.8V, ON, SLEEP_A or B, SLEEP full power */
31#define LDO_E_SETTING 0x10
32/* LDO_E SLEEP 0x00: 1.8V, not used, SLEEP_A or B, not used */
33#define LDO_E_SLEEP_SETTING 0x00
34/* LDO_F 0xD0: 2.5V, ON, SLEEP_A or B, SLEEP full power */
35#define LDO_F_SETTING 0xD0
36/* LDO_G 0x00: 2.85V, OFF, SLEEP_A or B, SLEEP full power */
37#define LDO_G_SETTING 0x00
38/* LDO_H 0x18: 2.75V, ON, SLEEP_B, SLEEP full power */
39#define LDO_H_SETTING 0x18
40/* LDO_K 0x00: 2.75V, OFF, SLEEP_A or B, SLEEP full power */
41#define LDO_K_SETTING 0x00
42/* LDO_EXT 0x00: Voltage not set, OFF, not used, not used */
43#define LDO_EXT_SETTING 0x00
44/* BUCK 0x7D: 1.2V, ON, SLEEP_A and B, SLEEP low power */
45#define BUCK_SETTING 0x7D
46/* BUCK SLEEP 0xAC: 1.05V, Not used, SLEEP_A and B, Not used */
47#define BUCK_SLEEP_SETTING 0xAC
48
49static struct regulator_consumer_supply supply_ldo_c[] = {
50 {
51 .dev_name = "ab3100-codec",
52 .supply = "vaudio", /* Powers the codec */
53 },
54};
55
56/*
57 * This one needs to be a supply so we can turn it off
58 * in order to shut down the system.
59 */
60static struct regulator_consumer_supply supply_ldo_d[] = {
61 {
62 .dev = NULL,
63 .supply = "vana15", /* Powers the SoC (CPU etc) */
64 },
65};
66
67static struct regulator_consumer_supply supply_ldo_g[] = {
68 {
69 .dev_name = "mmci",
70 .supply = "vmmc", /* Powers MMC/SD card */
71 },
72};
73
74static struct regulator_consumer_supply supply_ldo_h[] = {
75 {
76 .dev_name = "xgam_pdi",
77 .supply = "vdisp", /* Powers camera, display etc */
78 },
79};
80
81static struct regulator_consumer_supply supply_ldo_k[] = {
82 {
83 .dev_name = "irda",
84 .supply = "vir", /* Power IrDA */
85 },
86};
87
88/*
89 * This is a placeholder for whoever wish to use the
90 * external power.
91 */
92static struct regulator_consumer_supply supply_ldo_ext[] = {
93 {
94 .dev = NULL,
95 .supply = "vext", /* External power */
96 },
97};
98
99/* Preset (hardware defined) voltages for these regulators */
100#define LDO_A_VOLTAGE 2750000
101#define LDO_C_VOLTAGE 2650000
102#define LDO_D_VOLTAGE 2650000
103
104static struct ab3100_platform_data ab3100_plf_data = {
105 .reg_constraints = {
106 /* LDO A routing and constraints */
107 {
108 .constraints = {
109 .name = "vrad",
110 .min_uV = LDO_A_VOLTAGE,
111 .max_uV = LDO_A_VOLTAGE,
112 .valid_modes_mask = REGULATOR_MODE_NORMAL,
113 .always_on = 1,
114 .boot_on = 1,
115 },
116 },
117 /* LDO C routing and constraints */
118 {
119 .constraints = {
120 .min_uV = LDO_C_VOLTAGE,
121 .max_uV = LDO_C_VOLTAGE,
122 .valid_modes_mask = REGULATOR_MODE_NORMAL,
123 },
124 .num_consumer_supplies = ARRAY_SIZE(supply_ldo_c),
125 .consumer_supplies = supply_ldo_c,
126 },
127 /* LDO D routing and constraints */
128 {
129 .constraints = {
130 .min_uV = LDO_D_VOLTAGE,
131 .max_uV = LDO_D_VOLTAGE,
132 .valid_modes_mask = REGULATOR_MODE_NORMAL,
133 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
134 /*
135 * Actually this is boot_on but we need
136 * to reference count it externally to
137 * be able to shut down the system.
138 */
139 },
140 .num_consumer_supplies = ARRAY_SIZE(supply_ldo_d),
141 .consumer_supplies = supply_ldo_d,
142 },
143 /* LDO E routing and constraints */
144 {
145 .constraints = {
146 .name = "vio",
147 .min_uV = 1800000,
148 .max_uV = 1800000,
149 .valid_modes_mask = REGULATOR_MODE_NORMAL,
150 .valid_ops_mask =
151 REGULATOR_CHANGE_VOLTAGE |
152 REGULATOR_CHANGE_STATUS,
153 .always_on = 1,
154 .boot_on = 1,
155 },
156 },
157 /* LDO F routing and constraints */
158 {
159 .constraints = {
160 .name = "vana25",
161 .min_uV = 2500000,
162 .max_uV = 2500000,
163 .valid_modes_mask = REGULATOR_MODE_NORMAL,
164 .valid_ops_mask =
165 REGULATOR_CHANGE_VOLTAGE |
166 REGULATOR_CHANGE_STATUS,
167 .always_on = 1,
168 .boot_on = 1,
169 },
170 },
171 /* LDO G routing and constraints */
172 {
173 .constraints = {
174 .min_uV = 1500000,
175 .max_uV = 2850000,
176 .valid_modes_mask = REGULATOR_MODE_NORMAL,
177 .valid_ops_mask =
178 REGULATOR_CHANGE_VOLTAGE |
179 REGULATOR_CHANGE_STATUS,
180 },
181 .num_consumer_supplies = ARRAY_SIZE(supply_ldo_g),
182 .consumer_supplies = supply_ldo_g,
183 },
184 /* LDO H routing and constraints */
185 {
186 .constraints = {
187 .min_uV = 1200000,
188 .max_uV = 2750000,
189 .valid_modes_mask = REGULATOR_MODE_NORMAL,
190 .valid_ops_mask =
191 REGULATOR_CHANGE_VOLTAGE |
192 REGULATOR_CHANGE_STATUS,
193 },
194 .num_consumer_supplies = ARRAY_SIZE(supply_ldo_h),
195 .consumer_supplies = supply_ldo_h,
196 },
197 /* LDO K routing and constraints */
198 {
199 .constraints = {
200 .min_uV = 1800000,
201 .max_uV = 2750000,
202 .valid_modes_mask = REGULATOR_MODE_NORMAL,
203 .valid_ops_mask =
204 REGULATOR_CHANGE_VOLTAGE |
205 REGULATOR_CHANGE_STATUS,
206 },
207 .num_consumer_supplies = ARRAY_SIZE(supply_ldo_k),
208 .consumer_supplies = supply_ldo_k,
209 },
210 /* External regulator interface. No fixed voltage specified.
211 * If we knew the voltage of the external regulator and it
212 * was connected on the board, we could add the (fixed)
213 * voltage for it here.
214 */
215 {
216 .constraints = {
217 .min_uV = 0,
218 .max_uV = 0,
219 .valid_modes_mask = REGULATOR_MODE_NORMAL,
220 .valid_ops_mask =
221 REGULATOR_CHANGE_STATUS,
222 },
223 .num_consumer_supplies = ARRAY_SIZE(supply_ldo_ext),
224 .consumer_supplies = supply_ldo_ext,
225 },
226 /* Buck converter routing and constraints */
227 {
228 .constraints = {
229 .name = "vcore",
230 .min_uV = 1200000,
231 .max_uV = 1800000,
232 .valid_modes_mask = REGULATOR_MODE_NORMAL,
233 .valid_ops_mask =
234 REGULATOR_CHANGE_VOLTAGE |
235 REGULATOR_CHANGE_STATUS,
236 .always_on = 1,
237 .boot_on = 1,
238 },
239 },
240 },
241 .reg_initvals = {
242 LDO_A_SETTING,
243 LDO_C_SETTING,
244 LDO_E_SETTING,
245 LDO_E_SLEEP_SETTING,
246 LDO_F_SETTING,
247 LDO_G_SETTING,
248 LDO_H_SETTING,
249 LDO_K_SETTING,
250 LDO_EXT_SETTING,
251 BUCK_SETTING,
252 BUCK_SLEEP_SETTING,
253 LDO_D_SETTING,
254 },
255};
256
14static struct i2c_board_info __initdata bus0_i2c_board_info[] = { 257static struct i2c_board_info __initdata bus0_i2c_board_info[] = {
15 { 258 {
16 .type = "ab3100", 259 .type = "ab3100",
17 .addr = 0x48, 260 .addr = 0x48,
18 .irq = IRQ_U300_IRQ0_EXT, 261 .irq = IRQ_U300_IRQ0_EXT,
262 .platform_data = &ab3100_plf_data,
19 }, 263 },
20}; 264};
21 265
@@ -38,6 +282,11 @@ void __init u300_i2c_register_board_devices(void)
38{ 282{
39 i2c_register_board_info(0, bus0_i2c_board_info, 283 i2c_register_board_info(0, bus0_i2c_board_info,
40 ARRAY_SIZE(bus0_i2c_board_info)); 284 ARRAY_SIZE(bus0_i2c_board_info));
285 /*
286 * This makes the core shut down all unused regulators
287 * after all the initcalls have completed.
288 */
289 regulator_has_full_constraints();
41 i2c_register_board_info(1, bus1_i2c_board_info, 290 i2c_register_board_info(1, bus1_i2c_board_info,
42 ARRAY_SIZE(bus1_i2c_board_info)); 291 ARRAY_SIZE(bus1_i2c_board_info));
43} 292}
diff --git a/arch/arm/mach-u300/mmc.c b/arch/arm/mach-u300/mmc.c
index 7b6b016786bb..109f5a6e71c7 100644
--- a/arch/arm/mach-u300/mmc.c
+++ b/arch/arm/mach-u300/mmc.c
@@ -40,64 +40,6 @@ static unsigned int mmc_status(struct device *dev)
40 return mmci_card->mmc_inserted; 40 return mmci_card->mmc_inserted;
41} 41}
42 42
43/*
44 * Here follows a large chunk of code which will only be enabled if you
45 * have both the AB3100 chip mounted and the MMC subsystem activated.
46 */
47
48static u32 mmc_translate_vdd(struct device *dev, unsigned int voltage)
49{
50 int v;
51
52 /*
53 * MMC Spec:
54 * bit 7: 1.70 - 1.95V
55 * bit 8 - 14: 2.0 - 2.6V
56 * bit 15 - 23: 2.7 - 3.6V
57 *
58 * ab3100 voltages:
59 * 000 - 2.85V
60 * 001 - 2.75V
61 * 010 - 1.8V
62 * 011 - 1.5V
63 */
64 switch (voltage) {
65 case 8:
66 v = 3;
67 break;
68 case 9:
69 case 10:
70 case 11:
71 case 12:
72 case 13:
73 case 14:
74 case 15:
75 v = 1;
76 break;
77 case 16:
78 v = 1;
79 break;
80 case 17:
81 case 18:
82 case 19:
83 case 20:
84 case 21:
85 case 22:
86 case 23:
87 case 24:
88 v = 0;
89 break;
90 default:
91 v = 0;
92 break;
93 }
94
95 /* PL180 voltage register bits */
96 return v << 2;
97}
98
99
100
101static int mmci_callback(void *data) 43static int mmci_callback(void *data)
102{ 44{
103 struct mmci_card_event *mmci_card = data; 45 struct mmci_card_event *mmci_card = data;
@@ -154,9 +96,11 @@ int __devinit mmc_init(struct amba_device *adev)
154 if (!mmci_card) 96 if (!mmci_card)
155 return -ENOMEM; 97 return -ENOMEM;
156 98
99 /*
100 * Do not set ocr_mask or voltage translation function,
101 * we have a regulator we can control instead.
102 */
157 /* Nominally 2.85V on our platform */ 103 /* Nominally 2.85V on our platform */
158 mmci_card->mmc0_plat_data.ocr_mask = MMC_VDD_28_29;
159 mmci_card->mmc0_plat_data.translate_vdd = mmc_translate_vdd;
160 mmci_card->mmc0_plat_data.status = mmc_status; 104 mmci_card->mmc0_plat_data.status = mmc_status;
161 mmci_card->mmc0_plat_data.gpio_wp = -1; 105 mmci_card->mmc0_plat_data.gpio_wp = -1;
162 mmci_card->mmc0_plat_data.gpio_cd = -1; 106 mmci_card->mmc0_plat_data.gpio_cd = -1;
diff --git a/arch/arm/mach-u300/regulator.c b/arch/arm/mach-u300/regulator.c
new file mode 100644
index 000000000000..9c53f01c62eb
--- /dev/null
+++ b/arch/arm/mach-u300/regulator.c
@@ -0,0 +1,88 @@
1/*
2 * arch/arm/mach-u300/regulator.c
3 *
4 * Copyright (C) 2009 ST-Ericsson AB
5 * License terms: GNU General Public License (GPL) version 2
6 * Handle board-bound regulators and board power not related
7 * to any devices.
8 * Author: Linus Walleij <linus.walleij@stericsson.com>
9 */
10#include <linux/device.h>
11#include <linux/signal.h>
12#include <linux/err.h>
13#include <linux/regulator/consumer.h>
14/* Those are just for writing in syscon */
15#include <linux/io.h>
16#include <mach/hardware.h>
17#include <mach/syscon.h>
18
19/*
20 * Regulators that power the board and chip and which are
21 * not copuled to specific drivers are hogged in these
22 * instances.
23 */
24static struct regulator *main_power_15;
25
26/*
27 * This function is used from pm.h to shut down the system by
28 * resetting all regulators in turn and then disable regulator
29 * LDO D (main power).
30 */
31void u300_pm_poweroff(void)
32{
33 sigset_t old, all;
34
35 sigfillset(&all);
36 if (!sigprocmask(SIG_BLOCK, &all, &old)) {
37 /* Disable LDO D to shut down the system */
38 if (main_power_15)
39 regulator_disable(main_power_15);
40 else
41 pr_err("regulator not available to shut down system\n");
42 (void) sigprocmask(SIG_SETMASK, &old, NULL);
43 }
44 return;
45}
46
47/*
48 * Hog the regulators needed to power up the board.
49 */
50static int __init u300_init_boardpower(void)
51{
52 int err;
53 u32 val;
54
55 pr_info("U300: setting up board power\n");
56 main_power_15 = regulator_get(NULL, "vana15");
57 if (IS_ERR(main_power_15)) {
58 pr_err("could not get vana15");
59 return PTR_ERR(main_power_15);
60 }
61 err = regulator_enable(main_power_15);
62 if (err) {
63 pr_err("could not enable vana15\n");
64 return err;
65 }
66
67 /*
68 * On U300 a special system controller register pulls up the DC
69 * until the vana15 (LDO D) regulator comes up. At this point, all
70 * regulators are set and we do not need power control via
71 * DC ON anymore. This function will likely be moved whenever
72 * the rest of the U300 power management is implemented.
73 */
74 pr_info("U300: disable system controller pull-up\n");
75 val = readw(U300_SYSCON_VBASE + U300_SYSCON_PMCR);
76 val &= ~U300_SYSCON_PMCR_DCON_ENABLE;
77 writew(val, U300_SYSCON_VBASE + U300_SYSCON_PMCR);
78
79 /* Register globally exported PM poweroff hook */
80 pm_power_off = u300_pm_poweroff;
81
82 return 0;
83}
84
85/*
86 * So at module init time we hog the regulator!
87 */
88module_init(u300_init_boardpower);
diff --git a/arch/arm/mach-ux500/Kconfig b/arch/arm/mach-ux500/Kconfig
new file mode 100644
index 000000000000..03625d744857
--- /dev/null
+++ b/arch/arm/mach-ux500/Kconfig
@@ -0,0 +1,15 @@
1menu "ST-Ericsson platform type"
2 depends on ARCH_U8500
3
4comment "ST-Ericsson Multicore Mobile Platforms"
5
6config MACH_U8500_MOP
7 bool "U8500 Early Development platform"
8 default y
9 select ARM_GIC
10 select HAS_MTU
11 help
12 Include support for mop500 development platform
13 based on U8500 architecture. The platform is based
14 on early drop silicon version of 8500.
15endmenu
diff --git a/arch/arm/mach-ux500/Makefile b/arch/arm/mach-ux500/Makefile
new file mode 100644
index 000000000000..95e6e24c0042
--- /dev/null
+++ b/arch/arm/mach-ux500/Makefile
@@ -0,0 +1,8 @@
1#
2# Makefile for the linux kernel, U8500 machine.
3#
4
5obj-y := clock.o
6obj-$(CONFIG_ARCH_U8500) += cpu-u8500.o
7obj-$(CONFIG_MACH_U8500_MOP) += board-mop500.o
8obj-$(CONFIG_SMP) += platsmp.o headsmp.o localtimer.o
diff --git a/arch/arm/mach-ux500/Makefile.boot b/arch/arm/mach-ux500/Makefile.boot
new file mode 100644
index 000000000000..c7e75acfe6c9
--- /dev/null
+++ b/arch/arm/mach-ux500/Makefile.boot
@@ -0,0 +1,4 @@
1 zreladdr-y := 0x00008000
2params_phys-y := 0x00000100
3initrd_phys-y := 0x00800000
4
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
new file mode 100644
index 000000000000..aa5afbcc90f9
--- /dev/null
+++ b/arch/arm/mach-ux500/board-mop500.c
@@ -0,0 +1,158 @@
1/*
2 * Copyright (C) 2008-2009 ST-Ericsson
3 *
4 * Author: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
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 */
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/interrupt.h>
14#include <linux/platform_device.h>
15#include <linux/io.h>
16#include <linux/amba/bus.h>
17#include <linux/amba/pl022.h>
18#include <linux/spi/spi.h>
19
20#include <asm/localtimer.h>
21#include <asm/mach-types.h>
22#include <asm/mach/arch.h>
23
24#include <plat/mtu.h>
25
26#include <mach/hardware.h>
27#include <mach/setup.h>
28
29#define __MEM_4K_RESOURCE(x) \
30 .res = {.start = (x), .end = (x) + SZ_4K - 1, .flags = IORESOURCE_MEM}
31
32/* These are active devices on this board */
33static struct amba_device uart0_device = {
34 .dev = { .init_name = "uart0" },
35 __MEM_4K_RESOURCE(U8500_UART0_BASE),
36 .irq = {IRQ_UART0, NO_IRQ},
37};
38
39static struct amba_device uart1_device = {
40 .dev = { .init_name = "uart1" },
41 __MEM_4K_RESOURCE(U8500_UART1_BASE),
42 .irq = {IRQ_UART1, NO_IRQ},
43};
44
45static struct amba_device uart2_device = {
46 .dev = { .init_name = "uart2" },
47 __MEM_4K_RESOURCE(U8500_UART2_BASE),
48 .irq = {IRQ_UART2, NO_IRQ},
49};
50
51static void ab4500_spi_cs_control(u32 command)
52{
53 /* set the FRM signal, which is CS - TODO */
54}
55
56struct pl022_config_chip ab4500_chip_info = {
57 .lbm = LOOPBACK_DISABLED,
58 .com_mode = INTERRUPT_TRANSFER,
59 .iface = SSP_INTERFACE_MOTOROLA_SPI,
60 /* we can act as master only */
61 .hierarchy = SSP_MASTER,
62 .slave_tx_disable = 0,
63 .endian_rx = SSP_RX_MSB,
64 .endian_tx = SSP_TX_MSB,
65 .data_size = SSP_DATA_BITS_24,
66 .rx_lev_trig = SSP_RX_1_OR_MORE_ELEM,
67 .tx_lev_trig = SSP_TX_1_OR_MORE_EMPTY_LOC,
68 .clk_phase = SSP_CLK_SECOND_EDGE,
69 .clk_pol = SSP_CLK_POL_IDLE_HIGH,
70 .cs_control = ab4500_spi_cs_control,
71};
72
73static struct spi_board_info u8500_spi_devices[] = {
74 {
75 .modalias = "ab4500",
76 .controller_data = &ab4500_chip_info,
77 .max_speed_hz = 12000000,
78 .bus_num = 0,
79 .chip_select = 0,
80 .mode = SPI_MODE_0,
81 .irq = IRQ_AB4500,
82 },
83};
84
85static struct pl022_ssp_controller ssp0_platform_data = {
86 .bus_id = 0,
87 /* pl022 not yet supports dma */
88 .enable_dma = 0,
89 /* on this platform, gpio 31,142,144,214 &
90 * 224 are connected as chip selects
91 */
92 .num_chipselect = 5,
93};
94
95static struct amba_device pl022_device = {
96 .dev = {
97 .coherent_dma_mask = ~0,
98 .init_name = "pl022",
99 .platform_data = &ssp0_platform_data,
100 },
101 .res = {
102 .start = U8500_SSP0_BASE,
103 .end = U8500_SSP0_BASE + SZ_4K - 1,
104 .flags = IORESOURCE_MEM,
105 },
106 .irq = {IRQ_SSP0, NO_IRQ },
107 /* ST-Ericsson modified id */
108 .periphid = SSP_PER_ID,
109};
110
111static struct amba_device *amba_devs[] __initdata = {
112 &uart0_device,
113 &uart1_device,
114 &uart2_device,
115 &pl022_device,
116};
117
118static void __init u8500_timer_init(void)
119{
120#ifdef CONFIG_LOCAL_TIMERS
121 /* Setup the local timer base */
122 twd_base = __io_address(U8500_TWD_BASE);
123#endif
124 /* Setup the MTU base */
125 mtu_base = __io_address(U8500_MTU0_BASE);
126
127 nmdk_timer_init();
128}
129
130static struct sys_timer u8500_timer = {
131 .init = u8500_timer_init,
132};
133
134static void __init u8500_init_machine(void)
135{
136 int i;
137
138 /* Register the active AMBA devices on this board */
139 for (i = 0; i < ARRAY_SIZE(amba_devs); i++)
140 amba_device_register(amba_devs[i], &iomem_resource);
141
142 spi_register_board_info(u8500_spi_devices,
143 ARRAY_SIZE(u8500_spi_devices));
144
145 u8500_init_devices();
146}
147
148MACHINE_START(U8500, "ST-Ericsson MOP500 platform")
149 /* Maintainer: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com> */
150 .phys_io = U8500_UART2_BASE,
151 .io_pg_offst = (IO_ADDRESS(U8500_UART2_BASE) >> 18) & 0xfffc,
152 .boot_params = 0x100,
153 .map_io = u8500_map_io,
154 .init_irq = u8500_init_irq,
155 /* we re-use nomadik timer here */
156 .timer = &u8500_timer,
157 .init_machine = u8500_init_machine,
158MACHINE_END
diff --git a/arch/arm/mach-ux500/clock.c b/arch/arm/mach-ux500/clock.c
new file mode 100644
index 000000000000..20b6ebb6783a
--- /dev/null
+++ b/arch/arm/mach-ux500/clock.c
@@ -0,0 +1,95 @@
1/*
2 * Copyright (C) 2009 ST-Ericsson
3 * heavily based on realview platform
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 */
9#include <linux/module.h>
10#include <linux/kernel.h>
11#include <linux/list.h>
12#include <linux/errno.h>
13#include <linux/err.h>
14#include <linux/clk.h>
15#include <linux/mutex.h>
16
17#include <asm/clkdev.h>
18
19/* currently the clk structure
20 * just supports rate. This would
21 * be extended as and when new devices are
22 * added - TODO
23 */
24struct clk {
25 unsigned long rate;
26};
27
28int clk_enable(struct clk *clk)
29{
30 return 0;
31}
32EXPORT_SYMBOL(clk_enable);
33
34void clk_disable(struct clk *clk)
35{
36}
37EXPORT_SYMBOL(clk_disable);
38
39unsigned long clk_get_rate(struct clk *clk)
40{
41 return clk->rate;
42}
43EXPORT_SYMBOL(clk_get_rate);
44
45long clk_round_rate(struct clk *clk, unsigned long rate)
46{
47 /*TODO*/
48 return rate;
49}
50EXPORT_SYMBOL(clk_round_rate);
51
52int clk_set_rate(struct clk *clk, unsigned long rate)
53{
54 clk->rate = rate;
55 return 0;
56}
57EXPORT_SYMBOL(clk_set_rate);
58
59/* ssp clock */
60static struct clk ssp_clk = {
61 .rate = 48000000,
62};
63
64/* fixed clock */
65static struct clk f38_clk = {
66 .rate = 38400000,
67};
68
69static struct clk_lookup lookups[] = {
70 {
71 /* UART0 */
72 .dev_id = "uart0",
73 .clk = &f38_clk,
74 }, { /* UART1 */
75 .dev_id = "uart1",
76 .clk = &f38_clk,
77 }, { /* UART2 */
78 .dev_id = "uart2",
79 .clk = &f38_clk,
80 }, { /* SSP */
81 .dev_id = "pl022",
82 .clk = &ssp_clk,
83 }
84};
85
86static int __init clk_init(void)
87{
88 int i;
89
90 /* register the clock lookups */
91 for (i = 0; i < ARRAY_SIZE(lookups); i++)
92 clkdev_add(&lookups[i]);
93 return 0;
94}
95arch_initcall(clk_init);
diff --git a/arch/arm/mach-ux500/cpu-u8500.c b/arch/arm/mach-ux500/cpu-u8500.c
new file mode 100644
index 000000000000..5f05e5850f71
--- /dev/null
+++ b/arch/arm/mach-ux500/cpu-u8500.c
@@ -0,0 +1,64 @@
1/*
2 * Copyright (C) 2008-2009 ST-Ericsson
3 *
4 * Author: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
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 */
11#include <linux/types.h>
12#include <linux/init.h>
13#include <linux/device.h>
14#include <linux/amba/bus.h>
15#include <linux/irq.h>
16#include <linux/platform_device.h>
17
18#include <asm/hardware/gic.h>
19#include <asm/mach/map.h>
20#include <mach/hardware.h>
21
22/* add any platform devices here - TODO */
23static struct platform_device *platform_devs[] __initdata = {
24 /* yet to be added, add i2c0, gpio.. */
25};
26
27#define __IO_DEV_DESC(x, sz) { \
28 .virtual = IO_ADDRESS(x), \
29 .pfn = __phys_to_pfn(x), \
30 .length = sz, \
31 .type = MT_DEVICE, \
32}
33
34/* minimum static i/o mapping required to boot U8500 platforms */
35static struct map_desc u8500_io_desc[] __initdata = {
36 __IO_DEV_DESC(U8500_GIC_CPU_BASE, SZ_4K),
37 __IO_DEV_DESC(U8500_GIC_DIST_BASE, SZ_4K),
38 __IO_DEV_DESC(U8500_MTU0_BASE, SZ_4K),
39 __IO_DEV_DESC(U8500_TWD_BASE, SZ_4K),
40 __IO_DEV_DESC(U8500_SCU_BASE, SZ_4K),
41 __IO_DEV_DESC(U8500_BACKUPRAM0_BASE, SZ_8K),
42};
43
44void __init u8500_map_io(void)
45{
46 iotable_init(u8500_io_desc, ARRAY_SIZE(u8500_io_desc));
47}
48
49void __init u8500_init_irq(void)
50{
51 gic_dist_init(0, __io_address(U8500_GIC_DIST_BASE), 29);
52 gic_cpu_init(0, __io_address(U8500_GIC_CPU_BASE));
53}
54
55/*
56 * This function is called from the board init
57 */
58void __init u8500_init_devices(void)
59{
60 /* Register the platform devices */
61 platform_add_devices(platform_devs, ARRAY_SIZE(platform_devs));
62
63 return ;
64}
diff --git a/arch/arm/mach-ux500/headsmp.S b/arch/arm/mach-ux500/headsmp.S
new file mode 100644
index 000000000000..a6be2cdf2b2f
--- /dev/null
+++ b/arch/arm/mach-ux500/headsmp.S
@@ -0,0 +1,38 @@
1/*
2 * Copyright (c) 2009 ST-Ericsson
3 * This file is based ARM Realview platform
4 * Copyright (c) 2003 ARM Limited
5 * All Rights Reserved
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#include <linux/linkage.h>
12#include <linux/init.h>
13
14 __INIT
15
16/*
17 * U8500 specific entry point for secondary CPUs.
18 */
19ENTRY(u8500_secondary_startup)
20 mrc p15, 0, r0, c0, c0, 5
21 and r0, r0, #15
22 adr r4, 1f
23 ldmia r4, {r5, r6}
24 sub r4, r4, r5
25 add r6, r6, r4
26 dsb
27pen: ldr r7, [r6]
28 cmp r7, r0
29 bne pen
30
31 /*
32 * we've been released from the holding pen: secondary_stack
33 * should now contain the SVC stack for this core
34 */
35 b secondary_startup
36
371: .long .
38 .long pen_release
diff --git a/arch/arm/mach-ux500/include/mach/clkdev.h b/arch/arm/mach-ux500/include/mach/clkdev.h
new file mode 100644
index 000000000000..04b37a89801c
--- /dev/null
+++ b/arch/arm/mach-ux500/include/mach/clkdev.h
@@ -0,0 +1,7 @@
1#ifndef __ASM_MACH_CLKDEV_H
2#define __ASM_MACH_CLKDEV_H
3
4#define __clk_get(clk) ({ 1; })
5#define __clk_put(clk) do { } while (0)
6
7#endif
diff --git a/arch/arm/mach-ux500/include/mach/debug-macro.S b/arch/arm/mach-ux500/include/mach/debug-macro.S
new file mode 100644
index 000000000000..8f21b6a95dce
--- /dev/null
+++ b/arch/arm/mach-ux500/include/mach/debug-macro.S
@@ -0,0 +1,19 @@
1/*
2 * Debugging macro include header
3 *
4 * Copyright (C) 2009 ST-Ericsson
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 */
11 .macro addruart,rx
12 mrc p15, 0, \rx, c1, c0
13 tst \rx, #1 @MMU enabled?
14 moveq \rx, #0x80000000 @MMU off, Physical address
15 movne \rx, #0xF0000000 @MMU on, Virtual address
16 orr \rx, \rx, #0x7000
17 .endm
18
19#include <asm/hardware/debug-pl01x.S>
diff --git a/arch/arm/mach-ux500/include/mach/entry-macro.S b/arch/arm/mach-ux500/include/mach/entry-macro.S
new file mode 100644
index 000000000000..eece3301fef7
--- /dev/null
+++ b/arch/arm/mach-ux500/include/mach/entry-macro.S
@@ -0,0 +1,89 @@
1/*
2 * Low-level IRQ helper macros for U8500 platforms
3 *
4 * Copyright (C) 2009 ST-Ericsson.
5 *
6 * This file is a copy of ARM Realview platform.
7 * -just satisfied checkpatch script.
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13#include <mach/hardware.h>
14#include <asm/hardware/gic.h>
15
16 .macro disable_fiq
17 .endm
18
19 .macro get_irqnr_preamble, base, tmp
20 ldr \base, =IO_ADDRESS(U8500_GIC_CPU_BASE)
21 .endm
22
23 .macro arch_ret_to_user, tmp1, tmp2
24 .endm
25
26 /*
27 * The interrupt numbering scheme is defined in the
28 * interrupt controller spec. To wit:
29 *
30 * Interrupts 0-15 are IPI
31 * 16-28 are reserved
32 * 29-31 are local. We allow 30 to be used for the watchdog.
33 * 32-1020 are global
34 * 1021-1022 are reserved
35 * 1023 is "spurious" (no interrupt)
36 *
37 * For now, we ignore all local interrupts so only return an
38 * interrupt if it's between 30 and 1020. The test_for_ipi
39 * routine below will pick up on IPIs.
40 *
41 * A simple read from the controller will tell us the number
42 * of the highest priority enabled interrupt. We then just
43 * need to check whether it is in the valid range for an
44 * IRQ (30-1020 inclusive).
45 */
46
47 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
48
49 /* bits 12-10 = src CPU, 9-0 = int # */
50 ldr \irqstat, [\base, #GIC_CPU_INTACK]
51
52 ldr \tmp, =1021
53
54 bic \irqnr, \irqstat, #0x1c00
55
56 cmp \irqnr, #29
57 cmpcc \irqnr, \irqnr
58 cmpne \irqnr, \tmp
59 cmpcs \irqnr, \irqnr
60
61 .endm
62
63 /* We assume that irqstat (the raw value of the IRQ
64 * acknowledge register) is preserved from the macro above.
65 * If there is an IPI, we immediately signal end of
66 * interrupt on the controller, since this requires the
67 * original irqstat value which we won't easily be able
68 * to recreate later.
69 */
70
71 .macro test_for_ipi, irqnr, irqstat, base, tmp
72 bic \irqnr, \irqstat, #0x1c00
73 cmp \irqnr, #16
74 strcc \irqstat, [\base, #GIC_CPU_EOI]
75 cmpcs \irqnr, \irqnr
76 .endm
77
78 /* As above, this assumes that irqstat and base
79 * are preserved..
80 */
81
82 .macro test_for_ltirq, irqnr, irqstat, base, tmp
83 bic \irqnr, \irqstat, #0x1c00
84 mov \tmp, #0
85 cmp \irqnr, #29
86 moveq \tmp, #1
87 streq \irqstat, [\base, #GIC_CPU_EOI]
88 cmp \tmp, #0
89 .endm
diff --git a/arch/arm/mach-ux500/include/mach/hardware.h b/arch/arm/mach-ux500/include/mach/hardware.h
new file mode 100644
index 000000000000..6da650202dc7
--- /dev/null
+++ b/arch/arm/mach-ux500/include/mach/hardware.h
@@ -0,0 +1,131 @@
1/*
2 * Copyright (C) 2009 ST-Ericsson.
3 *
4 * U8500 hardware definitions
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#ifndef __MACH_HARDWARE_H
11#define __MACH_HARDWARE_H
12
13/* macros to get at IO space when running virtually
14 * We dont map all the peripherals, let ioremap do
15 * this for us. We map only very basic peripherals here.
16 */
17#define U8500_IO_VIRTUAL 0xf0000000
18#define U8500_IO_PHYSICAL 0xa0000000
19
20/* this macro is used in assembly, so no cast */
21#define IO_ADDRESS(x) \
22 (((x) & 0x0fffffff) + (((x) >> 4) & 0x0f000000) + U8500_IO_VIRTUAL)
23
24/* typesafe io address */
25#define __io_address(n) __io(IO_ADDRESS(n))
26
27/*
28 * Base address definitions for U8500 Onchip IPs. All the
29 * peripherals are contained in a single 1 Mbyte region, with
30 * AHB peripherals at the bottom and APB peripherals at the
31 * top of the region. PER stands for PERIPHERAL region which
32 * itself divided into sub regions.
33 */
34#define U8500_PER3_BASE 0x80000000
35#define U8500_PER2_BASE 0x80110000
36#define U8500_PER1_BASE 0x80120000
37#define U8500_PER4_BASE 0x80150000
38
39#define U8500_PER6_BASE 0xa03c0000
40#define U8500_PER5_BASE 0xa03e0000
41#define U8500_PER7_BASE 0xa03d0000
42
43#define U8500_SVA_BASE 0xa0100000
44#define U8500_SIA_BASE 0xa0200000
45
46#define U8500_SGA_BASE 0xa0300000
47#define U8500_MCDE_BASE 0xa0350000
48#define U8500_DMA_BASE 0xa0362000
49
50#define U8500_SCU_BASE 0xa0410000
51#define U8500_GIC_CPU_BASE 0xa0410100
52#define U8500_TWD_BASE 0xa0410600
53#define U8500_GIC_DIST_BASE 0xa0411000
54#define U8500_L2CC_BASE 0xa0412000
55
56#define U8500_TWD_SIZE 0x100
57
58/* per7 base addressess */
59#define U8500_CR_BASE (U8500_PER7_BASE + 0x8000)
60#define U8500_MTU0_BASE (U8500_PER7_BASE + 0xa000)
61#define U8500_MTU1_BASE (U8500_PER7_BASE + 0xb000)
62#define U8500_TZPC0_BASE (U8500_PER7_BASE + 0xc000)
63#define U8500_CLKRST7_BASE (U8500_PER7_BASE + 0xf000)
64
65/* per6 base addressess */
66#define U8500_RNG_BASE (U8500_PER6_BASE + 0x0000)
67#define U8500_PKA_BASE (U8500_PER6_BASE + 0x1000)
68#define U8500_PKAM_BASE (U8500_PER6_BASE + 0x2000)
69#define U8500_CRYPTO0_BASE (U8500_PER6_BASE + 0xa000)
70#define U8500_CRYPTO1_BASE (U8500_PER6_BASE + 0xb000)
71#define U8500_CLKRST6_BASE (U8500_PER7_BASE + 0xf000)
72
73/* per5 base addressess */
74#define U8500_USBOTG_BASE (U8500_PER5_BASE + 0x00000)
75#define U8500_GPIO5_BASE (U8500_PER5_BASE + 0x1e000)
76#define U8500_CLKRST5_BASE (U8500_PER7_BASE + 0x1f000)
77
78/* per4 base addressess */
79#define U8500_BACKUPRAM0_BASE (U8500_PER4_BASE + 0x0000)
80#define U8500_BACKUPRAM1_BASE (U8500_PER4_BASE + 0x1000)
81#define U8500_RTT0_BASE (U8500_PER4_BASE + 0x2000)
82#define U8500_RTT1_BASE (U8500_PER4_BASE + 0x3000)
83#define U8500_RTC_BASE (U8500_PER4_BASE + 0x4000)
84#define U8500_SCR_BASE (U8500_PER4_BASE + 0x5000)
85#define U8500_DMC_BASE (U8500_PER4_BASE + 0x6000)
86#define U8500_PRCMU_BASE (U8500_PER4_BASE + 0x7000)
87
88/* per3 base addressess */
89#define U8500_FSMC_BASE (U8500_PER3_BASE + 0x0000)
90#define U8500_SSP0_BASE (U8500_PER3_BASE + 0x2000)
91#define U8500_SSP1_BASE (U8500_PER3_BASE + 0x3000)
92#define U8500_I2C0_BASE (U8500_PER3_BASE + 0x4000)
93#define U8500_SDI2_BASE (U8500_PER3_BASE + 0x5000)
94#define U8500_SKE_BASE (U8500_PER3_BASE + 0x6000)
95#define U8500_UART2_BASE (U8500_PER3_BASE + 0x7000)
96#define U8500_SDI5_BASE (U8500_PER3_BASE + 0x8000)
97#define U8500_GPIO3_BASE (U8500_PER3_BASE + 0xe000)
98#define U8500_CLKRST3_BASE (U8500_PER7_BASE + 0xf000)
99
100/* per2 base addressess */
101#define U8500_I2C3_BASE (U8500_PER2_BASE + 0x0000)
102#define U8500_SPI2_BASE (U8500_PER2_BASE + 0x1000)
103#define U8500_SPI1_BASE (U8500_PER2_BASE + 0x2000)
104#define U8500_PWL_BASE (U8500_PER2_BASE + 0x3000)
105#define U8500_SDI4_BASE (U8500_PER2_BASE + 0x4000)
106#define U8500_MSP2_BASE (U8500_PER2_BASE + 0x7000)
107#define U8500_SDI1_BASE (U8500_PER2_BASE + 0x8000)
108#define U8500_SDI3_BASE (U8500_PER2_BASE + 0x9000)
109#define U8500_SPI0_BASE (U8500_PER2_BASE + 0xa000)
110#define U8500_HSIR_BASE (U8500_PER2_BASE + 0xb000)
111#define U8500_HSIT_BASE (U8500_PER2_BASE + 0xc000)
112#define U8500_GPIO2_BASE (U8500_PER2_BASE + 0xe000)
113#define U8500_CLKRST2_BASE (U8500_PER2_BASE + 0xf000)
114
115/* per1 base addresses */
116#define U8500_UART0_BASE (U8500_PER1_BASE + 0x0000)
117#define U8500_UART1_BASE (U8500_PER1_BASE + 0x1000)
118#define U8500_I2C1_BASE (U8500_PER1_BASE + 0x2000)
119#define U8500_MSP0_BASE (U8500_PER1_BASE + 0x3000)
120#define U8500_MSP1_BASE (U8500_PER1_BASE + 0x4000)
121#define U8500_SDI0_BASE (U8500_PER1_BASE + 0x6000)
122#define U8500_I2C2_BASE (U8500_PER1_BASE + 0x8000)
123#define U8500_SPI3_BASE (U8500_PER1_BASE + 0x9000)
124#define U8500_SLIM0_BASE (U8500_PER1_BASE + 0xa000)
125#define U8500_GPIO1_BASE (U8500_PER1_BASE + 0xe000)
126#define U8500_CLKRST1_BASE (U8500_PER2_BASE + 0xf000)
127
128/* ST-Ericsson modified pl022 id */
129#define SSP_PER_ID 0x01080022
130
131#endif /* __MACH_HARDWARE_H */
diff --git a/arch/arm/mach-ux500/include/mach/io.h b/arch/arm/mach-ux500/include/mach/io.h
new file mode 100644
index 000000000000..1cf3f44ce5b2
--- /dev/null
+++ b/arch/arm/mach-ux500/include/mach/io.h
@@ -0,0 +1,22 @@
1/*
2 * arch/arm/mach-u8500/include/mach/io.h
3 *
4 * Copyright (C) 1997-1999 Russell King
5 *
6 * Modifications:
7 * 06-12-1997 RMK Created.
8 * 07-04-1999 RMK Major cleanup
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 * We don't actually have real ISA nor PCI buses, but there is so many
17 * drivers out there that might just work if we fake them...
18 */
19#define __io(a) __typesafe_io(a)
20#define __mem_pci(a) (a)
21
22#endif
diff --git a/arch/arm/mach-ux500/include/mach/irqs.h b/arch/arm/mach-ux500/include/mach/irqs.h
new file mode 100644
index 000000000000..394b5dd2200f
--- /dev/null
+++ b/arch/arm/mach-ux500/include/mach/irqs.h
@@ -0,0 +1,71 @@
1/*
2 * Copyright (C) 2008 STMicroelectronics
3 * Copyright (C) 2009 ST-Ericsson.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 */
10#ifndef ASM_ARCH_IRQS_H
11#define ASM_ARCH_IRQS_H
12
13#include <mach/hardware.h>
14
15#define IRQ_LOCALTIMER 29
16#define IRQ_LOCALWDOG 30
17
18/* Shared Peripheral Interrupt (SHPI) */
19#define IRQ_SHPI_START 32
20
21/* Interrupt numbers generic for shared peripheral */
22#define IRQ_MTU0 (IRQ_SHPI_START + 4)
23#define IRQ_SPI2 (IRQ_SHPI_START + 6)
24#define IRQ_SPI0 (IRQ_SHPI_START + 8)
25#define IRQ_UART0 (IRQ_SHPI_START + 11)
26#define IRQ_I2C3 (IRQ_SHPI_START + 12)
27#define IRQ_SSP0 (IRQ_SHPI_START + 14)
28#define IRQ_MTU1 (IRQ_SHPI_START + 17)
29#define IRQ_RTC_RTT (IRQ_SHPI_START + 18)
30#define IRQ_UART1 (IRQ_SHPI_START + 19)
31#define IRQ_I2C0 (IRQ_SHPI_START + 21)
32#define IRQ_I2C1 (IRQ_SHPI_START + 22)
33#define IRQ_USBOTG (IRQ_SHPI_START + 23)
34#define IRQ_DMA (IRQ_SHPI_START + 25)
35#define IRQ_UART2 (IRQ_SHPI_START + 26)
36#define IRQ_HSIR_EXCEP (IRQ_SHPI_START + 29)
37#define IRQ_MSP0 (IRQ_SHPI_START + 31)
38#define IRQ_HSIR_CH0_OVRRUN (IRQ_SHPI_START + 32)
39#define IRQ_HSIR_CH1_OVRRUN (IRQ_SHPI_START + 33)
40#define IRQ_HSIR_CH2_OVRRUN (IRQ_SHPI_START + 34)
41#define IRQ_HSIR_CH3_OVRRUN (IRQ_SHPI_START + 35)
42#define IRQ_AB4500 (IRQ_SHPI_START + 40)
43#define IRQ_DISP (IRQ_SHPI_START + 48)
44#define IRQ_SiPI3 (IRQ_SHPI_START + 49)
45#define IRQ_SSP1 (IRQ_SHPI_START + 52)
46#define IRQ_I2C2 (IRQ_SHPI_START + 55)
47#define IRQ_SDMMC0 (IRQ_SHPI_START + 60)
48#define IRQ_MSP1 (IRQ_SHPI_START + 62)
49#define IRQ_SPI1 (IRQ_SHPI_START + 96)
50#define IRQ_MSP2 (IRQ_SHPI_START + 98)
51#define IRQ_SDMMC4 (IRQ_SHPI_START + 99)
52#define IRQ_HSIRD0 (IRQ_SHPI_START + 104)
53#define IRQ_HSIRD1 (IRQ_SHPI_START + 105)
54#define IRQ_HSITD0 (IRQ_SHPI_START + 106)
55#define IRQ_HSITD1 (IRQ_SHPI_START + 107)
56#define IRQ_GPIO0 (IRQ_SHPI_START + 119)
57#define IRQ_GPIO1 (IRQ_SHPI_START + 120)
58#define IRQ_GPIO2 (IRQ_SHPI_START + 121)
59#define IRQ_GPIO3 (IRQ_SHPI_START + 122)
60#define IRQ_GPIO4 (IRQ_SHPI_START + 123)
61#define IRQ_GPIO5 (IRQ_SHPI_START + 124)
62#define IRQ_GPIO6 (IRQ_SHPI_START + 125)
63#define IRQ_GPIO7 (IRQ_SHPI_START + 126)
64#define IRQ_GPIO8 (IRQ_SHPI_START + 127)
65
66/* There are 128 shared peripheral interrupts assigned to
67 * INTID[160:32]. The first 32 interrupts are reserved.
68 */
69#define NR_IRQS 161
70
71#endif /*ASM_ARCH_IRQS_H*/
diff --git a/arch/arm/mach-ux500/include/mach/memory.h b/arch/arm/mach-ux500/include/mach/memory.h
new file mode 100644
index 000000000000..510571a59e25
--- /dev/null
+++ b/arch/arm/mach-ux500/include/mach/memory.h
@@ -0,0 +1,18 @@
1/*
2 * Copyright (C) 2009 ST-Ericsson
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 */
9#ifndef __ASM_ARCH_MEMORY_H
10#define __ASM_ARCH_MEMORY_H
11
12/*
13 * Physical DRAM offset.
14 */
15#define PHYS_OFFSET UL(0x00000000)
16#define BUS_OFFSET UL(0x00000000)
17
18#endif
diff --git a/arch/arm/mach-ux500/include/mach/setup.h b/arch/arm/mach-ux500/include/mach/setup.h
new file mode 100644
index 000000000000..cf0ce1687f24
--- /dev/null
+++ b/arch/arm/mach-ux500/include/mach/setup.h
@@ -0,0 +1,23 @@
1/*
2 * Copyright (C) 2009 ST-Ericsson.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * These symbols are needed for board-specific files to call their
9 * own cpu-specific files
10 */
11#ifndef __ASM_ARCH_SETUP_H
12#define __ASM_ARCH_SETUP_H
13
14#include <asm/mach/time.h>
15#include <linux/init.h>
16
17extern void u8500_map_io(void);
18extern void u8500_init_devices(void);
19extern void u8500_init_irq(void);
20/* We re-use nomadik_timer for this platform */
21extern void nmdk_timer_init(void);
22
23#endif /* __ASM_ARCH_SETUP_H */
diff --git a/arch/arm/mach-ux500/include/mach/smp.h b/arch/arm/mach-ux500/include/mach/smp.h
new file mode 100644
index 000000000000..b59f7bc9725d
--- /dev/null
+++ b/arch/arm/mach-ux500/include/mach/smp.h
@@ -0,0 +1,32 @@
1/*
2 * This file is based ARM realview platform.
3 * Copyright (C) ARM Limited.
4 *
5 * This file is licensed under the terms of the GNU General Public
6 * License version 2. This program is licensed "as is" without any
7 * warranty of any kind, whether express or implied.
8 */
9#ifndef ASMARM_ARCH_SMP_H
10#define ASMARM_ARCH_SMP_H
11
12#include <asm/hardware/gic.h>
13
14/* This is required to wakeup the secondary core */
15extern void u8500_secondary_startup(void);
16
17#define hard_smp_processor_id() \
18 ({ \
19 unsigned int cpunum; \
20 __asm__("mrc p15, 0, %0, c0, c0, 5" \
21 : "=r" (cpunum)); \
22 cpunum &= 0x0F; \
23 })
24
25/*
26 * We use IRQ1 as the IPI
27 */
28static inline void smp_cross_call(const struct cpumask *mask)
29{
30 gic_raise_softirq(mask, 1);
31}
32#endif
diff --git a/arch/arm/mach-ux500/include/mach/system.h b/arch/arm/mach-ux500/include/mach/system.h
new file mode 100644
index 000000000000..c0cd8006f1a2
--- /dev/null
+++ b/arch/arm/mach-ux500/include/mach/system.h
@@ -0,0 +1,25 @@
1/*
2 * Copyright (C) 2009 ST-Ericsson.
3 *
4 * This file is licensed under the terms of the GNU General Public
5 * License version 2. This program is licensed "as is" without any
6 * warranty of any kind, whether express or implied.
7 */
8#ifndef __ASM_ARCH_SYSTEM_H
9#define __ASM_ARCH_SYSTEM_H
10
11static inline void arch_idle(void)
12{
13 /*
14 * This should do all the clock switching
15 * and wait for interrupt tricks
16 */
17 cpu_do_idle();
18}
19
20static inline void arch_reset(char mode, const char *cmd)
21{
22 /* yet to be implemented - TODO */
23}
24
25#endif
diff --git a/arch/arm/mach-ux500/include/mach/timex.h b/arch/arm/mach-ux500/include/mach/timex.h
new file mode 100644
index 000000000000..d0942c174018
--- /dev/null
+++ b/arch/arm/mach-ux500/include/mach/timex.h
@@ -0,0 +1,6 @@
1#ifndef __ASM_ARCH_TIMEX_H
2#define __ASM_ARCH_TIMEX_H
3
4#define CLOCK_TICK_RATE 110000000
5
6#endif
diff --git a/arch/arm/mach-ux500/include/mach/uncompress.h b/arch/arm/mach-ux500/include/mach/uncompress.h
new file mode 100644
index 000000000000..8552eb188b50
--- /dev/null
+++ b/arch/arm/mach-ux500/include/mach/uncompress.h
@@ -0,0 +1,58 @@
1/*
2 * Copyright (C) 2009 ST-Ericsson
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18#ifndef __ASM_ARCH_UNCOMPRESS_H
19#define __ASM_ARCH_UNCOMPRESS_H
20
21#include <asm/setup.h>
22#include <linux/io.h>
23#include <mach/hardware.h>
24
25#define U8500_UART_DR 0x80007000
26#define U8500_UART_LCRH 0x8000702c
27#define U8500_UART_CR 0x80007030
28#define U8500_UART_FR 0x80007018
29
30static void putc(const char c)
31{
32 /* Do nothing if the UART is not enabled. */
33 if (!(readb(U8500_UART_CR) & 0x1))
34 return;
35
36 if (c == '\n')
37 putc('\r');
38
39 while (readb(U8500_UART_FR) & (1 << 5))
40 barrier();
41 writeb(c, U8500_UART_DR);
42}
43
44static void flush(void)
45{
46 if (!(readb(U8500_UART_CR) & 0x1))
47 return;
48 while (readb(U8500_UART_FR) & (1 << 3))
49 barrier();
50}
51
52static inline void arch_decomp_setup(void)
53{
54}
55
56#define arch_decomp_wdog() /* nothing to do here */
57
58#endif /* __ASM_ARCH_UNCOMPRESS_H */
diff --git a/arch/arm/mach-ux500/include/mach/vmalloc.h b/arch/arm/mach-ux500/include/mach/vmalloc.h
new file mode 100644
index 000000000000..86cdbbce1842
--- /dev/null
+++ b/arch/arm/mach-ux500/include/mach/vmalloc.h
@@ -0,0 +1,18 @@
1/*
2 * Copyright (C) 2009 ST-Ericsson
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18#define VMALLOC_END 0xf0000000
diff --git a/arch/arm/mach-ux500/localtimer.c b/arch/arm/mach-ux500/localtimer.c
new file mode 100644
index 000000000000..2288f6a7c518
--- /dev/null
+++ b/arch/arm/mach-ux500/localtimer.c
@@ -0,0 +1,28 @@
1/*
2 * Copyright (C) 2008-2009 ST-Ericsson
3 * Srinidhi Kasagar <srinidhi.kasagar@stericsson.com>
4 *
5 * This file is heavily based on relaview platform, almost a copy.
6 *
7 * Copyright (C) 2002 ARM Ltd.
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 version 2 as
11 * published by the Free Software Foundation.
12 */
13#include <linux/init.h>
14#include <linux/smp.h>
15#include <linux/clockchips.h>
16
17#include <asm/irq.h>
18#include <asm/smp_twd.h>
19#include <asm/localtimer.h>
20
21/*
22 * Setup the local clock events for a CPU.
23 */
24void __cpuinit local_timer_setup(struct clock_event_device *evt)
25{
26 evt->irq = IRQ_LOCALTIMER;
27 twd_timer_setup(evt);
28}
diff --git a/arch/arm/mach-ux500/platsmp.c b/arch/arm/mach-ux500/platsmp.c
new file mode 100644
index 000000000000..8dfe7ca245d8
--- /dev/null
+++ b/arch/arm/mach-ux500/platsmp.c
@@ -0,0 +1,177 @@
1/*
2 * Copyright (C) 2002 ARM Ltd.
3 * Copyright (C) 2008 STMicroelctronics.
4 * Copyright (C) 2009 ST-Ericsson.
5 * Author: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com>
6 *
7 * This file is based on arm realview platform
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 version 2 as
11 * published by the Free Software Foundation.
12 */
13#include <linux/init.h>
14#include <linux/errno.h>
15#include <linux/delay.h>
16#include <linux/device.h>
17#include <linux/smp.h>
18#include <linux/io.h>
19
20#include <asm/cacheflush.h>
21#include <asm/localtimer.h>
22#include <asm/smp_scu.h>
23#include <mach/hardware.h>
24
25/*
26 * control for which core is the next to come out of the secondary
27 * boot "holding pen"
28 */
29volatile int __cpuinitdata pen_release = -1;
30
31static unsigned int __init get_core_count(void)
32{
33 return scu_get_core_count(__io_address(U8500_SCU_BASE));
34}
35
36static DEFINE_SPINLOCK(boot_lock);
37
38void __cpuinit platform_secondary_init(unsigned int cpu)
39{
40 trace_hardirqs_off();
41
42 /*
43 * if any interrupts are already enabled for the primary
44 * core (e.g. timer irq), then they will not have been enabled
45 * for us: do so
46 */
47 gic_cpu_init(0, __io_address(U8500_GIC_CPU_BASE));
48
49 /*
50 * let the primary processor know we're out of the
51 * pen, then head off into the C entry point
52 */
53 pen_release = -1;
54
55 /*
56 * Synchronise with the boot thread.
57 */
58 spin_lock(&boot_lock);
59 spin_unlock(&boot_lock);
60}
61
62int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
63{
64 unsigned long timeout;
65
66 /*
67 * set synchronisation state between this boot processor
68 * and the secondary one
69 */
70 spin_lock(&boot_lock);
71
72 /*
73 * The secondary processor is waiting to be released from
74 * the holding pen - release it, then wait for it to flag
75 * that it has been released by resetting pen_release.
76 */
77 pen_release = cpu;
78 flush_cache_all();
79
80 timeout = jiffies + (1 * HZ);
81 while (time_before(jiffies, timeout)) {
82 if (pen_release == -1)
83 break;
84 }
85
86 /*
87 * now the secondary core is starting up let it run its
88 * calibrations, then wait for it to finish
89 */
90 spin_unlock(&boot_lock);
91
92 return pen_release != -1 ? -ENOSYS : 0;
93}
94
95static void __init wakeup_secondary(void)
96{
97 /* nobody is to be released from the pen yet */
98 pen_release = -1;
99
100 /*
101 * write the address of secondary startup into the backup ram register
102 * at offset 0x1FF4, then write the magic number 0xA1FEED01 to the
103 * backup ram register at offset 0x1FF0, which is what boot rom code
104 * is waiting for. This would wake up the secondary core from WFE
105 */
106#define U8500_CPU1_JUMPADDR_OFFSET 0x1FF4
107 __raw_writel(virt_to_phys(u8500_secondary_startup),
108 (void __iomem *)IO_ADDRESS(U8500_BACKUPRAM0_BASE) +
109 U8500_CPU1_JUMPADDR_OFFSET);
110
111#define U8500_CPU1_WAKEMAGIC_OFFSET 0x1FF0
112 __raw_writel(0xA1FEED01,
113 (void __iomem *)IO_ADDRESS(U8500_BACKUPRAM0_BASE) +
114 U8500_CPU1_WAKEMAGIC_OFFSET);
115
116 /* make sure write buffer is drained */
117 mb();
118}
119
120/*
121 * Initialise the CPU possible map early - this describes the CPUs
122 * which may be present or become present in the system.
123 */
124void __init smp_init_cpus(void)
125{
126 unsigned int i, ncores = get_core_count();
127
128 for (i = 0; i < ncores; i++)
129 set_cpu_possible(i, true);
130}
131
132void __init smp_prepare_cpus(unsigned int max_cpus)
133{
134 unsigned int ncores = get_core_count();
135 unsigned int cpu = smp_processor_id();
136 int i;
137
138 /* sanity check */
139 if (ncores == 0) {
140 printk(KERN_ERR
141 "U8500: strange CM count of 0? Default to 1\n");
142 ncores = 1;
143 }
144
145 if (ncores > num_possible_cpus()) {
146 printk(KERN_WARNING
147 "U8500: no. of cores (%d) greater than configured "
148 "maximum of %d - clipping\n",
149 ncores, num_possible_cpus());
150 ncores = num_possible_cpus();
151 }
152
153 smp_store_cpu_info(cpu);
154
155 /*
156 * are we trying to boot more cores than exist?
157 */
158 if (max_cpus > ncores)
159 max_cpus = ncores;
160
161 /*
162 * Initialise the present map, which describes the set of CPUs
163 * actually populated at the present time.
164 */
165 for (i = 0; i < max_cpus; i++)
166 set_cpu_present(i, true);
167
168 if (max_cpus > 1) {
169 /*
170 * Enable the local timer or broadcast device for the
171 * boot CPU, but only if we have more than one CPU.
172 */
173 percpu_timer_setup();
174 scu_enable(__io_address(U8500_SCU_BASE));
175 wakeup_secondary();
176 }
177}
diff --git a/arch/arm/mach-w90x900/dev.c b/arch/arm/mach-w90x900/dev.c
index 2a6f98de48d2..51f17b753348 100644
--- a/arch/arm/mach-w90x900/dev.c
+++ b/arch/arm/mach-w90x900/dev.c
@@ -32,6 +32,7 @@
32#include <asm/mach-types.h> 32#include <asm/mach-types.h>
33 33
34#include <mach/regs-serial.h> 34#include <mach/regs-serial.h>
35#include <mach/nuc900_spi.h>
35#include <mach/map.h> 36#include <mach/map.h>
36 37
37#include "cpu.h" 38#include "cpu.h"
@@ -196,6 +197,18 @@ static struct platform_device nuc900_device_emc = {
196 197
197/* SPI device */ 198/* SPI device */
198 199
200static struct w90p910_spi_info nuc900_spiflash_data = {
201 .num_cs = 1,
202 .lsb = 0,
203 .txneg = 1,
204 .rxneg = 0,
205 .divider = 24,
206 .sleep = 0,
207 .txnum = 0,
208 .txbitlen = 1,
209 .bus_num = 0,
210};
211
199static struct resource nuc900_spi_resource[] = { 212static struct resource nuc900_spi_resource[] = {
200 [0] = { 213 [0] = {
201 .start = W90X900_PA_I2C + SPIOFFSET, 214 .start = W90X900_PA_I2C + SPIOFFSET,
@@ -214,6 +227,9 @@ static struct platform_device nuc900_device_spi = {
214 .id = -1, 227 .id = -1,
215 .num_resources = ARRAY_SIZE(nuc900_spi_resource), 228 .num_resources = ARRAY_SIZE(nuc900_spi_resource),
216 .resource = nuc900_spi_resource, 229 .resource = nuc900_spi_resource,
230 .dev = {
231 .platform_data = &nuc900_spiflash_data,
232 }
217}; 233};
218 234
219/* spi device, spi flash info */ 235/* spi device, spi flash info */
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index 9264d814cd7a..dd4698c67cc3 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -388,7 +388,7 @@ config CPU_FEROCEON_OLD_ID
388 388
389# ARMv6 389# ARMv6
390config CPU_V6 390config CPU_V6
391 bool "Support ARM V6 processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB || MACH_REALVIEW_PBX 391 bool "Support ARM V6 processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB || MACH_REALVIEW_PBX || ARCH_DOVE
392 select CPU_32v6 392 select CPU_32v6
393 select CPU_ABRT_EV6 393 select CPU_ABRT_EV6
394 select CPU_PABRT_V6 394 select CPU_PABRT_V6
@@ -764,6 +764,15 @@ config CACHE_L2X0
764 help 764 help
765 This option enables the L2x0 PrimeCell. 765 This option enables the L2x0 PrimeCell.
766 766
767config CACHE_TAUROS2
768 bool "Enable the Tauros2 L2 cache controller"
769 depends on ARCH_DOVE
770 default y
771 select OUTER_CACHE
772 help
773 This option enables the Tauros2 L2 cache controller (as
774 found on PJ1/PJ4).
775
767config CACHE_XSC3L2 776config CACHE_XSC3L2
768 bool "Enable the L2 cache on XScale3" 777 bool "Enable the L2 cache on XScale3"
769 depends on CPU_XSC3 778 depends on CPU_XSC3
@@ -774,5 +783,5 @@ config CACHE_XSC3L2
774 783
775config ARM_L1_CACHE_SHIFT 784config ARM_L1_CACHE_SHIFT
776 int 785 int
777 default 6 if ARCH_OMAP3 786 default 6 if ARCH_OMAP3 || ARCH_S5PC1XX
778 default 5 787 default 5
diff --git a/arch/arm/mm/Makefile b/arch/arm/mm/Makefile
index 055cb2aa8134..827e238e5d4a 100644
--- a/arch/arm/mm/Makefile
+++ b/arch/arm/mm/Makefile
@@ -6,7 +6,7 @@ obj-y := dma-mapping.o extable.o fault.o init.o \
6 iomap.o 6 iomap.o
7 7
8obj-$(CONFIG_MMU) += fault-armv.o flush.o ioremap.o mmap.o \ 8obj-$(CONFIG_MMU) += fault-armv.o flush.o ioremap.o mmap.o \
9 pgd.o mmu.o 9 pgd.o mmu.o vmregion.o
10 10
11ifneq ($(CONFIG_MMU),y) 11ifneq ($(CONFIG_MMU),y)
12obj-y += nommu.o 12obj-y += nommu.o
@@ -87,4 +87,4 @@ obj-$(CONFIG_CPU_V7) += proc-v7.o
87obj-$(CONFIG_CACHE_FEROCEON_L2) += cache-feroceon-l2.o 87obj-$(CONFIG_CACHE_FEROCEON_L2) += cache-feroceon-l2.o
88obj-$(CONFIG_CACHE_L2X0) += cache-l2x0.o 88obj-$(CONFIG_CACHE_L2X0) += cache-l2x0.o
89obj-$(CONFIG_CACHE_XSC3L2) += cache-xsc3l2.o 89obj-$(CONFIG_CACHE_XSC3L2) += cache-xsc3l2.o
90 90obj-$(CONFIG_CACHE_TAUROS2) += cache-tauros2.o
diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
index b480f1d3591f..747f9a9021bb 100644
--- a/arch/arm/mm/cache-l2x0.c
+++ b/arch/arm/mm/cache-l2x0.c
@@ -99,18 +99,25 @@ void __init l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask)
99 99
100 l2x0_base = base; 100 l2x0_base = base;
101 101
102 /* disable L2X0 */ 102 /*
103 writel(0, l2x0_base + L2X0_CTRL); 103 * Check if l2x0 controller is already enabled.
104 * If you are booting from non-secure mode
105 * accessing the below registers will fault.
106 */
107 if (!(readl(l2x0_base + L2X0_CTRL) & 1)) {
104 108
105 aux = readl(l2x0_base + L2X0_AUX_CTRL); 109 /* l2x0 controller is disabled */
106 aux &= aux_mask;
107 aux |= aux_val;
108 writel(aux, l2x0_base + L2X0_AUX_CTRL);
109 110
110 l2x0_inv_all(); 111 aux = readl(l2x0_base + L2X0_AUX_CTRL);
112 aux &= aux_mask;
113 aux |= aux_val;
114 writel(aux, l2x0_base + L2X0_AUX_CTRL);
111 115
112 /* enable L2X0 */ 116 l2x0_inv_all();
113 writel(1, l2x0_base + L2X0_CTRL); 117
118 /* enable L2X0 */
119 writel(1, l2x0_base + L2X0_CTRL);
120 }
114 121
115 outer_cache.inv_range = l2x0_inv_range; 122 outer_cache.inv_range = l2x0_inv_range;
116 outer_cache.clean_range = l2x0_clean_range; 123 outer_cache.clean_range = l2x0_clean_range;
diff --git a/arch/arm/mm/cache-tauros2.c b/arch/arm/mm/cache-tauros2.c
new file mode 100644
index 000000000000..50868651890f
--- /dev/null
+++ b/arch/arm/mm/cache-tauros2.c
@@ -0,0 +1,263 @@
1/*
2 * arch/arm/mm/cache-tauros2.c - Tauros2 L2 cache controller support
3 *
4 * Copyright (C) 2008 Marvell Semiconductor
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 * References:
11 * - PJ1 CPU Core Datasheet,
12 * Document ID MV-S104837-01, Rev 0.7, January 24 2008.
13 * - PJ4 CPU Core Datasheet,
14 * Document ID MV-S105190-00, Rev 0.7, March 14 2008.
15 */
16
17#include <linux/init.h>
18#include <asm/cacheflush.h>
19#include <asm/hardware/cache-tauros2.h>
20
21
22/*
23 * When Tauros2 is used on a CPU that supports the v7 hierarchical
24 * cache operations, the cache handling code in proc-v7.S takes care
25 * of everything, including handling DMA coherency.
26 *
27 * So, we only need to register outer cache operations here if we're
28 * being used on a pre-v7 CPU, and we only need to build support for
29 * outer cache operations into the kernel image if the kernel has been
30 * configured to support a pre-v7 CPU.
31 */
32#if __LINUX_ARM_ARCH__ < 7
33/*
34 * Low-level cache maintenance operations.
35 */
36static inline void tauros2_clean_pa(unsigned long addr)
37{
38 __asm__("mcr p15, 1, %0, c7, c11, 3" : : "r" (addr));
39}
40
41static inline void tauros2_clean_inv_pa(unsigned long addr)
42{
43 __asm__("mcr p15, 1, %0, c7, c15, 3" : : "r" (addr));
44}
45
46static inline void tauros2_inv_pa(unsigned long addr)
47{
48 __asm__("mcr p15, 1, %0, c7, c7, 3" : : "r" (addr));
49}
50
51
52/*
53 * Linux primitives.
54 *
55 * Note that the end addresses passed to Linux primitives are
56 * noninclusive.
57 */
58#define CACHE_LINE_SIZE 32
59
60static void tauros2_inv_range(unsigned long start, unsigned long end)
61{
62 /*
63 * Clean and invalidate partial first cache line.
64 */
65 if (start & (CACHE_LINE_SIZE - 1)) {
66 tauros2_clean_inv_pa(start & ~(CACHE_LINE_SIZE - 1));
67 start = (start | (CACHE_LINE_SIZE - 1)) + 1;
68 }
69
70 /*
71 * Clean and invalidate partial last cache line.
72 */
73 if (end & (CACHE_LINE_SIZE - 1)) {
74 tauros2_clean_inv_pa(end & ~(CACHE_LINE_SIZE - 1));
75 end &= ~(CACHE_LINE_SIZE - 1);
76 }
77
78 /*
79 * Invalidate all full cache lines between 'start' and 'end'.
80 */
81 while (start < end) {
82 tauros2_inv_pa(start);
83 start += CACHE_LINE_SIZE;
84 }
85
86 dsb();
87}
88
89static void tauros2_clean_range(unsigned long start, unsigned long end)
90{
91 start &= ~(CACHE_LINE_SIZE - 1);
92 while (start < end) {
93 tauros2_clean_pa(start);
94 start += CACHE_LINE_SIZE;
95 }
96
97 dsb();
98}
99
100static void tauros2_flush_range(unsigned long start, unsigned long end)
101{
102 start &= ~(CACHE_LINE_SIZE - 1);
103 while (start < end) {
104 tauros2_clean_inv_pa(start);
105 start += CACHE_LINE_SIZE;
106 }
107
108 dsb();
109}
110#endif
111
112static inline u32 __init read_extra_features(void)
113{
114 u32 u;
115
116 __asm__("mrc p15, 1, %0, c15, c1, 0" : "=r" (u));
117
118 return u;
119}
120
121static inline void __init write_extra_features(u32 u)
122{
123 __asm__("mcr p15, 1, %0, c15, c1, 0" : : "r" (u));
124}
125
126static void __init disable_l2_prefetch(void)
127{
128 u32 u;
129
130 /*
131 * Read the CPU Extra Features register and verify that the
132 * Disable L2 Prefetch bit is set.
133 */
134 u = read_extra_features();
135 if (!(u & 0x01000000)) {
136 printk(KERN_INFO "Tauros2: Disabling L2 prefetch.\n");
137 write_extra_features(u | 0x01000000);
138 }
139}
140
141static inline int __init cpuid_scheme(void)
142{
143 extern int processor_id;
144
145 return !!((processor_id & 0x000f0000) == 0x000f0000);
146}
147
148static inline u32 __init read_mmfr3(void)
149{
150 u32 mmfr3;
151
152 __asm__("mrc p15, 0, %0, c0, c1, 7\n" : "=r" (mmfr3));
153
154 return mmfr3;
155}
156
157static inline u32 __init read_actlr(void)
158{
159 u32 actlr;
160
161 __asm__("mrc p15, 0, %0, c1, c0, 1\n" : "=r" (actlr));
162
163 return actlr;
164}
165
166static inline void __init write_actlr(u32 actlr)
167{
168 __asm__("mcr p15, 0, %0, c1, c0, 1\n" : : "r" (actlr));
169}
170
171void __init tauros2_init(void)
172{
173 extern int processor_id;
174 char *mode;
175
176 disable_l2_prefetch();
177
178#ifdef CONFIG_CPU_32v5
179 if ((processor_id & 0xff0f0000) == 0x56050000) {
180 u32 feat;
181
182 /*
183 * v5 CPUs with Tauros2 have the L2 cache enable bit
184 * located in the CPU Extra Features register.
185 */
186 feat = read_extra_features();
187 if (!(feat & 0x00400000)) {
188 printk(KERN_INFO "Tauros2: Enabling L2 cache.\n");
189 write_extra_features(feat | 0x00400000);
190 }
191
192 mode = "ARMv5";
193 outer_cache.inv_range = tauros2_inv_range;
194 outer_cache.clean_range = tauros2_clean_range;
195 outer_cache.flush_range = tauros2_flush_range;
196 }
197#endif
198
199#ifdef CONFIG_CPU_32v6
200 /*
201 * Check whether this CPU lacks support for the v7 hierarchical
202 * cache ops. (PJ4 is in its v6 personality mode if the MMFR3
203 * register indicates no support for the v7 hierarchical cache
204 * ops.)
205 */
206 if (cpuid_scheme() && (read_mmfr3() & 0xf) == 0) {
207 /*
208 * When Tauros2 is used in an ARMv6 system, the L2
209 * enable bit is in the ARMv6 ARM-mandated position
210 * (bit [26] of the System Control Register).
211 */
212 if (!(get_cr() & 0x04000000)) {
213 printk(KERN_INFO "Tauros2: Enabling L2 cache.\n");
214 adjust_cr(0x04000000, 0x04000000);
215 }
216
217 mode = "ARMv6";
218 outer_cache.inv_range = tauros2_inv_range;
219 outer_cache.clean_range = tauros2_clean_range;
220 outer_cache.flush_range = tauros2_flush_range;
221 }
222#endif
223
224#ifdef CONFIG_CPU_32v7
225 /*
226 * Check whether this CPU has support for the v7 hierarchical
227 * cache ops. (PJ4 is in its v7 personality mode if the MMFR3
228 * register indicates support for the v7 hierarchical cache
229 * ops.)
230 *
231 * (Although strictly speaking there may exist CPUs that
232 * implement the v7 cache ops but are only ARMv6 CPUs (due to
233 * not complying with all of the other ARMv7 requirements),
234 * there are no real-life examples of Tauros2 being used on
235 * such CPUs as of yet.)
236 */
237 if (cpuid_scheme() && (read_mmfr3() & 0xf) == 1) {
238 u32 actlr;
239
240 /*
241 * When Tauros2 is used in an ARMv7 system, the L2
242 * enable bit is located in the Auxiliary System Control
243 * Register (which is the only register allowed by the
244 * ARMv7 spec to contain fine-grained cache control bits).
245 */
246 actlr = read_actlr();
247 if (!(actlr & 0x00000002)) {
248 printk(KERN_INFO "Tauros2: Enabling L2 cache.\n");
249 write_actlr(actlr | 0x00000002);
250 }
251
252 mode = "ARMv7";
253 }
254#endif
255
256 if (mode == NULL) {
257 printk(KERN_CRIT "Tauros2: Unable to detect CPU mode.\n");
258 return;
259 }
260
261 printk(KERN_INFO "Tauros2: L2 cache support initialised "
262 "in %s mode.\n", mode);
263}
diff --git a/arch/arm/mm/copypage-v6.c b/arch/arm/mm/copypage-v6.c
index 4127a7bddfe5..841f355319bf 100644
--- a/arch/arm/mm/copypage-v6.c
+++ b/arch/arm/mm/copypage-v6.c
@@ -41,6 +41,14 @@ static void v6_copy_user_highpage_nonaliasing(struct page *to,
41 kfrom = kmap_atomic(from, KM_USER0); 41 kfrom = kmap_atomic(from, KM_USER0);
42 kto = kmap_atomic(to, KM_USER1); 42 kto = kmap_atomic(to, KM_USER1);
43 copy_page(kto, kfrom); 43 copy_page(kto, kfrom);
44#ifdef CONFIG_HIGHMEM
45 /*
46 * kmap_atomic() doesn't set the page virtual address, and
47 * kunmap_atomic() takes care of cache flushing already.
48 */
49 if (page_address(to) != NULL)
50#endif
51 __cpuc_flush_dcache_page(kto);
44 kunmap_atomic(kto, KM_USER1); 52 kunmap_atomic(kto, KM_USER1);
45 kunmap_atomic(kfrom, KM_USER0); 53 kunmap_atomic(kfrom, KM_USER0);
46} 54}
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index b9590a7085ca..26325cb5d368 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -63,194 +63,152 @@ static u64 get_coherent_dma_mask(struct device *dev)
63 return mask; 63 return mask;
64} 64}
65 65
66#ifdef CONFIG_MMU
67/* 66/*
68 * These are the page tables (2MB each) covering uncached, DMA consistent allocations 67 * Allocate a DMA buffer for 'dev' of size 'size' using the
68 * specified gfp mask. Note that 'size' must be page aligned.
69 */ 69 */
70static pte_t *consistent_pte[NUM_CONSISTENT_PTES]; 70static struct page *__dma_alloc_buffer(struct device *dev, size_t size, gfp_t gfp)
71static DEFINE_SPINLOCK(consistent_lock); 71{
72 unsigned long order = get_order(size);
73 struct page *page, *p, *e;
74 void *ptr;
75 u64 mask = get_coherent_dma_mask(dev);
72 76
73/* 77#ifdef CONFIG_DMA_API_DEBUG
74 * VM region handling support. 78 u64 limit = (mask + 1) & ~mask;
75 * 79 if (limit && size >= limit) {
76 * This should become something generic, handling VM region allocations for 80 dev_warn(dev, "coherent allocation too big (requested %#x mask %#llx)\n",
77 * vmalloc and similar (ioremap, module space, etc). 81 size, mask);
78 * 82 return NULL;
79 * I envisage vmalloc()'s supporting vm_struct becoming: 83 }
80 * 84#endif
81 * struct vm_struct {
82 * struct vm_region region;
83 * unsigned long flags;
84 * struct page **pages;
85 * unsigned int nr_pages;
86 * unsigned long phys_addr;
87 * };
88 *
89 * get_vm_area() would then call vm_region_alloc with an appropriate
90 * struct vm_region head (eg):
91 *
92 * struct vm_region vmalloc_head = {
93 * .vm_list = LIST_HEAD_INIT(vmalloc_head.vm_list),
94 * .vm_start = VMALLOC_START,
95 * .vm_end = VMALLOC_END,
96 * };
97 *
98 * However, vmalloc_head.vm_start is variable (typically, it is dependent on
99 * the amount of RAM found at boot time.) I would imagine that get_vm_area()
100 * would have to initialise this each time prior to calling vm_region_alloc().
101 */
102struct arm_vm_region {
103 struct list_head vm_list;
104 unsigned long vm_start;
105 unsigned long vm_end;
106 struct page *vm_pages;
107 int vm_active;
108};
109 85
110static struct arm_vm_region consistent_head = { 86 if (!mask)
111 .vm_list = LIST_HEAD_INIT(consistent_head.vm_list), 87 return NULL;
112 .vm_start = CONSISTENT_BASE,
113 .vm_end = CONSISTENT_END,
114};
115 88
116static struct arm_vm_region * 89 if (mask < 0xffffffffULL)
117arm_vm_region_alloc(struct arm_vm_region *head, size_t size, gfp_t gfp) 90 gfp |= GFP_DMA;
118{ 91
119 unsigned long addr = head->vm_start, end = head->vm_end - size; 92 page = alloc_pages(gfp, order);
120 unsigned long flags; 93 if (!page)
121 struct arm_vm_region *c, *new; 94 return NULL;
122
123 new = kmalloc(sizeof(struct arm_vm_region), gfp);
124 if (!new)
125 goto out;
126
127 spin_lock_irqsave(&consistent_lock, flags);
128
129 list_for_each_entry(c, &head->vm_list, vm_list) {
130 if ((addr + size) < addr)
131 goto nospc;
132 if ((addr + size) <= c->vm_start)
133 goto found;
134 addr = c->vm_end;
135 if (addr > end)
136 goto nospc;
137 }
138 95
139 found:
140 /* 96 /*
141 * Insert this entry _before_ the one we found. 97 * Now split the huge page and free the excess pages
142 */ 98 */
143 list_add_tail(&new->vm_list, &c->vm_list); 99 split_page(page, order);
144 new->vm_start = addr; 100 for (p = page + (size >> PAGE_SHIFT), e = page + (1 << order); p < e; p++)
145 new->vm_end = addr + size; 101 __free_page(p);
146 new->vm_active = 1; 102
147 103 /*
148 spin_unlock_irqrestore(&consistent_lock, flags); 104 * Ensure that the allocated pages are zeroed, and that any data
149 return new; 105 * lurking in the kernel direct-mapped region is invalidated.
150 106 */
151 nospc: 107 ptr = page_address(page);
152 spin_unlock_irqrestore(&consistent_lock, flags); 108 memset(ptr, 0, size);
153 kfree(new); 109 dmac_flush_range(ptr, ptr + size);
154 out: 110 outer_flush_range(__pa(ptr), __pa(ptr) + size);
155 return NULL; 111
112 return page;
156} 113}
157 114
158static struct arm_vm_region *arm_vm_region_find(struct arm_vm_region *head, unsigned long addr) 115/*
116 * Free a DMA buffer. 'size' must be page aligned.
117 */
118static void __dma_free_buffer(struct page *page, size_t size)
159{ 119{
160 struct arm_vm_region *c; 120 struct page *e = page + (size >> PAGE_SHIFT);
161 121
162 list_for_each_entry(c, &head->vm_list, vm_list) { 122 while (page < e) {
163 if (c->vm_active && c->vm_start == addr) 123 __free_page(page);
164 goto out; 124 page++;
165 } 125 }
166 c = NULL;
167 out:
168 return c;
169} 126}
170 127
128#ifdef CONFIG_MMU
129/*
130 * These are the page tables (2MB each) covering uncached, DMA consistent allocations
131 */
132static pte_t *consistent_pte[NUM_CONSISTENT_PTES];
133
134#include "vmregion.h"
135
136static struct arm_vmregion_head consistent_head = {
137 .vm_lock = __SPIN_LOCK_UNLOCKED(&consistent_head.vm_lock),
138 .vm_list = LIST_HEAD_INIT(consistent_head.vm_list),
139 .vm_start = CONSISTENT_BASE,
140 .vm_end = CONSISTENT_END,
141};
142
171#ifdef CONFIG_HUGETLB_PAGE 143#ifdef CONFIG_HUGETLB_PAGE
172#error ARM Coherent DMA allocator does not (yet) support huge TLB 144#error ARM Coherent DMA allocator does not (yet) support huge TLB
173#endif 145#endif
174 146
175static void * 147/*
176__dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp, 148 * Initialise the consistent memory allocation.
177 pgprot_t prot) 149 */
150static int __init consistent_init(void)
178{ 151{
179 struct page *page; 152 int ret = 0;
180 struct arm_vm_region *c; 153 pgd_t *pgd;
181 unsigned long order; 154 pmd_t *pmd;
182 u64 mask = get_coherent_dma_mask(dev); 155 pte_t *pte;
183 u64 limit; 156 int i = 0;
157 u32 base = CONSISTENT_BASE;
184 158
185 if (!consistent_pte[0]) { 159 do {
186 printk(KERN_ERR "%s: not initialised\n", __func__); 160 pgd = pgd_offset(&init_mm, base);
187 dump_stack(); 161 pmd = pmd_alloc(&init_mm, pgd, base);
188 return NULL; 162 if (!pmd) {
189 } 163 printk(KERN_ERR "%s: no pmd tables\n", __func__);
164 ret = -ENOMEM;
165 break;
166 }
167 WARN_ON(!pmd_none(*pmd));
190 168
191 if (!mask) 169 pte = pte_alloc_kernel(pmd, base);
192 goto no_page; 170 if (!pte) {
171 printk(KERN_ERR "%s: no pte tables\n", __func__);
172 ret = -ENOMEM;
173 break;
174 }
193 175
194 /* 176 consistent_pte[i++] = pte;
195 * Sanity check the allocation size. 177 base += (1 << PGDIR_SHIFT);
196 */ 178 } while (base < CONSISTENT_END);
197 size = PAGE_ALIGN(size);
198 limit = (mask + 1) & ~mask;
199 if ((limit && size >= limit) ||
200 size >= (CONSISTENT_END - CONSISTENT_BASE)) {
201 printk(KERN_WARNING "coherent allocation too big "
202 "(requested %#x mask %#llx)\n", size, mask);
203 goto no_page;
204 }
205 179
206 order = get_order(size); 180 return ret;
181}
207 182
208 if (mask < 0xffffffffULL) 183core_initcall(consistent_init);
209 gfp |= GFP_DMA;
210 184
211 page = alloc_pages(gfp, order); 185static void *
212 if (!page) 186__dma_alloc_remap(struct page *page, size_t size, gfp_t gfp, pgprot_t prot)
213 goto no_page; 187{
188 struct arm_vmregion *c;
214 189
215 /* 190 if (!consistent_pte[0]) {
216 * Invalidate any data that might be lurking in the 191 printk(KERN_ERR "%s: not initialised\n", __func__);
217 * kernel direct-mapped region for device DMA. 192 dump_stack();
218 */ 193 return NULL;
219 {
220 void *ptr = page_address(page);
221 memset(ptr, 0, size);
222 dmac_flush_range(ptr, ptr + size);
223 outer_flush_range(__pa(ptr), __pa(ptr) + size);
224 } 194 }
225 195
226 /* 196 /*
227 * Allocate a virtual address in the consistent mapping region. 197 * Allocate a virtual address in the consistent mapping region.
228 */ 198 */
229 c = arm_vm_region_alloc(&consistent_head, size, 199 c = arm_vmregion_alloc(&consistent_head, size,
230 gfp & ~(__GFP_DMA | __GFP_HIGHMEM)); 200 gfp & ~(__GFP_DMA | __GFP_HIGHMEM));
231 if (c) { 201 if (c) {
232 pte_t *pte; 202 pte_t *pte;
233 struct page *end = page + (1 << order);
234 int idx = CONSISTENT_PTE_INDEX(c->vm_start); 203 int idx = CONSISTENT_PTE_INDEX(c->vm_start);
235 u32 off = CONSISTENT_OFFSET(c->vm_start) & (PTRS_PER_PTE-1); 204 u32 off = CONSISTENT_OFFSET(c->vm_start) & (PTRS_PER_PTE-1);
236 205
237 pte = consistent_pte[idx] + off; 206 pte = consistent_pte[idx] + off;
238 c->vm_pages = page; 207 c->vm_pages = page;
239 208
240 split_page(page, order);
241
242 /*
243 * Set the "dma handle"
244 */
245 *handle = page_to_dma(dev, page);
246
247 do { 209 do {
248 BUG_ON(!pte_none(*pte)); 210 BUG_ON(!pte_none(*pte));
249 211
250 /*
251 * x86 does not mark the pages reserved...
252 */
253 SetPageReserved(page);
254 set_pte_ext(pte, mk_pte(page, prot), 0); 212 set_pte_ext(pte, mk_pte(page, prot), 0);
255 page++; 213 page++;
256 pte++; 214 pte++;
@@ -261,48 +219,90 @@ __dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp,
261 } 219 }
262 } while (size -= PAGE_SIZE); 220 } while (size -= PAGE_SIZE);
263 221
264 /*
265 * Free the otherwise unused pages.
266 */
267 while (page < end) {
268 __free_page(page);
269 page++;
270 }
271
272 return (void *)c->vm_start; 222 return (void *)c->vm_start;
273 } 223 }
274
275 if (page)
276 __free_pages(page, order);
277 no_page:
278 *handle = ~0;
279 return NULL; 224 return NULL;
280} 225}
226
227static void __dma_free_remap(void *cpu_addr, size_t size)
228{
229 struct arm_vmregion *c;
230 unsigned long addr;
231 pte_t *ptep;
232 int idx;
233 u32 off;
234
235 c = arm_vmregion_find_remove(&consistent_head, (unsigned long)cpu_addr);
236 if (!c) {
237 printk(KERN_ERR "%s: trying to free invalid coherent area: %p\n",
238 __func__, cpu_addr);
239 dump_stack();
240 return;
241 }
242
243 if ((c->vm_end - c->vm_start) != size) {
244 printk(KERN_ERR "%s: freeing wrong coherent size (%ld != %d)\n",
245 __func__, c->vm_end - c->vm_start, size);
246 dump_stack();
247 size = c->vm_end - c->vm_start;
248 }
249
250 idx = CONSISTENT_PTE_INDEX(c->vm_start);
251 off = CONSISTENT_OFFSET(c->vm_start) & (PTRS_PER_PTE-1);
252 ptep = consistent_pte[idx] + off;
253 addr = c->vm_start;
254 do {
255 pte_t pte = ptep_get_and_clear(&init_mm, addr, ptep);
256
257 ptep++;
258 addr += PAGE_SIZE;
259 off++;
260 if (off >= PTRS_PER_PTE) {
261 off = 0;
262 ptep = consistent_pte[++idx];
263 }
264
265 if (pte_none(pte) || !pte_present(pte))
266 printk(KERN_CRIT "%s: bad page in kernel page table\n",
267 __func__);
268 } while (size -= PAGE_SIZE);
269
270 flush_tlb_kernel_range(c->vm_start, c->vm_end);
271
272 arm_vmregion_free(&consistent_head, c);
273}
274
281#else /* !CONFIG_MMU */ 275#else /* !CONFIG_MMU */
276
277#define __dma_alloc_remap(page, size, gfp, prot) page_address(page)
278#define __dma_free_remap(addr, size) do { } while (0)
279
280#endif /* CONFIG_MMU */
281
282static void * 282static void *
283__dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp, 283__dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp,
284 pgprot_t prot) 284 pgprot_t prot)
285{ 285{
286 void *virt; 286 struct page *page;
287 u64 mask = get_coherent_dma_mask(dev); 287 void *addr;
288 288
289 if (!mask) 289 *handle = ~0;
290 goto error; 290 size = PAGE_ALIGN(size);
291 291
292 if (mask < 0xffffffffULL) 292 page = __dma_alloc_buffer(dev, size, gfp);
293 gfp |= GFP_DMA; 293 if (!page)
294 virt = kmalloc(size, gfp); 294 return NULL;
295 if (!virt)
296 goto error;
297 295
298 *handle = virt_to_dma(dev, virt); 296 if (!arch_is_coherent())
299 return virt; 297 addr = __dma_alloc_remap(page, size, gfp, prot);
298 else
299 addr = page_address(page);
300 300
301error: 301 if (addr)
302 *handle = ~0; 302 *handle = page_to_dma(dev, page);
303 return NULL; 303
304 return addr;
304} 305}
305#endif /* CONFIG_MMU */
306 306
307/* 307/*
308 * Allocate DMA-coherent memory space and return both the kernel remapped 308 * Allocate DMA-coherent memory space and return both the kernel remapped
@@ -316,19 +316,8 @@ dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gf
316 if (dma_alloc_from_coherent(dev, size, handle, &memory)) 316 if (dma_alloc_from_coherent(dev, size, handle, &memory))
317 return memory; 317 return memory;
318 318
319 if (arch_is_coherent()) {
320 void *virt;
321
322 virt = kmalloc(size, gfp);
323 if (!virt)
324 return NULL;
325 *handle = virt_to_dma(dev, virt);
326
327 return virt;
328 }
329
330 return __dma_alloc(dev, size, handle, gfp, 319 return __dma_alloc(dev, size, handle, gfp,
331 pgprot_noncached(pgprot_kernel)); 320 pgprot_dmacoherent(pgprot_kernel));
332} 321}
333EXPORT_SYMBOL(dma_alloc_coherent); 322EXPORT_SYMBOL(dma_alloc_coherent);
334 323
@@ -349,15 +338,12 @@ static int dma_mmap(struct device *dev, struct vm_area_struct *vma,
349{ 338{
350 int ret = -ENXIO; 339 int ret = -ENXIO;
351#ifdef CONFIG_MMU 340#ifdef CONFIG_MMU
352 unsigned long flags, user_size, kern_size; 341 unsigned long user_size, kern_size;
353 struct arm_vm_region *c; 342 struct arm_vmregion *c;
354 343
355 user_size = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; 344 user_size = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
356 345
357 spin_lock_irqsave(&consistent_lock, flags); 346 c = arm_vmregion_find(&consistent_head, (unsigned long)cpu_addr);
358 c = arm_vm_region_find(&consistent_head, (unsigned long)cpu_addr);
359 spin_unlock_irqrestore(&consistent_lock, flags);
360
361 if (c) { 347 if (c) {
362 unsigned long off = vma->vm_pgoff; 348 unsigned long off = vma->vm_pgoff;
363 349
@@ -379,7 +365,7 @@ static int dma_mmap(struct device *dev, struct vm_area_struct *vma,
379int dma_mmap_coherent(struct device *dev, struct vm_area_struct *vma, 365int dma_mmap_coherent(struct device *dev, struct vm_area_struct *vma,
380 void *cpu_addr, dma_addr_t dma_addr, size_t size) 366 void *cpu_addr, dma_addr_t dma_addr, size_t size)
381{ 367{
382 vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); 368 vma->vm_page_prot = pgprot_dmacoherent(vma->vm_page_prot);
383 return dma_mmap(dev, vma, cpu_addr, dma_addr, size); 369 return dma_mmap(dev, vma, cpu_addr, dma_addr, size);
384} 370}
385EXPORT_SYMBOL(dma_mmap_coherent); 371EXPORT_SYMBOL(dma_mmap_coherent);
@@ -396,144 +382,23 @@ EXPORT_SYMBOL(dma_mmap_writecombine);
396 * free a page as defined by the above mapping. 382 * free a page as defined by the above mapping.
397 * Must not be called with IRQs disabled. 383 * Must not be called with IRQs disabled.
398 */ 384 */
399#ifdef CONFIG_MMU
400void dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, dma_addr_t handle) 385void dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, dma_addr_t handle)
401{ 386{
402 struct arm_vm_region *c;
403 unsigned long flags, addr;
404 pte_t *ptep;
405 int idx;
406 u32 off;
407
408 WARN_ON(irqs_disabled()); 387 WARN_ON(irqs_disabled());
409 388
410 if (dma_release_from_coherent(dev, get_order(size), cpu_addr)) 389 if (dma_release_from_coherent(dev, get_order(size), cpu_addr))
411 return; 390 return;
412 391
413 if (arch_is_coherent()) {
414 kfree(cpu_addr);
415 return;
416 }
417
418 size = PAGE_ALIGN(size); 392 size = PAGE_ALIGN(size);
419 393
420 spin_lock_irqsave(&consistent_lock, flags); 394 if (!arch_is_coherent())
421 c = arm_vm_region_find(&consistent_head, (unsigned long)cpu_addr); 395 __dma_free_remap(cpu_addr, size);
422 if (!c)
423 goto no_area;
424
425 c->vm_active = 0;
426 spin_unlock_irqrestore(&consistent_lock, flags);
427
428 if ((c->vm_end - c->vm_start) != size) {
429 printk(KERN_ERR "%s: freeing wrong coherent size (%ld != %d)\n",
430 __func__, c->vm_end - c->vm_start, size);
431 dump_stack();
432 size = c->vm_end - c->vm_start;
433 }
434
435 idx = CONSISTENT_PTE_INDEX(c->vm_start);
436 off = CONSISTENT_OFFSET(c->vm_start) & (PTRS_PER_PTE-1);
437 ptep = consistent_pte[idx] + off;
438 addr = c->vm_start;
439 do {
440 pte_t pte = ptep_get_and_clear(&init_mm, addr, ptep);
441 unsigned long pfn;
442
443 ptep++;
444 addr += PAGE_SIZE;
445 off++;
446 if (off >= PTRS_PER_PTE) {
447 off = 0;
448 ptep = consistent_pte[++idx];
449 }
450
451 if (!pte_none(pte) && pte_present(pte)) {
452 pfn = pte_pfn(pte);
453
454 if (pfn_valid(pfn)) {
455 struct page *page = pfn_to_page(pfn);
456
457 /*
458 * x86 does not mark the pages reserved...
459 */
460 ClearPageReserved(page);
461
462 __free_page(page);
463 continue;
464 }
465 }
466
467 printk(KERN_CRIT "%s: bad page in kernel page table\n",
468 __func__);
469 } while (size -= PAGE_SIZE);
470
471 flush_tlb_kernel_range(c->vm_start, c->vm_end);
472
473 spin_lock_irqsave(&consistent_lock, flags);
474 list_del(&c->vm_list);
475 spin_unlock_irqrestore(&consistent_lock, flags);
476
477 kfree(c);
478 return;
479 396
480 no_area: 397 __dma_free_buffer(dma_to_page(dev, handle), size);
481 spin_unlock_irqrestore(&consistent_lock, flags);
482 printk(KERN_ERR "%s: trying to free invalid coherent area: %p\n",
483 __func__, cpu_addr);
484 dump_stack();
485} 398}
486#else /* !CONFIG_MMU */
487void dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, dma_addr_t handle)
488{
489 if (dma_release_from_coherent(dev, get_order(size), cpu_addr))
490 return;
491 kfree(cpu_addr);
492}
493#endif /* CONFIG_MMU */
494EXPORT_SYMBOL(dma_free_coherent); 399EXPORT_SYMBOL(dma_free_coherent);
495 400
496/* 401/*
497 * Initialise the consistent memory allocation.
498 */
499static int __init consistent_init(void)
500{
501 int ret = 0;
502#ifdef CONFIG_MMU
503 pgd_t *pgd;
504 pmd_t *pmd;
505 pte_t *pte;
506 int i = 0;
507 u32 base = CONSISTENT_BASE;
508
509 do {
510 pgd = pgd_offset(&init_mm, base);
511 pmd = pmd_alloc(&init_mm, pgd, base);
512 if (!pmd) {
513 printk(KERN_ERR "%s: no pmd tables\n", __func__);
514 ret = -ENOMEM;
515 break;
516 }
517 WARN_ON(!pmd_none(*pmd));
518
519 pte = pte_alloc_kernel(pmd, base);
520 if (!pte) {
521 printk(KERN_ERR "%s: no pte tables\n", __func__);
522 ret = -ENOMEM;
523 break;
524 }
525
526 consistent_pte[i++] = pte;
527 base += (1 << PGDIR_SHIFT);
528 } while (base < CONSISTENT_END);
529#endif /* !CONFIG_MMU */
530
531 return ret;
532}
533
534core_initcall(consistent_init);
535
536/*
537 * Make an area consistent for devices. 402 * Make an area consistent for devices.
538 * Note: Drivers should NOT use this function directly, as it will break 403 * Note: Drivers should NOT use this function directly, as it will break
539 * platforms with CONFIG_DMABOUNCE. 404 * platforms with CONFIG_DMABOUNCE.
diff --git a/arch/arm/mm/fault-armv.c b/arch/arm/mm/fault-armv.c
index d0d17b6a3703..729602291958 100644
--- a/arch/arm/mm/fault-armv.c
+++ b/arch/arm/mm/fault-armv.c
@@ -23,6 +23,8 @@
23#include <asm/pgtable.h> 23#include <asm/pgtable.h>
24#include <asm/tlbflush.h> 24#include <asm/tlbflush.h>
25 25
26#include "mm.h"
27
26static unsigned long shared_pte_mask = L_PTE_MT_BUFFERABLE; 28static unsigned long shared_pte_mask = L_PTE_MT_BUFFERABLE;
27 29
28/* 30/*
@@ -151,7 +153,14 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long addr, pte_t pte)
151 if (!pfn_valid(pfn)) 153 if (!pfn_valid(pfn))
152 return; 154 return;
153 155
156 /*
157 * The zero page is never written to, so never has any dirty
158 * cache lines, and therefore never needs to be flushed.
159 */
154 page = pfn_to_page(pfn); 160 page = pfn_to_page(pfn);
161 if (page == ZERO_PAGE(0))
162 return;
163
155 mapping = page_mapping(page); 164 mapping = page_mapping(page);
156#ifndef CONFIG_SMP 165#ifndef CONFIG_SMP
157 if (test_and_clear_bit(PG_dcache_dirty, &page->flags)) 166 if (test_and_clear_bit(PG_dcache_dirty, &page->flags))
diff --git a/arch/arm/mm/flush.c b/arch/arm/mm/flush.c
index 7f294f307c83..329594e760cd 100644
--- a/arch/arm/mm/flush.c
+++ b/arch/arm/mm/flush.c
@@ -35,14 +35,12 @@ static void flush_pfn_alias(unsigned long pfn, unsigned long vaddr)
35 : 35 :
36 : "r" (to), "r" (to + PAGE_SIZE - L1_CACHE_BYTES), "r" (zero) 36 : "r" (to), "r" (to + PAGE_SIZE - L1_CACHE_BYTES), "r" (zero)
37 : "cc"); 37 : "cc");
38 __flush_icache_all();
39} 38}
40 39
41void flush_cache_mm(struct mm_struct *mm) 40void flush_cache_mm(struct mm_struct *mm)
42{ 41{
43 if (cache_is_vivt()) { 42 if (cache_is_vivt()) {
44 if (cpumask_test_cpu(smp_processor_id(), mm_cpumask(mm))) 43 vivt_flush_cache_mm(mm);
45 __cpuc_flush_user_all();
46 return; 44 return;
47 } 45 }
48 46
@@ -52,16 +50,13 @@ void flush_cache_mm(struct mm_struct *mm)
52 : 50 :
53 : "r" (0) 51 : "r" (0)
54 : "cc"); 52 : "cc");
55 __flush_icache_all();
56 } 53 }
57} 54}
58 55
59void flush_cache_range(struct vm_area_struct *vma, unsigned long start, unsigned long end) 56void flush_cache_range(struct vm_area_struct *vma, unsigned long start, unsigned long end)
60{ 57{
61 if (cache_is_vivt()) { 58 if (cache_is_vivt()) {
62 if (cpumask_test_cpu(smp_processor_id(), mm_cpumask(vma->vm_mm))) 59 vivt_flush_cache_range(vma, start, end);
63 __cpuc_flush_user_range(start & PAGE_MASK, PAGE_ALIGN(end),
64 vma->vm_flags);
65 return; 60 return;
66 } 61 }
67 62
@@ -71,22 +66,26 @@ void flush_cache_range(struct vm_area_struct *vma, unsigned long start, unsigned
71 : 66 :
72 : "r" (0) 67 : "r" (0)
73 : "cc"); 68 : "cc");
74 __flush_icache_all();
75 } 69 }
70
71 if (vma->vm_flags & VM_EXEC)
72 __flush_icache_all();
76} 73}
77 74
78void flush_cache_page(struct vm_area_struct *vma, unsigned long user_addr, unsigned long pfn) 75void flush_cache_page(struct vm_area_struct *vma, unsigned long user_addr, unsigned long pfn)
79{ 76{
80 if (cache_is_vivt()) { 77 if (cache_is_vivt()) {
81 if (cpumask_test_cpu(smp_processor_id(), mm_cpumask(vma->vm_mm))) { 78 vivt_flush_cache_page(vma, user_addr, pfn);
82 unsigned long addr = user_addr & PAGE_MASK;
83 __cpuc_flush_user_range(addr, addr + PAGE_SIZE, vma->vm_flags);
84 }
85 return; 79 return;
86 } 80 }
87 81
88 if (cache_is_vipt_aliasing()) 82 if (cache_is_vipt_aliasing()) {
89 flush_pfn_alias(pfn, user_addr); 83 flush_pfn_alias(pfn, user_addr);
84 __flush_icache_all();
85 }
86
87 if (vma->vm_flags & VM_EXEC && icache_is_vivt_asid_tagged())
88 __flush_icache_all();
90} 89}
91 90
92void flush_ptrace_access(struct vm_area_struct *vma, struct page *page, 91void flush_ptrace_access(struct vm_area_struct *vma, struct page *page,
@@ -94,15 +93,13 @@ void flush_ptrace_access(struct vm_area_struct *vma, struct page *page,
94 unsigned long len, int write) 93 unsigned long len, int write)
95{ 94{
96 if (cache_is_vivt()) { 95 if (cache_is_vivt()) {
97 if (cpumask_test_cpu(smp_processor_id(), mm_cpumask(vma->vm_mm))) { 96 vivt_flush_ptrace_access(vma, page, uaddr, kaddr, len, write);
98 unsigned long addr = (unsigned long)kaddr;
99 __cpuc_coherent_kern_range(addr, addr + len);
100 }
101 return; 97 return;
102 } 98 }
103 99
104 if (cache_is_vipt_aliasing()) { 100 if (cache_is_vipt_aliasing()) {
105 flush_pfn_alias(page_to_pfn(page), uaddr); 101 flush_pfn_alias(page_to_pfn(page), uaddr);
102 __flush_icache_all();
106 return; 103 return;
107 } 104 }
108 105
@@ -120,6 +117,8 @@ void flush_ptrace_access(struct vm_area_struct *vma, struct page *page,
120 117
121void __flush_dcache_page(struct address_space *mapping, struct page *page) 118void __flush_dcache_page(struct address_space *mapping, struct page *page)
122{ 119{
120 void *addr = page_address(page);
121
123 /* 122 /*
124 * Writeback any data associated with the kernel mapping of this 123 * Writeback any data associated with the kernel mapping of this
125 * page. This ensures that data in the physical page is mutually 124 * page. This ensures that data in the physical page is mutually
@@ -130,9 +129,9 @@ void __flush_dcache_page(struct address_space *mapping, struct page *page)
130 * kmap_atomic() doesn't set the page virtual address, and 129 * kmap_atomic() doesn't set the page virtual address, and
131 * kunmap_atomic() takes care of cache flushing already. 130 * kunmap_atomic() takes care of cache flushing already.
132 */ 131 */
133 if (page_address(page)) 132 if (addr)
134#endif 133#endif
135 __cpuc_flush_dcache_page(page_address(page)); 134 __cpuc_flush_dcache_page(addr);
136 135
137 /* 136 /*
138 * If this is a page cache page, and we have an aliasing VIPT cache, 137 * If this is a page cache page, and we have an aliasing VIPT cache,
@@ -196,7 +195,16 @@ static void __flush_dcache_aliases(struct address_space *mapping, struct page *p
196 */ 195 */
197void flush_dcache_page(struct page *page) 196void flush_dcache_page(struct page *page)
198{ 197{
199 struct address_space *mapping = page_mapping(page); 198 struct address_space *mapping;
199
200 /*
201 * The zero page is never written to, so never has any dirty
202 * cache lines, and therefore never needs to be flushed.
203 */
204 if (page == ZERO_PAGE(0))
205 return;
206
207 mapping = page_mapping(page);
200 208
201#ifndef CONFIG_SMP 209#ifndef CONFIG_SMP
202 if (!PageHighMem(page) && mapping && !mapping_mapped(mapping)) 210 if (!PageHighMem(page) && mapping && !mapping_mapped(mapping))
@@ -242,6 +250,7 @@ void __flush_anon_page(struct vm_area_struct *vma, struct page *page, unsigned l
242 * userspace address only. 250 * userspace address only.
243 */ 251 */
244 flush_pfn_alias(pfn, vmaddr); 252 flush_pfn_alias(pfn, vmaddr);
253 __flush_icache_all();
245 } 254 }
246 255
247 /* 256 /*
diff --git a/arch/arm/mm/mm.h b/arch/arm/mm/mm.h
index c4f6f05198e0..a888363398f8 100644
--- a/arch/arm/mm/mm.h
+++ b/arch/arm/mm/mm.h
@@ -24,6 +24,8 @@ struct mem_type {
24 24
25const struct mem_type *get_mem_type(unsigned int type); 25const struct mem_type *get_mem_type(unsigned int type);
26 26
27extern void __flush_dcache_page(struct address_space *mapping, struct page *page);
28
27#endif 29#endif
28 30
29struct map_desc; 31struct map_desc;
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index ea67be0223ac..8c7fbd19a4b3 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -881,7 +881,7 @@ void __init reserve_node_zero(pg_data_t *pgdat)
881 BOOTMEM_EXCLUSIVE); 881 BOOTMEM_EXCLUSIVE);
882 } 882 }
883 883
884 if (machine_is_treo680()) { 884 if (machine_is_treo680() || machine_is_centro()) {
885 reserve_bootmem_node(pgdat, 0xa0000000, 0x1000, 885 reserve_bootmem_node(pgdat, 0xa0000000, 0x1000,
886 BOOTMEM_EXCLUSIVE); 886 BOOTMEM_EXCLUSIVE);
887 reserve_bootmem_node(pgdat, 0xa2000000, 0x1000, 887 reserve_bootmem_node(pgdat, 0xa2000000, 0x1000,
@@ -1036,7 +1036,7 @@ void __init paging_init(struct machine_desc *mdesc)
1036 */ 1036 */
1037 zero_page = alloc_bootmem_low_pages(PAGE_SIZE); 1037 zero_page = alloc_bootmem_low_pages(PAGE_SIZE);
1038 empty_zero_page = virt_to_page(zero_page); 1038 empty_zero_page = virt_to_page(zero_page);
1039 flush_dcache_page(empty_zero_page); 1039 __flush_dcache_page(NULL, empty_zero_page);
1040} 1040}
1041 1041
1042/* 1042/*
diff --git a/arch/arm/mm/proc-v6.S b/arch/arm/mm/proc-v6.S
index 70f75d2e3ead..5485c821101c 100644
--- a/arch/arm/mm/proc-v6.S
+++ b/arch/arm/mm/proc-v6.S
@@ -130,9 +130,16 @@ ENTRY(cpu_v6_set_pte_ext)
130 130
131 131
132 132
133 133 .type cpu_v6_name, #object
134cpu_v6_name: 134cpu_v6_name:
135 .asciz "ARMv6-compatible processor" 135 .asciz "ARMv6-compatible processor"
136 .size cpu_v6_name, . - cpu_v6_name
137
138 .type cpu_pj4_name, #object
139cpu_pj4_name:
140 .asciz "Marvell PJ4 processor"
141 .size cpu_pj4_name, . - cpu_pj4_name
142
136 .align 143 .align
137 144
138 __INIT 145 __INIT
@@ -241,3 +248,27 @@ __v6_proc_info:
241 .long v6_user_fns 248 .long v6_user_fns
242 .long v6_cache_fns 249 .long v6_cache_fns
243 .size __v6_proc_info, . - __v6_proc_info 250 .size __v6_proc_info, . - __v6_proc_info
251
252 .type __pj4_v6_proc_info, #object
253__pj4_v6_proc_info:
254 .long 0x560f5810
255 .long 0xff0ffff0
256 .long PMD_TYPE_SECT | \
257 PMD_SECT_BUFFERABLE | \
258 PMD_SECT_CACHEABLE | \
259 PMD_SECT_AP_WRITE | \
260 PMD_SECT_AP_READ
261 .long PMD_TYPE_SECT | \
262 PMD_SECT_XN | \
263 PMD_SECT_AP_WRITE | \
264 PMD_SECT_AP_READ
265 b __v6_setup
266 .long cpu_arch_name
267 .long cpu_elf_name
268 .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP
269 .long cpu_pj4_name
270 .long v6_processor_functions
271 .long v6wbi_tlb_fns
272 .long v6_user_fns
273 .long v6_cache_fns
274 .size __pj4_v6_proc_info, . - __pj4_v6_proc_info
diff --git a/arch/arm/mm/proc-xsc3.S b/arch/arm/mm/proc-xsc3.S
index 2028f3702881..fab134e29826 100644
--- a/arch/arm/mm/proc-xsc3.S
+++ b/arch/arm/mm/proc-xsc3.S
@@ -396,7 +396,7 @@ __xsc3_setup:
396 orr r4, r4, #0x18 @ cache the page table in L2 396 orr r4, r4, #0x18 @ cache the page table in L2
397 mcr p15, 0, r4, c2, c0, 0 @ load page table pointer 397 mcr p15, 0, r4, c2, c0, 0 @ load page table pointer
398 398
399 mov r0, #0 @ don't allow CP access 399 mov r0, #1 << 6 @ cp6 access for early sched_clock
400 mcr p15, 0, r0, c15, c1, 0 @ write CP access register 400 mcr p15, 0, r0, c15, c1, 0 @ write CP access register
401 401
402 mrc p15, 0, r0, c1, c0, 1 @ get auxiliary control reg 402 mrc p15, 0, r0, c1, c0, 1 @ get auxiliary control reg
diff --git a/arch/arm/mm/vmregion.c b/arch/arm/mm/vmregion.c
new file mode 100644
index 000000000000..19e09bdb1b8a
--- /dev/null
+++ b/arch/arm/mm/vmregion.c
@@ -0,0 +1,131 @@
1#include <linux/spinlock.h>
2#include <linux/list.h>
3#include <linux/slab.h>
4
5#include "vmregion.h"
6
7/*
8 * VM region handling support.
9 *
10 * This should become something generic, handling VM region allocations for
11 * vmalloc and similar (ioremap, module space, etc).
12 *
13 * I envisage vmalloc()'s supporting vm_struct becoming:
14 *
15 * struct vm_struct {
16 * struct vmregion region;
17 * unsigned long flags;
18 * struct page **pages;
19 * unsigned int nr_pages;
20 * unsigned long phys_addr;
21 * };
22 *
23 * get_vm_area() would then call vmregion_alloc with an appropriate
24 * struct vmregion head (eg):
25 *
26 * struct vmregion vmalloc_head = {
27 * .vm_list = LIST_HEAD_INIT(vmalloc_head.vm_list),
28 * .vm_start = VMALLOC_START,
29 * .vm_end = VMALLOC_END,
30 * };
31 *
32 * However, vmalloc_head.vm_start is variable (typically, it is dependent on
33 * the amount of RAM found at boot time.) I would imagine that get_vm_area()
34 * would have to initialise this each time prior to calling vmregion_alloc().
35 */
36
37struct arm_vmregion *
38arm_vmregion_alloc(struct arm_vmregion_head *head, size_t size, gfp_t gfp)
39{
40 unsigned long addr = head->vm_start, end = head->vm_end - size;
41 unsigned long flags;
42 struct arm_vmregion *c, *new;
43
44 if (head->vm_end - head->vm_start < size) {
45 printk(KERN_WARNING "%s: allocation too big (requested %#x)\n",
46 __func__, size);
47 goto out;
48 }
49
50 new = kmalloc(sizeof(struct arm_vmregion), gfp);
51 if (!new)
52 goto out;
53
54 spin_lock_irqsave(&head->vm_lock, flags);
55
56 list_for_each_entry(c, &head->vm_list, vm_list) {
57 if ((addr + size) < addr)
58 goto nospc;
59 if ((addr + size) <= c->vm_start)
60 goto found;
61 addr = c->vm_end;
62 if (addr > end)
63 goto nospc;
64 }
65
66 found:
67 /*
68 * Insert this entry _before_ the one we found.
69 */
70 list_add_tail(&new->vm_list, &c->vm_list);
71 new->vm_start = addr;
72 new->vm_end = addr + size;
73 new->vm_active = 1;
74
75 spin_unlock_irqrestore(&head->vm_lock, flags);
76 return new;
77
78 nospc:
79 spin_unlock_irqrestore(&head->vm_lock, flags);
80 kfree(new);
81 out:
82 return NULL;
83}
84
85static struct arm_vmregion *__arm_vmregion_find(struct arm_vmregion_head *head, unsigned long addr)
86{
87 struct arm_vmregion *c;
88
89 list_for_each_entry(c, &head->vm_list, vm_list) {
90 if (c->vm_active && c->vm_start == addr)
91 goto out;
92 }
93 c = NULL;
94 out:
95 return c;
96}
97
98struct arm_vmregion *arm_vmregion_find(struct arm_vmregion_head *head, unsigned long addr)
99{
100 struct arm_vmregion *c;
101 unsigned long flags;
102
103 spin_lock_irqsave(&head->vm_lock, flags);
104 c = __arm_vmregion_find(head, addr);
105 spin_unlock_irqrestore(&head->vm_lock, flags);
106 return c;
107}
108
109struct arm_vmregion *arm_vmregion_find_remove(struct arm_vmregion_head *head, unsigned long addr)
110{
111 struct arm_vmregion *c;
112 unsigned long flags;
113
114 spin_lock_irqsave(&head->vm_lock, flags);
115 c = __arm_vmregion_find(head, addr);
116 if (c)
117 c->vm_active = 0;
118 spin_unlock_irqrestore(&head->vm_lock, flags);
119 return c;
120}
121
122void arm_vmregion_free(struct arm_vmregion_head *head, struct arm_vmregion *c)
123{
124 unsigned long flags;
125
126 spin_lock_irqsave(&head->vm_lock, flags);
127 list_del(&c->vm_list);
128 spin_unlock_irqrestore(&head->vm_lock, flags);
129
130 kfree(c);
131}
diff --git a/arch/arm/mm/vmregion.h b/arch/arm/mm/vmregion.h
new file mode 100644
index 000000000000..6b2cdbdf3a85
--- /dev/null
+++ b/arch/arm/mm/vmregion.h
@@ -0,0 +1,29 @@
1#ifndef VMREGION_H
2#define VMREGION_H
3
4#include <linux/spinlock.h>
5#include <linux/list.h>
6
7struct page;
8
9struct arm_vmregion_head {
10 spinlock_t vm_lock;
11 struct list_head vm_list;
12 unsigned long vm_start;
13 unsigned long vm_end;
14};
15
16struct arm_vmregion {
17 struct list_head vm_list;
18 unsigned long vm_start;
19 unsigned long vm_end;
20 struct page *vm_pages;
21 int vm_active;
22};
23
24struct arm_vmregion *arm_vmregion_alloc(struct arm_vmregion_head *, size_t, gfp_t);
25struct arm_vmregion *arm_vmregion_find(struct arm_vmregion_head *, unsigned long);
26struct arm_vmregion *arm_vmregion_find_remove(struct arm_vmregion_head *, unsigned long);
27void arm_vmregion_free(struct arm_vmregion_head *, struct arm_vmregion *);
28
29#endif
diff --git a/arch/arm/plat-iop/time.c b/arch/arm/plat-iop/time.c
index 8da95d57c21f..6c8a02ad98e3 100644
--- a/arch/arm/plat-iop/time.c
+++ b/arch/arm/plat-iop/time.c
@@ -19,6 +19,8 @@
19#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/timex.h> 20#include <linux/timex.h>
21#include <linux/io.h> 21#include <linux/io.h>
22#include <linux/clocksource.h>
23#include <linux/clockchips.h>
22#include <mach/hardware.h> 24#include <mach/hardware.h>
23#include <asm/irq.h> 25#include <asm/irq.h>
24#include <asm/uaccess.h> 26#include <asm/uaccess.h>
@@ -26,45 +28,136 @@
26#include <asm/mach/time.h> 28#include <asm/mach/time.h>
27#include <mach/time.h> 29#include <mach/time.h>
28 30
31/*
32 * IOP clocksource (free-running timer 1).
33 */
34static cycle_t iop_clocksource_read(struct clocksource *unused)
35{
36 return 0xffffffffu - read_tcr1();
37}
38
39static struct clocksource iop_clocksource = {
40 .name = "iop_timer1",
41 .rating = 300,
42 .read = iop_clocksource_read,
43 .mask = CLOCKSOURCE_MASK(32),
44 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
45};
46
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/*
69 * IOP sched_clock() implementation via its clocksource.
70 */
71unsigned long long sched_clock(void)
72{
73 cycle_t cyc = iop_clocksource_read(NULL);
74 struct clocksource *cs = &iop_clocksource;
75
76 return clocksource_cyc2ns(cyc, cs->mult, cs->shift);
77}
78
79/*
80 * IOP clockevents (interrupting timer 0).
81 */
82static int iop_set_next_event(unsigned long delta,
83 struct clock_event_device *unused)
84{
85 u32 tmr = IOP_TMR_PRIVILEGED | IOP_TMR_RATIO_1_1;
86
87 BUG_ON(delta == 0);
88 write_tmr0(tmr & ~(IOP_TMR_EN | IOP_TMR_RELOAD));
89 write_tcr0(delta);
90 write_tmr0((tmr & ~IOP_TMR_RELOAD) | IOP_TMR_EN);
91
92 return 0;
93}
94
29static unsigned long ticks_per_jiffy; 95static unsigned long ticks_per_jiffy;
30static unsigned long ticks_per_usec;
31static unsigned long next_jiffy_time;
32 96
33unsigned long iop_gettimeoffset(void) 97static void iop_set_mode(enum clock_event_mode mode,
98 struct clock_event_device *unused)
34{ 99{
35 unsigned long offset, temp; 100 u32 tmr = read_tmr0();
101
102 switch (mode) {
103 case CLOCK_EVT_MODE_PERIODIC:
104 write_tmr0(tmr & ~IOP_TMR_EN);
105 write_tcr0(ticks_per_jiffy - 1);
106 tmr |= (IOP_TMR_RELOAD | IOP_TMR_EN);
107 break;
108 case CLOCK_EVT_MODE_ONESHOT:
109 /* ->set_next_event sets period and enables timer */
110 tmr &= ~(IOP_TMR_RELOAD | IOP_TMR_EN);
111 break;
112 case CLOCK_EVT_MODE_RESUME:
113 tmr |= IOP_TMR_EN;
114 break;
115 case CLOCK_EVT_MODE_SHUTDOWN:
116 case CLOCK_EVT_MODE_UNUSED:
117 default:
118 tmr &= ~IOP_TMR_EN;
119 break;
120 }
36 121
37 /* enable cp6, if necessary, to avoid taking the overhead of an 122 write_tmr0(tmr);
38 * undefined instruction trap 123}
39 */ 124
40 asm volatile ( 125static struct clock_event_device iop_clockevent = {
41 "mrc p15, 0, %0, c15, c1, 0\n\t" 126 .name = "iop_timer0",
42 "tst %0, #(1 << 6)\n\t" 127 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
43 "orreq %0, %0, #(1 << 6)\n\t" 128 .rating = 300,
44 "mcreq p15, 0, %0, c15, c1, 0\n\t" 129 .set_next_event = iop_set_next_event,
45#ifdef CONFIG_CPU_XSCALE 130 .set_mode = iop_set_mode,
46 "mrceq p15, 0, %0, c15, c1, 0\n\t" 131};
47 "moveq %0, %0\n\t" 132
48 "subeq pc, pc, #4\n\t" 133static void __init iop_clockevent_set_hz(struct clock_event_device *ce, unsigned int hz)
49#endif 134{
50 : "=r"(temp) : : "cc"); 135 u64 temp;
51 136 u32 shift;
52 offset = next_jiffy_time - read_tcr1(); 137
53 138 /* Find shift and mult values for hz. */
54 return offset / ticks_per_usec; 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);
55} 152}
56 153
57static irqreturn_t 154static irqreturn_t
58iop_timer_interrupt(int irq, void *dev_id) 155iop_timer_interrupt(int irq, void *dev_id)
59{ 156{
60 write_tisr(1); 157 struct clock_event_device *evt = dev_id;
61
62 while ((signed long)(next_jiffy_time - read_tcr1())
63 >= ticks_per_jiffy) {
64 timer_tick();
65 next_jiffy_time -= ticks_per_jiffy;
66 }
67 158
159 write_tisr(1);
160 evt->event_handler(evt);
68 return IRQ_HANDLED; 161 return IRQ_HANDLED;
69} 162}
70 163
@@ -72,6 +165,7 @@ static struct irqaction iop_timer_irq = {
72 .name = "IOP Timer Tick", 165 .name = "IOP Timer Tick",
73 .handler = iop_timer_interrupt, 166 .handler = iop_timer_interrupt,
74 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, 167 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
168 .dev_id = &iop_clockevent,
75}; 169};
76 170
77static unsigned long iop_tick_rate; 171static unsigned long iop_tick_rate;
@@ -86,21 +180,33 @@ void __init iop_init_time(unsigned long tick_rate)
86 u32 timer_ctl; 180 u32 timer_ctl;
87 181
88 ticks_per_jiffy = DIV_ROUND_CLOSEST(tick_rate, HZ); 182 ticks_per_jiffy = DIV_ROUND_CLOSEST(tick_rate, HZ);
89 ticks_per_usec = tick_rate / 1000000;
90 next_jiffy_time = 0xffffffff;
91 iop_tick_rate = tick_rate; 183 iop_tick_rate = tick_rate;
92 184
93 timer_ctl = IOP_TMR_EN | IOP_TMR_PRIVILEGED | 185 timer_ctl = IOP_TMR_EN | IOP_TMR_PRIVILEGED |
94 IOP_TMR_RELOAD | IOP_TMR_RATIO_1_1; 186 IOP_TMR_RELOAD | IOP_TMR_RATIO_1_1;
95 187
96 /* 188 /*
97 * We use timer 0 for our timer interrupt, and timer 1 as 189 * Set up interrupting clockevent timer 0.
98 * monotonic counter for tracking missed jiffies.
99 */ 190 */
191 write_tmr0(timer_ctl & ~IOP_TMR_EN);
192 setup_irq(IRQ_IOP_TIMER0, &iop_timer_irq);
193 iop_clockevent_set_hz(&iop_clockevent, tick_rate);
194 iop_clockevent.max_delta_ns =
195 clockevent_delta2ns(0xfffffffe, &iop_clockevent);
196 iop_clockevent.min_delta_ns =
197 clockevent_delta2ns(0xf, &iop_clockevent);
198 iop_clockevent.cpumask = cpumask_of(0);
199 clockevents_register_device(&iop_clockevent);
100 write_trr0(ticks_per_jiffy - 1); 200 write_trr0(ticks_per_jiffy - 1);
201 write_tcr0(ticks_per_jiffy - 1);
101 write_tmr0(timer_ctl); 202 write_tmr0(timer_ctl);
203
204 /*
205 * Set up free-running clocksource timer 1.
206 */
102 write_trr1(0xffffffff); 207 write_trr1(0xffffffff);
208 write_tcr1(0xffffffff);
103 write_tmr1(timer_ctl); 209 write_tmr1(timer_ctl);
104 210 iop_clocksource_set_hz(&iop_clocksource, tick_rate);
105 setup_irq(IRQ_IOP_TIMER0, &iop_timer_irq); 211 clocksource_register(&iop_clocksource);
106} 212}
diff --git a/arch/arm/plat-mxc/Kconfig b/arch/arm/plat-mxc/Kconfig
index ca5c7c226341..8b0a1ee039fa 100644
--- a/arch/arm/plat-mxc/Kconfig
+++ b/arch/arm/plat-mxc/Kconfig
@@ -69,10 +69,20 @@ config MXC_PWM
69 help 69 help
70 Enable support for the i.MX PWM controller(s). 70 Enable support for the i.MX PWM controller(s).
71 71
72config MXC_ULPI
73 bool
74
72config ARCH_HAS_RNGA 75config ARCH_HAS_RNGA
73 bool 76 bool
74 depends on ARCH_MXC 77 depends on ARCH_MXC
75 78
76config ARCH_MXC_IOMUX_V3 79config ARCH_MXC_IOMUX_V3
77 bool 80 bool
81
82config ARCH_MXC_AUDMUX_V1
83 bool
84
85config ARCH_MXC_AUDMUX_V2
86 bool
87
78endif 88endif
diff --git a/arch/arm/plat-mxc/Makefile b/arch/arm/plat-mxc/Makefile
index e3212c8ff421..4cbca9da1505 100644
--- a/arch/arm/plat-mxc/Makefile
+++ b/arch/arm/plat-mxc/Makefile
@@ -9,3 +9,6 @@ obj-$(CONFIG_ARCH_MX1) += iomux-mx1-mx2.o dma-mx1-mx2.o
9obj-$(CONFIG_ARCH_MX2) += iomux-mx1-mx2.o dma-mx1-mx2.o 9obj-$(CONFIG_ARCH_MX2) += iomux-mx1-mx2.o dma-mx1-mx2.o
10obj-$(CONFIG_ARCH_MXC_IOMUX_V3) += iomux-v3.o 10obj-$(CONFIG_ARCH_MXC_IOMUX_V3) += iomux-v3.o
11obj-$(CONFIG_MXC_PWM) += pwm.o 11obj-$(CONFIG_MXC_PWM) += pwm.o
12obj-$(CONFIG_MXC_ULPI) += ulpi.o
13obj-$(CONFIG_ARCH_MXC_AUDMUX_V1) += audmux-v1.o
14obj-$(CONFIG_ARCH_MXC_AUDMUX_V2) += audmux-v2.o
diff --git a/arch/arm/plat-mxc/audmux-v1.c b/arch/arm/plat-mxc/audmux-v1.c
new file mode 100644
index 000000000000..da6387dcdf21
--- /dev/null
+++ b/arch/arm/plat-mxc/audmux-v1.c
@@ -0,0 +1,58 @@
1/*
2 * Copyright 2009 Pengutronix, Sascha Hauer <s.hauer@pengutronix.de>
3 *
4 * Initial development of this code was funded by
5 * Phytec Messtechnik GmbH, http://www.phytec.de
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 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 */
21
22#include <linux/module.h>
23#include <linux/err.h>
24#include <linux/io.h>
25#include <linux/clk.h>
26#include <mach/audmux.h>
27#include <mach/hardware.h>
28
29static void __iomem *audmux_base;
30
31static unsigned char port_mapping[] = {
32 0x0, 0x4, 0x8, 0x10, 0x14, 0x1c,
33};
34
35int mxc_audmux_v1_configure_port(unsigned int port, unsigned int pcr)
36{
37 if (!audmux_base) {
38 printk("%s: not configured\n", __func__);
39 return -ENOSYS;
40 }
41
42 if (port >= ARRAY_SIZE(port_mapping))
43 return -EINVAL;
44
45 writel(pcr, audmux_base + port_mapping[port]);
46
47 return 0;
48}
49EXPORT_SYMBOL_GPL(mxc_audmux_v1_configure_port);
50
51static int mxc_audmux_v1_init(void)
52{
53 if (cpu_is_mx27() || cpu_is_mx21())
54 audmux_base = IO_ADDRESS(AUDMUX_BASE_ADDR);
55 return 0;
56}
57
58postcore_initcall(mxc_audmux_v1_init);
diff --git a/arch/arm/plat-mxc/audmux-v2.c b/arch/arm/plat-mxc/audmux-v2.c
new file mode 100644
index 000000000000..6f21096086fd
--- /dev/null
+++ b/arch/arm/plat-mxc/audmux-v2.c
@@ -0,0 +1,74 @@
1/*
2 * Copyright 2009 Pengutronix, Sascha Hauer <s.hauer@pengutronix.de>
3 *
4 * Initial development of this code was funded by
5 * Phytec Messtechnik GmbH, http://www.phytec.de
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 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 */
21
22#include <linux/module.h>
23#include <linux/err.h>
24#include <linux/io.h>
25#include <linux/clk.h>
26#include <mach/audmux.h>
27#include <mach/hardware.h>
28
29static struct clk *audmux_clk;
30static void __iomem *audmux_base;
31
32#define MXC_AUDMUX_V2_PTCR(x) ((x) * 8)
33#define MXC_AUDMUX_V2_PDCR(x) ((x) * 8 + 4)
34
35int mxc_audmux_v2_configure_port(unsigned int port, unsigned int ptcr,
36 unsigned int pdcr)
37{
38 if (!audmux_base)
39 return -ENOSYS;
40
41 if (audmux_clk)
42 clk_enable(audmux_clk);
43
44 writel(ptcr, audmux_base + MXC_AUDMUX_V2_PTCR(port));
45 writel(pdcr, audmux_base + MXC_AUDMUX_V2_PDCR(port));
46
47 if (audmux_clk)
48 clk_disable(audmux_clk);
49
50 return 0;
51}
52EXPORT_SYMBOL_GPL(mxc_audmux_v2_configure_port);
53
54static int mxc_audmux_v2_init(void)
55{
56 int ret;
57
58 if (cpu_is_mx35()) {
59 audmux_clk = clk_get(NULL, "audmux");
60 if (IS_ERR(audmux_clk)) {
61 ret = PTR_ERR(audmux_clk);
62 printk(KERN_ERR "%s: cannot get clock: %d\n", __func__,
63 ret);
64 return ret;
65 }
66 }
67
68 if (cpu_is_mx31() || cpu_is_mx35())
69 audmux_base = IO_ADDRESS(AUDMUX_BASE_ADDR);
70
71 return 0;
72}
73
74postcore_initcall(mxc_audmux_v2_init);
diff --git a/arch/arm/plat-mxc/dma-mx1-mx2.c b/arch/arm/plat-mxc/dma-mx1-mx2.c
index 77646436c00e..9c1b3f9c4f4d 100644
--- a/arch/arm/plat-mxc/dma-mx1-mx2.c
+++ b/arch/arm/plat-mxc/dma-mx1-mx2.c
@@ -156,7 +156,8 @@ static inline int imx_dma_sg_next(int channel, struct scatterlist *sg)
156 } 156 }
157 157
158 now = min(imxdma->resbytes, sg->length); 158 now = min(imxdma->resbytes, sg->length);
159 imxdma->resbytes -= now; 159 if (imxdma->resbytes != IMX_DMA_LENGTH_LOOP)
160 imxdma->resbytes -= now;
160 161
161 if ((imxdma->dma_mode & DMA_MODE_MASK) == DMA_MODE_READ) 162 if ((imxdma->dma_mode & DMA_MODE_MASK) == DMA_MODE_READ)
162 __raw_writel(sg->dma_address, DMA_BASE + DMA_DAR(channel)); 163 __raw_writel(sg->dma_address, DMA_BASE + DMA_DAR(channel));
diff --git a/arch/arm/plat-mxc/gpio.c b/arch/arm/plat-mxc/gpio.c
index cfc4a8b43e6a..d65ebe303b9f 100644
--- a/arch/arm/plat-mxc/gpio.c
+++ b/arch/arm/plat-mxc/gpio.c
@@ -282,7 +282,7 @@ int __init mxc_gpio_init(struct mxc_gpio_port *port, int cnt)
282 for (j = port[i].virtual_irq_start; 282 for (j = port[i].virtual_irq_start;
283 j < port[i].virtual_irq_start + 32; j++) { 283 j < port[i].virtual_irq_start + 32; j++) {
284 set_irq_chip(j, &gpio_irq_chip); 284 set_irq_chip(j, &gpio_irq_chip);
285 set_irq_handler(j, handle_edge_irq); 285 set_irq_handler(j, handle_level_irq);
286 set_irq_flags(j, IRQF_VALID); 286 set_irq_flags(j, IRQF_VALID);
287 } 287 }
288 288
diff --git a/arch/arm/plat-mxc/include/mach/audmux.h b/arch/arm/plat-mxc/include/mach/audmux.h
new file mode 100644
index 000000000000..5cd6466964af
--- /dev/null
+++ b/arch/arm/plat-mxc/include/mach/audmux.h
@@ -0,0 +1,52 @@
1#ifndef __MACH_AUDMUX_H
2#define __MACH_AUDMUX_H
3
4#define MX27_AUDMUX_HPCR1_SSI0 0
5#define MX27_AUDMUX_HPCR2_SSI1 1
6#define MX27_AUDMUX_HPCR3_SSI_PINS_4 2
7#define MX27_AUDMUX_PPCR1_SSI_PINS_1 3
8#define MX27_AUDMUX_PPCR2_SSI_PINS_2 4
9#define MX27_AUDMUX_PPCR3_SSI_PINS_3 5
10
11#define MX31_AUDMUX_PORT1_SSI0 0
12#define MX31_AUDMUX_PORT2_SSI1 1
13#define MX31_AUDMUX_PORT3_SSI_PINS_3 2
14#define MX31_AUDMUX_PORT4_SSI_PINS_4 3
15#define MX31_AUDMUX_PORT5_SSI_PINS_5 4
16#define MX31_AUDMUX_PORT6_SSI_PINS_6 5
17
18/* Register definitions for the i.MX21/27 Digital Audio Multiplexer */
19#define MXC_AUDMUX_V1_PCR_INMMASK(x) ((x) & 0xff)
20#define MXC_AUDMUX_V1_PCR_INMEN (1 << 8)
21#define MXC_AUDMUX_V1_PCR_TXRXEN (1 << 10)
22#define MXC_AUDMUX_V1_PCR_SYN (1 << 12)
23#define MXC_AUDMUX_V1_PCR_RXDSEL(x) (((x) & 0x7) << 13)
24#define MXC_AUDMUX_V1_PCR_RFCSEL(x) (((x) & 0xf) << 20)
25#define MXC_AUDMUX_V1_PCR_RCLKDIR (1 << 24)
26#define MXC_AUDMUX_V1_PCR_RFSDIR (1 << 25)
27#define MXC_AUDMUX_V1_PCR_TFCSEL(x) (((x) & 0xf) << 26)
28#define MXC_AUDMUX_V1_PCR_TCLKDIR (1 << 30)
29#define MXC_AUDMUX_V1_PCR_TFSDIR (1 << 31)
30
31/* Register definitions for the i.MX25/31/35 Digital Audio Multiplexer */
32#define MXC_AUDMUX_V2_PTCR_TFSDIR (1 << 31)
33#define MXC_AUDMUX_V2_PTCR_TFSEL(x) (((x) & 0xf) << 27)
34#define MXC_AUDMUX_V2_PTCR_TCLKDIR (1 << 26)
35#define MXC_AUDMUX_V2_PTCR_TCSEL(x) (((x) & 0xf) << 22)
36#define MXC_AUDMUX_V2_PTCR_RFSDIR (1 << 21)
37#define MXC_AUDMUX_V2_PTCR_RFSEL(x) (((x) & 0xf) << 17)
38#define MXC_AUDMUX_V2_PTCR_RCLKDIR (1 << 16)
39#define MXC_AUDMUX_V2_PTCR_RCSEL(x) (((x) & 0xf) << 12)
40#define MXC_AUDMUX_V2_PTCR_SYN (1 << 11)
41
42#define MXC_AUDMUX_V2_PDCR_RXDSEL(x) (((x) & 0x7) << 13)
43#define MXC_AUDMUX_V2_PDCR_TXRXEN (1 << 12)
44#define MXC_AUDMUX_V2_PDCR_MODE(x) (((x) & 0x3) << 8)
45#define MXC_AUDMUX_V2_PDCR_INMMASK(x) ((x) & 0xff)
46
47int mxc_audmux_v1_configure_port(unsigned int port, unsigned int pcr);
48
49int mxc_audmux_v2_configure_port(unsigned int port, unsigned int ptcr,
50 unsigned int pdcr);
51
52#endif /* __MACH_AUDMUX_H */
diff --git a/arch/arm/plat-mxc/include/mach/board-kzmarm11.h b/arch/arm/plat-mxc/include/mach/board-kzmarm11.h
new file mode 100644
index 000000000000..05ff2f31ef1f
--- /dev/null
+++ b/arch/arm/plat-mxc/include/mach/board-kzmarm11.h
@@ -0,0 +1,39 @@
1/*
2 * Copyright (C) 2009 Yoichi Yuasa <yuasa@linux-mips.org>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18#ifndef __ARM_ARCH_BOARD_KZM_ARM11_H
19#define __ARM_ARCH_BOARD_KZM_ARM11_H
20
21/*
22 * KZM-ARM11-01 Board Control Registers on FPGA
23 */
24#define KZM_ARM11_CTL1 (CS4_BASE_ADDR + 0x1000)
25#define KZM_ARM11_CTL2 (CS4_BASE_ADDR + 0x1001)
26#define KZM_ARM11_RSW1 (CS4_BASE_ADDR + 0x1002)
27#define KZM_ARM11_BACK_LIGHT (CS4_BASE_ADDR + 0x1004)
28#define KZM_ARM11_FPGA_REV (CS4_BASE_ADDR + 0x1008)
29#define KZM_ARM11_7SEG_LED (CS4_BASE_ADDR + 0x1010)
30#define KZM_ARM11_LEDS (CS4_BASE_ADDR + 0x1020)
31#define KZM_ARM11_DIPSW2 (CS4_BASE_ADDR + 0x1003)
32
33/*
34 * External UART for touch panel on FPGA
35 */
36#define KZM_ARM11_16550 (CS4_BASE_ADDR + 0x1050)
37
38#endif /* __ARM_ARCH_BOARD_KZM_ARM11_H */
39
diff --git a/arch/arm/plat-mxc/include/mach/board-mx31lite.h b/arch/arm/plat-mxc/include/mach/board-mx31lite.h
index 8e64325d6905..0184b638c268 100644
--- a/arch/arm/plat-mxc/include/mach/board-mx31lite.h
+++ b/arch/arm/plat-mxc/include/mach/board-mx31lite.h
@@ -1,15 +1,42 @@
1/* 1/*
2 * Copyright 2007 Freescale Semiconductor, Inc. All Rights Reserved. 2 * Copyright 2007 Freescale Semiconductor, Inc. All Rights Reserved.
3 * Copyright (C) 2009 Daniel Mack <daniel@caiaq.de>
4 *
5 * Based on code for mobots boards,
6 * Copyright (C) 2009 Valentin Longchamp, EPFL Mobots group
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
20 * MA 02110-1301, USA.
3 */ 21 */
4 22
23#ifndef __ASM_ARCH_MXC_BOARD_MX31LITE_H__
24#define __ASM_ARCH_MXC_BOARD_MX31LITE_H__
25
26#ifndef __ASSEMBLY__
27
28enum mx31lilly_boards {
29 MX31LITE_NOBOARD = 0,
30 MX31LITE_DB = 1,
31};
32
5/* 33/*
6 * This program is free software; you can redistribute it and/or modify 34 * This CPU module needs a baseboard to work. After basic initializing
7 * it under the terms of the GNU General Public License version 2 as 35 * its own devices, it calls baseboard's init function.
8 * published by the Free Software Foundation.
9 */ 36 */
10 37
11#ifndef __ASM_ARCH_MXC_BOARD_MX31LITE_H__ 38extern void mx31lite_db_init(void);
12#define __ASM_ARCH_MXC_BOARD_MX31LITE_H__
13 39
14#endif /* __ASM_ARCH_MXC_BOARD_MX31LITE_H__ */ 40#endif
15 41
42#endif /* __ASM_ARCH_MXC_BOARD_MX31LITE_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/dma-mx1-mx2.h b/arch/arm/plat-mxc/include/mach/dma-mx1-mx2.h
index b3876cc238ca..07be8ad7ec37 100644
--- a/arch/arm/plat-mxc/include/mach/dma-mx1-mx2.h
+++ b/arch/arm/plat-mxc/include/mach/dma-mx1-mx2.h
@@ -58,6 +58,14 @@ imx_dma_setup_single(int channel, dma_addr_t dma_address,
58 unsigned int dma_length, unsigned int dev_addr, 58 unsigned int dma_length, unsigned int dev_addr,
59 unsigned int dmamode); 59 unsigned int dmamode);
60 60
61
62/*
63 * Use this flag as the dma_length argument to imx_dma_setup_sg()
64 * to create an endless running dma loop. The end of the scatterlist
65 * must be linked to the beginning for this to work.
66 */
67#define IMX_DMA_LENGTH_LOOP ((unsigned int)-1)
68
61int 69int
62imx_dma_setup_sg(int channel, struct scatterlist *sg, 70imx_dma_setup_sg(int channel, struct scatterlist *sg,
63 unsigned int sgcount, unsigned int dma_length, 71 unsigned int sgcount, unsigned int dma_length,
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx3.h b/arch/arm/plat-mxc/include/mach/iomux-mx3.h
index 446f86763816..eaabd4e96925 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-mx3.h
+++ b/arch/arm/plat-mxc/include/mach/iomux-mx3.h
@@ -524,10 +524,18 @@ enum iomux_pins {
524#define MX31_PIN_RTS1__RTS1 IOMUX_MODE(MX31_PIN_RTS1, IOMUX_CONFIG_FUNC) 524#define MX31_PIN_RTS1__RTS1 IOMUX_MODE(MX31_PIN_RTS1, IOMUX_CONFIG_FUNC)
525#define MX31_PIN_TXD1__TXD1 IOMUX_MODE(MX31_PIN_TXD1, IOMUX_CONFIG_FUNC) 525#define MX31_PIN_TXD1__TXD1 IOMUX_MODE(MX31_PIN_TXD1, IOMUX_CONFIG_FUNC)
526#define MX31_PIN_RXD1__RXD1 IOMUX_MODE(MX31_PIN_RXD1, IOMUX_CONFIG_FUNC) 526#define MX31_PIN_RXD1__RXD1 IOMUX_MODE(MX31_PIN_RXD1, IOMUX_CONFIG_FUNC)
527#define MX31_PIN_DCD_DCE1__DCD_DCE1 IOMUX_MODE(MX31_PIN_DCD_DCE1, IOMUX_CONFIG_FUNC)
528#define MX31_PIN_RI_DCE1__RI_DCE1 IOMUX_MODE(MX31_PIN_RI_DCE1, IOMUX_CONFIG_FUNC)
529#define MX31_PIN_DSR_DCE1__DSR_DCE1 IOMUX_MODE(MX31_PIN_DSR_DCE1, IOMUX_CONFIG_FUNC)
530#define MX31_PIN_DTR_DCE1__DTR_DCE1 IOMUX_MODE(MX31_PIN_DTR_DCE1, IOMUX_CONFIG_FUNC)
527#define MX31_PIN_CTS2__CTS2 IOMUX_MODE(MX31_PIN_CTS2, IOMUX_CONFIG_FUNC) 531#define MX31_PIN_CTS2__CTS2 IOMUX_MODE(MX31_PIN_CTS2, IOMUX_CONFIG_FUNC)
528#define MX31_PIN_RTS2__RTS2 IOMUX_MODE(MX31_PIN_RTS2, IOMUX_CONFIG_FUNC) 532#define MX31_PIN_RTS2__RTS2 IOMUX_MODE(MX31_PIN_RTS2, IOMUX_CONFIG_FUNC)
529#define MX31_PIN_TXD2__TXD2 IOMUX_MODE(MX31_PIN_TXD2, IOMUX_CONFIG_FUNC) 533#define MX31_PIN_TXD2__TXD2 IOMUX_MODE(MX31_PIN_TXD2, IOMUX_CONFIG_FUNC)
530#define MX31_PIN_RXD2__RXD2 IOMUX_MODE(MX31_PIN_RXD2, IOMUX_CONFIG_FUNC) 534#define MX31_PIN_RXD2__RXD2 IOMUX_MODE(MX31_PIN_RXD2, IOMUX_CONFIG_FUNC)
535#define MX31_PIN_DCD_DTE1__DCD_DTE2 IOMUX_MODE(MX31_PIN_DCD_DTE1, IOMUX_CONFIG_ALT1)
536#define MX31_PIN_RI_DTE1__RI_DTE2 IOMUX_MODE(MX31_PIN_RI_DTE1, IOMUX_CONFIG_ALT1)
537#define MX31_PIN_DSR_DTE1__DSR_DTE2 IOMUX_MODE(MX31_PIN_DSR_DTE1, IOMUX_CONFIG_ALT1)
538#define MX31_PIN_DTR_DTE1__DTR_DTE2 IOMUX_MODE(MX31_PIN_DTR_DTE1, IOMUX_OCONFIG_ALT3 | IOMUX_ICONFIG_NONE)
531#define MX31_PIN_PC_RST__CTS5 IOMUX_MODE(MX31_PIN_PC_RST, IOMUX_CONFIG_ALT2) 539#define MX31_PIN_PC_RST__CTS5 IOMUX_MODE(MX31_PIN_PC_RST, IOMUX_CONFIG_ALT2)
532#define MX31_PIN_PC_VS2__RTS5 IOMUX_MODE(MX31_PIN_PC_VS2, IOMUX_CONFIG_ALT2) 540#define MX31_PIN_PC_VS2__RTS5 IOMUX_MODE(MX31_PIN_PC_VS2, IOMUX_CONFIG_ALT2)
533#define MX31_PIN_PC_BVD2__TXD5 IOMUX_MODE(MX31_PIN_PC_BVD2, IOMUX_CONFIG_ALT2) 541#define MX31_PIN_PC_BVD2__TXD5 IOMUX_MODE(MX31_PIN_PC_BVD2, IOMUX_CONFIG_ALT2)
@@ -623,6 +631,8 @@ enum iomux_pins {
623#define MX31_PIN_GPIO3_0__GPIO3_0 IOMUX_MODE(MX31_PIN_GPIO3_0, IOMUX_CONFIG_GPIO) 631#define MX31_PIN_GPIO3_0__GPIO3_0 IOMUX_MODE(MX31_PIN_GPIO3_0, IOMUX_CONFIG_GPIO)
624#define MX31_PIN_GPIO3_1__GPIO3_1 IOMUX_MODE(MX31_PIN_GPIO3_1, IOMUX_CONFIG_GPIO) 632#define MX31_PIN_GPIO3_1__GPIO3_1 IOMUX_MODE(MX31_PIN_GPIO3_1, IOMUX_CONFIG_GPIO)
625#define MX31_PIN_TXD2__GPIO1_28 IOMUX_MODE(MX31_PIN_TXD2, IOMUX_CONFIG_GPIO) 633#define MX31_PIN_TXD2__GPIO1_28 IOMUX_MODE(MX31_PIN_TXD2, IOMUX_CONFIG_GPIO)
634#define MX31_PIN_CSI_D4__GPIO3_4 IOMUX_MODE(MX31_PIN_CSI_D4, IOMUX_CONFIG_GPIO)
635#define MX31_PIN_CSI_D5__GPIO3_5 IOMUX_MODE(MX31_PIN_CSI_D5, IOMUX_CONFIG_GPIO)
626#define MX31_PIN_USBOTG_DATA0__USBOTG_DATA0 IOMUX_MODE(MX31_PIN_USBOTG_DATA0, IOMUX_CONFIG_FUNC) 636#define MX31_PIN_USBOTG_DATA0__USBOTG_DATA0 IOMUX_MODE(MX31_PIN_USBOTG_DATA0, IOMUX_CONFIG_FUNC)
627#define MX31_PIN_USBOTG_DATA1__USBOTG_DATA1 IOMUX_MODE(MX31_PIN_USBOTG_DATA1, IOMUX_CONFIG_FUNC) 637#define MX31_PIN_USBOTG_DATA1__USBOTG_DATA1 IOMUX_MODE(MX31_PIN_USBOTG_DATA1, IOMUX_CONFIG_FUNC)
628#define MX31_PIN_USBOTG_DATA2__USBOTG_DATA2 IOMUX_MODE(MX31_PIN_USBOTG_DATA2, IOMUX_CONFIG_FUNC) 638#define MX31_PIN_USBOTG_DATA2__USBOTG_DATA2 IOMUX_MODE(MX31_PIN_USBOTG_DATA2, IOMUX_CONFIG_FUNC)
@@ -642,12 +652,22 @@ enum iomux_pins {
642#define MX31_PIN_CSPI1_SS2__USBH1_RCV IOMUX_MODE(MX31_PIN_CSPI1_SS2, IOMUX_CONFIG_ALT1) 652#define MX31_PIN_CSPI1_SS2__USBH1_RCV IOMUX_MODE(MX31_PIN_CSPI1_SS2, IOMUX_CONFIG_ALT1)
643#define MX31_PIN_CSPI1_SCLK__USBH1_OEB IOMUX_MODE(MX31_PIN_CSPI1_SCLK, IOMUX_CONFIG_ALT1) 653#define MX31_PIN_CSPI1_SCLK__USBH1_OEB IOMUX_MODE(MX31_PIN_CSPI1_SCLK, IOMUX_CONFIG_ALT1)
644#define MX31_PIN_CSPI1_SPI_RDY__USBH1_FS IOMUX_MODE(MX31_PIN_CSPI1_SPI_RDY, IOMUX_CONFIG_ALT1) 654#define MX31_PIN_CSPI1_SPI_RDY__USBH1_FS IOMUX_MODE(MX31_PIN_CSPI1_SPI_RDY, IOMUX_CONFIG_ALT1)
655#define MX31_PIN_SFS6__USBH1_SUSPEND IOMUX_MODE(MX31_PIN_SFS6, IOMUX_CONFIG_FUNC)
656#define MX31_PIN_NFRE_B__GPIO1_11 IOMUX_MODE(MX31_PIN_NFRE_B, IOMUX_CONFIG_GPIO)
657#define MX31_PIN_NFALE__GPIO1_12 IOMUX_MODE(MX31_PIN_NFALE, IOMUX_CONFIG_GPIO)
645#define MX31_PIN_USBH2_DATA0__USBH2_DATA0 IOMUX_MODE(MX31_PIN_USBH2_DATA0, IOMUX_CONFIG_FUNC) 658#define MX31_PIN_USBH2_DATA0__USBH2_DATA0 IOMUX_MODE(MX31_PIN_USBH2_DATA0, IOMUX_CONFIG_FUNC)
646#define MX31_PIN_USBH2_DATA1__USBH2_DATA1 IOMUX_MODE(MX31_PIN_USBH2_DATA1, IOMUX_CONFIG_FUNC) 659#define MX31_PIN_USBH2_DATA1__USBH2_DATA1 IOMUX_MODE(MX31_PIN_USBH2_DATA1, IOMUX_CONFIG_FUNC)
660#define MX31_PIN_STXD3__USBH2_DATA2 IOMUX_MODE(MX31_PIN_STXD3, IOMUX_CONFIG_FUNC)
661#define MX31_PIN_SRXD3__USBH2_DATA3 IOMUX_MODE(MX31_PIN_SRXD3, IOMUX_CONFIG_FUNC)
662#define MX31_PIN_SCK3__USBH2_DATA4 IOMUX_MODE(MX31_PIN_SCK3, IOMUX_CONFIG_FUNC)
663#define MX31_PIN_SFS3__USBH2_DATA5 IOMUX_MODE(MX31_PIN_SFS3, IOMUX_CONFIG_FUNC)
664#define MX31_PIN_STXD6__USBH2_DATA6 IOMUX_MODE(MX31_PIN_STXD6, IOMUX_CONFIG_FUNC)
665#define MX31_PIN_SRXD6__USBH2_DATA7 IOMUX_MODE(MX31_PIN_SRXD6, IOMUX_CONFIG_FUNC)
647#define MX31_PIN_USBH2_CLK__USBH2_CLK IOMUX_MODE(MX31_PIN_USBH2_CLK, IOMUX_CONFIG_FUNC) 666#define MX31_PIN_USBH2_CLK__USBH2_CLK IOMUX_MODE(MX31_PIN_USBH2_CLK, IOMUX_CONFIG_FUNC)
648#define MX31_PIN_USBH2_DIR__USBH2_DIR IOMUX_MODE(MX31_PIN_USBH2_DIR, IOMUX_CONFIG_FUNC) 667#define MX31_PIN_USBH2_DIR__USBH2_DIR IOMUX_MODE(MX31_PIN_USBH2_DIR, IOMUX_CONFIG_FUNC)
649#define MX31_PIN_USBH2_NXT__USBH2_NXT IOMUX_MODE(MX31_PIN_USBH2_NXT, IOMUX_CONFIG_FUNC) 668#define MX31_PIN_USBH2_NXT__USBH2_NXT IOMUX_MODE(MX31_PIN_USBH2_NXT, IOMUX_CONFIG_FUNC)
650#define MX31_PIN_USBH2_STP__USBH2_STP IOMUX_MODE(MX31_PIN_USBH2_STP, IOMUX_CONFIG_FUNC) 669#define MX31_PIN_USBH2_STP__USBH2_STP IOMUX_MODE(MX31_PIN_USBH2_STP, IOMUX_CONFIG_FUNC)
670#define MX31_PIN_SCK6__GPIO1_25 IOMUX_MODE(MX31_PIN_SCK6, IOMUX_CONFIG_GPIO)
651#define MX31_PIN_USB_OC__GPIO1_30 IOMUX_MODE(MX31_PIN_USB_OC, IOMUX_CONFIG_GPIO) 671#define MX31_PIN_USB_OC__GPIO1_30 IOMUX_MODE(MX31_PIN_USB_OC, IOMUX_CONFIG_GPIO)
652#define MX31_PIN_I2C_DAT__I2C1_SDA IOMUX_MODE(MX31_PIN_I2C_DAT, IOMUX_CONFIG_FUNC) 672#define MX31_PIN_I2C_DAT__I2C1_SDA IOMUX_MODE(MX31_PIN_I2C_DAT, IOMUX_CONFIG_FUNC)
653#define MX31_PIN_I2C_CLK__I2C1_SCL IOMUX_MODE(MX31_PIN_I2C_CLK, IOMUX_CONFIG_FUNC) 673#define MX31_PIN_I2C_CLK__I2C1_SCL IOMUX_MODE(MX31_PIN_I2C_CLK, IOMUX_CONFIG_FUNC)
@@ -693,7 +713,19 @@ enum iomux_pins {
693#define MX31_PIN_DCD_DCE1__GPIO2_11 IOMUX_MODE(MX31_PIN_DCD_DCE1, IOMUX_CONFIG_GPIO) 713#define MX31_PIN_DCD_DCE1__GPIO2_11 IOMUX_MODE(MX31_PIN_DCD_DCE1, IOMUX_CONFIG_GPIO)
694#define MX31_PIN_STXD5__GPIO1_21 IOMUX_MODE(MX31_PIN_STXD5, IOMUX_CONFIG_GPIO) 714#define MX31_PIN_STXD5__GPIO1_21 IOMUX_MODE(MX31_PIN_STXD5, IOMUX_CONFIG_GPIO)
695#define MX31_PIN_SRXD5__GPIO1_22 IOMUX_MODE(MX31_PIN_SRXD5, IOMUX_CONFIG_GPIO) 715#define MX31_PIN_SRXD5__GPIO1_22 IOMUX_MODE(MX31_PIN_SRXD5, IOMUX_CONFIG_GPIO)
696 716#define MX31_PIN_GPIO1_3__GPIO1_3 IOMUX_MODE(MX31_PIN_GPIO1_3, IOMUX_CONFIG_GPIO)
717#define MX31_PIN_CSPI2_SS1__CSPI3_SS1 IOMUX_MODE(MX31_PIN_CSPI2_SS1, IOMUX_CONFIG_ALT1)
718#define MX31_PIN_RTS1__GPIO2_6 IOMUX_MODE(MX31_PIN_RTS1, IOMUX_CONFIG_GPIO)
719#define MX31_PIN_CTS1__GPIO2_7 IOMUX_MODE(MX31_PIN_CTS1, IOMUX_CONFIG_GPIO)
720#define MX31_PIN_LCS0__GPIO3_23 IOMUX_MODE(MX31_PIN_LCS0, IOMUX_CONFIG_GPIO)
721#define MX31_PIN_STXD4__STXD4 IOMUX_MODE(MX31_PIN_STXD4, IOMUX_CONFIG_FUNC)
722#define MX31_PIN_SRXD4__SRXD4 IOMUX_MODE(MX31_PIN_SRXD4, IOMUX_CONFIG_FUNC)
723#define MX31_PIN_SCK4__SCK4 IOMUX_MODE(MX31_PIN_SCK4, IOMUX_CONFIG_FUNC)
724#define MX31_PIN_SFS4__SFS4 IOMUX_MODE(MX31_PIN_SFS4, IOMUX_CONFIG_FUNC)
725#define MX31_PIN_STXD5__STXD5 IOMUX_MODE(MX31_PIN_STXD5, IOMUX_CONFIG_FUNC)
726#define MX31_PIN_SRXD5__SRXD5 IOMUX_MODE(MX31_PIN_SRXD5, IOMUX_CONFIG_FUNC)
727#define MX31_PIN_SCK5__SCK5 IOMUX_MODE(MX31_PIN_SCK5, IOMUX_CONFIG_FUNC)
728#define MX31_PIN_SFS5__SFS5 IOMUX_MODE(MX31_PIN_SFS5, IOMUX_CONFIG_FUNC)
697 729
698/*XXX: The SS0, SS1, SS2, SS3 lines of spi3 are multiplexed by cspi2_ss0, cspi2_ss1, cspi1_ss0 730/*XXX: The SS0, SS1, SS2, SS3 lines of spi3 are multiplexed by cspi2_ss0, cspi2_ss1, cspi1_ss0
699 * cspi1_ss1*/ 731 * cspi1_ss1*/
diff --git a/arch/arm/plat-mxc/include/mach/iomux-v3.h b/arch/arm/plat-mxc/include/mach/iomux-v3.h
index a0fa40265468..1deda0184892 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-v3.h
+++ b/arch/arm/plat-mxc/include/mach/iomux-v3.h
@@ -88,9 +88,7 @@ struct pad_desc {
88#define PAD_CTL_SRE_FAST (1 << 0) 88#define PAD_CTL_SRE_FAST (1 << 0)
89 89
90/* 90/*
91 * setups a single pad: 91 * setups a single pad in the iomuxer
92 * - reserves the pad so that it is not claimed by another driver
93 * - setups the iomux according to the configuration
94 */ 92 */
95int mxc_iomux_v3_setup_pad(struct pad_desc *pad); 93int mxc_iomux_v3_setup_pad(struct pad_desc *pad);
96 94
@@ -101,19 +99,6 @@ int mxc_iomux_v3_setup_pad(struct pad_desc *pad);
101int mxc_iomux_v3_setup_multiple_pads(struct pad_desc *pad_list, unsigned count); 99int mxc_iomux_v3_setup_multiple_pads(struct pad_desc *pad_list, unsigned count);
102 100
103/* 101/*
104 * releases a single pad:
105 * - make it available for a future use by another driver
106 * - DOES NOT reconfigure the IOMUX in its reset state
107 */
108void mxc_iomux_v3_release_pad(struct pad_desc *pad);
109
110/*
111 * releases multiple pads
112 * convenvient way to call the above function with tables
113 */
114void mxc_iomux_v3_release_multiple_pads(struct pad_desc *pad_list, int count);
115
116/*
117 * Initialise the iomux controller 102 * Initialise the iomux controller
118 */ 103 */
119void mxc_iomux_v3_init(void __iomem *iomux_v3_base); 104void mxc_iomux_v3_init(void __iomem *iomux_v3_base);
diff --git a/arch/arm/plat-mxc/include/mach/iomux.h b/arch/arm/plat-mxc/include/mach/iomux.h
index 6d49f8ae3259..011cfcd8b820 100644
--- a/arch/arm/plat-mxc/include/mach/iomux.h
+++ b/arch/arm/plat-mxc/include/mach/iomux.h
@@ -123,6 +123,7 @@
123#define IRQ_GPIOC(x) (IRQ_GPIOB(32) + x) 123#define IRQ_GPIOC(x) (IRQ_GPIOB(32) + x)
124#define IRQ_GPIOD(x) (IRQ_GPIOC(32) + x) 124#define IRQ_GPIOD(x) (IRQ_GPIOC(32) + x)
125#define IRQ_GPIOE(x) (IRQ_GPIOD(32) + x) 125#define IRQ_GPIOE(x) (IRQ_GPIOD(32) + x)
126#define IRQ_GPIOF(x) (IRQ_GPIOE(32) + x)
126 127
127 128
128extern void mxc_gpio_mode(int gpio_mode); 129extern void mxc_gpio_mode(int gpio_mode);
diff --git a/arch/arm/plat-mxc/include/mach/mx21.h b/arch/arm/plat-mxc/include/mach/mx21.h
index 21112c695ec5..bb297d8765a7 100644
--- a/arch/arm/plat-mxc/include/mach/mx21.h
+++ b/arch/arm/plat-mxc/include/mach/mx21.h
@@ -25,46 +25,191 @@
25#ifndef __ASM_ARCH_MXC_MX21_H__ 25#ifndef __ASM_ARCH_MXC_MX21_H__
26#define __ASM_ARCH_MXC_MX21_H__ 26#define __ASM_ARCH_MXC_MX21_H__
27 27
28#define MX21_AIPI_BASE_ADDR 0x10000000
29#define MX21_AIPI_BASE_ADDR_VIRT 0xf4000000
30#define MX21_AIPI_SIZE SZ_1M
31#define MX21_DMA_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x01000)
32#define MX21_WDOG_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x02000)
33#define MX21_GPT1_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x03000)
34#define MX21_GPT2_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x04000)
35#define MX21_GPT3_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x05000)
36#define MX21_PWM_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x06000)
37#define MX21_RTC_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x07000)
38#define MX21_KPP_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x08000)
39#define MX21_OWIRE_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x09000)
40#define MX21_UART1_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x0a000)
41#define MX21_UART2_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x0b000)
42#define MX21_UART3_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x0c000)
43#define MX21_UART4_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x0d000)
44#define MX21_CSPI1_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x0e000)
45#define MX21_CSPI2_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x0f000)
46#define MX21_SSI1_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x10000)
47#define MX21_SSI2_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x11000)
48#define MX21_I2C_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x12000)
49#define MX21_SDHC1_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x13000)
50#define MX21_SDHC2_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x14000)
51#define MX21_GPIO_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x15000)
52#define MX21_AUDMUX_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x16000)
53#define MX21_CSPI3_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x17000)
54#define MX21_LCDC_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x21000)
55#define MX21_SLCDC_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x22000)
56#define MX21_USBOTG_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x24000)
57#define MX21_EMMA_PP_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x26000)
58#define MX21_EMMA_PRP_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x26400)
59#define MX21_CCM_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x27000)
60#define MX21_SYSCTRL_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x27800)
61#define MX21_JAM_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x3e000)
62#define MX21_MAX_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x3f000)
63
64#define MX21_AVIC_BASE_ADDR 0x10040000
65
66#define MX21_SAHB1_BASE_ADDR 0x80000000
67#define MX21_SAHB1_BASE_ADDR_VIRT 0xf4100000
68#define MX21_SAHB1_SIZE SZ_1M
69#define MX21_CSI_BASE_ADDR (MX2x_SAHB1_BASE_ADDR + 0x0000)
70
28/* Memory regions and CS */ 71/* Memory regions and CS */
29#define SDRAM_BASE_ADDR 0xC0000000 72#define MX21_SDRAM_BASE_ADDR 0xc0000000
30#define CSD1_BASE_ADDR 0xC4000000 73#define MX21_CSD1_BASE_ADDR 0xc4000000
31 74
32#define CS0_BASE_ADDR 0xC8000000 75#define MX21_CS0_BASE_ADDR 0xc8000000
33#define CS1_BASE_ADDR 0xCC000000 76#define MX21_CS1_BASE_ADDR 0xcc000000
34#define CS2_BASE_ADDR 0xD0000000 77#define MX21_CS2_BASE_ADDR 0xd0000000
35#define CS3_BASE_ADDR 0xD1000000 78#define MX21_CS3_BASE_ADDR 0xd1000000
36#define CS4_BASE_ADDR 0xD2000000 79#define MX21_CS4_BASE_ADDR 0xd2000000
37#define CS5_BASE_ADDR 0xDD000000 80#define MX21_PCMCIA_MEM_BASE_ADDR 0xd4000000
38#define PCMCIA_MEM_BASE_ADDR 0xD4000000 81#define MX21_CS5_BASE_ADDR 0xdd000000
39 82
40/* NAND, SDRAM, WEIM etc controllers */ 83/* NAND, SDRAM, WEIM etc controllers */
41#define X_MEMC_BASE_ADDR 0xDF000000 84#define MX21_X_MEMC_BASE_ADDR 0xdf000000
42#define X_MEMC_BASE_ADDR_VIRT 0xF4200000 85#define MX21_X_MEMC_BASE_ADDR_VIRT 0xf4200000
43#define X_MEMC_SIZE SZ_256K 86#define MX21_X_MEMC_SIZE SZ_256K
44 87
45#define SDRAMC_BASE_ADDR (X_MEMC_BASE_ADDR + 0x0000) 88#define MX21_SDRAMC_BASE_ADDR (MX21_X_MEMC_BASE_ADDR + 0x0000)
46#define EIM_BASE_ADDR (X_MEMC_BASE_ADDR + 0x1000) 89#define MX21_EIM_BASE_ADDR (MX21_X_MEMC_BASE_ADDR + 0x1000)
47#define PCMCIA_CTL_BASE_ADDR (X_MEMC_BASE_ADDR + 0x2000) 90#define MX21_PCMCIA_CTL_BASE_ADDR (MX21_X_MEMC_BASE_ADDR + 0x2000)
48#define NFC_BASE_ADDR (X_MEMC_BASE_ADDR + 0x3000) 91#define MX21_NFC_BASE_ADDR (MX21_X_MEMC_BASE_ADDR + 0x3000)
49 92
50#define IRAM_BASE_ADDR 0xFFFFE800 /* internal ram */ 93#define MX21_IRAM_BASE_ADDR 0xffffe800 /* internal ram */
51 94
52/* fixed interrupt numbers */ 95/* fixed interrupt numbers */
53#define MXC_INT_USBCTRL 58 96#define MX21_INT_CSPI3 6
54#define MXC_INT_USBCTRL 58 97#define MX21_INT_GPIO 8
55#define MXC_INT_USBMNP 57 98#define MX21_INT_FIRI 9
56#define MXC_INT_USBFUNC 56 99#define MX21_INT_SDHC2 10
57#define MXC_INT_USBHOST 55 100#define MX21_INT_SDHC1 11
58#define MXC_INT_USBDMA 54 101#define MX21_INT_I2C 12
59#define MXC_INT_USBWKUP 53 102#define MX21_INT_SSI2 13
60#define MXC_INT_EMMADEC 50 103#define MX21_INT_SSI1 14
61#define MXC_INT_EMMAENC 49 104#define MX21_INT_CSPI2 15
62#define MXC_INT_BMI 30 105#define MX21_INT_CSPI1 16
63#define MXC_INT_FIRI 9 106#define MX21_INT_UART4 17
107#define MX21_INT_UART3 18
108#define MX21_INT_UART2 19
109#define MX21_INT_UART1 20
110#define MX21_INT_KPP 21
111#define MX21_INT_RTC 22
112#define MX21_INT_PWM 23
113#define MX21_INT_GPT3 24
114#define MX21_INT_GPT2 25
115#define MX21_INT_GPT1 26
116#define MX21_INT_WDOG 27
117#define MX21_INT_PCMCIA 28
118#define MX21_INT_NANDFC 29
119#define MX21_INT_BMI 30
120#define MX21_INT_CSI 31
121#define MX21_INT_DMACH0 32
122#define MX21_INT_DMACH1 33
123#define MX21_INT_DMACH2 34
124#define MX21_INT_DMACH3 35
125#define MX21_INT_DMACH4 36
126#define MX21_INT_DMACH5 37
127#define MX21_INT_DMACH6 38
128#define MX21_INT_DMACH7 39
129#define MX21_INT_DMACH8 40
130#define MX21_INT_DMACH9 41
131#define MX21_INT_DMACH10 42
132#define MX21_INT_DMACH11 43
133#define MX21_INT_DMACH12 44
134#define MX21_INT_DMACH13 45
135#define MX21_INT_DMACH14 46
136#define MX21_INT_DMACH15 47
137#define MX21_INT_EMMAENC 49
138#define MX21_INT_EMMADEC 50
139#define MX21_INT_EMMAPRP 51
140#define MX21_INT_EMMAPP 52
141#define MX21_INT_USBWKUP 53
142#define MX21_INT_USBDMA 54
143#define MX21_INT_USBHOST 55
144#define MX21_INT_USBFUNC 56
145#define MX21_INT_USBMNP 57
146#define MX21_INT_USBCTRL 58
147#define MX21_INT_SLCDC 60
148#define MX21_INT_LCDC 61
64 149
65/* fixed DMA request numbers */ 150/* fixed DMA request numbers */
66#define DMA_REQ_BMI_RX 29 151#define MX21_DMA_REQ_CSPI3_RX 1
67#define DMA_REQ_BMI_TX 28 152#define MX21_DMA_REQ_CSPI3_TX 2
68#define DMA_REQ_FIRI_RX 4 153#define MX21_DMA_REQ_EXT 3
154#define MX21_DMA_REQ_FIRI_RX 4
155#define MX21_DMA_REQ_SDHC2 6
156#define MX21_DMA_REQ_SDHC1 7
157#define MX21_DMA_REQ_SSI2_RX0 8
158#define MX21_DMA_REQ_SSI2_TX0 9
159#define MX21_DMA_REQ_SSI2_RX1 10
160#define MX21_DMA_REQ_SSI2_TX1 11
161#define MX21_DMA_REQ_SSI1_RX0 12
162#define MX21_DMA_REQ_SSI1_TX0 13
163#define MX21_DMA_REQ_SSI1_RX1 14
164#define MX21_DMA_REQ_SSI1_TX1 15
165#define MX21_DMA_REQ_CSPI2_RX 16
166#define MX21_DMA_REQ_CSPI2_TX 17
167#define MX21_DMA_REQ_CSPI1_RX 18
168#define MX21_DMA_REQ_CSPI1_TX 19
169#define MX21_DMA_REQ_UART4_RX 20
170#define MX21_DMA_REQ_UART4_TX 21
171#define MX21_DMA_REQ_UART3_RX 22
172#define MX21_DMA_REQ_UART3_TX 23
173#define MX21_DMA_REQ_UART2_RX 24
174#define MX21_DMA_REQ_UART2_TX 25
175#define MX21_DMA_REQ_UART1_RX 26
176#define MX21_DMA_REQ_UART1_TX 27
177#define MX21_DMA_REQ_BMI_TX 28
178#define MX21_DMA_REQ_BMI_RX 29
179#define MX21_DMA_REQ_CSI_STAT 30
180#define MX21_DMA_REQ_CSI_RX 31
181
182/* these should go away */
183#define SDRAM_BASE_ADDR MX21_SDRAM_BASE_ADDR
184#define CSD1_BASE_ADDR MX21_CSD1_BASE_ADDR
185#define CS0_BASE_ADDR MX21_CS0_BASE_ADDR
186#define CS1_BASE_ADDR MX21_CS1_BASE_ADDR
187#define CS2_BASE_ADDR MX21_CS2_BASE_ADDR
188#define CS3_BASE_ADDR MX21_CS3_BASE_ADDR
189#define CS4_BASE_ADDR MX21_CS4_BASE_ADDR
190#define PCMCIA_MEM_BASE_ADDR MX21_PCMCIA_MEM_BASE_ADDR
191#define CS5_BASE_ADDR MX21_CS5_BASE_ADDR
192#define X_MEMC_BASE_ADDR MX21_X_MEMC_BASE_ADDR
193#define X_MEMC_BASE_ADDR_VIRT MX21_X_MEMC_BASE_ADDR_VIRT
194#define X_MEMC_SIZE MX21_X_MEMC_SIZE
195#define SDRAMC_BASE_ADDR MX21_SDRAMC_BASE_ADDR
196#define EIM_BASE_ADDR MX21_EIM_BASE_ADDR
197#define PCMCIA_CTL_BASE_ADDR MX21_PCMCIA_CTL_BASE_ADDR
198#define NFC_BASE_ADDR MX21_NFC_BASE_ADDR
199#define IRAM_BASE_ADDR MX21_IRAM_BASE_ADDR
200#define MXC_INT_FIRI MX21_INT_FIRI
201#define MXC_INT_BMI MX21_INT_BMI
202#define MXC_INT_EMMAENC MX21_INT_EMMAENC
203#define MXC_INT_EMMADEC MX21_INT_EMMADEC
204#define MXC_INT_USBWKUP MX21_INT_USBWKUP
205#define MXC_INT_USBDMA MX21_INT_USBDMA
206#define MXC_INT_USBHOST MX21_INT_USBHOST
207#define MXC_INT_USBFUNC MX21_INT_USBFUNC
208#define MXC_INT_USBMNP MX21_INT_USBMNP
209#define MXC_INT_USBCTRL MX21_INT_USBCTRL
210#define MXC_INT_USBCTRL MX21_INT_USBCTRL
211#define DMA_REQ_FIRI_RX MX21_DMA_REQ_FIRI_RX
212#define DMA_REQ_BMI_TX MX21_DMA_REQ_BMI_TX
213#define DMA_REQ_BMI_RX MX21_DMA_REQ_BMI_RX
69 214
70#endif /* __ASM_ARCH_MXC_MX21_H__ */ 215#endif /* __ASM_ARCH_MXC_MX21_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/mx25.h b/arch/arm/plat-mxc/include/mach/mx25.h
index ec64bd9a8ab1..91e738144804 100644
--- a/arch/arm/plat-mxc/include/mach/mx25.h
+++ b/arch/arm/plat-mxc/include/mach/mx25.h
@@ -1,14 +1,14 @@
1#ifndef __MACH_MX25_H__ 1#ifndef __MACH_MX25_H__
2#define __MACH_MX25_H__ 2#define __MACH_MX25_H__
3 3
4#define MX25_AIPS1_BASE_ADDR 0x43F00000 4#define MX25_AIPS1_BASE_ADDR 0x43f00000
5#define MX25_AIPS1_BASE_ADDR_VIRT 0xFC000000 5#define MX25_AIPS1_BASE_ADDR_VIRT 0xfc000000
6#define MX25_AIPS1_SIZE SZ_1M 6#define MX25_AIPS1_SIZE SZ_1M
7#define MX25_AIPS2_BASE_ADDR 0x53F00000 7#define MX25_AIPS2_BASE_ADDR 0x53f00000
8#define MX25_AIPS2_BASE_ADDR_VIRT 0xFC200000 8#define MX25_AIPS2_BASE_ADDR_VIRT 0xfc200000
9#define MX25_AIPS2_SIZE SZ_1M 9#define MX25_AIPS2_SIZE SZ_1M
10#define MX25_AVIC_BASE_ADDR 0x68000000 10#define MX25_AVIC_BASE_ADDR 0x68000000
11#define MX25_AVIC_BASE_ADDR_VIRT 0xFC400000 11#define MX25_AVIC_BASE_ADDR_VIRT 0xfc400000
12#define MX25_AVIC_SIZE SZ_1M 12#define MX25_AVIC_SIZE SZ_1M
13 13
14#define MX25_IOMUXC_BASE_ADDR (MX25_AIPS1_BASE_ADDR + 0xac000) 14#define MX25_IOMUXC_BASE_ADDR (MX25_AIPS1_BASE_ADDR + 0xac000)
diff --git a/arch/arm/plat-mxc/include/mach/mx27.h b/arch/arm/plat-mxc/include/mach/mx27.h
index dc3ad9aa952a..e2ae19f51710 100644
--- a/arch/arm/plat-mxc/include/mach/mx27.h
+++ b/arch/arm/plat-mxc/include/mach/mx27.h
@@ -24,87 +24,198 @@
24#ifndef __ASM_ARCH_MXC_MX27_H__ 24#ifndef __ASM_ARCH_MXC_MX27_H__
25#define __ASM_ARCH_MXC_MX27_H__ 25#define __ASM_ARCH_MXC_MX27_H__
26 26
27/* IRAM */ 27#define MX27_AIPI_BASE_ADDR 0x10000000
28#define IRAM_BASE_ADDR 0xFFFF4C00 /* internal ram */ 28#define MX27_AIPI_BASE_ADDR_VIRT 0xf4000000
29 29#define MX27_AIPI_SIZE SZ_1M
30#define MSHC_BASE_ADDR (AIPI_BASE_ADDR + 0x18000) 30#define MX27_DMA_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x01000)
31#define GPT5_BASE_ADDR (AIPI_BASE_ADDR + 0x19000) 31#define MX27_WDOG_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x02000)
32#define GPT4_BASE_ADDR (AIPI_BASE_ADDR + 0x1A000) 32#define MX27_GPT1_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x03000)
33#define UART5_BASE_ADDR (AIPI_BASE_ADDR + 0x1B000) 33#define MX27_GPT2_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x04000)
34#define UART6_BASE_ADDR (AIPI_BASE_ADDR + 0x1C000) 34#define MX27_GPT3_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x05000)
35#define I2C2_BASE_ADDR (AIPI_BASE_ADDR + 0x1D000) 35#define MX27_PWM_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x06000)
36#define SDHC3_BASE_ADDR (AIPI_BASE_ADDR + 0x1E000) 36#define MX27_RTC_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x07000)
37#define GPT6_BASE_ADDR (AIPI_BASE_ADDR + 0x1F000) 37#define MX27_KPP_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x08000)
38#define VPU_BASE_ADDR (AIPI_BASE_ADDR + 0x23000) 38#define MX27_OWIRE_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x09000)
39#define OTG_BASE_ADDR USBOTG_BASE_ADDR 39#define MX27_UART1_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x0a000)
40#define SAHARA_BASE_ADDR (AIPI_BASE_ADDR + 0x25000) 40#define MX27_UART2_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x0b000)
41#define IIM_BASE_ADDR (AIPI_BASE_ADDR + 0x28000) 41#define MX27_UART3_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x0c000)
42#define RTIC_BASE_ADDR (AIPI_BASE_ADDR + 0x2A000) 42#define MX27_UART4_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x0d000)
43#define FEC_BASE_ADDR (AIPI_BASE_ADDR + 0x2B000) 43#define MX27_CSPI1_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x0e000)
44#define SCC_BASE_ADDR (AIPI_BASE_ADDR + 0x2C000) 44#define MX27_CSPI2_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x0f000)
45#define ETB_BASE_ADDR (AIPI_BASE_ADDR + 0x3B000) 45#define MX27_SSI1_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x10000)
46#define ETB_RAM_BASE_ADDR (AIPI_BASE_ADDR + 0x3C000) 46#define MX27_SSI2_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x11000)
47#define MX27_I2C_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x12000)
48#define MX27_SDHC1_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x13000)
49#define MX27_SDHC2_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x14000)
50#define MX27_GPIO_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x15000)
51#define MX27_AUDMUX_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x16000)
52#define MX27_CSPI3_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x17000)
53#define MX27_MSHC_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x18000)
54#define MX27_GPT5_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x19000)
55#define MX27_GPT4_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x1a000)
56#define MX27_UART5_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x1b000)
57#define MX27_UART6_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x1c000)
58#define MX27_I2C2_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x1d000)
59#define MX27_SDHC3_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x1e000)
60#define MX27_GPT6_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x1f000)
61#define MX27_LCDC_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x21000)
62#define MX27_SLCDC_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x22000)
63#define MX27_VPU_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x23000)
64#define MX27_USBOTG_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x24000)
65#define MX27_OTG_BASE_ADDR MX27_USBOTG_BASE_ADDR
66#define MX27_SAHARA_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x25000)
67#define MX27_EMMA_PP_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x26000)
68#define MX27_EMMA_PRP_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x26400)
69#define MX27_CCM_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x27000)
70#define MX27_SYSCTRL_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x27800)
71#define MX27_IIM_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x28000)
72#define MX27_RTIC_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x2a000)
73#define MX27_FEC_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x2b000)
74#define MX27_SCC_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x2c000)
75#define MX27_ETB_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x3b000)
76#define MX27_ETB_RAM_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x3c000)
77#define MX27_JAM_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x3e000)
78#define MX27_MAX_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x3f000)
79
80#define MX27_AVIC_BASE_ADDR 0x10040000
47 81
48/* ROM patch */ 82/* ROM patch */
49#define ROMP_BASE_ADDR 0x10041000 83#define MX27_ROMP_BASE_ADDR 0x10041000
50 84
51#define ATA_BASE_ADDR (SAHB1_BASE_ADDR + 0x1000) 85#define MX27_SAHB1_BASE_ADDR 0x80000000
86#define MX27_SAHB1_BASE_ADDR_VIRT 0xf4100000
87#define MX27_SAHB1_SIZE SZ_1M
88#define MX27_CSI_BASE_ADDR (MX27_SAHB1_BASE_ADDR + 0x0000)
89#define MX27_ATA_BASE_ADDR (MX27_SAHB1_BASE_ADDR + 0x1000)
52 90
53/* Memory regions and CS */ 91/* Memory regions and CS */
54#define SDRAM_BASE_ADDR 0xA0000000 92#define MX27_SDRAM_BASE_ADDR 0xa0000000
55#define CSD1_BASE_ADDR 0xB0000000 93#define MX27_CSD1_BASE_ADDR 0xb0000000
56 94
57#define CS0_BASE_ADDR 0xC0000000 95#define MX27_CS0_BASE_ADDR 0xc0000000
58#define CS1_BASE_ADDR 0xC8000000 96#define MX27_CS1_BASE_ADDR 0xc8000000
59#define CS2_BASE_ADDR 0xD0000000 97#define MX27_CS2_BASE_ADDR 0xd0000000
60#define CS3_BASE_ADDR 0xD2000000 98#define MX27_CS3_BASE_ADDR 0xd2000000
61#define CS4_BASE_ADDR 0xD4000000 99#define MX27_CS4_BASE_ADDR 0xd4000000
62#define CS5_BASE_ADDR 0xD6000000 100#define MX27_CS5_BASE_ADDR 0xd6000000
63#define PCMCIA_MEM_BASE_ADDR 0xDC000000
64 101
65/* NAND, SDRAM, WEIM, M3IF, EMI controllers */ 102/* NAND, SDRAM, WEIM, M3IF, EMI controllers */
66#define X_MEMC_BASE_ADDR 0xD8000000 103#define MX27_X_MEMC_BASE_ADDR 0xd8000000
67#define X_MEMC_BASE_ADDR_VIRT 0xF4200000 104#define MX27_X_MEMC_BASE_ADDR_VIRT 0xf4200000
68#define X_MEMC_SIZE SZ_1M 105#define MX27_X_MEMC_SIZE SZ_1M
106#define MX27_NFC_BASE_ADDR (MX27_X_MEMC_BASE_ADDR)
107#define MX27_SDRAMC_BASE_ADDR (MX27_X_MEMC_BASE_ADDR + 0x1000)
108#define MX27_WEIM_BASE_ADDR (MX27_X_MEMC_BASE_ADDR + 0x2000)
109#define MX27_M3IF_BASE_ADDR (MX27_X_MEMC_BASE_ADDR + 0x3000)
110#define MX27_PCMCIA_CTL_BASE_ADDR (MX27_X_MEMC_BASE_ADDR + 0x4000)
69 111
70#define NFC_BASE_ADDR (X_MEMC_BASE_ADDR) 112#define MX27_PCMCIA_MEM_BASE_ADDR 0xdc000000
71#define SDRAMC_BASE_ADDR (X_MEMC_BASE_ADDR + 0x1000) 113
72#define WEIM_BASE_ADDR (X_MEMC_BASE_ADDR + 0x2000) 114/* IRAM */
73#define M3IF_BASE_ADDR (X_MEMC_BASE_ADDR + 0x3000) 115#define MX27_IRAM_BASE_ADDR 0xffff4c00 /* internal ram */
74#define PCMCIA_CTL_BASE_ADDR (X_MEMC_BASE_ADDR + 0x4000)
75 116
76/* fixed interrupt numbers */ 117/* fixed interrupt numbers */
77#define MXC_INT_CCM 63 118#define MX27_INT_I2C2 1
78#define MXC_INT_IIM 62 119#define MX27_INT_GPT6 2
79#define MXC_INT_SAHARA 59 120#define MX27_INT_GPT5 3
80#define MXC_INT_SCC_SCM 58 121#define MX27_INT_GPT4 4
81#define MXC_INT_SCC_SMN 57 122#define MX27_INT_RTIC 5
82#define MXC_INT_USB3 56 123#define MX27_INT_CSPI3 6
83#define MXC_INT_USB2 55 124#define MX27_INT_SDHC 7
84#define MXC_INT_USB1 54 125#define MX27_INT_GPIO 8
85#define MXC_INT_VPU 53 126#define MX27_INT_SDHC3 9
86#define MXC_INT_FEC 50 127#define MX27_INT_SDHC2 10
87#define MXC_INT_UART5 49 128#define MX27_INT_SDHC1 11
88#define MXC_INT_UART6 48 129#define MX27_INT_I2C 12
89#define MXC_INT_ATA 30 130#define MX27_INT_SSI2 13
90#define MXC_INT_SDHC3 9 131#define MX27_INT_SSI1 14
91#define MXC_INT_SDHC 7 132#define MX27_INT_CSPI2 15
92#define MXC_INT_RTIC 5 133#define MX27_INT_CSPI1 16
93#define MXC_INT_GPT4 4 134#define MX27_INT_UART4 17
94#define MXC_INT_GPT5 3 135#define MX27_INT_UART3 18
95#define MXC_INT_GPT6 2 136#define MX27_INT_UART2 19
96#define MXC_INT_I2C2 1 137#define MX27_INT_UART1 20
138#define MX27_INT_KPP 21
139#define MX27_INT_RTC 22
140#define MX27_INT_PWM 23
141#define MX27_INT_GPT3 24
142#define MX27_INT_GPT2 25
143#define MX27_INT_GPT1 26
144#define MX27_INT_WDOG 27
145#define MX27_INT_PCMCIA 28
146#define MX27_INT_NANDFC 29
147#define MX27_INT_ATA 30
148#define MX27_INT_CSI 31
149#define MX27_INT_DMACH0 32
150#define MX27_INT_DMACH1 33
151#define MX27_INT_DMACH2 34
152#define MX27_INT_DMACH3 35
153#define MX27_INT_DMACH4 36
154#define MX27_INT_DMACH5 37
155#define MX27_INT_DMACH6 38
156#define MX27_INT_DMACH7 39
157#define MX27_INT_DMACH8 40
158#define MX27_INT_DMACH9 41
159#define MX27_INT_DMACH10 42
160#define MX27_INT_DMACH11 43
161#define MX27_INT_DMACH12 44
162#define MX27_INT_DMACH13 45
163#define MX27_INT_DMACH14 46
164#define MX27_INT_DMACH15 47
165#define MX27_INT_UART6 48
166#define MX27_INT_UART5 49
167#define MX27_INT_FEC 50
168#define MX27_INT_EMMAPRP 51
169#define MX27_INT_EMMAPP 52
170#define MX27_INT_VPU 53
171#define MX27_INT_USB1 54
172#define MX27_INT_USB2 55
173#define MX27_INT_USB3 56
174#define MX27_INT_SCC_SMN 57
175#define MX27_INT_SCC_SCM 58
176#define MX27_INT_SAHARA 59
177#define MX27_INT_SLCDC 60
178#define MX27_INT_LCDC 61
179#define MX27_INT_IIM 62
180#define MX27_INT_CCM 63
97 181
98/* fixed DMA request numbers */ 182/* fixed DMA request numbers */
99#define DMA_REQ_NFC 37 183#define MX27_DMA_REQ_CSPI3_RX 1
100#define DMA_REQ_SDHC3 36 184#define MX27_DMA_REQ_CSPI3_TX 2
101#define DMA_REQ_UART6_RX 35 185#define MX27_DMA_REQ_EXT 3
102#define DMA_REQ_UART6_TX 34 186#define MX27_DMA_REQ_MSHC 4
103#define DMA_REQ_UART5_RX 33 187#define MX27_DMA_REQ_SDHC2 6
104#define DMA_REQ_UART5_TX 32 188#define MX27_DMA_REQ_SDHC1 7
105#define DMA_REQ_ATA_RCV 29 189#define MX27_DMA_REQ_SSI2_RX0 8
106#define DMA_REQ_ATA_TX 28 190#define MX27_DMA_REQ_SSI2_TX0 9
107#define DMA_REQ_MSHC 4 191#define MX27_DMA_REQ_SSI2_RX1 10
192#define MX27_DMA_REQ_SSI2_TX1 11
193#define MX27_DMA_REQ_SSI1_RX0 12
194#define MX27_DMA_REQ_SSI1_TX0 13
195#define MX27_DMA_REQ_SSI1_RX1 14
196#define MX27_DMA_REQ_SSI1_TX1 15
197#define MX27_DMA_REQ_CSPI2_RX 16
198#define MX27_DMA_REQ_CSPI2_TX 17
199#define MX27_DMA_REQ_CSPI1_RX 18
200#define MX27_DMA_REQ_CSPI1_TX 19
201#define MX27_DMA_REQ_UART4_RX 20
202#define MX27_DMA_REQ_UART4_TX 21
203#define MX27_DMA_REQ_UART3_RX 22
204#define MX27_DMA_REQ_UART3_TX 23
205#define MX27_DMA_REQ_UART2_RX 24
206#define MX27_DMA_REQ_UART2_TX 25
207#define MX27_DMA_REQ_UART1_RX 26
208#define MX27_DMA_REQ_UART1_TX 27
209#define MX27_DMA_REQ_ATA_TX 28
210#define MX27_DMA_REQ_ATA_RCV 29
211#define MX27_DMA_REQ_CSI_STAT 30
212#define MX27_DMA_REQ_CSI_RX 31
213#define MX27_DMA_REQ_UART5_TX 32
214#define MX27_DMA_REQ_UART5_RX 33
215#define MX27_DMA_REQ_UART6_TX 34
216#define MX27_DMA_REQ_UART6_RX 35
217#define MX27_DMA_REQ_SDHC3 36
218#define MX27_DMA_REQ_NFC 37
108 219
109/* silicon revisions specific to i.MX27 */ 220/* silicon revisions specific to i.MX27 */
110#define CHIP_REV_1_0 0x00 221#define CHIP_REV_1_0 0x00
@@ -114,6 +225,72 @@
114extern int mx27_revision(void); 225extern int mx27_revision(void);
115#endif 226#endif
116 227
117/* Mandatory defines used globally */ 228/* these should go away */
229#define MSHC_BASE_ADDR MX27_MSHC_BASE_ADDR
230#define GPT5_BASE_ADDR MX27_GPT5_BASE_ADDR
231#define GPT4_BASE_ADDR MX27_GPT4_BASE_ADDR
232#define UART5_BASE_ADDR MX27_UART5_BASE_ADDR
233#define UART6_BASE_ADDR MX27_UART6_BASE_ADDR
234#define I2C2_BASE_ADDR MX27_I2C2_BASE_ADDR
235#define SDHC3_BASE_ADDR MX27_SDHC3_BASE_ADDR
236#define GPT6_BASE_ADDR MX27_GPT6_BASE_ADDR
237#define VPU_BASE_ADDR MX27_VPU_BASE_ADDR
238#define OTG_BASE_ADDR MX27_OTG_BASE_ADDR
239#define SAHARA_BASE_ADDR MX27_SAHARA_BASE_ADDR
240#define IIM_BASE_ADDR MX27_IIM_BASE_ADDR
241#define RTIC_BASE_ADDR MX27_RTIC_BASE_ADDR
242#define FEC_BASE_ADDR MX27_FEC_BASE_ADDR
243#define SCC_BASE_ADDR MX27_SCC_BASE_ADDR
244#define ETB_BASE_ADDR MX27_ETB_BASE_ADDR
245#define ETB_RAM_BASE_ADDR MX27_ETB_RAM_BASE_ADDR
246#define ROMP_BASE_ADDR MX27_ROMP_BASE_ADDR
247#define ATA_BASE_ADDR MX27_ATA_BASE_ADDR
248#define SDRAM_BASE_ADDR MX27_SDRAM_BASE_ADDR
249#define CSD1_BASE_ADDR MX27_CSD1_BASE_ADDR
250#define CS0_BASE_ADDR MX27_CS0_BASE_ADDR
251#define CS1_BASE_ADDR MX27_CS1_BASE_ADDR
252#define CS2_BASE_ADDR MX27_CS2_BASE_ADDR
253#define CS3_BASE_ADDR MX27_CS3_BASE_ADDR
254#define CS4_BASE_ADDR MX27_CS4_BASE_ADDR
255#define CS5_BASE_ADDR MX27_CS5_BASE_ADDR
256#define X_MEMC_BASE_ADDR MX27_X_MEMC_BASE_ADDR
257#define X_MEMC_BASE_ADDR_VIRT MX27_X_MEMC_BASE_ADDR_VIRT
258#define X_MEMC_SIZE MX27_X_MEMC_SIZE
259#define NFC_BASE_ADDR MX27_NFC_BASE_ADDR
260#define SDRAMC_BASE_ADDR MX27_SDRAMC_BASE_ADDR
261#define WEIM_BASE_ADDR MX27_WEIM_BASE_ADDR
262#define M3IF_BASE_ADDR MX27_M3IF_BASE_ADDR
263#define PCMCIA_CTL_BASE_ADDR MX27_PCMCIA_CTL_BASE_ADDR
264#define PCMCIA_MEM_BASE_ADDR MX27_PCMCIA_MEM_BASE_ADDR
265#define IRAM_BASE_ADDR MX27_IRAM_BASE_ADDR
266#define MXC_INT_I2C2 MX27_INT_I2C2
267#define MXC_INT_GPT6 MX27_INT_GPT6
268#define MXC_INT_GPT5 MX27_INT_GPT5
269#define MXC_INT_GPT4 MX27_INT_GPT4
270#define MXC_INT_RTIC MX27_INT_RTIC
271#define MXC_INT_SDHC MX27_INT_SDHC
272#define MXC_INT_SDHC3 MX27_INT_SDHC3
273#define MXC_INT_ATA MX27_INT_ATA
274#define MXC_INT_UART6 MX27_INT_UART6
275#define MXC_INT_UART5 MX27_INT_UART5
276#define MXC_INT_FEC MX27_INT_FEC
277#define MXC_INT_VPU MX27_INT_VPU
278#define MXC_INT_USB1 MX27_INT_USB1
279#define MXC_INT_USB2 MX27_INT_USB2
280#define MXC_INT_USB3 MX27_INT_USB3
281#define MXC_INT_SCC_SMN MX27_INT_SCC_SMN
282#define MXC_INT_SCC_SCM MX27_INT_SCC_SCM
283#define MXC_INT_SAHARA MX27_INT_SAHARA
284#define MXC_INT_IIM MX27_INT_IIM
285#define MXC_INT_CCM MX27_INT_CCM
286#define DMA_REQ_MSHC MX27_DMA_REQ_MSHC
287#define DMA_REQ_ATA_TX MX27_DMA_REQ_ATA_TX
288#define DMA_REQ_ATA_RCV MX27_DMA_REQ_ATA_RCV
289#define DMA_REQ_UART5_TX MX27_DMA_REQ_UART5_TX
290#define DMA_REQ_UART5_RX MX27_DMA_REQ_UART5_RX
291#define DMA_REQ_UART6_TX MX27_DMA_REQ_UART6_TX
292#define DMA_REQ_UART6_RX MX27_DMA_REQ_UART6_RX
293#define DMA_REQ_SDHC3 MX27_DMA_REQ_SDHC3
294#define DMA_REQ_NFC MX27_DMA_REQ_NFC
118 295
119#endif /* __ASM_ARCH_MXC_MX27_H__ */ 296#endif /* __ASM_ARCH_MXC_MX27_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/mx2x.h b/arch/arm/plat-mxc/include/mach/mx2x.h
index db5d921e0fe6..f2eaf140ed02 100644
--- a/arch/arm/plat-mxc/include/mach/mx2x.h
+++ b/arch/arm/plat-mxc/include/mach/mx2x.h
@@ -25,51 +25,49 @@
25 25
26/* The following addresses are common between i.MX21 and i.MX27 */ 26/* The following addresses are common between i.MX21 and i.MX27 */
27 27
28/* Register offests */ 28/* Register offsets */
29#define AIPI_BASE_ADDR 0x10000000 29#define MX2x_AIPI_BASE_ADDR 0x10000000
30#define AIPI_BASE_ADDR_VIRT 0xF4000000 30#define MX2x_AIPI_BASE_ADDR_VIRT 0xf4000000
31#define AIPI_SIZE SZ_1M 31#define MX2x_AIPI_SIZE SZ_1M
32 32#define MX2x_DMA_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x01000)
33#define DMA_BASE_ADDR (AIPI_BASE_ADDR + 0x01000) 33#define MX2x_WDOG_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x02000)
34#define WDOG_BASE_ADDR (AIPI_BASE_ADDR + 0x02000) 34#define MX2x_GPT1_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x03000)
35#define GPT1_BASE_ADDR (AIPI_BASE_ADDR + 0x03000) 35#define MX2x_GPT2_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x04000)
36#define GPT2_BASE_ADDR (AIPI_BASE_ADDR + 0x04000) 36#define MX2x_GPT3_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x05000)
37#define GPT3_BASE_ADDR (AIPI_BASE_ADDR + 0x05000) 37#define MX2x_PWM_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x06000)
38#define PWM_BASE_ADDR (AIPI_BASE_ADDR + 0x06000) 38#define MX2x_RTC_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x07000)
39#define RTC_BASE_ADDR (AIPI_BASE_ADDR + 0x07000) 39#define MX2x_KPP_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x08000)
40#define KPP_BASE_ADDR (AIPI_BASE_ADDR + 0x08000) 40#define MX2x_OWIRE_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x09000)
41#define OWIRE_BASE_ADDR (AIPI_BASE_ADDR + 0x09000) 41#define MX2x_UART1_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x0a000)
42#define UART1_BASE_ADDR (AIPI_BASE_ADDR + 0x0A000) 42#define MX2x_UART2_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x0b000)
43#define UART2_BASE_ADDR (AIPI_BASE_ADDR + 0x0B000) 43#define MX2x_UART3_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x0c000)
44#define UART3_BASE_ADDR (AIPI_BASE_ADDR + 0x0C000) 44#define MX2x_UART4_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x0d000)
45#define UART4_BASE_ADDR (AIPI_BASE_ADDR + 0x0D000) 45#define MX2x_CSPI1_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x0e000)
46#define CSPI1_BASE_ADDR (AIPI_BASE_ADDR + 0x0E000) 46#define MX2x_CSPI2_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x0f000)
47#define CSPI2_BASE_ADDR (AIPI_BASE_ADDR + 0x0F000) 47#define MX2x_SSI1_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x10000)
48#define SSI1_BASE_ADDR (AIPI_BASE_ADDR + 0x10000) 48#define MX2x_SSI2_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x11000)
49#define SSI2_BASE_ADDR (AIPI_BASE_ADDR + 0x11000) 49#define MX2x_I2C_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x12000)
50#define I2C_BASE_ADDR (AIPI_BASE_ADDR + 0x12000) 50#define MX2x_SDHC1_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x13000)
51#define SDHC1_BASE_ADDR (AIPI_BASE_ADDR + 0x13000) 51#define MX2x_SDHC2_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x14000)
52#define SDHC2_BASE_ADDR (AIPI_BASE_ADDR + 0x14000) 52#define MX2x_GPIO_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x15000)
53#define GPIO_BASE_ADDR (AIPI_BASE_ADDR + 0x15000) 53#define MX2x_AUDMUX_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x16000)
54#define AUDMUX_BASE_ADDR (AIPI_BASE_ADDR + 0x16000) 54#define MX2x_CSPI3_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x17000)
55#define CSPI3_BASE_ADDR (AIPI_BASE_ADDR + 0x17000) 55#define MX2x_LCDC_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x21000)
56#define LCDC_BASE_ADDR (AIPI_BASE_ADDR + 0x21000) 56#define MX2x_SLCDC_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x22000)
57#define SLCDC_BASE_ADDR (AIPI_BASE_ADDR + 0x22000) 57#define MX2x_USBOTG_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x24000)
58#define USBOTG_BASE_ADDR (AIPI_BASE_ADDR + 0x24000) 58#define MX2x_EMMA_PP_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x26000)
59#define EMMA_PP_BASE_ADDR (AIPI_BASE_ADDR + 0x26000) 59#define MX2x_EMMA_PRP_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x26400)
60#define EMMA_PRP_BASE_ADDR (AIPI_BASE_ADDR + 0x26400) 60#define MX2x_CCM_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x27000)
61#define CCM_BASE_ADDR (AIPI_BASE_ADDR + 0x27000) 61#define MX2x_SYSCTRL_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x27800)
62#define SYSCTRL_BASE_ADDR (AIPI_BASE_ADDR + 0x27800) 62#define MX2x_JAM_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x3e000)
63#define JAM_BASE_ADDR (AIPI_BASE_ADDR + 0x3E000) 63#define MX2x_MAX_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x3f000)
64#define MAX_BASE_ADDR (AIPI_BASE_ADDR + 0x3F000) 64
65 65#define MX2x_AVIC_BASE_ADDR 0x10040000
66#define AVIC_BASE_ADDR 0x10040000 66
67 67#define MX2x_SAHB1_BASE_ADDR 0x80000000
68#define SAHB1_BASE_ADDR 0x80000000 68#define MX2x_SAHB1_BASE_ADDR_VIRT 0xf4100000
69#define SAHB1_BASE_ADDR_VIRT 0xF4100000 69#define MX2x_SAHB1_SIZE SZ_1M
70#define SAHB1_SIZE SZ_1M 70#define MX2x_CSI_BASE_ADDR (MX2x_SAHB1_BASE_ADDR + 0x0000)
71
72#define CSI_BASE_ADDR (SAHB1_BASE_ADDR + 0x0000)
73 71
74/* 72/*
75 * This macro defines the physical to virtual address mapping for all the 73 * This macro defines the physical to virtual address mapping for all the
@@ -105,78 +103,189 @@
105 (((x) - X_MEMC_BASE_ADDR) + X_MEMC_BASE_ADDR_VIRT) 103 (((x) - X_MEMC_BASE_ADDR) + X_MEMC_BASE_ADDR_VIRT)
106 104
107/* fixed interrupt numbers */ 105/* fixed interrupt numbers */
108#define MXC_INT_LCDC 61 106#define MX2x_INT_CSPI3 6
109#define MXC_INT_SLCDC 60 107#define MX2x_INT_GPIO 8
110#define MXC_INT_EMMAPP 52 108#define MX2x_INT_SDHC2 10
111#define MXC_INT_EMMAPRP 51 109#define MX2x_INT_SDHC1 11
112#define MXC_INT_DMACH15 47 110#define MX2x_INT_I2C 12
113#define MXC_INT_DMACH14 46 111#define MX2x_INT_SSI2 13
114#define MXC_INT_DMACH13 45 112#define MX2x_INT_SSI1 14
115#define MXC_INT_DMACH12 44 113#define MX2x_INT_CSPI2 15
116#define MXC_INT_DMACH11 43 114#define MX2x_INT_CSPI1 16
117#define MXC_INT_DMACH10 42 115#define MX2x_INT_UART4 17
118#define MXC_INT_DMACH9 41 116#define MX2x_INT_UART3 18
119#define MXC_INT_DMACH8 40 117#define MX2x_INT_UART2 19
120#define MXC_INT_DMACH7 39 118#define MX2x_INT_UART1 20
121#define MXC_INT_DMACH6 38 119#define MX2x_INT_KPP 21
122#define MXC_INT_DMACH5 37 120#define MX2x_INT_RTC 22
123#define MXC_INT_DMACH4 36 121#define MX2x_INT_PWM 23
124#define MXC_INT_DMACH3 35 122#define MX2x_INT_GPT3 24
125#define MXC_INT_DMACH2 34 123#define MX2x_INT_GPT2 25
126#define MXC_INT_DMACH1 33 124#define MX2x_INT_GPT1 26
127#define MXC_INT_DMACH0 32 125#define MX2x_INT_WDOG 27
128#define MXC_INT_CSI 31 126#define MX2x_INT_PCMCIA 28
129#define MXC_INT_NANDFC 29 127#define MX2x_INT_NANDFC 29
130#define MXC_INT_PCMCIA 28 128#define MX2x_INT_CSI 31
131#define MXC_INT_WDOG 27 129#define MX2x_INT_DMACH0 32
132#define MXC_INT_GPT1 26 130#define MX2x_INT_DMACH1 33
133#define MXC_INT_GPT2 25 131#define MX2x_INT_DMACH2 34
134#define MXC_INT_GPT3 24 132#define MX2x_INT_DMACH3 35
135#define MXC_INT_GPT INT_GPT1 133#define MX2x_INT_DMACH4 36
136#define MXC_INT_PWM 23 134#define MX2x_INT_DMACH5 37
137#define MXC_INT_RTC 22 135#define MX2x_INT_DMACH6 38
138#define MXC_INT_KPP 21 136#define MX2x_INT_DMACH7 39
139#define MXC_INT_UART1 20 137#define MX2x_INT_DMACH8 40
140#define MXC_INT_UART2 19 138#define MX2x_INT_DMACH9 41
141#define MXC_INT_UART3 18 139#define MX2x_INT_DMACH10 42
142#define MXC_INT_UART4 17 140#define MX2x_INT_DMACH11 43
143#define MXC_INT_CSPI1 16 141#define MX2x_INT_DMACH12 44
144#define MXC_INT_CSPI2 15 142#define MX2x_INT_DMACH13 45
145#define MXC_INT_SSI1 14 143#define MX2x_INT_DMACH14 46
146#define MXC_INT_SSI2 13 144#define MX2x_INT_DMACH15 47
147#define MXC_INT_I2C 12 145#define MX2x_INT_EMMAPRP 51
148#define MXC_INT_SDHC1 11 146#define MX2x_INT_EMMAPP 52
149#define MXC_INT_SDHC2 10 147#define MX2x_INT_SLCDC 60
150#define MXC_INT_GPIO 8 148#define MX2x_INT_LCDC 61
151#define MXC_INT_CSPI3 6
152 149
153/* fixed DMA request numbers */ 150/* fixed DMA request numbers */
154#define DMA_REQ_CSI_RX 31 151#define MX2x_DMA_REQ_CSPI3_RX 1
155#define DMA_REQ_CSI_STAT 30 152#define MX2x_DMA_REQ_CSPI3_TX 2
156#define DMA_REQ_UART1_TX 27 153#define MX2x_DMA_REQ_EXT 3
157#define DMA_REQ_UART1_RX 26 154#define MX2x_DMA_REQ_SDHC2 6
158#define DMA_REQ_UART2_TX 25 155#define MX2x_DMA_REQ_SDHC1 7
159#define DMA_REQ_UART2_RX 24 156#define MX2x_DMA_REQ_SSI2_RX0 8
160#define DMA_REQ_UART3_TX 23 157#define MX2x_DMA_REQ_SSI2_TX0 9
161#define DMA_REQ_UART3_RX 22 158#define MX2x_DMA_REQ_SSI2_RX1 10
162#define DMA_REQ_UART4_TX 21 159#define MX2x_DMA_REQ_SSI2_TX1 11
163#define DMA_REQ_UART4_RX 20 160#define MX2x_DMA_REQ_SSI1_RX0 12
164#define DMA_REQ_CSPI1_TX 19 161#define MX2x_DMA_REQ_SSI1_TX0 13
165#define DMA_REQ_CSPI1_RX 18 162#define MX2x_DMA_REQ_SSI1_RX1 14
166#define DMA_REQ_CSPI2_TX 17 163#define MX2x_DMA_REQ_SSI1_TX1 15
167#define DMA_REQ_CSPI2_RX 16 164#define MX2x_DMA_REQ_CSPI2_RX 16
168#define DMA_REQ_SSI1_TX1 15 165#define MX2x_DMA_REQ_CSPI2_TX 17
169#define DMA_REQ_SSI1_RX1 14 166#define MX2x_DMA_REQ_CSPI1_RX 18
170#define DMA_REQ_SSI1_TX0 13 167#define MX2x_DMA_REQ_CSPI1_TX 19
171#define DMA_REQ_SSI1_RX0 12 168#define MX2x_DMA_REQ_UART4_RX 20
172#define DMA_REQ_SSI2_TX1 11 169#define MX2x_DMA_REQ_UART4_TX 21
173#define DMA_REQ_SSI2_RX1 10 170#define MX2x_DMA_REQ_UART3_RX 22
174#define DMA_REQ_SSI2_TX0 9 171#define MX2x_DMA_REQ_UART3_TX 23
175#define DMA_REQ_SSI2_RX0 8 172#define MX2x_DMA_REQ_UART2_RX 24
176#define DMA_REQ_SDHC1 7 173#define MX2x_DMA_REQ_UART2_TX 25
177#define DMA_REQ_SDHC2 6 174#define MX2x_DMA_REQ_UART1_RX 26
178#define DMA_REQ_EXT 3 175#define MX2x_DMA_REQ_UART1_TX 27
179#define DMA_REQ_CSPI3_TX 2 176#define MX2x_DMA_REQ_CSI_STAT 30
180#define DMA_REQ_CSPI3_RX 1 177#define MX2x_DMA_REQ_CSI_RX 31
178
179/* these should go away */
180#define AIPI_BASE_ADDR MX2x_AIPI_BASE_ADDR
181#define AIPI_BASE_ADDR_VIRT MX2x_AIPI_BASE_ADDR_VIRT
182#define AIPI_SIZE MX2x_AIPI_SIZE
183#define DMA_BASE_ADDR MX2x_DMA_BASE_ADDR
184#define WDOG_BASE_ADDR MX2x_WDOG_BASE_ADDR
185#define GPT1_BASE_ADDR MX2x_GPT1_BASE_ADDR
186#define GPT2_BASE_ADDR MX2x_GPT2_BASE_ADDR
187#define GPT3_BASE_ADDR MX2x_GPT3_BASE_ADDR
188#define PWM_BASE_ADDR MX2x_PWM_BASE_ADDR
189#define RTC_BASE_ADDR MX2x_RTC_BASE_ADDR
190#define KPP_BASE_ADDR MX2x_KPP_BASE_ADDR
191#define OWIRE_BASE_ADDR MX2x_OWIRE_BASE_ADDR
192#define UART1_BASE_ADDR MX2x_UART1_BASE_ADDR
193#define UART2_BASE_ADDR MX2x_UART2_BASE_ADDR
194#define UART3_BASE_ADDR MX2x_UART3_BASE_ADDR
195#define UART4_BASE_ADDR MX2x_UART4_BASE_ADDR
196#define CSPI1_BASE_ADDR MX2x_CSPI1_BASE_ADDR
197#define CSPI2_BASE_ADDR MX2x_CSPI2_BASE_ADDR
198#define SSI1_BASE_ADDR MX2x_SSI1_BASE_ADDR
199#define SSI2_BASE_ADDR MX2x_SSI2_BASE_ADDR
200#define I2C_BASE_ADDR MX2x_I2C_BASE_ADDR
201#define SDHC1_BASE_ADDR MX2x_SDHC1_BASE_ADDR
202#define SDHC2_BASE_ADDR MX2x_SDHC2_BASE_ADDR
203#define GPIO_BASE_ADDR MX2x_GPIO_BASE_ADDR
204#define AUDMUX_BASE_ADDR MX2x_AUDMUX_BASE_ADDR
205#define CSPI3_BASE_ADDR MX2x_CSPI3_BASE_ADDR
206#define LCDC_BASE_ADDR MX2x_LCDC_BASE_ADDR
207#define SLCDC_BASE_ADDR MX2x_SLCDC_BASE_ADDR
208#define USBOTG_BASE_ADDR MX2x_USBOTG_BASE_ADDR
209#define EMMA_PP_BASE_ADDR MX2x_EMMA_PP_BASE_ADDR
210#define EMMA_PRP_BASE_ADDR MX2x_EMMA_PRP_BASE_ADDR
211#define CCM_BASE_ADDR MX2x_CCM_BASE_ADDR
212#define SYSCTRL_BASE_ADDR MX2x_SYSCTRL_BASE_ADDR
213#define JAM_BASE_ADDR MX2x_JAM_BASE_ADDR
214#define MAX_BASE_ADDR MX2x_MAX_BASE_ADDR
215#define AVIC_BASE_ADDR MX2x_AVIC_BASE_ADDR
216#define SAHB1_BASE_ADDR MX2x_SAHB1_BASE_ADDR
217#define SAHB1_BASE_ADDR_VIRT MX2x_SAHB1_BASE_ADDR_VIRT
218#define SAHB1_SIZE MX2x_SAHB1_SIZE
219#define CSI_BASE_ADDR MX2x_CSI_BASE_ADDR
220#define MXC_INT_CSPI3 MX2x_INT_CSPI3
221#define MXC_INT_GPIO MX2x_INT_GPIO
222#define MXC_INT_SDHC2 MX2x_INT_SDHC2
223#define MXC_INT_SDHC1 MX2x_INT_SDHC1
224#define MXC_INT_I2C MX2x_INT_I2C
225#define MXC_INT_SSI2 MX2x_INT_SSI2
226#define MXC_INT_SSI1 MX2x_INT_SSI1
227#define MXC_INT_CSPI2 MX2x_INT_CSPI2
228#define MXC_INT_CSPI1 MX2x_INT_CSPI1
229#define MXC_INT_UART4 MX2x_INT_UART4
230#define MXC_INT_UART3 MX2x_INT_UART3
231#define MXC_INT_UART2 MX2x_INT_UART2
232#define MXC_INT_UART1 MX2x_INT_UART1
233#define MXC_INT_KPP MX2x_INT_KPP
234#define MXC_INT_RTC MX2x_INT_RTC
235#define MXC_INT_PWM MX2x_INT_PWM
236#define MXC_INT_GPT3 MX2x_INT_GPT3
237#define MXC_INT_GPT2 MX2x_INT_GPT2
238#define MXC_INT_GPT1 MX2x_INT_GPT1
239#define MXC_INT_WDOG MX2x_INT_WDOG
240#define MXC_INT_PCMCIA MX2x_INT_PCMCIA
241#define MXC_INT_NANDFC MX2x_INT_NANDFC
242#define MXC_INT_CSI MX2x_INT_CSI
243#define MXC_INT_DMACH0 MX2x_INT_DMACH0
244#define MXC_INT_DMACH1 MX2x_INT_DMACH1
245#define MXC_INT_DMACH2 MX2x_INT_DMACH2
246#define MXC_INT_DMACH3 MX2x_INT_DMACH3
247#define MXC_INT_DMACH4 MX2x_INT_DMACH4
248#define MXC_INT_DMACH5 MX2x_INT_DMACH5
249#define MXC_INT_DMACH6 MX2x_INT_DMACH6
250#define MXC_INT_DMACH7 MX2x_INT_DMACH7
251#define MXC_INT_DMACH8 MX2x_INT_DMACH8
252#define MXC_INT_DMACH9 MX2x_INT_DMACH9
253#define MXC_INT_DMACH10 MX2x_INT_DMACH10
254#define MXC_INT_DMACH11 MX2x_INT_DMACH11
255#define MXC_INT_DMACH12 MX2x_INT_DMACH12
256#define MXC_INT_DMACH13 MX2x_INT_DMACH13
257#define MXC_INT_DMACH14 MX2x_INT_DMACH14
258#define MXC_INT_DMACH15 MX2x_INT_DMACH15
259#define MXC_INT_EMMAPRP MX2x_INT_EMMAPRP
260#define MXC_INT_EMMAPP MX2x_INT_EMMAPP
261#define MXC_INT_SLCDC MX2x_INT_SLCDC
262#define MXC_INT_LCDC MX2x_INT_LCDC
263#define DMA_REQ_CSPI3_RX MX2x_DMA_REQ_CSPI3_RX
264#define DMA_REQ_CSPI3_TX MX2x_DMA_REQ_CSPI3_TX
265#define DMA_REQ_EXT MX2x_DMA_REQ_EXT
266#define DMA_REQ_SDHC2 MX2x_DMA_REQ_SDHC2
267#define DMA_REQ_SDHC1 MX2x_DMA_REQ_SDHC1
268#define DMA_REQ_SSI2_RX0 MX2x_DMA_REQ_SSI2_RX0
269#define DMA_REQ_SSI2_TX0 MX2x_DMA_REQ_SSI2_TX0
270#define DMA_REQ_SSI2_RX1 MX2x_DMA_REQ_SSI2_RX1
271#define DMA_REQ_SSI2_TX1 MX2x_DMA_REQ_SSI2_TX1
272#define DMA_REQ_SSI1_RX0 MX2x_DMA_REQ_SSI1_RX0
273#define DMA_REQ_SSI1_TX0 MX2x_DMA_REQ_SSI1_TX0
274#define DMA_REQ_SSI1_RX1 MX2x_DMA_REQ_SSI1_RX1
275#define DMA_REQ_SSI1_TX1 MX2x_DMA_REQ_SSI1_TX1
276#define DMA_REQ_CSPI2_RX MX2x_DMA_REQ_CSPI2_RX
277#define DMA_REQ_CSPI2_TX MX2x_DMA_REQ_CSPI2_TX
278#define DMA_REQ_CSPI1_RX MX2x_DMA_REQ_CSPI1_RX
279#define DMA_REQ_CSPI1_TX MX2x_DMA_REQ_CSPI1_TX
280#define DMA_REQ_UART4_RX MX2x_DMA_REQ_UART4_RX
281#define DMA_REQ_UART4_TX MX2x_DMA_REQ_UART4_TX
282#define DMA_REQ_UART3_RX MX2x_DMA_REQ_UART3_RX
283#define DMA_REQ_UART3_TX MX2x_DMA_REQ_UART3_TX
284#define DMA_REQ_UART2_RX MX2x_DMA_REQ_UART2_RX
285#define DMA_REQ_UART2_TX MX2x_DMA_REQ_UART2_TX
286#define DMA_REQ_UART1_RX MX2x_DMA_REQ_UART1_RX
287#define DMA_REQ_UART1_TX MX2x_DMA_REQ_UART1_TX
288#define DMA_REQ_CSI_STAT MX2x_DMA_REQ_CSI_STAT
289#define DMA_REQ_CSI_RX MX2x_DMA_REQ_CSI_RX
181 290
182#endif /* __ASM_ARCH_MXC_MX2x_H__ */ 291#endif /* __ASM_ARCH_MXC_MX2x_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/mx31.h b/arch/arm/plat-mxc/include/mach/mx31.h
index 14ac0dcc82f4..b8b47d139eb5 100644
--- a/arch/arm/plat-mxc/include/mach/mx31.h
+++ b/arch/arm/plat-mxc/include/mach/mx31.h
@@ -1,45 +1,218 @@
1/* 1/*
2 * IRAM 2 * IRAM
3 */ 3 */
4#define MX31_IRAM_BASE_ADDR 0x1FFC0000 /* internal ram */ 4#define MX31_IRAM_BASE_ADDR 0x1ffc0000 /* internal ram */
5#define MX31_IRAM_SIZE SZ_16K 5#define MX31_IRAM_SIZE SZ_16K
6 6
7#define MX31_OTG_BASE_ADDR (AIPS1_BASE_ADDR + 0x00088000) 7#define MX31_L2CC_BASE_ADDR 0x30000000
8#define ATA_BASE_ADDR (AIPS1_BASE_ADDR + 0x0008C000) 8#define MX31_L2CC_SIZE SZ_1M
9#define UART4_BASE_ADDR (AIPS1_BASE_ADDR + 0x000B0000)
10#define UART5_BASE_ADDR (AIPS1_BASE_ADDR + 0x000B4000)
11 9
12#define MMC_SDHC1_BASE_ADDR (SPBA0_BASE_ADDR + 0x00004000) 10#define MX31_AIPS1_BASE_ADDR 0x43f00000
13#define MMC_SDHC2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00008000) 11#define MX31_AIPS1_BASE_ADDR_VIRT 0xfc000000
14#define SIM1_BASE_ADDR (SPBA0_BASE_ADDR + 0x00018000) 12#define MX31_AIPS1_SIZE SZ_1M
15#define IIM_BASE_ADDR (SPBA0_BASE_ADDR + 0x0001C000) 13#define MX31_MAX_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0x04000)
14#define MX31_EVTMON_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0x08000)
15#define MX31_CLKCTL_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0x0c000)
16#define MX31_ETB_SLOT4_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0x10000)
17#define MX31_ETB_SLOT5_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0x14000)
18#define MX31_ECT_CTIO_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0x18000)
19#define MX31_I2C_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0x80000)
20#define MX31_I2C3_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0x84000)
21#define MX31_OTG_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0x88000)
22#define MX31_ATA_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0x8c000)
23#define MX31_UART1_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0x90000)
24#define MX31_UART2_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0x94000)
25#define MX31_I2C2_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0x98000)
26#define MX31_OWIRE_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0x9c000)
27#define MX31_SSI1_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0xa0000)
28#define MX31_CSPI1_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0xa4000)
29#define MX31_KPP_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0xa8000)
30#define MX31_IOMUXC_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0xac000)
31#define MX31_UART4_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0xb0000)
32#define MX31_UART5_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0xb4000)
33#define MX31_ECT_IP1_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0xb8000)
34#define MX31_ECT_IP2_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0xbc000)
16 35
17#define CSPI3_BASE_ADDR (AIPS2_BASE_ADDR + 0x00084000) 36#define MX31_SPBA0_BASE_ADDR 0x50000000
18#define FIRI_BASE_ADDR (AIPS2_BASE_ADDR + 0x0008C000) 37#define MX31_SPBA0_BASE_ADDR_VIRT 0xfc100000
19#define SCM_BASE_ADDR (AIPS2_BASE_ADDR + 0x000AE000) 38#define MX31_SPBA0_SIZE SZ_1M
20#define SMN_BASE_ADDR (AIPS2_BASE_ADDR + 0x000AF000) 39#define MX31_MMC_SDHC1_BASE_ADDR (MX31_SPBA0_BASE_ADDR + 0x04000)
21#define MPEG4_ENC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000C8000) 40#define MX31_MMC_SDHC2_BASE_ADDR (MX31_SPBA0_BASE_ADDR + 0x08000)
41#define MX31_UART3_BASE_ADDR (MX31_SPBA0_BASE_ADDR + 0x0c000)
42#define MX31_CSPI2_BASE_ADDR (MX31_SPBA0_BASE_ADDR + 0x10000)
43#define MX31_SSI2_BASE_ADDR (MX31_SPBA0_BASE_ADDR + 0x14000)
44#define MX31_SIM1_BASE_ADDR (MX31_SPBA0_BASE_ADDR + 0x18000)
45#define MX31_IIM_BASE_ADDR (MX31_SPBA0_BASE_ADDR + 0x1c000)
46#define MX31_ATA_DMA_BASE_ADDR (MX31_SPBA0_BASE_ADDR + 0x20000)
47#define MX31_MSHC1_BASE_ADDR (MX31_SPBA0_BASE_ADDR + 0x24000)
48#define MX31_SPBA_CTRL_BASE_ADDR (MX31_SPBA0_BASE_ADDR + 0x3c000)
22 49
23#define MX31_NFC_BASE_ADDR (X_MEMC_BASE_ADDR + 0x0000) 50#define MX31_AIPS2_BASE_ADDR 0x53f00000
51#define MX31_AIPS2_BASE_ADDR_VIRT 0xfc200000
52#define MX31_AIPS2_SIZE SZ_1M
53#define MX31_CCM_BASE_ADDR (MX31_AIPS2_BASE_ADDR + 0x80000)
54#define MX31_CSPI3_BASE_ADDR (MX31_AIPS2_BASE_ADDR + 0x84000)
55#define MX31_FIRI_BASE_ADDR (MX31_AIPS2_BASE_ADDR + 0x8c000)
56#define MX31_GPT1_BASE_ADDR (MX31_AIPS2_BASE_ADDR + 0x90000)
57#define MX31_EPIT1_BASE_ADDR (MX31_AIPS2_BASE_ADDR + 0x94000)
58#define MX31_EPIT2_BASE_ADDR (MX31_AIPS2_BASE_ADDR + 0x98000)
59#define MX31_GPIO3_BASE_ADDR (MX31_AIPS2_BASE_ADDR + 0xa4000)
60#define MX31_SCC_BASE_ADDR (MX31_AIPS2_BASE_ADDR + 0xac000)
61#define MX31_SCM_BASE_ADDR (MX31_AIPS2_BASE_ADDR + 0xae000)
62#define MX31_SMN_BASE_ADDR (MX31_AIPS2_BASE_ADDR + 0xaf000)
63#define MX31_RNGA_BASE_ADDR (MX31_AIPS2_BASE_ADDR + 0xb0000)
64#define MX31_IPU_CTRL_BASE_ADDR (MX31_AIPS2_BASE_ADDR + 0xc0000)
65#define MX31_AUDMUX_BASE_ADDR (MX31_AIPS2_BASE_ADDR + 0xc4000)
66#define MX31_MPEG4_ENC_BASE_ADDR (MX31_AIPS2_BASE_ADDR + 0xc8000)
67#define MX31_GPIO1_BASE_ADDR (MX31_AIPS2_BASE_ADDR + 0xcc000)
68#define MX31_GPIO2_BASE_ADDR (MX31_AIPS2_BASE_ADDR + 0xd0000)
69#define MX31_SDMA_BASE_ADDR (MX31_AIPS2_BASE_ADDR + 0xd4000)
70#define MX31_RTC_BASE_ADDR (MX31_AIPS2_BASE_ADDR + 0xd8000)
71#define MX31_WDOG_BASE_ADDR (MX31_AIPS2_BASE_ADDR + 0xdc000)
72#define MX31_PWM_BASE_ADDR (MX31_AIPS2_BASE_ADDR + 0xe0000)
73#define MX31_RTIC_BASE_ADDR (MX31_AIPS2_BASE_ADDR + 0xec000)
24 74
25#define MXC_INT_MPEG4_ENCODER 5 75#define MX31_ROMP_BASE_ADDR 0x60000000
26#define MXC_INT_FIRI 7 76#define MX31_ROMP_BASE_ADDR_VIRT 0xfc500000
77#define MX31_ROMP_SIZE SZ_1M
78
79#define MX31_AVIC_BASE_ADDR 0x68000000
80#define MX31_AVIC_BASE_ADDR_VIRT 0xfc400000
81#define MX31_AVIC_SIZE SZ_1M
82
83#define MX31_IPU_MEM_BASE_ADDR 0x70000000
84#define MX31_CSD0_BASE_ADDR 0x80000000
85#define MX31_CSD1_BASE_ADDR 0x90000000
86
87#define MX31_CS0_BASE_ADDR 0xa0000000
88#define MX31_CS1_BASE_ADDR 0xa8000000
89#define MX31_CS2_BASE_ADDR 0xb0000000
90#define MX31_CS3_BASE_ADDR 0xb2000000
91
92#define MX31_CS4_BASE_ADDR 0xb4000000
93#define MX31_CS4_BASE_ADDR_VIRT 0xf4000000
94#define MX31_CS4_SIZE SZ_32M
95
96#define MX31_CS5_BASE_ADDR 0xb6000000
97#define MX31_CS5_BASE_ADDR_VIRT 0xf6000000
98#define MX31_CS5_SIZE SZ_32M
99
100#define MX31_X_MEMC_BASE_ADDR 0xb8000000
101#define MX31_X_MEMC_BASE_ADDR_VIRT 0xfc320000
102#define MX31_X_MEMC_SIZE SZ_64K
103#define MX31_NFC_BASE_ADDR (MX31_X_MEMC_BASE_ADDR + 0x0000)
104#define MX31_ESDCTL_BASE_ADDR (MX31_X_MEMC_BASE_ADDR + 0x1000)
105#define MX31_WEIM_BASE_ADDR (MX31_X_MEMC_BASE_ADDR + 0x2000)
106#define MX31_M3IF_BASE_ADDR (MX31_X_MEMC_BASE_ADDR + 0x3000)
107#define MX31_EMI_CTL_BASE_ADDR (MX31_X_MEMC_BASE_ADDR + 0x4000)
108#define MX31_PCMCIA_CTL_BASE_ADDR MX31_EMI_CTL_BASE_ADDR
109
110#define MX31_PCMCIA_MEM_BASE_ADDR 0xbc000000
111
112#define MX31_INT_I2C3 3
113#define MX31_INT_I2C2 4
114#define MX31_INT_MPEG4_ENCODER 5
115#define MX31_INT_RTIC 6
116#define MX31_INT_FIRI 7
27#define MX31_INT_MMC_SDHC2 8 117#define MX31_INT_MMC_SDHC2 8
28#define MXC_INT_MMC_SDHC1 9 118#define MX31_INT_MMC_SDHC1 9
119#define MX31_INT_I2C 10
29#define MX31_INT_SSI2 11 120#define MX31_INT_SSI2 11
30#define MX31_INT_SSI1 12 121#define MX31_INT_SSI1 12
31#define MXC_INT_MBX 16 122#define MX31_INT_CSPI2 13
32#define MXC_INT_CSPI3 17 123#define MX31_INT_CSPI1 14
33#define MXC_INT_SIM2 20 124#define MX31_INT_ATA 15
34#define MXC_INT_SIM1 21 125#define MX31_INT_MBX 16
35#define MXC_INT_CCM_DVFS 31 126#define MX31_INT_CSPI3 17
36#define MXC_INT_USB1 35 127#define MX31_INT_UART3 18
37#define MXC_INT_USB2 36 128#define MX31_INT_IIM 19
38#define MXC_INT_USB3 37 129#define MX31_INT_SIM2 20
39#define MXC_INT_USB4 38 130#define MX31_INT_SIM1 21
40#define MXC_INT_MSHC2 40 131#define MX31_INT_RNGA 22
41#define MXC_INT_UART4 46 132#define MX31_INT_EVTMON 23
42#define MXC_INT_UART5 47 133#define MX31_INT_KPP 24
43#define MXC_INT_CCM 53 134#define MX31_INT_RTC 25
44#define MXC_INT_PCMCIA 54 135#define MX31_INT_PWM 26
136#define MX31_INT_EPIT2 27
137#define MX31_INT_EPIT1 28
138#define MX31_INT_GPT 29
139#define MX31_INT_POWER_FAIL 30
140#define MX31_INT_CCM_DVFS 31
141#define MX31_INT_UART2 32
142#define MX31_INT_NANDFC 33
143#define MX31_INT_SDMA 34
144#define MX31_INT_USB1 35
145#define MX31_INT_USB2 36
146#define MX31_INT_USB3 37
147#define MX31_INT_USB4 38
148#define MX31_INT_MSHC1 39
149#define MX31_INT_MSHC2 40
150#define MX31_INT_IPU_ERR 41
151#define MX31_INT_IPU_SYN 42
152#define MX31_INT_UART1 45
153#define MX31_INT_UART4 46
154#define MX31_INT_UART5 47
155#define MX31_INT_ECT 48
156#define MX31_INT_SCC_SCM 49
157#define MX31_INT_SCC_SMN 50
158#define MX31_INT_GPIO2 51
159#define MX31_INT_GPIO1 52
160#define MX31_INT_CCM 53
161#define MX31_INT_PCMCIA 54
162#define MX31_INT_WDOG 55
163#define MX31_INT_GPIO3 56
164#define MX31_INT_EXT_POWER 58
165#define MX31_INT_EXT_TEMPER 59
166#define MX31_INT_EXT_SENSOR60 60
167#define MX31_INT_EXT_SENSOR61 61
168#define MX31_INT_EXT_WDOG 62
169#define MX31_INT_EXT_TV 63
170
171#define MX31_PROD_SIGNATURE 0x1 /* For MX31 */
172
173/* silicon revisions specific to i.MX31 */
174#define MX31_CHIP_REV_1_0 0x10
175#define MX31_CHIP_REV_1_1 0x11
176#define MX31_CHIP_REV_1_2 0x12
177#define MX31_CHIP_REV_1_3 0x13
178#define MX31_CHIP_REV_2_0 0x20
179#define MX31_CHIP_REV_2_1 0x21
180#define MX31_CHIP_REV_2_2 0x22
181#define MX31_CHIP_REV_2_3 0x23
182#define MX31_CHIP_REV_3_0 0x30
183#define MX31_CHIP_REV_3_1 0x31
184#define MX31_CHIP_REV_3_2 0x32
185
186#define MX31_SYSTEM_REV_MIN MX31_CHIP_REV_1_0
187#define MX31_SYSTEM_REV_NUM 3
45 188
189/* these should go away */
190#define ATA_BASE_ADDR MX31_ATA_BASE_ADDR
191#define UART4_BASE_ADDR MX31_UART4_BASE_ADDR
192#define UART5_BASE_ADDR MX31_UART5_BASE_ADDR
193#define MMC_SDHC1_BASE_ADDR MX31_MMC_SDHC1_BASE_ADDR
194#define MMC_SDHC2_BASE_ADDR MX31_MMC_SDHC2_BASE_ADDR
195#define SIM1_BASE_ADDR MX31_SIM1_BASE_ADDR
196#define IIM_BASE_ADDR MX31_IIM_BASE_ADDR
197#define CSPI3_BASE_ADDR MX31_CSPI3_BASE_ADDR
198#define FIRI_BASE_ADDR MX31_FIRI_BASE_ADDR
199#define SCM_BASE_ADDR MX31_SCM_BASE_ADDR
200#define SMN_BASE_ADDR MX31_SMN_BASE_ADDR
201#define MPEG4_ENC_BASE_ADDR MX31_MPEG4_ENC_BASE_ADDR
202#define MXC_INT_MPEG4_ENCODER MX31_INT_MPEG4_ENCODER
203#define MXC_INT_FIRI MX31_INT_FIRI
204#define MXC_INT_MMC_SDHC1 MX31_INT_MMC_SDHC1
205#define MXC_INT_MBX MX31_INT_MBX
206#define MXC_INT_CSPI3 MX31_INT_CSPI3
207#define MXC_INT_SIM2 MX31_INT_SIM2
208#define MXC_INT_SIM1 MX31_INT_SIM1
209#define MXC_INT_CCM_DVFS MX31_INT_CCM_DVFS
210#define MXC_INT_USB1 MX31_INT_USB1
211#define MXC_INT_USB2 MX31_INT_USB2
212#define MXC_INT_USB3 MX31_INT_USB3
213#define MXC_INT_USB4 MX31_INT_USB4
214#define MXC_INT_MSHC2 MX31_INT_MSHC2
215#define MXC_INT_UART4 MX31_INT_UART4
216#define MXC_INT_UART5 MX31_INT_UART5
217#define MXC_INT_CCM MX31_INT_CCM
218#define MXC_INT_PCMCIA MX31_INT_PCMCIA
diff --git a/arch/arm/plat-mxc/include/mach/mx35.h b/arch/arm/plat-mxc/include/mach/mx35.h
index ab4cfec6c8ab..af871bce35b6 100644
--- a/arch/arm/plat-mxc/include/mach/mx35.h
+++ b/arch/arm/plat-mxc/include/mach/mx35.h
@@ -2,29 +2,196 @@
2 * IRAM 2 * IRAM
3 */ 3 */
4#define MX35_IRAM_BASE_ADDR 0x10000000 /* internal ram */ 4#define MX35_IRAM_BASE_ADDR 0x10000000 /* internal ram */
5#define MX35_IRAM_SIZE SZ_128K 5#define MX35_IRAM_SIZE SZ_128K
6 6
7#define MXC_FEC_BASE_ADDR 0x50038000 7#define MX35_L2CC_BASE_ADDR 0x30000000
8#define MX35_OTG_BASE_ADDR 0x53ff4000 8#define MX35_L2CC_SIZE SZ_1M
9#define MX35_NFC_BASE_ADDR 0xBB000000 9
10#define MX35_AIPS1_BASE_ADDR 0x43f00000
11#define MX35_AIPS1_BASE_ADDR_VIRT 0xfc000000
12#define MX35_AIPS1_SIZE SZ_1M
13#define MX35_MAX_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0x04000)
14#define MX35_EVTMON_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0x08000)
15#define MX35_CLKCTL_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0x0c000)
16#define MX35_ETB_SLOT4_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0x10000)
17#define MX35_ETB_SLOT5_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0x14000)
18#define MX35_ECT_CTIO_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0x18000)
19#define MX35_I2C_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0x80000)
20#define MX35_I2C3_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0x84000)
21#define MX35_UART1_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0x90000)
22#define MX35_UART2_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0x94000)
23#define MX35_I2C2_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0x98000)
24#define MX35_OWIRE_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0x9c000)
25#define MX35_SSI1_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0xa0000)
26#define MX35_CSPI1_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0xa4000)
27#define MX35_KPP_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0xa8000)
28#define MX35_IOMUXC_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0xac000)
29#define MX35_ECT_IP1_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0xb8000)
30#define MX35_ECT_IP2_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0xbc000)
31
32#define MX35_SPBA0_BASE_ADDR 0x50000000
33#define MX35_SPBA0_BASE_ADDR_VIRT 0xfc100000
34#define MX35_SPBA0_SIZE SZ_1M
35#define MX35_UART3_BASE_ADDR (MX35_SPBA0_BASE_ADDR + 0x0c000)
36#define MX35_CSPI2_BASE_ADDR (MX35_SPBA0_BASE_ADDR + 0x10000)
37#define MX35_SSI2_BASE_ADDR (MX35_SPBA0_BASE_ADDR + 0x14000)
38#define MX35_ATA_DMA_BASE_ADDR (MX35_SPBA0_BASE_ADDR + 0x20000)
39#define MX35_MSHC1_BASE_ADDR (MX35_SPBA0_BASE_ADDR + 0x24000)
40#define MX35_FEC_BASE_ADDR 0x50038000
41#define MX35_SPBA_CTRL_BASE_ADDR (MX35_SPBA0_BASE_ADDR + 0x3c000)
42
43#define MX35_AIPS2_BASE_ADDR 0x53f00000
44#define MX35_AIPS2_BASE_ADDR_VIRT 0xfc200000
45#define MX35_AIPS2_SIZE SZ_1M
46#define MX35_CCM_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0x80000)
47#define MX35_GPT1_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0x90000)
48#define MX35_EPIT1_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0x94000)
49#define MX35_EPIT2_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0x98000)
50#define MX35_GPIO3_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0xa4000)
51#define MX35_SCC_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0xac000)
52#define MX35_RNGA_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0xb0000)
53#define MX35_IPU_CTRL_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0xc0000)
54#define MX35_AUDMUX_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0xc4000)
55#define MX35_GPIO1_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0xcc000)
56#define MX35_GPIO2_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0xd0000)
57#define MX35_SDMA_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0xd4000)
58#define MX35_RTC_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0xd8000)
59#define MX35_WDOG_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0xdc000)
60#define MX35_PWM_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0xe0000)
61#define MX35_RTIC_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0xec000)
62#define MX35_OTG_BASE_ADDR 0x53ff4000
63
64#define MX35_ROMP_BASE_ADDR 0x60000000
65#define MX35_ROMP_BASE_ADDR_VIRT 0xfc500000
66#define MX35_ROMP_SIZE SZ_1M
67
68#define MX35_AVIC_BASE_ADDR 0x68000000
69#define MX35_AVIC_BASE_ADDR_VIRT 0xfc400000
70#define MX35_AVIC_SIZE SZ_1M
71
72/*
73 * Memory regions and CS
74 */
75#define MX35_IPU_MEM_BASE_ADDR 0x70000000
76#define MX35_CSD0_BASE_ADDR 0x80000000
77#define MX35_CSD1_BASE_ADDR 0x90000000
78
79#define MX35_CS0_BASE_ADDR 0xa0000000
80#define MX35_CS1_BASE_ADDR 0xa8000000
81#define MX35_CS2_BASE_ADDR 0xb0000000
82#define MX35_CS3_BASE_ADDR 0xb2000000
83
84#define MX35_CS4_BASE_ADDR 0xb4000000
85#define MX35_CS4_BASE_ADDR_VIRT 0xf4000000
86#define MX35_CS4_SIZE SZ_32M
87
88#define MX35_CS5_BASE_ADDR 0xb6000000
89#define MX35_CS5_BASE_ADDR_VIRT 0xf6000000
90#define MX35_CS5_SIZE SZ_32M
91
92/*
93 * NAND, SDRAM, WEIM, M3IF, EMI controllers
94 */
95#define MX35_X_MEMC_BASE_ADDR 0xb8000000
96#define MX35_X_MEMC_BASE_ADDR_VIRT 0xfc320000
97#define MX35_X_MEMC_SIZE SZ_64K
98#define MX35_ESDCTL_BASE_ADDR (MX35_X_MEMC_BASE_ADDR + 0x1000)
99#define MX35_WEIM_BASE_ADDR (MX35_X_MEMC_BASE_ADDR + 0x2000)
100#define MX35_M3IF_BASE_ADDR (MX35_X_MEMC_BASE_ADDR + 0x3000)
101#define MX35_EMI_CTL_BASE_ADDR (MX35_X_MEMC_BASE_ADDR + 0x4000)
102#define MX35_PCMCIA_CTL_BASE_ADDR MX35_EMI_CTL_BASE_ADDR
103
104#define MX35_NFC_BASE_ADDR 0xbb000000
105#define MX35_PCMCIA_MEM_BASE_ADDR 0xbc000000
10 106
11/* 107/*
12 * Interrupt numbers 108 * Interrupt numbers
13 */ 109 */
14#define MXC_INT_OWIRE 2 110#define MX35_INT_OWIRE 2
111#define MX35_INT_I2C3 3
112#define MX35_INT_I2C2 4
113#define MX35_INT_RTIC 6
15#define MX35_INT_MMC_SDHC1 7 114#define MX35_INT_MMC_SDHC1 7
16#define MXC_INT_MMC_SDHC2 8 115#define MX35_INT_MMC_SDHC2 8
17#define MXC_INT_MMC_SDHC3 9 116#define MX35_INT_MMC_SDHC3 9
117#define MX35_INT_I2C 10
18#define MX35_INT_SSI1 11 118#define MX35_INT_SSI1 11
19#define MX35_INT_SSI2 12 119#define MX35_INT_SSI2 12
20#define MXC_INT_GPU2D 16 120#define MX35_INT_CSPI2 13
21#define MXC_INT_ASRC 17 121#define MX35_INT_CSPI1 14
22#define MXC_INT_USBHS 35 122#define MX35_INT_ATA 15
23#define MXC_INT_USBOTG 37 123#define MX35_INT_GPU2D 16
24#define MXC_INT_ESAI 40 124#define MX35_INT_ASRC 17
25#define MXC_INT_CAN1 43 125#define MX35_INT_UART3 18
26#define MXC_INT_CAN2 44 126#define MX35_INT_IIM 19
27#define MXC_INT_MLB 46 127#define MX35_INT_RNGA 22
28#define MXC_INT_SPDIF 47 128#define MX35_INT_EVTMON 23
29#define MXC_INT_FEC 57 129#define MX35_INT_KPP 24
130#define MX35_INT_RTC 25
131#define MX35_INT_PWM 26
132#define MX35_INT_EPIT2 27
133#define MX35_INT_EPIT1 28
134#define MX35_INT_GPT 29
135#define MX35_INT_POWER_FAIL 30
136#define MX35_INT_UART2 32
137#define MX35_INT_NANDFC 33
138#define MX35_INT_SDMA 34
139#define MX35_INT_USBHS 35
140#define MX35_INT_USBOTG 37
141#define MX35_INT_MSHC1 39
142#define MX35_INT_ESAI 40
143#define MX35_INT_IPU_ERR 41
144#define MX35_INT_IPU_SYN 42
145#define MX35_INT_CAN1 43
146#define MX35_INT_CAN2 44
147#define MX35_INT_UART1 45
148#define MX35_INT_MLB 46
149#define MX35_INT_SPDIF 47
150#define MX35_INT_ECT 48
151#define MX35_INT_SCC_SCM 49
152#define MX35_INT_SCC_SMN 50
153#define MX35_INT_GPIO2 51
154#define MX35_INT_GPIO1 52
155#define MX35_INT_WDOG 55
156#define MX35_INT_GPIO3 56
157#define MX35_INT_FEC 57
158#define MX35_INT_EXT_POWER 58
159#define MX35_INT_EXT_TEMPER 59
160#define MX35_INT_EXT_SENSOR60 60
161#define MX35_INT_EXT_SENSOR61 61
162#define MX35_INT_EXT_WDOG 62
163#define MX35_INT_EXT_TV 63
164
165#define MX35_PROD_SIGNATURE 0x1 /* For MX31 */
166
167/* silicon revisions specific to i.MX31 */
168#define MX35_CHIP_REV_1_0 0x10
169#define MX35_CHIP_REV_1_1 0x11
170#define MX35_CHIP_REV_1_2 0x12
171#define MX35_CHIP_REV_1_3 0x13
172#define MX35_CHIP_REV_2_0 0x20
173#define MX35_CHIP_REV_2_1 0x21
174#define MX35_CHIP_REV_2_2 0x22
175#define MX35_CHIP_REV_2_3 0x23
176#define MX35_CHIP_REV_3_0 0x30
177#define MX35_CHIP_REV_3_1 0x31
178#define MX35_CHIP_REV_3_2 0x32
179
180#define MX35_SYSTEM_REV_MIN MX35_CHIP_REV_1_0
181#define MX35_SYSTEM_REV_NUM 3
30 182
183/* these should go away */
184#define MXC_FEC_BASE_ADDR MX35_FEC_BASE_ADDR
185#define MXC_INT_OWIRE MX35_INT_OWIRE
186#define MXC_INT_MMC_SDHC2 MX35_INT_MMC_SDHC2
187#define MXC_INT_MMC_SDHC3 MX35_INT_MMC_SDHC3
188#define MXC_INT_GPU2D MX35_INT_GPU2D
189#define MXC_INT_ASRC MX35_INT_ASRC
190#define MXC_INT_USBHS MX35_INT_USBHS
191#define MXC_INT_USBOTG MX35_INT_USBOTG
192#define MXC_INT_ESAI MX35_INT_ESAI
193#define MXC_INT_CAN1 MX35_INT_CAN1
194#define MXC_INT_CAN2 MX35_INT_CAN2
195#define MXC_INT_MLB MX35_INT_MLB
196#define MXC_INT_SPDIF MX35_INT_SPDIF
197#define MXC_INT_FEC MX35_INT_FEC
diff --git a/arch/arm/plat-mxc/include/mach/mx3x.h b/arch/arm/plat-mxc/include/mach/mx3x.h
index 009f4440276b..be69272407ad 100644
--- a/arch/arm/plat-mxc/include/mach/mx3x.h
+++ b/arch/arm/plat-mxc/include/mach/mx3x.h
@@ -34,120 +34,117 @@
34 * C0000000 64M PCMCIA/CF 34 * C0000000 64M PCMCIA/CF
35 */ 35 */
36 36
37#define CS0_BASE_ADDR 0xA0000000
38#define CS1_BASE_ADDR 0xA8000000
39#define CS2_BASE_ADDR 0xB0000000
40#define CS3_BASE_ADDR 0xB2000000
41
42#define CS4_BASE_ADDR 0xB4000000
43#define CS4_BASE_ADDR_VIRT 0xF4000000
44#define CS4_SIZE SZ_32M
45
46#define CS5_BASE_ADDR 0xB6000000
47#define CS5_BASE_ADDR_VIRT 0xF6000000
48#define CS5_SIZE SZ_32M
49
50#define PCMCIA_MEM_BASE_ADDR 0xBC000000
51
52/* 37/*
53 * L2CC 38 * L2CC
54 */ 39 */
55#define L2CC_BASE_ADDR 0x30000000 40#define MX3x_L2CC_BASE_ADDR 0x30000000
56#define L2CC_SIZE SZ_1M 41#define MX3x_L2CC_SIZE SZ_1M
57 42
58/* 43/*
59 * AIPS 1 44 * AIPS 1
60 */ 45 */
61#define AIPS1_BASE_ADDR 0x43F00000 46#define MX3x_AIPS1_BASE_ADDR 0x43f00000
62#define AIPS1_BASE_ADDR_VIRT 0xFC000000 47#define MX3x_AIPS1_BASE_ADDR_VIRT 0xfc000000
63#define AIPS1_SIZE SZ_1M 48#define MX3x_AIPS1_SIZE SZ_1M
64 49#define MX3x_MAX_BASE_ADDR (MX3x_AIPS1_BASE_ADDR + 0x04000)
65#define MAX_BASE_ADDR (AIPS1_BASE_ADDR + 0x00004000) 50#define MX3x_EVTMON_BASE_ADDR (MX3x_AIPS1_BASE_ADDR + 0x08000)
66#define EVTMON_BASE_ADDR (AIPS1_BASE_ADDR + 0x00008000) 51#define MX3x_CLKCTL_BASE_ADDR (MX3x_AIPS1_BASE_ADDR + 0x0c000)
67#define CLKCTL_BASE_ADDR (AIPS1_BASE_ADDR + 0x0000C000) 52#define MX3x_ETB_SLOT4_BASE_ADDR (MX3x_AIPS1_BASE_ADDR + 0x10000)
68#define ETB_SLOT4_BASE_ADDR (AIPS1_BASE_ADDR + 0x00010000) 53#define MX3x_ETB_SLOT5_BASE_ADDR (MX3x_AIPS1_BASE_ADDR + 0x14000)
69#define ETB_SLOT5_BASE_ADDR (AIPS1_BASE_ADDR + 0x00014000) 54#define MX3x_ECT_CTIO_BASE_ADDR (MX3x_AIPS1_BASE_ADDR + 0x18000)
70#define ECT_CTIO_BASE_ADDR (AIPS1_BASE_ADDR + 0x00018000) 55#define MX3x_I2C_BASE_ADDR (MX3x_AIPS1_BASE_ADDR + 0x80000)
71#define I2C_BASE_ADDR (AIPS1_BASE_ADDR + 0x00080000) 56#define MX3x_I2C3_BASE_ADDR (MX3x_AIPS1_BASE_ADDR + 0x84000)
72#define I2C3_BASE_ADDR (AIPS1_BASE_ADDR + 0x00084000) 57#define MX3x_UART1_BASE_ADDR (MX3x_AIPS1_BASE_ADDR + 0x90000)
73#define UART1_BASE_ADDR (AIPS1_BASE_ADDR + 0x00090000) 58#define MX3x_UART2_BASE_ADDR (MX3x_AIPS1_BASE_ADDR + 0x94000)
74#define UART2_BASE_ADDR (AIPS1_BASE_ADDR + 0x00094000) 59#define MX3x_I2C2_BASE_ADDR (MX3x_AIPS1_BASE_ADDR + 0x98000)
75#define I2C2_BASE_ADDR (AIPS1_BASE_ADDR + 0x00098000) 60#define MX3x_OWIRE_BASE_ADDR (MX3x_AIPS1_BASE_ADDR + 0x9c000)
76#define OWIRE_BASE_ADDR (AIPS1_BASE_ADDR + 0x0009C000) 61#define MX3x_SSI1_BASE_ADDR (MX3x_AIPS1_BASE_ADDR + 0xa0000)
77#define SSI1_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A0000) 62#define MX3x_CSPI1_BASE_ADDR (MX3x_AIPS1_BASE_ADDR + 0xa4000)
78#define CSPI1_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A4000) 63#define MX3x_KPP_BASE_ADDR (MX3x_AIPS1_BASE_ADDR + 0xa8000)
79#define KPP_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A8000) 64#define MX3x_IOMUXC_BASE_ADDR (MX3x_AIPS1_BASE_ADDR + 0xac000)
80#define IOMUXC_BASE_ADDR (AIPS1_BASE_ADDR + 0x000AC000) 65#define MX3x_ECT_IP1_BASE_ADDR (MX3x_AIPS1_BASE_ADDR + 0xb8000)
81#define ECT_IP1_BASE_ADDR (AIPS1_BASE_ADDR + 0x000B8000) 66#define MX3x_ECT_IP2_BASE_ADDR (MX3x_AIPS1_BASE_ADDR + 0xbc000)
82#define ECT_IP2_BASE_ADDR (AIPS1_BASE_ADDR + 0x000BC000)
83 67
84/* 68/*
85 * SPBA global module enabled #0 69 * SPBA global module enabled #0
86 */ 70 */
87#define SPBA0_BASE_ADDR 0x50000000 71#define MX3x_SPBA0_BASE_ADDR 0x50000000
88#define SPBA0_BASE_ADDR_VIRT 0xFC100000 72#define MX3x_SPBA0_BASE_ADDR_VIRT 0xfc100000
89#define SPBA0_SIZE SZ_1M 73#define MX3x_SPBA0_SIZE SZ_1M
90 74#define MX3x_UART3_BASE_ADDR (MX3x_SPBA0_BASE_ADDR + 0x0c000)
91#define UART3_BASE_ADDR (SPBA0_BASE_ADDR + 0x0000C000) 75#define MX3x_CSPI2_BASE_ADDR (MX3x_SPBA0_BASE_ADDR + 0x10000)
92#define CSPI2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00010000) 76#define MX3x_SSI2_BASE_ADDR (MX3x_SPBA0_BASE_ADDR + 0x14000)
93#define SSI2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00014000) 77#define MX3x_ATA_DMA_BASE_ADDR (MX3x_SPBA0_BASE_ADDR + 0x20000)
94#define ATA_DMA_BASE_ADDR (SPBA0_BASE_ADDR + 0x00020000) 78#define MX3x_MSHC1_BASE_ADDR (MX3x_SPBA0_BASE_ADDR + 0x24000)
95#define MSHC1_BASE_ADDR (SPBA0_BASE_ADDR + 0x00024000) 79#define MX3x_SPBA_CTRL_BASE_ADDR (MX3x_SPBA0_BASE_ADDR + 0x3c000)
96#define SPBA_CTRL_BASE_ADDR (SPBA0_BASE_ADDR + 0x0003C000)
97 80
98/* 81/*
99 * AIPS 2 82 * AIPS 2
100 */ 83 */
101#define AIPS2_BASE_ADDR 0x53F00000 84#define MX3x_AIPS2_BASE_ADDR 0x53f00000
102#define AIPS2_BASE_ADDR_VIRT 0xFC200000 85#define MX3x_AIPS2_BASE_ADDR_VIRT 0xfc200000
103#define AIPS2_SIZE SZ_1M 86#define MX3x_AIPS2_SIZE SZ_1M
104#define CCM_BASE_ADDR (AIPS2_BASE_ADDR + 0x00080000) 87#define MX3x_CCM_BASE_ADDR (MX3x_AIPS2_BASE_ADDR + 0x80000)
105#define GPT1_BASE_ADDR (AIPS2_BASE_ADDR + 0x00090000) 88#define MX3x_GPT1_BASE_ADDR (MX3x_AIPS2_BASE_ADDR + 0x90000)
106#define EPIT1_BASE_ADDR (AIPS2_BASE_ADDR + 0x00094000) 89#define MX3x_EPIT1_BASE_ADDR (MX3x_AIPS2_BASE_ADDR + 0x94000)
107#define EPIT2_BASE_ADDR (AIPS2_BASE_ADDR + 0x00098000) 90#define MX3x_EPIT2_BASE_ADDR (MX3x_AIPS2_BASE_ADDR + 0x98000)
108#define GPIO3_BASE_ADDR (AIPS2_BASE_ADDR + 0x000A4000) 91#define MX3x_GPIO3_BASE_ADDR (MX3x_AIPS2_BASE_ADDR + 0xa4000)
109#define SCC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000AC000) 92#define MX3x_SCC_BASE_ADDR (MX3x_AIPS2_BASE_ADDR + 0xac000)
110#define RNGA_BASE_ADDR (AIPS2_BASE_ADDR + 0x000B0000) 93#define MX3x_RNGA_BASE_ADDR (MX3x_AIPS2_BASE_ADDR + 0xb0000)
111#define IPU_CTRL_BASE_ADDR (AIPS2_BASE_ADDR + 0x000C0000) 94#define MX3x_IPU_CTRL_BASE_ADDR (MX3x_AIPS2_BASE_ADDR + 0xc0000)
112#define AUDMUX_BASE_ADDR (AIPS2_BASE_ADDR + 0x000C4000) 95#define MX3x_AUDMUX_BASE_ADDR (MX3x_AIPS2_BASE_ADDR + 0xc4000)
113#define GPIO1_BASE_ADDR (AIPS2_BASE_ADDR + 0x000CC000) 96#define MX3x_GPIO1_BASE_ADDR (MX3x_AIPS2_BASE_ADDR + 0xcc000)
114#define GPIO2_BASE_ADDR (AIPS2_BASE_ADDR + 0x000D0000) 97#define MX3x_GPIO2_BASE_ADDR (MX3x_AIPS2_BASE_ADDR + 0xd0000)
115#define SDMA_BASE_ADDR (AIPS2_BASE_ADDR + 0x000D4000) 98#define MX3x_SDMA_BASE_ADDR (MX3x_AIPS2_BASE_ADDR + 0xd4000)
116#define RTC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000D8000) 99#define MX3x_RTC_BASE_ADDR (MX3x_AIPS2_BASE_ADDR + 0xd8000)
117#define WDOG_BASE_ADDR (AIPS2_BASE_ADDR + 0x000DC000) 100#define MX3x_WDOG_BASE_ADDR (MX3x_AIPS2_BASE_ADDR + 0xdc000)
118#define PWM_BASE_ADDR (AIPS2_BASE_ADDR + 0x000E0000) 101#define MX3x_PWM_BASE_ADDR (MX3x_AIPS2_BASE_ADDR + 0xe0000)
119#define RTIC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000EC000) 102#define MX3x_RTIC_BASE_ADDR (MX3x_AIPS2_BASE_ADDR + 0xec000)
120 103
121/* 104/*
122 * ROMP and AVIC 105 * ROMP and AVIC
123 */ 106 */
124#define ROMP_BASE_ADDR 0x60000000 107#define MX3x_ROMP_BASE_ADDR 0x60000000
125#define ROMP_BASE_ADDR_VIRT 0xFC500000 108#define MX3x_ROMP_BASE_ADDR_VIRT 0xfc500000
126#define ROMP_SIZE SZ_1M 109#define MX3x_ROMP_SIZE SZ_1M
127 110
128#define AVIC_BASE_ADDR 0x68000000 111#define MX3x_AVIC_BASE_ADDR 0x68000000
129#define AVIC_BASE_ADDR_VIRT 0xFC400000 112#define MX3x_AVIC_BASE_ADDR_VIRT 0xfc400000
130#define AVIC_SIZE SZ_1M 113#define MX3x_AVIC_SIZE SZ_1M
131 114
132/* 115/*
133 * NAND, SDRAM, WEIM, M3IF, EMI controllers 116 * Memory regions and CS
134 */ 117 */
135#define X_MEMC_BASE_ADDR 0xB8000000 118#define MX3x_IPU_MEM_BASE_ADDR 0x70000000
136#define X_MEMC_BASE_ADDR_VIRT 0xFC320000 119#define MX3x_CSD0_BASE_ADDR 0x80000000
137#define X_MEMC_SIZE SZ_64K 120#define MX3x_CSD1_BASE_ADDR 0x90000000
138 121
139#define ESDCTL_BASE_ADDR (X_MEMC_BASE_ADDR + 0x1000) 122#define MX3x_CS0_BASE_ADDR 0xa0000000
140#define WEIM_BASE_ADDR (X_MEMC_BASE_ADDR + 0x2000) 123#define MX3x_CS1_BASE_ADDR 0xa8000000
141#define M3IF_BASE_ADDR (X_MEMC_BASE_ADDR + 0x3000) 124#define MX3x_CS2_BASE_ADDR 0xb0000000
142#define EMI_CTL_BASE_ADDR (X_MEMC_BASE_ADDR + 0x4000) 125#define MX3x_CS3_BASE_ADDR 0xb2000000
143#define PCMCIA_CTL_BASE_ADDR EMI_CTL_BASE_ADDR 126
127#define MX3x_CS4_BASE_ADDR 0xb4000000
128#define MX3x_CS4_BASE_ADDR_VIRT 0xf4000000
129#define MX3x_CS4_SIZE SZ_32M
130
131#define MX3x_CS5_BASE_ADDR 0xb6000000
132#define MX3x_CS5_BASE_ADDR_VIRT 0xf6000000
133#define MX3x_CS5_SIZE SZ_32M
144 134
145/* 135/*
146 * Memory regions and CS 136 * NAND, SDRAM, WEIM, M3IF, EMI controllers
147 */ 137 */
148#define IPU_MEM_BASE_ADDR 0x70000000 138#define MX3x_X_MEMC_BASE_ADDR 0xb8000000
149#define CSD0_BASE_ADDR 0x80000000 139#define MX3x_X_MEMC_BASE_ADDR_VIRT 0xfc320000
150#define CSD1_BASE_ADDR 0x90000000 140#define MX3x_X_MEMC_SIZE SZ_64K
141#define MX3x_ESDCTL_BASE_ADDR (MX3x_X_MEMC_BASE_ADDR + 0x1000)
142#define MX3x_WEIM_BASE_ADDR (MX3x_X_MEMC_BASE_ADDR + 0x2000)
143#define MX3x_M3IF_BASE_ADDR (MX3x_X_MEMC_BASE_ADDR + 0x3000)
144#define MX3x_EMI_CTL_BASE_ADDR (MX3x_X_MEMC_BASE_ADDR + 0x4000)
145#define MX3x_PCMCIA_CTL_BASE_ADDR MX3x_EMI_CTL_BASE_ADDR
146
147#define MX3x_PCMCIA_MEM_BASE_ADDR 0xbc000000
151 148
152/*! 149/*!
153 * This macro defines the physical to virtual address mapping for all the 150 * This macro defines the physical to virtual address mapping for all the
@@ -202,74 +199,207 @@
202/* 199/*
203 * Interrupt numbers 200 * Interrupt numbers
204 */ 201 */
205#define MXC_INT_I2C3 3 202#define MX3x_INT_I2C3 3
206#define MXC_INT_I2C2 4 203#define MX3x_INT_I2C2 4
207#define MXC_INT_RTIC 6 204#define MX3x_INT_RTIC 6
208#define MXC_INT_I2C 10 205#define MX3x_INT_I2C 10
209#define MXC_INT_CSPI2 13 206#define MX3x_INT_CSPI2 13
210#define MXC_INT_CSPI1 14 207#define MX3x_INT_CSPI1 14
211#define MXC_INT_ATA 15 208#define MX3x_INT_ATA 15
212#define MXC_INT_UART3 18 209#define MX3x_INT_UART3 18
213#define MXC_INT_IIM 19 210#define MX3x_INT_IIM 19
214#define MXC_INT_RNGA 22 211#define MX3x_INT_RNGA 22
215#define MXC_INT_EVTMON 23 212#define MX3x_INT_EVTMON 23
216#define MXC_INT_KPP 24 213#define MX3x_INT_KPP 24
217#define MXC_INT_RTC 25 214#define MX3x_INT_RTC 25
218#define MXC_INT_PWM 26 215#define MX3x_INT_PWM 26
219#define MXC_INT_EPIT2 27 216#define MX3x_INT_EPIT2 27
220#define MXC_INT_EPIT1 28 217#define MX3x_INT_EPIT1 28
221#define MXC_INT_GPT 29 218#define MX3x_INT_GPT 29
222#define MXC_INT_POWER_FAIL 30 219#define MX3x_INT_POWER_FAIL 30
223#define MXC_INT_UART2 32 220#define MX3x_INT_UART2 32
224#define MXC_INT_NANDFC 33 221#define MX3x_INT_NANDFC 33
225#define MXC_INT_SDMA 34 222#define MX3x_INT_SDMA 34
226#define MXC_INT_MSHC1 39 223#define MX3x_INT_MSHC1 39
227#define MXC_INT_IPU_ERR 41 224#define MX3x_INT_IPU_ERR 41
228#define MXC_INT_IPU_SYN 42 225#define MX3x_INT_IPU_SYN 42
229#define MXC_INT_UART1 45 226#define MX3x_INT_UART1 45
230#define MXC_INT_ECT 48 227#define MX3x_INT_ECT 48
231#define MXC_INT_SCC_SCM 49 228#define MX3x_INT_SCC_SCM 49
232#define MXC_INT_SCC_SMN 50 229#define MX3x_INT_SCC_SMN 50
233#define MXC_INT_GPIO2 51 230#define MX3x_INT_GPIO2 51
234#define MXC_INT_GPIO1 52 231#define MX3x_INT_GPIO1 52
235#define MXC_INT_WDOG 55 232#define MX3x_INT_WDOG 55
236#define MXC_INT_GPIO3 56 233#define MX3x_INT_GPIO3 56
237#define MXC_INT_EXT_POWER 58 234#define MX3x_INT_EXT_POWER 58
238#define MXC_INT_EXT_TEMPER 59 235#define MX3x_INT_EXT_TEMPER 59
239#define MXC_INT_EXT_SENSOR60 60 236#define MX3x_INT_EXT_SENSOR60 60
240#define MXC_INT_EXT_SENSOR61 61 237#define MX3x_INT_EXT_SENSOR61 61
241#define MXC_INT_EXT_WDOG 62 238#define MX3x_INT_EXT_WDOG 62
242#define MXC_INT_EXT_TV 63 239#define MX3x_INT_EXT_TV 63
243 240
244#define PROD_SIGNATURE 0x1 /* For MX31 */ 241#define MX3x_PROD_SIGNATURE 0x1 /* For MX31 */
245 242
246/* silicon revisions specific to i.MX31 */ 243/* silicon revisions specific to i.MX31 */
247#define CHIP_REV_1_0 0x10 244#define MX3x_CHIP_REV_1_0 0x10
248#define CHIP_REV_1_1 0x11 245#define MX3x_CHIP_REV_1_1 0x11
249#define CHIP_REV_1_2 0x12 246#define MX3x_CHIP_REV_1_2 0x12
250#define CHIP_REV_1_3 0x13 247#define MX3x_CHIP_REV_1_3 0x13
251#define CHIP_REV_2_0 0x20 248#define MX3x_CHIP_REV_2_0 0x20
252#define CHIP_REV_2_1 0x21 249#define MX3x_CHIP_REV_2_1 0x21
253#define CHIP_REV_2_2 0x22 250#define MX3x_CHIP_REV_2_2 0x22
254#define CHIP_REV_2_3 0x23 251#define MX3x_CHIP_REV_2_3 0x23
255#define CHIP_REV_3_0 0x30 252#define MX3x_CHIP_REV_3_0 0x30
256#define CHIP_REV_3_1 0x31 253#define MX3x_CHIP_REV_3_1 0x31
257#define CHIP_REV_3_2 0x32 254#define MX3x_CHIP_REV_3_2 0x32
258 255
259#define SYSTEM_REV_MIN CHIP_REV_1_0 256#define MX3x_SYSTEM_REV_MIN MX3x_CHIP_REV_1_0
260#define SYSTEM_REV_NUM 3 257#define MX3x_SYSTEM_REV_NUM 3
261 258
262/* Mandatory defines used globally */ 259/* Mandatory defines used globally */
263 260
264#if !defined(__ASSEMBLY__) && !defined(__MXC_BOOT_UNCOMPRESS) 261#if !defined(__ASSEMBLY__) && !defined(__MXC_BOOT_UNCOMPRESS)
265 262
266extern unsigned int system_rev; 263extern unsigned int mx31_cpu_rev;
264extern void mx31_read_cpu_rev(void);
267 265
268static inline int mx31_revision(void) 266static inline int mx31_revision(void)
269{ 267{
270 return system_rev; 268 return mx31_cpu_rev;
271} 269}
272#endif 270#endif
273 271
274#endif /* __ASM_ARCH_MXC_MX31_H__ */ 272/* these should go away */
273#define L2CC_BASE_ADDR MX3x_L2CC_BASE_ADDR
274#define L2CC_SIZE MX3x_L2CC_SIZE
275#define AIPS1_BASE_ADDR MX3x_AIPS1_BASE_ADDR
276#define AIPS1_BASE_ADDR_VIRT MX3x_AIPS1_BASE_ADDR_VIRT
277#define AIPS1_SIZE MX3x_AIPS1_SIZE
278#define MAX_BASE_ADDR MX3x_MAX_BASE_ADDR
279#define EVTMON_BASE_ADDR MX3x_EVTMON_BASE_ADDR
280#define CLKCTL_BASE_ADDR MX3x_CLKCTL_BASE_ADDR
281#define ETB_SLOT4_BASE_ADDR MX3x_ETB_SLOT4_BASE_ADDR
282#define ETB_SLOT5_BASE_ADDR MX3x_ETB_SLOT5_BASE_ADDR
283#define ECT_CTIO_BASE_ADDR MX3x_ECT_CTIO_BASE_ADDR
284#define I2C_BASE_ADDR MX3x_I2C_BASE_ADDR
285#define I2C3_BASE_ADDR MX3x_I2C3_BASE_ADDR
286#define UART1_BASE_ADDR MX3x_UART1_BASE_ADDR
287#define UART2_BASE_ADDR MX3x_UART2_BASE_ADDR
288#define I2C2_BASE_ADDR MX3x_I2C2_BASE_ADDR
289#define OWIRE_BASE_ADDR MX3x_OWIRE_BASE_ADDR
290#define SSI1_BASE_ADDR MX3x_SSI1_BASE_ADDR
291#define CSPI1_BASE_ADDR MX3x_CSPI1_BASE_ADDR
292#define KPP_BASE_ADDR MX3x_KPP_BASE_ADDR
293#define IOMUXC_BASE_ADDR MX3x_IOMUXC_BASE_ADDR
294#define ECT_IP1_BASE_ADDR MX3x_ECT_IP1_BASE_ADDR
295#define ECT_IP2_BASE_ADDR MX3x_ECT_IP2_BASE_ADDR
296#define SPBA0_BASE_ADDR MX3x_SPBA0_BASE_ADDR
297#define SPBA0_BASE_ADDR_VIRT MX3x_SPBA0_BASE_ADDR_VIRT
298#define SPBA0_SIZE MX3x_SPBA0_SIZE
299#define UART3_BASE_ADDR MX3x_UART3_BASE_ADDR
300#define CSPI2_BASE_ADDR MX3x_CSPI2_BASE_ADDR
301#define SSI2_BASE_ADDR MX3x_SSI2_BASE_ADDR
302#define ATA_DMA_BASE_ADDR MX3x_ATA_DMA_BASE_ADDR
303#define MSHC1_BASE_ADDR MX3x_MSHC1_BASE_ADDR
304#define SPBA_CTRL_BASE_ADDR MX3x_SPBA_CTRL_BASE_ADDR
305#define AIPS2_BASE_ADDR MX3x_AIPS2_BASE_ADDR
306#define AIPS2_BASE_ADDR_VIRT MX3x_AIPS2_BASE_ADDR_VIRT
307#define AIPS2_SIZE MX3x_AIPS2_SIZE
308#define CCM_BASE_ADDR MX3x_CCM_BASE_ADDR
309#define GPT1_BASE_ADDR MX3x_GPT1_BASE_ADDR
310#define EPIT1_BASE_ADDR MX3x_EPIT1_BASE_ADDR
311#define EPIT2_BASE_ADDR MX3x_EPIT2_BASE_ADDR
312#define GPIO3_BASE_ADDR MX3x_GPIO3_BASE_ADDR
313#define SCC_BASE_ADDR MX3x_SCC_BASE_ADDR
314#define RNGA_BASE_ADDR MX3x_RNGA_BASE_ADDR
315#define IPU_CTRL_BASE_ADDR MX3x_IPU_CTRL_BASE_ADDR
316#define AUDMUX_BASE_ADDR MX3x_AUDMUX_BASE_ADDR
317#define GPIO1_BASE_ADDR MX3x_GPIO1_BASE_ADDR
318#define GPIO2_BASE_ADDR MX3x_GPIO2_BASE_ADDR
319#define SDMA_BASE_ADDR MX3x_SDMA_BASE_ADDR
320#define RTC_BASE_ADDR MX3x_RTC_BASE_ADDR
321#define WDOG_BASE_ADDR MX3x_WDOG_BASE_ADDR
322#define PWM_BASE_ADDR MX3x_PWM_BASE_ADDR
323#define RTIC_BASE_ADDR MX3x_RTIC_BASE_ADDR
324#define ROMP_BASE_ADDR MX3x_ROMP_BASE_ADDR
325#define ROMP_BASE_ADDR_VIRT MX3x_ROMP_BASE_ADDR_VIRT
326#define ROMP_SIZE MX3x_ROMP_SIZE
327#define AVIC_BASE_ADDR MX3x_AVIC_BASE_ADDR
328#define AVIC_BASE_ADDR_VIRT MX3x_AVIC_BASE_ADDR_VIRT
329#define AVIC_SIZE MX3x_AVIC_SIZE
330#define IPU_MEM_BASE_ADDR MX3x_IPU_MEM_BASE_ADDR
331#define CSD0_BASE_ADDR MX3x_CSD0_BASE_ADDR
332#define CSD1_BASE_ADDR MX3x_CSD1_BASE_ADDR
333#define CS0_BASE_ADDR MX3x_CS0_BASE_ADDR
334#define CS1_BASE_ADDR MX3x_CS1_BASE_ADDR
335#define CS2_BASE_ADDR MX3x_CS2_BASE_ADDR
336#define CS3_BASE_ADDR MX3x_CS3_BASE_ADDR
337#define CS4_BASE_ADDR MX3x_CS4_BASE_ADDR
338#define CS4_BASE_ADDR_VIRT MX3x_CS4_BASE_ADDR_VIRT
339#define CS4_SIZE MX3x_CS4_SIZE
340#define CS5_BASE_ADDR MX3x_CS5_BASE_ADDR
341#define CS5_BASE_ADDR_VIRT MX3x_CS5_BASE_ADDR_VIRT
342#define CS5_SIZE MX3x_CS5_SIZE
343#define X_MEMC_BASE_ADDR MX3x_X_MEMC_BASE_ADDR
344#define X_MEMC_BASE_ADDR_VIRT MX3x_X_MEMC_BASE_ADDR_VIRT
345#define X_MEMC_SIZE MX3x_X_MEMC_SIZE
346#define ESDCTL_BASE_ADDR MX3x_ESDCTL_BASE_ADDR
347#define WEIM_BASE_ADDR MX3x_WEIM_BASE_ADDR
348#define M3IF_BASE_ADDR MX3x_M3IF_BASE_ADDR
349#define EMI_CTL_BASE_ADDR MX3x_EMI_CTL_BASE_ADDR
350#define PCMCIA_CTL_BASE_ADDR MX3x_PCMCIA_CTL_BASE_ADDR
351#define PCMCIA_MEM_BASE_ADDR MX3x_PCMCIA_MEM_BASE_ADDR
352#define MXC_INT_I2C3 MX3x_INT_I2C3
353#define MXC_INT_I2C2 MX3x_INT_I2C2
354#define MXC_INT_RTIC MX3x_INT_RTIC
355#define MXC_INT_I2C MX3x_INT_I2C
356#define MXC_INT_CSPI2 MX3x_INT_CSPI2
357#define MXC_INT_CSPI1 MX3x_INT_CSPI1
358#define MXC_INT_ATA MX3x_INT_ATA
359#define MXC_INT_UART3 MX3x_INT_UART3
360#define MXC_INT_IIM MX3x_INT_IIM
361#define MXC_INT_RNGA MX3x_INT_RNGA
362#define MXC_INT_EVTMON MX3x_INT_EVTMON
363#define MXC_INT_KPP MX3x_INT_KPP
364#define MXC_INT_RTC MX3x_INT_RTC
365#define MXC_INT_PWM MX3x_INT_PWM
366#define MXC_INT_EPIT2 MX3x_INT_EPIT2
367#define MXC_INT_EPIT1 MX3x_INT_EPIT1
368#define MXC_INT_GPT MX3x_INT_GPT
369#define MXC_INT_POWER_FAIL MX3x_INT_POWER_FAIL
370#define MXC_INT_UART2 MX3x_INT_UART2
371#define MXC_INT_NANDFC MX3x_INT_NANDFC
372#define MXC_INT_SDMA MX3x_INT_SDMA
373#define MXC_INT_MSHC1 MX3x_INT_MSHC1
374#define MXC_INT_IPU_ERR MX3x_INT_IPU_ERR
375#define MXC_INT_IPU_SYN MX3x_INT_IPU_SYN
376#define MXC_INT_UART1 MX3x_INT_UART1
377#define MXC_INT_ECT MX3x_INT_ECT
378#define MXC_INT_SCC_SCM MX3x_INT_SCC_SCM
379#define MXC_INT_SCC_SMN MX3x_INT_SCC_SMN
380#define MXC_INT_GPIO2 MX3x_INT_GPIO2
381#define MXC_INT_GPIO1 MX3x_INT_GPIO1
382#define MXC_INT_WDOG MX3x_INT_WDOG
383#define MXC_INT_GPIO3 MX3x_INT_GPIO3
384#define MXC_INT_EXT_POWER MX3x_INT_EXT_POWER
385#define MXC_INT_EXT_TEMPER MX3x_INT_EXT_TEMPER
386#define MXC_INT_EXT_SENSOR60 MX3x_INT_EXT_SENSOR60
387#define MXC_INT_EXT_SENSOR61 MX3x_INT_EXT_SENSOR61
388#define MXC_INT_EXT_WDOG MX3x_INT_EXT_WDOG
389#define MXC_INT_EXT_TV MX3x_INT_EXT_TV
390#define PROD_SIGNATURE MX3x_PROD_SIGNATURE
391#define CHIP_REV_1_0 MX3x_CHIP_REV_1_0
392#define CHIP_REV_1_1 MX3x_CHIP_REV_1_1
393#define CHIP_REV_1_2 MX3x_CHIP_REV_1_2
394#define CHIP_REV_1_3 MX3x_CHIP_REV_1_3
395#define CHIP_REV_2_0 MX3x_CHIP_REV_2_0
396#define CHIP_REV_2_1 MX3x_CHIP_REV_2_1
397#define CHIP_REV_2_2 MX3x_CHIP_REV_2_2
398#define CHIP_REV_2_3 MX3x_CHIP_REV_2_3
399#define CHIP_REV_3_0 MX3x_CHIP_REV_3_0
400#define CHIP_REV_3_1 MX3x_CHIP_REV_3_1
401#define CHIP_REV_3_2 MX3x_CHIP_REV_3_2
402#define SYSTEM_REV_MIN MX3x_SYSTEM_REV_MIN
403#define SYSTEM_REV_NUM MX3x_SYSTEM_REV_NUM
275 404
405#endif /* __ASM_ARCH_MXC_MX31_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/ulpi.h b/arch/arm/plat-mxc/include/mach/ulpi.h
new file mode 100644
index 000000000000..96b6ab4c40c3
--- /dev/null
+++ b/arch/arm/plat-mxc/include/mach/ulpi.h
@@ -0,0 +1,7 @@
1#ifndef __MACH_ULPI_H
2#define __MACH_ULPI_H
3
4extern struct otg_io_access_ops mxc_ulpi_access_ops;
5
6#endif /* __MACH_ULPI_H */
7
diff --git a/arch/arm/plat-mxc/include/mach/uncompress.h b/arch/arm/plat-mxc/include/mach/uncompress.h
index 082a3908256b..4d5d395ad63b 100644
--- a/arch/arm/plat-mxc/include/mach/uncompress.h
+++ b/arch/arm/plat-mxc/include/mach/uncompress.h
@@ -83,6 +83,8 @@ static __inline__ void __arch_decomp_setup(unsigned long arch_id)
83 case MACH_TYPE_MX27ADS: 83 case MACH_TYPE_MX27ADS:
84 case MACH_TYPE_PCM038: 84 case MACH_TYPE_PCM038:
85 case MACH_TYPE_MX21ADS: 85 case MACH_TYPE_MX21ADS:
86 case MACH_TYPE_PCA100:
87 case MACH_TYPE_MXT_TD60:
86 uart_base = MX2X_UART1_BASE_ADDR; 88 uart_base = MX2X_UART1_BASE_ADDR;
87 break; 89 break;
88 case MACH_TYPE_MX31LITE: 90 case MACH_TYPE_MX31LITE:
@@ -94,6 +96,7 @@ static __inline__ void __arch_decomp_setup(unsigned long arch_id)
94 case MACH_TYPE_MX31ADS: 96 case MACH_TYPE_MX31ADS:
95 case MACH_TYPE_MX35_3DS: 97 case MACH_TYPE_MX35_3DS:
96 case MACH_TYPE_PCM043: 98 case MACH_TYPE_PCM043:
99 case MACH_TYPE_LILLY1131:
97 uart_base = MX3X_UART1_BASE_ADDR; 100 uart_base = MX3X_UART1_BASE_ADDR;
98 break; 101 break;
99 case MACH_TYPE_MAGX_ZN5: 102 case MACH_TYPE_MAGX_ZN5:
diff --git a/arch/arm/plat-mxc/iomux-v3.c b/arch/arm/plat-mxc/iomux-v3.c
index 851ca99bf1b1..b318c6a222d5 100644
--- a/arch/arm/plat-mxc/iomux-v3.c
+++ b/arch/arm/plat-mxc/iomux-v3.c
@@ -31,19 +31,11 @@
31 31
32static void __iomem *base; 32static void __iomem *base;
33 33
34static unsigned long iomux_v3_pad_alloc_map[0x200 / BITS_PER_LONG];
35
36/* 34/*
37 * setups a single pin: 35 * setups a single pad in the iomuxer
38 * - reserves the pin so that it is not claimed by another driver
39 * - setups the iomux according to the configuration
40 */ 36 */
41int mxc_iomux_v3_setup_pad(struct pad_desc *pad) 37int mxc_iomux_v3_setup_pad(struct pad_desc *pad)
42{ 38{
43 unsigned int pad_ofs = pad->pad_ctrl_ofs;
44
45 if (test_and_set_bit(pad_ofs >> 2, iomux_v3_pad_alloc_map))
46 return -EBUSY;
47 if (pad->mux_ctrl_ofs) 39 if (pad->mux_ctrl_ofs)
48 __raw_writel(pad->mux_mode, base + pad->mux_ctrl_ofs); 40 __raw_writel(pad->mux_mode, base + pad->mux_ctrl_ofs);
49 41
@@ -66,37 +58,13 @@ int mxc_iomux_v3_setup_multiple_pads(struct pad_desc *pad_list, unsigned count)
66 for (i = 0; i < count; i++) { 58 for (i = 0; i < count; i++) {
67 ret = mxc_iomux_v3_setup_pad(p); 59 ret = mxc_iomux_v3_setup_pad(p);
68 if (ret) 60 if (ret)
69 goto setup_error; 61 return ret;
70 p++; 62 p++;
71 } 63 }
72 return 0; 64 return 0;
73
74setup_error:
75 mxc_iomux_v3_release_multiple_pads(pad_list, i);
76 return ret;
77} 65}
78EXPORT_SYMBOL(mxc_iomux_v3_setup_multiple_pads); 66EXPORT_SYMBOL(mxc_iomux_v3_setup_multiple_pads);
79 67
80void mxc_iomux_v3_release_pad(struct pad_desc *pad)
81{
82 unsigned int pad_ofs = pad->pad_ctrl_ofs;
83
84 clear_bit(pad_ofs >> 2, iomux_v3_pad_alloc_map);
85}
86EXPORT_SYMBOL(mxc_iomux_v3_release_pad);
87
88void mxc_iomux_v3_release_multiple_pads(struct pad_desc *pad_list, int count)
89{
90 struct pad_desc *p = pad_list;
91 int i;
92
93 for (i = 0; i < count; i++) {
94 mxc_iomux_v3_release_pad(p);
95 p++;
96 }
97}
98EXPORT_SYMBOL(mxc_iomux_v3_release_multiple_pads);
99
100void mxc_iomux_v3_init(void __iomem *iomux_v3_base) 68void mxc_iomux_v3_init(void __iomem *iomux_v3_base)
101{ 69{
102 base = iomux_v3_base; 70 base = iomux_v3_base;
diff --git a/arch/arm/plat-mxc/ulpi.c b/arch/arm/plat-mxc/ulpi.c
new file mode 100644
index 000000000000..582c6dfaba4a
--- /dev/null
+++ b/arch/arm/plat-mxc/ulpi.c
@@ -0,0 +1,113 @@
1/*
2 * Copyright 2008 Sascha Hauer, Pengutronix <s.hauer@pengutronix.de>
3 * Copyright 2009 Daniel Mack <daniel@caiaq.de>
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17 * MA 02110-1301, USA.
18 */
19
20#include <linux/module.h>
21#include <linux/kernel.h>
22#include <linux/io.h>
23#include <linux/delay.h>
24#include <linux/usb/otg.h>
25
26#include <mach/ulpi.h>
27
28/* ULPIVIEW register bits */
29#define ULPIVW_WU (1 << 31) /* Wakeup */
30#define ULPIVW_RUN (1 << 30) /* read/write run */
31#define ULPIVW_WRITE (1 << 29) /* 0 = read 1 = write */
32#define ULPIVW_SS (1 << 27) /* SyncState */
33#define ULPIVW_PORT_MASK 0x07 /* Port field */
34#define ULPIVW_PORT_SHIFT 24
35#define ULPIVW_ADDR_MASK 0xff /* data address field */
36#define ULPIVW_ADDR_SHIFT 16
37#define ULPIVW_RDATA_MASK 0xff /* read data field */
38#define ULPIVW_RDATA_SHIFT 8
39#define ULPIVW_WDATA_MASK 0xff /* write data field */
40#define ULPIVW_WDATA_SHIFT 0
41
42static int ulpi_poll(void __iomem *view, u32 bit)
43{
44 int timeout = 10000;
45
46 while (timeout--) {
47 u32 data = __raw_readl(view);
48
49 if (!(data & bit))
50 return 0;
51
52 cpu_relax();
53 };
54
55 printk(KERN_WARNING "timeout polling for ULPI device\n");
56
57 return -ETIMEDOUT;
58}
59
60static int ulpi_read(struct otg_transceiver *otg, u32 reg)
61{
62 int ret;
63 void __iomem *view = otg->io_priv;
64
65 /* make sure interface is running */
66 if (!(__raw_readl(view) & ULPIVW_SS)) {
67 __raw_writel(ULPIVW_WU, view);
68
69 /* wait for wakeup */
70 ret = ulpi_poll(view, ULPIVW_WU);
71 if (ret)
72 return ret;
73 }
74
75 /* read the register */
76 __raw_writel((ULPIVW_RUN | (reg << ULPIVW_ADDR_SHIFT)), view);
77
78 /* wait for completion */
79 ret = ulpi_poll(view, ULPIVW_RUN);
80 if (ret)
81 return ret;
82
83 return (__raw_readl(view) >> ULPIVW_RDATA_SHIFT) & ULPIVW_RDATA_MASK;
84}
85
86static int ulpi_write(struct otg_transceiver *otg, u32 val, u32 reg)
87{
88 int ret;
89 void __iomem *view = otg->io_priv;
90
91 /* make sure the interface is running */
92 if (!(__raw_readl(view) & ULPIVW_SS)) {
93 __raw_writel(ULPIVW_WU, view);
94 /* wait for wakeup */
95 ret = ulpi_poll(view, ULPIVW_WU);
96 if (ret)
97 return ret;
98 }
99
100 __raw_writel((ULPIVW_RUN | ULPIVW_WRITE |
101 (reg << ULPIVW_ADDR_SHIFT) |
102 ((val & ULPIVW_WDATA_MASK) << ULPIVW_WDATA_SHIFT)), view);
103
104 /* wait for completion */
105 return ulpi_poll(view, ULPIVW_RUN);
106}
107
108struct otg_io_access_ops mxc_ulpi_access_ops = {
109 .read = ulpi_read,
110 .write = ulpi_write,
111};
112EXPORT_SYMBOL_GPL(mxc_ulpi_access_ops);
113
diff --git a/arch/arm/plat-nomadik/Kconfig b/arch/arm/plat-nomadik/Kconfig
new file mode 100644
index 000000000000..159daf583f85
--- /dev/null
+++ b/arch/arm/plat-nomadik/Kconfig
@@ -0,0 +1,22 @@
1# We keep common IP's here for Nomadik and other similar
2# familiy of processors from ST-Ericsson. At the moment we have
3# just MTU, others to follow soon.
4
5config PLAT_NOMADIK
6 bool
7 depends on ARCH_NOMADIK || ARCH_U8500
8 default y
9 help
10 Common platform code for Nomadik and other ST-Ericsson
11 platforms.
12
13if PLAT_NOMADIK
14
15config HAS_MTU
16 bool
17 help
18 Support for Multi Timer Unit. MTU provides access
19 to multiple interrupt generating programmable
20 32-bit free running decrementing counters.
21
22endif
diff --git a/arch/arm/plat-nomadik/Makefile b/arch/arm/plat-nomadik/Makefile
new file mode 100644
index 000000000000..37c7cdd0f8f0
--- /dev/null
+++ b/arch/arm/plat-nomadik/Makefile
@@ -0,0 +1,5 @@
1# arch/arm/plat-nomadik/Makefile
2# Copyright 2009 ST-Ericsson
3# Licensed under GPLv2
4
5obj-$(CONFIG_HAS_MTU) += timer.o
diff --git a/arch/arm/mach-nomadik/include/mach/mtu.h b/arch/arm/plat-nomadik/include/plat/mtu.h
index 76da7f085330..42c907258b14 100644
--- a/arch/arm/mach-nomadik/include/mach/mtu.h
+++ b/arch/arm/plat-nomadik/include/plat/mtu.h
@@ -1,5 +1,8 @@
1#ifndef __ASM_ARCH_MTU_H 1#ifndef __PLAT_MTU_H
2#define __ASM_ARCH_MTU_H 2#define __PLAT_MTU_H
3
4/* should be set by the platform code */
5extern void __iomem *mtu_base;
3 6
4/* 7/*
5 * The MTU device hosts four different counters, with 4 set of 8 * The MTU device hosts four different counters, with 4 set of
@@ -41,5 +44,5 @@
41#define MTU_PCELL2 0xff8 44#define MTU_PCELL2 0xff8
42#define MTU_PCELL3 0xffC 45#define MTU_PCELL3 0xffC
43 46
44#endif /* __ASM_ARCH_MTU_H */ 47#endif /* __PLAT_MTU_H */
45 48
diff --git a/arch/arm/mach-nomadik/timer.c b/arch/arm/plat-nomadik/timer.c
index d1738e7061d4..62f18ad43a28 100644
--- a/arch/arm/mach-nomadik/timer.c
+++ b/arch/arm/plat-nomadik/timer.c
@@ -15,19 +15,14 @@
15#include <linux/clockchips.h> 15#include <linux/clockchips.h>
16#include <linux/jiffies.h> 16#include <linux/jiffies.h>
17#include <asm/mach/time.h> 17#include <asm/mach/time.h>
18#include <mach/mtu.h>
19 18
20#define TIMER_CTRL 0x80 /* No divisor */ 19#include <plat/mtu.h>
21#define TIMER_PERIODIC 0x40
22#define TIMER_SZ32BIT 0x02
23
24/* Initial value for SRC control register: all timers use MXTAL/8 source */
25#define SRC_CR_INIT_MASK 0x00007fff
26#define SRC_CR_INIT_VAL 0x2aaa8000
27 20
28static u32 nmdk_count; /* accumulated count */ 21static u32 nmdk_count; /* accumulated count */
29static u32 nmdk_cycle; /* write-once */ 22static u32 nmdk_cycle; /* write-once */
30static __iomem void *mtu_base; 23
24/* setup by the platform code */
25void __iomem *mtu_base;
31 26
32/* 27/*
33 * clocksource: the MTU device is a decrementing counters, so we negate 28 * clocksource: the MTU device is a decrementing counters, so we negate
@@ -93,7 +88,7 @@ static struct clock_event_device nmdk_clkevt = {
93static irqreturn_t nmdk_timer_interrupt(int irq, void *dev_id) 88static irqreturn_t nmdk_timer_interrupt(int irq, void *dev_id)
94{ 89{
95 /* ack: "interrupt clear register" */ 90 /* ack: "interrupt clear register" */
96 writel( 1 << 0, mtu_base + MTU_ICR); 91 writel(1 << 0, mtu_base + MTU_ICR);
97 92
98 /* we can't count lost ticks, unfortunately */ 93 /* we can't count lost ticks, unfortunately */
99 nmdk_count += nmdk_cycle; 94 nmdk_count += nmdk_cycle;
@@ -125,24 +120,14 @@ static void nmdk_timer_reset(void)
125 writel(cr | MTU_CRn_ENA, mtu_base + MTU_CR(0)); 120 writel(cr | MTU_CRn_ENA, mtu_base + MTU_CR(0));
126} 121}
127 122
128static void __init nmdk_timer_init(void) 123void __init nmdk_timer_init(void)
129{ 124{
130 u32 src_cr;
131 unsigned long rate; 125 unsigned long rate;
132 int bits; 126 int bits;
133 127
134 rate = CLOCK_TICK_RATE; /* 2.4MHz */ 128 rate = CLOCK_TICK_RATE; /* 2.4MHz */
135 nmdk_cycle = (rate + HZ/2) / HZ; 129 nmdk_cycle = (rate + HZ/2) / HZ;
136 130
137 /* Configure timer sources in "system reset controller" ctrl reg */
138 src_cr = readl(io_p2v(NOMADIK_SRC_BASE));
139 src_cr &= SRC_CR_INIT_MASK;
140 src_cr |= SRC_CR_INIT_VAL;
141 writel(src_cr, io_p2v(NOMADIK_SRC_BASE));
142
143 /* Save global pointer to mtu, used by functions above */
144 mtu_base = io_p2v(NOMADIK_MTU0_BASE);
145
146 /* Init the timer and register clocksource */ 131 /* Init the timer and register clocksource */
147 nmdk_timer_reset(); 132 nmdk_timer_reset();
148 133
@@ -150,7 +135,9 @@ static void __init nmdk_timer_init(void)
150 bits = 8*sizeof(nmdk_count); 135 bits = 8*sizeof(nmdk_count);
151 nmdk_clksrc.mask = CLOCKSOURCE_MASK(bits); 136 nmdk_clksrc.mask = CLOCKSOURCE_MASK(bits);
152 137
153 clocksource_register(&nmdk_clksrc); 138 if (clocksource_register(&nmdk_clksrc))
139 printk(KERN_ERR "timer: failed to initialize clock "
140 "source %s\n", nmdk_clksrc.name);
154 141
155 /* Register irq and clockevents */ 142 /* Register irq and clockevents */
156 setup_irq(IRQ_MTU0, &nmdk_timer_irq); 143 setup_irq(IRQ_MTU0, &nmdk_timer_irq);
@@ -158,7 +145,3 @@ static void __init nmdk_timer_init(void)
158 nmdk_clkevt.cpumask = cpumask_of(0); 145 nmdk_clkevt.cpumask = cpumask_of(0);
159 clockevents_register_device(&nmdk_clkevt); 146 clockevents_register_device(&nmdk_clkevt);
160} 147}
161
162struct sys_timer nomadik_timer = {
163 .init = nmdk_timer_init,
164};
diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig
index 64b3f52bd9b2..f348ddfb0492 100644
--- a/arch/arm/plat-omap/Kconfig
+++ b/arch/arm/plat-omap/Kconfig
@@ -165,7 +165,7 @@ config OMAP_DM_TIMER
165choice 165choice
166 prompt "Low-level debug console UART" 166 prompt "Low-level debug console UART"
167 depends on ARCH_OMAP 167 depends on ARCH_OMAP
168 default OMAP_LL_DEBUG_UART1 168 default OMAP_LL_DEBUG_NONE
169 169
170config OMAP_LL_DEBUG_UART1 170config OMAP_LL_DEBUG_UART1
171 bool "UART1" 171 bool "UART1"
@@ -176,6 +176,9 @@ config OMAP_LL_DEBUG_UART2
176config OMAP_LL_DEBUG_UART3 176config OMAP_LL_DEBUG_UART3
177 bool "UART3" 177 bool "UART3"
178 178
179config OMAP_LL_DEBUG_NONE
180 bool "None"
181
179endchoice 182endchoice
180 183
181config OMAP_SERIAL_WAKE 184config OMAP_SERIAL_WAKE
diff --git a/arch/arm/plat-omap/clock.c b/arch/arm/plat-omap/clock.c
index bf880e966d3b..681bfc37ebb2 100644
--- a/arch/arm/plat-omap/clock.c
+++ b/arch/arm/plat-omap/clock.c
@@ -24,7 +24,7 @@
24#include <linux/debugfs.h> 24#include <linux/debugfs.h>
25#include <linux/io.h> 25#include <linux/io.h>
26 26
27#include <mach/clock.h> 27#include <plat/clock.h>
28 28
29static LIST_HEAD(clocks); 29static LIST_HEAD(clocks);
30static DEFINE_MUTEX(clocks_mutex); 30static DEFINE_MUTEX(clocks_mutex);
diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c
index 3a4768d55895..cc050b3313bd 100644
--- a/arch/arm/plat-omap/common.c
+++ b/arch/arm/plat-omap/common.c
@@ -29,13 +29,13 @@
29#include <asm/mach/map.h> 29#include <asm/mach/map.h>
30#include <asm/setup.h> 30#include <asm/setup.h>
31 31
32#include <mach/common.h> 32#include <plat/common.h>
33#include <mach/board.h> 33#include <plat/board.h>
34#include <mach/control.h> 34#include <plat/control.h>
35#include <mach/mux.h> 35#include <plat/mux.h>
36#include <mach/fpga.h> 36#include <plat/fpga.h>
37 37
38#include <mach/clock.h> 38#include <plat/clock.h>
39 39
40#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) 40#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
41# include "../mach-omap2/sdrc.h" 41# include "../mach-omap2/sdrc.h"
@@ -49,6 +49,9 @@ int omap_bootloader_tag_len;
49struct omap_board_config_kernel *omap_board_config; 49struct omap_board_config_kernel *omap_board_config;
50int omap_board_config_size; 50int omap_board_config_size;
51 51
52/* used by omap-smp.c and board-4430sdp.c */
53void __iomem *gic_cpu_base_addr;
54
52static const void *get_config(u16 tag, size_t len, int skip, size_t *len_out) 55static const void *get_config(u16 tag, size_t len, int skip, size_t *len_out)
53{ 56{
54 struct omap_board_config_kernel *kinfo = NULL; 57 struct omap_board_config_kernel *kinfo = NULL;
@@ -224,12 +227,12 @@ static void __init __omap2_set_globals(struct omap_globals *omap2_globals)
224 227
225static struct omap_globals omap242x_globals = { 228static struct omap_globals omap242x_globals = {
226 .class = OMAP242X_CLASS, 229 .class = OMAP242X_CLASS,
227 .tap = OMAP2_IO_ADDRESS(0x48014000), 230 .tap = OMAP2_L4_IO_ADDRESS(0x48014000),
228 .sdrc = OMAP2_IO_ADDRESS(OMAP2420_SDRC_BASE), 231 .sdrc = OMAP2_L3_IO_ADDRESS(OMAP2420_SDRC_BASE),
229 .sms = OMAP2_IO_ADDRESS(OMAP2420_SMS_BASE), 232 .sms = OMAP2_L3_IO_ADDRESS(OMAP2420_SMS_BASE),
230 .ctrl = OMAP2_IO_ADDRESS(OMAP2420_CTRL_BASE), 233 .ctrl = OMAP2_L4_IO_ADDRESS(OMAP2420_CTRL_BASE),
231 .prm = OMAP2_IO_ADDRESS(OMAP2420_PRM_BASE), 234 .prm = OMAP2_L4_IO_ADDRESS(OMAP2420_PRM_BASE),
232 .cm = OMAP2_IO_ADDRESS(OMAP2420_CM_BASE), 235 .cm = OMAP2_L4_IO_ADDRESS(OMAP2420_CM_BASE),
233}; 236};
234 237
235void __init omap2_set_globals_242x(void) 238void __init omap2_set_globals_242x(void)
@@ -242,12 +245,12 @@ void __init omap2_set_globals_242x(void)
242 245
243static struct omap_globals omap243x_globals = { 246static struct omap_globals omap243x_globals = {
244 .class = OMAP243X_CLASS, 247 .class = OMAP243X_CLASS,
245 .tap = OMAP2_IO_ADDRESS(0x4900a000), 248 .tap = OMAP2_L4_IO_ADDRESS(0x4900a000),
246 .sdrc = OMAP2_IO_ADDRESS(OMAP243X_SDRC_BASE), 249 .sdrc = OMAP2_L3_IO_ADDRESS(OMAP243X_SDRC_BASE),
247 .sms = OMAP2_IO_ADDRESS(OMAP243X_SMS_BASE), 250 .sms = OMAP2_L3_IO_ADDRESS(OMAP243X_SMS_BASE),
248 .ctrl = OMAP2_IO_ADDRESS(OMAP243X_CTRL_BASE), 251 .ctrl = OMAP2_L4_IO_ADDRESS(OMAP243X_CTRL_BASE),
249 .prm = OMAP2_IO_ADDRESS(OMAP2430_PRM_BASE), 252 .prm = OMAP2_L4_IO_ADDRESS(OMAP2430_PRM_BASE),
250 .cm = OMAP2_IO_ADDRESS(OMAP2430_CM_BASE), 253 .cm = OMAP2_L4_IO_ADDRESS(OMAP2430_CM_BASE),
251}; 254};
252 255
253void __init omap2_set_globals_243x(void) 256void __init omap2_set_globals_243x(void)
@@ -260,12 +263,12 @@ void __init omap2_set_globals_243x(void)
260 263
261static struct omap_globals omap343x_globals = { 264static struct omap_globals omap343x_globals = {
262 .class = OMAP343X_CLASS, 265 .class = OMAP343X_CLASS,
263 .tap = OMAP2_IO_ADDRESS(0x4830A000), 266 .tap = OMAP2_L4_IO_ADDRESS(0x4830A000),
264 .sdrc = OMAP2_IO_ADDRESS(OMAP343X_SDRC_BASE), 267 .sdrc = OMAP2_L3_IO_ADDRESS(OMAP343X_SDRC_BASE),
265 .sms = OMAP2_IO_ADDRESS(OMAP343X_SMS_BASE), 268 .sms = OMAP2_L3_IO_ADDRESS(OMAP343X_SMS_BASE),
266 .ctrl = OMAP2_IO_ADDRESS(OMAP343X_CTRL_BASE), 269 .ctrl = OMAP2_L4_IO_ADDRESS(OMAP343X_CTRL_BASE),
267 .prm = OMAP2_IO_ADDRESS(OMAP3430_PRM_BASE), 270 .prm = OMAP2_L4_IO_ADDRESS(OMAP3430_PRM_BASE),
268 .cm = OMAP2_IO_ADDRESS(OMAP3430_CM_BASE), 271 .cm = OMAP2_L4_IO_ADDRESS(OMAP3430_CM_BASE),
269}; 272};
270 273
271void __init omap2_set_globals_343x(void) 274void __init omap2_set_globals_343x(void)
@@ -277,10 +280,10 @@ void __init omap2_set_globals_343x(void)
277#if defined(CONFIG_ARCH_OMAP4) 280#if defined(CONFIG_ARCH_OMAP4)
278static struct omap_globals omap4_globals = { 281static struct omap_globals omap4_globals = {
279 .class = OMAP443X_CLASS, 282 .class = OMAP443X_CLASS,
280 .tap = OMAP2_IO_ADDRESS(0x4830a000), 283 .tap = OMAP2_L4_IO_ADDRESS(0x4830a000),
281 .ctrl = OMAP2_IO_ADDRESS(OMAP443X_CTRL_BASE), 284 .ctrl = OMAP2_L4_IO_ADDRESS(OMAP443X_CTRL_BASE),
282 .prm = OMAP2_IO_ADDRESS(OMAP4430_PRM_BASE), 285 .prm = OMAP2_L4_IO_ADDRESS(OMAP4430_PRM_BASE),
283 .cm = OMAP2_IO_ADDRESS(OMAP4430_CM_BASE), 286 .cm = OMAP2_L4_IO_ADDRESS(OMAP4430_CM_BASE),
284}; 287};
285 288
286void __init omap2_set_globals_443x(void) 289void __init omap2_set_globals_443x(void)
diff --git a/arch/arm/plat-omap/cpu-omap.c b/arch/arm/plat-omap/cpu-omap.c
index 341235c278ac..f8ddbdd8b076 100644
--- a/arch/arm/plat-omap/cpu-omap.c
+++ b/arch/arm/plat-omap/cpu-omap.c
@@ -23,7 +23,7 @@
23#include <linux/io.h> 23#include <linux/io.h>
24 24
25#include <mach/hardware.h> 25#include <mach/hardware.h>
26#include <mach/clock.h> 26#include <plat/clock.h>
27#include <asm/system.h> 27#include <asm/system.h>
28 28
29#define VERY_HI_RATE 900000000 29#define VERY_HI_RATE 900000000
diff --git a/arch/arm/plat-omap/debug-devices.c b/arch/arm/plat-omap/debug-devices.c
index f6684832ca8f..09c1107637f6 100644
--- a/arch/arm/plat-omap/debug-devices.c
+++ b/arch/arm/plat-omap/debug-devices.c
@@ -16,7 +16,7 @@
16 16
17#include <mach/hardware.h> 17#include <mach/hardware.h>
18 18
19#include <mach/board.h> 19#include <plat/board.h>
20#include <mach/gpio.h> 20#include <mach/gpio.h>
21 21
22 22
diff --git a/arch/arm/plat-omap/debug-leds.c b/arch/arm/plat-omap/debug-leds.c
index 9395898dd49a..6c768b71ad64 100644
--- a/arch/arm/plat-omap/debug-leds.c
+++ b/arch/arm/plat-omap/debug-leds.c
@@ -18,7 +18,7 @@
18#include <asm/system.h> 18#include <asm/system.h>
19#include <asm/mach-types.h> 19#include <asm/mach-types.h>
20 20
21#include <mach/fpga.h> 21#include <plat/fpga.h>
22#include <mach/gpio.h> 22#include <mach/gpio.h>
23 23
24 24
diff --git a/arch/arm/plat-omap/devices.c b/arch/arm/plat-omap/devices.c
index a64b692a1bfe..f86617869b38 100644
--- a/arch/arm/plat-omap/devices.c
+++ b/arch/arm/plat-omap/devices.c
@@ -19,15 +19,15 @@
19#include <asm/mach-types.h> 19#include <asm/mach-types.h>
20#include <asm/mach/map.h> 20#include <asm/mach/map.h>
21 21
22#include <mach/tc.h> 22#include <plat/tc.h>
23#include <mach/control.h> 23#include <plat/control.h>
24#include <mach/board.h> 24#include <plat/board.h>
25#include <mach/mmc.h> 25#include <plat/mmc.h>
26#include <mach/mux.h> 26#include <plat/mux.h>
27#include <mach/gpio.h> 27#include <mach/gpio.h>
28#include <mach/menelaus.h> 28#include <plat/menelaus.h>
29#include <mach/mcbsp.h> 29#include <plat/mcbsp.h>
30#include <mach/dsp_common.h> 30#include <plat/dsp_common.h>
31 31
32#if defined(CONFIG_OMAP_DSP) || defined(CONFIG_OMAP_DSP_MODULE) 32#if defined(CONFIG_OMAP_DSP) || defined(CONFIG_OMAP_DSP_MODULE)
33 33
@@ -113,17 +113,17 @@ static void omap_init_kp(void)
113 omap_cfg_reg(E19_1610_KBR4); 113 omap_cfg_reg(E19_1610_KBR4);
114 omap_cfg_reg(N19_1610_KBR5); 114 omap_cfg_reg(N19_1610_KBR5);
115 } else if (machine_is_omap_perseus2() || machine_is_omap_fsample()) { 115 } else if (machine_is_omap_perseus2() || machine_is_omap_fsample()) {
116 omap_cfg_reg(E2_730_KBR0); 116 omap_cfg_reg(E2_7XX_KBR0);
117 omap_cfg_reg(J7_730_KBR1); 117 omap_cfg_reg(J7_7XX_KBR1);
118 omap_cfg_reg(E1_730_KBR2); 118 omap_cfg_reg(E1_7XX_KBR2);
119 omap_cfg_reg(F3_730_KBR3); 119 omap_cfg_reg(F3_7XX_KBR3);
120 omap_cfg_reg(D2_730_KBR4); 120 omap_cfg_reg(D2_7XX_KBR4);
121 121
122 omap_cfg_reg(C2_730_KBC0); 122 omap_cfg_reg(C2_7XX_KBC0);
123 omap_cfg_reg(D3_730_KBC1); 123 omap_cfg_reg(D3_7XX_KBC1);
124 omap_cfg_reg(E4_730_KBC2); 124 omap_cfg_reg(E4_7XX_KBC2);
125 omap_cfg_reg(F4_730_KBC3); 125 omap_cfg_reg(F4_7XX_KBC3);
126 omap_cfg_reg(E3_730_KBC4); 126 omap_cfg_reg(E3_7XX_KBC4);
127 } else if (machine_is_omap_h4()) { 127 } else if (machine_is_omap_h4()) {
128 omap_cfg_reg(T19_24XX_KBR0); 128 omap_cfg_reg(T19_24XX_KBR0);
129 omap_cfg_reg(R19_24XX_KBR1); 129 omap_cfg_reg(R19_24XX_KBR1);
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
index 68eaae324b6a..be4ce070fb4c 100644
--- a/arch/arm/plat-omap/dma.c
+++ b/arch/arm/plat-omap/dma.c
@@ -32,9 +32,9 @@
32 32
33#include <asm/system.h> 33#include <asm/system.h>
34#include <mach/hardware.h> 34#include <mach/hardware.h>
35#include <mach/dma.h> 35#include <plat/dma.h>
36 36
37#include <mach/tc.h> 37#include <plat/tc.h>
38 38
39#undef DEBUG 39#undef DEBUG
40 40
@@ -54,6 +54,12 @@ enum { DMA_CHAIN_STARTED, DMA_CHAIN_NOTSTARTED };
54 54
55static int enable_1510_mode; 55static int enable_1510_mode;
56 56
57static struct omap_dma_global_context_registers {
58 u32 dma_irqenable_l0;
59 u32 dma_ocp_sysconfig;
60 u32 dma_gcr;
61} omap_dma_global_context;
62
57struct omap_dma_lch { 63struct omap_dma_lch {
58 int next_lch; 64 int next_lch;
59 int dev_id; 65 int dev_id;
@@ -2355,44 +2361,83 @@ void omap_stop_lcd_dma(void)
2355} 2361}
2356EXPORT_SYMBOL(omap_stop_lcd_dma); 2362EXPORT_SYMBOL(omap_stop_lcd_dma);
2357 2363
2364void omap_dma_global_context_save(void)
2365{
2366 omap_dma_global_context.dma_irqenable_l0 =
2367 dma_read(IRQENABLE_L0);
2368 omap_dma_global_context.dma_ocp_sysconfig =
2369 dma_read(OCP_SYSCONFIG);
2370 omap_dma_global_context.dma_gcr = dma_read(GCR);
2371}
2372
2373void omap_dma_global_context_restore(void)
2374{
2375 int ch;
2376
2377 dma_write(omap_dma_global_context.dma_gcr, GCR);
2378 dma_write(omap_dma_global_context.dma_ocp_sysconfig,
2379 OCP_SYSCONFIG);
2380 dma_write(omap_dma_global_context.dma_irqenable_l0,
2381 IRQENABLE_L0);
2382
2383 /*
2384 * A bug in ROM code leaves IRQ status for channels 0 and 1 uncleared
2385 * after secure sram context save and restore. Hence we need to
2386 * manually clear those IRQs to avoid spurious interrupts. This
2387 * affects only secure devices.
2388 */
2389 if (cpu_is_omap34xx() && (omap_type() != OMAP2_DEVICE_TYPE_GP))
2390 dma_write(0x3 , IRQSTATUS_L0);
2391
2392 for (ch = 0; ch < dma_chan_count; ch++)
2393 if (dma_chan[ch].dev_id != -1)
2394 omap_clear_dma(ch);
2395}
2396
2358/*----------------------------------------------------------------------------*/ 2397/*----------------------------------------------------------------------------*/
2359 2398
2360static int __init omap_init_dma(void) 2399static int __init omap_init_dma(void)
2361{ 2400{
2401 unsigned long base;
2362 int ch, r; 2402 int ch, r;
2363 2403
2364 if (cpu_class_is_omap1()) { 2404 if (cpu_class_is_omap1()) {
2365 omap_dma_base = OMAP1_IO_ADDRESS(OMAP1_DMA_BASE); 2405 base = OMAP1_DMA_BASE;
2366 dma_lch_count = OMAP1_LOGICAL_DMA_CH_COUNT; 2406 dma_lch_count = OMAP1_LOGICAL_DMA_CH_COUNT;
2367 } else if (cpu_is_omap24xx()) { 2407 } else if (cpu_is_omap24xx()) {
2368 omap_dma_base = OMAP2_IO_ADDRESS(OMAP24XX_DMA4_BASE); 2408 base = OMAP24XX_DMA4_BASE;
2369 dma_lch_count = OMAP_DMA4_LOGICAL_DMA_CH_COUNT; 2409 dma_lch_count = OMAP_DMA4_LOGICAL_DMA_CH_COUNT;
2370 } else if (cpu_is_omap34xx()) { 2410 } else if (cpu_is_omap34xx()) {
2371 omap_dma_base = OMAP2_IO_ADDRESS(OMAP34XX_DMA4_BASE); 2411 base = OMAP34XX_DMA4_BASE;
2372 dma_lch_count = OMAP_DMA4_LOGICAL_DMA_CH_COUNT; 2412 dma_lch_count = OMAP_DMA4_LOGICAL_DMA_CH_COUNT;
2373 } else if (cpu_is_omap44xx()) { 2413 } else if (cpu_is_omap44xx()) {
2374 omap_dma_base = OMAP2_IO_ADDRESS(OMAP44XX_DMA4_BASE); 2414 base = OMAP44XX_DMA4_BASE;
2375 dma_lch_count = OMAP_DMA4_LOGICAL_DMA_CH_COUNT; 2415 dma_lch_count = OMAP_DMA4_LOGICAL_DMA_CH_COUNT;
2376 } else { 2416 } else {
2377 pr_err("DMA init failed for unsupported omap\n"); 2417 pr_err("DMA init failed for unsupported omap\n");
2378 return -ENODEV; 2418 return -ENODEV;
2379 } 2419 }
2380 2420
2421 omap_dma_base = ioremap(base, SZ_4K);
2422 BUG_ON(!omap_dma_base);
2423
2381 if (cpu_class_is_omap2() && omap_dma_reserve_channels 2424 if (cpu_class_is_omap2() && omap_dma_reserve_channels
2382 && (omap_dma_reserve_channels <= dma_lch_count)) 2425 && (omap_dma_reserve_channels <= dma_lch_count))
2383 dma_lch_count = omap_dma_reserve_channels; 2426 dma_lch_count = omap_dma_reserve_channels;
2384 2427
2385 dma_chan = kzalloc(sizeof(struct omap_dma_lch) * dma_lch_count, 2428 dma_chan = kzalloc(sizeof(struct omap_dma_lch) * dma_lch_count,
2386 GFP_KERNEL); 2429 GFP_KERNEL);
2387 if (!dma_chan) 2430 if (!dma_chan) {
2388 return -ENOMEM; 2431 r = -ENOMEM;
2432 goto out_unmap;
2433 }
2389 2434
2390 if (cpu_class_is_omap2()) { 2435 if (cpu_class_is_omap2()) {
2391 dma_linked_lch = kzalloc(sizeof(struct dma_link_info) * 2436 dma_linked_lch = kzalloc(sizeof(struct dma_link_info) *
2392 dma_lch_count, GFP_KERNEL); 2437 dma_lch_count, GFP_KERNEL);
2393 if (!dma_linked_lch) { 2438 if (!dma_linked_lch) {
2394 kfree(dma_chan); 2439 r = -ENOMEM;
2395 return -ENOMEM; 2440 goto out_free;
2396 } 2441 }
2397 } 2442 }
2398 2443
@@ -2466,7 +2511,7 @@ static int __init omap_init_dma(void)
2466 for (i = 0; i < ch; i++) 2511 for (i = 0; i < ch; i++)
2467 free_irq(omap1_dma_irq[i], 2512 free_irq(omap1_dma_irq[i],
2468 (void *) (i + 1)); 2513 (void *) (i + 1));
2469 return r; 2514 goto out_free;
2470 } 2515 }
2471 } 2516 }
2472 } 2517 }
@@ -2484,8 +2529,8 @@ static int __init omap_init_dma(void)
2484 setup_irq(irq, &omap24xx_dma_irq); 2529 setup_irq(irq, &omap24xx_dma_irq);
2485 } 2530 }
2486 2531
2487 /* Enable smartidle idlemodes and autoidle */
2488 if (cpu_is_omap34xx()) { 2532 if (cpu_is_omap34xx()) {
2533 /* Enable smartidle idlemodes and autoidle */
2489 u32 v = dma_read(OCP_SYSCONFIG); 2534 u32 v = dma_read(OCP_SYSCONFIG);
2490 v &= ~(DMA_SYSCONFIG_MIDLEMODE_MASK | 2535 v &= ~(DMA_SYSCONFIG_MIDLEMODE_MASK |
2491 DMA_SYSCONFIG_SIDLEMODE_MASK | 2536 DMA_SYSCONFIG_SIDLEMODE_MASK |
@@ -2494,6 +2539,13 @@ static int __init omap_init_dma(void)
2494 DMA_SYSCONFIG_SIDLEMODE(DMA_IDLEMODE_SMARTIDLE) | 2539 DMA_SYSCONFIG_SIDLEMODE(DMA_IDLEMODE_SMARTIDLE) |
2495 DMA_SYSCONFIG_AUTOIDLE); 2540 DMA_SYSCONFIG_AUTOIDLE);
2496 dma_write(v , OCP_SYSCONFIG); 2541 dma_write(v , OCP_SYSCONFIG);
2542 /* reserve dma channels 0 and 1 in high security devices */
2543 if (omap_type() != OMAP2_DEVICE_TYPE_GP) {
2544 printk(KERN_INFO "Reserving DMA channels 0 and 1 for "
2545 "HS ROM code\n");
2546 dma_chan[0].dev_id = 0;
2547 dma_chan[1].dev_id = 1;
2548 }
2497 } 2549 }
2498 2550
2499 2551
@@ -2508,11 +2560,19 @@ static int __init omap_init_dma(void)
2508 "(error %d)\n", r); 2560 "(error %d)\n", r);
2509 for (i = 0; i < dma_chan_count; i++) 2561 for (i = 0; i < dma_chan_count; i++)
2510 free_irq(omap1_dma_irq[i], (void *) (i + 1)); 2562 free_irq(omap1_dma_irq[i], (void *) (i + 1));
2511 return r; 2563 goto out_free;
2512 } 2564 }
2513 } 2565 }
2514 2566
2515 return 0; 2567 return 0;
2568
2569out_free:
2570 kfree(dma_chan);
2571
2572out_unmap:
2573 iounmap(omap_dma_base);
2574
2575 return r;
2516} 2576}
2517 2577
2518arch_initcall(omap_init_dma); 2578arch_initcall(omap_init_dma);
diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index d325b54daeb5..64f407ee0f4e 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -38,7 +38,7 @@
38#include <linux/io.h> 38#include <linux/io.h>
39#include <linux/module.h> 39#include <linux/module.h>
40#include <mach/hardware.h> 40#include <mach/hardware.h>
41#include <mach/dmtimer.h> 41#include <plat/dmtimer.h>
42#include <mach/irqs.h> 42#include <mach/irqs.h>
43 43
44/* register offsets */ 44/* register offsets */
@@ -742,16 +742,17 @@ EXPORT_SYMBOL_GPL(omap_dm_timers_active);
742int __init omap_dm_timer_init(void) 742int __init omap_dm_timer_init(void)
743{ 743{
744 struct omap_dm_timer *timer; 744 struct omap_dm_timer *timer;
745 int i; 745 int i, map_size = SZ_8K; /* Module 4KB + L4 4KB except on omap1 */
746 746
747 if (!(cpu_is_omap16xx() || cpu_class_is_omap2())) 747 if (!(cpu_is_omap16xx() || cpu_class_is_omap2()))
748 return -ENODEV; 748 return -ENODEV;
749 749
750 spin_lock_init(&dm_timer_lock); 750 spin_lock_init(&dm_timer_lock);
751 751
752 if (cpu_class_is_omap1()) 752 if (cpu_class_is_omap1()) {
753 dm_timers = omap1_dm_timers; 753 dm_timers = omap1_dm_timers;
754 else if (cpu_is_omap24xx()) { 754 map_size = SZ_2K;
755 } else if (cpu_is_omap24xx()) {
755 dm_timers = omap2_dm_timers; 756 dm_timers = omap2_dm_timers;
756 dm_source_names = omap2_dm_source_names; 757 dm_source_names = omap2_dm_source_names;
757 dm_source_clocks = omap2_dm_source_clocks; 758 dm_source_clocks = omap2_dm_source_clocks;
@@ -774,10 +775,11 @@ int __init omap_dm_timer_init(void)
774 775
775 for (i = 0; i < dm_timer_count; i++) { 776 for (i = 0; i < dm_timer_count; i++) {
776 timer = &dm_timers[i]; 777 timer = &dm_timers[i];
777 if (cpu_class_is_omap1()) 778
778 timer->io_base = OMAP1_IO_ADDRESS(timer->phys_base); 779 /* Static mapping, never released */
779 else 780 timer->io_base = ioremap(timer->phys_base, map_size);
780 timer->io_base = OMAP2_IO_ADDRESS(timer->phys_base); 781 BUG_ON(!timer->io_base);
782
781#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) || \ 783#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) || \
782 defined(CONFIG_ARCH_OMAP4) 784 defined(CONFIG_ARCH_OMAP4)
783 if (cpu_class_is_omap2()) { 785 if (cpu_class_is_omap2()) {
diff --git a/arch/arm/plat-omap/fb.c b/arch/arm/plat-omap/fb.c
index 3746222bed10..78a4ce538dbd 100644
--- a/arch/arm/plat-omap/fb.c
+++ b/arch/arm/plat-omap/fb.c
@@ -32,9 +32,9 @@
32#include <mach/hardware.h> 32#include <mach/hardware.h>
33#include <asm/mach/map.h> 33#include <asm/mach/map.h>
34 34
35#include <mach/board.h> 35#include <plat/board.h>
36#include <mach/sram.h> 36#include <plat/sram.h>
37#include <mach/omapfb.h> 37#include <plat/omapfb.h>
38 38
39#if defined(CONFIG_FB_OMAP) || defined(CONFIG_FB_OMAP_MODULE) 39#if defined(CONFIG_FB_OMAP) || defined(CONFIG_FB_OMAP_MODULE)
40 40
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index 7c345b757df1..055160e0620e 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -31,7 +31,7 @@
31/* 31/*
32 * OMAP1510 GPIO registers 32 * OMAP1510 GPIO registers
33 */ 33 */
34#define OMAP1510_GPIO_BASE OMAP1_IO_ADDRESS(0xfffce000) 34#define OMAP1510_GPIO_BASE 0xfffce000
35#define OMAP1510_GPIO_DATA_INPUT 0x00 35#define OMAP1510_GPIO_DATA_INPUT 0x00
36#define OMAP1510_GPIO_DATA_OUTPUT 0x04 36#define OMAP1510_GPIO_DATA_OUTPUT 0x04
37#define OMAP1510_GPIO_DIR_CONTROL 0x08 37#define OMAP1510_GPIO_DIR_CONTROL 0x08
@@ -45,10 +45,10 @@
45/* 45/*
46 * OMAP1610 specific GPIO registers 46 * OMAP1610 specific GPIO registers
47 */ 47 */
48#define OMAP1610_GPIO1_BASE OMAP1_IO_ADDRESS(0xfffbe400) 48#define OMAP1610_GPIO1_BASE 0xfffbe400
49#define OMAP1610_GPIO2_BASE OMAP1_IO_ADDRESS(0xfffbec00) 49#define OMAP1610_GPIO2_BASE 0xfffbec00
50#define OMAP1610_GPIO3_BASE OMAP1_IO_ADDRESS(0xfffbb400) 50#define OMAP1610_GPIO3_BASE 0xfffbb400
51#define OMAP1610_GPIO4_BASE OMAP1_IO_ADDRESS(0xfffbbc00) 51#define OMAP1610_GPIO4_BASE 0xfffbbc00
52#define OMAP1610_GPIO_REVISION 0x0000 52#define OMAP1610_GPIO_REVISION 0x0000
53#define OMAP1610_GPIO_SYSCONFIG 0x0010 53#define OMAP1610_GPIO_SYSCONFIG 0x0010
54#define OMAP1610_GPIO_SYSSTATUS 0x0014 54#define OMAP1610_GPIO_SYSSTATUS 0x0014
@@ -68,52 +68,36 @@
68#define OMAP1610_GPIO_SET_DATAOUT 0x00f0 68#define OMAP1610_GPIO_SET_DATAOUT 0x00f0
69 69
70/* 70/*
71 * OMAP730 specific GPIO registers 71 * OMAP7XX specific GPIO registers
72 */ 72 */
73#define OMAP730_GPIO1_BASE OMAP1_IO_ADDRESS(0xfffbc000) 73#define OMAP7XX_GPIO1_BASE 0xfffbc000
74#define OMAP730_GPIO2_BASE OMAP1_IO_ADDRESS(0xfffbc800) 74#define OMAP7XX_GPIO2_BASE 0xfffbc800
75#define OMAP730_GPIO3_BASE OMAP1_IO_ADDRESS(0xfffbd000) 75#define OMAP7XX_GPIO3_BASE 0xfffbd000
76#define OMAP730_GPIO4_BASE OMAP1_IO_ADDRESS(0xfffbd800) 76#define OMAP7XX_GPIO4_BASE 0xfffbd800
77#define OMAP730_GPIO5_BASE OMAP1_IO_ADDRESS(0xfffbe000) 77#define OMAP7XX_GPIO5_BASE 0xfffbe000
78#define OMAP730_GPIO6_BASE OMAP1_IO_ADDRESS(0xfffbe800) 78#define OMAP7XX_GPIO6_BASE 0xfffbe800
79#define OMAP730_GPIO_DATA_INPUT 0x00 79#define OMAP7XX_GPIO_DATA_INPUT 0x00
80#define OMAP730_GPIO_DATA_OUTPUT 0x04 80#define OMAP7XX_GPIO_DATA_OUTPUT 0x04
81#define OMAP730_GPIO_DIR_CONTROL 0x08 81#define OMAP7XX_GPIO_DIR_CONTROL 0x08
82#define OMAP730_GPIO_INT_CONTROL 0x0c 82#define OMAP7XX_GPIO_INT_CONTROL 0x0c
83#define OMAP730_GPIO_INT_MASK 0x10 83#define OMAP7XX_GPIO_INT_MASK 0x10
84#define OMAP730_GPIO_INT_STATUS 0x14 84#define OMAP7XX_GPIO_INT_STATUS 0x14
85 85
86/* 86#define OMAP1_MPUIO_VBASE OMAP1_MPUIO_BASE
87 * OMAP850 specific GPIO registers
88 */
89#define OMAP850_GPIO1_BASE OMAP1_IO_ADDRESS(0xfffbc000)
90#define OMAP850_GPIO2_BASE OMAP1_IO_ADDRESS(0xfffbc800)
91#define OMAP850_GPIO3_BASE OMAP1_IO_ADDRESS(0xfffbd000)
92#define OMAP850_GPIO4_BASE OMAP1_IO_ADDRESS(0xfffbd800)
93#define OMAP850_GPIO5_BASE OMAP1_IO_ADDRESS(0xfffbe000)
94#define OMAP850_GPIO6_BASE OMAP1_IO_ADDRESS(0xfffbe800)
95#define OMAP850_GPIO_DATA_INPUT 0x00
96#define OMAP850_GPIO_DATA_OUTPUT 0x04
97#define OMAP850_GPIO_DIR_CONTROL 0x08
98#define OMAP850_GPIO_INT_CONTROL 0x0c
99#define OMAP850_GPIO_INT_MASK 0x10
100#define OMAP850_GPIO_INT_STATUS 0x14
101
102#define OMAP1_MPUIO_VBASE OMAP1_IO_ADDRESS(OMAP1_MPUIO_BASE)
103 87
104/* 88/*
105 * omap24xx specific GPIO registers 89 * omap24xx specific GPIO registers
106 */ 90 */
107#define OMAP242X_GPIO1_BASE OMAP2_IO_ADDRESS(0x48018000) 91#define OMAP242X_GPIO1_BASE 0x48018000
108#define OMAP242X_GPIO2_BASE OMAP2_IO_ADDRESS(0x4801a000) 92#define OMAP242X_GPIO2_BASE 0x4801a000
109#define OMAP242X_GPIO3_BASE OMAP2_IO_ADDRESS(0x4801c000) 93#define OMAP242X_GPIO3_BASE 0x4801c000
110#define OMAP242X_GPIO4_BASE OMAP2_IO_ADDRESS(0x4801e000) 94#define OMAP242X_GPIO4_BASE 0x4801e000
111 95
112#define OMAP243X_GPIO1_BASE OMAP2_IO_ADDRESS(0x4900C000) 96#define OMAP243X_GPIO1_BASE 0x4900C000
113#define OMAP243X_GPIO2_BASE OMAP2_IO_ADDRESS(0x4900E000) 97#define OMAP243X_GPIO2_BASE 0x4900E000
114#define OMAP243X_GPIO3_BASE OMAP2_IO_ADDRESS(0x49010000) 98#define OMAP243X_GPIO3_BASE 0x49010000
115#define OMAP243X_GPIO4_BASE OMAP2_IO_ADDRESS(0x49012000) 99#define OMAP243X_GPIO4_BASE 0x49012000
116#define OMAP243X_GPIO5_BASE OMAP2_IO_ADDRESS(0x480B6000) 100#define OMAP243X_GPIO5_BASE 0x480B6000
117 101
118#define OMAP24XX_GPIO_REVISION 0x0000 102#define OMAP24XX_GPIO_REVISION 0x0000
119#define OMAP24XX_GPIO_SYSCONFIG 0x0010 103#define OMAP24XX_GPIO_SYSCONFIG 0x0010
@@ -170,24 +154,25 @@
170 * omap34xx specific GPIO registers 154 * omap34xx specific GPIO registers
171 */ 155 */
172 156
173#define OMAP34XX_GPIO1_BASE OMAP2_IO_ADDRESS(0x48310000) 157#define OMAP34XX_GPIO1_BASE 0x48310000
174#define OMAP34XX_GPIO2_BASE OMAP2_IO_ADDRESS(0x49050000) 158#define OMAP34XX_GPIO2_BASE 0x49050000
175#define OMAP34XX_GPIO3_BASE OMAP2_IO_ADDRESS(0x49052000) 159#define OMAP34XX_GPIO3_BASE 0x49052000
176#define OMAP34XX_GPIO4_BASE OMAP2_IO_ADDRESS(0x49054000) 160#define OMAP34XX_GPIO4_BASE 0x49054000
177#define OMAP34XX_GPIO5_BASE OMAP2_IO_ADDRESS(0x49056000) 161#define OMAP34XX_GPIO5_BASE 0x49056000
178#define OMAP34XX_GPIO6_BASE OMAP2_IO_ADDRESS(0x49058000) 162#define OMAP34XX_GPIO6_BASE 0x49058000
179 163
180/* 164/*
181 * OMAP44XX specific GPIO registers 165 * OMAP44XX specific GPIO registers
182 */ 166 */
183#define OMAP44XX_GPIO1_BASE OMAP2_IO_ADDRESS(0x4a310000) 167#define OMAP44XX_GPIO1_BASE 0x4a310000
184#define OMAP44XX_GPIO2_BASE OMAP2_IO_ADDRESS(0x48055000) 168#define OMAP44XX_GPIO2_BASE 0x48055000
185#define OMAP44XX_GPIO3_BASE OMAP2_IO_ADDRESS(0x48057000) 169#define OMAP44XX_GPIO3_BASE 0x48057000
186#define OMAP44XX_GPIO4_BASE OMAP2_IO_ADDRESS(0x48059000) 170#define OMAP44XX_GPIO4_BASE 0x48059000
187#define OMAP44XX_GPIO5_BASE OMAP2_IO_ADDRESS(0x4805B000) 171#define OMAP44XX_GPIO5_BASE 0x4805B000
188#define OMAP44XX_GPIO6_BASE OMAP2_IO_ADDRESS(0x4805D000) 172#define OMAP44XX_GPIO6_BASE 0x4805D000
189 173
190struct gpio_bank { 174struct gpio_bank {
175 unsigned long pbase;
191 void __iomem *base; 176 void __iomem *base;
192 u16 irq; 177 u16 irq;
193 u16 virtual_irq_start; 178 u16 virtual_irq_start;
@@ -210,101 +195,134 @@ struct gpio_bank {
210 spinlock_t lock; 195 spinlock_t lock;
211 struct gpio_chip chip; 196 struct gpio_chip chip;
212 struct clk *dbck; 197 struct clk *dbck;
198 u32 mod_usage;
213}; 199};
214 200
215#define METHOD_MPUIO 0 201#define METHOD_MPUIO 0
216#define METHOD_GPIO_1510 1 202#define METHOD_GPIO_1510 1
217#define METHOD_GPIO_1610 2 203#define METHOD_GPIO_1610 2
218#define METHOD_GPIO_730 3 204#define METHOD_GPIO_7XX 3
219#define METHOD_GPIO_850 4
220#define METHOD_GPIO_24XX 5 205#define METHOD_GPIO_24XX 5
221 206
222#ifdef CONFIG_ARCH_OMAP16XX 207#ifdef CONFIG_ARCH_OMAP16XX
223static struct gpio_bank gpio_bank_1610[5] = { 208static struct gpio_bank gpio_bank_1610[5] = {
224 { OMAP1_MPUIO_VBASE, INT_MPUIO, IH_MPUIO_BASE, METHOD_MPUIO}, 209 { OMAP1_MPUIO_VBASE, NULL, INT_MPUIO, IH_MPUIO_BASE,
225 { OMAP1610_GPIO1_BASE, INT_GPIO_BANK1, IH_GPIO_BASE, METHOD_GPIO_1610 }, 210 METHOD_MPUIO },
226 { OMAP1610_GPIO2_BASE, INT_1610_GPIO_BANK2, IH_GPIO_BASE + 16, METHOD_GPIO_1610 }, 211 { OMAP1610_GPIO1_BASE, NULL, INT_GPIO_BANK1, IH_GPIO_BASE,
227 { OMAP1610_GPIO3_BASE, INT_1610_GPIO_BANK3, IH_GPIO_BASE + 32, METHOD_GPIO_1610 }, 212 METHOD_GPIO_1610 },
228 { OMAP1610_GPIO4_BASE, INT_1610_GPIO_BANK4, IH_GPIO_BASE + 48, METHOD_GPIO_1610 }, 213 { OMAP1610_GPIO2_BASE, NULL, INT_1610_GPIO_BANK2, IH_GPIO_BASE + 16,
214 METHOD_GPIO_1610 },
215 { OMAP1610_GPIO3_BASE, NULL, INT_1610_GPIO_BANK3, IH_GPIO_BASE + 32,
216 METHOD_GPIO_1610 },
217 { OMAP1610_GPIO4_BASE, NULL, INT_1610_GPIO_BANK4, IH_GPIO_BASE + 48,
218 METHOD_GPIO_1610 },
229}; 219};
230#endif 220#endif
231 221
232#ifdef CONFIG_ARCH_OMAP15XX 222#ifdef CONFIG_ARCH_OMAP15XX
233static struct gpio_bank gpio_bank_1510[2] = { 223static struct gpio_bank gpio_bank_1510[2] = {
234 { OMAP1_MPUIO_VBASE, INT_MPUIO, IH_MPUIO_BASE, METHOD_MPUIO }, 224 { OMAP1_MPUIO_VBASE, NULL, INT_MPUIO, IH_MPUIO_BASE,
235 { OMAP1510_GPIO_BASE, INT_GPIO_BANK1, IH_GPIO_BASE, METHOD_GPIO_1510 } 225 METHOD_MPUIO },
236}; 226 { OMAP1510_GPIO_BASE, NULL, INT_GPIO_BANK1, IH_GPIO_BASE,
237#endif 227 METHOD_GPIO_1510 }
238
239#ifdef CONFIG_ARCH_OMAP730
240static struct gpio_bank gpio_bank_730[7] = {
241 { OMAP1_MPUIO_VBASE, INT_730_MPUIO, IH_MPUIO_BASE, METHOD_MPUIO },
242 { OMAP730_GPIO1_BASE, INT_730_GPIO_BANK1, IH_GPIO_BASE, METHOD_GPIO_730 },
243 { OMAP730_GPIO2_BASE, INT_730_GPIO_BANK2, IH_GPIO_BASE + 32, METHOD_GPIO_730 },
244 { OMAP730_GPIO3_BASE, INT_730_GPIO_BANK3, IH_GPIO_BASE + 64, METHOD_GPIO_730 },
245 { OMAP730_GPIO4_BASE, INT_730_GPIO_BANK4, IH_GPIO_BASE + 96, METHOD_GPIO_730 },
246 { OMAP730_GPIO5_BASE, INT_730_GPIO_BANK5, IH_GPIO_BASE + 128, METHOD_GPIO_730 },
247 { OMAP730_GPIO6_BASE, INT_730_GPIO_BANK6, IH_GPIO_BASE + 160, METHOD_GPIO_730 },
248}; 228};
249#endif 229#endif
250 230
251#ifdef CONFIG_ARCH_OMAP850 231#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
252static struct gpio_bank gpio_bank_850[7] = { 232static struct gpio_bank gpio_bank_7xx[7] = {
253 { OMAP1_MPUIO_VBASE, INT_850_MPUIO, IH_MPUIO_BASE, METHOD_MPUIO }, 233 { OMAP1_MPUIO_VBASE, NULL, INT_7XX_MPUIO, IH_MPUIO_BASE,
254 { OMAP850_GPIO1_BASE, INT_850_GPIO_BANK1, IH_GPIO_BASE, METHOD_GPIO_850 }, 234 METHOD_MPUIO },
255 { OMAP850_GPIO2_BASE, INT_850_GPIO_BANK2, IH_GPIO_BASE + 32, METHOD_GPIO_850 }, 235 { OMAP7XX_GPIO1_BASE, NULL, INT_7XX_GPIO_BANK1, IH_GPIO_BASE,
256 { OMAP850_GPIO3_BASE, INT_850_GPIO_BANK3, IH_GPIO_BASE + 64, METHOD_GPIO_850 }, 236 METHOD_GPIO_7XX },
257 { OMAP850_GPIO4_BASE, INT_850_GPIO_BANK4, IH_GPIO_BASE + 96, METHOD_GPIO_850 }, 237 { OMAP7XX_GPIO2_BASE, NULL, INT_7XX_GPIO_BANK2, IH_GPIO_BASE + 32,
258 { OMAP850_GPIO5_BASE, INT_850_GPIO_BANK5, IH_GPIO_BASE + 128, METHOD_GPIO_850 }, 238 METHOD_GPIO_7XX },
259 { OMAP850_GPIO6_BASE, INT_850_GPIO_BANK6, IH_GPIO_BASE + 160, METHOD_GPIO_850 }, 239 { OMAP7XX_GPIO3_BASE, NULL, INT_7XX_GPIO_BANK3, IH_GPIO_BASE + 64,
240 METHOD_GPIO_7XX },
241 { OMAP7XX_GPIO4_BASE, NULL, INT_7XX_GPIO_BANK4, IH_GPIO_BASE + 96,
242 METHOD_GPIO_7XX },
243 { OMAP7XX_GPIO5_BASE, NULL, INT_7XX_GPIO_BANK5, IH_GPIO_BASE + 128,
244 METHOD_GPIO_7XX },
245 { OMAP7XX_GPIO6_BASE, NULL, INT_7XX_GPIO_BANK6, IH_GPIO_BASE + 160,
246 METHOD_GPIO_7XX },
260}; 247};
261#endif 248#endif
262 249
263
264#ifdef CONFIG_ARCH_OMAP24XX 250#ifdef CONFIG_ARCH_OMAP24XX
265 251
266static struct gpio_bank gpio_bank_242x[4] = { 252static struct gpio_bank gpio_bank_242x[4] = {
267 { OMAP242X_GPIO1_BASE, INT_24XX_GPIO_BANK1, IH_GPIO_BASE, METHOD_GPIO_24XX }, 253 { OMAP242X_GPIO1_BASE, NULL, INT_24XX_GPIO_BANK1, IH_GPIO_BASE,
268 { OMAP242X_GPIO2_BASE, INT_24XX_GPIO_BANK2, IH_GPIO_BASE + 32, METHOD_GPIO_24XX }, 254 METHOD_GPIO_24XX },
269 { OMAP242X_GPIO3_BASE, INT_24XX_GPIO_BANK3, IH_GPIO_BASE + 64, METHOD_GPIO_24XX }, 255 { OMAP242X_GPIO2_BASE, NULL, INT_24XX_GPIO_BANK2, IH_GPIO_BASE + 32,
270 { OMAP242X_GPIO4_BASE, INT_24XX_GPIO_BANK4, IH_GPIO_BASE + 96, METHOD_GPIO_24XX }, 256 METHOD_GPIO_24XX },
257 { OMAP242X_GPIO3_BASE, NULL, INT_24XX_GPIO_BANK3, IH_GPIO_BASE + 64,
258 METHOD_GPIO_24XX },
259 { OMAP242X_GPIO4_BASE, NULL, INT_24XX_GPIO_BANK4, IH_GPIO_BASE + 96,
260 METHOD_GPIO_24XX },
271}; 261};
272 262
273static struct gpio_bank gpio_bank_243x[5] = { 263static struct gpio_bank gpio_bank_243x[5] = {
274 { OMAP243X_GPIO1_BASE, INT_24XX_GPIO_BANK1, IH_GPIO_BASE, METHOD_GPIO_24XX }, 264 { OMAP243X_GPIO1_BASE, NULL, INT_24XX_GPIO_BANK1, IH_GPIO_BASE,
275 { OMAP243X_GPIO2_BASE, INT_24XX_GPIO_BANK2, IH_GPIO_BASE + 32, METHOD_GPIO_24XX }, 265 METHOD_GPIO_24XX },
276 { OMAP243X_GPIO3_BASE, INT_24XX_GPIO_BANK3, IH_GPIO_BASE + 64, METHOD_GPIO_24XX }, 266 { OMAP243X_GPIO2_BASE, NULL, INT_24XX_GPIO_BANK2, IH_GPIO_BASE + 32,
277 { OMAP243X_GPIO4_BASE, INT_24XX_GPIO_BANK4, IH_GPIO_BASE + 96, METHOD_GPIO_24XX }, 267 METHOD_GPIO_24XX },
278 { OMAP243X_GPIO5_BASE, INT_24XX_GPIO_BANK5, IH_GPIO_BASE + 128, METHOD_GPIO_24XX }, 268 { OMAP243X_GPIO3_BASE, NULL, INT_24XX_GPIO_BANK3, IH_GPIO_BASE + 64,
269 METHOD_GPIO_24XX },
270 { OMAP243X_GPIO4_BASE, NULL, INT_24XX_GPIO_BANK4, IH_GPIO_BASE + 96,
271 METHOD_GPIO_24XX },
272 { OMAP243X_GPIO5_BASE, NULL, INT_24XX_GPIO_BANK5, IH_GPIO_BASE + 128,
273 METHOD_GPIO_24XX },
279}; 274};
280 275
281#endif 276#endif
282 277
283#ifdef CONFIG_ARCH_OMAP34XX 278#ifdef CONFIG_ARCH_OMAP34XX
284static struct gpio_bank gpio_bank_34xx[6] = { 279static struct gpio_bank gpio_bank_34xx[6] = {
285 { OMAP34XX_GPIO1_BASE, INT_34XX_GPIO_BANK1, IH_GPIO_BASE, METHOD_GPIO_24XX }, 280 { OMAP34XX_GPIO1_BASE, NULL, INT_34XX_GPIO_BANK1, IH_GPIO_BASE,
286 { OMAP34XX_GPIO2_BASE, INT_34XX_GPIO_BANK2, IH_GPIO_BASE + 32, METHOD_GPIO_24XX }, 281 METHOD_GPIO_24XX },
287 { OMAP34XX_GPIO3_BASE, INT_34XX_GPIO_BANK3, IH_GPIO_BASE + 64, METHOD_GPIO_24XX }, 282 { OMAP34XX_GPIO2_BASE, NULL, INT_34XX_GPIO_BANK2, IH_GPIO_BASE + 32,
288 { OMAP34XX_GPIO4_BASE, INT_34XX_GPIO_BANK4, IH_GPIO_BASE + 96, METHOD_GPIO_24XX }, 283 METHOD_GPIO_24XX },
289 { OMAP34XX_GPIO5_BASE, INT_34XX_GPIO_BANK5, IH_GPIO_BASE + 128, METHOD_GPIO_24XX }, 284 { OMAP34XX_GPIO3_BASE, NULL, INT_34XX_GPIO_BANK3, IH_GPIO_BASE + 64,
290 { OMAP34XX_GPIO6_BASE, INT_34XX_GPIO_BANK6, IH_GPIO_BASE + 160, METHOD_GPIO_24XX }, 285 METHOD_GPIO_24XX },
286 { OMAP34XX_GPIO4_BASE, NULL, INT_34XX_GPIO_BANK4, IH_GPIO_BASE + 96,
287 METHOD_GPIO_24XX },
288 { OMAP34XX_GPIO5_BASE, NULL, INT_34XX_GPIO_BANK5, IH_GPIO_BASE + 128,
289 METHOD_GPIO_24XX },
290 { OMAP34XX_GPIO6_BASE, NULL, INT_34XX_GPIO_BANK6, IH_GPIO_BASE + 160,
291 METHOD_GPIO_24XX },
291}; 292};
292 293
294struct omap3_gpio_regs {
295 u32 sysconfig;
296 u32 irqenable1;
297 u32 irqenable2;
298 u32 wake_en;
299 u32 ctrl;
300 u32 oe;
301 u32 leveldetect0;
302 u32 leveldetect1;
303 u32 risingdetect;
304 u32 fallingdetect;
305 u32 dataout;
306 u32 setwkuena;
307 u32 setdataout;
308};
309
310static struct omap3_gpio_regs gpio_context[OMAP34XX_NR_GPIOS];
293#endif 311#endif
294 312
295#ifdef CONFIG_ARCH_OMAP4 313#ifdef CONFIG_ARCH_OMAP4
296static struct gpio_bank gpio_bank_44xx[6] = { 314static struct gpio_bank gpio_bank_44xx[6] = {
297 { OMAP44XX_GPIO1_BASE, INT_44XX_GPIO_BANK1, IH_GPIO_BASE, \ 315 { OMAP44XX_GPIO1_BASE, NULL, INT_44XX_GPIO_BANK1, IH_GPIO_BASE,
298 METHOD_GPIO_24XX }, 316 METHOD_GPIO_24XX },
299 { OMAP44XX_GPIO2_BASE, INT_44XX_GPIO_BANK2, IH_GPIO_BASE + 32, \ 317 { OMAP44XX_GPIO2_BASE, NULL, INT_44XX_GPIO_BANK2, IH_GPIO_BASE + 32,
300 METHOD_GPIO_24XX }, 318 METHOD_GPIO_24XX },
301 { OMAP44XX_GPIO3_BASE, INT_44XX_GPIO_BANK3, IH_GPIO_BASE + 64, \ 319 { OMAP44XX_GPIO3_BASE, NULL, INT_44XX_GPIO_BANK3, IH_GPIO_BASE + 64,
302 METHOD_GPIO_24XX }, 320 METHOD_GPIO_24XX },
303 { OMAP44XX_GPIO4_BASE, INT_44XX_GPIO_BANK4, IH_GPIO_BASE + 96, \ 321 { OMAP44XX_GPIO4_BASE, NULL, INT_44XX_GPIO_BANK4, IH_GPIO_BASE + 96,
304 METHOD_GPIO_24XX }, 322 METHOD_GPIO_24XX },
305 { OMAP44XX_GPIO5_BASE, INT_44XX_GPIO_BANK5, IH_GPIO_BASE + 128, \ 323 { OMAP44XX_GPIO5_BASE, NULL, INT_44XX_GPIO_BANK5, IH_GPIO_BASE + 128,
306 METHOD_GPIO_24XX }, 324 METHOD_GPIO_24XX },
307 { OMAP44XX_GPIO6_BASE, INT_44XX_GPIO_BANK6, IH_GPIO_BASE + 160, \ 325 { OMAP44XX_GPIO6_BASE, NULL, INT_44XX_GPIO_BANK6, IH_GPIO_BASE + 160,
308 METHOD_GPIO_24XX }, 326 METHOD_GPIO_24XX },
309}; 327};
310 328
@@ -402,14 +420,9 @@ static void _set_gpio_direction(struct gpio_bank *bank, int gpio, int is_input)
402 reg += OMAP1610_GPIO_DIRECTION; 420 reg += OMAP1610_GPIO_DIRECTION;
403 break; 421 break;
404#endif 422#endif
405#ifdef CONFIG_ARCH_OMAP730 423#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
406 case METHOD_GPIO_730: 424 case METHOD_GPIO_7XX:
407 reg += OMAP730_GPIO_DIR_CONTROL; 425 reg += OMAP7XX_GPIO_DIR_CONTROL;
408 break;
409#endif
410#ifdef CONFIG_ARCH_OMAP850
411 case METHOD_GPIO_850:
412 reg += OMAP850_GPIO_DIR_CONTROL;
413 break; 426 break;
414#endif 427#endif
415#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) 428#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX)
@@ -469,19 +482,9 @@ static void _set_gpio_dataout(struct gpio_bank *bank, int gpio, int enable)
469 l = 1 << gpio; 482 l = 1 << gpio;
470 break; 483 break;
471#endif 484#endif
472#ifdef CONFIG_ARCH_OMAP730 485#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
473 case METHOD_GPIO_730: 486 case METHOD_GPIO_7XX:
474 reg += OMAP730_GPIO_DATA_OUTPUT; 487 reg += OMAP7XX_GPIO_DATA_OUTPUT;
475 l = __raw_readl(reg);
476 if (enable)
477 l |= 1 << gpio;
478 else
479 l &= ~(1 << gpio);
480 break;
481#endif
482#ifdef CONFIG_ARCH_OMAP850
483 case METHOD_GPIO_850:
484 reg += OMAP850_GPIO_DATA_OUTPUT;
485 l = __raw_readl(reg); 488 l = __raw_readl(reg);
486 if (enable) 489 if (enable)
487 l |= 1 << gpio; 490 l |= 1 << gpio;
@@ -537,14 +540,9 @@ static int _get_gpio_datain(struct gpio_bank *bank, int gpio)
537 reg += OMAP1610_GPIO_DATAIN; 540 reg += OMAP1610_GPIO_DATAIN;
538 break; 541 break;
539#endif 542#endif
540#ifdef CONFIG_ARCH_OMAP730 543#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
541 case METHOD_GPIO_730: 544 case METHOD_GPIO_7XX:
542 reg += OMAP730_GPIO_DATA_INPUT; 545 reg += OMAP7XX_GPIO_DATA_INPUT;
543 break;
544#endif
545#ifdef CONFIG_ARCH_OMAP850
546 case METHOD_GPIO_850:
547 reg += OMAP850_GPIO_DATA_INPUT;
548 break; 546 break;
549#endif 547#endif
550#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) 548#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX)
@@ -588,14 +586,9 @@ static int _get_gpio_dataout(struct gpio_bank *bank, int gpio)
588 reg += OMAP1610_GPIO_DATAOUT; 586 reg += OMAP1610_GPIO_DATAOUT;
589 break; 587 break;
590#endif 588#endif
591#ifdef CONFIG_ARCH_OMAP730 589#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
592 case METHOD_GPIO_730: 590 case METHOD_GPIO_7XX:
593 reg += OMAP730_GPIO_DATA_OUTPUT; 591 reg += OMAP7XX_GPIO_DATA_OUTPUT;
594 break;
595#endif
596#ifdef CONFIG_ARCH_OMAP850
597 case METHOD_GPIO_850:
598 reg += OMAP850_GPIO_DATA_OUTPUT;
599 break; 592 break;
600#endif 593#endif
601#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) || \ 594#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) || \
@@ -636,6 +629,10 @@ void omap_set_gpio_debounce(int gpio, int enable)
636#else 629#else
637 reg += OMAP24XX_GPIO_DEBOUNCE_EN; 630 reg += OMAP24XX_GPIO_DEBOUNCE_EN;
638#endif 631#endif
632 if (!(bank->mod_usage & l)) {
633 printk(KERN_ERR "GPIO %d not requested\n", gpio);
634 return;
635 }
639 636
640 spin_lock_irqsave(&bank->lock, flags); 637 spin_lock_irqsave(&bank->lock, flags);
641 val = __raw_readl(reg); 638 val = __raw_readl(reg);
@@ -671,6 +668,11 @@ void omap_set_gpio_debounce_time(int gpio, int enc_time)
671 bank = get_gpio_bank(gpio); 668 bank = get_gpio_bank(gpio);
672 reg = bank->base; 669 reg = bank->base;
673 670
671 if (!bank->mod_usage) {
672 printk(KERN_ERR "GPIO not requested\n");
673 return;
674 }
675
674 enc_time &= 0xff; 676 enc_time &= 0xff;
675#ifdef CONFIG_ARCH_OMAP4 677#ifdef CONFIG_ARCH_OMAP4
676 reg += OMAP4_GPIO_DEBOUNCINGTIME; 678 reg += OMAP4_GPIO_DEBOUNCINGTIME;
@@ -797,21 +799,9 @@ static int _set_gpio_triggering(struct gpio_bank *bank, int gpio, int trigger)
797 __raw_writel(1 << gpio, bank->base + OMAP1610_GPIO_CLEAR_WAKEUPENA); 799 __raw_writel(1 << gpio, bank->base + OMAP1610_GPIO_CLEAR_WAKEUPENA);
798 break; 800 break;
799#endif 801#endif
800#ifdef CONFIG_ARCH_OMAP730 802#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
801 case METHOD_GPIO_730: 803 case METHOD_GPIO_7XX:
802 reg += OMAP730_GPIO_INT_CONTROL; 804 reg += OMAP7XX_GPIO_INT_CONTROL;
803 l = __raw_readl(reg);
804 if (trigger & IRQ_TYPE_EDGE_RISING)
805 l |= 1 << gpio;
806 else if (trigger & IRQ_TYPE_EDGE_FALLING)
807 l &= ~(1 << gpio);
808 else
809 goto bad;
810 break;
811#endif
812#ifdef CONFIG_ARCH_OMAP850
813 case METHOD_GPIO_850:
814 reg += OMAP850_GPIO_INT_CONTROL;
815 l = __raw_readl(reg); 805 l = __raw_readl(reg);
816 if (trigger & IRQ_TYPE_EDGE_RISING) 806 if (trigger & IRQ_TYPE_EDGE_RISING)
817 l |= 1 << gpio; 807 l |= 1 << gpio;
@@ -897,14 +887,9 @@ static void _clear_gpio_irqbank(struct gpio_bank *bank, int gpio_mask)
897 reg += OMAP1610_GPIO_IRQSTATUS1; 887 reg += OMAP1610_GPIO_IRQSTATUS1;
898 break; 888 break;
899#endif 889#endif
900#ifdef CONFIG_ARCH_OMAP730 890#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
901 case METHOD_GPIO_730: 891 case METHOD_GPIO_7XX:
902 reg += OMAP730_GPIO_INT_STATUS; 892 reg += OMAP7XX_GPIO_INT_STATUS;
903 break;
904#endif
905#ifdef CONFIG_ARCH_OMAP850
906 case METHOD_GPIO_850:
907 reg += OMAP850_GPIO_INT_STATUS;
908 break; 893 break;
909#endif 894#endif
910#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) 895#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX)
@@ -971,16 +956,9 @@ static u32 _get_gpio_irqbank_mask(struct gpio_bank *bank)
971 mask = 0xffff; 956 mask = 0xffff;
972 break; 957 break;
973#endif 958#endif
974#ifdef CONFIG_ARCH_OMAP730 959#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
975 case METHOD_GPIO_730: 960 case METHOD_GPIO_7XX:
976 reg += OMAP730_GPIO_INT_MASK; 961 reg += OMAP7XX_GPIO_INT_MASK;
977 mask = 0xffffffff;
978 inv = 1;
979 break;
980#endif
981#ifdef CONFIG_ARCH_OMAP850
982 case METHOD_GPIO_850:
983 reg += OMAP850_GPIO_INT_MASK;
984 mask = 0xffffffff; 962 mask = 0xffffffff;
985 inv = 1; 963 inv = 1;
986 break; 964 break;
@@ -1044,19 +1022,9 @@ static void _enable_gpio_irqbank(struct gpio_bank *bank, int gpio_mask, int enab
1044 l = gpio_mask; 1022 l = gpio_mask;
1045 break; 1023 break;
1046#endif 1024#endif
1047#ifdef CONFIG_ARCH_OMAP730 1025#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
1048 case METHOD_GPIO_730: 1026 case METHOD_GPIO_7XX:
1049 reg += OMAP730_GPIO_INT_MASK; 1027 reg += OMAP7XX_GPIO_INT_MASK;
1050 l = __raw_readl(reg);
1051 if (enable)
1052 l &= ~(gpio_mask);
1053 else
1054 l |= gpio_mask;
1055 break;
1056#endif
1057#ifdef CONFIG_ARCH_OMAP850
1058 case METHOD_GPIO_850:
1059 reg += OMAP850_GPIO_INT_MASK;
1060 l = __raw_readl(reg); 1028 l = __raw_readl(reg);
1061 if (enable) 1029 if (enable)
1062 l &= ~(gpio_mask); 1030 l &= ~(gpio_mask);
@@ -1186,6 +1154,16 @@ static int omap_gpio_request(struct gpio_chip *chip, unsigned offset)
1186 __raw_writel(__raw_readl(reg) | (1 << offset), reg); 1154 __raw_writel(__raw_readl(reg) | (1 << offset), reg);
1187 } 1155 }
1188#endif 1156#endif
1157 if (!cpu_class_is_omap1()) {
1158 if (!bank->mod_usage) {
1159 u32 ctrl;
1160 ctrl = __raw_readl(bank->base + OMAP24XX_GPIO_CTRL);
1161 ctrl &= 0xFFFFFFFE;
1162 /* Module is enabled, clocks are not gated */
1163 __raw_writel(ctrl, bank->base + OMAP24XX_GPIO_CTRL);
1164 }
1165 bank->mod_usage |= 1 << offset;
1166 }
1189 spin_unlock_irqrestore(&bank->lock, flags); 1167 spin_unlock_irqrestore(&bank->lock, flags);
1190 1168
1191 return 0; 1169 return 0;
@@ -1212,6 +1190,16 @@ static void omap_gpio_free(struct gpio_chip *chip, unsigned offset)
1212 __raw_writel(1 << offset, reg); 1190 __raw_writel(1 << offset, reg);
1213 } 1191 }
1214#endif 1192#endif
1193 if (!cpu_class_is_omap1()) {
1194 bank->mod_usage &= ~(1 << offset);
1195 if (!bank->mod_usage) {
1196 u32 ctrl;
1197 ctrl = __raw_readl(bank->base + OMAP24XX_GPIO_CTRL);
1198 /* Module is disabled, clocks are gated */
1199 ctrl |= 1;
1200 __raw_writel(ctrl, bank->base + OMAP24XX_GPIO_CTRL);
1201 }
1202 }
1215 _reset_gpio(bank, bank->chip.base + offset); 1203 _reset_gpio(bank, bank->chip.base + offset);
1216 spin_unlock_irqrestore(&bank->lock, flags); 1204 spin_unlock_irqrestore(&bank->lock, flags);
1217} 1205}
@@ -1249,13 +1237,9 @@ static void gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
1249 if (bank->method == METHOD_GPIO_1610) 1237 if (bank->method == METHOD_GPIO_1610)
1250 isr_reg = bank->base + OMAP1610_GPIO_IRQSTATUS1; 1238 isr_reg = bank->base + OMAP1610_GPIO_IRQSTATUS1;
1251#endif 1239#endif
1252#ifdef CONFIG_ARCH_OMAP730 1240#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
1253 if (bank->method == METHOD_GPIO_730) 1241 if (bank->method == METHOD_GPIO_7XX)
1254 isr_reg = bank->base + OMAP730_GPIO_INT_STATUS; 1242 isr_reg = bank->base + OMAP7XX_GPIO_INT_STATUS;
1255#endif
1256#ifdef CONFIG_ARCH_OMAP850
1257 if (bank->method == METHOD_GPIO_850)
1258 isr_reg = bank->base + OMAP850_GPIO_INT_STATUS;
1259#endif 1243#endif
1260#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) 1244#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX)
1261 if (bank->method == METHOD_GPIO_24XX) 1245 if (bank->method == METHOD_GPIO_24XX)
@@ -1524,11 +1508,8 @@ static int gpio_is_input(struct gpio_bank *bank, int mask)
1524 case METHOD_GPIO_1610: 1508 case METHOD_GPIO_1610:
1525 reg += OMAP1610_GPIO_DIRECTION; 1509 reg += OMAP1610_GPIO_DIRECTION;
1526 break; 1510 break;
1527 case METHOD_GPIO_730: 1511 case METHOD_GPIO_7XX:
1528 reg += OMAP730_GPIO_DIR_CONTROL; 1512 reg += OMAP7XX_GPIO_DIR_CONTROL;
1529 break;
1530 case METHOD_GPIO_850:
1531 reg += OMAP850_GPIO_DIR_CONTROL;
1532 break; 1513 break;
1533 case METHOD_GPIO_24XX: 1514 case METHOD_GPIO_24XX:
1534 reg += OMAP24XX_GPIO_OE; 1515 reg += OMAP24XX_GPIO_OE;
@@ -1607,6 +1588,23 @@ static struct clk * gpio5_fck;
1607static struct clk *gpio_iclks[OMAP34XX_NR_GPIOS]; 1588static struct clk *gpio_iclks[OMAP34XX_NR_GPIOS];
1608#endif 1589#endif
1609 1590
1591static void __init omap_gpio_show_rev(void)
1592{
1593 u32 rev;
1594
1595 if (cpu_is_omap16xx())
1596 rev = __raw_readw(gpio_bank[1].base + OMAP1610_GPIO_REVISION);
1597 else if (cpu_is_omap24xx() || cpu_is_omap34xx())
1598 rev = __raw_readl(gpio_bank[0].base + OMAP24XX_GPIO_REVISION);
1599 else if (cpu_is_omap44xx())
1600 rev = __raw_readl(gpio_bank[0].base + OMAP4_GPIO_REVISION);
1601 else
1602 return;
1603
1604 printk(KERN_INFO "OMAP GPIO hardware version %d.%d\n",
1605 (rev >> 4) & 0x0f, rev & 0x0f);
1606}
1607
1610/* This lock class tells lockdep that GPIO irqs are in a different 1608/* This lock class tells lockdep that GPIO irqs are in a different
1611 * category than their parents, so it won't report false recursion. 1609 * category than their parents, so it won't report false recursion.
1612 */ 1610 */
@@ -1617,6 +1615,7 @@ static int __init _omap_gpio_init(void)
1617 int i; 1615 int i;
1618 int gpio = 0; 1616 int gpio = 0;
1619 struct gpio_bank *bank; 1617 struct gpio_bank *bank;
1618 int bank_size = SZ_8K; /* Module 4KB + L4 4KB except on omap1 */
1620 char clk_name[11]; 1619 char clk_name[11];
1621 1620
1622 initialized = 1; 1621 initialized = 1;
@@ -1679,77 +1678,45 @@ static int __init _omap_gpio_init(void)
1679 1678
1680#ifdef CONFIG_ARCH_OMAP15XX 1679#ifdef CONFIG_ARCH_OMAP15XX
1681 if (cpu_is_omap15xx()) { 1680 if (cpu_is_omap15xx()) {
1682 printk(KERN_INFO "OMAP1510 GPIO hardware\n");
1683 gpio_bank_count = 2; 1681 gpio_bank_count = 2;
1684 gpio_bank = gpio_bank_1510; 1682 gpio_bank = gpio_bank_1510;
1683 bank_size = SZ_2K;
1685 } 1684 }
1686#endif 1685#endif
1687#if defined(CONFIG_ARCH_OMAP16XX) 1686#if defined(CONFIG_ARCH_OMAP16XX)
1688 if (cpu_is_omap16xx()) { 1687 if (cpu_is_omap16xx()) {
1689 u32 rev;
1690
1691 gpio_bank_count = 5; 1688 gpio_bank_count = 5;
1692 gpio_bank = gpio_bank_1610; 1689 gpio_bank = gpio_bank_1610;
1693 rev = __raw_readw(gpio_bank[1].base + OMAP1610_GPIO_REVISION); 1690 bank_size = SZ_2K;
1694 printk(KERN_INFO "OMAP GPIO hardware version %d.%d\n",
1695 (rev >> 4) & 0x0f, rev & 0x0f);
1696 } 1691 }
1697#endif 1692#endif
1698#ifdef CONFIG_ARCH_OMAP730 1693#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
1699 if (cpu_is_omap730()) { 1694 if (cpu_is_omap7xx()) {
1700 printk(KERN_INFO "OMAP730 GPIO hardware\n");
1701 gpio_bank_count = 7;
1702 gpio_bank = gpio_bank_730;
1703 }
1704#endif
1705#ifdef CONFIG_ARCH_OMAP850
1706 if (cpu_is_omap850()) {
1707 printk(KERN_INFO "OMAP850 GPIO hardware\n");
1708 gpio_bank_count = 7; 1695 gpio_bank_count = 7;
1709 gpio_bank = gpio_bank_850; 1696 gpio_bank = gpio_bank_7xx;
1697 bank_size = SZ_2K;
1710 } 1698 }
1711#endif 1699#endif
1712
1713#ifdef CONFIG_ARCH_OMAP24XX 1700#ifdef CONFIG_ARCH_OMAP24XX
1714 if (cpu_is_omap242x()) { 1701 if (cpu_is_omap242x()) {
1715 int rev;
1716
1717 gpio_bank_count = 4; 1702 gpio_bank_count = 4;
1718 gpio_bank = gpio_bank_242x; 1703 gpio_bank = gpio_bank_242x;
1719 rev = __raw_readl(gpio_bank[0].base + OMAP24XX_GPIO_REVISION);
1720 printk(KERN_INFO "OMAP242x GPIO hardware version %d.%d\n",
1721 (rev >> 4) & 0x0f, rev & 0x0f);
1722 } 1704 }
1723 if (cpu_is_omap243x()) { 1705 if (cpu_is_omap243x()) {
1724 int rev;
1725
1726 gpio_bank_count = 5; 1706 gpio_bank_count = 5;
1727 gpio_bank = gpio_bank_243x; 1707 gpio_bank = gpio_bank_243x;
1728 rev = __raw_readl(gpio_bank[0].base + OMAP24XX_GPIO_REVISION);
1729 printk(KERN_INFO "OMAP243x GPIO hardware version %d.%d\n",
1730 (rev >> 4) & 0x0f, rev & 0x0f);
1731 } 1708 }
1732#endif 1709#endif
1733#ifdef CONFIG_ARCH_OMAP34XX 1710#ifdef CONFIG_ARCH_OMAP34XX
1734 if (cpu_is_omap34xx()) { 1711 if (cpu_is_omap34xx()) {
1735 int rev;
1736
1737 gpio_bank_count = OMAP34XX_NR_GPIOS; 1712 gpio_bank_count = OMAP34XX_NR_GPIOS;
1738 gpio_bank = gpio_bank_34xx; 1713 gpio_bank = gpio_bank_34xx;
1739 rev = __raw_readl(gpio_bank[0].base + OMAP24XX_GPIO_REVISION);
1740 printk(KERN_INFO "OMAP34xx GPIO hardware version %d.%d\n",
1741 (rev >> 4) & 0x0f, rev & 0x0f);
1742 } 1714 }
1743#endif 1715#endif
1744#ifdef CONFIG_ARCH_OMAP4 1716#ifdef CONFIG_ARCH_OMAP4
1745 if (cpu_is_omap44xx()) { 1717 if (cpu_is_omap44xx()) {
1746 int rev;
1747
1748 gpio_bank_count = OMAP34XX_NR_GPIOS; 1718 gpio_bank_count = OMAP34XX_NR_GPIOS;
1749 gpio_bank = gpio_bank_44xx; 1719 gpio_bank = gpio_bank_44xx;
1750 rev = __raw_readl(gpio_bank[0].base + OMAP4_GPIO_REVISION);
1751 printk(KERN_INFO "OMAP44xx GPIO hardware version %d.%d\n",
1752 (rev >> 4) & 0x0f, rev & 0x0f);
1753 } 1720 }
1754#endif 1721#endif
1755 for (i = 0; i < gpio_bank_count; i++) { 1722 for (i = 0; i < gpio_bank_count; i++) {
@@ -1757,6 +1724,14 @@ static int __init _omap_gpio_init(void)
1757 1724
1758 bank = &gpio_bank[i]; 1725 bank = &gpio_bank[i];
1759 spin_lock_init(&bank->lock); 1726 spin_lock_init(&bank->lock);
1727
1728 /* Static mapping, never released */
1729 bank->base = ioremap(bank->pbase, bank_size);
1730 if (!bank->base) {
1731 printk(KERN_ERR "Could not ioremap gpio bank%i\n", i);
1732 continue;
1733 }
1734
1760 if (bank_is_mpuio(bank)) 1735 if (bank_is_mpuio(bank))
1761 __raw_writew(0xffff, bank->base + OMAP_MPUIO_GPIO_MASKIT); 1736 __raw_writew(0xffff, bank->base + OMAP_MPUIO_GPIO_MASKIT);
1762 if (cpu_is_omap15xx() && bank->method == METHOD_GPIO_1510) { 1737 if (cpu_is_omap15xx() && bank->method == METHOD_GPIO_1510) {
@@ -1768,11 +1743,11 @@ static int __init _omap_gpio_init(void)
1768 __raw_writew(0xffff, bank->base + OMAP1610_GPIO_IRQSTATUS1); 1743 __raw_writew(0xffff, bank->base + OMAP1610_GPIO_IRQSTATUS1);
1769 __raw_writew(0x0014, bank->base + OMAP1610_GPIO_SYSCONFIG); 1744 __raw_writew(0x0014, bank->base + OMAP1610_GPIO_SYSCONFIG);
1770 } 1745 }
1771 if (cpu_is_omap7xx() && bank->method == METHOD_GPIO_730) { 1746 if (cpu_is_omap7xx() && bank->method == METHOD_GPIO_7XX) {
1772 __raw_writel(0xffffffff, bank->base + OMAP730_GPIO_INT_MASK); 1747 __raw_writel(0xffffffff, bank->base + OMAP7XX_GPIO_INT_MASK);
1773 __raw_writel(0x00000000, bank->base + OMAP730_GPIO_INT_STATUS); 1748 __raw_writel(0x00000000, bank->base + OMAP7XX_GPIO_INT_STATUS);
1774 1749
1775 gpio_count = 32; /* 730 has 32-bit GPIOs */ 1750 gpio_count = 32; /* 7xx has 32-bit GPIOs */
1776 } 1751 }
1777 1752
1778#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) || \ 1753#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) || \
@@ -1804,6 +1779,8 @@ static int __init _omap_gpio_init(void)
1804 gpio_count = 32; 1779 gpio_count = 32;
1805 } 1780 }
1806#endif 1781#endif
1782
1783 bank->mod_usage = 0;
1807 /* REVISIT eventually switch from OMAP-specific gpio structs 1784 /* REVISIT eventually switch from OMAP-specific gpio structs
1808 * over to the generic ones 1785 * over to the generic ones
1809 */ 1786 */
@@ -1862,6 +1839,8 @@ static int __init _omap_gpio_init(void)
1862 if (cpu_is_omap34xx()) 1839 if (cpu_is_omap34xx())
1863 omap_writel(1 << 0, 0x48306814); 1840 omap_writel(1 << 0, 0x48306814);
1864 1841
1842 omap_gpio_show_rev();
1843
1865 return 0; 1844 return 0;
1866} 1845}
1867 1846
@@ -2106,6 +2085,81 @@ void omap2_gpio_resume_after_retention(void)
2106 2085
2107#endif 2086#endif
2108 2087
2088#ifdef CONFIG_ARCH_OMAP34XX
2089/* save the registers of bank 2-6 */
2090void omap_gpio_save_context(void)
2091{
2092 int i;
2093
2094 /* saving banks from 2-6 only since GPIO1 is in WKUP */
2095 for (i = 1; i < gpio_bank_count; i++) {
2096 struct gpio_bank *bank = &gpio_bank[i];
2097 gpio_context[i].sysconfig =
2098 __raw_readl(bank->base + OMAP24XX_GPIO_SYSCONFIG);
2099 gpio_context[i].irqenable1 =
2100 __raw_readl(bank->base + OMAP24XX_GPIO_IRQENABLE1);
2101 gpio_context[i].irqenable2 =
2102 __raw_readl(bank->base + OMAP24XX_GPIO_IRQENABLE2);
2103 gpio_context[i].wake_en =
2104 __raw_readl(bank->base + OMAP24XX_GPIO_WAKE_EN);
2105 gpio_context[i].ctrl =
2106 __raw_readl(bank->base + OMAP24XX_GPIO_CTRL);
2107 gpio_context[i].oe =
2108 __raw_readl(bank->base + OMAP24XX_GPIO_OE);
2109 gpio_context[i].leveldetect0 =
2110 __raw_readl(bank->base + OMAP24XX_GPIO_LEVELDETECT0);
2111 gpio_context[i].leveldetect1 =
2112 __raw_readl(bank->base + OMAP24XX_GPIO_LEVELDETECT1);
2113 gpio_context[i].risingdetect =
2114 __raw_readl(bank->base + OMAP24XX_GPIO_RISINGDETECT);
2115 gpio_context[i].fallingdetect =
2116 __raw_readl(bank->base + OMAP24XX_GPIO_FALLINGDETECT);
2117 gpio_context[i].dataout =
2118 __raw_readl(bank->base + OMAP24XX_GPIO_DATAOUT);
2119 gpio_context[i].setwkuena =
2120 __raw_readl(bank->base + OMAP24XX_GPIO_SETWKUENA);
2121 gpio_context[i].setdataout =
2122 __raw_readl(bank->base + OMAP24XX_GPIO_SETDATAOUT);
2123 }
2124}
2125
2126/* restore the required registers of bank 2-6 */
2127void omap_gpio_restore_context(void)
2128{
2129 int i;
2130
2131 for (i = 1; i < gpio_bank_count; i++) {
2132 struct gpio_bank *bank = &gpio_bank[i];
2133 __raw_writel(gpio_context[i].sysconfig,
2134 bank->base + OMAP24XX_GPIO_SYSCONFIG);
2135 __raw_writel(gpio_context[i].irqenable1,
2136 bank->base + OMAP24XX_GPIO_IRQENABLE1);
2137 __raw_writel(gpio_context[i].irqenable2,
2138 bank->base + OMAP24XX_GPIO_IRQENABLE2);
2139 __raw_writel(gpio_context[i].wake_en,
2140 bank->base + OMAP24XX_GPIO_WAKE_EN);
2141 __raw_writel(gpio_context[i].ctrl,
2142 bank->base + OMAP24XX_GPIO_CTRL);
2143 __raw_writel(gpio_context[i].oe,
2144 bank->base + OMAP24XX_GPIO_OE);
2145 __raw_writel(gpio_context[i].leveldetect0,
2146 bank->base + OMAP24XX_GPIO_LEVELDETECT0);
2147 __raw_writel(gpio_context[i].leveldetect1,
2148 bank->base + OMAP24XX_GPIO_LEVELDETECT1);
2149 __raw_writel(gpio_context[i].risingdetect,
2150 bank->base + OMAP24XX_GPIO_RISINGDETECT);
2151 __raw_writel(gpio_context[i].fallingdetect,
2152 bank->base + OMAP24XX_GPIO_FALLINGDETECT);
2153 __raw_writel(gpio_context[i].dataout,
2154 bank->base + OMAP24XX_GPIO_DATAOUT);
2155 __raw_writel(gpio_context[i].setwkuena,
2156 bank->base + OMAP24XX_GPIO_SETWKUENA);
2157 __raw_writel(gpio_context[i].setdataout,
2158 bank->base + OMAP24XX_GPIO_SETDATAOUT);
2159 }
2160}
2161#endif
2162
2109/* 2163/*
2110 * This may get called early from board specific init 2164 * This may get called early from board specific init
2111 * for boards that have interrupts routed via FPGA. 2165 * for boards that have interrupts routed via FPGA.
@@ -2160,8 +2214,7 @@ static int dbg_gpio_show(struct seq_file *s, void *unused)
2160 2214
2161 if (bank_is_mpuio(bank)) 2215 if (bank_is_mpuio(bank))
2162 gpio = OMAP_MPUIO(0); 2216 gpio = OMAP_MPUIO(0);
2163 else if (cpu_class_is_omap2() || cpu_is_omap730() || 2217 else if (cpu_class_is_omap2() || cpu_is_omap7xx())
2164 cpu_is_omap850())
2165 bankwidth = 32; 2218 bankwidth = 32;
2166 2219
2167 for (j = 0; j < bankwidth; j++, gpio++, mask <<= 1) { 2220 for (j = 0; j < bankwidth; j++, gpio++, mask <<= 1) {
diff --git a/arch/arm/plat-omap/i2c.c b/arch/arm/plat-omap/i2c.c
index 8b848391f0c8..c08362dbb8ed 100644
--- a/arch/arm/plat-omap/i2c.c
+++ b/arch/arm/plat-omap/i2c.c
@@ -27,7 +27,7 @@
27#include <linux/platform_device.h> 27#include <linux/platform_device.h>
28#include <linux/i2c.h> 28#include <linux/i2c.h>
29#include <mach/irqs.h> 29#include <mach/irqs.h>
30#include <mach/mux.h> 30#include <plat/mux.h>
31 31
32#define OMAP_I2C_SIZE 0x3f 32#define OMAP_I2C_SIZE 0x3f
33#define OMAP1_I2C_BASE 0xfffb3800 33#define OMAP1_I2C_BASE 0xfffb3800
diff --git a/arch/arm/plat-omap/include/mach/blizzard.h b/arch/arm/plat-omap/include/plat/blizzard.h
index 8d160f171372..8d160f171372 100644
--- a/arch/arm/plat-omap/include/mach/blizzard.h
+++ b/arch/arm/plat-omap/include/plat/blizzard.h
diff --git a/arch/arm/plat-omap/include/mach/board-ams-delta.h b/arch/arm/plat-omap/include/plat/board-ams-delta.h
index 51b102dc906b..51b102dc906b 100644
--- a/arch/arm/plat-omap/include/mach/board-ams-delta.h
+++ b/arch/arm/plat-omap/include/plat/board-ams-delta.h
diff --git a/arch/arm/plat-omap/include/mach/board-sx1.h b/arch/arm/plat-omap/include/plat/board-sx1.h
index 355adbdaae33..355adbdaae33 100644
--- a/arch/arm/plat-omap/include/mach/board-sx1.h
+++ b/arch/arm/plat-omap/include/plat/board-sx1.h
diff --git a/arch/arm/plat-omap/include/mach/board-voiceblue.h b/arch/arm/plat-omap/include/plat/board-voiceblue.h
index 27916b210f57..27916b210f57 100644
--- a/arch/arm/plat-omap/include/mach/board-voiceblue.h
+++ b/arch/arm/plat-omap/include/plat/board-voiceblue.h
diff --git a/arch/arm/plat-omap/include/mach/board.h b/arch/arm/plat-omap/include/plat/board.h
index 8e913c322810..abb17b604f82 100644
--- a/arch/arm/plat-omap/include/mach/board.h
+++ b/arch/arm/plat-omap/include/plat/board.h
@@ -12,7 +12,19 @@
12 12
13#include <linux/types.h> 13#include <linux/types.h>
14 14
15#include <mach/gpio-switch.h> 15#include <plat/gpio-switch.h>
16
17/*
18 * OMAP35x EVM revision
19 * Run time detection of EVM revision is done by reading Ethernet
20 * PHY ID -
21 * GEN_1 = 0x01150000
22 * GEN_2 = 0x92200000
23 */
24enum {
25 OMAP3EVM_BOARD_GEN_1 = 0, /* EVM Rev between A - D */
26 OMAP3EVM_BOARD_GEN_2, /* EVM Rev >= Rev E */
27};
16 28
17/* Different peripheral ids */ 29/* Different peripheral ids */
18#define OMAP_TAG_CLOCK 0x4f01 30#define OMAP_TAG_CLOCK 0x4f01
@@ -157,4 +169,10 @@ extern int omap_board_config_size;
157/* for TI reference platforms sharing the same debug card */ 169/* for TI reference platforms sharing the same debug card */
158extern int debug_card_init(u32 addr, unsigned gpio); 170extern int debug_card_init(u32 addr, unsigned gpio);
159 171
172/* OMAP3EVM revision */
173#if defined(CONFIG_MACH_OMAP3EVM)
174u8 get_omap3_evm_rev(void);
175#else
176#define get_omap3_evm_rev() (-EINVAL)
177#endif
160#endif 178#endif
diff --git a/arch/arm/plat-omap/include/mach/clkdev.h b/arch/arm/plat-omap/include/plat/clkdev.h
index 730c49d1ebd8..730c49d1ebd8 100644
--- a/arch/arm/plat-omap/include/mach/clkdev.h
+++ b/arch/arm/plat-omap/include/plat/clkdev.h
diff --git a/arch/arm/plat-omap/include/mach/clock.h b/arch/arm/plat-omap/include/plat/clock.h
index 4b8b0d65cbf2..4b8b0d65cbf2 100644
--- a/arch/arm/plat-omap/include/mach/clock.h
+++ b/arch/arm/plat-omap/include/plat/clock.h
diff --git a/arch/arm/plat-omap/include/mach/clockdomain.h b/arch/arm/plat-omap/include/plat/clockdomain.h
index 99ebd886f134..eb734826e64e 100644
--- a/arch/arm/plat-omap/include/mach/clockdomain.h
+++ b/arch/arm/plat-omap/include/plat/clockdomain.h
@@ -16,9 +16,9 @@
16#ifndef __ASM_ARM_ARCH_OMAP_CLOCKDOMAIN_H 16#ifndef __ASM_ARM_ARCH_OMAP_CLOCKDOMAIN_H
17#define __ASM_ARM_ARCH_OMAP_CLOCKDOMAIN_H 17#define __ASM_ARM_ARCH_OMAP_CLOCKDOMAIN_H
18 18
19#include <mach/powerdomain.h> 19#include <plat/powerdomain.h>
20#include <mach/clock.h> 20#include <plat/clock.h>
21#include <mach/cpu.h> 21#include <plat/cpu.h>
22 22
23/* Clockdomain capability flags */ 23/* Clockdomain capability flags */
24#define CLKDM_CAN_FORCE_SLEEP (1 << 0) 24#define CLKDM_CAN_FORCE_SLEEP (1 << 0)
diff --git a/arch/arm/plat-omap/include/mach/common.h b/arch/arm/plat-omap/include/plat/common.h
index fdeab421b4dc..064f1730f43b 100644
--- a/arch/arm/plat-omap/include/mach/common.h
+++ b/arch/arm/plat-omap/include/plat/common.h
@@ -31,6 +31,9 @@
31 31
32struct sys_timer; 32struct sys_timer;
33 33
34/* used by omap-smp.c and board-4430sdp.c */
35extern void __iomem *gic_cpu_base_addr;
36
34extern void omap_map_common_io(void); 37extern void omap_map_common_io(void);
35extern struct sys_timer omap_timer; 38extern struct sys_timer omap_timer;
36#if defined(CONFIG_I2C_OMAP) || defined(CONFIG_I2C_OMAP_MODULE) 39#if defined(CONFIG_I2C_OMAP) || defined(CONFIG_I2C_OMAP_MODULE)
diff --git a/arch/arm/plat-omap/include/mach/control.h b/arch/arm/plat-omap/include/plat/control.h
index 826d317cdbec..2ae884378638 100644
--- a/arch/arm/plat-omap/include/mach/control.h
+++ b/arch/arm/plat-omap/include/plat/control.h
@@ -20,15 +20,18 @@
20 20
21#ifndef __ASSEMBLY__ 21#ifndef __ASSEMBLY__
22#define OMAP242X_CTRL_REGADDR(reg) \ 22#define OMAP242X_CTRL_REGADDR(reg) \
23 OMAP2_IO_ADDRESS(OMAP242X_CTRL_BASE + (reg)) 23 OMAP2_L4_IO_ADDRESS(OMAP242X_CTRL_BASE + (reg))
24#define OMAP243X_CTRL_REGADDR(reg) \ 24#define OMAP243X_CTRL_REGADDR(reg) \
25 OMAP2_IO_ADDRESS(OMAP243X_CTRL_BASE + (reg)) 25 OMAP2_L4_IO_ADDRESS(OMAP243X_CTRL_BASE + (reg))
26#define OMAP343X_CTRL_REGADDR(reg) \ 26#define OMAP343X_CTRL_REGADDR(reg) \
27 OMAP2_IO_ADDRESS(OMAP343X_CTRL_BASE + (reg)) 27 OMAP2_L4_IO_ADDRESS(OMAP343X_CTRL_BASE + (reg))
28#else 28#else
29#define OMAP242X_CTRL_REGADDR(reg) OMAP2_IO_ADDRESS(OMAP242X_CTRL_BASE + (reg)) 29#define OMAP242X_CTRL_REGADDR(reg) \
30#define OMAP243X_CTRL_REGADDR(reg) OMAP2_IO_ADDRESS(OMAP243X_CTRL_BASE + (reg)) 30 OMAP2_L4_IO_ADDRESS(OMAP242X_CTRL_BASE + (reg))
31#define OMAP343X_CTRL_REGADDR(reg) OMAP2_IO_ADDRESS(OMAP343X_CTRL_BASE + (reg)) 31#define OMAP243X_CTRL_REGADDR(reg) \
32 OMAP2_L4_IO_ADDRESS(OMAP243X_CTRL_BASE + (reg))
33#define OMAP343X_CTRL_REGADDR(reg) \
34 OMAP2_L4_IO_ADDRESS(OMAP343X_CTRL_BASE + (reg))
32#endif /* __ASSEMBLY__ */ 35#endif /* __ASSEMBLY__ */
33 36
34/* 37/*
@@ -109,6 +112,8 @@
109#define OMAP24XX_CONTROL_TEST_KEY_8 (OMAP2_CONTROL_GENERAL + 0x00e0) 112#define OMAP24XX_CONTROL_TEST_KEY_8 (OMAP2_CONTROL_GENERAL + 0x00e0)
110#define OMAP24XX_CONTROL_TEST_KEY_9 (OMAP2_CONTROL_GENERAL + 0x00e4) 113#define OMAP24XX_CONTROL_TEST_KEY_9 (OMAP2_CONTROL_GENERAL + 0x00e4)
111 114
115#define OMAP343X_CONTROL_PADCONF_SYSNIRQ (OMAP2_CONTROL_INTERFACE + 0x01b0)
116
112/* 34xx-only CONTROL_GENERAL register offsets */ 117/* 34xx-only CONTROL_GENERAL register offsets */
113#define OMAP343X_CONTROL_PADCONF_OFF (OMAP2_CONTROL_GENERAL + 0x0000) 118#define OMAP343X_CONTROL_PADCONF_OFF (OMAP2_CONTROL_GENERAL + 0x0000)
114#define OMAP343X_CONTROL_MEM_DFTRW0 (OMAP2_CONTROL_GENERAL + 0x0008) 119#define OMAP343X_CONTROL_MEM_DFTRW0 (OMAP2_CONTROL_GENERAL + 0x0008)
@@ -141,8 +146,51 @@
141#define OMAP343X_CONTROL_TEST_KEY_13 (OMAP2_CONTROL_GENERAL + 0x00fc) 146#define OMAP343X_CONTROL_TEST_KEY_13 (OMAP2_CONTROL_GENERAL + 0x00fc)
142#define OMAP343X_CONTROL_IVA2_BOOTADDR (OMAP2_CONTROL_GENERAL + 0x0190) 147#define OMAP343X_CONTROL_IVA2_BOOTADDR (OMAP2_CONTROL_GENERAL + 0x0190)
143#define OMAP343X_CONTROL_IVA2_BOOTMOD (OMAP2_CONTROL_GENERAL + 0x0194) 148#define OMAP343X_CONTROL_IVA2_BOOTMOD (OMAP2_CONTROL_GENERAL + 0x0194)
144#define OMAP343X_CONTROL_PBIAS_LITE (OMAP2_CONTROL_GENERAL + 0x02b0) 149#define OMAP343X_CONTROL_DEBOBS(i) (OMAP2_CONTROL_GENERAL + 0x01B0 \
145#define OMAP343X_CONTROL_TEMP_SENSOR (OMAP2_CONTROL_GENERAL + 0x02b4) 150 + ((i) >> 1) * 4 + (!(i) & 1) * 2)
151#define OMAP343X_CONTROL_PROG_IO0 (OMAP2_CONTROL_GENERAL + 0x01D4)
152#define OMAP343X_CONTROL_PROG_IO1 (OMAP2_CONTROL_GENERAL + 0x01D8)
153#define OMAP343X_CONTROL_DSS_DPLL_SPREADING (OMAP2_CONTROL_GENERAL + 0x01E0)
154#define OMAP343X_CONTROL_CORE_DPLL_SPREADING (OMAP2_CONTROL_GENERAL + 0x01E4)
155#define OMAP343X_CONTROL_PER_DPLL_SPREADING (OMAP2_CONTROL_GENERAL + 0x01E8)
156#define OMAP343X_CONTROL_USBHOST_DPLL_SPREADING (OMAP2_CONTROL_GENERAL + 0x01EC)
157#define OMAP343X_CONTROL_PBIAS_LITE (OMAP2_CONTROL_GENERAL + 0x02B0)
158#define OMAP343X_CONTROL_TEMP_SENSOR (OMAP2_CONTROL_GENERAL + 0x02B4)
159#define OMAP343X_CONTROL_SRAMLDO4 (OMAP2_CONTROL_GENERAL + 0x02B8)
160#define OMAP343X_CONTROL_SRAMLDO5 (OMAP2_CONTROL_GENERAL + 0x02C0)
161#define OMAP343X_CONTROL_CSI (OMAP2_CONTROL_GENERAL + 0x02C4)
162
163
164/* 34xx PADCONF register offsets */
165#define OMAP343X_PADCONF_ETK(i) (OMAP2_CONTROL_PADCONFS + 0x5a8 + \
166 (i)*2)
167#define OMAP343X_PADCONF_ETK_CLK OMAP343X_PADCONF_ETK(0)
168#define OMAP343X_PADCONF_ETK_CTL OMAP343X_PADCONF_ETK(1)
169#define OMAP343X_PADCONF_ETK_D0 OMAP343X_PADCONF_ETK(2)
170#define OMAP343X_PADCONF_ETK_D1 OMAP343X_PADCONF_ETK(3)
171#define OMAP343X_PADCONF_ETK_D2 OMAP343X_PADCONF_ETK(4)
172#define OMAP343X_PADCONF_ETK_D3 OMAP343X_PADCONF_ETK(5)
173#define OMAP343X_PADCONF_ETK_D4 OMAP343X_PADCONF_ETK(6)
174#define OMAP343X_PADCONF_ETK_D5 OMAP343X_PADCONF_ETK(7)
175#define OMAP343X_PADCONF_ETK_D6 OMAP343X_PADCONF_ETK(8)
176#define OMAP343X_PADCONF_ETK_D7 OMAP343X_PADCONF_ETK(9)
177#define OMAP343X_PADCONF_ETK_D8 OMAP343X_PADCONF_ETK(10)
178#define OMAP343X_PADCONF_ETK_D9 OMAP343X_PADCONF_ETK(11)
179#define OMAP343X_PADCONF_ETK_D10 OMAP343X_PADCONF_ETK(12)
180#define OMAP343X_PADCONF_ETK_D11 OMAP343X_PADCONF_ETK(13)
181#define OMAP343X_PADCONF_ETK_D12 OMAP343X_PADCONF_ETK(14)
182#define OMAP343X_PADCONF_ETK_D13 OMAP343X_PADCONF_ETK(15)
183#define OMAP343X_PADCONF_ETK_D14 OMAP343X_PADCONF_ETK(16)
184#define OMAP343X_PADCONF_ETK_D15 OMAP343X_PADCONF_ETK(17)
185
186/* 34xx GENERAL_WKUP regist offsets */
187#define OMAP343X_CONTROL_WKUP_DEBOBSMUX(i) (OMAP343X_CONTROL_GENERAL_WKUP + \
188 0x008 + (i))
189#define OMAP343X_CONTROL_WKUP_DEBOBS0 (OMAP343X_CONTROL_GENERAL_WKUP + 0x008)
190#define OMAP343X_CONTROL_WKUP_DEBOBS1 (OMAP343X_CONTROL_GENERAL_WKUP + 0x00C)
191#define OMAP343X_CONTROL_WKUP_DEBOBS2 (OMAP343X_CONTROL_GENERAL_WKUP + 0x010)
192#define OMAP343X_CONTROL_WKUP_DEBOBS3 (OMAP343X_CONTROL_GENERAL_WKUP + 0x014)
193#define OMAP343X_CONTROL_WKUP_DEBOBS4 (OMAP343X_CONTROL_GENERAL_WKUP + 0x018)
146 194
147/* 34xx D2D idle-related pins, handled by PM core */ 195/* 34xx D2D idle-related pins, handled by PM core */
148#define OMAP3_PADCONF_SAD2D_MSTANDBY 0x250 196#define OMAP3_PADCONF_SAD2D_MSTANDBY 0x250
@@ -193,6 +241,9 @@
193#define OMAP2_PBIASLITEPWRDNZ0 (1 << 1) 241#define OMAP2_PBIASLITEPWRDNZ0 (1 << 1)
194#define OMAP2_PBIASLITEVMODE0 (1 << 0) 242#define OMAP2_PBIASLITEVMODE0 (1 << 0)
195 243
244/* CONTROL_PROG_IO1 bits */
245#define OMAP3630_PRG_SDMMC1_SPEEDCTRL (1 << 20)
246
196/* CONTROL_IVA2_BOOTMOD bits */ 247/* CONTROL_IVA2_BOOTMOD bits */
197#define OMAP3_IVA2_BOOTMOD_SHIFT 0 248#define OMAP3_IVA2_BOOTMOD_SHIFT 0
198#define OMAP3_IVA2_BOOTMOD_MASK (0xf << 0) 249#define OMAP3_IVA2_BOOTMOD_MASK (0xf << 0)
@@ -202,6 +253,44 @@
202#define OMAP3_PADCONF_WAKEUPEVENT0 (1 << 15) 253#define OMAP3_PADCONF_WAKEUPEVENT0 (1 << 15)
203#define OMAP3_PADCONF_WAKEUPENABLE0 (1 << 14) 254#define OMAP3_PADCONF_WAKEUPENABLE0 (1 << 14)
204 255
256#define OMAP343X_SCRATCHPAD_ROM (OMAP343X_CTRL_BASE + 0x860)
257#define OMAP343X_SCRATCHPAD (OMAP343X_CTRL_BASE + 0x910)
258#define OMAP343X_SCRATCHPAD_ROM_OFFSET 0x19C
259
260/*
261 * CONTROL OMAP STATUS register to identify OMAP3 features
262 */
263#define OMAP3_CONTROL_OMAP_STATUS 0x044c
264
265#define OMAP3_SGX_SHIFT 13
266#define OMAP3_SGX_MASK (3 << OMAP3_SGX_SHIFT)
267#define FEAT_SGX_FULL 0
268#define FEAT_SGX_HALF 1
269#define FEAT_SGX_NONE 2
270
271#define OMAP3_IVA_SHIFT 12
272#define OMAP3_IVA_MASK (1 << OMAP3_SGX_SHIFT)
273#define FEAT_IVA 0
274#define FEAT_IVA_NONE 1
275
276#define OMAP3_L2CACHE_SHIFT 10
277#define OMAP3_L2CACHE_MASK (3 << OMAP3_L2CACHE_SHIFT)
278#define FEAT_L2CACHE_NONE 0
279#define FEAT_L2CACHE_64KB 1
280#define FEAT_L2CACHE_128KB 2
281#define FEAT_L2CACHE_256KB 3
282
283#define OMAP3_ISP_SHIFT 5
284#define OMAP3_ISP_MASK (1<< OMAP3_ISP_SHIFT)
285#define FEAT_ISP 0
286#define FEAT_ISP_NONE 1
287
288#define OMAP3_NEON_SHIFT 4
289#define OMAP3_NEON_MASK (1<< OMAP3_NEON_SHIFT)
290#define FEAT_NEON 0
291#define FEAT_NEON_NONE 1
292
293
205#ifndef __ASSEMBLY__ 294#ifndef __ASSEMBLY__
206#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) || \ 295#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) || \
207 defined(CONFIG_ARCH_OMAP4) 296 defined(CONFIG_ARCH_OMAP4)
@@ -212,6 +301,15 @@ extern u32 omap_ctrl_readl(u16 offset);
212extern void omap_ctrl_writeb(u8 val, u16 offset); 301extern void omap_ctrl_writeb(u8 val, u16 offset);
213extern void omap_ctrl_writew(u16 val, u16 offset); 302extern void omap_ctrl_writew(u16 val, u16 offset);
214extern void omap_ctrl_writel(u32 val, u16 offset); 303extern void omap_ctrl_writel(u32 val, u16 offset);
304
305extern void omap3_save_scratchpad_contents(void);
306extern void omap3_clear_scratchpad_contents(void);
307extern u32 *get_restore_pointer(void);
308extern u32 *get_es3_restore_pointer(void);
309extern u32 omap3_arm_context[128];
310extern void omap3_control_save_context(void);
311extern void omap3_control_restore_context(void);
312
215#else 313#else
216#define omap_ctrl_base_get() 0 314#define omap_ctrl_base_get() 0
217#define omap_ctrl_readb(x) 0 315#define omap_ctrl_readb(x) 0
diff --git a/arch/arm/plat-omap/include/mach/cpu.h b/arch/arm/plat-omap/include/plat/cpu.h
index f129efb3075e..2e1789001dfe 100644
--- a/arch/arm/plat-omap/include/mach/cpu.h
+++ b/arch/arm/plat-omap/include/plat/cpu.h
@@ -30,6 +30,8 @@
30#ifndef __ASM_ARCH_OMAP_CPU_H 30#ifndef __ASM_ARCH_OMAP_CPU_H
31#define __ASM_ARCH_OMAP_CPU_H 31#define __ASM_ARCH_OMAP_CPU_H
32 32
33#include <linux/bitops.h>
34
33/* 35/*
34 * Omap device type i.e. EMU/HS/TST/GP/BAD 36 * Omap device type i.e. EMU/HS/TST/GP/BAD
35 */ 37 */
@@ -57,6 +59,23 @@ struct omap_chip_id {
57unsigned int omap_rev(void); 59unsigned int omap_rev(void);
58 60
59/* 61/*
62 * Define CPU revision bits
63 *
64 * Verbose meaning of the revision bits may be different for a silicon
65 * family. This difference can be handled separately.
66 */
67#define OMAP_REVBITS_00 0x00
68#define OMAP_REVBITS_10 0x10
69#define OMAP_REVBITS_20 0x20
70#define OMAP_REVBITS_30 0x30
71#define OMAP_REVBITS_40 0x40
72
73/*
74 * Get the CPU revision for OMAP devices
75 */
76#define GET_OMAP_REVISION() ((omap_rev() >> 8) & 0xff)
77
78/*
60 * Test if multicore OMAP support is needed 79 * Test if multicore OMAP support is needed
61 */ 80 */
62#undef MULTI_OMAP1 81#undef MULTI_OMAP1
@@ -161,6 +180,7 @@ IS_OMAP_CLASS(34xx, 0x34)
161IS_OMAP_SUBCLASS(242x, 0x242) 180IS_OMAP_SUBCLASS(242x, 0x242)
162IS_OMAP_SUBCLASS(243x, 0x243) 181IS_OMAP_SUBCLASS(243x, 0x243)
163IS_OMAP_SUBCLASS(343x, 0x343) 182IS_OMAP_SUBCLASS(343x, 0x343)
183IS_OMAP_SUBCLASS(363x, 0x363)
164 184
165#define cpu_is_omap7xx() 0 185#define cpu_is_omap7xx() 0
166#define cpu_is_omap15xx() 0 186#define cpu_is_omap15xx() 0
@@ -264,6 +284,8 @@ IS_OMAP_SUBCLASS(343x, 0x343)
264 * cpu_is_omap2423(): True for OMAP2423 284 * cpu_is_omap2423(): True for OMAP2423
265 * cpu_is_omap2430(): True for OMAP2430 285 * cpu_is_omap2430(): True for OMAP2430
266 * cpu_is_omap3430(): True for OMAP3430 286 * cpu_is_omap3430(): True for OMAP3430
287 * cpu_is_omap3505(): True for OMAP3505
288 * cpu_is_omap3517(): True for OMAP3517
267 */ 289 */
268#define GET_OMAP_TYPE ((omap_rev() >> 16) & 0xffff) 290#define GET_OMAP_TYPE ((omap_rev() >> 16) & 0xffff)
269 291
@@ -287,6 +309,8 @@ IS_OMAP_TYPE(2422, 0x2422)
287IS_OMAP_TYPE(2423, 0x2423) 309IS_OMAP_TYPE(2423, 0x2423)
288IS_OMAP_TYPE(2430, 0x2430) 310IS_OMAP_TYPE(2430, 0x2430)
289IS_OMAP_TYPE(3430, 0x3430) 311IS_OMAP_TYPE(3430, 0x3430)
312IS_OMAP_TYPE(3505, 0x3505)
313IS_OMAP_TYPE(3517, 0x3517)
290 314
291#define cpu_is_omap310() 0 315#define cpu_is_omap310() 0
292#define cpu_is_omap730() 0 316#define cpu_is_omap730() 0
@@ -301,7 +325,14 @@ IS_OMAP_TYPE(3430, 0x3430)
301#define cpu_is_omap2422() 0 325#define cpu_is_omap2422() 0
302#define cpu_is_omap2423() 0 326#define cpu_is_omap2423() 0
303#define cpu_is_omap2430() 0 327#define cpu_is_omap2430() 0
328#define cpu_is_omap3503() 0
329#define cpu_is_omap3515() 0
330#define cpu_is_omap3525() 0
331#define cpu_is_omap3530() 0
332#define cpu_is_omap3505() 0
333#define cpu_is_omap3517() 0
304#define cpu_is_omap3430() 0 334#define cpu_is_omap3430() 0
335#define cpu_is_omap3630() 0
305 336
306/* 337/*
307 * Whether we have MULTI_OMAP1 or not, we still need to distinguish 338 * Whether we have MULTI_OMAP1 or not, we still need to distinguish
@@ -351,7 +382,27 @@ IS_OMAP_TYPE(3430, 0x3430)
351 382
352#if defined(CONFIG_ARCH_OMAP34XX) 383#if defined(CONFIG_ARCH_OMAP34XX)
353# undef cpu_is_omap3430 384# undef cpu_is_omap3430
385# undef cpu_is_omap3503
386# undef cpu_is_omap3515
387# undef cpu_is_omap3525
388# undef cpu_is_omap3530
389# undef cpu_is_omap3505
390# undef cpu_is_omap3517
354# define cpu_is_omap3430() is_omap3430() 391# define cpu_is_omap3430() is_omap3430()
392# define cpu_is_omap3503() (cpu_is_omap3430() && \
393 (!omap3_has_iva()) && \
394 (!omap3_has_sgx()))
395# define cpu_is_omap3515() (cpu_is_omap3430() && \
396 (omap3_has_iva()) && \
397 (!omap3_has_sgx()))
398# define cpu_is_omap3525() (cpu_is_omap3430() && \
399 (omap3_has_sgx()) && \
400 (!omap3_has_iva()))
401# define cpu_is_omap3530() (cpu_is_omap3430())
402# define cpu_is_omap3505() is_omap3505()
403# define cpu_is_omap3517() is_omap3517()
404# undef cpu_is_omap3630
405# define cpu_is_omap3630() is_omap363x()
355#endif 406#endif
356 407
357# if defined(CONFIG_ARCH_OMAP4) 408# if defined(CONFIG_ARCH_OMAP4)
@@ -382,6 +433,16 @@ IS_OMAP_TYPE(3430, 0x3430)
382#define OMAP3430_REV_ES3_0 0x34303034 433#define OMAP3430_REV_ES3_0 0x34303034
383#define OMAP3430_REV_ES3_1 0x34304034 434#define OMAP3430_REV_ES3_1 0x34304034
384 435
436#define OMAP3630_REV_ES1_0 0x36300034
437
438#define OMAP35XX_CLASS 0x35000034
439#define OMAP3503_REV(v) (OMAP35XX_CLASS | (0x3503 << 16) | (v << 12))
440#define OMAP3515_REV(v) (OMAP35XX_CLASS | (0x3515 << 16) | (v << 12))
441#define OMAP3525_REV(v) (OMAP35XX_CLASS | (0x3525 << 16) | (v << 12))
442#define OMAP3530_REV(v) (OMAP35XX_CLASS | (0x3530 << 16) | (v << 12))
443#define OMAP3505_REV(v) (OMAP35XX_CLASS | (0x3505 << 16) | (v << 12))
444#define OMAP3517_REV(v) (OMAP35XX_CLASS | (0x3517 << 16) | (v << 12))
445
385#define OMAP443X_CLASS 0x44300034 446#define OMAP443X_CLASS 0x44300034
386 447
387/* 448/*
@@ -405,6 +466,7 @@ IS_OMAP_TYPE(3430, 0x3430)
405#define CHIP_IS_OMAP3430ES2 (1 << 4) 466#define CHIP_IS_OMAP3430ES2 (1 << 4)
406#define CHIP_IS_OMAP3430ES3_0 (1 << 5) 467#define CHIP_IS_OMAP3430ES3_0 (1 << 5)
407#define CHIP_IS_OMAP3430ES3_1 (1 << 6) 468#define CHIP_IS_OMAP3430ES3_1 (1 << 6)
469#define CHIP_IS_OMAP3630ES1 (1 << 7)
408 470
409#define CHIP_IS_OMAP24XX (CHIP_IS_OMAP2420 | CHIP_IS_OMAP2430) 471#define CHIP_IS_OMAP24XX (CHIP_IS_OMAP2420 | CHIP_IS_OMAP2430)
410 472
@@ -416,11 +478,36 @@ IS_OMAP_TYPE(3430, 0x3430)
416 */ 478 */
417#define CHIP_GE_OMAP3430ES2 (CHIP_IS_OMAP3430ES2 | \ 479#define CHIP_GE_OMAP3430ES2 (CHIP_IS_OMAP3430ES2 | \
418 CHIP_IS_OMAP3430ES3_0 | \ 480 CHIP_IS_OMAP3430ES3_0 | \
419 CHIP_IS_OMAP3430ES3_1) 481 CHIP_IS_OMAP3430ES3_1 | \
420#define CHIP_GE_OMAP3430ES3_1 (CHIP_IS_OMAP3430ES3_1) 482 CHIP_IS_OMAP3630ES1)
483#define CHIP_GE_OMAP3430ES3_1 (CHIP_IS_OMAP3430ES3_1 | \
484 CHIP_IS_OMAP3630ES1)
421 485
422 486
423int omap_chip_is(struct omap_chip_id oci); 487int omap_chip_is(struct omap_chip_id oci);
424void omap2_check_revision(void); 488void omap2_check_revision(void);
425 489
490/*
491 * Runtime detection of OMAP3 features
492 */
493extern u32 omap3_features;
494
495#define OMAP3_HAS_L2CACHE BIT(0)
496#define OMAP3_HAS_IVA BIT(1)
497#define OMAP3_HAS_SGX BIT(2)
498#define OMAP3_HAS_NEON BIT(3)
499#define OMAP3_HAS_ISP BIT(4)
500
501#define OMAP3_HAS_FEATURE(feat,flag) \
502static inline unsigned int omap3_has_ ##feat(void) \
503{ \
504 return (omap3_features & OMAP3_HAS_ ##flag); \
505} \
506
507OMAP3_HAS_FEATURE(l2cache, L2CACHE)
508OMAP3_HAS_FEATURE(sgx, SGX)
509OMAP3_HAS_FEATURE(iva, IVA)
510OMAP3_HAS_FEATURE(neon, NEON)
511OMAP3_HAS_FEATURE(isp, ISP)
512
426#endif 513#endif
diff --git a/arch/arm/plat-omap/include/mach/dma.h b/arch/arm/plat-omap/include/plat/dma.h
index 72f680b7180d..1c017b29b7e9 100644
--- a/arch/arm/plat-omap/include/mach/dma.h
+++ b/arch/arm/plat-omap/include/plat/dma.h
@@ -633,6 +633,11 @@ extern void omap_set_dma_dst_endian_type(int lch, enum end_type etype);
633extern void omap_set_dma_src_endian_type(int lch, enum end_type etype); 633extern void omap_set_dma_src_endian_type(int lch, enum end_type etype);
634extern int omap_get_dma_index(int lch, int *ei, int *fi); 634extern int omap_get_dma_index(int lch, int *ei, int *fi);
635 635
636void omap_dma_global_context_save(void);
637void omap_dma_global_context_restore(void);
638
639extern void omap_dma_disable_irq(int lch);
640
636/* Chaining APIs */ 641/* Chaining APIs */
637#ifndef CONFIG_ARCH_OMAP1 642#ifndef CONFIG_ARCH_OMAP1
638extern int omap_request_dma_chain(int dev_id, const char *dev_name, 643extern int omap_request_dma_chain(int dev_id, const char *dev_name,
diff --git a/arch/arm/plat-omap/include/mach/dmtimer.h b/arch/arm/plat-omap/include/plat/dmtimer.h
index 20f1054c0a80..20f1054c0a80 100644
--- a/arch/arm/plat-omap/include/mach/dmtimer.h
+++ b/arch/arm/plat-omap/include/plat/dmtimer.h
diff --git a/arch/arm/plat-omap/include/mach/dsp_common.h b/arch/arm/plat-omap/include/plat/dsp_common.h
index da97736f3efa..da97736f3efa 100644
--- a/arch/arm/plat-omap/include/mach/dsp_common.h
+++ b/arch/arm/plat-omap/include/plat/dsp_common.h
diff --git a/arch/arm/plat-omap/include/mach/fpga.h b/arch/arm/plat-omap/include/plat/fpga.h
index f1864a652f7a..f1864a652f7a 100644
--- a/arch/arm/plat-omap/include/mach/fpga.h
+++ b/arch/arm/plat-omap/include/plat/fpga.h
diff --git a/arch/arm/plat-omap/include/mach/gpio-switch.h b/arch/arm/plat-omap/include/plat/gpio-switch.h
index 10da0e07c0cf..10da0e07c0cf 100644
--- a/arch/arm/plat-omap/include/mach/gpio-switch.h
+++ b/arch/arm/plat-omap/include/plat/gpio-switch.h
diff --git a/arch/arm/plat-omap/include/mach/gpio.h b/arch/arm/plat-omap/include/plat/gpio.h
index 633ff688b928..de7c54731cbe 100644
--- a/arch/arm/plat-omap/include/mach/gpio.h
+++ b/arch/arm/plat-omap/include/plat/gpio.h
@@ -76,7 +76,8 @@ extern void omap2_gpio_prepare_for_retention(void);
76extern void omap2_gpio_resume_after_retention(void); 76extern void omap2_gpio_resume_after_retention(void);
77extern void omap_set_gpio_debounce(int gpio, int enable); 77extern void omap_set_gpio_debounce(int gpio, int enable);
78extern void omap_set_gpio_debounce_time(int gpio, int enable); 78extern void omap_set_gpio_debounce_time(int gpio, int enable);
79 79extern void omap_gpio_save_context(void);
80extern void omap_gpio_restore_context(void);
80/*-------------------------------------------------------------------------*/ 81/*-------------------------------------------------------------------------*/
81 82
82/* Wrappers for "new style" GPIO calls, using the new infrastructure 83/* Wrappers for "new style" GPIO calls, using the new infrastructure
diff --git a/arch/arm/plat-omap/include/mach/gpmc-smc91x.h b/arch/arm/plat-omap/include/plat/gpmc-smc91x.h
index b64fbee4d567..b64fbee4d567 100644
--- a/arch/arm/plat-omap/include/mach/gpmc-smc91x.h
+++ b/arch/arm/plat-omap/include/plat/gpmc-smc91x.h
diff --git a/arch/arm/plat-omap/include/mach/gpmc.h b/arch/arm/plat-omap/include/plat/gpmc.h
index 9c99cda77ba6..696e0ca051b7 100644
--- a/arch/arm/plat-omap/include/mach/gpmc.h
+++ b/arch/arm/plat-omap/include/plat/gpmc.h
@@ -52,6 +52,7 @@
52#define GPMC_CONFIG1_FCLK_DIV2 (GPMC_CONFIG1_FCLK_DIV(1)) 52#define GPMC_CONFIG1_FCLK_DIV2 (GPMC_CONFIG1_FCLK_DIV(1))
53#define GPMC_CONFIG1_FCLK_DIV3 (GPMC_CONFIG1_FCLK_DIV(2)) 53#define GPMC_CONFIG1_FCLK_DIV3 (GPMC_CONFIG1_FCLK_DIV(2))
54#define GPMC_CONFIG1_FCLK_DIV4 (GPMC_CONFIG1_FCLK_DIV(3)) 54#define GPMC_CONFIG1_FCLK_DIV4 (GPMC_CONFIG1_FCLK_DIV(3))
55#define GPMC_CONFIG7_CSVALID (1 << 6)
55 56
56/* 57/*
57 * Note that all values in this struct are in nanoseconds, while 58 * Note that all values in this struct are in nanoseconds, while
@@ -107,6 +108,8 @@ extern int gpmc_prefetch_enable(int cs, int dma_mode,
107 unsigned int u32_count, int is_write); 108 unsigned int u32_count, int is_write);
108extern void gpmc_prefetch_reset(void); 109extern void gpmc_prefetch_reset(void);
109extern int gpmc_prefetch_status(void); 110extern int gpmc_prefetch_status(void);
111extern void omap3_gpmc_save_context(void);
112extern void omap3_gpmc_restore_context(void);
110extern void __init gpmc_init(void); 113extern void __init gpmc_init(void);
111 114
112#endif 115#endif
diff --git a/arch/arm/plat-omap/include/mach/hardware.h b/arch/arm/plat-omap/include/plat/hardware.h
index 26c1fbff08aa..d5b26adfb890 100644
--- a/arch/arm/plat-omap/include/mach/hardware.h
+++ b/arch/arm/plat-omap/include/plat/hardware.h
@@ -39,9 +39,9 @@
39#include <asm/sizes.h> 39#include <asm/sizes.h>
40#ifndef __ASSEMBLER__ 40#ifndef __ASSEMBLER__
41#include <asm/types.h> 41#include <asm/types.h>
42#include <mach/cpu.h> 42#include <plat/cpu.h>
43#endif 43#endif
44#include <mach/serial.h> 44#include <plat/serial.h>
45 45
46/* 46/*
47 * --------------------------------------------------------------------------- 47 * ---------------------------------------------------------------------------
@@ -280,11 +280,11 @@
280 * --------------------------------------------------------------------------- 280 * ---------------------------------------------------------------------------
281 */ 281 */
282 282
283#include "omap730.h" 283#include <plat/omap7xx.h>
284#include "omap1510.h" 284#include <plat/omap1510.h>
285#include "omap16xx.h" 285#include <plat/omap16xx.h>
286#include "omap24xx.h" 286#include <plat/omap24xx.h>
287#include "omap34xx.h" 287#include <plat/omap34xx.h>
288#include "omap44xx.h" 288#include <plat/omap44xx.h>
289 289
290#endif /* __ASM_ARCH_OMAP_HARDWARE_H */ 290#endif /* __ASM_ARCH_OMAP_HARDWARE_H */
diff --git a/arch/arm/plat-omap/include/mach/hwa742.h b/arch/arm/plat-omap/include/plat/hwa742.h
index 886248d32b49..886248d32b49 100644
--- a/arch/arm/plat-omap/include/mach/hwa742.h
+++ b/arch/arm/plat-omap/include/plat/hwa742.h
diff --git a/arch/arm/plat-omap/include/mach/io.h b/arch/arm/plat-omap/include/plat/io.h
index 8d32df32b0b1..7e5319f907d1 100644
--- a/arch/arm/plat-omap/include/mach/io.h
+++ b/arch/arm/plat-omap/include/plat/io.h
@@ -63,8 +63,24 @@
63#define OMAP1_IO_OFFSET 0x01000000 /* Virtual IO = 0xfefb0000 */ 63#define OMAP1_IO_OFFSET 0x01000000 /* Virtual IO = 0xfefb0000 */
64#define OMAP1_IO_ADDRESS(pa) IOMEM((pa) - OMAP1_IO_OFFSET) 64#define OMAP1_IO_ADDRESS(pa) IOMEM((pa) - OMAP1_IO_OFFSET)
65 65
66#define OMAP2_IO_OFFSET 0x90000000 66#define OMAP2_L3_IO_OFFSET 0x90000000
67#define OMAP2_IO_ADDRESS(pa) IOMEM((pa) + OMAP2_IO_OFFSET) /* L3 and L4 */ 67#define OMAP2_L3_IO_ADDRESS(pa) IOMEM((pa) + OMAP2_L3_IO_OFFSET) /* L3 */
68
69
70#define OMAP2_L4_IO_OFFSET 0xb2000000
71#define OMAP2_L4_IO_ADDRESS(pa) IOMEM((pa) + OMAP2_L4_IO_OFFSET) /* L4 */
72
73#define OMAP4_L3_IO_OFFSET 0xb4000000
74#define OMAP4_L3_IO_ADDRESS(pa) IOMEM((pa) + OMAP4_L3_IO_OFFSET) /* L3 */
75
76#define OMAP4_L3_PER_IO_OFFSET 0xb1100000
77#define OMAP4_L3_PER_IO_ADDRESS(pa) IOMEM((pa) + OMAP4_L3_PER_IO_OFFSET)
78
79#define OMAP4_GPMC_IO_OFFSET 0xa9000000
80#define OMAP4_GPMC_IO_ADDRESS(pa) IOMEM((pa) + OMAP4_GPMC_IO_OFFSET)
81
82#define OMAP2_EMU_IO_OFFSET 0xaa800000 /* Emulation */
83#define OMAP2_EMU_IO_ADDRESS(pa) IOMEM((pa) + OMAP2_EMU_IO_OFFSET)
68 84
69/* 85/*
70 * ---------------------------------------------------------------------------- 86 * ----------------------------------------------------------------------------
@@ -83,24 +99,27 @@
83 */ 99 */
84 100
85/* We map both L3 and L4 on OMAP2 */ 101/* We map both L3 and L4 on OMAP2 */
86#define L3_24XX_PHYS L3_24XX_BASE /* 0x68000000 */ 102#define L3_24XX_PHYS L3_24XX_BASE /* 0x68000000 --> 0xf8000000*/
87#define L3_24XX_VIRT 0xf8000000 103#define L3_24XX_VIRT (L3_24XX_PHYS + OMAP2_L3_IO_OFFSET)
88#define L3_24XX_SIZE SZ_1M /* 44kB of 128MB used, want 1MB sect */ 104#define L3_24XX_SIZE SZ_1M /* 44kB of 128MB used, want 1MB sect */
89#define L4_24XX_PHYS L4_24XX_BASE /* 0x48000000 */ 105#define L4_24XX_PHYS L4_24XX_BASE /* 0x48000000 --> 0xfa000000 */
90#define L4_24XX_VIRT 0xd8000000 106#define L4_24XX_VIRT (L4_24XX_PHYS + OMAP2_L4_IO_OFFSET)
91#define L4_24XX_SIZE SZ_1M /* 1MB of 128MB used, want 1MB sect */ 107#define L4_24XX_SIZE SZ_1M /* 1MB of 128MB used, want 1MB sect */
92 108
93#define L4_WK_243X_PHYS L4_WK_243X_BASE /* 0x49000000 */ 109#define L4_WK_243X_PHYS L4_WK_243X_BASE /* 0x49000000 --> 0xfb000000 */
94#define L4_WK_243X_VIRT 0xd9000000 110#define L4_WK_243X_VIRT (L4_WK_243X_PHYS + OMAP2_L4_IO_OFFSET)
95#define L4_WK_243X_SIZE SZ_1M 111#define L4_WK_243X_SIZE SZ_1M
96#define OMAP243X_GPMC_PHYS OMAP243X_GPMC_BASE /* 0x49000000 */ 112#define OMAP243X_GPMC_PHYS OMAP243X_GPMC_BASE
97#define OMAP243X_GPMC_VIRT 0xFE000000 113#define OMAP243X_GPMC_VIRT (OMAP243X_GPMC_PHYS + OMAP2_L3_IO_OFFSET)
114 /* 0x6e000000 --> 0xfe000000 */
98#define OMAP243X_GPMC_SIZE SZ_1M 115#define OMAP243X_GPMC_SIZE SZ_1M
99#define OMAP243X_SDRC_PHYS OMAP243X_SDRC_BASE 116#define OMAP243X_SDRC_PHYS OMAP243X_SDRC_BASE
100#define OMAP243X_SDRC_VIRT 0xFD000000 117 /* 0x6D000000 --> 0xfd000000 */
118#define OMAP243X_SDRC_VIRT (OMAP243X_SDRC_PHYS + OMAP2_L3_IO_OFFSET)
101#define OMAP243X_SDRC_SIZE SZ_1M 119#define OMAP243X_SDRC_SIZE SZ_1M
102#define OMAP243X_SMS_PHYS OMAP243X_SMS_BASE 120#define OMAP243X_SMS_PHYS OMAP243X_SMS_BASE
103#define OMAP243X_SMS_VIRT 0xFC000000 121 /* 0x6c000000 --> 0xfc000000 */
122#define OMAP243X_SMS_VIRT (OMAP243X_SMS_PHYS + OMAP2_L3_IO_OFFSET)
104#define OMAP243X_SMS_SIZE SZ_1M 123#define OMAP243X_SMS_SIZE SZ_1M
105 124
106/* DSP */ 125/* DSP */
@@ -121,12 +140,12 @@
121 */ 140 */
122 141
123/* We map both L3 and L4 on OMAP3 */ 142/* We map both L3 and L4 on OMAP3 */
124#define L3_34XX_PHYS L3_34XX_BASE /* 0x68000000 */ 143#define L3_34XX_PHYS L3_34XX_BASE /* 0x68000000 --> 0xf8000000 */
125#define L3_34XX_VIRT 0xf8000000 144#define L3_34XX_VIRT (L3_34XX_PHYS + OMAP2_L3_IO_OFFSET)
126#define L3_34XX_SIZE SZ_1M /* 44kB of 128MB used, want 1MB sect */ 145#define L3_34XX_SIZE SZ_1M /* 44kB of 128MB used, want 1MB sect */
127 146
128#define L4_34XX_PHYS L4_34XX_BASE /* 0x48000000 */ 147#define L4_34XX_PHYS L4_34XX_BASE /* 0x48000000 --> 0xfa000000 */
129#define L4_34XX_VIRT 0xd8000000 148#define L4_34XX_VIRT (L4_34XX_PHYS + OMAP2_L4_IO_OFFSET)
130#define L4_34XX_SIZE SZ_4M /* 1MB of 128MB used, want 1MB sect */ 149#define L4_34XX_SIZE SZ_4M /* 1MB of 128MB used, want 1MB sect */
131 150
132/* 151/*
@@ -134,28 +153,33 @@
134 * VPOM3430 was not working for Int controller 153 * VPOM3430 was not working for Int controller
135 */ 154 */
136 155
137#define L4_WK_34XX_PHYS L4_WK_34XX_BASE /* 0x48300000 */ 156#define L4_WK_34XX_PHYS L4_WK_34XX_BASE /* 0x48300000 --> 0xfa300000 */
138#define L4_WK_34XX_VIRT 0xd8300000 157#define L4_WK_34XX_VIRT (L4_WK_34XX_PHYS + OMAP2_L4_IO_OFFSET)
139#define L4_WK_34XX_SIZE SZ_1M 158#define L4_WK_34XX_SIZE SZ_1M
140 159
141#define L4_PER_34XX_PHYS L4_PER_34XX_BASE /* 0x49000000 */ 160#define L4_PER_34XX_PHYS L4_PER_34XX_BASE
142#define L4_PER_34XX_VIRT 0xd9000000 161 /* 0x49000000 --> 0xfb000000 */
162#define L4_PER_34XX_VIRT (L4_PER_34XX_PHYS + OMAP2_L4_IO_OFFSET)
143#define L4_PER_34XX_SIZE SZ_1M 163#define L4_PER_34XX_SIZE SZ_1M
144 164
145#define L4_EMU_34XX_PHYS L4_EMU_34XX_BASE /* 0x54000000 */ 165#define L4_EMU_34XX_PHYS L4_EMU_34XX_BASE
146#define L4_EMU_34XX_VIRT 0xe4000000 166 /* 0x54000000 --> 0xfe800000 */
147#define L4_EMU_34XX_SIZE SZ_64M 167#define L4_EMU_34XX_VIRT (L4_EMU_34XX_PHYS + OMAP2_EMU_IO_OFFSET)
168#define L4_EMU_34XX_SIZE SZ_8M
148 169
149#define OMAP34XX_GPMC_PHYS OMAP34XX_GPMC_BASE /* 0x6E000000 */ 170#define OMAP34XX_GPMC_PHYS OMAP34XX_GPMC_BASE
150#define OMAP34XX_GPMC_VIRT 0xFE000000 171 /* 0x6e000000 --> 0xfe000000 */
172#define OMAP34XX_GPMC_VIRT (OMAP34XX_GPMC_PHYS + OMAP2_L3_IO_OFFSET)
151#define OMAP34XX_GPMC_SIZE SZ_1M 173#define OMAP34XX_GPMC_SIZE SZ_1M
152 174
153#define OMAP343X_SMS_PHYS OMAP343X_SMS_BASE /* 0x6C000000 */ 175#define OMAP343X_SMS_PHYS OMAP343X_SMS_BASE
154#define OMAP343X_SMS_VIRT 0xFC000000 176 /* 0x6c000000 --> 0xfc000000 */
177#define OMAP343X_SMS_VIRT (OMAP343X_SMS_PHYS + OMAP2_L3_IO_OFFSET)
155#define OMAP343X_SMS_SIZE SZ_1M 178#define OMAP343X_SMS_SIZE SZ_1M
156 179
157#define OMAP343X_SDRC_PHYS OMAP343X_SDRC_BASE /* 0x6D000000 */ 180#define OMAP343X_SDRC_PHYS OMAP343X_SDRC_BASE
158#define OMAP343X_SDRC_VIRT 0xFD000000 181 /* 0x6D000000 --> 0xfd000000 */
182#define OMAP343X_SDRC_VIRT (OMAP343X_SDRC_PHYS + OMAP2_L3_IO_OFFSET)
159#define OMAP343X_SDRC_SIZE SZ_1M 183#define OMAP343X_SDRC_SIZE SZ_1M
160 184
161/* DSP */ 185/* DSP */
@@ -176,32 +200,54 @@
176 */ 200 */
177 201
178/* We map both L3 and L4 on OMAP4 */ 202/* We map both L3 and L4 on OMAP4 */
179#define L3_44XX_PHYS L3_44XX_BASE 203#define L3_44XX_PHYS L3_44XX_BASE /* 0x44000000 --> 0xf8000000 */
180#define L3_44XX_VIRT 0xd4000000 204#define L3_44XX_VIRT (L3_44XX_PHYS + OMAP4_L3_IO_OFFSET)
181#define L3_44XX_SIZE SZ_1M 205#define L3_44XX_SIZE SZ_1M
182 206
183#define L4_44XX_PHYS L4_44XX_BASE 207#define L4_44XX_PHYS L4_44XX_BASE /* 0x4a000000 --> 0xfc000000 */
184#define L4_44XX_VIRT 0xda000000 208#define L4_44XX_VIRT (L4_44XX_PHYS + OMAP2_L4_IO_OFFSET)
185#define L4_44XX_SIZE SZ_4M 209#define L4_44XX_SIZE SZ_4M
186 210
187 211
188#define L4_WK_44XX_PHYS L4_WK_44XX_BASE 212#define L4_WK_44XX_PHYS L4_WK_44XX_BASE /* 0x4a300000 --> 0xfc300000 */
189#define L4_WK_44XX_VIRT 0xda300000 213#define L4_WK_44XX_VIRT (L4_WK_44XX_PHYS + OMAP2_L4_IO_OFFSET)
190#define L4_WK_44XX_SIZE SZ_1M 214#define L4_WK_44XX_SIZE SZ_1M
191 215
192#define L4_PER_44XX_PHYS L4_PER_44XX_BASE 216#define L4_PER_44XX_PHYS L4_PER_44XX_BASE
193#define L4_PER_44XX_VIRT 0xd8000000 217 /* 0x48000000 --> 0xfa000000 */
218#define L4_PER_44XX_VIRT (L4_PER_44XX_PHYS + OMAP2_L4_IO_OFFSET)
194#define L4_PER_44XX_SIZE SZ_4M 219#define L4_PER_44XX_SIZE SZ_4M
195 220
221#define L4_ABE_44XX_PHYS L4_ABE_44XX_BASE
222 /* 0x49000000 --> 0xfb000000 */
223#define L4_ABE_44XX_VIRT (L4_ABE_44XX_PHYS + OMAP2_L4_IO_OFFSET)
224#define L4_ABE_44XX_SIZE SZ_1M
225
196#define L4_EMU_44XX_PHYS L4_EMU_44XX_BASE 226#define L4_EMU_44XX_PHYS L4_EMU_44XX_BASE
197#define L4_EMU_44XX_VIRT 0xe4000000 227 /* 0x54000000 --> 0xfe800000 */
198#define L4_EMU_44XX_SIZE SZ_64M 228#define L4_EMU_44XX_VIRT (L4_EMU_44XX_PHYS + OMAP2_EMU_IO_OFFSET)
229#define L4_EMU_44XX_SIZE SZ_8M
199 230
200#define OMAP44XX_GPMC_PHYS OMAP44XX_GPMC_BASE 231#define OMAP44XX_GPMC_PHYS OMAP44XX_GPMC_BASE
201#define OMAP44XX_GPMC_VIRT 0xe0000000 232 /* 0x50000000 --> 0xf9000000 */
233#define OMAP44XX_GPMC_VIRT (OMAP44XX_GPMC_PHYS + OMAP4_GPMC_IO_OFFSET)
202#define OMAP44XX_GPMC_SIZE SZ_1M 234#define OMAP44XX_GPMC_SIZE SZ_1M
203 235
204 236
237#define OMAP44XX_EMIF1_PHYS OMAP44XX_EMIF1_BASE
238 /* 0x4c000000 --> 0xfd100000 */
239#define OMAP44XX_EMIF1_VIRT (OMAP44XX_EMIF1_PHYS + OMAP4_L3_PER_IO_OFFSET)
240#define OMAP44XX_EMIF1_SIZE SZ_1M
241
242#define OMAP44XX_EMIF2_PHYS OMAP44XX_EMIF2_BASE
243 /* 0x4d000000 --> 0xfd200000 */
244#define OMAP44XX_EMIF2_VIRT (OMAP44XX_EMIF2_PHYS + OMAP4_L3_PER_IO_OFFSET)
245#define OMAP44XX_EMIF2_SIZE SZ_1M
246
247#define OMAP44XX_DMM_PHYS OMAP44XX_DMM_BASE
248 /* 0x4e000000 --> 0xfd300000 */
249#define OMAP44XX_DMM_VIRT (OMAP44XX_DMM_PHYS + OMAP4_L3_PER_IO_OFFSET)
250#define OMAP44XX_DMM_SIZE SZ_1M
205/* 251/*
206 * ---------------------------------------------------------------------------- 252 * ----------------------------------------------------------------------------
207 * Omap specific register access 253 * Omap specific register access
diff --git a/arch/arm/plat-omap/include/mach/iommu.h b/arch/arm/plat-omap/include/plat/iommu.h
index 46d41ac83dbf..0752af9d099e 100644
--- a/arch/arm/plat-omap/include/mach/iommu.h
+++ b/arch/arm/plat-omap/include/plat/iommu.h
@@ -107,7 +107,7 @@ struct iommu_platform_data {
107#if defined(CONFIG_ARCH_OMAP1) 107#if defined(CONFIG_ARCH_OMAP1)
108#error "iommu for this processor not implemented yet" 108#error "iommu for this processor not implemented yet"
109#else 109#else
110#include <mach/iommu2.h> 110#include <plat/iommu2.h>
111#endif 111#endif
112 112
113/* 113/*
diff --git a/arch/arm/plat-omap/include/mach/iommu2.h b/arch/arm/plat-omap/include/plat/iommu2.h
index 10ad05f410e9..10ad05f410e9 100644
--- a/arch/arm/plat-omap/include/mach/iommu2.h
+++ b/arch/arm/plat-omap/include/plat/iommu2.h
diff --git a/arch/arm/plat-omap/include/mach/iovmm.h b/arch/arm/plat-omap/include/plat/iovmm.h
index bdc7ce5d7a4a..bdc7ce5d7a4a 100644
--- a/arch/arm/plat-omap/include/mach/iovmm.h
+++ b/arch/arm/plat-omap/include/plat/iovmm.h
diff --git a/arch/arm/plat-omap/include/mach/irda.h b/arch/arm/plat-omap/include/plat/irda.h
index 40f60339d1c6..40f60339d1c6 100644
--- a/arch/arm/plat-omap/include/mach/irda.h
+++ b/arch/arm/plat-omap/include/plat/irda.h
diff --git a/arch/arm/plat-omap/include/mach/irqs.h b/arch/arm/plat-omap/include/plat/irqs.h
index 28a165058b61..ce5dd2d1dc21 100644
--- a/arch/arm/plat-omap/include/mach/irqs.h
+++ b/arch/arm/plat-omap/include/plat/irqs.h
@@ -86,49 +86,26 @@
86#define INT_1610_SSR_FIFO_0 29 86#define INT_1610_SSR_FIFO_0 29
87 87
88/* 88/*
89 * OMAP-730 specific IRQ numbers for interrupt handler 1 89 * OMAP-7xx specific IRQ numbers for interrupt handler 1
90 */ 90 */
91#define INT_730_IH2_FIQ 0 91#define INT_7XX_IH2_FIQ 0
92#define INT_730_IH2_IRQ 1 92#define INT_7XX_IH2_IRQ 1
93#define INT_730_USB_NON_ISO 2 93#define INT_7XX_USB_NON_ISO 2
94#define INT_730_USB_ISO 3 94#define INT_7XX_USB_ISO 3
95#define INT_730_ICR 4 95#define INT_7XX_ICR 4
96#define INT_730_EAC 5 96#define INT_7XX_EAC 5
97#define INT_730_GPIO_BANK1 6 97#define INT_7XX_GPIO_BANK1 6
98#define INT_730_GPIO_BANK2 7 98#define INT_7XX_GPIO_BANK2 7
99#define INT_730_GPIO_BANK3 8 99#define INT_7XX_GPIO_BANK3 8
100#define INT_730_McBSP2TX 10 100#define INT_7XX_McBSP2TX 10
101#define INT_730_McBSP2RX 11 101#define INT_7XX_McBSP2RX 11
102#define INT_730_McBSP2RX_OVF 12 102#define INT_7XX_McBSP2RX_OVF 12
103#define INT_730_LCD_LINE 14 103#define INT_7XX_LCD_LINE 14
104#define INT_730_GSM_PROTECT 15 104#define INT_7XX_GSM_PROTECT 15
105#define INT_730_TIMER3 16 105#define INT_7XX_TIMER3 16
106#define INT_730_GPIO_BANK5 17 106#define INT_7XX_GPIO_BANK5 17
107#define INT_730_GPIO_BANK6 18 107#define INT_7XX_GPIO_BANK6 18
108#define INT_730_SPGIO_WR 29 108#define INT_7XX_SPGIO_WR 29
109
110/*
111 * OMAP-850 specific IRQ numbers for interrupt handler 1
112 */
113#define INT_850_IH2_FIQ 0
114#define INT_850_IH2_IRQ 1
115#define INT_850_USB_NON_ISO 2
116#define INT_850_USB_ISO 3
117#define INT_850_ICR 4
118#define INT_850_EAC 5
119#define INT_850_GPIO_BANK1 6
120#define INT_850_GPIO_BANK2 7
121#define INT_850_GPIO_BANK3 8
122#define INT_850_McBSP2TX 10
123#define INT_850_McBSP2RX 11
124#define INT_850_McBSP2RX_OVF 12
125#define INT_850_LCD_LINE 14
126#define INT_850_GSM_PROTECT 15
127#define INT_850_TIMER3 16
128#define INT_850_GPIO_BANK5 17
129#define INT_850_GPIO_BANK6 18
130#define INT_850_SPGIO_WR 29
131
132 109
133/* 110/*
134 * IRQ numbers for interrupt handler 2 111 * IRQ numbers for interrupt handler 2
@@ -206,120 +183,62 @@
206#define INT_1610_SHA1MD5 (91 + IH2_BASE) 183#define INT_1610_SHA1MD5 (91 + IH2_BASE)
207 184
208/* 185/*
209 * OMAP-730 specific IRQ numbers for interrupt handler 2 186 * OMAP-7xx specific IRQ numbers for interrupt handler 2
210 */ 187 */
211#define INT_730_HW_ERRORS (0 + IH2_BASE) 188#define INT_7XX_HW_ERRORS (0 + IH2_BASE)
212#define INT_730_NFIQ_PWR_FAIL (1 + IH2_BASE) 189#define INT_7XX_NFIQ_PWR_FAIL (1 + IH2_BASE)
213#define INT_730_CFCD (2 + IH2_BASE) 190#define INT_7XX_CFCD (2 + IH2_BASE)
214#define INT_730_CFIREQ (3 + IH2_BASE) 191#define INT_7XX_CFIREQ (3 + IH2_BASE)
215#define INT_730_I2C (4 + IH2_BASE) 192#define INT_7XX_I2C (4 + IH2_BASE)
216#define INT_730_PCC (5 + IH2_BASE) 193#define INT_7XX_PCC (5 + IH2_BASE)
217#define INT_730_MPU_EXT_NIRQ (6 + IH2_BASE) 194#define INT_7XX_MPU_EXT_NIRQ (6 + IH2_BASE)
218#define INT_730_SPI_100K_1 (7 + IH2_BASE) 195#define INT_7XX_SPI_100K_1 (7 + IH2_BASE)
219#define INT_730_SYREN_SPI (8 + IH2_BASE) 196#define INT_7XX_SYREN_SPI (8 + IH2_BASE)
220#define INT_730_VLYNQ (9 + IH2_BASE) 197#define INT_7XX_VLYNQ (9 + IH2_BASE)
221#define INT_730_GPIO_BANK4 (10 + IH2_BASE) 198#define INT_7XX_GPIO_BANK4 (10 + IH2_BASE)
222#define INT_730_McBSP1TX (11 + IH2_BASE) 199#define INT_7XX_McBSP1TX (11 + IH2_BASE)
223#define INT_730_McBSP1RX (12 + IH2_BASE) 200#define INT_7XX_McBSP1RX (12 + IH2_BASE)
224#define INT_730_McBSP1RX_OF (13 + IH2_BASE) 201#define INT_7XX_McBSP1RX_OF (13 + IH2_BASE)
225#define INT_730_UART_MODEM_IRDA_2 (14 + IH2_BASE) 202#define INT_7XX_UART_MODEM_IRDA_2 (14 + IH2_BASE)
226#define INT_730_UART_MODEM_1 (15 + IH2_BASE) 203#define INT_7XX_UART_MODEM_1 (15 + IH2_BASE)
227#define INT_730_MCSI (16 + IH2_BASE) 204#define INT_7XX_MCSI (16 + IH2_BASE)
228#define INT_730_uWireTX (17 + IH2_BASE) 205#define INT_7XX_uWireTX (17 + IH2_BASE)
229#define INT_730_uWireRX (18 + IH2_BASE) 206#define INT_7XX_uWireRX (18 + IH2_BASE)
230#define INT_730_SMC_CD (19 + IH2_BASE) 207#define INT_7XX_SMC_CD (19 + IH2_BASE)
231#define INT_730_SMC_IREQ (20 + IH2_BASE) 208#define INT_7XX_SMC_IREQ (20 + IH2_BASE)
232#define INT_730_HDQ_1WIRE (21 + IH2_BASE) 209#define INT_7XX_HDQ_1WIRE (21 + IH2_BASE)
233#define INT_730_TIMER32K (22 + IH2_BASE) 210#define INT_7XX_TIMER32K (22 + IH2_BASE)
234#define INT_730_MMC_SDIO (23 + IH2_BASE) 211#define INT_7XX_MMC_SDIO (23 + IH2_BASE)
235#define INT_730_UPLD (24 + IH2_BASE) 212#define INT_7XX_UPLD (24 + IH2_BASE)
236#define INT_730_USB_HHC_1 (27 + IH2_BASE) 213#define INT_7XX_USB_HHC_1 (27 + IH2_BASE)
237#define INT_730_USB_HHC_2 (28 + IH2_BASE) 214#define INT_7XX_USB_HHC_2 (28 + IH2_BASE)
238#define INT_730_USB_GENI (29 + IH2_BASE) 215#define INT_7XX_USB_GENI (29 + IH2_BASE)
239#define INT_730_USB_OTG (30 + IH2_BASE) 216#define INT_7XX_USB_OTG (30 + IH2_BASE)
240#define INT_730_CAMERA_IF (31 + IH2_BASE) 217#define INT_7XX_CAMERA_IF (31 + IH2_BASE)
241#define INT_730_RNG (32 + IH2_BASE) 218#define INT_7XX_RNG (32 + IH2_BASE)
242#define INT_730_DUAL_MODE_TIMER (33 + IH2_BASE) 219#define INT_7XX_DUAL_MODE_TIMER (33 + IH2_BASE)
243#define INT_730_DBB_RF_EN (34 + IH2_BASE) 220#define INT_7XX_DBB_RF_EN (34 + IH2_BASE)
244#define INT_730_MPUIO_KEYPAD (35 + IH2_BASE) 221#define INT_7XX_MPUIO_KEYPAD (35 + IH2_BASE)
245#define INT_730_SHA1_MD5 (36 + IH2_BASE) 222#define INT_7XX_SHA1_MD5 (36 + IH2_BASE)
246#define INT_730_SPI_100K_2 (37 + IH2_BASE) 223#define INT_7XX_SPI_100K_2 (37 + IH2_BASE)
247#define INT_730_RNG_IDLE (38 + IH2_BASE) 224#define INT_7XX_RNG_IDLE (38 + IH2_BASE)
248#define INT_730_MPUIO (39 + IH2_BASE) 225#define INT_7XX_MPUIO (39 + IH2_BASE)
249#define INT_730_LLPC_LCD_CTRL_CAN_BE_OFF (40 + IH2_BASE) 226#define INT_7XX_LLPC_LCD_CTRL_CAN_BE_OFF (40 + IH2_BASE)
250#define INT_730_LLPC_OE_FALLING (41 + IH2_BASE) 227#define INT_7XX_LLPC_OE_FALLING (41 + IH2_BASE)
251#define INT_730_LLPC_OE_RISING (42 + IH2_BASE) 228#define INT_7XX_LLPC_OE_RISING (42 + IH2_BASE)
252#define INT_730_LLPC_VSYNC (43 + IH2_BASE) 229#define INT_7XX_LLPC_VSYNC (43 + IH2_BASE)
253#define INT_730_WAKE_UP_REQ (46 + IH2_BASE) 230#define INT_7XX_WAKE_UP_REQ (46 + IH2_BASE)
254#define INT_730_DMA_CH6 (53 + IH2_BASE) 231#define INT_7XX_DMA_CH6 (53 + IH2_BASE)
255#define INT_730_DMA_CH7 (54 + IH2_BASE) 232#define INT_7XX_DMA_CH7 (54 + IH2_BASE)
256#define INT_730_DMA_CH8 (55 + IH2_BASE) 233#define INT_7XX_DMA_CH8 (55 + IH2_BASE)
257#define INT_730_DMA_CH9 (56 + IH2_BASE) 234#define INT_7XX_DMA_CH9 (56 + IH2_BASE)
258#define INT_730_DMA_CH10 (57 + IH2_BASE) 235#define INT_7XX_DMA_CH10 (57 + IH2_BASE)
259#define INT_730_DMA_CH11 (58 + IH2_BASE) 236#define INT_7XX_DMA_CH11 (58 + IH2_BASE)
260#define INT_730_DMA_CH12 (59 + IH2_BASE) 237#define INT_7XX_DMA_CH12 (59 + IH2_BASE)
261#define INT_730_DMA_CH13 (60 + IH2_BASE) 238#define INT_7XX_DMA_CH13 (60 + IH2_BASE)
262#define INT_730_DMA_CH14 (61 + IH2_BASE) 239#define INT_7XX_DMA_CH14 (61 + IH2_BASE)
263#define INT_730_DMA_CH15 (62 + IH2_BASE) 240#define INT_7XX_DMA_CH15 (62 + IH2_BASE)
264#define INT_730_NAND (63 + IH2_BASE) 241#define INT_7XX_NAND (63 + IH2_BASE)
265
266/*
267 * OMAP-850 specific IRQ numbers for interrupt handler 2
268 */
269#define INT_850_HW_ERRORS (0 + IH2_BASE)
270#define INT_850_NFIQ_PWR_FAIL (1 + IH2_BASE)
271#define INT_850_CFCD (2 + IH2_BASE)
272#define INT_850_CFIREQ (3 + IH2_BASE)
273#define INT_850_I2C (4 + IH2_BASE)
274#define INT_850_PCC (5 + IH2_BASE)
275#define INT_850_MPU_EXT_NIRQ (6 + IH2_BASE)
276#define INT_850_SPI_100K_1 (7 + IH2_BASE)
277#define INT_850_SYREN_SPI (8 + IH2_BASE)
278#define INT_850_VLYNQ (9 + IH2_BASE)
279#define INT_850_GPIO_BANK4 (10 + IH2_BASE)
280#define INT_850_McBSP1TX (11 + IH2_BASE)
281#define INT_850_McBSP1RX (12 + IH2_BASE)
282#define INT_850_McBSP1RX_OF (13 + IH2_BASE)
283#define INT_850_UART_MODEM_IRDA_2 (14 + IH2_BASE)
284#define INT_850_UART_MODEM_1 (15 + IH2_BASE)
285#define INT_850_MCSI (16 + IH2_BASE)
286#define INT_850_uWireTX (17 + IH2_BASE)
287#define INT_850_uWireRX (18 + IH2_BASE)
288#define INT_850_SMC_CD (19 + IH2_BASE)
289#define INT_850_SMC_IREQ (20 + IH2_BASE)
290#define INT_850_HDQ_1WIRE (21 + IH2_BASE)
291#define INT_850_TIMER32K (22 + IH2_BASE)
292#define INT_850_MMC_SDIO (23 + IH2_BASE)
293#define INT_850_UPLD (24 + IH2_BASE)
294#define INT_850_USB_HHC_1 (27 + IH2_BASE)
295#define INT_850_USB_HHC_2 (28 + IH2_BASE)
296#define INT_850_USB_GENI (29 + IH2_BASE)
297#define INT_850_USB_OTG (30 + IH2_BASE)
298#define INT_850_CAMERA_IF (31 + IH2_BASE)
299#define INT_850_RNG (32 + IH2_BASE)
300#define INT_850_DUAL_MODE_TIMER (33 + IH2_BASE)
301#define INT_850_DBB_RF_EN (34 + IH2_BASE)
302#define INT_850_MPUIO_KEYPAD (35 + IH2_BASE)
303#define INT_850_SHA1_MD5 (36 + IH2_BASE)
304#define INT_850_SPI_100K_2 (37 + IH2_BASE)
305#define INT_850_RNG_IDLE (38 + IH2_BASE)
306#define INT_850_MPUIO (39 + IH2_BASE)
307#define INT_850_LLPC_LCD_CTRL_CAN_BE_OFF (40 + IH2_BASE)
308#define INT_850_LLPC_OE_FALLING (41 + IH2_BASE)
309#define INT_850_LLPC_OE_RISING (42 + IH2_BASE)
310#define INT_850_LLPC_VSYNC (43 + IH2_BASE)
311#define INT_850_WAKE_UP_REQ (46 + IH2_BASE)
312#define INT_850_DMA_CH6 (53 + IH2_BASE)
313#define INT_850_DMA_CH7 (54 + IH2_BASE)
314#define INT_850_DMA_CH8 (55 + IH2_BASE)
315#define INT_850_DMA_CH9 (56 + IH2_BASE)
316#define INT_850_DMA_CH10 (57 + IH2_BASE)
317#define INT_850_DMA_CH11 (58 + IH2_BASE)
318#define INT_850_DMA_CH12 (59 + IH2_BASE)
319#define INT_850_DMA_CH13 (60 + IH2_BASE)
320#define INT_850_DMA_CH14 (61 + IH2_BASE)
321#define INT_850_DMA_CH15 (62 + IH2_BASE)
322#define INT_850_NAND (63 + IH2_BASE)
323 242
324#define INT_24XX_SYS_NIRQ 7 243#define INT_24XX_SYS_NIRQ 7
325#define INT_24XX_SDMA_IRQ0 12 244#define INT_24XX_SDMA_IRQ0 12
@@ -558,9 +477,14 @@
558 477
559#define OMAP_IRQ_BIT(irq) (1 << ((irq) % 32)) 478#define OMAP_IRQ_BIT(irq) (1 << ((irq) % 32))
560 479
480#define INTCPS_NR_MIR_REGS 3
481#define INTCPS_NR_IRQS 96
482
561#ifndef __ASSEMBLY__ 483#ifndef __ASSEMBLY__
562extern void omap_init_irq(void); 484extern void omap_init_irq(void);
563extern int omap_irq_pending(void); 485extern int omap_irq_pending(void);
486void omap_intc_save_context(void);
487void omap_intc_restore_context(void);
564#endif 488#endif
565 489
566#include <mach/hardware.h> 490#include <mach/hardware.h>
diff --git a/arch/arm/plat-omap/include/mach/keypad.h b/arch/arm/plat-omap/include/plat/keypad.h
index 3ae52ccc793c..3ae52ccc793c 100644
--- a/arch/arm/plat-omap/include/mach/keypad.h
+++ b/arch/arm/plat-omap/include/plat/keypad.h
diff --git a/arch/arm/plat-omap/include/mach/lcd_mipid.h b/arch/arm/plat-omap/include/plat/lcd_mipid.h
index 8e52c6572281..8e52c6572281 100644
--- a/arch/arm/plat-omap/include/mach/lcd_mipid.h
+++ b/arch/arm/plat-omap/include/plat/lcd_mipid.h
diff --git a/arch/arm/plat-omap/include/mach/led.h b/arch/arm/plat-omap/include/plat/led.h
index 25e451e7e2fd..25e451e7e2fd 100644
--- a/arch/arm/plat-omap/include/mach/led.h
+++ b/arch/arm/plat-omap/include/plat/led.h
diff --git a/arch/arm/plat-omap/include/mach/mailbox.h b/arch/arm/plat-omap/include/plat/mailbox.h
index b7a6991814ec..729166b76a7c 100644
--- a/arch/arm/plat-omap/include/mach/mailbox.h
+++ b/arch/arm/plat-omap/include/plat/mailbox.h
@@ -6,9 +6,9 @@
6#include <linux/wait.h> 6#include <linux/wait.h>
7#include <linux/workqueue.h> 7#include <linux/workqueue.h>
8#include <linux/blkdev.h> 8#include <linux/blkdev.h>
9#include <linux/interrupt.h>
9 10
10typedef u32 mbox_msg_t; 11typedef u32 mbox_msg_t;
11typedef void (mbox_receiver_t)(mbox_msg_t msg);
12struct omap_mbox; 12struct omap_mbox;
13 13
14typedef int __bitwise omap_mbox_irq_t; 14typedef int __bitwise omap_mbox_irq_t;
@@ -29,8 +29,10 @@ struct omap_mbox_ops {
29 int (*fifo_empty)(struct omap_mbox *mbox); 29 int (*fifo_empty)(struct omap_mbox *mbox);
30 int (*fifo_full)(struct omap_mbox *mbox); 30 int (*fifo_full)(struct omap_mbox *mbox);
31 /* irq */ 31 /* irq */
32 void (*enable_irq)(struct omap_mbox *mbox, omap_mbox_irq_t irq); 32 void (*enable_irq)(struct omap_mbox *mbox,
33 void (*disable_irq)(struct omap_mbox *mbox, omap_mbox_irq_t irq); 33 omap_mbox_irq_t irq);
34 void (*disable_irq)(struct omap_mbox *mbox,
35 omap_mbox_irq_t irq);
34 void (*ack_irq)(struct omap_mbox *mbox, omap_mbox_irq_t irq); 36 void (*ack_irq)(struct omap_mbox *mbox, omap_mbox_irq_t irq);
35 int (*is_irq)(struct omap_mbox *mbox, omap_mbox_irq_t irq); 37 int (*is_irq)(struct omap_mbox *mbox, omap_mbox_irq_t irq);
36 /* ctx */ 38 /* ctx */
@@ -42,6 +44,7 @@ struct omap_mbox_queue {
42 spinlock_t lock; 44 spinlock_t lock;
43 struct request_queue *queue; 45 struct request_queue *queue;
44 struct work_struct work; 46 struct work_struct work;
47 struct tasklet_struct tasklet;
45 int (*callback)(void *); 48 int (*callback)(void *);
46 struct omap_mbox *mbox; 49 struct omap_mbox *mbox;
47}; 50};
@@ -64,7 +67,7 @@ struct omap_mbox {
64 void (*err_notify)(void); 67 void (*err_notify)(void);
65}; 68};
66 69
67int omap_mbox_msg_send(struct omap_mbox *, mbox_msg_t msg, void *); 70int omap_mbox_msg_send(struct omap_mbox *, mbox_msg_t msg);
68void omap_mbox_init_seq(struct omap_mbox *); 71void omap_mbox_init_seq(struct omap_mbox *);
69 72
70struct omap_mbox *omap_mbox_get(const char *); 73struct omap_mbox *omap_mbox_get(const char *);
@@ -93,4 +96,16 @@ static inline void omap_mbox_restore_ctx(struct omap_mbox *mbox)
93 mbox->ops->restore_ctx(mbox); 96 mbox->ops->restore_ctx(mbox);
94} 97}
95 98
99static inline void omap_mbox_enable_irq(struct omap_mbox *mbox,
100 omap_mbox_irq_t irq)
101{
102 mbox->ops->enable_irq(mbox, irq);
103}
104
105static inline void omap_mbox_disable_irq(struct omap_mbox *mbox,
106 omap_mbox_irq_t irq)
107{
108 mbox->ops->disable_irq(mbox, irq);
109}
110
96#endif /* MAILBOX_H */ 111#endif /* MAILBOX_H */
diff --git a/arch/arm/plat-omap/include/mach/mcbsp.h b/arch/arm/plat-omap/include/plat/mcbsp.h
index e0d6eca222cc..4f22e5bb7ff7 100644
--- a/arch/arm/plat-omap/include/mach/mcbsp.h
+++ b/arch/arm/plat-omap/include/plat/mcbsp.h
@@ -28,10 +28,10 @@
28#include <linux/spinlock.h> 28#include <linux/spinlock.h>
29 29
30#include <mach/hardware.h> 30#include <mach/hardware.h>
31#include <mach/clock.h> 31#include <plat/clock.h>
32 32
33#define OMAP730_MCBSP1_BASE 0xfffb1000 33#define OMAP7XX_MCBSP1_BASE 0xfffb1000
34#define OMAP730_MCBSP2_BASE 0xfffb1800 34#define OMAP7XX_MCBSP2_BASE 0xfffb1800
35 35
36#define OMAP1510_MCBSP1_BASE 0xe1011800 36#define OMAP1510_MCBSP1_BASE 0xe1011800
37#define OMAP1510_MCBSP2_BASE 0xfffb1000 37#define OMAP1510_MCBSP2_BASE 0xfffb1000
@@ -58,7 +58,7 @@
58#define OMAP44XX_MCBSP3_BASE 0x49026000 58#define OMAP44XX_MCBSP3_BASE 0x49026000
59#define OMAP44XX_MCBSP4_BASE 0x48074000 59#define OMAP44XX_MCBSP4_BASE 0x48074000
60 60
61#if defined(CONFIG_ARCH_OMAP15XX) || defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP730) 61#if defined(CONFIG_ARCH_OMAP15XX) || defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
62 62
63#define OMAP_MCBSP_REG_DRR2 0x00 63#define OMAP_MCBSP_REG_DRR2 0x00
64#define OMAP_MCBSP_REG_DRR1 0x02 64#define OMAP_MCBSP_REG_DRR1 0x02
diff --git a/arch/arm/plat-omap/include/mach/mcspi.h b/arch/arm/plat-omap/include/plat/mcspi.h
index 1254e4945b6f..1254e4945b6f 100644
--- a/arch/arm/plat-omap/include/mach/mcspi.h
+++ b/arch/arm/plat-omap/include/plat/mcspi.h
diff --git a/arch/arm/plat-omap/include/mach/memory.h b/arch/arm/plat-omap/include/plat/memory.h
index 9ad41dc484c1..3325f7b49eaa 100644
--- a/arch/arm/plat-omap/include/mach/memory.h
+++ b/arch/arm/plat-omap/include/plat/memory.h
@@ -68,6 +68,13 @@
68 __dma = __dma - PHYS_OFFSET + OMAP1510_LB_OFFSET; \ 68 __dma = __dma - PHYS_OFFSET + OMAP1510_LB_OFFSET; \
69 __dma; }) 69 __dma; })
70 70
71#define __arch_dma_to_page(dev, addr) \
72 ({ dma_addr_t __dma = addr; \
73 if (is_lbus_device(dev)) \
74 __dma += PHYS_OFFSET - OMAP1510_LB_OFFSET; \
75 phys_to_page(__dma); \
76 })
77
71#define __arch_dma_to_virt(dev, addr) ({ (void *) (is_lbus_device(dev) ? \ 78#define __arch_dma_to_virt(dev, addr) ({ (void *) (is_lbus_device(dev) ? \
72 lbus_to_virt(addr) : \ 79 lbus_to_virt(addr) : \
73 __phys_to_virt(addr)); }) 80 __phys_to_virt(addr)); })
diff --git a/arch/arm/plat-omap/include/mach/menelaus.h b/arch/arm/plat-omap/include/plat/menelaus.h
index 3122bf68c7ce..3122bf68c7ce 100644
--- a/arch/arm/plat-omap/include/mach/menelaus.h
+++ b/arch/arm/plat-omap/include/plat/menelaus.h
diff --git a/arch/arm/plat-omap/include/mach/mmc.h b/arch/arm/plat-omap/include/plat/mmc.h
index 7229b9593301..29937137bf3e 100644
--- a/arch/arm/plat-omap/include/mach/mmc.h
+++ b/arch/arm/plat-omap/include/plat/mmc.h
@@ -15,7 +15,7 @@
15#include <linux/device.h> 15#include <linux/device.h>
16#include <linux/mmc/host.h> 16#include <linux/mmc/host.h>
17 17
18#include <mach/board.h> 18#include <plat/board.h>
19 19
20#define OMAP15XX_NR_MMC 1 20#define OMAP15XX_NR_MMC 1
21#define OMAP16XX_NR_MMC 2 21#define OMAP16XX_NR_MMC 2
diff --git a/arch/arm/plat-omap/include/mach/mux.h b/arch/arm/plat-omap/include/plat/mux.h
index 0f49d2d563d9..ba77de601501 100644
--- a/arch/arm/plat-omap/include/mach/mux.h
+++ b/arch/arm/plat-omap/include/plat/mux.h
@@ -51,23 +51,13 @@
51 .pu_pd_reg = PU_PD_SEL_##reg, \ 51 .pu_pd_reg = PU_PD_SEL_##reg, \
52 .pu_pd_val = status, 52 .pu_pd_val = status,
53 53
54#define MUX_REG_730(reg, mode_offset, mode) .mux_reg_name = "OMAP730_IO_CONF_"#reg, \ 54#define MUX_REG_7XX(reg, mode_offset, mode) .mux_reg_name = "OMAP7XX_IO_CONF_"#reg, \
55 .mux_reg = OMAP730_IO_CONF_##reg, \ 55 .mux_reg = OMAP7XX_IO_CONF_##reg, \
56 .mask_offset = mode_offset, \ 56 .mask_offset = mode_offset, \
57 .mask = mode, 57 .mask = mode,
58 58
59#define PULL_REG_730(reg, bit, status) .pull_name = "OMAP730_IO_CONF_"#reg, \ 59#define PULL_REG_7XX(reg, bit, status) .pull_name = "OMAP7XX_IO_CONF_"#reg, \
60 .pull_reg = OMAP730_IO_CONF_##reg, \ 60 .pull_reg = OMAP7XX_IO_CONF_##reg, \
61 .pull_bit = bit, \
62 .pull_val = status,
63
64#define MUX_REG_850(reg, mode_offset, mode) .mux_reg_name = "OMAP850_IO_CONF_"#reg, \
65 .mux_reg = OMAP850_IO_CONF_##reg, \
66 .mask_offset = mode_offset, \
67 .mask = mode,
68
69#define PULL_REG_850(reg, bit, status) .pull_name = "OMAP850_IO_CONF_"#reg, \
70 .pull_reg = OMAP850_IO_CONF_##reg, \
71 .pull_bit = bit, \ 61 .pull_bit = bit, \
72 .pull_val = status, 62 .pull_val = status,
73 63
@@ -84,21 +74,12 @@
84#define PU_PD_REG(reg, status) .pu_pd_reg = PU_PD_SEL_##reg, \ 74#define PU_PD_REG(reg, status) .pu_pd_reg = PU_PD_SEL_##reg, \
85 .pu_pd_val = status, 75 .pu_pd_val = status,
86 76
87#define MUX_REG_730(reg, mode_offset, mode) \ 77#define MUX_REG_7XX(reg, mode_offset, mode) \
88 .mux_reg = OMAP730_IO_CONF_##reg, \ 78 .mux_reg = OMAP7XX_IO_CONF_##reg, \
89 .mask_offset = mode_offset, \ 79 .mask_offset = mode_offset, \
90 .mask = mode, 80 .mask = mode,
91 81
92#define PULL_REG_730(reg, bit, status) .pull_reg = OMAP730_IO_CONF_##reg, \ 82#define PULL_REG_7XX(reg, bit, status) .pull_reg = OMAP7XX_IO_CONF_##reg, \
93 .pull_bit = bit, \
94 .pull_val = status,
95
96#define MUX_REG_850(reg, mode_offset, mode) \
97 .mux_reg = OMAP850_IO_CONF_##reg, \
98 .mask_offset = mode_offset, \
99 .mask = mode,
100
101#define PULL_REG_850(reg, bit, status) .pull_reg = OMAP850_IO_CONF_##reg, \
102 .pull_bit = bit, \ 83 .pull_bit = bit, \
103 .pull_val = status, 84 .pull_val = status,
104 85
@@ -118,32 +99,21 @@
118 99
119/* 100/*
120 * OMAP730/850 has a slightly different config for the pin mux. 101 * OMAP730/850 has a slightly different config for the pin mux.
121 * - config regs are the OMAP730_IO_CONF_x regs (see omap730.h) regs and 102 * - config regs are the OMAP7XX_IO_CONF_x regs (see omap730.h) regs and
122 * not the FUNC_MUX_CTRL_x regs from hardware.h 103 * not the FUNC_MUX_CTRL_x regs from hardware.h
123 * - for pull-up/down, only has one enable bit which is is in the same register 104 * - for pull-up/down, only has one enable bit which is is in the same register
124 * as mux config 105 * as mux config
125 */ 106 */
126#define MUX_CFG_730(desc, mux_reg, mode_offset, mode, \ 107#define MUX_CFG_7XX(desc, mux_reg, mode_offset, mode, \
127 pull_bit, pull_status, debug_status)\
128{ \
129 .name = desc, \
130 .debug = debug_status, \
131 MUX_REG_730(mux_reg, mode_offset, mode) \
132 PULL_REG_730(mux_reg, pull_bit, pull_status) \
133 PU_PD_REG(NA, 0) \
134},
135
136#define MUX_CFG_850(desc, mux_reg, mode_offset, mode, \
137 pull_bit, pull_status, debug_status)\ 108 pull_bit, pull_status, debug_status)\
138{ \ 109{ \
139 .name = desc, \ 110 .name = desc, \
140 .debug = debug_status, \ 111 .debug = debug_status, \
141 MUX_REG_850(mux_reg, mode_offset, mode) \ 112 MUX_REG_7XX(mux_reg, mode_offset, mode) \
142 PULL_REG_850(mux_reg, pull_bit, pull_status) \ 113 PULL_REG_7XX(mux_reg, pull_bit, pull_status) \
143 PU_PD_REG(NA, 0) \ 114 PU_PD_REG(NA, 0) \
144}, 115},
145 116
146
147#define MUX_CFG_24XX(desc, reg_offset, mode, \ 117#define MUX_CFG_24XX(desc, reg_offset, mode, \
148 pull_en, pull_mode, dbg) \ 118 pull_en, pull_mode, dbg) \
149{ \ 119{ \
@@ -232,45 +202,30 @@ struct pin_config {
232 202
233}; 203};
234 204
235enum omap730_index { 205enum omap7xx_index {
236 /* OMAP 730 keyboard */ 206 /* OMAP 730 keyboard */
237 E2_730_KBR0, 207 E2_7XX_KBR0,
238 J7_730_KBR1, 208 J7_7XX_KBR1,
239 E1_730_KBR2, 209 E1_7XX_KBR2,
240 F3_730_KBR3, 210 F3_7XX_KBR3,
241 D2_730_KBR4, 211 D2_7XX_KBR4,
242 C2_730_KBC0, 212 C2_7XX_KBC0,
243 D3_730_KBC1, 213 D3_7XX_KBC1,
244 E4_730_KBC2, 214 E4_7XX_KBC2,
245 F4_730_KBC3, 215 F4_7XX_KBC3,
246 E3_730_KBC4, 216 E3_7XX_KBC4,
247 217
248 /* USB */ 218 /* USB */
249 AA17_730_USB_DM, 219 AA17_7XX_USB_DM,
250 W16_730_USB_PU_EN, 220 W16_7XX_USB_PU_EN,
251 W17_730_USB_VBUSI, 221 W17_7XX_USB_VBUSI,
222
223 /* MMC */
224 MMC_7XX_CMD,
225 MMC_7XX_CLK,
226 MMC_7XX_DAT0,
252}; 227};
253 228
254enum omap850_index {
255 /* OMAP 850 keyboard */
256 E2_850_KBR0,
257 J7_850_KBR1,
258 E1_850_KBR2,
259 F3_850_KBR3,
260 D2_850_KBR4,
261 C2_850_KBC0,
262 D3_850_KBC1,
263 E4_850_KBC2,
264 F4_850_KBC3,
265 E3_850_KBC4,
266
267 /* USB */
268 AA17_850_USB_DM,
269 W16_850_USB_PU_EN,
270 W17_850_USB_VBUSI,
271};
272
273
274enum omap1xxx_index { 229enum omap1xxx_index {
275 /* UART1 (BT_UART_GATING)*/ 230 /* UART1 (BT_UART_GATING)*/
276 UART1_TX = 0, 231 UART1_TX = 0,
@@ -879,6 +834,10 @@ enum omap34xx_index {
879 AH4_3430_MMC2_DAT1, 834 AH4_3430_MMC2_DAT1,
880 AG4_3430_MMC2_DAT2, 835 AG4_3430_MMC2_DAT2,
881 AF4_3430_MMC2_DAT3, 836 AF4_3430_MMC2_DAT3,
837 AE4_3430_MMC2_DAT4,
838 AH3_3430_MMC2_DAT5,
839 AF3_3430_MMC2_DAT6,
840 AE3_3430_MMC2_DAT7,
882 841
883 /* MMC3 */ 842 /* MMC3 */
884 AF10_3430_MMC3_CLK, 843 AF10_3430_MMC3_CLK,
@@ -890,6 +849,11 @@ enum omap34xx_index {
890 849
891 /* SYS_NIRQ T2 INT1 */ 850 /* SYS_NIRQ T2 INT1 */
892 AF26_34XX_SYS_NIRQ, 851 AF26_34XX_SYS_NIRQ,
852
853 /* EHCI GPIO's for OMAP3EVM (Rev >= E) */
854 AH14_34XX_GPIO21,
855 AF9_34XX_GPIO22,
856 U3_34XX_GPIO61,
893}; 857};
894 858
895struct omap_mux_cfg { 859struct omap_mux_cfg {
diff --git a/arch/arm/plat-omap/include/mach/nand.h b/arch/arm/plat-omap/include/plat/nand.h
index 631a7bed1eef..631a7bed1eef 100644
--- a/arch/arm/plat-omap/include/mach/nand.h
+++ b/arch/arm/plat-omap/include/plat/nand.h
diff --git a/arch/arm/plat-omap/include/mach/omap-alsa.h b/arch/arm/plat-omap/include/plat/omap-alsa.h
index bdf30a0f87f2..b53055b390d0 100644
--- a/arch/arm/plat-omap/include/mach/omap-alsa.h
+++ b/arch/arm/plat-omap/include/plat/omap-alsa.h
@@ -40,10 +40,10 @@
40#ifndef __OMAP_ALSA_H 40#ifndef __OMAP_ALSA_H
41#define __OMAP_ALSA_H 41#define __OMAP_ALSA_H
42 42
43#include <mach/dma.h> 43#include <plat/dma.h>
44#include <sound/core.h> 44#include <sound/core.h>
45#include <sound/pcm.h> 45#include <sound/pcm.h>
46#include <mach/mcbsp.h> 46#include <plat/mcbsp.h>
47#include <linux/platform_device.h> 47#include <linux/platform_device.h>
48 48
49#define DMA_BUF_SIZE (1024 * 8) 49#define DMA_BUF_SIZE (1024 * 8)
diff --git a/arch/arm/plat-omap/include/mach/omap-pm.h b/arch/arm/plat-omap/include/plat/omap-pm.h
index 3ee41d711492..3ee41d711492 100644
--- a/arch/arm/plat-omap/include/mach/omap-pm.h
+++ b/arch/arm/plat-omap/include/plat/omap-pm.h
diff --git a/arch/arm/plat-omap/include/mach/omap1510.h b/arch/arm/plat-omap/include/plat/omap1510.h
index d24004668138..d24004668138 100644
--- a/arch/arm/plat-omap/include/mach/omap1510.h
+++ b/arch/arm/plat-omap/include/plat/omap1510.h
diff --git a/arch/arm/plat-omap/include/mach/omap16xx.h b/arch/arm/plat-omap/include/plat/omap16xx.h
index 0e69b504c25f..0e69b504c25f 100644
--- a/arch/arm/plat-omap/include/mach/omap16xx.h
+++ b/arch/arm/plat-omap/include/plat/omap16xx.h
diff --git a/arch/arm/plat-omap/include/mach/omap24xx.h b/arch/arm/plat-omap/include/plat/omap24xx.h
index 696edfc145a6..696edfc145a6 100644
--- a/arch/arm/plat-omap/include/mach/omap24xx.h
+++ b/arch/arm/plat-omap/include/plat/omap24xx.h
diff --git a/arch/arm/plat-omap/include/mach/omap34xx.h b/arch/arm/plat-omap/include/plat/omap34xx.h
index f8d186a73712..077f05979f86 100644
--- a/arch/arm/plat-omap/include/mach/omap34xx.h
+++ b/arch/arm/plat-omap/include/plat/omap34xx.h
@@ -72,16 +72,15 @@
72#define OMAP3430_ISP_CSI2A_END (OMAP3430_ISP_CSI2A_BASE + 0x16F) 72#define OMAP3430_ISP_CSI2A_END (OMAP3430_ISP_CSI2A_BASE + 0x16F)
73#define OMAP3430_ISP_CSI2PHY_END (OMAP3430_ISP_CSI2PHY_BASE + 0x007) 73#define OMAP3430_ISP_CSI2PHY_END (OMAP3430_ISP_CSI2PHY_BASE + 0x007)
74 74
75#define OMAP34XX_IVA_INTC_BASE 0x40000000
76#define OMAP34XX_HSUSB_OTG_BASE (L4_34XX_BASE + 0xAB000) 75#define OMAP34XX_HSUSB_OTG_BASE (L4_34XX_BASE + 0xAB000)
77#define OMAP34XX_HSUSB_HOST_BASE (L4_34XX_BASE + 0x64000)
78#define OMAP34XX_USBTLL_BASE (L4_34XX_BASE + 0x62000) 76#define OMAP34XX_USBTLL_BASE (L4_34XX_BASE + 0x62000)
77#define OMAP34XX_UHH_CONFIG_BASE (L4_34XX_BASE + 0x64000)
78#define OMAP34XX_OHCI_BASE (L4_34XX_BASE + 0x64400)
79#define OMAP34XX_EHCI_BASE (L4_34XX_BASE + 0x64800)
80#define OMAP34XX_SR1_BASE 0x480C9000
81#define OMAP34XX_SR2_BASE 0x480CB000
79 82
80#define OMAP34XX_MAILBOX_BASE (L4_34XX_BASE + 0x94000) 83#define OMAP34XX_MAILBOX_BASE (L4_34XX_BASE + 0x94000)
81 84
82#define OMAP34XX_DSP_BASE 0x58000000
83#define OMAP34XX_DSP_MEM_BASE (OMAP34XX_DSP_BASE + 0x0)
84#define OMAP34XX_DSP_IPI_BASE (OMAP34XX_DSP_BASE + 0x1000000)
85#define OMAP34XX_DSP_MMU_BASE (OMAP34XX_DSP_BASE + 0x2000000)
86#endif /* __ASM_ARCH_OMAP34XX_H */ 85#endif /* __ASM_ARCH_OMAP34XX_H */
87 86
diff --git a/arch/arm/plat-omap/include/mach/omap44xx.h b/arch/arm/plat-omap/include/plat/omap44xx.h
index b3ba5ac7b4a4..e52902a15c1a 100644
--- a/arch/arm/plat-omap/include/mach/omap44xx.h
+++ b/arch/arm/plat-omap/include/plat/omap44xx.h
@@ -22,6 +22,9 @@
22#define L4_PER_44XX_BASE 0x48000000 22#define L4_PER_44XX_BASE 0x48000000
23#define L4_EMU_44XX_BASE 0x54000000 23#define L4_EMU_44XX_BASE 0x54000000
24#define L3_44XX_BASE 0x44000000 24#define L3_44XX_BASE 0x44000000
25#define OMAP44XX_EMIF1_BASE 0x4c000000
26#define OMAP44XX_EMIF2_BASE 0x4d000000
27#define OMAP44XX_DMM_BASE 0x4e000000
25#define OMAP4430_32KSYNCT_BASE 0x4a304000 28#define OMAP4430_32KSYNCT_BASE 0x4a304000
26#define OMAP4430_CM_BASE 0x4a004000 29#define OMAP4430_CM_BASE 0x4a004000
27#define OMAP4430_PRM_BASE 0x48306000 30#define OMAP4430_PRM_BASE 0x48306000
@@ -33,14 +36,11 @@
33#define IRQ_SIR_IRQ 0x0040 36#define IRQ_SIR_IRQ 0x0040
34#define OMAP44XX_GIC_DIST_BASE 0x48241000 37#define OMAP44XX_GIC_DIST_BASE 0x48241000
35#define OMAP44XX_GIC_CPU_BASE 0x48240100 38#define OMAP44XX_GIC_CPU_BASE 0x48240100
36#define OMAP44XX_VA_GIC_CPU_BASE OMAP2_IO_ADDRESS(OMAP44XX_GIC_CPU_BASE)
37#define OMAP44XX_SCU_BASE 0x48240000 39#define OMAP44XX_SCU_BASE 0x48240000
38#define OMAP44XX_VA_SCU_BASE OMAP2_IO_ADDRESS(OMAP44XX_SCU_BASE)
39#define OMAP44XX_LOCAL_TWD_BASE 0x48240600 40#define OMAP44XX_LOCAL_TWD_BASE 0x48240600
40#define OMAP44XX_VA_LOCAL_TWD_BASE OMAP2_IO_ADDRESS(OMAP44XX_LOCAL_TWD_BASE)
41#define OMAP44XX_LOCAL_TWD_SIZE 0x00000100
42#define OMAP44XX_WKUPGEN_BASE 0x48281000 41#define OMAP44XX_WKUPGEN_BASE 0x48281000
43#define OMAP44XX_VA_WKUPGEN_BASE OMAP2_IO_ADDRESS(OMAP44XX_WKUPGEN_BASE) 42
43#define OMAP44XX_MAILBOX_BASE (L4_44XX_BASE + 0xF4000)
44 44
45#endif /* __ASM_ARCH_OMAP44XX_H */ 45#endif /* __ASM_ARCH_OMAP44XX_H */
46 46
diff --git a/arch/arm/plat-omap/include/mach/omap730.h b/arch/arm/plat-omap/include/plat/omap730.h
index 14272bc1a6fd..14272bc1a6fd 100644
--- a/arch/arm/plat-omap/include/mach/omap730.h
+++ b/arch/arm/plat-omap/include/plat/omap730.h
diff --git a/arch/arm/plat-omap/include/plat/omap7xx.h b/arch/arm/plat-omap/include/plat/omap7xx.h
new file mode 100644
index 000000000000..53f52414b0e9
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/omap7xx.h
@@ -0,0 +1,104 @@
1/* arch/arm/plat-omap/include/mach/omap7xx.h
2 *
3 * Hardware definitions for TI OMAP7XX processor.
4 *
5 * Cleanup for Linux-2.6 by Dirk Behme <dirk.behme@de.bosch.com>
6 * Adapted for omap850 by Zebediah C. McClure <zmc@lurian.net>
7 * Adapted for omap7xx by Alistair Buxton <a.j.buxton@gmail.com>
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 *
14 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
15 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
16 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
17 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
20 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
21 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 *
25 * You should have received a copy of the GNU General Public License along
26 * with this program; if not, write to the Free Software Foundation, Inc.,
27 * 675 Mass Ave, Cambridge, MA 02139, USA.
28 */
29
30#ifndef __ASM_ARCH_OMAP7XX_H
31#define __ASM_ARCH_OMAP7XX_H
32
33/*
34 * ----------------------------------------------------------------------------
35 * Base addresses
36 * ----------------------------------------------------------------------------
37 */
38
39/* Syntax: XX_BASE = Virtual base address, XX_START = Physical base address */
40
41#define OMAP7XX_DSP_BASE 0xE0000000
42#define OMAP7XX_DSP_SIZE 0x50000
43#define OMAP7XX_DSP_START 0xE0000000
44
45#define OMAP7XX_DSPREG_BASE 0xE1000000
46#define OMAP7XX_DSPREG_SIZE SZ_128K
47#define OMAP7XX_DSPREG_START 0xE1000000
48
49/*
50 * ----------------------------------------------------------------------------
51 * OMAP7XX specific configuration registers
52 * ----------------------------------------------------------------------------
53 */
54#define OMAP7XX_CONFIG_BASE 0xfffe1000
55#define OMAP7XX_IO_CONF_0 0xfffe1070
56#define OMAP7XX_IO_CONF_1 0xfffe1074
57#define OMAP7XX_IO_CONF_2 0xfffe1078
58#define OMAP7XX_IO_CONF_3 0xfffe107c
59#define OMAP7XX_IO_CONF_4 0xfffe1080
60#define OMAP7XX_IO_CONF_5 0xfffe1084
61#define OMAP7XX_IO_CONF_6 0xfffe1088
62#define OMAP7XX_IO_CONF_7 0xfffe108c
63#define OMAP7XX_IO_CONF_8 0xfffe1090
64#define OMAP7XX_IO_CONF_9 0xfffe1094
65#define OMAP7XX_IO_CONF_10 0xfffe1098
66#define OMAP7XX_IO_CONF_11 0xfffe109c
67#define OMAP7XX_IO_CONF_12 0xfffe10a0
68#define OMAP7XX_IO_CONF_13 0xfffe10a4
69
70#define OMAP7XX_MODE_1 0xfffe1010
71#define OMAP7XX_MODE_2 0xfffe1014
72
73/* CSMI specials: in terms of base + offset */
74#define OMAP7XX_MODE2_OFFSET 0x14
75
76/*
77 * ----------------------------------------------------------------------------
78 * OMAP7XX traffic controller configuration registers
79 * ----------------------------------------------------------------------------
80 */
81#define OMAP7XX_FLASH_CFG_0 0xfffecc10
82#define OMAP7XX_FLASH_ACFG_0 0xfffecc50
83#define OMAP7XX_FLASH_CFG_1 0xfffecc14
84#define OMAP7XX_FLASH_ACFG_1 0xfffecc54
85
86/*
87 * ----------------------------------------------------------------------------
88 * OMAP7XX DSP control registers
89 * ----------------------------------------------------------------------------
90 */
91#define OMAP7XX_ICR_BASE 0xfffbb800
92#define OMAP7XX_DSP_M_CTL 0xfffbb804
93#define OMAP7XX_DSP_MMU_BASE 0xfffed200
94
95/*
96 * ----------------------------------------------------------------------------
97 * OMAP7XX PCC_UPLD configuration registers
98 * ----------------------------------------------------------------------------
99 */
100#define OMAP7XX_PCC_UPLD_CTRL_BASE (0xfffe0900)
101#define OMAP7XX_PCC_UPLD_CTRL (OMAP7XX_PCC_UPLD_CTRL_BASE + 0x00)
102
103#endif /* __ASM_ARCH_OMAP7XX_H */
104
diff --git a/arch/arm/plat-omap/include/mach/omap850.h b/arch/arm/plat-omap/include/plat/omap850.h
index c33f67981712..c33f67981712 100644
--- a/arch/arm/plat-omap/include/mach/omap850.h
+++ b/arch/arm/plat-omap/include/plat/omap850.h
diff --git a/arch/arm/plat-omap/include/mach/omap_device.h b/arch/arm/plat-omap/include/plat/omap_device.h
index bd0e136db337..11a9773a4e7f 100644
--- a/arch/arm/plat-omap/include/mach/omap_device.h
+++ b/arch/arm/plat-omap/include/plat/omap_device.h
@@ -34,7 +34,7 @@
34#include <linux/kernel.h> 34#include <linux/kernel.h>
35#include <linux/platform_device.h> 35#include <linux/platform_device.h>
36 36
37#include <mach/omap_hwmod.h> 37#include <plat/omap_hwmod.h>
38 38
39/* omap_device._state values */ 39/* omap_device._state values */
40#define OMAP_DEVICE_STATE_UNKNOWN 0 40#define OMAP_DEVICE_STATE_UNKNOWN 0
diff --git a/arch/arm/plat-omap/include/mach/omap_hwmod.h b/arch/arm/plat-omap/include/plat/omap_hwmod.h
index 1f79c20e2929..dbdd123eca16 100644
--- a/arch/arm/plat-omap/include/mach/omap_hwmod.h
+++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h
@@ -35,7 +35,7 @@
35#include <linux/kernel.h> 35#include <linux/kernel.h>
36#include <linux/ioport.h> 36#include <linux/ioport.h>
37 37
38#include <mach/cpu.h> 38#include <plat/cpu.h>
39 39
40struct omap_device; 40struct omap_device;
41 41
diff --git a/arch/arm/plat-omap/include/mach/omapfb.h b/arch/arm/plat-omap/include/plat/omapfb.h
index b226bdf45739..bfef7ab95f17 100644
--- a/arch/arm/plat-omap/include/mach/omapfb.h
+++ b/arch/arm/plat-omap/include/plat/omapfb.h
@@ -168,7 +168,7 @@ enum omapfb_update_mode {
168#include <linux/fb.h> 168#include <linux/fb.h>
169#include <linux/mutex.h> 169#include <linux/mutex.h>
170 170
171#include <mach/board.h> 171#include <plat/board.h>
172 172
173#define OMAP_LCDC_INV_VSYNC 0x0001 173#define OMAP_LCDC_INV_VSYNC 0x0001
174#define OMAP_LCDC_INV_HSYNC 0x0002 174#define OMAP_LCDC_INV_HSYNC 0x0002
diff --git a/arch/arm/plat-omap/include/mach/onenand.h b/arch/arm/plat-omap/include/plat/onenand.h
index 72f433d7d827..72f433d7d827 100644
--- a/arch/arm/plat-omap/include/mach/onenand.h
+++ b/arch/arm/plat-omap/include/plat/onenand.h
diff --git a/arch/arm/plat-omap/include/mach/param.h b/arch/arm/plat-omap/include/plat/param.h
index 1eb4dc326979..1eb4dc326979 100644
--- a/arch/arm/plat-omap/include/mach/param.h
+++ b/arch/arm/plat-omap/include/plat/param.h
diff --git a/arch/arm/plat-omap/include/mach/powerdomain.h b/arch/arm/plat-omap/include/plat/powerdomain.h
index fa6461423bd0..3d45ee1d3cf4 100644
--- a/arch/arm/plat-omap/include/mach/powerdomain.h
+++ b/arch/arm/plat-omap/include/plat/powerdomain.h
@@ -19,7 +19,7 @@
19 19
20#include <asm/atomic.h> 20#include <asm/atomic.h>
21 21
22#include <mach/cpu.h> 22#include <plat/cpu.h>
23 23
24 24
25/* Powerdomain basic power states */ 25/* Powerdomain basic power states */
diff --git a/arch/arm/plat-omap/include/mach/prcm.h b/arch/arm/plat-omap/include/plat/prcm.h
index cda2a70397b4..e63e94e18975 100644
--- a/arch/arm/plat-omap/include/mach/prcm.h
+++ b/arch/arm/plat-omap/include/plat/prcm.h
@@ -27,9 +27,13 @@ u32 omap_prcm_get_reset_sources(void);
27void omap_prcm_arch_reset(char mode); 27void omap_prcm_arch_reset(char mode);
28int omap2_cm_wait_idlest(void __iomem *reg, u32 mask, const char *name); 28int omap2_cm_wait_idlest(void __iomem *reg, u32 mask, const char *name);
29 29
30#endif 30#define START_PADCONF_SAVE 0x2
31#define PADCONF_SAVE_DONE 0x1
31 32
33void omap3_prcm_save_context(void);
34void omap3_prcm_restore_context(void);
32 35
36#endif
33 37
34 38
35 39
diff --git a/arch/arm/plat-omap/include/mach/sdrc.h b/arch/arm/plat-omap/include/plat/sdrc.h
index 1c09c78a48f2..f704030d2a70 100644
--- a/arch/arm/plat-omap/include/mach/sdrc.h
+++ b/arch/arm/plat-omap/include/plat/sdrc.h
@@ -44,6 +44,12 @@
44#define SDRC_RFR_CTRL_1 0x0D4 44#define SDRC_RFR_CTRL_1 0x0D4
45#define SDRC_MANUAL_1 0x0D8 45#define SDRC_MANUAL_1 0x0D8
46 46
47#define SDRC_POWER_AUTOCOUNT_SHIFT 8
48#define SDRC_POWER_AUTOCOUNT_MASK (0xffff << SDRC_POWER_AUTOCOUNT_SHIFT)
49#define SDRC_POWER_CLKCTRL_SHIFT 4
50#define SDRC_POWER_CLKCTRL_MASK (0x3 << SDRC_POWER_CLKCTRL_SHIFT)
51#define SDRC_SELF_REFRESH_ON_AUTOCOUNT (0x2 << SDRC_POWER_CLKCTRL_SHIFT)
52
47/* 53/*
48 * These values represent the number of memory clock cycles between 54 * These values represent the number of memory clock cycles between
49 * autorefresh initiation. They assume 1 refresh per 64 ms (JEDEC), 8192 55 * autorefresh initiation. They assume 1 refresh per 64 ms (JEDEC), 8192
@@ -80,11 +86,11 @@
80 */ 86 */
81 87
82#define OMAP242X_SMS_REGADDR(reg) \ 88#define OMAP242X_SMS_REGADDR(reg) \
83 (void __iomem *)OMAP2_IO_ADDRESS(OMAP2420_SMS_BASE + reg) 89 (void __iomem *)OMAP2_L3_IO_ADDRESS(OMAP2420_SMS_BASE + reg)
84#define OMAP243X_SMS_REGADDR(reg) \ 90#define OMAP243X_SMS_REGADDR(reg) \
85 (void __iomem *)OMAP2_IO_ADDRESS(OMAP243X_SMS_BASE + reg) 91 (void __iomem *)OMAP2_L3_IO_ADDRESS(OMAP243X_SMS_BASE + reg)
86#define OMAP343X_SMS_REGADDR(reg) \ 92#define OMAP343X_SMS_REGADDR(reg) \
87 (void __iomem *)OMAP2_IO_ADDRESS(OMAP343X_SMS_BASE + reg) 93 (void __iomem *)OMAP2_L3_IO_ADDRESS(OMAP343X_SMS_BASE + reg)
88 94
89/* SMS register offsets - read/write with sms_{read,write}_reg() */ 95/* SMS register offsets - read/write with sms_{read,write}_reg() */
90 96
@@ -120,6 +126,8 @@ void __init omap2_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
120int omap2_sdrc_get_params(unsigned long r, 126int omap2_sdrc_get_params(unsigned long r,
121 struct omap_sdrc_params **sdrc_cs0, 127 struct omap_sdrc_params **sdrc_cs0,
122 struct omap_sdrc_params **sdrc_cs1); 128 struct omap_sdrc_params **sdrc_cs1);
129void omap2_sms_save_context(void);
130void omap2_sms_restore_context(void);
123 131
124#ifdef CONFIG_ARCH_OMAP2 132#ifdef CONFIG_ARCH_OMAP2
125 133
diff --git a/arch/arm/plat-omap/include/mach/serial.h b/arch/arm/plat-omap/include/plat/serial.h
index e249186d26e2..9951345a25d6 100644
--- a/arch/arm/plat-omap/include/mach/serial.h
+++ b/arch/arm/plat-omap/include/plat/serial.h
@@ -20,26 +20,22 @@
20#define OMAP_UART1_BASE 0xfffb0000 20#define OMAP_UART1_BASE 0xfffb0000
21#define OMAP_UART2_BASE 0xfffb0800 21#define OMAP_UART2_BASE 0xfffb0800
22#define OMAP_UART3_BASE 0xfffb9800 22#define OMAP_UART3_BASE 0xfffb9800
23#define OMAP_MAX_NR_PORTS 3
24#elif defined(CONFIG_ARCH_OMAP2) 23#elif defined(CONFIG_ARCH_OMAP2)
25/* OMAP2 serial ports */ 24/* OMAP2 serial ports */
26#define OMAP_UART1_BASE 0x4806a000 25#define OMAP_UART1_BASE 0x4806a000
27#define OMAP_UART2_BASE 0x4806c000 26#define OMAP_UART2_BASE 0x4806c000
28#define OMAP_UART3_BASE 0x4806e000 27#define OMAP_UART3_BASE 0x4806e000
29#define OMAP_MAX_NR_PORTS 3
30#elif defined(CONFIG_ARCH_OMAP3) 28#elif defined(CONFIG_ARCH_OMAP3)
31/* OMAP3 serial ports */ 29/* OMAP3 serial ports */
32#define OMAP_UART1_BASE 0x4806a000 30#define OMAP_UART1_BASE 0x4806a000
33#define OMAP_UART2_BASE 0x4806c000 31#define OMAP_UART2_BASE 0x4806c000
34#define OMAP_UART3_BASE 0x49020000 32#define OMAP_UART3_BASE 0x49020000
35#define OMAP_MAX_NR_PORTS 3
36#elif defined(CONFIG_ARCH_OMAP4) 33#elif defined(CONFIG_ARCH_OMAP4)
37/* OMAP4 serial ports */ 34/* OMAP4 serial ports */
38#define OMAP_UART1_BASE 0x4806a000 35#define OMAP_UART1_BASE 0x4806a000
39#define OMAP_UART2_BASE 0x4806c000 36#define OMAP_UART2_BASE 0x4806c000
40#define OMAP_UART3_BASE 0x48020000 37#define OMAP_UART3_BASE 0x48020000
41#define OMAP_UART4_BASE 0x4806e000 38#define OMAP_UART4_BASE 0x4806e000
42#define OMAP_MAX_NR_PORTS 4
43#endif 39#endif
44 40
45#define OMAP1510_BASE_BAUD (12000000/16) 41#define OMAP1510_BASE_BAUD (12000000/16)
diff --git a/arch/arm/plat-omap/include/mach/smp.h b/arch/arm/plat-omap/include/plat/smp.h
index dcaa8fde7063..dcaa8fde7063 100644
--- a/arch/arm/plat-omap/include/mach/smp.h
+++ b/arch/arm/plat-omap/include/plat/smp.h
diff --git a/arch/arm/plat-omap/include/mach/sram.h b/arch/arm/plat-omap/include/plat/sram.h
index 8974e3fc2691..16a1b458d53c 100644
--- a/arch/arm/plat-omap/include/mach/sram.h
+++ b/arch/arm/plat-omap/include/plat/sram.h
@@ -27,6 +27,7 @@ extern u32 omap3_configure_core_dpll(
27 u32 sdrc_actim_ctrl_b_0, u32 sdrc_mr_0, 27 u32 sdrc_actim_ctrl_b_0, u32 sdrc_mr_0,
28 u32 sdrc_rfr_ctrl_1, u32 sdrc_actim_ctrl_a_1, 28 u32 sdrc_rfr_ctrl_1, u32 sdrc_actim_ctrl_a_1,
29 u32 sdrc_actim_ctrl_b_1, u32 sdrc_mr_1); 29 u32 sdrc_actim_ctrl_b_1, u32 sdrc_mr_1);
30extern void omap3_sram_restore_context(void);
30 31
31/* Do not use these */ 32/* Do not use these */
32extern void omap1_sram_reprogram_clock(u32 ckctl, u32 dpllctl); 33extern void omap1_sram_reprogram_clock(u32 ckctl, u32 dpllctl);
@@ -68,4 +69,10 @@ extern u32 omap3_sram_configure_core_dpll(
68 u32 sdrc_actim_ctrl_b_1, u32 sdrc_mr_1); 69 u32 sdrc_actim_ctrl_b_1, u32 sdrc_mr_1);
69extern unsigned long omap3_sram_configure_core_dpll_sz; 70extern unsigned long omap3_sram_configure_core_dpll_sz;
70 71
72#ifdef CONFIG_PM
73extern void omap_push_sram_idle(void);
74#else
75static inline void omap_push_sram_idle(void) {}
76#endif /* CONFIG_PM */
77
71#endif 78#endif
diff --git a/arch/arm/plat-omap/include/mach/system.h b/arch/arm/plat-omap/include/plat/system.h
index ed8ec7477261..c58a4ef42a45 100644
--- a/arch/arm/plat-omap/include/mach/system.h
+++ b/arch/arm/plat-omap/include/plat/system.h
@@ -9,7 +9,7 @@
9#include <asm/mach-types.h> 9#include <asm/mach-types.h>
10#include <mach/hardware.h> 10#include <mach/hardware.h>
11 11
12#include <mach/prcm.h> 12#include <plat/prcm.h>
13 13
14#ifndef CONFIG_MACH_VOICEBLUE 14#ifndef CONFIG_MACH_VOICEBLUE
15#define voiceblue_reset() do {} while (0) 15#define voiceblue_reset() do {} while (0)
diff --git a/arch/arm/plat-omap/include/mach/tc.h b/arch/arm/plat-omap/include/plat/tc.h
index d2fcd789bb9a..d2fcd789bb9a 100644
--- a/arch/arm/plat-omap/include/mach/tc.h
+++ b/arch/arm/plat-omap/include/plat/tc.h
diff --git a/arch/arm/plat-omap/include/mach/timer-gp.h b/arch/arm/plat-omap/include/plat/timer-gp.h
index c88d346b59d9..c88d346b59d9 100644
--- a/arch/arm/plat-omap/include/mach/timer-gp.h
+++ b/arch/arm/plat-omap/include/plat/timer-gp.h
diff --git a/arch/arm/plat-omap/include/mach/timex.h b/arch/arm/plat-omap/include/plat/timex.h
index 6d35767bc48f..6d35767bc48f 100644
--- a/arch/arm/plat-omap/include/mach/timex.h
+++ b/arch/arm/plat-omap/include/plat/timex.h
diff --git a/arch/arm/plat-omap/include/mach/uncompress.h b/arch/arm/plat-omap/include/plat/uncompress.h
index 0814c5f210c3..13c305d62127 100644
--- a/arch/arm/plat-omap/include/mach/uncompress.h
+++ b/arch/arm/plat-omap/include/plat/uncompress.h
@@ -19,12 +19,13 @@
19 19
20#include <linux/types.h> 20#include <linux/types.h>
21#include <linux/serial_reg.h> 21#include <linux/serial_reg.h>
22#include <mach/serial.h> 22#include <plat/serial.h>
23 23
24unsigned int system_rev; 24unsigned int system_rev;
25 25
26#define UART_OMAP_MDR1 0x08 /* mode definition register */ 26#define UART_OMAP_MDR1 0x08 /* mode definition register */
27#define OMAP_ID_730 0x355F 27#define OMAP_ID_730 0x355F
28#define OMAP_ID_850 0x362C
28#define ID_MASK 0x7fff 29#define ID_MASK 0x7fff
29#define check_port(base, shift) ((base[UART_OMAP_MDR1 << shift] & 7) == 0) 30#define check_port(base, shift) ((base[UART_OMAP_MDR1 << shift] & 7) == 0)
30#define omap_get_id() ((*(volatile unsigned int *)(0xfffed404)) >> 12) & ID_MASK 31#define omap_get_id() ((*(volatile unsigned int *)(0xfffed404)) >> 12) & ID_MASK
@@ -43,8 +44,12 @@ static void putc(int c)
43 uart = (volatile u8 *)(OMAP_UART3_BASE); 44 uart = (volatile u8 *)(OMAP_UART3_BASE);
44#elif defined(CONFIG_OMAP_LL_DEBUG_UART2) 45#elif defined(CONFIG_OMAP_LL_DEBUG_UART2)
45 uart = (volatile u8 *)(OMAP_UART2_BASE); 46 uart = (volatile u8 *)(OMAP_UART2_BASE);
46#else 47#elif defined(CONFIG_OMAP_LL_DEBUG_UART1)
47 uart = (volatile u8 *)(OMAP_UART1_BASE); 48 uart = (volatile u8 *)(OMAP_UART1_BASE);
49#elif defined(CONFIG_OMAP_LL_DEBUG_NONE)
50 return;
51#else
52 return;
48#endif 53#endif
49 54
50#ifdef CONFIG_ARCH_OMAP1 55#ifdef CONFIG_ARCH_OMAP1
@@ -53,7 +58,7 @@ static void putc(int c)
53 /* MMU is not on, so cpu_is_omapXXXX() won't work here */ 58 /* MMU is not on, so cpu_is_omapXXXX() won't work here */
54 unsigned int omap_id = omap_get_id(); 59 unsigned int omap_id = omap_get_id();
55 60
56 if (omap_id == OMAP_ID_730) 61 if (omap_id == OMAP_ID_730 || omap_id == OMAP_ID_850)
57 shift = 0; 62 shift = 0;
58 63
59 if (check_port(uart, shift)) 64 if (check_port(uart, shift))
diff --git a/arch/arm/plat-omap/include/mach/usb.h b/arch/arm/plat-omap/include/plat/usb.h
index f337e1761e2c..33a500eb2f93 100644
--- a/arch/arm/plat-omap/include/mach/usb.h
+++ b/arch/arm/plat-omap/include/plat/usb.h
@@ -3,7 +3,22 @@
3#ifndef __ASM_ARCH_OMAP_USB_H 3#ifndef __ASM_ARCH_OMAP_USB_H
4#define __ASM_ARCH_OMAP_USB_H 4#define __ASM_ARCH_OMAP_USB_H
5 5
6#include <mach/board.h> 6#include <plat/board.h>
7
8#define OMAP3_HS_USB_PORTS 3
9enum ehci_hcd_omap_mode {
10 EHCI_HCD_OMAP_MODE_UNKNOWN,
11 EHCI_HCD_OMAP_MODE_PHY,
12 EHCI_HCD_OMAP_MODE_TLL,
13};
14
15struct ehci_hcd_omap_platform_data {
16 enum ehci_hcd_omap_mode port_mode[OMAP3_HS_USB_PORTS];
17 unsigned phy_reset:1;
18
19 /* have to be valid if phy_reset is true and portx is in phy mode */
20 int reset_gpio_port[OMAP3_HS_USB_PORTS];
21};
7 22
8/*-------------------------------------------------------------------------*/ 23/*-------------------------------------------------------------------------*/
9 24
@@ -29,6 +44,8 @@
29 44
30extern void usb_musb_init(void); 45extern void usb_musb_init(void);
31 46
47extern void usb_ehci_init(struct ehci_hcd_omap_platform_data *pdata);
48
32#endif 49#endif
33 50
34void omap_usb_init(struct omap_usb_config *pdata); 51void omap_usb_init(struct omap_usb_config *pdata);
diff --git a/arch/arm/plat-omap/io.c b/arch/arm/plat-omap/io.c
index b6defa23e77e..11f5d7961c73 100644
--- a/arch/arm/plat-omap/io.c
+++ b/arch/arm/plat-omap/io.c
@@ -13,12 +13,12 @@
13#include <linux/io.h> 13#include <linux/io.h>
14#include <linux/mm.h> 14#include <linux/mm.h>
15 15
16#include <mach/omap730.h> 16#include <plat/omap7xx.h>
17#include <mach/omap1510.h> 17#include <plat/omap1510.h>
18#include <mach/omap16xx.h> 18#include <plat/omap16xx.h>
19#include <mach/omap24xx.h> 19#include <plat/omap24xx.h>
20#include <mach/omap34xx.h> 20#include <plat/omap34xx.h>
21#include <mach/omap44xx.h> 21#include <plat/omap44xx.h>
22 22
23#define BETWEEN(p,st,sz) ((p) >= (st) && (p) < ((st) + (sz))) 23#define BETWEEN(p,st,sz) ((p) >= (st) && (p) < ((st) + (sz)))
24#define XLATE(p,pst,vst) ((void __iomem *)((p) - (pst) + (vst))) 24#define XLATE(p,pst,vst) ((void __iomem *)((p) - (pst) + (vst)))
@@ -33,13 +33,13 @@ void __iomem *omap_ioremap(unsigned long p, size_t size, unsigned int type)
33 if (BETWEEN(p, OMAP1_IO_PHYS, OMAP1_IO_SIZE)) 33 if (BETWEEN(p, OMAP1_IO_PHYS, OMAP1_IO_SIZE))
34 return XLATE(p, OMAP1_IO_PHYS, OMAP1_IO_VIRT); 34 return XLATE(p, OMAP1_IO_PHYS, OMAP1_IO_VIRT);
35 } 35 }
36 if (cpu_is_omap730()) { 36 if (cpu_is_omap7xx()) {
37 if (BETWEEN(p, OMAP730_DSP_BASE, OMAP730_DSP_SIZE)) 37 if (BETWEEN(p, OMAP7XX_DSP_BASE, OMAP7XX_DSP_SIZE))
38 return XLATE(p, OMAP730_DSP_BASE, OMAP730_DSP_START); 38 return XLATE(p, OMAP7XX_DSP_BASE, OMAP7XX_DSP_START);
39 39
40 if (BETWEEN(p, OMAP730_DSPREG_BASE, OMAP730_DSPREG_SIZE)) 40 if (BETWEEN(p, OMAP7XX_DSPREG_BASE, OMAP7XX_DSPREG_SIZE))
41 return XLATE(p, OMAP730_DSPREG_BASE, 41 return XLATE(p, OMAP7XX_DSPREG_BASE,
42 OMAP730_DSPREG_START); 42 OMAP7XX_DSPREG_START);
43 } 43 }
44 if (cpu_is_omap15xx()) { 44 if (cpu_is_omap15xx()) {
45 if (BETWEEN(p, OMAP1510_DSP_BASE, OMAP1510_DSP_SIZE)) 45 if (BETWEEN(p, OMAP1510_DSP_BASE, OMAP1510_DSP_SIZE))
@@ -114,6 +114,14 @@ void __iomem *omap_ioremap(unsigned long p, size_t size, unsigned int type)
114 return XLATE(p, L4_WK_44XX_PHYS, L4_WK_44XX_VIRT); 114 return XLATE(p, L4_WK_44XX_PHYS, L4_WK_44XX_VIRT);
115 if (BETWEEN(p, OMAP44XX_GPMC_PHYS, OMAP44XX_GPMC_SIZE)) 115 if (BETWEEN(p, OMAP44XX_GPMC_PHYS, OMAP44XX_GPMC_SIZE))
116 return XLATE(p, OMAP44XX_GPMC_PHYS, OMAP44XX_GPMC_VIRT); 116 return XLATE(p, OMAP44XX_GPMC_PHYS, OMAP44XX_GPMC_VIRT);
117 if (BETWEEN(p, OMAP44XX_EMIF1_PHYS, OMAP44XX_EMIF1_SIZE))
118 return XLATE(p, OMAP44XX_EMIF1_PHYS, \
119 OMAP44XX_EMIF1_VIRT);
120 if (BETWEEN(p, OMAP44XX_EMIF2_PHYS, OMAP44XX_EMIF2_SIZE))
121 return XLATE(p, OMAP44XX_EMIF2_PHYS, \
122 OMAP44XX_EMIF2_VIRT);
123 if (BETWEEN(p, OMAP44XX_DMM_PHYS, OMAP44XX_DMM_SIZE))
124 return XLATE(p, OMAP44XX_DMM_PHYS, OMAP44XX_DMM_VIRT);
117 if (BETWEEN(p, L4_PER_44XX_PHYS, L4_PER_44XX_SIZE)) 125 if (BETWEEN(p, L4_PER_44XX_PHYS, L4_PER_44XX_SIZE))
118 return XLATE(p, L4_PER_44XX_PHYS, L4_PER_44XX_VIRT); 126 return XLATE(p, L4_PER_44XX_PHYS, L4_PER_44XX_VIRT);
119 if (BETWEEN(p, L4_EMU_44XX_PHYS, L4_EMU_44XX_SIZE)) 127 if (BETWEEN(p, L4_EMU_44XX_PHYS, L4_EMU_44XX_SIZE))
@@ -142,7 +150,7 @@ u8 omap_readb(u32 pa)
142 if (cpu_class_is_omap1()) 150 if (cpu_class_is_omap1())
143 return __raw_readb(OMAP1_IO_ADDRESS(pa)); 151 return __raw_readb(OMAP1_IO_ADDRESS(pa));
144 else 152 else
145 return __raw_readb(OMAP2_IO_ADDRESS(pa)); 153 return __raw_readb(OMAP2_L4_IO_ADDRESS(pa));
146} 154}
147EXPORT_SYMBOL(omap_readb); 155EXPORT_SYMBOL(omap_readb);
148 156
@@ -151,7 +159,7 @@ u16 omap_readw(u32 pa)
151 if (cpu_class_is_omap1()) 159 if (cpu_class_is_omap1())
152 return __raw_readw(OMAP1_IO_ADDRESS(pa)); 160 return __raw_readw(OMAP1_IO_ADDRESS(pa));
153 else 161 else
154 return __raw_readw(OMAP2_IO_ADDRESS(pa)); 162 return __raw_readw(OMAP2_L4_IO_ADDRESS(pa));
155} 163}
156EXPORT_SYMBOL(omap_readw); 164EXPORT_SYMBOL(omap_readw);
157 165
@@ -160,7 +168,7 @@ u32 omap_readl(u32 pa)
160 if (cpu_class_is_omap1()) 168 if (cpu_class_is_omap1())
161 return __raw_readl(OMAP1_IO_ADDRESS(pa)); 169 return __raw_readl(OMAP1_IO_ADDRESS(pa));
162 else 170 else
163 return __raw_readl(OMAP2_IO_ADDRESS(pa)); 171 return __raw_readl(OMAP2_L4_IO_ADDRESS(pa));
164} 172}
165EXPORT_SYMBOL(omap_readl); 173EXPORT_SYMBOL(omap_readl);
166 174
@@ -169,7 +177,7 @@ void omap_writeb(u8 v, u32 pa)
169 if (cpu_class_is_omap1()) 177 if (cpu_class_is_omap1())
170 __raw_writeb(v, OMAP1_IO_ADDRESS(pa)); 178 __raw_writeb(v, OMAP1_IO_ADDRESS(pa));
171 else 179 else
172 __raw_writeb(v, OMAP2_IO_ADDRESS(pa)); 180 __raw_writeb(v, OMAP2_L4_IO_ADDRESS(pa));
173} 181}
174EXPORT_SYMBOL(omap_writeb); 182EXPORT_SYMBOL(omap_writeb);
175 183
@@ -178,7 +186,7 @@ void omap_writew(u16 v, u32 pa)
178 if (cpu_class_is_omap1()) 186 if (cpu_class_is_omap1())
179 __raw_writew(v, OMAP1_IO_ADDRESS(pa)); 187 __raw_writew(v, OMAP1_IO_ADDRESS(pa));
180 else 188 else
181 __raw_writew(v, OMAP2_IO_ADDRESS(pa)); 189 __raw_writew(v, OMAP2_L4_IO_ADDRESS(pa));
182} 190}
183EXPORT_SYMBOL(omap_writew); 191EXPORT_SYMBOL(omap_writew);
184 192
@@ -187,6 +195,6 @@ void omap_writel(u32 v, u32 pa)
187 if (cpu_class_is_omap1()) 195 if (cpu_class_is_omap1())
188 __raw_writel(v, OMAP1_IO_ADDRESS(pa)); 196 __raw_writel(v, OMAP1_IO_ADDRESS(pa));
189 else 197 else
190 __raw_writel(v, OMAP2_IO_ADDRESS(pa)); 198 __raw_writel(v, OMAP2_L4_IO_ADDRESS(pa));
191} 199}
192EXPORT_SYMBOL(omap_writel); 200EXPORT_SYMBOL(omap_writel);
diff --git a/arch/arm/plat-omap/iommu-debug.c b/arch/arm/plat-omap/iommu-debug.c
index c799b3b0d709..afd1c27cff7c 100644
--- a/arch/arm/plat-omap/iommu-debug.c
+++ b/arch/arm/plat-omap/iommu-debug.c
@@ -17,8 +17,8 @@
17#include <linux/platform_device.h> 17#include <linux/platform_device.h>
18#include <linux/debugfs.h> 18#include <linux/debugfs.h>
19 19
20#include <mach/iommu.h> 20#include <plat/iommu.h>
21#include <mach/iovmm.h> 21#include <plat/iovmm.h>
22 22
23#include "iopgtable.h" 23#include "iopgtable.h"
24 24
diff --git a/arch/arm/plat-omap/iommu.c b/arch/arm/plat-omap/iommu.c
index 94584f167a82..c0ff1e39d893 100644
--- a/arch/arm/plat-omap/iommu.c
+++ b/arch/arm/plat-omap/iommu.c
@@ -20,7 +20,7 @@
20 20
21#include <asm/cacheflush.h> 21#include <asm/cacheflush.h>
22 22
23#include <mach/iommu.h> 23#include <plat/iommu.h>
24 24
25#include "iopgtable.h" 25#include "iopgtable.h"
26 26
diff --git a/arch/arm/plat-omap/iovmm.c b/arch/arm/plat-omap/iovmm.c
index dc3fac3dd0ea..936aef1971cd 100644
--- a/arch/arm/plat-omap/iovmm.c
+++ b/arch/arm/plat-omap/iovmm.c
@@ -18,8 +18,8 @@
18#include <asm/cacheflush.h> 18#include <asm/cacheflush.h>
19#include <asm/mach/map.h> 19#include <asm/mach/map.h>
20 20
21#include <mach/iommu.h> 21#include <plat/iommu.h>
22#include <mach/iovmm.h> 22#include <plat/iovmm.h>
23 23
24#include "iopgtable.h" 24#include "iopgtable.h"
25 25
@@ -392,7 +392,6 @@ static void sgtable_fill_vmalloc(struct sg_table *sgt, void *_va)
392 } 392 }
393 393
394 va_end = _va + PAGE_SIZE * i; 394 va_end = _va + PAGE_SIZE * i;
395 flush_cache_vmap((unsigned long)_va, (unsigned long)va_end);
396} 395}
397 396
398static inline void sgtable_drain_vmalloc(struct sg_table *sgt) 397static inline void sgtable_drain_vmalloc(struct sg_table *sgt)
@@ -427,8 +426,6 @@ static void sgtable_fill_kmalloc(struct sg_table *sgt, u32 pa, size_t len)
427 len -= bytes; 426 len -= bytes;
428 } 427 }
429 BUG_ON(len); 428 BUG_ON(len);
430
431 clean_dcache_area(va, len);
432} 429}
433 430
434static inline void sgtable_drain_kmalloc(struct sg_table *sgt) 431static inline void sgtable_drain_kmalloc(struct sg_table *sgt)
@@ -449,7 +446,7 @@ static int map_iovm_area(struct iommu *obj, struct iovm_struct *new,
449 struct scatterlist *sg; 446 struct scatterlist *sg;
450 u32 da = new->da_start; 447 u32 da = new->da_start;
451 448
452 if (!obj || !new || !sgt) 449 if (!obj || !sgt)
453 return -EINVAL; 450 return -EINVAL;
454 451
455 BUG_ON(!sgtable_ok(sgt)); 452 BUG_ON(!sgtable_ok(sgt));
@@ -617,7 +614,7 @@ u32 iommu_vmap(struct iommu *obj, u32 da, const struct sg_table *sgt,
617 u32 flags) 614 u32 flags)
618{ 615{
619 size_t bytes; 616 size_t bytes;
620 void *va; 617 void *va = NULL;
621 618
622 if (!obj || !obj->dev || !sgt) 619 if (!obj || !obj->dev || !sgt)
623 return -EINVAL; 620 return -EINVAL;
@@ -627,9 +624,11 @@ u32 iommu_vmap(struct iommu *obj, u32 da, const struct sg_table *sgt,
627 return -EINVAL; 624 return -EINVAL;
628 bytes = PAGE_ALIGN(bytes); 625 bytes = PAGE_ALIGN(bytes);
629 626
630 va = vmap_sg(sgt); 627 if (flags & IOVMF_MMIO) {
631 if (IS_ERR(va)) 628 va = vmap_sg(sgt);
632 return PTR_ERR(va); 629 if (IS_ERR(va))
630 return PTR_ERR(va);
631 }
633 632
634 flags &= IOVMF_HW_MASK; 633 flags &= IOVMF_HW_MASK;
635 flags |= IOVMF_DISCONT; 634 flags |= IOVMF_DISCONT;
diff --git a/arch/arm/plat-omap/mailbox.c b/arch/arm/plat-omap/mailbox.c
index 40424edae939..8e90633e4cb9 100644
--- a/arch/arm/plat-omap/mailbox.c
+++ b/arch/arm/plat-omap/mailbox.c
@@ -26,55 +26,12 @@
26#include <linux/device.h> 26#include <linux/device.h>
27#include <linux/delay.h> 27#include <linux/delay.h>
28 28
29#include <mach/mailbox.h> 29#include <plat/mailbox.h>
30
31static int enable_seq_bit;
32module_param(enable_seq_bit, bool, 0);
33MODULE_PARM_DESC(enable_seq_bit, "Enable sequence bit checking.");
34 30
35static struct omap_mbox *mboxes; 31static struct omap_mbox *mboxes;
36static DEFINE_RWLOCK(mboxes_lock); 32static DEFINE_RWLOCK(mboxes_lock);
37 33
38/* 34static int mbox_configured;
39 * Mailbox sequence bit API
40 */
41
42/* seq_rcv should be initialized with any value other than
43 * 0 and 1 << 31, to allow either value for the first
44 * message. */
45static inline void mbox_seq_init(struct omap_mbox *mbox)
46{
47 if (!enable_seq_bit)
48 return;
49
50 /* any value other than 0 and 1 << 31 */
51 mbox->seq_rcv = 0xffffffff;
52}
53
54static inline void mbox_seq_toggle(struct omap_mbox *mbox, mbox_msg_t * msg)
55{
56 if (!enable_seq_bit)
57 return;
58
59 /* add seq_snd to msg */
60 *msg = (*msg & 0x7fffffff) | mbox->seq_snd;
61 /* flip seq_snd */
62 mbox->seq_snd ^= 1 << 31;
63}
64
65static inline int mbox_seq_test(struct omap_mbox *mbox, mbox_msg_t msg)
66{
67 mbox_msg_t seq;
68
69 if (!enable_seq_bit)
70 return 0;
71
72 seq = msg & (1 << 31);
73 if (seq == mbox->seq_rcv)
74 return -1;
75 mbox->seq_rcv = seq;
76 return 0;
77}
78 35
79/* Mailbox FIFO handle functions */ 36/* Mailbox FIFO handle functions */
80static inline mbox_msg_t mbox_fifo_read(struct omap_mbox *mbox) 37static inline mbox_msg_t mbox_fifo_read(struct omap_mbox *mbox)
@@ -95,14 +52,6 @@ static inline int mbox_fifo_full(struct omap_mbox *mbox)
95} 52}
96 53
97/* Mailbox IRQ handle functions */ 54/* Mailbox IRQ handle functions */
98static inline void enable_mbox_irq(struct omap_mbox *mbox, omap_mbox_irq_t irq)
99{
100 mbox->ops->enable_irq(mbox, irq);
101}
102static inline void disable_mbox_irq(struct omap_mbox *mbox, omap_mbox_irq_t irq)
103{
104 mbox->ops->disable_irq(mbox, irq);
105}
106static inline void ack_mbox_irq(struct omap_mbox *mbox, omap_mbox_irq_t irq) 55static inline void ack_mbox_irq(struct omap_mbox *mbox, omap_mbox_irq_t irq)
107{ 56{
108 if (mbox->ops->ack_irq) 57 if (mbox->ops->ack_irq)
@@ -113,17 +62,10 @@ static inline int is_mbox_irq(struct omap_mbox *mbox, omap_mbox_irq_t irq)
113 return mbox->ops->is_irq(mbox, irq); 62 return mbox->ops->is_irq(mbox, irq);
114} 63}
115 64
116/* Mailbox Sequence Bit function */
117void omap_mbox_init_seq(struct omap_mbox *mbox)
118{
119 mbox_seq_init(mbox);
120}
121EXPORT_SYMBOL(omap_mbox_init_seq);
122
123/* 65/*
124 * message sender 66 * message sender
125 */ 67 */
126static int __mbox_msg_send(struct omap_mbox *mbox, mbox_msg_t msg, void *arg) 68static int __mbox_msg_send(struct omap_mbox *mbox, mbox_msg_t msg)
127{ 69{
128 int ret = 0, i = 1000; 70 int ret = 0, i = 1000;
129 71
@@ -134,89 +76,49 @@ static int __mbox_msg_send(struct omap_mbox *mbox, mbox_msg_t msg, void *arg)
134 return -1; 76 return -1;
135 udelay(1); 77 udelay(1);
136 } 78 }
137
138 if (arg && mbox->txq->callback) {
139 ret = mbox->txq->callback(arg);
140 if (ret)
141 goto out;
142 }
143
144 mbox_seq_toggle(mbox, &msg);
145 mbox_fifo_write(mbox, msg); 79 mbox_fifo_write(mbox, msg);
146 out:
147 return ret; 80 return ret;
148} 81}
149 82
150struct omap_msg_tx_data {
151 mbox_msg_t msg;
152 void *arg;
153};
154 83
155static void omap_msg_tx_end_io(struct request *rq, int error) 84int omap_mbox_msg_send(struct omap_mbox *mbox, mbox_msg_t msg)
156{ 85{
157 kfree(rq->special);
158 __blk_put_request(rq->q, rq);
159}
160 86
161int omap_mbox_msg_send(struct omap_mbox *mbox, mbox_msg_t msg, void* arg)
162{
163 struct omap_msg_tx_data *tx_data;
164 struct request *rq; 87 struct request *rq;
165 struct request_queue *q = mbox->txq->queue; 88 struct request_queue *q = mbox->txq->queue;
166 89
167 tx_data = kmalloc(sizeof(*tx_data), GFP_ATOMIC);
168 if (unlikely(!tx_data))
169 return -ENOMEM;
170
171 rq = blk_get_request(q, WRITE, GFP_ATOMIC); 90 rq = blk_get_request(q, WRITE, GFP_ATOMIC);
172 if (unlikely(!rq)) { 91 if (unlikely(!rq))
173 kfree(tx_data);
174 return -ENOMEM; 92 return -ENOMEM;
175 }
176 93
177 tx_data->msg = msg; 94 blk_insert_request(q, rq, 0, (void *) msg);
178 tx_data->arg = arg; 95 tasklet_schedule(&mbox->txq->tasklet);
179 rq->end_io = omap_msg_tx_end_io;
180 blk_insert_request(q, rq, 0, tx_data);
181 96
182 schedule_work(&mbox->txq->work);
183 return 0; 97 return 0;
184} 98}
185EXPORT_SYMBOL(omap_mbox_msg_send); 99EXPORT_SYMBOL(omap_mbox_msg_send);
186 100
187static void mbox_tx_work(struct work_struct *work) 101static void mbox_tx_tasklet(unsigned long tx_data)
188{ 102{
189 int ret; 103 int ret;
190 struct request *rq; 104 struct request *rq;
191 struct omap_mbox_queue *mq = container_of(work, 105 struct omap_mbox *mbox = (struct omap_mbox *)tx_data;
192 struct omap_mbox_queue, work);
193 struct omap_mbox *mbox = mq->queue->queuedata;
194 struct request_queue *q = mbox->txq->queue; 106 struct request_queue *q = mbox->txq->queue;
195 107
196 while (1) { 108 while (1) {
197 struct omap_msg_tx_data *tx_data;
198 109
199 spin_lock(q->queue_lock);
200 rq = blk_fetch_request(q); 110 rq = blk_fetch_request(q);
201 spin_unlock(q->queue_lock);
202 111
203 if (!rq) 112 if (!rq)
204 break; 113 break;
205 114
206 tx_data = rq->special; 115 ret = __mbox_msg_send(mbox, (mbox_msg_t)rq->special);
207
208 ret = __mbox_msg_send(mbox, tx_data->msg, tx_data->arg);
209 if (ret) { 116 if (ret) {
210 enable_mbox_irq(mbox, IRQ_TX); 117 omap_mbox_enable_irq(mbox, IRQ_TX);
211 spin_lock(q->queue_lock);
212 blk_requeue_request(q, rq); 118 blk_requeue_request(q, rq);
213 spin_unlock(q->queue_lock);
214 return; 119 return;
215 } 120 }
216 121 blk_end_request_all(rq, 0);
217 spin_lock(q->queue_lock);
218 __blk_end_request_all(rq, 0);
219 spin_unlock(q->queue_lock);
220 } 122 }
221} 123}
222 124
@@ -233,11 +135,6 @@ static void mbox_rx_work(struct work_struct *work)
233 mbox_msg_t msg; 135 mbox_msg_t msg;
234 unsigned long flags; 136 unsigned long flags;
235 137
236 if (mbox->rxq->callback == NULL) {
237 sysfs_notify(&mbox->dev->kobj, NULL, "mbox");
238 return;
239 }
240
241 while (1) { 138 while (1) {
242 spin_lock_irqsave(q->queue_lock, flags); 139 spin_lock_irqsave(q->queue_lock, flags);
243 rq = blk_fetch_request(q); 140 rq = blk_fetch_request(q);
@@ -254,19 +151,19 @@ static void mbox_rx_work(struct work_struct *work)
254/* 151/*
255 * Mailbox interrupt handler 152 * Mailbox interrupt handler
256 */ 153 */
257static void mbox_txq_fn(struct request_queue * q) 154static void mbox_txq_fn(struct request_queue *q)
258{ 155{
259} 156}
260 157
261static void mbox_rxq_fn(struct request_queue * q) 158static void mbox_rxq_fn(struct request_queue *q)
262{ 159{
263} 160}
264 161
265static void __mbox_tx_interrupt(struct omap_mbox *mbox) 162static void __mbox_tx_interrupt(struct omap_mbox *mbox)
266{ 163{
267 disable_mbox_irq(mbox, IRQ_TX); 164 omap_mbox_disable_irq(mbox, IRQ_TX);
268 ack_mbox_irq(mbox, IRQ_TX); 165 ack_mbox_irq(mbox, IRQ_TX);
269 schedule_work(&mbox->txq->work); 166 tasklet_schedule(&mbox->txq->tasklet);
270} 167}
271 168
272static void __mbox_rx_interrupt(struct omap_mbox *mbox) 169static void __mbox_rx_interrupt(struct omap_mbox *mbox)
@@ -275,8 +172,6 @@ static void __mbox_rx_interrupt(struct omap_mbox *mbox)
275 mbox_msg_t msg; 172 mbox_msg_t msg;
276 struct request_queue *q = mbox->rxq->queue; 173 struct request_queue *q = mbox->rxq->queue;
277 174
278 disable_mbox_irq(mbox, IRQ_RX);
279
280 while (!mbox_fifo_empty(mbox)) { 175 while (!mbox_fifo_empty(mbox)) {
281 rq = blk_get_request(q, WRITE, GFP_ATOMIC); 176 rq = blk_get_request(q, WRITE, GFP_ATOMIC);
282 if (unlikely(!rq)) 177 if (unlikely(!rq))
@@ -284,11 +179,6 @@ static void __mbox_rx_interrupt(struct omap_mbox *mbox)
284 179
285 msg = mbox_fifo_read(mbox); 180 msg = mbox_fifo_read(mbox);
286 181
287 if (unlikely(mbox_seq_test(mbox, msg))) {
288 pr_info("mbox: Illegal seq bit!(%08x)\n", msg);
289 if (mbox->err_notify)
290 mbox->err_notify();
291 }
292 182
293 blk_insert_request(q, rq, 0, (void *)msg); 183 blk_insert_request(q, rq, 0, (void *)msg);
294 if (mbox->ops->type == OMAP_MBOX_TYPE1) 184 if (mbox->ops->type == OMAP_MBOX_TYPE1)
@@ -297,7 +187,6 @@ static void __mbox_rx_interrupt(struct omap_mbox *mbox)
297 187
298 /* no more messages in the fifo. clear IRQ source. */ 188 /* no more messages in the fifo. clear IRQ source. */
299 ack_mbox_irq(mbox, IRQ_RX); 189 ack_mbox_irq(mbox, IRQ_RX);
300 enable_mbox_irq(mbox, IRQ_RX);
301nomem: 190nomem:
302 schedule_work(&mbox->rxq->work); 191 schedule_work(&mbox->rxq->work);
303} 192}
@@ -315,76 +204,10 @@ static irqreturn_t mbox_interrupt(int irq, void *p)
315 return IRQ_HANDLED; 204 return IRQ_HANDLED;
316} 205}
317 206
318/*
319 * sysfs files
320 */
321static ssize_t
322omap_mbox_write(struct device *dev, struct device_attribute *attr,
323 const char * buf, size_t count)
324{
325 int ret;
326 mbox_msg_t *p = (mbox_msg_t *)buf;
327 struct omap_mbox *mbox = dev_get_drvdata(dev);
328
329 for (; count >= sizeof(mbox_msg_t); count -= sizeof(mbox_msg_t)) {
330 ret = omap_mbox_msg_send(mbox, be32_to_cpu(*p), NULL);
331 if (ret)
332 return -EAGAIN;
333 p++;
334 }
335
336 return (size_t)((char *)p - buf);
337}
338
339static ssize_t
340omap_mbox_read(struct device *dev, struct device_attribute *attr, char *buf)
341{
342 unsigned long flags;
343 struct request *rq;
344 mbox_msg_t *p = (mbox_msg_t *) buf;
345 struct omap_mbox *mbox = dev_get_drvdata(dev);
346 struct request_queue *q = mbox->rxq->queue;
347
348 while (1) {
349 spin_lock_irqsave(q->queue_lock, flags);
350 rq = blk_fetch_request(q);
351 spin_unlock_irqrestore(q->queue_lock, flags);
352
353 if (!rq)
354 break;
355
356 *p = (mbox_msg_t)rq->special;
357
358 blk_end_request_all(rq, 0);
359
360 if (unlikely(mbox_seq_test(mbox, *p))) {
361 pr_info("mbox: Illegal seq bit!(%08x) ignored\n", *p);
362 continue;
363 }
364 p++;
365 }
366
367 pr_debug("%02x %02x %02x %02x\n", buf[0], buf[1], buf[2], buf[3]);
368
369 return (size_t) ((char *)p - buf);
370}
371
372static DEVICE_ATTR(mbox, S_IRUGO | S_IWUSR, omap_mbox_read, omap_mbox_write);
373
374static ssize_t mbox_show(struct class *class, char *buf)
375{
376 return sprintf(buf, "mbox");
377}
378
379static CLASS_ATTR(mbox, S_IRUGO, mbox_show, NULL);
380
381static struct class omap_mbox_class = {
382 .name = "omap-mailbox",
383};
384
385static struct omap_mbox_queue *mbox_queue_alloc(struct omap_mbox *mbox, 207static struct omap_mbox_queue *mbox_queue_alloc(struct omap_mbox *mbox,
386 request_fn_proc * proc, 208 request_fn_proc *proc,
387 void (*work) (struct work_struct *)) 209 void (*work) (struct work_struct *),
210 void (*tasklet)(unsigned long))
388{ 211{
389 struct request_queue *q; 212 struct request_queue *q;
390 struct omap_mbox_queue *mq; 213 struct omap_mbox_queue *mq;
@@ -401,8 +224,11 @@ static struct omap_mbox_queue *mbox_queue_alloc(struct omap_mbox *mbox,
401 q->queuedata = mbox; 224 q->queuedata = mbox;
402 mq->queue = q; 225 mq->queue = q;
403 226
404 INIT_WORK(&mq->work, work); 227 if (work)
228 INIT_WORK(&mq->work, work);
405 229
230 if (tasklet)
231 tasklet_init(&mq->tasklet, tasklet, (unsigned long)mbox);
406 return mq; 232 return mq;
407error: 233error:
408 kfree(mq); 234 kfree(mq);
@@ -415,18 +241,25 @@ static void mbox_queue_free(struct omap_mbox_queue *q)
415 kfree(q); 241 kfree(q);
416} 242}
417 243
418static int omap_mbox_init(struct omap_mbox *mbox) 244static int omap_mbox_startup(struct omap_mbox *mbox)
419{ 245{
420 int ret; 246 int ret = 0;
421 struct omap_mbox_queue *mq; 247 struct omap_mbox_queue *mq;
422 248
423 if (likely(mbox->ops->startup)) { 249 if (likely(mbox->ops->startup)) {
424 ret = mbox->ops->startup(mbox); 250 write_lock(&mboxes_lock);
425 if (unlikely(ret)) 251 if (!mbox_configured)
252 ret = mbox->ops->startup(mbox);
253
254 if (unlikely(ret)) {
255 write_unlock(&mboxes_lock);
426 return ret; 256 return ret;
257 }
258 mbox_configured++;
259 write_unlock(&mboxes_lock);
427 } 260 }
428 261
429 ret = request_irq(mbox->irq, mbox_interrupt, IRQF_DISABLED, 262 ret = request_irq(mbox->irq, mbox_interrupt, IRQF_SHARED,
430 mbox->name, mbox); 263 mbox->name, mbox);
431 if (unlikely(ret)) { 264 if (unlikely(ret)) {
432 printk(KERN_ERR 265 printk(KERN_ERR
@@ -434,14 +267,14 @@ static int omap_mbox_init(struct omap_mbox *mbox)
434 goto fail_request_irq; 267 goto fail_request_irq;
435 } 268 }
436 269
437 mq = mbox_queue_alloc(mbox, mbox_txq_fn, mbox_tx_work); 270 mq = mbox_queue_alloc(mbox, mbox_txq_fn, NULL, mbox_tx_tasklet);
438 if (!mq) { 271 if (!mq) {
439 ret = -ENOMEM; 272 ret = -ENOMEM;
440 goto fail_alloc_txq; 273 goto fail_alloc_txq;
441 } 274 }
442 mbox->txq = mq; 275 mbox->txq = mq;
443 276
444 mq = mbox_queue_alloc(mbox, mbox_rxq_fn, mbox_rx_work); 277 mq = mbox_queue_alloc(mbox, mbox_rxq_fn, mbox_rx_work, NULL);
445 if (!mq) { 278 if (!mq) {
446 ret = -ENOMEM; 279 ret = -ENOMEM;
447 goto fail_alloc_rxq; 280 goto fail_alloc_rxq;
@@ -468,8 +301,14 @@ static void omap_mbox_fini(struct omap_mbox *mbox)
468 301
469 free_irq(mbox->irq, mbox); 302 free_irq(mbox->irq, mbox);
470 303
471 if (unlikely(mbox->ops->shutdown)) 304 if (unlikely(mbox->ops->shutdown)) {
472 mbox->ops->shutdown(mbox); 305 write_lock(&mboxes_lock);
306 if (mbox_configured > 0)
307 mbox_configured--;
308 if (!mbox_configured)
309 mbox->ops->shutdown(mbox);
310 write_unlock(&mboxes_lock);
311 }
473} 312}
474 313
475static struct omap_mbox **find_mboxes(const char *name) 314static struct omap_mbox **find_mboxes(const char *name)
@@ -498,7 +337,7 @@ struct omap_mbox *omap_mbox_get(const char *name)
498 337
499 read_unlock(&mboxes_lock); 338 read_unlock(&mboxes_lock);
500 339
501 ret = omap_mbox_init(mbox); 340 ret = omap_mbox_startup(mbox);
502 if (ret) 341 if (ret)
503 return ERR_PTR(-ENODEV); 342 return ERR_PTR(-ENODEV);
504 343
@@ -522,15 +361,6 @@ int omap_mbox_register(struct device *parent, struct omap_mbox *mbox)
522 if (mbox->next) 361 if (mbox->next)
523 return -EBUSY; 362 return -EBUSY;
524 363
525 mbox->dev = device_create(&omap_mbox_class,
526 parent, 0, mbox, "%s", mbox->name);
527 if (IS_ERR(mbox->dev))
528 return PTR_ERR(mbox->dev);
529
530 ret = device_create_file(mbox->dev, &dev_attr_mbox);
531 if (ret)
532 goto err_sysfs;
533
534 write_lock(&mboxes_lock); 364 write_lock(&mboxes_lock);
535 tmp = find_mboxes(mbox->name); 365 tmp = find_mboxes(mbox->name);
536 if (*tmp) { 366 if (*tmp) {
@@ -544,9 +374,6 @@ int omap_mbox_register(struct device *parent, struct omap_mbox *mbox)
544 return 0; 374 return 0;
545 375
546err_find: 376err_find:
547 device_remove_file(mbox->dev, &dev_attr_mbox);
548err_sysfs:
549 device_unregister(mbox->dev);
550 return ret; 377 return ret;
551} 378}
552EXPORT_SYMBOL(omap_mbox_register); 379EXPORT_SYMBOL(omap_mbox_register);
@@ -562,8 +389,6 @@ int omap_mbox_unregister(struct omap_mbox *mbox)
562 *tmp = mbox->next; 389 *tmp = mbox->next;
563 mbox->next = NULL; 390 mbox->next = NULL;
564 write_unlock(&mboxes_lock); 391 write_unlock(&mboxes_lock);
565 device_remove_file(mbox->dev, &dev_attr_mbox);
566 device_unregister(mbox->dev);
567 return 0; 392 return 0;
568 } 393 }
569 tmp = &(*tmp)->next; 394 tmp = &(*tmp)->next;
@@ -574,23 +399,16 @@ int omap_mbox_unregister(struct omap_mbox *mbox)
574} 399}
575EXPORT_SYMBOL(omap_mbox_unregister); 400EXPORT_SYMBOL(omap_mbox_unregister);
576 401
577static int __init omap_mbox_class_init(void) 402static int __init omap_mbox_init(void)
578{ 403{
579 int ret = class_register(&omap_mbox_class); 404 return 0;
580 if (!ret)
581 ret = class_create_file(&omap_mbox_class, &class_attr_mbox);
582
583 return ret;
584} 405}
406module_init(omap_mbox_init);
585 407
586static void __exit omap_mbox_class_exit(void) 408static void __exit omap_mbox_exit(void)
587{ 409{
588 class_remove_file(&omap_mbox_class, &class_attr_mbox);
589 class_unregister(&omap_mbox_class);
590} 410}
591 411module_exit(omap_mbox_exit);
592subsys_initcall(omap_mbox_class_init);
593module_exit(omap_mbox_class_exit);
594 412
595MODULE_LICENSE("GPL v2"); 413MODULE_LICENSE("GPL v2");
596MODULE_DESCRIPTION("omap mailbox: interrupt driven messaging"); 414MODULE_DESCRIPTION("omap mailbox: interrupt driven messaging");
diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c
index e664b912d7bb..2cc1cc328bac 100644
--- a/arch/arm/plat-omap/mcbsp.c
+++ b/arch/arm/plat-omap/mcbsp.c
@@ -24,8 +24,8 @@
24#include <linux/delay.h> 24#include <linux/delay.h>
25#include <linux/io.h> 25#include <linux/io.h>
26 26
27#include <mach/dma.h> 27#include <plat/dma.h>
28#include <mach/mcbsp.h> 28#include <plat/mcbsp.h>
29 29
30struct omap_mcbsp **mcbsp_ptr; 30struct omap_mcbsp **mcbsp_ptr;
31int omap_mcbsp_count; 31int omap_mcbsp_count;
@@ -298,9 +298,7 @@ int omap_mcbsp_get_dma_op_mode(unsigned int id)
298 } 298 }
299 mcbsp = id_to_mcbsp_ptr(id); 299 mcbsp = id_to_mcbsp_ptr(id);
300 300
301 spin_lock_irq(&mcbsp->lock);
302 dma_op_mode = mcbsp->dma_op_mode; 301 dma_op_mode = mcbsp->dma_op_mode;
303 spin_unlock_irq(&mcbsp->lock);
304 302
305 return dma_op_mode; 303 return dma_op_mode;
306} 304}
@@ -318,7 +316,6 @@ static inline void omap34xx_mcbsp_request(struct omap_mcbsp *mcbsp)
318 syscon = OMAP_MCBSP_READ(mcbsp->io_base, SYSCON); 316 syscon = OMAP_MCBSP_READ(mcbsp->io_base, SYSCON);
319 syscon &= ~(ENAWAKEUP | SIDLEMODE(0x03) | CLOCKACTIVITY(0x03)); 317 syscon &= ~(ENAWAKEUP | SIDLEMODE(0x03) | CLOCKACTIVITY(0x03));
320 318
321 spin_lock_irq(&mcbsp->lock);
322 if (mcbsp->dma_op_mode == MCBSP_DMA_MODE_THRESHOLD) { 319 if (mcbsp->dma_op_mode == MCBSP_DMA_MODE_THRESHOLD) {
323 syscon |= (ENAWAKEUP | SIDLEMODE(0x02) | 320 syscon |= (ENAWAKEUP | SIDLEMODE(0x02) |
324 CLOCKACTIVITY(0x02)); 321 CLOCKACTIVITY(0x02));
@@ -327,7 +324,6 @@ static inline void omap34xx_mcbsp_request(struct omap_mcbsp *mcbsp)
327 } else { 324 } else {
328 syscon |= SIDLEMODE(0x01); 325 syscon |= SIDLEMODE(0x01);
329 } 326 }
330 spin_unlock_irq(&mcbsp->lock);
331 327
332 OMAP_MCBSP_WRITE(mcbsp->io_base, SYSCON, syscon); 328 OMAP_MCBSP_WRITE(mcbsp->io_base, SYSCON, syscon);
333 } 329 }
@@ -1145,9 +1141,7 @@ static ssize_t dma_op_mode_show(struct device *dev,
1145 ssize_t len = 0; 1141 ssize_t len = 0;
1146 const char * const *s; 1142 const char * const *s;
1147 1143
1148 spin_lock_irq(&mcbsp->lock);
1149 dma_op_mode = mcbsp->dma_op_mode; 1144 dma_op_mode = mcbsp->dma_op_mode;
1150 spin_unlock_irq(&mcbsp->lock);
1151 1145
1152 for (s = &dma_op_modes[i]; i < ARRAY_SIZE(dma_op_modes); s++, i++) { 1146 for (s = &dma_op_modes[i]; i < ARRAY_SIZE(dma_op_modes); s++, i++) {
1153 if (dma_op_mode == i) 1147 if (dma_op_mode == i)
diff --git a/arch/arm/plat-omap/mux.c b/arch/arm/plat-omap/mux.c
index 8d329fb20740..05aebcad215b 100644
--- a/arch/arm/plat-omap/mux.c
+++ b/arch/arm/plat-omap/mux.c
@@ -28,7 +28,7 @@
28#include <linux/io.h> 28#include <linux/io.h>
29#include <asm/system.h> 29#include <asm/system.h>
30#include <linux/spinlock.h> 30#include <linux/spinlock.h>
31#include <mach/mux.h> 31#include <plat/mux.h>
32 32
33#ifdef CONFIG_OMAP_MUX 33#ifdef CONFIG_OMAP_MUX
34 34
diff --git a/arch/arm/plat-omap/omap-pm-noop.c b/arch/arm/plat-omap/omap-pm-noop.c
index e98f0a2a6c26..186bca82cfab 100644
--- a/arch/arm/plat-omap/omap-pm-noop.c
+++ b/arch/arm/plat-omap/omap-pm-noop.c
@@ -22,9 +22,9 @@
22#include <linux/device.h> 22#include <linux/device.h>
23 23
24/* Interface documentation is in mach/omap-pm.h */ 24/* Interface documentation is in mach/omap-pm.h */
25#include <mach/omap-pm.h> 25#include <plat/omap-pm.h>
26 26
27#include <mach/powerdomain.h> 27#include <plat/powerdomain.h>
28 28
29struct omap_opp *dsp_opps; 29struct omap_opp *dsp_opps;
30struct omap_opp *mpu_opps; 30struct omap_opp *mpu_opps;
diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c
index 2c409fc6dd21..bb16e624a557 100644
--- a/arch/arm/plat-omap/omap_device.c
+++ b/arch/arm/plat-omap/omap_device.c
@@ -82,8 +82,8 @@
82#include <linux/err.h> 82#include <linux/err.h>
83#include <linux/io.h> 83#include <linux/io.h>
84 84
85#include <mach/omap_device.h> 85#include <plat/omap_device.h>
86#include <mach/omap_hwmod.h> 86#include <plat/omap_hwmod.h>
87 87
88/* These parameters are passed to _omap_device_{de,}activate() */ 88/* These parameters are passed to _omap_device_{de,}activate() */
89#define USE_WAKEUP_LAT 0 89#define USE_WAKEUP_LAT 0
@@ -103,21 +103,6 @@
103/* Private functions */ 103/* Private functions */
104 104
105/** 105/**
106 * _read_32ksynct - read the OMAP 32K sync timer
107 *
108 * Returns the current value of the 32KiHz synchronization counter.
109 * XXX this should be generalized to simply read the system clocksource.
110 * XXX this should be moved to a separate synctimer32k.c file
111 */
112static u32 _read_32ksynct(void)
113{
114 if (!cpu_class_is_omap2())
115 BUG();
116
117 return __raw_readl(OMAP2_IO_ADDRESS(OMAP_32KSYNCT_BASE + 0x010));
118}
119
120/**
121 * _omap_device_activate - increase device readiness 106 * _omap_device_activate - increase device readiness
122 * @od: struct omap_device * 107 * @od: struct omap_device *
123 * @ignore_lat: increase to latency target (0) or full readiness (1)? 108 * @ignore_lat: increase to latency target (0) or full readiness (1)?
@@ -133,13 +118,13 @@ static u32 _read_32ksynct(void)
133 */ 118 */
134static int _omap_device_activate(struct omap_device *od, u8 ignore_lat) 119static int _omap_device_activate(struct omap_device *od, u8 ignore_lat)
135{ 120{
136 u32 a, b; 121 struct timespec a, b, c;
137 122
138 pr_debug("omap_device: %s: activating\n", od->pdev.name); 123 pr_debug("omap_device: %s: activating\n", od->pdev.name);
139 124
140 while (od->pm_lat_level > 0) { 125 while (od->pm_lat_level > 0) {
141 struct omap_device_pm_latency *odpl; 126 struct omap_device_pm_latency *odpl;
142 int act_lat = 0; 127 unsigned long long act_lat = 0;
143 128
144 od->pm_lat_level--; 129 od->pm_lat_level--;
145 130
@@ -149,20 +134,22 @@ static int _omap_device_activate(struct omap_device *od, u8 ignore_lat)
149 (od->dev_wakeup_lat <= od->_dev_wakeup_lat_limit)) 134 (od->dev_wakeup_lat <= od->_dev_wakeup_lat_limit))
150 break; 135 break;
151 136
152 a = _read_32ksynct(); 137 getnstimeofday(&a);
153 138
154 /* XXX check return code */ 139 /* XXX check return code */
155 odpl->activate_func(od); 140 odpl->activate_func(od);
156 141
157 b = _read_32ksynct(); 142 getnstimeofday(&b);
158 143
159 act_lat = (b - a) >> 15; /* 32KiHz cycles to microseconds */ 144 c = timespec_sub(b, a);
145 act_lat = timespec_to_ns(&c) * NSEC_PER_USEC;
160 146
161 pr_debug("omap_device: %s: pm_lat %d: activate: elapsed time " 147 pr_debug("omap_device: %s: pm_lat %d: activate: elapsed time "
162 "%d usec\n", od->pdev.name, od->pm_lat_level, act_lat); 148 "%llu usec\n", od->pdev.name, od->pm_lat_level,
149 act_lat);
163 150
164 WARN(act_lat > odpl->activate_lat, "omap_device: %s.%d: " 151 WARN(act_lat > odpl->activate_lat, "omap_device: %s.%d: "
165 "activate step %d took longer than expected (%d > %d)\n", 152 "activate step %d took longer than expected (%llu > %d)\n",
166 od->pdev.name, od->pdev.id, od->pm_lat_level, 153 od->pdev.name, od->pdev.id, od->pm_lat_level,
167 act_lat, odpl->activate_lat); 154 act_lat, odpl->activate_lat);
168 155
@@ -188,13 +175,13 @@ static int _omap_device_activate(struct omap_device *od, u8 ignore_lat)
188 */ 175 */
189static int _omap_device_deactivate(struct omap_device *od, u8 ignore_lat) 176static int _omap_device_deactivate(struct omap_device *od, u8 ignore_lat)
190{ 177{
191 u32 a, b; 178 struct timespec a, b, c;
192 179
193 pr_debug("omap_device: %s: deactivating\n", od->pdev.name); 180 pr_debug("omap_device: %s: deactivating\n", od->pdev.name);
194 181
195 while (od->pm_lat_level < od->pm_lats_cnt) { 182 while (od->pm_lat_level < od->pm_lats_cnt) {
196 struct omap_device_pm_latency *odpl; 183 struct omap_device_pm_latency *odpl;
197 int deact_lat = 0; 184 unsigned long long deact_lat = 0;
198 185
199 odpl = od->pm_lats + od->pm_lat_level; 186 odpl = od->pm_lats + od->pm_lat_level;
200 187
@@ -203,23 +190,24 @@ static int _omap_device_deactivate(struct omap_device *od, u8 ignore_lat)
203 od->_dev_wakeup_lat_limit)) 190 od->_dev_wakeup_lat_limit))
204 break; 191 break;
205 192
206 a = _read_32ksynct(); 193 getnstimeofday(&a);
207 194
208 /* XXX check return code */ 195 /* XXX check return code */
209 odpl->deactivate_func(od); 196 odpl->deactivate_func(od);
210 197
211 b = _read_32ksynct(); 198 getnstimeofday(&b);
212 199
213 deact_lat = (b - a) >> 15; /* 32KiHz cycles to microseconds */ 200 c = timespec_sub(b, a);
201 deact_lat = timespec_to_ns(&c) * NSEC_PER_USEC;
214 202
215 pr_debug("omap_device: %s: pm_lat %d: deactivate: elapsed time " 203 pr_debug("omap_device: %s: pm_lat %d: deactivate: elapsed time "
216 "%d usec\n", od->pdev.name, od->pm_lat_level, 204 "%llu usec\n", od->pdev.name, od->pm_lat_level,
217 deact_lat); 205 deact_lat);
218 206
219 WARN(deact_lat > odpl->deactivate_lat, "omap_device: %s.%d: " 207 WARN(deact_lat > odpl->deactivate_lat, "omap_device: %s.%d: "
220 "deactivate step %d took longer than expected (%d > %d)\n", 208 "deactivate step %d took longer than expected "
221 od->pdev.name, od->pdev.id, od->pm_lat_level, 209 "(%llu > %d)\n", od->pdev.name, od->pdev.id,
222 deact_lat, odpl->deactivate_lat); 210 od->pm_lat_level, deact_lat, odpl->deactivate_lat);
223 211
224 od->dev_wakeup_lat += odpl->activate_lat; 212 od->dev_wakeup_lat += odpl->activate_lat;
225 213
diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c
index 75d1f26e5b17..3e923668778d 100644
--- a/arch/arm/plat-omap/sram.c
+++ b/arch/arm/plat-omap/sram.c
@@ -25,11 +25,11 @@
25 25
26#include <asm/mach/map.h> 26#include <asm/mach/map.h>
27 27
28#include <mach/sram.h> 28#include <plat/sram.h>
29#include <mach/board.h> 29#include <plat/board.h>
30#include <mach/cpu.h> 30#include <plat/cpu.h>
31 31
32#include <mach/control.h> 32#include <plat/control.h>
33 33
34#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) 34#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
35# include "../mach-omap2/prm.h" 35# include "../mach-omap2/prm.h"
@@ -41,14 +41,14 @@
41#define OMAP1_SRAM_VA VMALLOC_END 41#define OMAP1_SRAM_VA VMALLOC_END
42#define OMAP2_SRAM_PA 0x40200000 42#define OMAP2_SRAM_PA 0x40200000
43#define OMAP2_SRAM_PUB_PA 0x4020f800 43#define OMAP2_SRAM_PUB_PA 0x4020f800
44#define OMAP2_SRAM_VA 0xe3000000 44#define OMAP2_SRAM_VA 0xfe400000
45#define OMAP2_SRAM_PUB_VA (OMAP2_SRAM_VA + 0x800) 45#define OMAP2_SRAM_PUB_VA (OMAP2_SRAM_VA + 0x800)
46#define OMAP3_SRAM_PA 0x40200000 46#define OMAP3_SRAM_PA 0x40200000
47#define OMAP3_SRAM_VA 0xe3000000 47#define OMAP3_SRAM_VA 0xfe400000
48#define OMAP3_SRAM_PUB_PA 0x40208000 48#define OMAP3_SRAM_PUB_PA 0x40208000
49#define OMAP3_SRAM_PUB_VA (OMAP3_SRAM_VA + 0x8000) 49#define OMAP3_SRAM_PUB_VA (OMAP3_SRAM_VA + 0x8000)
50#define OMAP4_SRAM_PA 0x40200000 /*0x402f0000*/ 50#define OMAP4_SRAM_PA 0x40200000 /*0x402f0000*/
51#define OMAP4_SRAM_VA 0xd7000000 /*0xd70f0000*/ 51#define OMAP4_SRAM_VA 0xfe400000 /*0xfe4f0000*/
52 52
53#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) 53#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX)
54#define SRAM_BOOTLOADER_SZ 0x00 54#define SRAM_BOOTLOADER_SZ 0x00
@@ -56,16 +56,16 @@
56#define SRAM_BOOTLOADER_SZ 0x80 56#define SRAM_BOOTLOADER_SZ 0x80
57#endif 57#endif
58 58
59#define OMAP24XX_VA_REQINFOPERM0 OMAP2_IO_ADDRESS(0x68005048) 59#define OMAP24XX_VA_REQINFOPERM0 OMAP2_L3_IO_ADDRESS(0x68005048)
60#define OMAP24XX_VA_READPERM0 OMAP2_IO_ADDRESS(0x68005050) 60#define OMAP24XX_VA_READPERM0 OMAP2_L3_IO_ADDRESS(0x68005050)
61#define OMAP24XX_VA_WRITEPERM0 OMAP2_IO_ADDRESS(0x68005058) 61#define OMAP24XX_VA_WRITEPERM0 OMAP2_L3_IO_ADDRESS(0x68005058)
62 62
63#define OMAP34XX_VA_REQINFOPERM0 OMAP2_IO_ADDRESS(0x68012848) 63#define OMAP34XX_VA_REQINFOPERM0 OMAP2_L3_IO_ADDRESS(0x68012848)
64#define OMAP34XX_VA_READPERM0 OMAP2_IO_ADDRESS(0x68012850) 64#define OMAP34XX_VA_READPERM0 OMAP2_L3_IO_ADDRESS(0x68012850)
65#define OMAP34XX_VA_WRITEPERM0 OMAP2_IO_ADDRESS(0x68012858) 65#define OMAP34XX_VA_WRITEPERM0 OMAP2_L3_IO_ADDRESS(0x68012858)
66#define OMAP34XX_VA_ADDR_MATCH2 OMAP2_IO_ADDRESS(0x68012880) 66#define OMAP34XX_VA_ADDR_MATCH2 OMAP2_L3_IO_ADDRESS(0x68012880)
67#define OMAP34XX_VA_SMS_RG_ATT0 OMAP2_IO_ADDRESS(0x6C000048) 67#define OMAP34XX_VA_SMS_RG_ATT0 OMAP2_L3_IO_ADDRESS(0x6C000048)
68#define OMAP34XX_VA_CONTROL_STAT OMAP2_IO_ADDRESS(0x480022F0) 68#define OMAP34XX_VA_CONTROL_STAT OMAP2_L4_IO_ADDRESS(0x480022F0)
69 69
70#define GP_DEVICE 0x300 70#define GP_DEVICE 0x300
71 71
@@ -396,22 +396,24 @@ u32 omap3_configure_core_dpll(u32 m2, u32 unlock_dll, u32 f, u32 inc,
396 sdrc_actim_ctrl_b_1, sdrc_mr_1); 396 sdrc_actim_ctrl_b_1, sdrc_mr_1);
397} 397}
398 398
399/* REVISIT: Should this be same as omap34xx_sram_init() after off-idle? */ 399#ifdef CONFIG_PM
400void restore_sram_functions(void) 400void omap3_sram_restore_context(void)
401{ 401{
402 omap_sram_ceil = omap_sram_base + omap_sram_size; 402 omap_sram_ceil = omap_sram_base + omap_sram_size;
403 403
404 _omap3_sram_configure_core_dpll = 404 _omap3_sram_configure_core_dpll =
405 omap_sram_push(omap3_sram_configure_core_dpll, 405 omap_sram_push(omap3_sram_configure_core_dpll,
406 omap3_sram_configure_core_dpll_sz); 406 omap3_sram_configure_core_dpll_sz);
407 omap_push_sram_idle();
407} 408}
409#endif /* CONFIG_PM */
408 410
409int __init omap34xx_sram_init(void) 411int __init omap34xx_sram_init(void)
410{ 412{
411 _omap3_sram_configure_core_dpll = 413 _omap3_sram_configure_core_dpll =
412 omap_sram_push(omap3_sram_configure_core_dpll, 414 omap_sram_push(omap3_sram_configure_core_dpll,
413 omap3_sram_configure_core_dpll_sz); 415 omap3_sram_configure_core_dpll_sz);
414 416 omap_push_sram_idle();
415 return 0; 417 return 0;
416} 418}
417#else 419#else
diff --git a/arch/arm/plat-omap/usb.c b/arch/arm/plat-omap/usb.c
index 509f2ed99e21..51033a4503c3 100644
--- a/arch/arm/plat-omap/usb.c
+++ b/arch/arm/plat-omap/usb.c
@@ -33,10 +33,10 @@
33#include <asm/system.h> 33#include <asm/system.h>
34#include <mach/hardware.h> 34#include <mach/hardware.h>
35 35
36#include <mach/control.h> 36#include <plat/control.h>
37#include <mach/mux.h> 37#include <plat/mux.h>
38#include <mach/usb.h> 38#include <plat/usb.h>
39#include <mach/board.h> 39#include <plat/board.h>
40 40
41#ifdef CONFIG_ARCH_OMAP1 41#ifdef CONFIG_ARCH_OMAP1
42 42
@@ -159,11 +159,14 @@ static u32 __init omap_usb0_init(unsigned nwires, unsigned is_device)
159 * - OTG support on this port not yet written 159 * - OTG support on this port not yet written
160 */ 160 */
161 161
162 l = omap_readl(USB_TRANSCEIVER_CTRL); 162 /* Don't do this for omap7xx -- it causes USB to not work correctly */
163 l &= ~(7 << 4); 163 if (!cpu_is_omap7xx()) {
164 if (!is_device) 164 l = omap_readl(USB_TRANSCEIVER_CTRL);
165 l |= (3 << 1); 165 l &= ~(7 << 4);
166 omap_writel(l, USB_TRANSCEIVER_CTRL); 166 if (!is_device)
167 l |= (3 << 1);
168 omap_writel(l, USB_TRANSCEIVER_CTRL);
169 }
167 170
168 return 3 << 16; 171 return 3 << 16;
169 } 172 }
@@ -603,7 +606,12 @@ omap_otg_init(struct omap_usb_config *config)
603 if (config->otg || config->register_dev) { 606 if (config->otg || config->register_dev) {
604 syscon &= ~DEV_IDLE_EN; 607 syscon &= ~DEV_IDLE_EN;
605 udc_device.dev.platform_data = config; 608 udc_device.dev.platform_data = config;
606 /* FIXME patch IRQ numbers for omap730 */ 609 /* IRQ numbers for omap7xx */
610 if(cpu_is_omap7xx()) {
611 udc_resources[1].start = INT_7XX_USB_GENI;
612 udc_resources[2].start = INT_7XX_USB_NON_ISO;
613 udc_resources[3].start = INT_7XX_USB_ISO;
614 }
607 status = platform_device_register(&udc_device); 615 status = platform_device_register(&udc_device);
608 if (status) 616 if (status)
609 pr_debug("can't register UDC device, %d\n", status); 617 pr_debug("can't register UDC device, %d\n", status);
@@ -614,8 +622,8 @@ omap_otg_init(struct omap_usb_config *config)
614 if (config->otg || config->register_host) { 622 if (config->otg || config->register_host) {
615 syscon &= ~HST_IDLE_EN; 623 syscon &= ~HST_IDLE_EN;
616 ohci_device.dev.platform_data = config; 624 ohci_device.dev.platform_data = config;
617 if (cpu_is_omap730()) 625 if (cpu_is_omap7xx())
618 ohci_resources[1].start = INT_730_USB_HHC_1; 626 ohci_resources[1].start = INT_7XX_USB_HHC_1;
619 status = platform_device_register(&ohci_device); 627 status = platform_device_register(&ohci_device);
620 if (status) 628 if (status)
621 pr_debug("can't register OHCI device, %d\n", status); 629 pr_debug("can't register OHCI device, %d\n", status);
@@ -626,8 +634,8 @@ omap_otg_init(struct omap_usb_config *config)
626 if (config->otg) { 634 if (config->otg) {
627 syscon &= ~OTG_IDLE_EN; 635 syscon &= ~OTG_IDLE_EN;
628 otg_device.dev.platform_data = config; 636 otg_device.dev.platform_data = config;
629 if (cpu_is_omap730()) 637 if (cpu_is_omap7xx())
630 otg_resources[1].start = INT_730_USB_OTG; 638 otg_resources[1].start = INT_7XX_USB_OTG;
631 status = platform_device_register(&otg_device); 639 status = platform_device_register(&otg_device);
632 if (status) 640 if (status)
633 pr_debug("can't register OTG device, %d\n", status); 641 pr_debug("can't register OTG device, %d\n", status);
@@ -731,7 +739,7 @@ static inline void omap_1510_usb_init(struct omap_usb_config *config) {}
731 739
732void __init omap_usb_init(struct omap_usb_config *pdata) 740void __init omap_usb_init(struct omap_usb_config *pdata)
733{ 741{
734 if (cpu_is_omap730() || cpu_is_omap16xx() || cpu_is_omap24xx()) 742 if (cpu_is_omap7xx() || cpu_is_omap16xx() || cpu_is_omap24xx())
735 omap_otg_init(pdata); 743 omap_otg_init(pdata);
736 else if (cpu_is_omap15xx()) 744 else if (cpu_is_omap15xx())
737 omap_1510_usb_init(pdata); 745 omap_1510_usb_init(pdata);
diff --git a/arch/arm/mach-pxa/include/mach/pxa3xx_nand.h b/arch/arm/plat-pxa/include/plat/pxa3xx_nand.h
index 3478eae32d8a..3478eae32d8a 100644
--- a/arch/arm/mach-pxa/include/mach/pxa3xx_nand.h
+++ b/arch/arm/plat-pxa/include/plat/pxa3xx_nand.h
diff --git a/arch/arm/plat-s3c/Kconfig b/arch/arm/plat-s3c/Kconfig
index 8931c5f0e46b..e139a72c2149 100644
--- a/arch/arm/plat-s3c/Kconfig
+++ b/arch/arm/plat-s3c/Kconfig
@@ -159,6 +159,12 @@ config S3C_GPIO_CFG_S3C64XX
159 Internal configuration to enable S3C64XX style GPIO configuration 159 Internal configuration to enable S3C64XX style GPIO configuration
160 functions. 160 functions.
161 161
162config S5P_GPIO_CFG_S5PC1XX
163 bool
164 help
165 Internal configuration to enable S5PC1XX style GPIO configuration
166 functions.
167
162# DMA 168# DMA
163 169
164config S3C_DMA 170config S3C_DMA
@@ -178,6 +184,11 @@ config S3C_DEV_HSMMC1
178 help 184 help
179 Compile in platform device definitions for HSMMC channel 1 185 Compile in platform device definitions for HSMMC channel 1
180 186
187config S3C_DEV_HSMMC2
188 bool
189 help
190 Compile in platform device definitions for HSMMC channel 2
191
181config S3C_DEV_I2C1 192config S3C_DEV_I2C1
182 bool 193 bool
183 help 194 help
diff --git a/arch/arm/plat-s3c/Makefile b/arch/arm/plat-s3c/Makefile
index 3c09109e9e84..50444da98425 100644
--- a/arch/arm/plat-s3c/Makefile
+++ b/arch/arm/plat-s3c/Makefile
@@ -36,6 +36,7 @@ obj-$(CONFIG_HAVE_PWM) += pwm.o
36 36
37obj-$(CONFIG_S3C_DEV_HSMMC) += dev-hsmmc.o 37obj-$(CONFIG_S3C_DEV_HSMMC) += dev-hsmmc.o
38obj-$(CONFIG_S3C_DEV_HSMMC1) += dev-hsmmc1.o 38obj-$(CONFIG_S3C_DEV_HSMMC1) += dev-hsmmc1.o
39obj-$(CONFIG_S3C_DEV_HSMMC2) += dev-hsmmc2.o
39obj-y += dev-i2c0.o 40obj-y += dev-i2c0.o
40obj-$(CONFIG_S3C_DEV_I2C1) += dev-i2c1.o 41obj-$(CONFIG_S3C_DEV_I2C1) += dev-i2c1.o
41obj-$(CONFIG_S3C_DEV_FB) += dev-fb.o 42obj-$(CONFIG_S3C_DEV_FB) += dev-fb.o
diff --git a/arch/arm/plat-s3c/clock.c b/arch/arm/plat-s3c/clock.c
index 4d01ef1a25dd..619cfa82dcab 100644
--- a/arch/arm/plat-s3c/clock.c
+++ b/arch/arm/plat-s3c/clock.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/plat-s3c24xx/clock.c 1/* linux/arch/arm/plat-s3c24xx/clock.c
2 * 2 *
3 * Copyright (c) 2004-2005 Simtec Electronics 3 * Copyright 2004-2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * S3C24XX Core clock control support 6 * S3C24XX Core clock control support
@@ -337,7 +337,7 @@ int s3c24xx_register_clocks(struct clk **clks, int nr_clks)
337 337
338int __init s3c24xx_register_baseclocks(unsigned long xtal) 338int __init s3c24xx_register_baseclocks(unsigned long xtal)
339{ 339{
340 printk(KERN_INFO "S3C24XX Clocks, (c) 2004 Simtec Electronics\n"); 340 printk(KERN_INFO "S3C24XX Clocks, Copyright 2004 Simtec Electronics\n");
341 341
342 clk_xtal.rate = xtal; 342 clk_xtal.rate = xtal;
343 343
diff --git a/arch/arm/plat-s3c/dev-hsmmc2.c b/arch/arm/plat-s3c/dev-hsmmc2.c
new file mode 100644
index 000000000000..824580bc0e06
--- /dev/null
+++ b/arch/arm/plat-s3c/dev-hsmmc2.c
@@ -0,0 +1,69 @@
1/* linux/arch/arm/plat-s3c/dev-hsmmc2.c
2 *
3 * Copyright (c) 2009 Samsung Electronics
4 * Copyright (c) 2009 Maurus Cuelenaere
5 *
6 * Based on arch/arm/plat-s3c/dev-hsmmc1.c
7 * original file Copyright (c) 2008 Simtec Electronics
8 *
9 * S3C series device definition for hsmmc device 2
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/kernel.h>
17#include <linux/platform_device.h>
18#include <linux/mmc/host.h>
19
20#include <mach/map.h>
21#include <plat/sdhci.h>
22#include <plat/devs.h>
23
24#define S3C_SZ_HSMMC (0x1000)
25
26static struct resource s3c_hsmmc2_resource[] = {
27 [0] = {
28 .start = S3C_PA_HSMMC2,
29 .end = S3C_PA_HSMMC2 + S3C_SZ_HSMMC - 1,
30 .flags = IORESOURCE_MEM,
31 },
32 [1] = {
33 .start = IRQ_HSMMC2,
34 .end = IRQ_HSMMC2,
35 .flags = IORESOURCE_IRQ,
36 }
37};
38
39static u64 s3c_device_hsmmc2_dmamask = 0xffffffffUL;
40
41struct s3c_sdhci_platdata s3c_hsmmc2_def_platdata = {
42 .max_width = 4,
43 .host_caps = (MMC_CAP_4_BIT_DATA |
44 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
45};
46
47struct platform_device s3c_device_hsmmc2 = {
48 .name = "s3c-sdhci",
49 .id = 2,
50 .num_resources = ARRAY_SIZE(s3c_hsmmc2_resource),
51 .resource = s3c_hsmmc2_resource,
52 .dev = {
53 .dma_mask = &s3c_device_hsmmc2_dmamask,
54 .coherent_dma_mask = 0xffffffffUL,
55 .platform_data = &s3c_hsmmc2_def_platdata,
56 },
57};
58
59void s3c_sdhci2_set_platdata(struct s3c_sdhci_platdata *pd)
60{
61 struct s3c_sdhci_platdata *set = &s3c_hsmmc2_def_platdata;
62
63 set->max_width = pd->max_width;
64
65 if (pd->cfg_gpio)
66 set->cfg_gpio = pd->cfg_gpio;
67 if (pd->cfg_card)
68 set->cfg_card = pd->cfg_card;
69}
diff --git a/arch/arm/plat-s3c/dev-i2c0.c b/arch/arm/plat-s3c/dev-i2c0.c
index 428372868fbb..4c761529b949 100644
--- a/arch/arm/plat-s3c/dev-i2c0.c
+++ b/arch/arm/plat-s3c/dev-i2c0.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/plat-s3c/dev-i2c0.c 1/* linux/arch/arm/plat-s3c/dev-i2c0.c
2 * 2 *
3 * Copyright 2008,2009 Simtec Electronics 3 * Copyright 2008-2009 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/ 5 * http://armlinux.simtec.co.uk/
6 * 6 *
diff --git a/arch/arm/plat-s3c/dev-i2c1.c b/arch/arm/plat-s3c/dev-i2c1.c
index 8349c462788c..d44f79110506 100644
--- a/arch/arm/plat-s3c/dev-i2c1.c
+++ b/arch/arm/plat-s3c/dev-i2c1.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/plat-s3c/dev-i2c1.c 1/* linux/arch/arm/plat-s3c/dev-i2c1.c
2 * 2 *
3 * Copyright 2008,2009 Simtec Electronics 3 * Copyright 2008-2009 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/ 5 * http://armlinux.simtec.co.uk/
6 * 6 *
diff --git a/arch/arm/plat-s3c/dev-nand.c b/arch/arm/plat-s3c/dev-nand.c
index 4e5323732434..e771e77dcd54 100644
--- a/arch/arm/plat-s3c/dev-nand.c
+++ b/arch/arm/plat-s3c/dev-nand.c
@@ -9,8 +9,12 @@
9#include <linux/kernel.h> 9#include <linux/kernel.h>
10#include <linux/platform_device.h> 10#include <linux/platform_device.h>
11 11
12#include <linux/mtd/mtd.h>
13#include <linux/mtd/partitions.h>
14
12#include <mach/map.h> 15#include <mach/map.h>
13#include <plat/devs.h> 16#include <plat/devs.h>
17#include <plat/nand.h>
14 18
15static struct resource s3c_nand_resource[] = { 19static struct resource s3c_nand_resource[] = {
16 [0] = { 20 [0] = {
@@ -28,3 +32,96 @@ struct platform_device s3c_device_nand = {
28}; 32};
29 33
30EXPORT_SYMBOL(s3c_device_nand); 34EXPORT_SYMBOL(s3c_device_nand);
35
36/**
37 * s3c_nand_copy_set() - copy nand set data
38 * @set: The new structure, directly copied from the old.
39 *
40 * Copy all the fields from the NAND set field from what is probably __initdata
41 * to new kernel memory. The code returns 0 if the copy happened correctly or
42 * an error code for the calling function to display.
43 *
44 * Note, we currently do not try and look to see if we've already copied the
45 * data in a previous set.
46 */
47static int __init s3c_nand_copy_set(struct s3c2410_nand_set *set)
48{
49 void *ptr;
50 int size;
51
52 size = sizeof(struct mtd_partition) * set->nr_partitions;
53 if (size) {
54 ptr = kmemdup(set->partitions, size, GFP_KERNEL);
55 set->partitions = ptr;
56
57 if (!ptr)
58 return -ENOMEM;
59 }
60
61 size = sizeof(int) * set->nr_chips;
62 if (size) {
63 ptr = kmemdup(set->nr_map, size, GFP_KERNEL);
64 set->nr_map = ptr;
65
66 if (!ptr)
67 return -ENOMEM;
68 }
69
70 if (set->ecc_layout) {
71 ptr = kmemdup(set->ecc_layout,
72 sizeof(struct nand_ecclayout), GFP_KERNEL);
73 set->ecc_layout = ptr;
74
75 if (!ptr)
76 return -ENOMEM;
77 }
78
79 return 0;
80}
81
82void __init s3c_nand_set_platdata(struct s3c2410_platform_nand *nand)
83{
84 struct s3c2410_platform_nand *npd;
85 int size;
86 int ret;
87
88 /* note, if we get a failure in allocation, we simply drop out of the
89 * function. If there is so little memory available at initialisation
90 * time then there is little chance the system is going to run.
91 */
92
93 npd = kmemdup(nand, sizeof(struct s3c2410_platform_nand), GFP_KERNEL);
94 if (!npd) {
95 printk(KERN_ERR "%s: failed copying platform data\n", __func__);
96 return;
97 }
98
99 /* now see if we need to copy any of the nand set data */
100
101 size = sizeof(struct s3c2410_nand_set) * npd->nr_sets;
102 if (size) {
103 struct s3c2410_nand_set *from = npd->sets;
104 struct s3c2410_nand_set *to;
105 int i;
106
107 to = kmemdup(from, size, GFP_KERNEL);
108 npd->sets = to; /* set, even if we failed */
109
110 if (!to) {
111 printk(KERN_ERR "%s: no memory for sets\n", __func__);
112 return;
113 }
114
115 for (i = 0; i < npd->nr_sets; i++) {
116 ret = s3c_nand_copy_set(to);
117 if (!ret) {
118 printk(KERN_ERR "%s: failed to copy set %d\n",
119 __func__, i);
120 return;
121 }
122 to++;
123 }
124 }
125}
126
127EXPORT_SYMBOL_GPL(s3c_nand_set_platdata);
diff --git a/arch/arm/plat-s3c/dma.c b/arch/arm/plat-s3c/dma.c
index c9db75c06af5..a995850cd9d5 100644
--- a/arch/arm/plat-s3c/dma.c
+++ b/arch/arm/plat-s3c/dma.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/plat-s3c/dma.c 1/* linux/arch/arm/plat-s3c/dma.c
2 * 2 *
3 * Copyright (c) 2003-2005,2006,2009 Simtec Electronics 3 * Copyright (c) 2003-2009 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/ 5 * http://armlinux.simtec.co.uk/
6 * 6 *
diff --git a/arch/arm/plat-s3c/include/plat/audio-simtec.h b/arch/arm/plat-s3c/include/plat/audio-simtec.h
index 0f440b9168db..53a93656d5db 100644
--- a/arch/arm/plat-s3c/include/plat/audio-simtec.h
+++ b/arch/arm/plat-s3c/include/plat/audio-simtec.h
@@ -33,5 +33,5 @@ struct s3c24xx_audio_simtec_pdata {
33 void (*startup)(void); 33 void (*startup)(void);
34}; 34};
35 35
36extern int simtec_audio_add(const char *codec_name, 36extern int simtec_audio_add(const char *codec_name, bool has_lr_routing,
37 struct s3c24xx_audio_simtec_pdata *pdata); 37 struct s3c24xx_audio_simtec_pdata *pdata);
diff --git a/arch/arm/plat-s3c/include/plat/audio.h b/arch/arm/plat-s3c/include/plat/audio.h
index de0e8da48bc3..f22d23bb6271 100644
--- a/arch/arm/plat-s3c/include/plat/audio.h
+++ b/arch/arm/plat-s3c/include/plat/audio.h
@@ -1,45 +1,17 @@
1/* arch/arm/mach-s3c2410/include/mach/audio.h 1/* arch/arm/plat-s3c/include/plat/audio.h
2 * 2 *
3 * Copyright (c) 2004-2005 Simtec Electronics 3 * Copyright (c) 2009 Samsung Electronics Co. Ltd
4 * http://www.simtec.co.uk/products/SWLINUX/ 4 * Author: Jaswinder Singh <jassi.brar@samsung.com>
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * S3C24XX - Audio platfrom_device info
8 * 5 *
9 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as 7 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
12*/ 9 */
13
14#ifndef __ASM_ARCH_AUDIO_H
15#define __ASM_ARCH_AUDIO_H __FILE__
16
17/* struct s3c24xx_iis_ops
18 *
19 * called from the s3c24xx audio core to deal with the architecture
20 * or the codec's setup and control.
21 *
22 * the pointer to itself is passed through in case the caller wants to
23 * embed this in an larger structure for easy reference to it's context.
24*/
25 10
26struct s3c24xx_iis_ops { 11/**
27 struct module *owner; 12 * struct s3c_audio_pdata - common platform data for audio device drivers
28 13 * @cfg_gpio: Callback function to setup mux'ed pins in I2S/PCM/AC97 mode
29 int (*startup)(struct s3c24xx_iis_ops *me); 14 */
30 void (*shutdown)(struct s3c24xx_iis_ops *me); 15struct s3c_audio_pdata {
31 int (*suspend)(struct s3c24xx_iis_ops *me); 16 int (*cfg_gpio)(struct platform_device *);
32 int (*resume)(struct s3c24xx_iis_ops *me);
33
34 int (*open)(struct s3c24xx_iis_ops *me, struct snd_pcm_substream *strm);
35 int (*close)(struct s3c24xx_iis_ops *me, struct snd_pcm_substream *strm);
36 int (*prepare)(struct s3c24xx_iis_ops *me, struct snd_pcm_substream *strm, struct snd_pcm_runtime *rt);
37}; 17};
38
39struct s3c24xx_platdata_iis {
40 const char *codec_clk;
41 struct s3c24xx_iis_ops *ops;
42 int (*match_dev)(struct device *dev);
43};
44
45#endif /* __ASM_ARCH_AUDIO_H */
diff --git a/arch/arm/plat-s3c/include/plat/cpu-freq.h b/arch/arm/plat-s3c/include/plat/cpu-freq.h
index 7b982b7f28cd..94eb06a2ea5c 100644
--- a/arch/arm/plat-s3c/include/plat/cpu-freq.h
+++ b/arch/arm/plat-s3c/include/plat/cpu-freq.h
@@ -1,6 +1,6 @@
1/* arch/arm/plat-s3c/include/plat/cpu-freq.h 1/* arch/arm/plat-s3c/include/plat/cpu-freq.h
2 * 2 *
3 * Copyright (c) 2006,2007 Simtec Electronics 3 * Copyright (c) 2006-2007 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk> 5 * Ben Dooks <ben@simtec.co.uk>
6 * 6 *
diff --git a/arch/arm/plat-s3c/include/plat/cpu.h b/arch/arm/plat-s3c/include/plat/cpu.h
index fbc3d498e02e..d1131ca11e97 100644
--- a/arch/arm/plat-s3c/include/plat/cpu.h
+++ b/arch/arm/plat-s3c/include/plat/cpu.h
@@ -12,6 +12,9 @@
12 12
13/* todo - fix when rmk changes iodescs to use `void __iomem *` */ 13/* todo - fix when rmk changes iodescs to use `void __iomem *` */
14 14
15#ifndef __SAMSUNG_PLAT_CPU_H
16#define __SAMSUNG_PLAT_CPU_H
17
15#define IODESC_ENT(x) { (unsigned long)S3C24XX_VA_##x, __phys_to_pfn(S3C24XX_PA_##x), S3C24XX_SZ_##x, MT_DEVICE } 18#define IODESC_ENT(x) { (unsigned long)S3C24XX_VA_##x, __phys_to_pfn(S3C24XX_PA_##x), S3C24XX_SZ_##x, MT_DEVICE }
16 19
17#ifndef MHZ 20#ifndef MHZ
@@ -73,3 +76,6 @@ extern struct sysdev_class s3c2443_sysclass;
73extern struct sysdev_class s3c6410_sysclass; 76extern struct sysdev_class s3c6410_sysclass;
74extern struct sysdev_class s3c64xx_sysclass; 77extern struct sysdev_class s3c64xx_sysclass;
75 78
79extern void (*s5pc1xx_idle)(void);
80
81#endif
diff --git a/arch/arm/plat-s3c/include/plat/devs.h b/arch/arm/plat-s3c/include/plat/devs.h
index 0f540ea1e999..932cbbbb4273 100644
--- a/arch/arm/plat-s3c/include/plat/devs.h
+++ b/arch/arm/plat-s3c/include/plat/devs.h
@@ -28,6 +28,9 @@ extern struct platform_device s3c64xx_device_iis0;
28extern struct platform_device s3c64xx_device_iis1; 28extern struct platform_device s3c64xx_device_iis1;
29extern struct platform_device s3c64xx_device_iisv4; 29extern struct platform_device s3c64xx_device_iisv4;
30 30
31extern struct platform_device s3c64xx_device_pcm0;
32extern struct platform_device s3c64xx_device_pcm1;
33
31extern struct platform_device s3c_device_fb; 34extern struct platform_device s3c_device_fb;
32extern struct platform_device s3c_device_usb; 35extern struct platform_device s3c_device_usb;
33extern struct platform_device s3c_device_lcd; 36extern struct platform_device s3c_device_lcd;
diff --git a/arch/arm/plat-s3c/include/plat/dma.h b/arch/arm/plat-s3c/include/plat/dma.h
index 34dba98f08e1..e429d10be3ad 100644
--- a/arch/arm/plat-s3c/include/plat/dma.h
+++ b/arch/arm/plat-s3c/include/plat/dma.h
@@ -1,6 +1,6 @@
1/* arch/arm/plat-s3c/include/plat/dma.h 1/* arch/arm/plat-s3c/include/plat/dma.h
2 * 2 *
3 * Copyright (C) 2003,2004,2006 Simtec Electronics 3 * Copyright (C) 2003-2006 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * Samsung S3C DMA support 6 * Samsung S3C DMA support
diff --git a/arch/arm/plat-s3c/include/plat/fb.h b/arch/arm/plat-s3c/include/plat/fb.h
index 214ff561b0dd..f8db87930f8b 100644
--- a/arch/arm/plat-s3c/include/plat/fb.h
+++ b/arch/arm/plat-s3c/include/plat/fb.h
@@ -70,4 +70,11 @@ extern void s3c_fb_set_platdata(struct s3c_fb_platdata *pd);
70 */ 70 */
71extern void s3c64xx_fb_gpio_setup_24bpp(void); 71extern void s3c64xx_fb_gpio_setup_24bpp(void);
72 72
73/**
74 * s5pc100_fb_gpio_setup_24bpp() - S5PC100 setup function for 24bpp LCD
75 *
76 * Initialise the GPIO for an 24bpp LCD display on the RGB interface.
77 */
78extern void s5pc100_fb_gpio_setup_24bpp(void);
79
73#endif /* __PLAT_S3C_FB_H */ 80#endif /* __PLAT_S3C_FB_H */
diff --git a/arch/arm/plat-s3c/include/plat/iic.h b/arch/arm/plat-s3c/include/plat/iic.h
index 67450f115748..3083df00dee6 100644
--- a/arch/arm/plat-s3c/include/plat/iic.h
+++ b/arch/arm/plat-s3c/include/plat/iic.h
@@ -1,6 +1,6 @@
1/* arch/arm/plat-s3c/include/plat/iic.h 1/* arch/arm/plat-s3c/include/plat/iic.h
2 * 2 *
3 * Copyright 2004,2009 Simtec Electronics 3 * Copyright 2004-2009 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * S3C - I2C Controller platform_device info 6 * S3C - I2C Controller platform_device info
diff --git a/arch/arm/plat-s3c/include/plat/nand.h b/arch/arm/plat-s3c/include/plat/nand.h
index 18f958801e64..065985978413 100644
--- a/arch/arm/plat-s3c/include/plat/nand.h
+++ b/arch/arm/plat-s3c/include/plat/nand.h
@@ -55,3 +55,11 @@ struct s3c2410_platform_nand {
55 int chip); 55 int chip);
56}; 56};
57 57
58/**
59 * s3c_nand_set_platdata() - register NAND platform data.
60 * @nand: The NAND platform data to register with s3c_device_nand.
61 *
62 * This function copies the given NAND platform data, @nand and registers
63 * it with the s3c_device_nand. This allows @nand to be __initdata.
64*/
65extern void s3c_nand_set_platdata(struct s3c2410_platform_nand *nand);
diff --git a/arch/arm/plat-s3c/include/plat/regs-fb-v4.h b/arch/arm/plat-s3c/include/plat/regs-fb-v4.h
new file mode 100644
index 000000000000..a60ed0d06c94
--- /dev/null
+++ b/arch/arm/plat-s3c/include/plat/regs-fb-v4.h
@@ -0,0 +1,235 @@
1/* arch/arm/plat-s3c/include/plat/regs-fb-v4.h
2 *
3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics
5 * http://armlinux.simtec.co.uk/
6 * Ben Dooks <ben@simtec.co.uk>
7 *
8 * S3C64XX - new-style framebuffer register definitions
9 *
10 * This is the register set for the new style framebuffer interface
11 * found from the S3C2443 onwards and specifically the S3C64XX series
12 * S3C6400 and S3C6410.
13 *
14 * The file contains the cpu specific items which change between whichever
15 * architecture is selected. See <plat/regs-fb.h> for the core definitions
16 * that are the same.
17 *
18 * This program is free software; you can redistribute it and/or modify
19 * it under the terms of the GNU General Public License version 2 as
20 * published by the Free Software Foundation.
21*/
22
23/* include the core definitions here, in case we really do need to
24 * override them at a later date.
25*/
26
27#include <plat/regs-fb.h>
28
29#define S3C_FB_MAX_WIN (5) /* number of hardware windows available. */
30#define VIDCON1_FSTATUS_EVEN (1 << 15)
31
32/* Video timing controls */
33#define VIDTCON0 (0x10)
34#define VIDTCON1 (0x14)
35#define VIDTCON2 (0x18)
36
37/* Window position controls */
38
39#define WINCON(_win) (0x20 + ((_win) * 4))
40
41/* OSD1 and OSD4 do not have register D */
42
43#define VIDOSD_A(_win) (0x40 + ((_win) * 16))
44#define VIDOSD_B(_win) (0x44 + ((_win) * 16))
45#define VIDOSD_C(_win) (0x48 + ((_win) * 16))
46#define VIDOSD_D(_win) (0x4C + ((_win) * 16))
47
48
49#define VIDINTCON0 (0x130)
50
51#define WxKEYCONy(_win, _con) ((0x140 + ((_win) * 8)) + ((_con) * 4))
52
53/* WINCONx */
54
55#define WINCONx_CSCWIDTH_MASK (0x3 << 26)
56#define WINCONx_CSCWIDTH_SHIFT (26)
57#define WINCONx_CSCWIDTH_WIDE (0x0 << 26)
58#define WINCONx_CSCWIDTH_NARROW (0x3 << 26)
59
60#define WINCONx_ENLOCAL (1 << 22)
61#define WINCONx_BUFSTATUS (1 << 21)
62#define WINCONx_BUFSEL (1 << 20)
63#define WINCONx_BUFAUTOEN (1 << 19)
64#define WINCONx_YCbCr (1 << 13)
65
66#define WINCON1_LOCALSEL_CAMIF (1 << 23)
67
68#define WINCON2_LOCALSEL_CAMIF (1 << 23)
69#define WINCON2_BLD_PIX (1 << 6)
70
71#define WINCON2_ALPHA_SEL (1 << 1)
72#define WINCON2_BPPMODE_MASK (0xf << 2)
73#define WINCON2_BPPMODE_SHIFT (2)
74#define WINCON2_BPPMODE_1BPP (0x0 << 2)
75#define WINCON2_BPPMODE_2BPP (0x1 << 2)
76#define WINCON2_BPPMODE_4BPP (0x2 << 2)
77#define WINCON2_BPPMODE_8BPP_1232 (0x4 << 2)
78#define WINCON2_BPPMODE_16BPP_565 (0x5 << 2)
79#define WINCON2_BPPMODE_16BPP_A1555 (0x6 << 2)
80#define WINCON2_BPPMODE_16BPP_I1555 (0x7 << 2)
81#define WINCON2_BPPMODE_18BPP_666 (0x8 << 2)
82#define WINCON2_BPPMODE_18BPP_A1665 (0x9 << 2)
83#define WINCON2_BPPMODE_19BPP_A1666 (0xa << 2)
84#define WINCON2_BPPMODE_24BPP_888 (0xb << 2)
85#define WINCON2_BPPMODE_24BPP_A1887 (0xc << 2)
86#define WINCON2_BPPMODE_25BPP_A1888 (0xd << 2)
87#define WINCON2_BPPMODE_28BPP_A4888 (0xd << 2)
88
89#define WINCON3_BLD_PIX (1 << 6)
90
91#define WINCON3_ALPHA_SEL (1 << 1)
92#define WINCON3_BPPMODE_MASK (0xf << 2)
93#define WINCON3_BPPMODE_SHIFT (2)
94#define WINCON3_BPPMODE_1BPP (0x0 << 2)
95#define WINCON3_BPPMODE_2BPP (0x1 << 2)
96#define WINCON3_BPPMODE_4BPP (0x2 << 2)
97#define WINCON3_BPPMODE_16BPP_565 (0x5 << 2)
98#define WINCON3_BPPMODE_16BPP_A1555 (0x6 << 2)
99#define WINCON3_BPPMODE_16BPP_I1555 (0x7 << 2)
100#define WINCON3_BPPMODE_18BPP_666 (0x8 << 2)
101#define WINCON3_BPPMODE_18BPP_A1665 (0x9 << 2)
102#define WINCON3_BPPMODE_19BPP_A1666 (0xa << 2)
103#define WINCON3_BPPMODE_24BPP_888 (0xb << 2)
104#define WINCON3_BPPMODE_24BPP_A1887 (0xc << 2)
105#define WINCON3_BPPMODE_25BPP_A1888 (0xd << 2)
106#define WINCON3_BPPMODE_28BPP_A4888 (0xd << 2)
107
108#define VIDINTCON0_FIFIOSEL_WINDOW2 (0x10 << 5)
109#define VIDINTCON0_FIFIOSEL_WINDOW3 (0x20 << 5)
110#define VIDINTCON0_FIFIOSEL_WINDOW4 (0x40 << 5)
111
112#define DITHMODE (0x170)
113#define WINxMAP(_win) (0x180 + ((_win) * 4))
114
115
116#define DITHMODE_R_POS_MASK (0x3 << 5)
117#define DITHMODE_R_POS_SHIFT (5)
118#define DITHMODE_R_POS_8BIT (0x0 << 5)
119#define DITHMODE_R_POS_6BIT (0x1 << 5)
120#define DITHMODE_R_POS_5BIT (0x2 << 5)
121
122#define DITHMODE_G_POS_MASK (0x3 << 3)
123#define DITHMODE_G_POS_SHIFT (3)
124#define DITHMODE_G_POS_8BIT (0x0 << 3)
125#define DITHMODE_G_POS_6BIT (0x1 << 3)
126#define DITHMODE_G_POS_5BIT (0x2 << 3)
127
128#define DITHMODE_B_POS_MASK (0x3 << 1)
129#define DITHMODE_B_POS_SHIFT (1)
130#define DITHMODE_B_POS_8BIT (0x0 << 1)
131#define DITHMODE_B_POS_6BIT (0x1 << 1)
132#define DITHMODE_B_POS_5BIT (0x2 << 1)
133
134#define DITHMODE_DITH_EN (1 << 0)
135
136#define WPALCON (0x1A0)
137
138/* Palette control */
139/* Note for S5PC100: you can still use those macros on WPALCON (aka WPALCON_L),
140 * but make sure that WPALCON_H W2PAL-W4PAL entries are zeroed out */
141#define WPALCON_W4PAL_16BPP_A555 (1 << 8)
142#define WPALCON_W3PAL_16BPP_A555 (1 << 7)
143#define WPALCON_W2PAL_16BPP_A555 (1 << 6)
144
145
146/* system specific implementation code for palette sizes, and other
147 * information that changes depending on which architecture is being
148 * compiled.
149*/
150
151/* return true if window _win has OSD register D */
152#define s3c_fb_has_osd_d(_win) ((_win) != 4 && (_win) != 0)
153
154static inline unsigned int s3c_fb_win_pal_size(unsigned int win)
155{
156 if (win < 2)
157 return 256;
158 if (win < 4)
159 return 16;
160 if (win == 4)
161 return 4;
162
163 BUG(); /* shouldn't get here */
164}
165
166static inline int s3c_fb_validate_win_bpp(unsigned int win, unsigned int bpp)
167{
168 /* all windows can do 1/2 bpp */
169
170 if ((bpp == 25 || bpp == 19) && win == 0)
171 return 0; /* win 0 does not have 19 or 25bpp modes */
172
173 if (bpp == 4 && win == 4)
174 return 0;
175
176 if (bpp == 8 && (win >= 3))
177 return 0; /* win 3/4 cannot do 8bpp in any mode */
178
179 return 1;
180}
181
182static inline int s3c_fb_pal_is16(unsigned int window)
183{
184 return window > 1;
185}
186
187struct s3c_fb_palette {
188 struct fb_bitfield r;
189 struct fb_bitfield g;
190 struct fb_bitfield b;
191 struct fb_bitfield a;
192};
193
194static inline void s3c_fb_init_palette(unsigned int window,
195 struct s3c_fb_palette *palette)
196{
197 if (window < 2) {
198 /* Windows 0/1 are 8/8/8 or A/8/8/8 */
199 palette->r.offset = 16;
200 palette->r.length = 8;
201 palette->g.offset = 8;
202 palette->g.length = 8;
203 palette->b.offset = 0;
204 palette->b.length = 8;
205 } else {
206 /* currently we assume RGB 5/6/5 */
207 palette->r.offset = 11;
208 palette->r.length = 5;
209 palette->g.offset = 5;
210 palette->g.length = 6;
211 palette->b.offset = 0;
212 palette->b.length = 5;
213 }
214}
215
216/* Notes on per-window bpp settings
217 *
218 * Value Win0 Win1 Win2 Win3 Win 4
219 * 0000 1(P) 1(P) 1(P) 1(P) 1(P)
220 * 0001 2(P) 2(P) 2(P) 2(P) 2(P)
221 * 0010 4(P) 4(P) 4(P) 4(P) -none-
222 * 0011 8(P) 8(P) -none- -none- -none-
223 * 0100 -none- 8(A232) 8(A232) -none- -none-
224 * 0101 16(565) 16(565) 16(565) 16(565) 16(565)
225 * 0110 -none- 16(A555) 16(A555) 16(A555) 16(A555)
226 * 0111 16(I555) 16(I565) 16(I555) 16(I555) 16(I555)
227 * 1000 18(666) 18(666) 18(666) 18(666) 18(666)
228 * 1001 -none- 18(A665) 18(A665) 18(A665) 16(A665)
229 * 1010 -none- 19(A666) 19(A666) 19(A666) 19(A666)
230 * 1011 24(888) 24(888) 24(888) 24(888) 24(888)
231 * 1100 -none- 24(A887) 24(A887) 24(A887) 24(A887)
232 * 1101 -none- 25(A888) 25(A888) 25(A888) 25(A888)
233 * 1110 -none- -none- -none- -none- -none-
234 * 1111 -none- -none- -none- -none- -none-
235*/
diff --git a/arch/arm/plat-s3c/include/plat/regs-nand.h b/arch/arm/plat-s3c/include/plat/regs-nand.h
index b2caa4bca270..238efea7b9e4 100644
--- a/arch/arm/plat-s3c/include/plat/regs-nand.h
+++ b/arch/arm/plat-s3c/include/plat/regs-nand.h
@@ -1,7 +1,7 @@
1/* arch/arm/mach-s3c2410/include/mach/regs-nand.h 1/* arch/arm/mach-s3c2410/include/mach/regs-nand.h
2 * 2 *
3 * Copyright (c) 2004,2005 Simtec Electronics <linux@simtec.co.uk> 3 * Copyright (c) 2004-2005 Simtec Electronics <linux@simtec.co.uk>
4 * http://www.simtec.co.uk/products/SWLINUX/ 4 * http://www.simtec.co.uk/products/SWLINUX/
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 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 7 * it under the terms of the GNU General Public License version 2 as
diff --git a/arch/arm/plat-s3c/include/plat/regs-s3c2412-iis.h b/arch/arm/plat-s3c/include/plat/regs-s3c2412-iis.h
index 07659dad1748..abf2fbc2eb2f 100644
--- a/arch/arm/plat-s3c/include/plat/regs-s3c2412-iis.h
+++ b/arch/arm/plat-s3c/include/plat/regs-s3c2412-iis.h
@@ -67,6 +67,8 @@
67#define S3C2412_IISMOD_BCLK_MASK (3 << 1) 67#define S3C2412_IISMOD_BCLK_MASK (3 << 1)
68#define S3C2412_IISMOD_8BIT (1 << 0) 68#define S3C2412_IISMOD_8BIT (1 << 0)
69 69
70#define S3C64XX_IISMOD_CDCLKCON (1 << 12)
71
70#define S3C2412_IISPSR_PSREN (1 << 15) 72#define S3C2412_IISPSR_PSREN (1 << 15)
71 73
72#define S3C2412_IISFIC_TXFLUSH (1 << 15) 74#define S3C2412_IISFIC_TXFLUSH (1 << 15)
diff --git a/arch/arm/plat-s3c/include/plat/regs-serial.h b/arch/arm/plat-s3c/include/plat/regs-serial.h
index 66af75a5cdd1..85d8904e7f24 100644
--- a/arch/arm/plat-s3c/include/plat/regs-serial.h
+++ b/arch/arm/plat-s3c/include/plat/regs-serial.h
@@ -6,7 +6,7 @@
6 * 6 *
7 * Copyright (C) 2002 Shane Nay (shane@minirl.com) 7 * Copyright (C) 2002 Shane Nay (shane@minirl.com)
8 * 8 *
9 * Additional defines, (c) 2003 Simtec Electronics (linux@simtec.co.uk) 9 * Additional defines, Copyright 2003 Simtec Electronics (linux@simtec.co.uk)
10 * 10 *
11 * Adapted from: 11 * Adapted from:
12 * 12 *
diff --git a/arch/arm/plat-s3c/include/plat/sdhci.h b/arch/arm/plat-s3c/include/plat/sdhci.h
index f615308ccdfb..53198673b6bd 100644
--- a/arch/arm/plat-s3c/include/plat/sdhci.h
+++ b/arch/arm/plat-s3c/include/plat/sdhci.h
@@ -57,6 +57,7 @@ struct s3c_sdhci_platdata {
57 */ 57 */
58extern void s3c_sdhci0_set_platdata(struct s3c_sdhci_platdata *pd); 58extern void s3c_sdhci0_set_platdata(struct s3c_sdhci_platdata *pd);
59extern void s3c_sdhci1_set_platdata(struct s3c_sdhci_platdata *pd); 59extern void s3c_sdhci1_set_platdata(struct s3c_sdhci_platdata *pd);
60extern void s3c_sdhci2_set_platdata(struct s3c_sdhci_platdata *pd);
60 61
61/* Default platform data, exported so that per-cpu initialisation can 62/* Default platform data, exported so that per-cpu initialisation can
62 * set the correct one when there are more than one cpu type selected. 63 * set the correct one when there are more than one cpu type selected.
@@ -64,11 +65,16 @@ extern void s3c_sdhci1_set_platdata(struct s3c_sdhci_platdata *pd);
64 65
65extern struct s3c_sdhci_platdata s3c_hsmmc0_def_platdata; 66extern struct s3c_sdhci_platdata s3c_hsmmc0_def_platdata;
66extern struct s3c_sdhci_platdata s3c_hsmmc1_def_platdata; 67extern struct s3c_sdhci_platdata s3c_hsmmc1_def_platdata;
68extern struct s3c_sdhci_platdata s3c_hsmmc2_def_platdata;
67 69
68/* Helper function availablity */ 70/* Helper function availablity */
69 71
70extern void s3c64xx_setup_sdhci0_cfg_gpio(struct platform_device *, int w); 72extern void s3c64xx_setup_sdhci0_cfg_gpio(struct platform_device *, int w);
71extern void s3c64xx_setup_sdhci1_cfg_gpio(struct platform_device *, int w); 73extern void s3c64xx_setup_sdhci1_cfg_gpio(struct platform_device *, int w);
74extern void s5pc100_setup_sdhci0_cfg_gpio(struct platform_device *, int w);
75extern void s5pc100_setup_sdhci1_cfg_gpio(struct platform_device *, int w);
76extern void s5pc100_setup_sdhci2_cfg_gpio(struct platform_device *, int w);
77extern void s3c64xx_setup_sdhci2_cfg_gpio(struct platform_device *, int w);
72 78
73/* S3C6400 SDHCI setup */ 79/* S3C6400 SDHCI setup */
74 80
@@ -103,6 +109,17 @@ static inline void s3c6400_default_sdhci1(void)
103static inline void s3c6400_default_sdhci1(void) { } 109static inline void s3c6400_default_sdhci1(void) { }
104#endif /* CONFIG_S3C_DEV_HSMMC1 */ 110#endif /* CONFIG_S3C_DEV_HSMMC1 */
105 111
112#ifdef CONFIG_S3C_DEV_HSMMC2
113static inline void s3c6400_default_sdhci2(void)
114{
115 s3c_hsmmc2_def_platdata.clocks = s3c6400_hsmmc_clksrcs;
116 s3c_hsmmc2_def_platdata.cfg_gpio = s3c64xx_setup_sdhci2_cfg_gpio;
117 s3c_hsmmc2_def_platdata.cfg_card = s3c6400_setup_sdhci_cfg_card;
118}
119#else
120static inline void s3c6400_default_sdhci2(void) { }
121#endif /* CONFIG_S3C_DEV_HSMMC2 */
122
106#else 123#else
107static inline void s3c6400_default_sdhci0(void) { } 124static inline void s3c6400_default_sdhci0(void) { }
108static inline void s3c6400_default_sdhci1(void) { } 125static inline void s3c6400_default_sdhci1(void) { }
@@ -140,9 +157,70 @@ static inline void s3c6410_default_sdhci1(void)
140static inline void s3c6410_default_sdhci1(void) { } 157static inline void s3c6410_default_sdhci1(void) { }
141#endif /* CONFIG_S3C_DEV_HSMMC1 */ 158#endif /* CONFIG_S3C_DEV_HSMMC1 */
142 159
160#ifdef CONFIG_S3C_DEV_HSMMC2
161static inline void s3c6410_default_sdhci2(void)
162{
163 s3c_hsmmc2_def_platdata.clocks = s3c6410_hsmmc_clksrcs;
164 s3c_hsmmc2_def_platdata.cfg_gpio = s3c64xx_setup_sdhci2_cfg_gpio;
165 s3c_hsmmc2_def_platdata.cfg_card = s3c6410_setup_sdhci0_cfg_card;
166}
167#else
168static inline void s3c6410_default_sdhci2(void) { }
169#endif /* CONFIG_S3C_DEV_HSMMC2 */
170
143#else 171#else
144static inline void s3c6410_default_sdhci0(void) { } 172static inline void s3c6410_default_sdhci0(void) { }
145static inline void s3c6410_default_sdhci1(void) { } 173static inline void s3c6410_default_sdhci1(void) { }
146#endif /* CONFIG_S3C6410_SETUP_SDHCI */ 174#endif /* CONFIG_S3C6410_SETUP_SDHCI */
147 175
176/* S5PC100 SDHCI setup */
177
178#ifdef CONFIG_S5PC100_SETUP_SDHCI
179extern char *s5pc100_hsmmc_clksrcs[4];
180
181extern void s5pc100_setup_sdhci0_cfg_card(struct platform_device *dev,
182 void __iomem *r,
183 struct mmc_ios *ios,
184 struct mmc_card *card);
185
186#ifdef CONFIG_S3C_DEV_HSMMC
187static inline void s5pc100_default_sdhci0(void)
188{
189 s3c_hsmmc0_def_platdata.clocks = s5pc100_hsmmc_clksrcs;
190 s3c_hsmmc0_def_platdata.cfg_gpio = s5pc100_setup_sdhci0_cfg_gpio;
191 s3c_hsmmc0_def_platdata.cfg_card = s5pc100_setup_sdhci0_cfg_card;
192}
193#else
194static inline void s5pc100_default_sdhci0(void) { }
195#endif /* CONFIG_S3C_DEV_HSMMC */
196
197#ifdef CONFIG_S3C_DEV_HSMMC1
198static inline void s5pc100_default_sdhci1(void)
199{
200 s3c_hsmmc1_def_platdata.clocks = s5pc100_hsmmc_clksrcs;
201 s3c_hsmmc1_def_platdata.cfg_gpio = s5pc100_setup_sdhci1_cfg_gpio;
202 s3c_hsmmc1_def_platdata.cfg_card = s5pc100_setup_sdhci0_cfg_card;
203}
204#else
205static inline void s5pc100_default_sdhci1(void) { }
206#endif /* CONFIG_S3C_DEV_HSMMC1 */
207
208#ifdef CONFIG_S3C_DEV_HSMMC2
209static inline void s5pc100_default_sdhci2(void)
210{
211 s3c_hsmmc2_def_platdata.clocks = s5pc100_hsmmc_clksrcs;
212 s3c_hsmmc2_def_platdata.cfg_gpio = s5pc100_setup_sdhci2_cfg_gpio;
213 s3c_hsmmc2_def_platdata.cfg_card = s5pc100_setup_sdhci0_cfg_card;
214}
215#else
216static inline void s5pc100_default_sdhci2(void) { }
217#endif /* CONFIG_S3C_DEV_HSMMC1 */
218
219
220#else
221static inline void s5pc100_default_sdhci0(void) { }
222static inline void s5pc100_default_sdhci1(void) { }
223static inline void s5pc100_default_sdhci2(void) { }
224#endif /* CONFIG_S5PC100_SETUP_SDHCI */
225
148#endif /* __PLAT_S3C_SDHCI_H */ 226#endif /* __PLAT_S3C_SDHCI_H */
diff --git a/arch/arm/plat-s3c/pm-check.c b/arch/arm/plat-s3c/pm-check.c
index 39f2555564da..8eb1f439861c 100644
--- a/arch/arm/plat-s3c/pm-check.c
+++ b/arch/arm/plat-s3c/pm-check.c
@@ -1,7 +1,7 @@
1/* linux/arch/arm/plat-s3c/pm-check.c 1/* linux/arch/arm/plat-s3c/pm-check.c
2 * originally in linux/arch/arm/plat-s3c24xx/pm.c 2 * originally in linux/arch/arm/plat-s3c24xx/pm.c
3 * 3 *
4 * Copyright (c) 2004,2006,2008 Simtec Electronics 4 * Copyright (c) 2004-2008 Simtec Electronics
5 * http://armlinux.simtec.co.uk 5 * http://armlinux.simtec.co.uk
6 * Ben Dooks <ben@simtec.co.uk> 6 * Ben Dooks <ben@simtec.co.uk>
7 * 7 *
diff --git a/arch/arm/plat-s3c/pm.c b/arch/arm/plat-s3c/pm.c
index 8d97db2c7a0d..767470601e5c 100644
--- a/arch/arm/plat-s3c/pm.c
+++ b/arch/arm/plat-s3c/pm.c
@@ -1,7 +1,7 @@
1/* linux/arch/arm/plat-s3c/pm.c 1/* linux/arch/arm/plat-s3c/pm.c
2 * 2 *
3 * Copyright 2008 Openmoko, Inc. 3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2004,2006,2008 Simtec Electronics 4 * Copyright 2004-2008 Simtec Electronics
5 * Ben Dooks <ben@simtec.co.uk> 5 * Ben Dooks <ben@simtec.co.uk>
6 * http://armlinux.simtec.co.uk/ 6 * http://armlinux.simtec.co.uk/
7 * 7 *
diff --git a/arch/arm/plat-s3c24xx/Kconfig b/arch/arm/plat-s3c24xx/Kconfig
index 9c7aca489643..20fbf936bb93 100644
--- a/arch/arm/plat-s3c24xx/Kconfig
+++ b/arch/arm/plat-s3c24xx/Kconfig
@@ -178,4 +178,11 @@ config MACH_SMDK
178 help 178 help
179 Common machine code for SMDK2410 and SMDK2440 179 Common machine code for SMDK2410 and SMDK2440
180 180
181config S3C24XX_SIMTEC_AUDIO
182 bool
183 depends on (ARCH_BAST || MACH_VR1000 || MACH_OSIRIS || MACH_ANUBIS)
184 default y
185 help
186 Add audio devices for common Simtec S3C24XX boards
187
181endif 188endif
diff --git a/arch/arm/plat-s3c24xx/Makefile b/arch/arm/plat-s3c24xx/Makefile
index 7780d2dd833a..5dee8c12e8b4 100644
--- a/arch/arm/plat-s3c24xx/Makefile
+++ b/arch/arm/plat-s3c24xx/Makefile
@@ -55,3 +55,4 @@ obj-$(CONFIG_S3C24XX_SPI_BUS1_GPD8_GPD9_GPD10) += spi-bus1-gpd8_9_10.o
55# machine common support 55# machine common support
56 56
57obj-$(CONFIG_MACH_SMDK) += common-smdk.o 57obj-$(CONFIG_MACH_SMDK) += common-smdk.o
58obj-$(CONFIG_S3C24XX_SIMTEC_AUDIO) += simtec-audio.o
diff --git a/arch/arm/plat-s3c24xx/clock-dclk.c b/arch/arm/plat-s3c24xx/clock-dclk.c
index 0afb217a775e..ac061a1bcb37 100644
--- a/arch/arm/plat-s3c24xx/clock-dclk.c
+++ b/arch/arm/plat-s3c24xx/clock-dclk.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/plat-s3c24xx/clock-dclk.c 1/* linux/arch/arm/plat-s3c24xx/clock-dclk.c
2 * 2 *
3 * Copyright (c) 2004,2008 Simtec Electronics 3 * Copyright (c) 2004-2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/ 5 * http://armlinux.simtec.co.uk/
6 * 6 *
diff --git a/arch/arm/plat-s3c24xx/common-smdk.c b/arch/arm/plat-s3c24xx/common-smdk.c
index aa119863c5ce..9e0e20ad2e46 100644
--- a/arch/arm/plat-s3c24xx/common-smdk.c
+++ b/arch/arm/plat-s3c24xx/common-smdk.c
@@ -198,7 +198,7 @@ void __init smdk_machine_init(void)
198 if (machine_is_smdk2443()) 198 if (machine_is_smdk2443())
199 smdk_nand_info.twrph0 = 50; 199 smdk_nand_info.twrph0 = 50;
200 200
201 s3c_device_nand.dev.platform_data = &smdk_nand_info; 201 s3c_nand_set_platdata(&smdk_nand_info);
202 202
203 platform_add_devices(smdk_devs, ARRAY_SIZE(smdk_devs)); 203 platform_add_devices(smdk_devs, ARRAY_SIZE(smdk_devs));
204 204
diff --git a/arch/arm/plat-s3c24xx/cpu-freq.c b/arch/arm/plat-s3c24xx/cpu-freq.c
index 4f1b789a1173..2d42efb9f4e9 100644
--- a/arch/arm/plat-s3c24xx/cpu-freq.c
+++ b/arch/arm/plat-s3c24xx/cpu-freq.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/plat-s3c24xx/cpu-freq.c 1/* linux/arch/arm/plat-s3c24xx/cpu-freq.c
2 * 2 *
3 * Copyright (c) 2006,2007,2008 Simtec Electronics 3 * Copyright (c) 2006-2008 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk> 5 * Ben Dooks <ben@simtec.co.uk>
6 * 6 *
diff --git a/arch/arm/plat-s3c24xx/dma.c b/arch/arm/plat-s3c24xx/dma.c
index f046f8c51084..f65192d5b1d7 100644
--- a/arch/arm/plat-s3c24xx/dma.c
+++ b/arch/arm/plat-s3c24xx/dma.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/plat-s3c24xx/dma.c 1/* linux/arch/arm/plat-s3c24xx/dma.c
2 * 2 *
3 * Copyright (c) 2003-2005,2006 Simtec Electronics 3 * Copyright 2003-2006 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * S3C2410 DMA core 6 * S3C2410 DMA core
@@ -1310,7 +1310,7 @@ int __init s3c24xx_dma_init(unsigned int channels, unsigned int irq,
1310 int channel; 1310 int channel;
1311 int ret; 1311 int ret;
1312 1312
1313 printk("S3C24XX DMA Driver, (c) 2003-2004,2006 Simtec Electronics\n"); 1313 printk("S3C24XX DMA Driver, Copyright 2003-2006 Simtec Electronics\n");
1314 1314
1315 dma_channels = channels; 1315 dma_channels = channels;
1316 1316
diff --git a/arch/arm/plat-s3c24xx/include/plat/cpu-freq-core.h b/arch/arm/plat-s3c24xx/include/plat/cpu-freq-core.h
index c776120b99e6..33d421d78bad 100644
--- a/arch/arm/plat-s3c24xx/include/plat/cpu-freq-core.h
+++ b/arch/arm/plat-s3c24xx/include/plat/cpu-freq-core.h
@@ -1,6 +1,6 @@
1/* arch/arm/plat-s3c/include/plat/cpu-freq.h 1/* arch/arm/plat-s3c/include/plat/cpu-freq.h
2 * 2 *
3 * Copyright (c) 2006,2007,2009 Simtec Electronics 3 * Copyright (c) 2006-2009 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk> 5 * Ben Dooks <ben@simtec.co.uk>
6 * 6 *
diff --git a/arch/arm/plat-s3c24xx/include/plat/mci.h b/arch/arm/plat-s3c24xx/include/plat/mci.h
index c2cef6139683..36aaa10fad06 100644
--- a/arch/arm/plat-s3c24xx/include/plat/mci.h
+++ b/arch/arm/plat-s3c24xx/include/plat/mci.h
@@ -1,6 +1,31 @@
1#ifndef _ARCH_MCI_H 1#ifndef _ARCH_MCI_H
2#define _ARCH_MCI_H 2#define _ARCH_MCI_H
3 3
4/**
5 * struct s3c24xx_mci_pdata - sd/mmc controller platform data
6 * @no_wprotect: Set this to indicate there is no write-protect switch.
7 * @no_detect: Set this if there is no detect switch.
8 * @wprotect_invert: Invert the default sense of the write protect switch.
9 * @detect_invert: Invert the default sense of the write protect switch.
10 * @use_dma: Set to allow the use of DMA.
11 * @gpio_detect: GPIO number for the card detect line.
12 * @gpio_wprotect: GPIO number for the write protect line.
13 * @ocr_avail: The mask of the available power states, non-zero to use.
14 * @set_power: Callback to control the power mode.
15 *
16 * The @gpio_detect is used for card detection when @no_wprotect is unset,
17 * and the default sense is that 0 returned from gpio_get_value() means
18 * that a card is inserted. If @detect_invert is set, then the value from
19 * gpio_get_value() is inverted, which makes 1 mean card inserted.
20 *
21 * The driver will use @gpio_wprotect to signal whether the card is write
22 * protected if @no_wprotect is not set. A 0 returned from gpio_get_value()
23 * means the card is read/write, and 1 means read-only. The @wprotect_invert
24 * will invert the value returned from gpio_get_value().
25 *
26 * Card power is set by @ocr_availa, using MCC_VDD_ constants if it is set
27 * to a non-zero value, otherwise the default of 3.2-3.4V is used.
28 */
4struct s3c24xx_mci_pdata { 29struct s3c24xx_mci_pdata {
5 unsigned int no_wprotect : 1; 30 unsigned int no_wprotect : 1;
6 unsigned int no_detect : 1; 31 unsigned int no_detect : 1;
diff --git a/arch/arm/plat-s3c24xx/include/plat/regs-dma.h b/arch/arm/plat-s3c24xx/include/plat/regs-dma.h
index 3bc0a216df97..1b0f4c36d384 100644
--- a/arch/arm/plat-s3c24xx/include/plat/regs-dma.h
+++ b/arch/arm/plat-s3c24xx/include/plat/regs-dma.h
@@ -1,6 +1,6 @@
1/* arch/arm/mach-s3c2410/include/mach/dma.h 1/* arch/arm/mach-s3c2410/include/mach/dma.h
2 * 2 *
3 * Copyright (C) 2003,2004,2006 Simtec Electronics 3 * Copyright (C) 2003-2006 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * Samsung S3C24XX DMA support 6 * Samsung S3C24XX DMA support
diff --git a/arch/arm/plat-s3c24xx/irq-pm.c b/arch/arm/plat-s3c24xx/irq-pm.c
index b7acf1a8ecd2..ea8dea3339a4 100644
--- a/arch/arm/plat-s3c24xx/irq-pm.c
+++ b/arch/arm/plat-s3c24xx/irq-pm.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/plat-s3c24xx/irq-om.c 1/* linux/arch/arm/plat-s3c24xx/irq-om.c
2 * 2 *
3 * Copyright (c) 2003,2004 Simtec Electronics 3 * Copyright (c) 2003-2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/ 5 * http://armlinux.simtec.co.uk/
6 * 6 *
diff --git a/arch/arm/plat-s3c24xx/irq.c b/arch/arm/plat-s3c24xx/irq.c
index d02f5f02045e..ef0f521437d7 100644
--- a/arch/arm/plat-s3c24xx/irq.c
+++ b/arch/arm/plat-s3c24xx/irq.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/plat-s3c24xx/irq.c 1/* linux/arch/arm/plat-s3c24xx/irq.c
2 * 2 *
3 * Copyright (c) 2003,2004 Simtec Electronics 3 * Copyright (c) 2003-2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
diff --git a/arch/arm/plat-s3c24xx/pm-simtec.c b/arch/arm/plat-s3c24xx/pm-simtec.c
index da0d3217d3e3..663b280d65da 100644
--- a/arch/arm/plat-s3c24xx/pm-simtec.c
+++ b/arch/arm/plat-s3c24xx/pm-simtec.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/plat-s3c24xx/pm-simtec.c 1/* linux/arch/arm/plat-s3c24xx/pm-simtec.c
2 * 2 *
3 * Copyright (c) 2004 Simtec Electronics 3 * Copyright 2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * http://armlinux.simtec.co.uk/ 6 * http://armlinux.simtec.co.uk/
@@ -35,7 +35,7 @@
35 35
36#include <plat/pm.h> 36#include <plat/pm.h>
37 37
38#define COPYRIGHT ", (c) 2005 Simtec Electronics" 38#define COPYRIGHT ", Copyright 2005 Simtec Electronics"
39 39
40/* pm_simtec_init 40/* pm_simtec_init
41 * 41 *
diff --git a/arch/arm/plat-s3c24xx/pm.c b/arch/arm/plat-s3c24xx/pm.c
index 56e5253ca02c..3620dd299095 100644
--- a/arch/arm/plat-s3c24xx/pm.c
+++ b/arch/arm/plat-s3c24xx/pm.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/plat-s3c24xx/pm.c 1/* linux/arch/arm/plat-s3c24xx/pm.c
2 * 2 *
3 * Copyright (c) 2004,2006 Simtec Electronics 3 * Copyright (c) 2004-2006 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * S3C24XX Power Manager (Suspend-To-RAM) support 6 * S3C24XX Power Manager (Suspend-To-RAM) support
diff --git a/arch/arm/plat-s3c24xx/s3c2410-iotiming.c b/arch/arm/plat-s3c24xx/s3c2410-iotiming.c
index d0a3a145cd4d..963fb0b4379e 100644
--- a/arch/arm/plat-s3c24xx/s3c2410-iotiming.c
+++ b/arch/arm/plat-s3c24xx/s3c2410-iotiming.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/plat-s3c24xx/s3c2410-iotiming.c 1/* linux/arch/arm/plat-s3c24xx/s3c2410-iotiming.c
2 * 2 *
3 * Copyright (c) 2006,2008,2009 Simtec Electronics 3 * Copyright (c) 2006-2009 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk> 5 * Ben Dooks <ben@simtec.co.uk>
6 * 6 *
diff --git a/arch/arm/plat-s3c24xx/s3c2412-iotiming.c b/arch/arm/plat-s3c24xx/s3c2412-iotiming.c
index fd45e47facbc..24993dce10b5 100644
--- a/arch/arm/plat-s3c24xx/s3c2412-iotiming.c
+++ b/arch/arm/plat-s3c24xx/s3c2412-iotiming.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/plat-s3c24xx/s3c2412-iotiming.c 1/* linux/arch/arm/plat-s3c24xx/s3c2412-iotiming.c
2 * 2 *
3 * Copyright (c) 2006,2008 Simtec Electronics 3 * Copyright (c) 2006-2008 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk> 5 * Ben Dooks <ben@simtec.co.uk>
6 * 6 *
diff --git a/arch/arm/plat-s3c24xx/s3c2440-cpufreq.c b/arch/arm/plat-s3c24xx/s3c2440-cpufreq.c
index ae2e6c604f27..976002fb1b8f 100644
--- a/arch/arm/plat-s3c24xx/s3c2440-cpufreq.c
+++ b/arch/arm/plat-s3c24xx/s3c2440-cpufreq.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/plat-s3c24xx/s3c2440-cpufreq.c 1/* linux/arch/arm/plat-s3c24xx/s3c2440-cpufreq.c
2 * 2 *
3 * Copyright (c) 2006,2008,2009 Simtec Electronics 3 * Copyright (c) 2006-2009 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk> 5 * Ben Dooks <ben@simtec.co.uk>
6 * Vincent Sanders <vince@simtec.co.uk> 6 * Vincent Sanders <vince@simtec.co.uk>
diff --git a/arch/arm/plat-s3c24xx/s3c2440-pll-12000000.c b/arch/arm/plat-s3c24xx/s3c2440-pll-12000000.c
index ff9443b233aa..49f65032f2c0 100644
--- a/arch/arm/plat-s3c24xx/s3c2440-pll-12000000.c
+++ b/arch/arm/plat-s3c24xx/s3c2440-pll-12000000.c
@@ -1,6 +1,6 @@
1/* arch/arm/plat-s3c24xx/s3c2440-pll-12000000.c 1/* arch/arm/plat-s3c24xx/s3c2440-pll-12000000.c
2 * 2 *
3 * Copyright (c) 2006,2007 Simtec Electronics 3 * Copyright (c) 2006-2007 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk> 5 * Ben Dooks <ben@simtec.co.uk>
6 * Vincent Sanders <vince@arm.linux.org.uk> 6 * Vincent Sanders <vince@arm.linux.org.uk>
diff --git a/arch/arm/plat-s3c24xx/s3c244x-clock.c b/arch/arm/plat-s3c24xx/s3c244x-clock.c
index dde41f171aff..79371091aa38 100644
--- a/arch/arm/plat-s3c24xx/s3c244x-clock.c
+++ b/arch/arm/plat-s3c24xx/s3c244x-clock.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/plat-s3c24xx/s3c24xx-clock.c 1/* linux/arch/arm/plat-s3c24xx/s3c24xx-clock.c
2 * 2 *
3 * Copyright (c) 2004-2005,2008 Simtec Electronics 3 * Copyright (c) 2004-2008 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk> 5 * Ben Dooks <ben@simtec.co.uk>
6 * 6 *
diff --git a/arch/arm/plat-s3c24xx/s3c244x-irq.c b/arch/arm/plat-s3c24xx/s3c244x-irq.c
index 0902afd227ca..a75c0c2431ea 100644
--- a/arch/arm/plat-s3c24xx/s3c244x-irq.c
+++ b/arch/arm/plat-s3c24xx/s3c244x-irq.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/plat-s3c24xx/s3c244x-irq.c 1/* linux/arch/arm/plat-s3c24xx/s3c244x-irq.c
2 * 2 *
3 * Copyright (c) 2003,2004 Simtec Electronics 3 * Copyright (c) 2003-2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
diff --git a/arch/arm/plat-s3c24xx/simtec-audio.c b/arch/arm/plat-s3c24xx/simtec-audio.c
new file mode 100644
index 000000000000..6bc832e0d8ea
--- /dev/null
+++ b/arch/arm/plat-s3c24xx/simtec-audio.c
@@ -0,0 +1,77 @@
1/* linux/arch/arm/plat-s3c24xx/simtec-audio.c
2 *
3 * Copyright (c) 2009 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * Audio setup for various Simtec S3C24XX implementations
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 version 2 as
11 * published by the Free Software Foundation.
12*/
13
14#include <linux/kernel.h>
15#include <linux/interrupt.h>
16#include <linux/init.h>
17#include <linux/device.h>
18#include <linux/io.h>
19
20#include <mach/bast-map.h>
21#include <mach/bast-irq.h>
22#include <mach/bast-cpld.h>
23
24#include <mach/hardware.h>
25#include <mach/regs-gpio.h>
26
27#include <plat/audio-simtec.h>
28#include <plat/devs.h>
29
30/* platform ops for audio */
31
32static void simtec_audio_startup_lrroute(void)
33{
34 unsigned int tmp;
35 unsigned long flags;
36
37 local_irq_save(flags);
38
39 tmp = __raw_readb(BAST_VA_CTRL1);
40 tmp &= ~BAST_CPLD_CTRL1_LRMASK;
41 tmp |= BAST_CPLD_CTRL1_LRCDAC;
42 __raw_writeb(tmp, BAST_VA_CTRL1);
43
44 local_irq_restore(flags);
45}
46
47static struct s3c24xx_audio_simtec_pdata simtec_audio_platdata;
48static char our_name[32];
49
50static struct platform_device simtec_audio_dev = {
51 .name = our_name,
52 .id = -1,
53 .dev = {
54 .parent = &s3c_device_iis.dev,
55 .platform_data = &simtec_audio_platdata,
56 },
57};
58
59int __init simtec_audio_add(const char *name, bool has_lr_routing,
60 struct s3c24xx_audio_simtec_pdata *spd)
61{
62 if (!name)
63 name = "tlv320aic23";
64
65 snprintf(our_name, sizeof(our_name)-1, "s3c24xx-simtec-%s", name);
66
67 /* copy platform data so the source can be __initdata */
68 if (spd)
69 simtec_audio_platdata = *spd;
70
71 if (has_lr_routing)
72 simtec_audio_platdata.startup = simtec_audio_startup_lrroute;
73
74 platform_device_register(&s3c_device_iis);
75 platform_device_register(&simtec_audio_dev);
76 return 0;
77}
diff --git a/arch/arm/plat-s3c64xx/cpu.c b/arch/arm/plat-s3c64xx/cpu.c
index b1fdd83940a6..49796d2db86d 100644
--- a/arch/arm/plat-s3c64xx/cpu.c
+++ b/arch/arm/plat-s3c64xx/cpu.c
@@ -107,6 +107,11 @@ static struct map_desc s3c_iodesc[] __initdata = {
107 .pfn = __phys_to_pfn(S3C64XX_PA_WATCHDOG), 107 .pfn = __phys_to_pfn(S3C64XX_PA_WATCHDOG),
108 .length = SZ_4K, 108 .length = SZ_4K,
109 .type = MT_DEVICE, 109 .type = MT_DEVICE,
110 }, {
111 .virtual = (unsigned long)S3C_VA_USB_HSPHY,
112 .pfn = __phys_to_pfn(S3C64XX_PA_USB_HSPHY),
113 .length = SZ_1K,
114 .type = MT_DEVICE,
110 }, 115 },
111}; 116};
112 117
diff --git a/arch/arm/plat-s3c64xx/cpufreq.c b/arch/arm/plat-s3c64xx/cpufreq.c
index e6e0843215df..74c0e8347de5 100644
--- a/arch/arm/plat-s3c64xx/cpufreq.c
+++ b/arch/arm/plat-s3c64xx/cpufreq.c
@@ -19,6 +19,7 @@
19 19
20static struct clk *armclk; 20static struct clk *armclk;
21static struct regulator *vddarm; 21static struct regulator *vddarm;
22static unsigned long regulator_latency;
22 23
23#ifdef CONFIG_CPU_S3C6410 24#ifdef CONFIG_CPU_S3C6410
24struct s3c64xx_dvfs { 25struct s3c64xx_dvfs {
@@ -27,11 +28,10 @@ struct s3c64xx_dvfs {
27}; 28};
28 29
29static struct s3c64xx_dvfs s3c64xx_dvfs_table[] = { 30static struct s3c64xx_dvfs s3c64xx_dvfs_table[] = {
30 [0] = { 1000000, 1000000 }, 31 [0] = { 1000000, 1150000 },
31 [1] = { 1000000, 1050000 }, 32 [1] = { 1050000, 1150000 },
32 [2] = { 1050000, 1100000 }, 33 [2] = { 1100000, 1150000 },
33 [3] = { 1050000, 1150000 }, 34 [3] = { 1200000, 1350000 },
34 [4] = { 1250000, 1350000 },
35}; 35};
36 36
37static struct cpufreq_frequency_table s3c64xx_freq_table[] = { 37static struct cpufreq_frequency_table s3c64xx_freq_table[] = {
@@ -41,9 +41,9 @@ static struct cpufreq_frequency_table s3c64xx_freq_table[] = {
41 { 1, 266000 }, 41 { 1, 266000 },
42 { 2, 333000 }, 42 { 2, 333000 },
43 { 2, 400000 }, 43 { 2, 400000 },
44 { 3, 532000 }, 44 { 2, 532000 },
45 { 3, 533000 }, 45 { 2, 533000 },
46 { 4, 667000 }, 46 { 3, 667000 },
47 { 0, CPUFREQ_TABLE_END }, 47 { 0, CPUFREQ_TABLE_END },
48}; 48};
49#endif 49#endif
@@ -141,7 +141,7 @@ err:
141} 141}
142 142
143#ifdef CONFIG_REGULATOR 143#ifdef CONFIG_REGULATOR
144static void __init s3c64xx_cpufreq_constrain_voltages(void) 144static void __init s3c64xx_cpufreq_config_regulator(void)
145{ 145{
146 int count, v, i, found; 146 int count, v, i, found;
147 struct cpufreq_frequency_table *freq; 147 struct cpufreq_frequency_table *freq;
@@ -150,11 +150,10 @@ static void __init s3c64xx_cpufreq_constrain_voltages(void)
150 count = regulator_count_voltages(vddarm); 150 count = regulator_count_voltages(vddarm);
151 if (count < 0) { 151 if (count < 0) {
152 pr_err("cpufreq: Unable to check supported voltages\n"); 152 pr_err("cpufreq: Unable to check supported voltages\n");
153 return;
154 } 153 }
155 154
156 freq = s3c64xx_freq_table; 155 freq = s3c64xx_freq_table;
157 while (freq->frequency != CPUFREQ_TABLE_END) { 156 while (count > 0 && freq->frequency != CPUFREQ_TABLE_END) {
158 if (freq->frequency == CPUFREQ_ENTRY_INVALID) 157 if (freq->frequency == CPUFREQ_ENTRY_INVALID)
159 continue; 158 continue;
160 159
@@ -175,6 +174,10 @@ static void __init s3c64xx_cpufreq_constrain_voltages(void)
175 174
176 freq++; 175 freq++;
177 } 176 }
177
178 /* Guess based on having to do an I2C/SPI write; in future we
179 * will be able to query the regulator performance here. */
180 regulator_latency = 1 * 1000 * 1000;
178} 181}
179#endif 182#endif
180 183
@@ -206,7 +209,7 @@ static int __init s3c64xx_cpufreq_driver_init(struct cpufreq_policy *policy)
206 pr_err("cpufreq: Only frequency scaling available\n"); 209 pr_err("cpufreq: Only frequency scaling available\n");
207 vddarm = NULL; 210 vddarm = NULL;
208 } else { 211 } else {
209 s3c64xx_cpufreq_constrain_voltages(); 212 s3c64xx_cpufreq_config_regulator();
210 } 213 }
211#endif 214#endif
212 215
@@ -217,8 +220,11 @@ static int __init s3c64xx_cpufreq_driver_init(struct cpufreq_policy *policy)
217 /* Check for frequencies we can generate */ 220 /* Check for frequencies we can generate */
218 r = clk_round_rate(armclk, freq->frequency * 1000); 221 r = clk_round_rate(armclk, freq->frequency * 1000);
219 r /= 1000; 222 r /= 1000;
220 if (r != freq->frequency) 223 if (r != freq->frequency) {
224 pr_debug("cpufreq: %dkHz unsupported by clock\n",
225 freq->frequency);
221 freq->frequency = CPUFREQ_ENTRY_INVALID; 226 freq->frequency = CPUFREQ_ENTRY_INVALID;
227 }
222 228
223 /* If we have no regulator then assume startup 229 /* If we have no regulator then assume startup
224 * frequency is the maximum we can support. */ 230 * frequency is the maximum we can support. */
@@ -230,9 +236,11 @@ static int __init s3c64xx_cpufreq_driver_init(struct cpufreq_policy *policy)
230 236
231 policy->cur = clk_get_rate(armclk) / 1000; 237 policy->cur = clk_get_rate(armclk) / 1000;
232 238
233 /* Pick a conservative guess in ns: we'll need ~1 I2C/SPI 239 /* Datasheet says PLL stabalisation time (if we were to use
234 * write plus clock reprogramming. */ 240 * the PLLs, which we don't currently) is ~300us worst case,
235 policy->cpuinfo.transition_latency = 2 * 1000 * 1000; 241 * but add some fudge.
242 */
243 policy->cpuinfo.transition_latency = (500 * 1000) + regulator_latency;
236 244
237 ret = cpufreq_frequency_table_cpuinfo(policy, s3c64xx_freq_table); 245 ret = cpufreq_frequency_table_cpuinfo(policy, s3c64xx_freq_table);
238 if (ret != 0) { 246 if (ret != 0) {
diff --git a/arch/arm/plat-s3c64xx/dev-audio.c b/arch/arm/plat-s3c64xx/dev-audio.c
index 1322beb40dd7..a21a88fbb7e3 100644
--- a/arch/arm/plat-s3c64xx/dev-audio.c
+++ b/arch/arm/plat-s3c64xx/dev-audio.c
@@ -15,9 +15,14 @@
15 15
16#include <mach/irqs.h> 16#include <mach/irqs.h>
17#include <mach/map.h> 17#include <mach/map.h>
18#include <mach/dma.h>
19#include <mach/gpio.h>
18 20
19#include <plat/devs.h> 21#include <plat/devs.h>
20 22#include <plat/audio.h>
23#include <plat/gpio-bank-d.h>
24#include <plat/gpio-bank-e.h>
25#include <plat/gpio-cfg.h>
21 26
22static struct resource s3c64xx_iis0_resource[] = { 27static struct resource s3c64xx_iis0_resource[] = {
23 [0] = { 28 [0] = {
@@ -66,3 +71,97 @@ struct platform_device s3c64xx_device_iisv4 = {
66 .resource = s3c64xx_iisv4_resource, 71 .resource = s3c64xx_iisv4_resource,
67}; 72};
68EXPORT_SYMBOL(s3c64xx_device_iisv4); 73EXPORT_SYMBOL(s3c64xx_device_iisv4);
74
75
76/* PCM Controller platform_devices */
77
78static int s3c64xx_pcm_cfg_gpio(struct platform_device *pdev)
79{
80 switch (pdev->id) {
81 case 0:
82 s3c_gpio_cfgpin(S3C64XX_GPD(0), S3C64XX_GPD0_PCM0_SCLK);
83 s3c_gpio_cfgpin(S3C64XX_GPD(1), S3C64XX_GPD1_PCM0_EXTCLK);
84 s3c_gpio_cfgpin(S3C64XX_GPD(2), S3C64XX_GPD2_PCM0_FSYNC);
85 s3c_gpio_cfgpin(S3C64XX_GPD(3), S3C64XX_GPD3_PCM0_SIN);
86 s3c_gpio_cfgpin(S3C64XX_GPD(4), S3C64XX_GPD4_PCM0_SOUT);
87 break;
88 case 1:
89 s3c_gpio_cfgpin(S3C64XX_GPE(0), S3C64XX_GPE0_PCM1_SCLK);
90 s3c_gpio_cfgpin(S3C64XX_GPE(1), S3C64XX_GPE1_PCM1_EXTCLK);
91 s3c_gpio_cfgpin(S3C64XX_GPE(2), S3C64XX_GPE2_PCM1_FSYNC);
92 s3c_gpio_cfgpin(S3C64XX_GPE(3), S3C64XX_GPE3_PCM1_SIN);
93 s3c_gpio_cfgpin(S3C64XX_GPE(4), S3C64XX_GPE4_PCM1_SOUT);
94 break;
95 default:
96 printk(KERN_DEBUG "Invalid PCM Controller number!");
97 return -EINVAL;
98 }
99
100 return 0;
101}
102
103static struct resource s3c64xx_pcm0_resource[] = {
104 [0] = {
105 .start = S3C64XX_PA_PCM0,
106 .end = S3C64XX_PA_PCM0 + 0x100 - 1,
107 .flags = IORESOURCE_MEM,
108 },
109 [1] = {
110 .start = DMACH_PCM0_TX,
111 .end = DMACH_PCM0_TX,
112 .flags = IORESOURCE_DMA,
113 },
114 [2] = {
115 .start = DMACH_PCM0_RX,
116 .end = DMACH_PCM0_RX,
117 .flags = IORESOURCE_DMA,
118 },
119};
120
121static struct s3c_audio_pdata s3c_pcm0_pdata = {
122 .cfg_gpio = s3c64xx_pcm_cfg_gpio,
123};
124
125struct platform_device s3c64xx_device_pcm0 = {
126 .name = "samsung-pcm",
127 .id = 0,
128 .num_resources = ARRAY_SIZE(s3c64xx_pcm0_resource),
129 .resource = s3c64xx_pcm0_resource,
130 .dev = {
131 .platform_data = &s3c_pcm0_pdata,
132 },
133};
134EXPORT_SYMBOL(s3c64xx_device_pcm0);
135
136static struct resource s3c64xx_pcm1_resource[] = {
137 [0] = {
138 .start = S3C64XX_PA_PCM1,
139 .end = S3C64XX_PA_PCM1 + 0x100 - 1,
140 .flags = IORESOURCE_MEM,
141 },
142 [1] = {
143 .start = DMACH_PCM1_TX,
144 .end = DMACH_PCM1_TX,
145 .flags = IORESOURCE_DMA,
146 },
147 [2] = {
148 .start = DMACH_PCM1_RX,
149 .end = DMACH_PCM1_RX,
150 .flags = IORESOURCE_DMA,
151 },
152};
153
154static struct s3c_audio_pdata s3c_pcm1_pdata = {
155 .cfg_gpio = s3c64xx_pcm_cfg_gpio,
156};
157
158struct platform_device s3c64xx_device_pcm1 = {
159 .name = "samsung-pcm",
160 .id = 1,
161 .num_resources = ARRAY_SIZE(s3c64xx_pcm1_resource),
162 .resource = s3c64xx_pcm1_resource,
163 .dev = {
164 .platform_data = &s3c_pcm1_pdata,
165 },
166};
167EXPORT_SYMBOL(s3c64xx_device_pcm1);
diff --git a/arch/arm/plat-s3c64xx/gpiolib.c b/arch/arm/plat-s3c64xx/gpiolib.c
index 92859290ea33..778560457277 100644
--- a/arch/arm/plat-s3c64xx/gpiolib.c
+++ b/arch/arm/plat-s3c64xx/gpiolib.c
@@ -213,6 +213,11 @@ static struct s3c_gpio_cfg gpio_4bit_cfg_eint0011 = {
213 .get_pull = s3c_gpio_getpull_updown, 213 .get_pull = s3c_gpio_getpull_updown,
214}; 214};
215 215
216int s3c64xx_gpio2int_gpm(struct gpio_chip *chip, unsigned pin)
217{
218 return pin < 5 ? IRQ_EINT(23) + pin : -ENXIO;
219}
220
216static struct s3c_gpio_chip gpio_4bit[] = { 221static struct s3c_gpio_chip gpio_4bit[] = {
217 { 222 {
218 .base = S3C64XX_GPA_BASE, 223 .base = S3C64XX_GPA_BASE,
@@ -269,10 +274,16 @@ static struct s3c_gpio_chip gpio_4bit[] = {
269 .base = S3C64XX_GPM(0), 274 .base = S3C64XX_GPM(0),
270 .ngpio = S3C64XX_GPIO_M_NR, 275 .ngpio = S3C64XX_GPIO_M_NR,
271 .label = "GPM", 276 .label = "GPM",
277 .to_irq = s3c64xx_gpio2int_gpm,
272 }, 278 },
273 }, 279 },
274}; 280};
275 281
282int s3c64xx_gpio2int_gpl(struct gpio_chip *chip, unsigned pin)
283{
284 return pin >= 8 ? IRQ_EINT(16) + pin - 8 : -ENXIO;
285}
286
276static struct s3c_gpio_chip gpio_4bit2[] = { 287static struct s3c_gpio_chip gpio_4bit2[] = {
277 { 288 {
278 .base = S3C64XX_GPH_BASE + 0x4, 289 .base = S3C64XX_GPH_BASE + 0x4,
@@ -297,6 +308,7 @@ static struct s3c_gpio_chip gpio_4bit2[] = {
297 .base = S3C64XX_GPL(0), 308 .base = S3C64XX_GPL(0),
298 .ngpio = S3C64XX_GPIO_L_NR, 309 .ngpio = S3C64XX_GPIO_L_NR,
299 .label = "GPL", 310 .label = "GPL",
311 .to_irq = s3c64xx_gpio2int_gpl,
300 }, 312 },
301 }, 313 },
302}; 314};
diff --git a/arch/arm/plat-s3c64xx/include/plat/gpio-bank-c.h b/arch/arm/plat-s3c64xx/include/plat/gpio-bank-c.h
index c47daf7e2723..e22b49f4f982 100644
--- a/arch/arm/plat-s3c64xx/include/plat/gpio-bank-c.h
+++ b/arch/arm/plat-s3c64xx/include/plat/gpio-bank-c.h
@@ -36,18 +36,18 @@
36 36
37#define S3C64XX_GPC4_SPI_MISO1 (0x02 << 16) 37#define S3C64XX_GPC4_SPI_MISO1 (0x02 << 16)
38#define S3C64XX_GPC4_MMC2_CMD (0x03 << 16) 38#define S3C64XX_GPC4_MMC2_CMD (0x03 << 16)
39#define S3C64XX_GPC4_I2S0_V40_DO (0x05 << 16) 39#define S3C64XX_GPC4_I2S_V40_DO0 (0x05 << 16)
40#define S3C64XX_GPC4_EINT_G2_4 (0x07 << 16) 40#define S3C64XX_GPC4_EINT_G2_4 (0x07 << 16)
41 41
42#define S3C64XX_GPC5_SPI_CLK1 (0x02 << 20) 42#define S3C64XX_GPC5_SPI_CLK1 (0x02 << 20)
43#define S3C64XX_GPC5_MMC2_CLK (0x03 << 20) 43#define S3C64XX_GPC5_MMC2_CLK (0x03 << 20)
44#define S3C64XX_GPC5_I2S1_V40_DO (0x05 << 20) 44#define S3C64XX_GPC5_I2S_V40_DO1 (0x05 << 20)
45#define S3C64XX_GPC5_EINT_G2_5 (0x07 << 20) 45#define S3C64XX_GPC5_EINT_G2_5 (0x07 << 20)
46 46
47#define S3C64XX_GPC6_SPI_MOSI1 (0x02 << 24) 47#define S3C64XX_GPC6_SPI_MOSI1 (0x02 << 24)
48#define S3C64XX_GPC6_EINT_G2_6 (0x07 << 24) 48#define S3C64XX_GPC6_EINT_G2_6 (0x07 << 24)
49 49
50#define S3C64XX_GPC7_SPI_nCS1 (0x02 << 28) 50#define S3C64XX_GPC7_SPI_nCS1 (0x02 << 28)
51#define S3C64XX_GPC7_I2S2_V40_DO (0x05 << 28) 51#define S3C64XX_GPC7_I2S_V40_DO2 (0x05 << 28)
52#define S3C64XX_GPC7_EINT_G2_7 (0x07 << 28) 52#define S3C64XX_GPC7_EINT_G2_7 (0x07 << 28)
53 53
diff --git a/arch/arm/plat-s3c64xx/irq-eint.c b/arch/arm/plat-s3c64xx/irq-eint.c
index f81b7b818ba0..ebdf183a0911 100644
--- a/arch/arm/plat-s3c64xx/irq-eint.c
+++ b/arch/arm/plat-s3c64xx/irq-eint.c
@@ -65,7 +65,7 @@ static void s3c_irq_eint_maskack(unsigned int irq)
65static int s3c_irq_eint_set_type(unsigned int irq, unsigned int type) 65static int s3c_irq_eint_set_type(unsigned int irq, unsigned int type)
66{ 66{
67 int offs = eint_offset(irq); 67 int offs = eint_offset(irq);
68 int pin; 68 int pin, pin_val;
69 int shift; 69 int shift;
70 u32 ctrl, mask; 70 u32 ctrl, mask;
71 u32 newvalue = 0; 71 u32 newvalue = 0;
@@ -109,7 +109,10 @@ static int s3c_irq_eint_set_type(unsigned int irq, unsigned int type)
109 return -1; 109 return -1;
110 } 110 }
111 111
112 shift = (offs / 2) * 4; 112 if (offs <= 15)
113 shift = (offs / 2) * 4;
114 else
115 shift = ((offs - 16) / 2) * 4;
113 mask = 0x7 << shift; 116 mask = 0x7 << shift;
114 117
115 ctrl = __raw_readl(reg); 118 ctrl = __raw_readl(reg);
@@ -119,12 +122,18 @@ static int s3c_irq_eint_set_type(unsigned int irq, unsigned int type)
119 122
120 /* set the GPIO pin appropriately */ 123 /* set the GPIO pin appropriately */
121 124
122 if (offs < 23) 125 if (offs < 16) {
123 pin = S3C64XX_GPN(offs); 126 pin = S3C64XX_GPN(offs);
124 else 127 pin_val = S3C_GPIO_SFN(2);
128 } else if (offs < 23) {
129 pin = S3C64XX_GPL(offs + 8 - 16);
130 pin_val = S3C_GPIO_SFN(3);
131 } else {
125 pin = S3C64XX_GPM(offs - 23); 132 pin = S3C64XX_GPM(offs - 23);
133 pin_val = S3C_GPIO_SFN(3);
134 }
126 135
127 s3c_gpio_cfgpin(pin, S3C_GPIO_SFN(2)); 136 s3c_gpio_cfgpin(pin, pin_val);
128 137
129 return 0; 138 return 0;
130} 139}
diff --git a/arch/arm/plat-s3c64xx/setup-sdhci-gpio.c b/arch/arm/plat-s3c64xx/setup-sdhci-gpio.c
index 5417123b0ac1..a58c0cc7ba5e 100644
--- a/arch/arm/plat-s3c64xx/setup-sdhci-gpio.c
+++ b/arch/arm/plat-s3c64xx/setup-sdhci-gpio.c
@@ -53,3 +53,23 @@ void s3c64xx_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)
53 s3c_gpio_setpull(S3C64XX_GPG(6), S3C_GPIO_PULL_UP); 53 s3c_gpio_setpull(S3C64XX_GPG(6), S3C_GPIO_PULL_UP);
54 s3c_gpio_cfgpin(S3C64XX_GPG(6), S3C_GPIO_SFN(3)); 54 s3c_gpio_cfgpin(S3C64XX_GPG(6), S3C_GPIO_SFN(3));
55} 55}
56
57void s3c64xx_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width)
58{
59 unsigned int gpio;
60 unsigned int end;
61
62 end = S3C64XX_GPH(6 + width);
63
64 /* Set all the necessary GPH pins to special-function 1 */
65 for (gpio = S3C64XX_GPH(6); gpio < end; gpio++) {
66 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3));
67 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
68 }
69
70 /* Set all the necessary GPC pins to special-function 1 */
71 for (gpio = S3C64XX_GPC(4); gpio < S3C64XX_GPC(6); gpio++) {
72 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3));
73 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
74 }
75}
diff --git a/arch/arm/plat-s5pc1xx/Kconfig b/arch/arm/plat-s5pc1xx/Kconfig
index a8a711c3c064..1608e62b0c9d 100644
--- a/arch/arm/plat-s5pc1xx/Kconfig
+++ b/arch/arm/plat-s5pc1xx/Kconfig
@@ -15,6 +15,9 @@ config PLAT_S5PC1XX
15 select ARCH_REQUIRE_GPIOLIB 15 select ARCH_REQUIRE_GPIOLIB
16 select S3C_GPIO_TRACK 16 select S3C_GPIO_TRACK
17 select S3C_GPIO_PULL_UPDOWN 17 select S3C_GPIO_PULL_UPDOWN
18 select S3C_GPIO_CFG_S3C24XX
19 select S3C_GPIO_CFG_S3C64XX
20 select S5P_GPIO_CFG_S5PC1XX
18 help 21 help
19 Base platform code for any Samsung S5PC1XX device 22 Base platform code for any Samsung S5PC1XX device
20 23
@@ -34,7 +37,12 @@ config CPU_S5PC100_CLOCK
34 37
35# platform specific device setup 38# platform specific device setup
36 39
37config S5PC100_SETUP_I2C0 40config S5PC1XX_SETUP_FB_24BPP
41 bool
42 help
43 Common setup code for S5PC1XX with an 24bpp RGB display helper.
44
45config S5PC1XX_SETUP_I2C0
38 bool 46 bool
39 default y 47 default y
40 help 48 help
@@ -43,8 +51,14 @@ config S5PC100_SETUP_I2C0
43 Note, currently since i2c0 is always compiled, this setup helper 51 Note, currently since i2c0 is always compiled, this setup helper
44 is always compiled with it. 52 is always compiled with it.
45 53
46config S5PC100_SETUP_I2C1 54config S5PC1XX_SETUP_I2C1
47 bool 55 bool
48 help 56 help
49 Common setup code for i2c bus 1. 57 Common setup code for i2c bus 1.
58
59config S5PC1XX_SETUP_SDHCI_GPIO
60 bool
61 help
62 Common setup code for SDHCI gpio.
63
50endif 64endif
diff --git a/arch/arm/plat-s5pc1xx/Makefile b/arch/arm/plat-s5pc1xx/Makefile
index f1ecb2c37ee2..278f26806089 100644
--- a/arch/arm/plat-s5pc1xx/Makefile
+++ b/arch/arm/plat-s5pc1xx/Makefile
@@ -13,7 +13,9 @@ obj- :=
13 13
14obj-y += dev-uart.o 14obj-y += dev-uart.o
15obj-y += cpu.o 15obj-y += cpu.o
16obj-y += irq.o 16obj-y += irq.o irq-gpio.o irq-eint.o
17obj-y += clock.o
18obj-y += gpiolib.o
17 19
18# CPU support 20# CPU support
19 21
@@ -22,5 +24,8 @@ obj-$(CONFIG_CPU_S5PC100_CLOCK) += s5pc100-clock.o
22 24
23# Device setup 25# Device setup
24 26
25obj-$(CONFIG_S5PC100_SETUP_I2C0) += setup-i2c0.o 27obj-$(CONFIG_S5P_GPIO_CFG_S5PC1XX) += gpio-config.o
26obj-$(CONFIG_S5PC100_SETUP_I2C1) += setup-i2c1.o 28obj-$(CONFIG_S5PC1XX_SETUP_FB_24BPP) += setup-fb-24bpp.o
29obj-$(CONFIG_S5PC1XX_SETUP_I2C0) += setup-i2c0.o
30obj-$(CONFIG_S5PC1XX_SETUP_I2C1) += setup-i2c1.o
31obj-$(CONFIG_S5PC1XX_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o
diff --git a/arch/arm/plat-s5pc1xx/clock.c b/arch/arm/plat-s5pc1xx/clock.c
new file mode 100644
index 000000000000..26c21d849790
--- /dev/null
+++ b/arch/arm/plat-s5pc1xx/clock.c
@@ -0,0 +1,728 @@
1/* linux/arch/arm/plat-s5pc1xx/clock.c
2 *
3 * Copyright 2009 Samsung Electronics Co.
4 *
5 * S5PC1XX Base clock support
6 *
7 * Based on plat-s3c64xx/clock.c
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 version 2 as
11 * published by the Free Software Foundation.
12*/
13
14#include <linux/init.h>
15#include <linux/module.h>
16#include <linux/interrupt.h>
17#include <linux/ioport.h>
18#include <linux/clk.h>
19#include <linux/io.h>
20
21#include <mach/hardware.h>
22#include <mach/map.h>
23
24#include <plat/regs-clock.h>
25#include <plat/devs.h>
26#include <plat/clock.h>
27
28struct clk clk_27m = {
29 .name = "clk_27m",
30 .id = -1,
31 .rate = 27000000,
32};
33
34static int clk_48m_ctrl(struct clk *clk, int enable)
35{
36 unsigned long flags;
37 u32 val;
38
39 /* can't rely on clock lock, this register has other usages */
40 local_irq_save(flags);
41
42 val = __raw_readl(S5PC100_CLKSRC1);
43 if (enable)
44 val |= S5PC100_CLKSRC1_CLK48M_MASK;
45 else
46 val &= ~S5PC100_CLKSRC1_CLK48M_MASK;
47
48 __raw_writel(val, S5PC100_CLKSRC1);
49 local_irq_restore(flags);
50
51 return 0;
52}
53
54struct clk clk_48m = {
55 .name = "clk_48m",
56 .id = -1,
57 .rate = 48000000,
58 .enable = clk_48m_ctrl,
59};
60
61struct clk clk_54m = {
62 .name = "clk_54m",
63 .id = -1,
64 .rate = 54000000,
65};
66
67static int clk_default_setrate(struct clk *clk, unsigned long rate)
68{
69 clk->rate = rate;
70 return 0;
71}
72
73static int clk_dummy_enable(struct clk *clk, int enable)
74{
75 return 0;
76}
77
78struct clk clk_hd0 = {
79 .name = "hclkd0",
80 .id = -1,
81 .rate = 0,
82 .parent = NULL,
83 .ctrlbit = 0,
84 .set_rate = clk_default_setrate,
85 .enable = clk_dummy_enable,
86};
87
88struct clk clk_pd0 = {
89 .name = "pclkd0",
90 .id = -1,
91 .rate = 0,
92 .parent = NULL,
93 .ctrlbit = 0,
94 .set_rate = clk_default_setrate,
95 .enable = clk_dummy_enable,
96};
97
98static int s5pc1xx_clk_gate(void __iomem *reg, struct clk *clk, int enable)
99{
100 unsigned int ctrlbit = clk->ctrlbit;
101 u32 con;
102
103 con = __raw_readl(reg);
104 if (enable)
105 con |= ctrlbit;
106 else
107 con &= ~ctrlbit;
108 __raw_writel(con, reg);
109
110 return 0;
111}
112
113static int s5pc100_clk_d00_ctrl(struct clk *clk, int enable)
114{
115 return s5pc1xx_clk_gate(S5PC100_CLKGATE_D00, clk, enable);
116}
117
118static int s5pc100_clk_d01_ctrl(struct clk *clk, int enable)
119{
120 return s5pc1xx_clk_gate(S5PC100_CLKGATE_D01, clk, enable);
121}
122
123static int s5pc100_clk_d02_ctrl(struct clk *clk, int enable)
124{
125 return s5pc1xx_clk_gate(S5PC100_CLKGATE_D02, clk, enable);
126}
127
128static int s5pc100_clk_d10_ctrl(struct clk *clk, int enable)
129{
130 return s5pc1xx_clk_gate(S5PC100_CLKGATE_D10, clk, enable);
131}
132
133static int s5pc100_clk_d11_ctrl(struct clk *clk, int enable)
134{
135 return s5pc1xx_clk_gate(S5PC100_CLKGATE_D11, clk, enable);
136}
137
138static int s5pc100_clk_d12_ctrl(struct clk *clk, int enable)
139{
140 return s5pc1xx_clk_gate(S5PC100_CLKGATE_D12, clk, enable);
141}
142
143static int s5pc100_clk_d13_ctrl(struct clk *clk, int enable)
144{
145 return s5pc1xx_clk_gate(S5PC100_CLKGATE_D13, clk, enable);
146}
147
148static int s5pc100_clk_d14_ctrl(struct clk *clk, int enable)
149{
150 return s5pc1xx_clk_gate(S5PC100_CLKGATE_D14, clk, enable);
151}
152
153static int s5pc100_clk_d15_ctrl(struct clk *clk, int enable)
154{
155 return s5pc1xx_clk_gate(S5PC100_CLKGATE_D15, clk, enable);
156}
157
158static int s5pc100_clk_d20_ctrl(struct clk *clk, int enable)
159{
160 return s5pc1xx_clk_gate(S5PC100_CLKGATE_D20, clk, enable);
161}
162
163int s5pc100_sclk0_ctrl(struct clk *clk, int enable)
164{
165 return s5pc1xx_clk_gate(S5PC100_SCLKGATE0, clk, enable);
166}
167
168int s5pc100_sclk1_ctrl(struct clk *clk, int enable)
169{
170 return s5pc1xx_clk_gate(S5PC100_SCLKGATE1, clk, enable);
171}
172
173static struct clk s5pc100_init_clocks_disable[] = {
174 {
175 .name = "dsi",
176 .id = -1,
177 .parent = &clk_p,
178 .enable = s5pc100_clk_d11_ctrl,
179 .ctrlbit = S5PC100_CLKGATE_D11_DSI,
180 }, {
181 .name = "csi",
182 .id = -1,
183 .parent = &clk_h,
184 .enable = s5pc100_clk_d11_ctrl,
185 .ctrlbit = S5PC100_CLKGATE_D11_CSI,
186 }, {
187 .name = "ccan",
188 .id = 0,
189 .parent = &clk_p,
190 .enable = s5pc100_clk_d14_ctrl,
191 .ctrlbit = S5PC100_CLKGATE_D14_CCAN0,
192 }, {
193 .name = "ccan",
194 .id = 1,
195 .parent = &clk_p,
196 .enable = s5pc100_clk_d14_ctrl,
197 .ctrlbit = S5PC100_CLKGATE_D14_CCAN1,
198 }, {
199 .name = "keypad",
200 .id = -1,
201 .parent = &clk_p,
202 .enable = s5pc100_clk_d15_ctrl,
203 .ctrlbit = S5PC100_CLKGATE_D15_KEYIF,
204 }, {
205 .name = "hclkd2",
206 .id = -1,
207 .parent = NULL,
208 .enable = s5pc100_clk_d20_ctrl,
209 .ctrlbit = S5PC100_CLKGATE_D20_HCLKD2,
210 }, {
211 .name = "iis-d2",
212 .id = -1,
213 .parent = NULL,
214 .enable = s5pc100_clk_d20_ctrl,
215 .ctrlbit = S5PC100_CLKGATE_D20_I2SD2,
216 },
217};
218
219static struct clk s5pc100_init_clocks[] = {
220 /* System1 (D0_0) devices */
221 {
222 .name = "intc",
223 .id = -1,
224 .parent = &clk_hd0,
225 .enable = s5pc100_clk_d00_ctrl,
226 .ctrlbit = S5PC100_CLKGATE_D00_INTC,
227 }, {
228 .name = "tzic",
229 .id = -1,
230 .parent = &clk_hd0,
231 .enable = s5pc100_clk_d00_ctrl,
232 .ctrlbit = S5PC100_CLKGATE_D00_TZIC,
233 }, {
234 .name = "cf-ata",
235 .id = -1,
236 .parent = &clk_hd0,
237 .enable = s5pc100_clk_d00_ctrl,
238 .ctrlbit = S5PC100_CLKGATE_D00_CFCON,
239 }, {
240 .name = "mdma",
241 .id = -1,
242 .parent = &clk_hd0,
243 .enable = s5pc100_clk_d00_ctrl,
244 .ctrlbit = S5PC100_CLKGATE_D00_MDMA,
245 }, {
246 .name = "g2d",
247 .id = -1,
248 .parent = &clk_hd0,
249 .enable = s5pc100_clk_d00_ctrl,
250 .ctrlbit = S5PC100_CLKGATE_D00_G2D,
251 }, {
252 .name = "secss",
253 .id = -1,
254 .parent = &clk_hd0,
255 .enable = s5pc100_clk_d00_ctrl,
256 .ctrlbit = S5PC100_CLKGATE_D00_SECSS,
257 }, {
258 .name = "cssys",
259 .id = -1,
260 .parent = &clk_hd0,
261 .enable = s5pc100_clk_d00_ctrl,
262 .ctrlbit = S5PC100_CLKGATE_D00_CSSYS,
263 },
264
265 /* Memory (D0_1) devices */
266 {
267 .name = "dmc",
268 .id = -1,
269 .parent = &clk_hd0,
270 .enable = s5pc100_clk_d01_ctrl,
271 .ctrlbit = S5PC100_CLKGATE_D01_DMC,
272 }, {
273 .name = "sromc",
274 .id = -1,
275 .parent = &clk_hd0,
276 .enable = s5pc100_clk_d01_ctrl,
277 .ctrlbit = S5PC100_CLKGATE_D01_SROMC,
278 }, {
279 .name = "onenand",
280 .id = -1,
281 .parent = &clk_hd0,
282 .enable = s5pc100_clk_d01_ctrl,
283 .ctrlbit = S5PC100_CLKGATE_D01_ONENAND,
284 }, {
285 .name = "nand",
286 .id = -1,
287 .parent = &clk_hd0,
288 .enable = s5pc100_clk_d01_ctrl,
289 .ctrlbit = S5PC100_CLKGATE_D01_NFCON,
290 }, {
291 .name = "intmem",
292 .id = -1,
293 .parent = &clk_hd0,
294 .enable = s5pc100_clk_d01_ctrl,
295 .ctrlbit = S5PC100_CLKGATE_D01_INTMEM,
296 }, {
297 .name = "ebi",
298 .id = -1,
299 .parent = &clk_hd0,
300 .enable = s5pc100_clk_d01_ctrl,
301 .ctrlbit = S5PC100_CLKGATE_D01_EBI,
302 },
303
304 /* System2 (D0_2) devices */
305 {
306 .name = "seckey",
307 .id = -1,
308 .parent = &clk_pd0,
309 .enable = s5pc100_clk_d02_ctrl,
310 .ctrlbit = S5PC100_CLKGATE_D02_SECKEY,
311 }, {
312 .name = "sdm",
313 .id = -1,
314 .parent = &clk_hd0,
315 .enable = s5pc100_clk_d02_ctrl,
316 .ctrlbit = S5PC100_CLKGATE_D02_SDM,
317 },
318
319 /* File (D1_0) devices */
320 {
321 .name = "pdma",
322 .id = 0,
323 .parent = &clk_h,
324 .enable = s5pc100_clk_d10_ctrl,
325 .ctrlbit = S5PC100_CLKGATE_D10_PDMA0,
326 }, {
327 .name = "pdma",
328 .id = 1,
329 .parent = &clk_h,
330 .enable = s5pc100_clk_d10_ctrl,
331 .ctrlbit = S5PC100_CLKGATE_D10_PDMA1,
332 }, {
333 .name = "usb-host",
334 .id = -1,
335 .parent = &clk_h,
336 .enable = s5pc100_clk_d10_ctrl,
337 .ctrlbit = S5PC100_CLKGATE_D10_USBHOST,
338 }, {
339 .name = "otg",
340 .id = -1,
341 .parent = &clk_h,
342 .enable = s5pc100_clk_d10_ctrl,
343 .ctrlbit = S5PC100_CLKGATE_D10_USBOTG,
344 }, {
345 .name = "modem",
346 .id = -1,
347 .parent = &clk_h,
348 .enable = s5pc100_clk_d10_ctrl,
349 .ctrlbit = S5PC100_CLKGATE_D10_MODEMIF,
350 }, {
351 .name = "hsmmc",
352 .id = 0,
353 .parent = &clk_48m,
354 .enable = s5pc100_clk_d10_ctrl,
355 .ctrlbit = S5PC100_CLKGATE_D10_HSMMC0,
356 }, {
357 .name = "hsmmc",
358 .id = 1,
359 .parent = &clk_48m,
360 .enable = s5pc100_clk_d10_ctrl,
361 .ctrlbit = S5PC100_CLKGATE_D10_HSMMC1,
362 }, {
363 .name = "hsmmc",
364 .id = 2,
365 .parent = &clk_48m,
366 .enable = s5pc100_clk_d10_ctrl,
367 .ctrlbit = S5PC100_CLKGATE_D10_HSMMC2,
368 },
369
370 /* Multimedia1 (D1_1) devices */
371 {
372 .name = "lcd",
373 .id = -1,
374 .parent = &clk_p,
375 .enable = s5pc100_clk_d11_ctrl,
376 .ctrlbit = S5PC100_CLKGATE_D11_LCD,
377 }, {
378 .name = "rotator",
379 .id = -1,
380 .parent = &clk_p,
381 .enable = s5pc100_clk_d11_ctrl,
382 .ctrlbit = S5PC100_CLKGATE_D11_ROTATOR,
383 }, {
384 .name = "fimc",
385 .id = -1,
386 .parent = &clk_p,
387 .enable = s5pc100_clk_d11_ctrl,
388 .ctrlbit = S5PC100_CLKGATE_D11_FIMC0,
389 }, {
390 .name = "fimc",
391 .id = -1,
392 .parent = &clk_p,
393 .enable = s5pc100_clk_d11_ctrl,
394 .ctrlbit = S5PC100_CLKGATE_D11_FIMC1,
395 }, {
396 .name = "fimc",
397 .id = -1,
398 .parent = &clk_p,
399 .enable = s5pc100_clk_d11_ctrl,
400 .ctrlbit = S5PC100_CLKGATE_D11_FIMC2,
401 }, {
402 .name = "jpeg",
403 .id = -1,
404 .parent = &clk_p,
405 .enable = s5pc100_clk_d11_ctrl,
406 .ctrlbit = S5PC100_CLKGATE_D11_JPEG,
407 }, {
408 .name = "g3d",
409 .id = -1,
410 .parent = &clk_p,
411 .enable = s5pc100_clk_d11_ctrl,
412 .ctrlbit = S5PC100_CLKGATE_D11_G3D,
413 },
414
415 /* Multimedia2 (D1_2) devices */
416 {
417 .name = "tv",
418 .id = -1,
419 .parent = &clk_p,
420 .enable = s5pc100_clk_d12_ctrl,
421 .ctrlbit = S5PC100_CLKGATE_D12_TV,
422 }, {
423 .name = "vp",
424 .id = -1,
425 .parent = &clk_p,
426 .enable = s5pc100_clk_d12_ctrl,
427 .ctrlbit = S5PC100_CLKGATE_D12_VP,
428 }, {
429 .name = "mixer",
430 .id = -1,
431 .parent = &clk_p,
432 .enable = s5pc100_clk_d12_ctrl,
433 .ctrlbit = S5PC100_CLKGATE_D12_MIXER,
434 }, {
435 .name = "hdmi",
436 .id = -1,
437 .parent = &clk_p,
438 .enable = s5pc100_clk_d12_ctrl,
439 .ctrlbit = S5PC100_CLKGATE_D12_HDMI,
440 }, {
441 .name = "mfc",
442 .id = -1,
443 .parent = &clk_p,
444 .enable = s5pc100_clk_d12_ctrl,
445 .ctrlbit = S5PC100_CLKGATE_D12_MFC,
446 },
447
448 /* System (D1_3) devices */
449 {
450 .name = "chipid",
451 .id = -1,
452 .parent = &clk_p,
453 .enable = s5pc100_clk_d13_ctrl,
454 .ctrlbit = S5PC100_CLKGATE_D13_CHIPID,
455 }, {
456 .name = "gpio",
457 .id = -1,
458 .parent = &clk_p,
459 .enable = s5pc100_clk_d13_ctrl,
460 .ctrlbit = S5PC100_CLKGATE_D13_GPIO,
461 }, {
462 .name = "apc",
463 .id = -1,
464 .parent = &clk_p,
465 .enable = s5pc100_clk_d13_ctrl,
466 .ctrlbit = S5PC100_CLKGATE_D13_APC,
467 }, {
468 .name = "iec",
469 .id = -1,
470 .parent = &clk_p,
471 .enable = s5pc100_clk_d13_ctrl,
472 .ctrlbit = S5PC100_CLKGATE_D13_IEC,
473 }, {
474 .name = "timers",
475 .id = -1,
476 .parent = &clk_p,
477 .enable = s5pc100_clk_d13_ctrl,
478 .ctrlbit = S5PC100_CLKGATE_D13_PWM,
479 }, {
480 .name = "systimer",
481 .id = -1,
482 .parent = &clk_p,
483 .enable = s5pc100_clk_d13_ctrl,
484 .ctrlbit = S5PC100_CLKGATE_D13_SYSTIMER,
485 }, {
486 .name = "watchdog",
487 .id = -1,
488 .parent = &clk_p,
489 .enable = s5pc100_clk_d13_ctrl,
490 .ctrlbit = S5PC100_CLKGATE_D13_WDT,
491 }, {
492 .name = "rtc",
493 .id = -1,
494 .parent = &clk_p,
495 .enable = s5pc100_clk_d13_ctrl,
496 .ctrlbit = S5PC100_CLKGATE_D13_RTC,
497 },
498
499 /* Connectivity (D1_4) devices */
500 {
501 .name = "uart",
502 .id = 0,
503 .parent = &clk_p,
504 .enable = s5pc100_clk_d14_ctrl,
505 .ctrlbit = S5PC100_CLKGATE_D14_UART0,
506 }, {
507 .name = "uart",
508 .id = 1,
509 .parent = &clk_p,
510 .enable = s5pc100_clk_d14_ctrl,
511 .ctrlbit = S5PC100_CLKGATE_D14_UART1,
512 }, {
513 .name = "uart",
514 .id = 2,
515 .parent = &clk_p,
516 .enable = s5pc100_clk_d14_ctrl,
517 .ctrlbit = S5PC100_CLKGATE_D14_UART2,
518 }, {
519 .name = "uart",
520 .id = 3,
521 .parent = &clk_p,
522 .enable = s5pc100_clk_d14_ctrl,
523 .ctrlbit = S5PC100_CLKGATE_D14_UART3,
524 }, {
525 .name = "i2c",
526 .id = -1,
527 .parent = &clk_p,
528 .enable = s5pc100_clk_d14_ctrl,
529 .ctrlbit = S5PC100_CLKGATE_D14_IIC,
530 }, {
531 .name = "hdmi-i2c",
532 .id = -1,
533 .parent = &clk_p,
534 .enable = s5pc100_clk_d14_ctrl,
535 .ctrlbit = S5PC100_CLKGATE_D14_HDMI_IIC,
536 }, {
537 .name = "spi",
538 .id = 0,
539 .parent = &clk_p,
540 .enable = s5pc100_clk_d14_ctrl,
541 .ctrlbit = S5PC100_CLKGATE_D14_SPI0,
542 }, {
543 .name = "spi",
544 .id = 1,
545 .parent = &clk_p,
546 .enable = s5pc100_clk_d14_ctrl,
547 .ctrlbit = S5PC100_CLKGATE_D14_SPI1,
548 }, {
549 .name = "spi",
550 .id = 2,
551 .parent = &clk_p,
552 .enable = s5pc100_clk_d14_ctrl,
553 .ctrlbit = S5PC100_CLKGATE_D14_SPI2,
554 }, {
555 .name = "irda",
556 .id = -1,
557 .parent = &clk_p,
558 .enable = s5pc100_clk_d14_ctrl,
559 .ctrlbit = S5PC100_CLKGATE_D14_IRDA,
560 }, {
561 .name = "hsitx",
562 .id = -1,
563 .parent = &clk_p,
564 .enable = s5pc100_clk_d14_ctrl,
565 .ctrlbit = S5PC100_CLKGATE_D14_HSITX,
566 }, {
567 .name = "hsirx",
568 .id = -1,
569 .parent = &clk_p,
570 .enable = s5pc100_clk_d14_ctrl,
571 .ctrlbit = S5PC100_CLKGATE_D14_HSIRX,
572 },
573
574 /* Audio (D1_5) devices */
575 {
576 .name = "iis",
577 .id = 0,
578 .parent = &clk_p,
579 .enable = s5pc100_clk_d15_ctrl,
580 .ctrlbit = S5PC100_CLKGATE_D15_IIS0,
581 }, {
582 .name = "iis",
583 .id = 1,
584 .parent = &clk_p,
585 .enable = s5pc100_clk_d15_ctrl,
586 .ctrlbit = S5PC100_CLKGATE_D15_IIS1,
587 }, {
588 .name = "iis",
589 .id = 2,
590 .parent = &clk_p,
591 .enable = s5pc100_clk_d15_ctrl,
592 .ctrlbit = S5PC100_CLKGATE_D15_IIS2,
593 }, {
594 .name = "ac97",
595 .id = -1,
596 .parent = &clk_p,
597 .enable = s5pc100_clk_d15_ctrl,
598 .ctrlbit = S5PC100_CLKGATE_D15_AC97,
599 }, {
600 .name = "pcm",
601 .id = 0,
602 .parent = &clk_p,
603 .enable = s5pc100_clk_d15_ctrl,
604 .ctrlbit = S5PC100_CLKGATE_D15_PCM0,
605 }, {
606 .name = "pcm",
607 .id = 1,
608 .parent = &clk_p,
609 .enable = s5pc100_clk_d15_ctrl,
610 .ctrlbit = S5PC100_CLKGATE_D15_PCM1,
611 }, {
612 .name = "spdif",
613 .id = -1,
614 .parent = &clk_p,
615 .enable = s5pc100_clk_d15_ctrl,
616 .ctrlbit = S5PC100_CLKGATE_D15_SPDIF,
617 }, {
618 .name = "adc",
619 .id = -1,
620 .parent = &clk_p,
621 .enable = s5pc100_clk_d15_ctrl,
622 .ctrlbit = S5PC100_CLKGATE_D15_TSADC,
623 }, {
624 .name = "cg",
625 .id = -1,
626 .parent = &clk_p,
627 .enable = s5pc100_clk_d15_ctrl,
628 .ctrlbit = S5PC100_CLKGATE_D15_CG,
629 },
630
631 /* Audio (D2_0) devices: all disabled */
632
633 /* Special Clocks 0 */
634 {
635 .name = "sclk_hpm",
636 .id = -1,
637 .parent = NULL,
638 .enable = s5pc100_sclk0_ctrl,
639 .ctrlbit = S5PC100_CLKGATE_SCLK0_HPM,
640 }, {
641 .name = "sclk_onenand",
642 .id = -1,
643 .parent = NULL,
644 .enable = s5pc100_sclk0_ctrl,
645 .ctrlbit = S5PC100_CLKGATE_SCLK0_ONENAND,
646 }, {
647 .name = "spi_48",
648 .id = 0,
649 .parent = &clk_48m,
650 .enable = s5pc100_sclk0_ctrl,
651 .ctrlbit = S5PC100_CLKGATE_SCLK0_SPI0_48,
652 }, {
653 .name = "spi_48",
654 .id = 1,
655 .parent = &clk_48m,
656 .enable = s5pc100_sclk0_ctrl,
657 .ctrlbit = S5PC100_CLKGATE_SCLK0_SPI1_48,
658 }, {
659 .name = "spi_48",
660 .id = 2,
661 .parent = &clk_48m,
662 .enable = s5pc100_sclk0_ctrl,
663 .ctrlbit = S5PC100_CLKGATE_SCLK0_SPI2_48,
664 }, {
665 .name = "mmc_48",
666 .id = 0,
667 .parent = &clk_48m,
668 .enable = s5pc100_sclk0_ctrl,
669 .ctrlbit = S5PC100_CLKGATE_SCLK0_MMC0_48,
670 }, {
671 .name = "mmc_48",
672 .id = 1,
673 .parent = &clk_48m,
674 .enable = s5pc100_sclk0_ctrl,
675 .ctrlbit = S5PC100_CLKGATE_SCLK0_MMC1_48,
676 }, {
677 .name = "mmc_48",
678 .id = 2,
679 .parent = &clk_48m,
680 .enable = s5pc100_sclk0_ctrl,
681 .ctrlbit = S5PC100_CLKGATE_SCLK0_MMC2_48,
682 },
683 /* Special Clocks 1 */
684};
685
686static struct clk *clks[] __initdata = {
687 &clk_ext,
688 &clk_epll,
689 &clk_27m,
690 &clk_48m,
691 &clk_54m,
692};
693
694void __init s5pc1xx_register_clocks(void)
695{
696 struct clk *clkp;
697 int ret;
698 int ptr;
699 int size;
700
701 s3c24xx_register_clocks(clks, ARRAY_SIZE(clks));
702
703 clkp = s5pc100_init_clocks;
704 size = ARRAY_SIZE(s5pc100_init_clocks);
705
706 for (ptr = 0; ptr < size; ptr++, clkp++) {
707 ret = s3c24xx_register_clock(clkp);
708 if (ret < 0) {
709 printk(KERN_ERR "Failed to register clock %s (%d)\n",
710 clkp->name, ret);
711 }
712 }
713
714 clkp = s5pc100_init_clocks_disable;
715 size = ARRAY_SIZE(s5pc100_init_clocks_disable);
716
717 for (ptr = 0; ptr < size; ptr++, clkp++) {
718 ret = s3c24xx_register_clock(clkp);
719 if (ret < 0) {
720 printk(KERN_ERR "Failed to register clock %s (%d)\n",
721 clkp->name, ret);
722 }
723
724 (clkp->enable)(clkp, 0);
725 }
726
727 s3c_pwmclk_init();
728}
diff --git a/arch/arm/plat-s5pc1xx/cpu.c b/arch/arm/plat-s5pc1xx/cpu.c
index 715a7330794d..02baeaa2a121 100644
--- a/arch/arm/plat-s5pc1xx/cpu.c
+++ b/arch/arm/plat-s5pc1xx/cpu.c
@@ -55,6 +55,16 @@ static struct cpu_table cpu_ids[] __initdata = {
55 55
56static struct map_desc s5pc1xx_iodesc[] __initdata = { 56static struct map_desc s5pc1xx_iodesc[] __initdata = {
57 { 57 {
58 .virtual = (unsigned long)S5PC1XX_VA_CLK_OTHER,
59 .pfn = __phys_to_pfn(S5PC1XX_PA_CLK_OTHER),
60 .length = SZ_4K,
61 .type = MT_DEVICE,
62 }, {
63 .virtual = (unsigned long)S5PC1XX_VA_GPIO,
64 .pfn = __phys_to_pfn(S5PC100_PA_GPIO),
65 .length = SZ_4K,
66 .type = MT_DEVICE,
67 }, {
58 .virtual = (unsigned long)S5PC1XX_VA_CHIPID, 68 .virtual = (unsigned long)S5PC1XX_VA_CHIPID,
59 .pfn = __phys_to_pfn(S5PC1XX_PA_CHIPID), 69 .pfn = __phys_to_pfn(S5PC1XX_PA_CHIPID),
60 .length = SZ_16, 70 .length = SZ_16,
diff --git a/arch/arm/plat-s5pc1xx/gpio-config.c b/arch/arm/plat-s5pc1xx/gpio-config.c
new file mode 100644
index 000000000000..bba675df9c75
--- /dev/null
+++ b/arch/arm/plat-s5pc1xx/gpio-config.c
@@ -0,0 +1,62 @@
1/* linux/arch/arm/plat-s5pc1xx/gpio-config.c
2 *
3 * Copyright 2009 Samsung Electronics
4 *
5 * S5PC1XX GPIO Configuration.
6 *
7 * Based on plat-s3c64xx/gpio-config.c
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 version 2 as
11 * published by the Free Software Foundation.
12*/
13
14#include <linux/kernel.h>
15#include <linux/module.h>
16#include <linux/gpio.h>
17#include <linux/io.h>
18
19#include <mach/gpio-core.h>
20#include <plat/gpio-cfg-s5pc1xx.h>
21
22s5p_gpio_drvstr_t s5p_gpio_get_drvstr(unsigned int pin, unsigned int off)
23{
24 struct s3c_gpio_chip *chip = s3c_gpiolib_getchip(pin);
25 void __iomem *reg;
26 int shift = off * 2;
27 u32 drvstr;
28
29 if (!chip)
30 return -EINVAL;
31
32 reg = chip->base + 0x0C;
33
34 drvstr = __raw_readl(reg);
35 drvstr = 0xffff & (0x3 << shift);
36 drvstr = drvstr >> shift;
37
38 return (__force s5p_gpio_drvstr_t)drvstr;
39}
40EXPORT_SYMBOL(s5p_gpio_get_drvstr);
41
42int s5p_gpio_set_drvstr(unsigned int pin, unsigned int off,
43 s5p_gpio_drvstr_t drvstr)
44{
45 struct s3c_gpio_chip *chip = s3c_gpiolib_getchip(pin);
46 void __iomem *reg;
47 int shift = off * 2;
48 u32 tmp;
49
50 if (!chip)
51 return -EINVAL;
52
53 reg = chip->base + 0x0C;
54
55 tmp = __raw_readl(reg);
56 tmp |= drvstr << shift;
57
58 __raw_writel(tmp, reg);
59
60 return 0;
61}
62EXPORT_SYMBOL(s5p_gpio_set_drvstr);
diff --git a/arch/arm/plat-s5pc1xx/gpiolib.c b/arch/arm/plat-s5pc1xx/gpiolib.c
new file mode 100644
index 000000000000..facb410e7a71
--- /dev/null
+++ b/arch/arm/plat-s5pc1xx/gpiolib.c
@@ -0,0 +1,503 @@
1/*
2 * arch/arm/plat-s5pc1xx/gpiolib.c
3 *
4 * Copyright 2009 Samsung Electronics Co
5 * Kyungmin Park <kyungmin.park@samsung.com>
6 *
7 * S5PC1XX - GPIOlib support
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 version 2 as
11 * published by the Free Software Foundation.
12 */
13
14#include <linux/kernel.h>
15#include <linux/irq.h>
16#include <linux/io.h>
17#include <linux/gpio.h>
18
19#include <mach/map.h>
20#include <mach/gpio-core.h>
21
22#include <plat/gpio-cfg.h>
23#include <plat/gpio-cfg-helpers.h>
24#include <plat/regs-gpio.h>
25
26/* S5PC100 GPIO bank summary:
27 *
28 * Bank GPIOs Style INT Type
29 * A0 8 4Bit GPIO_INT0
30 * A1 5 4Bit GPIO_INT1
31 * B 8 4Bit GPIO_INT2
32 * C 5 4Bit GPIO_INT3
33 * D 7 4Bit GPIO_INT4
34 * E0 8 4Bit GPIO_INT5
35 * E1 6 4Bit GPIO_INT6
36 * F0 8 4Bit GPIO_INT7
37 * F1 8 4Bit GPIO_INT8
38 * F2 8 4Bit GPIO_INT9
39 * F3 4 4Bit GPIO_INT10
40 * G0 8 4Bit GPIO_INT11
41 * G1 3 4Bit GPIO_INT12
42 * G2 7 4Bit GPIO_INT13
43 * G3 7 4Bit GPIO_INT14
44 * H0 8 4Bit WKUP_INT
45 * H1 8 4Bit WKUP_INT
46 * H2 8 4Bit WKUP_INT
47 * H3 8 4Bit WKUP_INT
48 * I 8 4Bit GPIO_INT15
49 * J0 8 4Bit GPIO_INT16
50 * J1 5 4Bit GPIO_INT17
51 * J2 8 4Bit GPIO_INT18
52 * J3 8 4Bit GPIO_INT19
53 * J4 4 4Bit GPIO_INT20
54 * K0 8 4Bit None
55 * K1 6 4Bit None
56 * K2 8 4Bit None
57 * K3 8 4Bit None
58 * L0 8 4Bit None
59 * L1 8 4Bit None
60 * L2 8 4Bit None
61 * L3 8 4Bit None
62 */
63
64#define OFF_GPCON (0x00)
65#define OFF_GPDAT (0x04)
66
67#define con_4bit_shift(__off) ((__off) * 4)
68
69#if 1
70#define gpio_dbg(x...) do { } while (0)
71#else
72#define gpio_dbg(x...) printk(KERN_DEBUG x)
73#endif
74
75/* The s5pc1xx_gpiolib routines are to control the gpio banks where
76 * the gpio configuration register (GPxCON) has 4 bits per GPIO, as the
77 * following example:
78 *
79 * base + 0x00: Control register, 4 bits per gpio
80 * gpio n: 4 bits starting at (4*n)
81 * 0000 = input, 0001 = output, others mean special-function
82 * base + 0x04: Data register, 1 bit per gpio
83 * bit n: data bit n
84 *
85 * Note, since the data register is one bit per gpio and is at base + 0x4
86 * we can use s3c_gpiolib_get and s3c_gpiolib_set to change the state of
87 * the output.
88 */
89
90static int s5pc1xx_gpiolib_input(struct gpio_chip *chip, unsigned offset)
91{
92 struct s3c_gpio_chip *ourchip = to_s3c_gpio(chip);
93 void __iomem *base = ourchip->base;
94 unsigned long con;
95
96 con = __raw_readl(base + OFF_GPCON);
97 con &= ~(0xf << con_4bit_shift(offset));
98 __raw_writel(con, base + OFF_GPCON);
99
100 gpio_dbg("%s: %p: CON now %08lx\n", __func__, base, con);
101
102 return 0;
103}
104
105static int s5pc1xx_gpiolib_output(struct gpio_chip *chip,
106 unsigned offset, int value)
107{
108 struct s3c_gpio_chip *ourchip = to_s3c_gpio(chip);
109 void __iomem *base = ourchip->base;
110 unsigned long con;
111 unsigned long dat;
112
113 con = __raw_readl(base + OFF_GPCON);
114 con &= ~(0xf << con_4bit_shift(offset));
115 con |= 0x1 << con_4bit_shift(offset);
116
117 dat = __raw_readl(base + OFF_GPDAT);
118 if (value)
119 dat |= 1 << offset;
120 else
121 dat &= ~(1 << offset);
122
123 __raw_writel(dat, base + OFF_GPDAT);
124 __raw_writel(con, base + OFF_GPCON);
125 __raw_writel(dat, base + OFF_GPDAT);
126
127 gpio_dbg("%s: %p: CON %08lx, DAT %08lx\n", __func__, base, con, dat);
128
129 return 0;
130}
131
132static int s5pc1xx_gpiolib_to_irq(struct gpio_chip *chip, unsigned int offset)
133{
134 return S3C_IRQ_GPIO(chip->base + offset);
135}
136
137static int s5pc1xx_gpiolib_to_eint(struct gpio_chip *chip, unsigned int offset)
138{
139 int base;
140
141 base = chip->base - S5PC100_GPH0(0);
142 if (base == 0)
143 return IRQ_EINT(offset);
144 base = chip->base - S5PC100_GPH1(0);
145 if (base == 0)
146 return IRQ_EINT(8 + offset);
147 base = chip->base - S5PC100_GPH2(0);
148 if (base == 0)
149 return IRQ_EINT(16 + offset);
150 base = chip->base - S5PC100_GPH3(0);
151 if (base == 0)
152 return IRQ_EINT(24 + offset);
153 return -EINVAL;
154}
155
156static struct s3c_gpio_cfg gpio_cfg = {
157 .set_config = s3c_gpio_setcfg_s3c64xx_4bit,
158 .set_pull = s3c_gpio_setpull_updown,
159 .get_pull = s3c_gpio_getpull_updown,
160};
161
162static struct s3c_gpio_cfg gpio_cfg_eint = {
163 .cfg_eint = 0xf,
164 .set_config = s3c_gpio_setcfg_s3c64xx_4bit,
165 .set_pull = s3c_gpio_setpull_updown,
166 .get_pull = s3c_gpio_getpull_updown,
167};
168
169static struct s3c_gpio_cfg gpio_cfg_noint = {
170 .set_config = s3c_gpio_setcfg_s3c64xx_4bit,
171 .set_pull = s3c_gpio_setpull_updown,
172 .get_pull = s3c_gpio_getpull_updown,
173};
174
175static struct s3c_gpio_chip s5pc100_gpio_chips[] = {
176 {
177 .base = S5PC100_GPA0_BASE,
178 .config = &gpio_cfg,
179 .chip = {
180 .base = S5PC100_GPA0(0),
181 .ngpio = S5PC100_GPIO_A0_NR,
182 .label = "GPA0",
183 },
184 }, {
185 .base = S5PC100_GPA1_BASE,
186 .config = &gpio_cfg,
187 .chip = {
188 .base = S5PC100_GPA1(0),
189 .ngpio = S5PC100_GPIO_A1_NR,
190 .label = "GPA1",
191 },
192 }, {
193 .base = S5PC100_GPB_BASE,
194 .config = &gpio_cfg,
195 .chip = {
196 .base = S5PC100_GPB(0),
197 .ngpio = S5PC100_GPIO_B_NR,
198 .label = "GPB",
199 },
200 }, {
201 .base = S5PC100_GPC_BASE,
202 .config = &gpio_cfg,
203 .chip = {
204 .base = S5PC100_GPC(0),
205 .ngpio = S5PC100_GPIO_C_NR,
206 .label = "GPC",
207 },
208 }, {
209 .base = S5PC100_GPD_BASE,
210 .config = &gpio_cfg,
211 .chip = {
212 .base = S5PC100_GPD(0),
213 .ngpio = S5PC100_GPIO_D_NR,
214 .label = "GPD",
215 },
216 }, {
217 .base = S5PC100_GPE0_BASE,
218 .config = &gpio_cfg,
219 .chip = {
220 .base = S5PC100_GPE0(0),
221 .ngpio = S5PC100_GPIO_E0_NR,
222 .label = "GPE0",
223 },
224 }, {
225 .base = S5PC100_GPE1_BASE,
226 .config = &gpio_cfg,
227 .chip = {
228 .base = S5PC100_GPE1(0),
229 .ngpio = S5PC100_GPIO_E1_NR,
230 .label = "GPE1",
231 },
232 }, {
233 .base = S5PC100_GPF0_BASE,
234 .config = &gpio_cfg,
235 .chip = {
236 .base = S5PC100_GPF0(0),
237 .ngpio = S5PC100_GPIO_F0_NR,
238 .label = "GPF0",
239 },
240 }, {
241 .base = S5PC100_GPF1_BASE,
242 .config = &gpio_cfg,
243 .chip = {
244 .base = S5PC100_GPF1(0),
245 .ngpio = S5PC100_GPIO_F1_NR,
246 .label = "GPF1",
247 },
248 }, {
249 .base = S5PC100_GPF2_BASE,
250 .config = &gpio_cfg,
251 .chip = {
252 .base = S5PC100_GPF2(0),
253 .ngpio = S5PC100_GPIO_F2_NR,
254 .label = "GPF2",
255 },
256 }, {
257 .base = S5PC100_GPF3_BASE,
258 .config = &gpio_cfg,
259 .chip = {
260 .base = S5PC100_GPF3(0),
261 .ngpio = S5PC100_GPIO_F3_NR,
262 .label = "GPF3",
263 },
264 }, {
265 .base = S5PC100_GPG0_BASE,
266 .config = &gpio_cfg,
267 .chip = {
268 .base = S5PC100_GPG0(0),
269 .ngpio = S5PC100_GPIO_G0_NR,
270 .label = "GPG0",
271 },
272 }, {
273 .base = S5PC100_GPG1_BASE,
274 .config = &gpio_cfg,
275 .chip = {
276 .base = S5PC100_GPG1(0),
277 .ngpio = S5PC100_GPIO_G1_NR,
278 .label = "GPG1",
279 },
280 }, {
281 .base = S5PC100_GPG2_BASE,
282 .config = &gpio_cfg,
283 .chip = {
284 .base = S5PC100_GPG2(0),
285 .ngpio = S5PC100_GPIO_G2_NR,
286 .label = "GPG2",
287 },
288 }, {
289 .base = S5PC100_GPG3_BASE,
290 .config = &gpio_cfg,
291 .chip = {
292 .base = S5PC100_GPG3(0),
293 .ngpio = S5PC100_GPIO_G3_NR,
294 .label = "GPG3",
295 },
296 }, {
297 .base = S5PC100_GPH0_BASE,
298 .config = &gpio_cfg_eint,
299 .chip = {
300 .base = S5PC100_GPH0(0),
301 .ngpio = S5PC100_GPIO_H0_NR,
302 .label = "GPH0",
303 },
304 }, {
305 .base = S5PC100_GPH1_BASE,
306 .config = &gpio_cfg_eint,
307 .chip = {
308 .base = S5PC100_GPH1(0),
309 .ngpio = S5PC100_GPIO_H1_NR,
310 .label = "GPH1",
311 },
312 }, {
313 .base = S5PC100_GPH2_BASE,
314 .config = &gpio_cfg_eint,
315 .chip = {
316 .base = S5PC100_GPH2(0),
317 .ngpio = S5PC100_GPIO_H2_NR,
318 .label = "GPH2",
319 },
320 }, {
321 .base = S5PC100_GPH3_BASE,
322 .config = &gpio_cfg_eint,
323 .chip = {
324 .base = S5PC100_GPH3(0),
325 .ngpio = S5PC100_GPIO_H3_NR,
326 .label = "GPH3",
327 },
328 }, {
329 .base = S5PC100_GPI_BASE,
330 .config = &gpio_cfg,
331 .chip = {
332 .base = S5PC100_GPI(0),
333 .ngpio = S5PC100_GPIO_I_NR,
334 .label = "GPI",
335 },
336 }, {
337 .base = S5PC100_GPJ0_BASE,
338 .config = &gpio_cfg,
339 .chip = {
340 .base = S5PC100_GPJ0(0),
341 .ngpio = S5PC100_GPIO_J0_NR,
342 .label = "GPJ0",
343 },
344 }, {
345 .base = S5PC100_GPJ1_BASE,
346 .config = &gpio_cfg,
347 .chip = {
348 .base = S5PC100_GPJ1(0),
349 .ngpio = S5PC100_GPIO_J1_NR,
350 .label = "GPJ1",
351 },
352 }, {
353 .base = S5PC100_GPJ2_BASE,
354 .config = &gpio_cfg,
355 .chip = {
356 .base = S5PC100_GPJ2(0),
357 .ngpio = S5PC100_GPIO_J2_NR,
358 .label = "GPJ2",
359 },
360 }, {
361 .base = S5PC100_GPJ3_BASE,
362 .config = &gpio_cfg,
363 .chip = {
364 .base = S5PC100_GPJ3(0),
365 .ngpio = S5PC100_GPIO_J3_NR,
366 .label = "GPJ3",
367 },
368 }, {
369 .base = S5PC100_GPJ4_BASE,
370 .config = &gpio_cfg,
371 .chip = {
372 .base = S5PC100_GPJ4(0),
373 .ngpio = S5PC100_GPIO_J4_NR,
374 .label = "GPJ4",
375 },
376 }, {
377 .base = S5PC100_GPK0_BASE,
378 .config = &gpio_cfg_noint,
379 .chip = {
380 .base = S5PC100_GPK0(0),
381 .ngpio = S5PC100_GPIO_K0_NR,
382 .label = "GPK0",
383 },
384 }, {
385 .base = S5PC100_GPK1_BASE,
386 .config = &gpio_cfg_noint,
387 .chip = {
388 .base = S5PC100_GPK1(0),
389 .ngpio = S5PC100_GPIO_K1_NR,
390 .label = "GPK1",
391 },
392 }, {
393 .base = S5PC100_GPK2_BASE,
394 .config = &gpio_cfg_noint,
395 .chip = {
396 .base = S5PC100_GPK2(0),
397 .ngpio = S5PC100_GPIO_K2_NR,
398 .label = "GPK2",
399 },
400 }, {
401 .base = S5PC100_GPK3_BASE,
402 .config = &gpio_cfg_noint,
403 .chip = {
404 .base = S5PC100_GPK3(0),
405 .ngpio = S5PC100_GPIO_K3_NR,
406 .label = "GPK3",
407 },
408 }, {
409 .base = S5PC100_GPL0_BASE,
410 .config = &gpio_cfg_noint,
411 .chip = {
412 .base = S5PC100_GPL0(0),
413 .ngpio = S5PC100_GPIO_L0_NR,
414 .label = "GPL0",
415 },
416 }, {
417 .base = S5PC100_GPL1_BASE,
418 .config = &gpio_cfg_noint,
419 .chip = {
420 .base = S5PC100_GPL1(0),
421 .ngpio = S5PC100_GPIO_L1_NR,
422 .label = "GPL1",
423 },
424 }, {
425 .base = S5PC100_GPL2_BASE,
426 .config = &gpio_cfg_noint,
427 .chip = {
428 .base = S5PC100_GPL2(0),
429 .ngpio = S5PC100_GPIO_L2_NR,
430 .label = "GPL2",
431 },
432 }, {
433 .base = S5PC100_GPL3_BASE,
434 .config = &gpio_cfg_noint,
435 .chip = {
436 .base = S5PC100_GPL3(0),
437 .ngpio = S5PC100_GPIO_L3_NR,
438 .label = "GPL3",
439 },
440 }, {
441 .base = S5PC100_GPL4_BASE,
442 .config = &gpio_cfg_noint,
443 .chip = {
444 .base = S5PC100_GPL4(0),
445 .ngpio = S5PC100_GPIO_L4_NR,
446 .label = "GPL4",
447 },
448 },
449};
450
451/* FIXME move from irq-gpio.c */
452extern struct irq_chip s5pc1xx_gpioint;
453extern void s5pc1xx_irq_gpioint_handler(unsigned int irq, struct irq_desc *desc);
454
455static __init void s5pc1xx_gpiolib_link(struct s3c_gpio_chip *chip)
456{
457 chip->chip.direction_input = s5pc1xx_gpiolib_input;
458 chip->chip.direction_output = s5pc1xx_gpiolib_output;
459 chip->pm = __gpio_pm(&s3c_gpio_pm_4bit);
460
461 /* Interrupt */
462 if (chip->config == &gpio_cfg) {
463 int i, irq;
464
465 chip->chip.to_irq = s5pc1xx_gpiolib_to_irq;
466
467 for (i = 0; i < chip->chip.ngpio; i++) {
468 irq = S3C_IRQ_GPIO_BASE + chip->chip.base + i;
469 set_irq_chip(irq, &s5pc1xx_gpioint);
470 set_irq_data(irq, &chip->chip);
471 set_irq_handler(irq, handle_level_irq);
472 set_irq_flags(irq, IRQF_VALID);
473 }
474 } else if (chip->config == &gpio_cfg_eint)
475 chip->chip.to_irq = s5pc1xx_gpiolib_to_eint;
476}
477
478static __init void s5pc1xx_gpiolib_add(struct s3c_gpio_chip *chips,
479 int nr_chips,
480 void (*fn)(struct s3c_gpio_chip *))
481{
482 for (; nr_chips > 0; nr_chips--, chips++) {
483 if (fn)
484 (fn)(chips);
485 s3c_gpiolib_add(chips);
486 }
487}
488
489static __init int s5pc1xx_gpiolib_init(void)
490{
491 struct s3c_gpio_chip *chips;
492 int nr_chips;
493
494 chips = s5pc100_gpio_chips;
495 nr_chips = ARRAY_SIZE(s5pc100_gpio_chips);
496
497 s5pc1xx_gpiolib_add(chips, nr_chips, s5pc1xx_gpiolib_link);
498 /* Interrupt */
499 set_irq_chained_handler(IRQ_GPIOINT, s5pc1xx_irq_gpioint_handler);
500
501 return 0;
502}
503core_initcall(s5pc1xx_gpiolib_init);
diff --git a/arch/arm/plat-s5pc1xx/include/plat/gpio-cfg-s5pc1xx.h b/arch/arm/plat-s5pc1xx/include/plat/gpio-cfg-s5pc1xx.h
new file mode 100644
index 000000000000..72ad59f61efc
--- /dev/null
+++ b/arch/arm/plat-s5pc1xx/include/plat/gpio-cfg-s5pc1xx.h
@@ -0,0 +1,32 @@
1/* linux/arch/arm/plat-s5pc1xx/include/plat/gpio-cfg.h
2 *
3 * Copyright 2009 Samsung Electronic
4 *
5 * S5PC1XX Platform - GPIO pin configuration
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10*/
11
12/* This file contains the necessary definitions to get the basic gpio
13 * pin configuration done such as setting a pin to input or output or
14 * changing the pull-{up,down} configurations.
15 */
16
17#ifndef __GPIO_CFG_S5PC1XX_H
18#define __GPIO_CFG_S5PC1XX_H __FILE__
19
20typedef unsigned int __bitwise__ s5p_gpio_drvstr_t;
21
22#define S5P_GPIO_DRVSTR_LV1 0x00
23#define S5P_GPIO_DRVSTR_LV2 0x01
24#define S5P_GPIO_DRVSTR_LV3 0x10
25#define S5P_GPIO_DRVSTR_LV4 0x11
26
27extern s5p_gpio_drvstr_t s5p_gpio_get_drvstr(unsigned int pin, unsigned int off);
28
29extern int s5p_gpio_set_drvstr(unsigned int pin, unsigned int off,
30 s5p_gpio_drvstr_t drvstr);
31
32#endif /* __GPIO_CFG_S5PC1XX_H */
diff --git a/arch/arm/plat-s5pc1xx/include/plat/gpio-ext.h b/arch/arm/plat-s5pc1xx/include/plat/gpio-ext.h
new file mode 100644
index 000000000000..33ad267e8477
--- /dev/null
+++ b/arch/arm/plat-s5pc1xx/include/plat/gpio-ext.h
@@ -0,0 +1,44 @@
1/* linux/arch/arm/plat-s5pc1xx/include/plat/gpio-eint.h
2 *
3 * Copyright 2009 Samsung Electronics Co.
4 *
5 * External Interrupt (GPH0 ~ GPH3) control register definitions
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10*/
11
12#define S5PC1XX_WKUP_INT_CON0_7 (S5PC1XX_EINT_BASE + 0x0)
13#define S5PC1XX_WKUP_INT_CON8_15 (S5PC1XX_EINT_BASE + 0x4)
14#define S5PC1XX_WKUP_INT_CON16_23 (S5PC1XX_EINT_BASE + 0x8)
15#define S5PC1XX_WKUP_INT_CON24_31 (S5PC1XX_EINT_BASE + 0xC)
16#define S5PC1XX_WKUP_INT_CON(x) (S5PC1XX_WKUP_INT_CON0_7 + (x * 0x4))
17
18#define S5PC1XX_WKUP_INT_FLTCON0_3 (S5PC1XX_EINT_BASE + 0x80)
19#define S5PC1XX_WKUP_INT_FLTCON4_7 (S5PC1XX_EINT_BASE + 0x84)
20#define S5PC1XX_WKUP_INT_FLTCON8_11 (S5PC1XX_EINT_BASE + 0x88)
21#define S5PC1XX_WKUP_INT_FLTCON12_15 (S5PC1XX_EINT_BASE + 0x8C)
22#define S5PC1XX_WKUP_INT_FLTCON16_19 (S5PC1XX_EINT_BASE + 0x90)
23#define S5PC1XX_WKUP_INT_FLTCON20_23 (S5PC1XX_EINT_BASE + 0x94)
24#define S5PC1XX_WKUP_INT_FLTCON24_27 (S5PC1XX_EINT_BASE + 0x98)
25#define S5PC1XX_WKUP_INT_FLTCON28_31 (S5PC1XX_EINT_BASE + 0x9C)
26#define S5PC1XX_WKUP_INT_FLTCON(x) (S5PC1XX_WKUP_INT_FLTCON0_3 + (x * 0x4))
27
28#define S5PC1XX_WKUP_INT_MASK0_7 (S5PC1XX_EINT_BASE + 0x100)
29#define S5PC1XX_WKUP_INT_MASK8_15 (S5PC1XX_EINT_BASE + 0x104)
30#define S5PC1XX_WKUP_INT_MASK16_23 (S5PC1XX_EINT_BASE + 0x108)
31#define S5PC1XX_WKUP_INT_MASK24_31 (S5PC1XX_EINT_BASE + 0x10C)
32#define S5PC1XX_WKUP_INT_MASK(x) (S5PC1XX_WKUP_INT_MASK0_7 + (x * 0x4))
33
34#define S5PC1XX_WKUP_INT_PEND0_7 (S5PC1XX_EINT_BASE + 0x140)
35#define S5PC1XX_WKUP_INT_PEND8_15 (S5PC1XX_EINT_BASE + 0x144)
36#define S5PC1XX_WKUP_INT_PEND16_23 (S5PC1XX_EINT_BASE + 0x148)
37#define S5PC1XX_WKUP_INT_PEND24_31 (S5PC1XX_EINT_BASE + 0x14C)
38#define S5PC1XX_WKUP_INT_PEND(x) (S5PC1XX_WKUP_INT_PEND0_7 + (x * 0x4))
39
40#define S5PC1XX_WKUP_INT_LOWLEV (0x00)
41#define S5PC1XX_WKUP_INT_HILEV (0x01)
42#define S5PC1XX_WKUP_INT_FALLEDGE (0x02)
43#define S5PC1XX_WKUP_INT_RISEEDGE (0x03)
44#define S5PC1XX_WKUP_INT_BOTHEDGE (0x04)
diff --git a/arch/arm/plat-s5pc1xx/include/plat/irqs.h b/arch/arm/plat-s5pc1xx/include/plat/irqs.h
index f07d8c3b25d6..ef8736366f0d 100644
--- a/arch/arm/plat-s5pc1xx/include/plat/irqs.h
+++ b/arch/arm/plat-s5pc1xx/include/plat/irqs.h
@@ -171,12 +171,21 @@
171#define IRQ_SDMIRQ S5PC1XX_IRQ_VIC2(30) 171#define IRQ_SDMIRQ S5PC1XX_IRQ_VIC2(30)
172#define IRQ_SDMFIQ S5PC1XX_IRQ_VIC2(31) 172#define IRQ_SDMFIQ S5PC1XX_IRQ_VIC2(31)
173 173
174/* External interrupt */
174#define S3C_IRQ_EINT_BASE (IRQ_SDMFIQ + 1) 175#define S3C_IRQ_EINT_BASE (IRQ_SDMFIQ + 1)
175 176
176#define S3C_EINT(x) ((x) + S3C_IRQ_EINT_BASE) 177#define S3C_EINT(x) (S3C_IRQ_EINT_BASE + (x - 16))
177#define IRQ_EINT(x) S3C_EINT(x) 178#define IRQ_EINT(x) (x < 16 ? IRQ_EINT0 + x : S3C_EINT(x))
179#define IRQ_EINT_BIT(x) (x < IRQ_EINT16_31 ? x - IRQ_EINT0 : x - S3C_EINT(0))
178 180
179#define NR_IRQS (IRQ_EINT(31)+1) 181/* GPIO interrupt */
182#define S3C_IRQ_GPIO_BASE (IRQ_EINT(31) + 1)
183#define S3C_IRQ_GPIO(x) (S3C_IRQ_GPIO_BASE + (x))
184
185/*
186 * Until MP04 Groups -> 40 (exactly 39) Groups * 8 ~= 320 GPIOs
187 */
188#define NR_IRQS (S3C_IRQ_GPIO(320) + 1)
180 189
181#endif /* __ASM_PLAT_S5PC1XX_IRQS_H */ 190#endif /* __ASM_PLAT_S5PC1XX_IRQS_H */
182 191
diff --git a/arch/arm/plat-s5pc1xx/include/plat/regs-clock.h b/arch/arm/plat-s5pc1xx/include/plat/regs-clock.h
index 75c8390cb827..c5cc86e92d65 100644
--- a/arch/arm/plat-s5pc1xx/include/plat/regs-clock.h
+++ b/arch/arm/plat-s5pc1xx/include/plat/regs-clock.h
@@ -13,68 +13,69 @@
13#ifndef __PLAT_REGS_CLOCK_H 13#ifndef __PLAT_REGS_CLOCK_H
14#define __PLAT_REGS_CLOCK_H __FILE__ 14#define __PLAT_REGS_CLOCK_H __FILE__
15 15
16#define S5PC1XX_CLKREG(x) (S5PC1XX_VA_CLK + (x)) 16#define S5PC100_CLKREG(x) (S5PC1XX_VA_CLK + (x))
17 17#define S5PC100_CLKREG_OTHER(x) (S5PC1XX_VA_CLK_OTHER + (x))
18#define S5PC1XX_APLL_LOCK S5PC1XX_CLKREG(0x00) 18
19#define S5PC1XX_MPLL_LOCK S5PC1XX_CLKREG(0x04) 19/* s5pc100 register for clock */
20#define S5PC1XX_EPLL_LOCK S5PC1XX_CLKREG(0x08) 20#define S5PC100_APLL_LOCK S5PC100_CLKREG(0x00)
21#define S5PC100_HPLL_LOCK S5PC1XX_CLKREG(0x0C) 21#define S5PC100_MPLL_LOCK S5PC100_CLKREG(0x04)
22 22#define S5PC100_EPLL_LOCK S5PC100_CLKREG(0x08)
23#define S5PC1XX_APLL_CON S5PC1XX_CLKREG(0x100) 23#define S5PC100_HPLL_LOCK S5PC100_CLKREG(0x0C)
24#define S5PC1XX_MPLL_CON S5PC1XX_CLKREG(0x104) 24
25#define S5PC1XX_EPLL_CON S5PC1XX_CLKREG(0x108) 25#define S5PC100_APLL_CON S5PC100_CLKREG(0x100)
26#define S5PC100_HPLL_CON S5PC1XX_CLKREG(0x10C) 26#define S5PC100_MPLL_CON S5PC100_CLKREG(0x104)
27 27#define S5PC100_EPLL_CON S5PC100_CLKREG(0x108)
28#define S5PC1XX_CLK_SRC0 S5PC1XX_CLKREG(0x200) 28#define S5PC100_HPLL_CON S5PC100_CLKREG(0x10C)
29#define S5PC1XX_CLK_SRC1 S5PC1XX_CLKREG(0x204) 29
30#define S5PC1XX_CLK_SRC2 S5PC1XX_CLKREG(0x208) 30#define S5PC100_CLKSRC0 S5PC100_CLKREG(0x200)
31#define S5PC1XX_CLK_SRC3 S5PC1XX_CLKREG(0x20C) 31#define S5PC100_CLKSRC1 S5PC100_CLKREG(0x204)
32 32#define S5PC100_CLKSRC2 S5PC100_CLKREG(0x208)
33#define S5PC1XX_CLK_DIV0 S5PC1XX_CLKREG(0x300) 33#define S5PC100_CLKSRC3 S5PC100_CLKREG(0x20C)
34#define S5PC1XX_CLK_DIV1 S5PC1XX_CLKREG(0x304) 34
35#define S5PC1XX_CLK_DIV2 S5PC1XX_CLKREG(0x308) 35#define S5PC100_CLKDIV0 S5PC100_CLKREG(0x300)
36#define S5PC1XX_CLK_DIV3 S5PC1XX_CLKREG(0x30C) 36#define S5PC100_CLKDIV1 S5PC100_CLKREG(0x304)
37#define S5PC1XX_CLK_DIV4 S5PC1XX_CLKREG(0x310) 37#define S5PC100_CLKDIV2 S5PC100_CLKREG(0x308)
38 38#define S5PC100_CLKDIV3 S5PC100_CLKREG(0x30C)
39#define S5PC100_CLK_OUT S5PC1XX_CLKREG(0x400) 39#define S5PC100_CLKDIV4 S5PC100_CLKREG(0x310)
40 40
41#define S5PC100_CLKGATE_D00 S5PC1XX_CLKREG(0x500) 41#define S5PC100_CLK_OUT S5PC100_CLKREG(0x400)
42#define S5PC100_CLKGATE_D01 S5PC1XX_CLKREG(0x504) 42
43#define S5PC100_CLKGATE_D02 S5PC1XX_CLKREG(0x508) 43#define S5PC100_CLKGATE_D00 S5PC100_CLKREG(0x500)
44 44#define S5PC100_CLKGATE_D01 S5PC100_CLKREG(0x504)
45#define S5PC100_CLKGATE_D10 S5PC1XX_CLKREG(0x520) 45#define S5PC100_CLKGATE_D02 S5PC100_CLKREG(0x508)
46#define S5PC100_CLKGATE_D11 S5PC1XX_CLKREG(0x524) 46
47#define S5PC100_CLKGATE_D12 S5PC1XX_CLKREG(0x528) 47#define S5PC100_CLKGATE_D10 S5PC100_CLKREG(0x520)
48#define S5PC100_CLKGATE_D13 S5PC1XX_CLKREG(0x52C) 48#define S5PC100_CLKGATE_D11 S5PC100_CLKREG(0x524)
49#define S5PC100_CLKGATE_D14 S5PC1XX_CLKREG(0x530) 49#define S5PC100_CLKGATE_D12 S5PC100_CLKREG(0x528)
50#define S5PC100_CLKGATE_D15 S5PC1XX_CLKREG(0x534) 50#define S5PC100_CLKGATE_D13 S5PC100_CLKREG(0x52C)
51 51#define S5PC100_CLKGATE_D14 S5PC100_CLKREG(0x530)
52#define S5PC100_CLKGATE_D20 S5PC1XX_CLKREG(0x540) 52#define S5PC100_CLKGATE_D15 S5PC100_CLKREG(0x534)
53 53
54#define S5PC100_SCLKGATE0 S5PC1XX_CLKREG(0x560) 54#define S5PC100_CLKGATE_D20 S5PC100_CLKREG(0x540)
55#define S5PC100_SCLKGATE1 S5PC1XX_CLKREG(0x564) 55
56 56#define S5PC100_SCLKGATE0 S5PC100_CLKREG(0x560)
57#define S5PC100_OTHERS S5PC1XX_CLKREG(0x8200) 57#define S5PC100_SCLKGATE1 S5PC100_CLKREG(0x564)
58 58
59#define S5PC1XX_EPLL_EN (1<<31) 59/* EPLL_CON */
60#define S5PC1XX_EPLL_MASK 0xffffffff 60#define S5PC100_EPLL_EN (1<<31)
61#define S5PC1XX_EPLLVAL(_m, _p, _s) ((_m) << 16 | ((_p) << 8) | ((_s))) 61#define S5PC100_EPLL_MASK 0xffffffff
62#define S5PC100_EPLLVAL(_m, _p, _s) ((_m) << 16 | ((_p) << 8) | ((_s)))
62 63
63/* CLKSRC0 */ 64/* CLKSRC0 */
64#define S5PC1XX_CLKSRC0_APLL_MASK (0x1<<0) 65#define S5PC100_CLKSRC0_APLL_MASK (0x1<<0)
65#define S5PC1XX_CLKSRC0_APLL_SHIFT (0) 66#define S5PC100_CLKSRC0_APLL_SHIFT (0)
66#define S5PC1XX_CLKSRC0_MPLL_MASK (0x1<<4) 67#define S5PC100_CLKSRC0_MPLL_MASK (0x1<<4)
67#define S5PC1XX_CLKSRC0_MPLL_SHIFT (4) 68#define S5PC100_CLKSRC0_MPLL_SHIFT (4)
68#define S5PC1XX_CLKSRC0_EPLL_MASK (0x1<<8) 69#define S5PC100_CLKSRC0_EPLL_MASK (0x1<<8)
69#define S5PC1XX_CLKSRC0_EPLL_SHIFT (8) 70#define S5PC100_CLKSRC0_EPLL_SHIFT (8)
70#define S5PC100_CLKSRC0_HPLL_MASK (0x1<<12) 71#define S5PC100_CLKSRC0_HPLL_MASK (0x1<<12)
71#define S5PC100_CLKSRC0_HPLL_SHIFT (12) 72#define S5PC100_CLKSRC0_HPLL_SHIFT (12)
72#define S5PC100_CLKSRC0_AMMUX_MASK (0x1<<16) 73#define S5PC100_CLKSRC0_AMMUX_MASK (0x1<<16)
73#define S5PC100_CLKSRC0_AMMUX_SHIFT (16) 74#define S5PC100_CLKSRC0_AMMUX_SHIFT (16)
74#define S5PC100_CLKSRC0_HREF_MASK (0x1<<20) 75#define S5PC100_CLKSRC0_HREF_MASK (0x1<<20)
75#define S5PC100_CLKSRC0_HREF_SHIFT (20) 76#define S5PC100_CLKSRC0_HREF_SHIFT (20)
76#define S5PC1XX_CLKSRC0_ONENAND_MASK (0x1<<24) 77#define S5PC100_CLKSRC0_ONENAND_MASK (0x1<<24)
77#define S5PC1XX_CLKSRC0_ONENAND_SHIFT (24) 78#define S5PC100_CLKSRC0_ONENAND_SHIFT (24)
78 79
79 80
80/* CLKSRC1 */ 81/* CLKSRC1 */
@@ -127,10 +128,9 @@
127#define S5PC100_CLKSRC3_SPDIF_MASK (0x3<<24) 128#define S5PC100_CLKSRC3_SPDIF_MASK (0x3<<24)
128#define S5PC100_CLKSRC3_SPDIF_SHIFT (24) 129#define S5PC100_CLKSRC3_SPDIF_SHIFT (24)
129 130
130
131/* CLKDIV0 */ 131/* CLKDIV0 */
132#define S5PC1XX_CLKDIV0_APLL_MASK (0x1<<0) 132#define S5PC100_CLKDIV0_APLL_MASK (0x1<<0)
133#define S5PC1XX_CLKDIV0_APLL_SHIFT (0) 133#define S5PC100_CLKDIV0_APLL_SHIFT (0)
134#define S5PC100_CLKDIV0_ARM_MASK (0x7<<4) 134#define S5PC100_CLKDIV0_ARM_MASK (0x7<<4)
135#define S5PC100_CLKDIV0_ARM_SHIFT (4) 135#define S5PC100_CLKDIV0_ARM_SHIFT (4)
136#define S5PC100_CLKDIV0_D0_MASK (0x7<<8) 136#define S5PC100_CLKDIV0_D0_MASK (0x7<<8)
@@ -141,8 +141,8 @@
141#define S5PC100_CLKDIV0_SECSS_SHIFT (16) 141#define S5PC100_CLKDIV0_SECSS_SHIFT (16)
142 142
143/* CLKDIV1 */ 143/* CLKDIV1 */
144#define S5PC100_CLKDIV1_AM_MASK (0x7<<0) 144#define S5PC100_CLKDIV1_APLL2_MASK (0x7<<0)
145#define S5PC100_CLKDIV1_AM_SHIFT (0) 145#define S5PC100_CLKDIV1_APLL2_SHIFT (0)
146#define S5PC100_CLKDIV1_MPLL_MASK (0x3<<4) 146#define S5PC100_CLKDIV1_MPLL_MASK (0x3<<4)
147#define S5PC100_CLKDIV1_MPLL_SHIFT (4) 147#define S5PC100_CLKDIV1_MPLL_SHIFT (4)
148#define S5PC100_CLKDIV1_MPLL2_MASK (0x1<<8) 148#define S5PC100_CLKDIV1_MPLL2_MASK (0x1<<8)
@@ -202,7 +202,6 @@
202#define S5PC100_CLKDIV4_AUDIO2_MASK (0xf<<20) 202#define S5PC100_CLKDIV4_AUDIO2_MASK (0xf<<20)
203#define S5PC100_CLKDIV4_AUDIO2_SHIFT (20) 203#define S5PC100_CLKDIV4_AUDIO2_SHIFT (20)
204 204
205
206/* HCLKD0/PCLKD0 Clock Gate 0 Registers */ 205/* HCLKD0/PCLKD0 Clock Gate 0 Registers */
207#define S5PC100_CLKGATE_D00_INTC (1<<0) 206#define S5PC100_CLKGATE_D00_INTC (1<<0)
208#define S5PC100_CLKGATE_D00_TZIC (1<<1) 207#define S5PC100_CLKGATE_D00_TZIC (1<<1)
@@ -295,8 +294,8 @@
295#define S5PC100_CLKGATE_D20_I2SD2 (1<<1) 294#define S5PC100_CLKGATE_D20_I2SD2 (1<<1)
296 295
297/* Special Clock Gate 0 Registers */ 296/* Special Clock Gate 0 Registers */
298#define S5PC1XX_CLKGATE_SCLK0_HPM (1<<0) 297#define S5PC100_CLKGATE_SCLK0_HPM (1<<0)
299#define S5PC1XX_CLKGATE_SCLK0_PWI (1<<1) 298#define S5PC100_CLKGATE_SCLK0_PWI (1<<1)
300#define S5PC100_CLKGATE_SCLK0_ONENAND (1<<2) 299#define S5PC100_CLKGATE_SCLK0_ONENAND (1<<2)
301#define S5PC100_CLKGATE_SCLK0_UART (1<<3) 300#define S5PC100_CLKGATE_SCLK0_UART (1<<3)
302#define S5PC100_CLKGATE_SCLK0_SPI0 (1<<4) 301#define S5PC100_CLKGATE_SCLK0_SPI0 (1<<4)
@@ -329,89 +328,28 @@
329#define S5PC100_CLKGATE_SCLK1_SPDIF (1<<11) 328#define S5PC100_CLKGATE_SCLK1_SPDIF (1<<11)
330#define S5PC100_CLKGATE_SCLK1_CAM (1<<12) 329#define S5PC100_CLKGATE_SCLK1_CAM (1<<12)
331 330
332/* register for power management */ 331#define S5PC100_SWRESET S5PC100_CLKREG_OTHER(0x000)
333#define S5PC100_PWR_CFG S5PC1XX_CLKREG(0x8000) 332#define S5PC100_OND_SWRESET S5PC100_CLKREG_OTHER(0x008)
334#define S5PC100_EINT_WAKEUP_MASK S5PC1XX_CLKREG(0x8004) 333#define S5PC100_GEN_CTRL S5PC100_CLKREG_OTHER(0x100)
335#define S5PC100_NORMAL_CFG S5PC1XX_CLKREG(0x8010) 334#define S5PC100_GEN_STATUS S5PC100_CLKREG_OTHER(0x104)
336#define S5PC100_STOP_CFG S5PC1XX_CLKREG(0x8014) 335#define S5PC100_MEM_SYS_CFG S5PC100_CLKREG_OTHER(0x200)
337#define S5PC100_SLEEP_CFG S5PC1XX_CLKREG(0x8018) 336#define S5PC100_CAM_MUX_SEL S5PC100_CLKREG_OTHER(0x300)
338#define S5PC100_STOP_MEM_CFG S5PC1XX_CLKREG(0x801C) 337#define S5PC100_MIXER_OUT_SEL S5PC100_CLKREG_OTHER(0x304)
339#define S5PC100_OSC_FREQ S5PC1XX_CLKREG(0x8100) 338#define S5PC100_LPMP_MODE_SEL S5PC100_CLKREG_OTHER(0x308)
340#define S5PC100_OSC_STABLE S5PC1XX_CLKREG(0x8104) 339#define S5PC100_MIPI_PHY_CON0 S5PC100_CLKREG_OTHER(0x400)
341#define S5PC100_PWR_STABLE S5PC1XX_CLKREG(0x8108) 340#define S5PC100_MIPI_PHY_CON1 S5PC100_CLKREG_OTHER(0x414)
342#define S5PC100_MTC_STABLE S5PC1XX_CLKREG(0x8110) 341#define S5PC100_HDMI_PHY_CON0 S5PC100_CLKREG_OTHER(0x420)
343#define S5PC100_CLAMP_STABLE S5PC1XX_CLKREG(0x8114) 342
344#define S5PC100_OTHERS S5PC1XX_CLKREG(0x8200) 343#define S5PC100_SWRESET_RESETVAL 0xc100
345#define S5PC100_RST_STAT S5PC1XX_CLKREG(0x8300)
346#define S5PC100_WAKEUP_STAT S5PC1XX_CLKREG(0x8304)
347#define S5PC100_BLK_PWR_STAT S5PC1XX_CLKREG(0x8308)
348#define S5PC100_INFORM0 S5PC1XX_CLKREG(0x8400)
349#define S5PC100_INFORM1 S5PC1XX_CLKREG(0x8404)
350#define S5PC100_INFORM2 S5PC1XX_CLKREG(0x8408)
351#define S5PC100_INFORM3 S5PC1XX_CLKREG(0x840C)
352#define S5PC100_INFORM4 S5PC1XX_CLKREG(0x8410)
353#define S5PC100_INFORM5 S5PC1XX_CLKREG(0x8414)
354#define S5PC100_INFORM6 S5PC1XX_CLKREG(0x8418)
355#define S5PC100_INFORM7 S5PC1XX_CLKREG(0x841C)
356#define S5PC100_DCGIDX_MAP0 S5PC1XX_CLKREG(0x8500)
357#define S5PC100_DCGIDX_MAP1 S5PC1XX_CLKREG(0x8504)
358#define S5PC100_DCGIDX_MAP2 S5PC1XX_CLKREG(0x8508)
359#define S5PC100_DCGPERF_MAP0 S5PC1XX_CLKREG(0x850C)
360#define S5PC100_DCGPERF_MAP1 S5PC1XX_CLKREG(0x8510)
361#define S5PC100_DVCIDX_MAP S5PC1XX_CLKREG(0x8514)
362#define S5PC100_FREQ_CPU S5PC1XX_CLKREG(0x8518)
363#define S5PC100_FREQ_DPM S5PC1XX_CLKREG(0x851C)
364#define S5PC100_DVSEMCLK_EN S5PC1XX_CLKREG(0x8520)
365#define S5PC100_APLL_CON_L8 S5PC1XX_CLKREG(0x8600)
366#define S5PC100_APLL_CON_L7 S5PC1XX_CLKREG(0x8604)
367#define S5PC100_APLL_CON_L6 S5PC1XX_CLKREG(0x8608)
368#define S5PC100_APLL_CON_L5 S5PC1XX_CLKREG(0x860C)
369#define S5PC100_APLL_CON_L4 S5PC1XX_CLKREG(0x8610)
370#define S5PC100_APLL_CON_L3 S5PC1XX_CLKREG(0x8614)
371#define S5PC100_APLL_CON_L2 S5PC1XX_CLKREG(0x8618)
372#define S5PC100_APLL_CON_L1 S5PC1XX_CLKREG(0x861C)
373#define S5PC100_IEM_CONTROL S5PC1XX_CLKREG(0x8620)
374#define S5PC100_CLKDIV_IEM_L8 S5PC1XX_CLKREG(0x8700)
375#define S5PC100_CLKDIV_IEM_L7 S5PC1XX_CLKREG(0x8704)
376#define S5PC100_CLKDIV_IEM_L6 S5PC1XX_CLKREG(0x8708)
377#define S5PC100_CLKDIV_IEM_L5 S5PC1XX_CLKREG(0x870C)
378#define S5PC100_CLKDIV_IEM_L4 S5PC1XX_CLKREG(0x8710)
379#define S5PC100_CLKDIV_IEM_L3 S5PC1XX_CLKREG(0x8714)
380#define S5PC100_CLKDIV_IEM_L2 S5PC1XX_CLKREG(0x8718)
381#define S5PC100_CLKDIV_IEM_L1 S5PC1XX_CLKREG(0x871C)
382#define S5PC100_IEM_HPMCLK_DIV S5PC1XX_CLKREG(0x8724)
383
384#define S5PC100_SWRESET S5PC1XX_CLKREG(0x100000)
385#define S5PC100_OND_SWRESET S5PC1XX_CLKREG(0x100008)
386#define S5PC100_GEN_CTRL S5PC1XX_CLKREG(0x100100)
387#define S5PC100_GEN_STATUS S5PC1XX_CLKREG(0x100104)
388#define S5PC100_MEM_SYS_CFG S5PC1XX_CLKREG(0x100200)
389#define S5PC100_CAM_MUX_SEL S5PC1XX_CLKREG(0x100300)
390#define S5PC100_MIXER_OUT_SEL S5PC1XX_CLKREG(0x100304)
391#define S5PC100_LPMP_MODE_SEL S5PC1XX_CLKREG(0x100308)
392#define S5PC100_MIPI_PHY_CON0 S5PC1XX_CLKREG(0x100400)
393#define S5PC100_MIPI_PHY_CON1 S5PC1XX_CLKREG(0x100414)
394#define S5PC100_HDMI_PHY_CON0 S5PC1XX_CLKREG(0x100420)
395
396#define S5PC100_CFG_WFI_CLEAN (~(3<<5))
397#define S5PC100_CFG_WFI_IDLE (1<<5)
398#define S5PC100_CFG_WFI_STOP (2<<5)
399#define S5PC100_CFG_WFI_SLEEP (3<<5)
400
401#define S5PC100_OTHER_SYS_INT 24 344#define S5PC100_OTHER_SYS_INT 24
402#define S5PC100_OTHER_STA_TYPE 23 345#define S5PC100_OTHER_STA_TYPE 23
403#define STA_TYPE_EXPON 0 346#define STA_TYPE_EXPON 0
404#define STA_TYPE_SFR 1 347#define STA_TYPE_SFR 1
405 348
406#define S5PC100_PWR_STA_EXP_SCALE 0
407#define S5PC100_PWR_STA_CNT 4
408
409#define S5PC100_PWR_STABLE_COUNT 85500
410
411#define S5PC100_SLEEP_CFG_OSC_EN 0 349#define S5PC100_SLEEP_CFG_OSC_EN 0
412 350
413/* OTHERS Resgister */ 351/* OTHERS Resgister */
414#define S5PC100_OTHERS_USB_SIG_MASK (1 << 16) 352#define S5PC100_OTHERS_USB_SIG_MASK (1 << 16)
415#define S5PC100_OTHERS_MIPI_DPHY_EN (1 << 28) 353#define S5PC100_OTHERS_MIPI_DPHY_EN (1 << 28)
416 354
417/* MIPI D-PHY Control Register 0 */ 355/* MIPI D-PHY Control Register 0 */
diff --git a/arch/arm/plat-s5pc1xx/include/plat/regs-gpio.h b/arch/arm/plat-s5pc1xx/include/plat/regs-gpio.h
new file mode 100644
index 000000000000..43c7bc8bf784
--- /dev/null
+++ b/arch/arm/plat-s5pc1xx/include/plat/regs-gpio.h
@@ -0,0 +1,70 @@
1/* linux/arch/arm/plat-s5pc1xx/include/plat/regs-gpio.h
2 *
3 * Copyright 2009 Samsung Electronics Co.
4 * Byungho Min <bhmin@samsung.com>
5 *
6 * S5PC1XX - GPIO register definitions
7 */
8
9#ifndef __ASM_PLAT_S5PC1XX_REGS_GPIO_H
10#define __ASM_PLAT_S5PC1XX_REGS_GPIO_H __FILE__
11
12#include <mach/map.h>
13
14/* S5PC100 */
15#define S5PC100_GPIO_BASE S5PC1XX_VA_GPIO
16#define S5PC100_GPA0_BASE (S5PC100_GPIO_BASE + 0x0000)
17#define S5PC100_GPA1_BASE (S5PC100_GPIO_BASE + 0x0020)
18#define S5PC100_GPB_BASE (S5PC100_GPIO_BASE + 0x0040)
19#define S5PC100_GPC_BASE (S5PC100_GPIO_BASE + 0x0060)
20#define S5PC100_GPD_BASE (S5PC100_GPIO_BASE + 0x0080)
21#define S5PC100_GPE0_BASE (S5PC100_GPIO_BASE + 0x00A0)
22#define S5PC100_GPE1_BASE (S5PC100_GPIO_BASE + 0x00C0)
23#define S5PC100_GPF0_BASE (S5PC100_GPIO_BASE + 0x00E0)
24#define S5PC100_GPF1_BASE (S5PC100_GPIO_BASE + 0x0100)
25#define S5PC100_GPF2_BASE (S5PC100_GPIO_BASE + 0x0120)
26#define S5PC100_GPF3_BASE (S5PC100_GPIO_BASE + 0x0140)
27#define S5PC100_GPG0_BASE (S5PC100_GPIO_BASE + 0x0160)
28#define S5PC100_GPG1_BASE (S5PC100_GPIO_BASE + 0x0180)
29#define S5PC100_GPG2_BASE (S5PC100_GPIO_BASE + 0x01A0)
30#define S5PC100_GPG3_BASE (S5PC100_GPIO_BASE + 0x01C0)
31#define S5PC100_GPH0_BASE (S5PC100_GPIO_BASE + 0x0C00)
32#define S5PC100_GPH1_BASE (S5PC100_GPIO_BASE + 0x0C20)
33#define S5PC100_GPH2_BASE (S5PC100_GPIO_BASE + 0x0C40)
34#define S5PC100_GPH3_BASE (S5PC100_GPIO_BASE + 0x0C60)
35#define S5PC100_GPI_BASE (S5PC100_GPIO_BASE + 0x01E0)
36#define S5PC100_GPJ0_BASE (S5PC100_GPIO_BASE + 0x0200)
37#define S5PC100_GPJ1_BASE (S5PC100_GPIO_BASE + 0x0220)
38#define S5PC100_GPJ2_BASE (S5PC100_GPIO_BASE + 0x0240)
39#define S5PC100_GPJ3_BASE (S5PC100_GPIO_BASE + 0x0260)
40#define S5PC100_GPJ4_BASE (S5PC100_GPIO_BASE + 0x0280)
41#define S5PC100_GPK0_BASE (S5PC100_GPIO_BASE + 0x02A0)
42#define S5PC100_GPK1_BASE (S5PC100_GPIO_BASE + 0x02C0)
43#define S5PC100_GPK2_BASE (S5PC100_GPIO_BASE + 0x02E0)
44#define S5PC100_GPK3_BASE (S5PC100_GPIO_BASE + 0x0300)
45#define S5PC100_GPL0_BASE (S5PC100_GPIO_BASE + 0x0320)
46#define S5PC100_GPL1_BASE (S5PC100_GPIO_BASE + 0x0340)
47#define S5PC100_GPL2_BASE (S5PC100_GPIO_BASE + 0x0360)
48#define S5PC100_GPL3_BASE (S5PC100_GPIO_BASE + 0x0380)
49#define S5PC100_GPL4_BASE (S5PC100_GPIO_BASE + 0x03A0)
50#define S5PC100_EINT_BASE (S5PC100_GPIO_BASE + 0x0E00)
51
52#define S5PC100_UHOST (S5PC100_GPIO_BASE + 0x0B68)
53#define S5PC100_PDNEN (S5PC100_GPIO_BASE + 0x0F80)
54
55/* PDNEN */
56#define S5PC100_PDNEN_CFG_PDNEN (1 << 1)
57#define S5PC100_PDNEN_CFG_AUTO (0 << 1)
58#define S5PC100_PDNEN_POWERDOWN (1 << 0)
59#define S5PC100_PDNEN_NORMAL (0 << 0)
60
61/* Common part */
62/* External interrupt base is same at both s5pc100 and s5pc110 */
63#define S5PC1XX_EINT_BASE (S5PC100_EINT_BASE)
64
65#define S5PC100_GPx_INPUT(__gpio) (0x0 << ((__gpio) * 4))
66#define S5PC100_GPx_OUTPUT(__gpio) (0x1 << ((__gpio) * 4))
67#define S5PC100_GPx_CONMASK(__gpio) (0xf << ((__gpio) * 4))
68
69#endif /* __ASM_PLAT_S5PC1XX_REGS_GPIO_H */
70
diff --git a/arch/arm/plat-s5pc1xx/include/plat/regs-power.h b/arch/arm/plat-s5pc1xx/include/plat/regs-power.h
new file mode 100644
index 000000000000..02ffa491b53a
--- /dev/null
+++ b/arch/arm/plat-s5pc1xx/include/plat/regs-power.h
@@ -0,0 +1,84 @@
1/* arch/arm/plat-s5pc1xx/include/plat/regs-clock.h
2 *
3 * Copyright 2009 Samsung Electronics Co.
4 * Jongse Won <jongse.won@samsung.com>
5 *
6 * S5PC1XX clock register definitions
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#ifndef __ASM_ARM_REGS_PWR
14#define __ASM_ARM_REGS_PWR __FILE__
15
16#define S5PC1XX_PWRREG(x) (S5PC1XX_VA_PWR + (x))
17
18/* s5pc100 (0xE0108000) register for power management */
19#define S5PC100_PWR_CFG S5PC1XX_PWRREG(0x0)
20#define S5PC100_EINT_WAKEUP_MASK S5PC1XX_PWRREG(0x4)
21#define S5PC100_NORMAL_CFG S5PC1XX_PWRREG(0x10)
22#define S5PC100_STOP_CFG S5PC1XX_PWRREG(0x14)
23#define S5PC100_SLEEP_CFG S5PC1XX_PWRREG(0x18)
24#define S5PC100_STOP_MEM_CFG S5PC1XX_PWRREG(0x1C)
25#define S5PC100_OSC_FREQ S5PC1XX_PWRREG(0x100)
26#define S5PC100_OSC_STABLE S5PC1XX_PWRREG(0x104)
27#define S5PC100_PWR_STABLE S5PC1XX_PWRREG(0x108)
28#define S5PC100_MTC_STABLE S5PC1XX_PWRREG(0x110)
29#define S5PC100_CLAMP_STABLE S5PC1XX_PWRREG(0x114)
30#define S5PC100_OTHERS S5PC1XX_PWRREG(0x200)
31#define S5PC100_RST_STAT S5PC1XX_PWRREG(0x300)
32#define S5PC100_WAKEUP_STAT S5PC1XX_PWRREG(0x304)
33#define S5PC100_BLK_PWR_STAT S5PC1XX_PWRREG(0x308)
34#define S5PC100_INFORM0 S5PC1XX_PWRREG(0x400)
35#define S5PC100_INFORM1 S5PC1XX_PWRREG(0x404)
36#define S5PC100_INFORM2 S5PC1XX_PWRREG(0x408)
37#define S5PC100_INFORM3 S5PC1XX_PWRREG(0x40C)
38#define S5PC100_INFORM4 S5PC1XX_PWRREG(0x410)
39#define S5PC100_INFORM5 S5PC1XX_PWRREG(0x414)
40#define S5PC100_INFORM6 S5PC1XX_PWRREG(0x418)
41#define S5PC100_INFORM7 S5PC1XX_PWRREG(0x41C)
42#define S5PC100_DCGIDX_MAP0 S5PC1XX_PWRREG(0x500)
43#define S5PC100_DCGIDX_MAP1 S5PC1XX_PWRREG(0x504)
44#define S5PC100_DCGIDX_MAP2 S5PC1XX_PWRREG(0x508)
45#define S5PC100_DCGPERF_MAP0 S5PC1XX_PWRREG(0x50C)
46#define S5PC100_DCGPERF_MAP1 S5PC1XX_PWRREG(0x510)
47#define S5PC100_DVCIDX_MAP S5PC1XX_PWRREG(0x514)
48#define S5PC100_FREQ_CPU S5PC1XX_PWRREG(0x518)
49#define S5PC100_FREQ_DPM S5PC1XX_PWRREG(0x51C)
50#define S5PC100_DVSEMCLK_EN S5PC1XX_PWRREG(0x520)
51#define S5PC100_APLL_CON_L8 S5PC1XX_PWRREG(0x600)
52#define S5PC100_APLL_CON_L7 S5PC1XX_PWRREG(0x604)
53#define S5PC100_APLL_CON_L6 S5PC1XX_PWRREG(0x608)
54#define S5PC100_APLL_CON_L5 S5PC1XX_PWRREG(0x60C)
55#define S5PC100_APLL_CON_L4 S5PC1XX_PWRREG(0x610)
56#define S5PC100_APLL_CON_L3 S5PC1XX_PWRREG(0x614)
57#define S5PC100_APLL_CON_L2 S5PC1XX_PWRREG(0x618)
58#define S5PC100_APLL_CON_L1 S5PC1XX_PWRREG(0x61C)
59#define S5PC100_IEM_CONTROL S5PC1XX_PWRREG(0x620)
60#define S5PC100_CLKDIV_IEM_L8 S5PC1XX_PWRREG(0x700)
61#define S5PC100_CLKDIV_IEM_L7 S5PC1XX_PWRREG(0x704)
62#define S5PC100_CLKDIV_IEM_L6 S5PC1XX_PWRREG(0x708)
63#define S5PC100_CLKDIV_IEM_L5 S5PC1XX_PWRREG(0x70C)
64#define S5PC100_CLKDIV_IEM_L4 S5PC1XX_PWRREG(0x710)
65#define S5PC100_CLKDIV_IEM_L3 S5PC1XX_PWRREG(0x714)
66#define S5PC100_CLKDIV_IEM_L2 S5PC1XX_PWRREG(0x718)
67#define S5PC100_CLKDIV_IEM_L1 S5PC1XX_PWRREG(0x71C)
68#define S5PC100_IEM_HPMCLK_DIV S5PC1XX_PWRREG(0x724)
69
70/* PWR_CFG */
71#define S5PC100_PWRCFG_CFG_DEEP_IDLE (1 << 31)
72#define S5PC100_PWRCFG_CFG_WFI_MASK (3 << 5)
73#define S5PC100_PWRCFG_CFG_WFI_IDLE (0 << 5)
74#define S5PC100_PWRCFG_CFG_WFI_DEEP_IDLE (1 << 5)
75#define S5PC100_PWRCFG_CFG_WFI_STOP (2 << 5)
76#define S5PC100_PWRCFG_CFG_WFI_SLEEP (3 << 5)
77
78/* SLEEP_CFG */
79#define S5PC100_SLEEP_OSC_EN_SLEEP (1 << 0)
80
81/* OTHERS */
82#define S5PC100_PMU_INT_DISABLE (1 << 24)
83
84#endif /* __ASM_ARM_REGS_PWR */
diff --git a/arch/arm/plat-s5pc1xx/include/plat/s5pc100.h b/arch/arm/plat-s5pc1xx/include/plat/s5pc100.h
index 45e275131665..2531f34a56f3 100644
--- a/arch/arm/plat-s5pc1xx/include/plat/s5pc100.h
+++ b/arch/arm/plat-s5pc1xx/include/plat/s5pc100.h
@@ -35,10 +35,9 @@ extern struct clk clk_hpll;
35extern struct clk clk_hd0; 35extern struct clk clk_hd0;
36extern struct clk clk_pd0; 36extern struct clk clk_pd0;
37extern struct clk clk_54m; 37extern struct clk clk_54m;
38extern struct clk clk_dout_mpll2;
39extern void s5pc1xx_register_clocks(void); 38extern void s5pc1xx_register_clocks(void);
40extern int s5pc1xx_sclk0_ctrl(struct clk *clk, int enable); 39extern int s5pc100_sclk0_ctrl(struct clk *clk, int enable);
41extern int s5pc1xx_sclk1_ctrl(struct clk *clk, int enable); 40extern int s5pc100_sclk1_ctrl(struct clk *clk, int enable);
42 41
43/* Some day, belows will be moved to plat-s5pc/include/plat/devs.h */ 42/* Some day, belows will be moved to plat-s5pc/include/plat/devs.h */
44extern struct s3c24xx_uart_resources s5pc1xx_uart_resources[]; 43extern struct s3c24xx_uart_resources s5pc1xx_uart_resources[];
diff --git a/arch/arm/plat-s5pc1xx/irq-eint.c b/arch/arm/plat-s5pc1xx/irq-eint.c
new file mode 100644
index 000000000000..373122f57d56
--- /dev/null
+++ b/arch/arm/plat-s5pc1xx/irq-eint.c
@@ -0,0 +1,281 @@
1/*
2 * linux/arch/arm/plat-s5pc1xx/irq-eint.c
3 *
4 * Copyright 2009 Samsung Electronics Co.
5 * Byungho Min <bhmin@samsung.com>
6 * Kyungin Park <kyungmin.park@samsung.com>
7 *
8 * Based on plat-s3c64xx/irq-eint.c
9 *
10 * S5PC1XX - Interrupt handling for IRQ_EINT(x)
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2 as
14 * published by the Free Software Foundation.
15 */
16
17#include <linux/kernel.h>
18#include <linux/interrupt.h>
19#include <linux/irq.h>
20#include <linux/io.h>
21#include <linux/sysdev.h>
22#include <linux/pm.h>
23#include <linux/gpio.h>
24
25#include <asm/hardware/vic.h>
26
27#include <mach/map.h>
28
29#include <plat/gpio-cfg.h>
30#include <plat/gpio-ext.h>
31#include <plat/pm.h>
32#include <plat/regs-gpio.h>
33#include <plat/regs-irqtype.h>
34
35/*
36 * bank is a group of external interrupt
37 * bank0 means EINT0 ... EINT7
38 * bank1 means EINT8 ... EINT15
39 * bank2 means EINT16 ... EINT23
40 * bank3 means EINT24 ... EINT31
41 */
42
43static inline int s3c_get_eint(unsigned int irq)
44{
45 int real;
46
47 if (irq < IRQ_EINT16_31)
48 real = (irq - IRQ_EINT0);
49 else
50 real = (irq - S3C_IRQ_EINT_BASE) + IRQ_EINT16_31 - IRQ_EINT0;
51
52 return real;
53}
54
55static inline int s3c_get_bank(unsigned int irq)
56{
57 return s3c_get_eint(irq) >> 3;
58}
59
60static inline int s3c_eint_to_bit(unsigned int irq)
61{
62 int real, bit;
63
64 real = s3c_get_eint(irq);
65 bit = 1 << (real & (8 - 1));
66
67 return bit;
68}
69
70static inline void s3c_irq_eint_mask(unsigned int irq)
71{
72 u32 mask;
73 u32 bank = s3c_get_bank(irq);
74
75 mask = __raw_readl(S5PC1XX_WKUP_INT_MASK(bank));
76 mask |= s3c_eint_to_bit(irq);
77 __raw_writel(mask, S5PC1XX_WKUP_INT_MASK(bank));
78}
79
80static void s3c_irq_eint_unmask(unsigned int irq)
81{
82 u32 mask;
83 u32 bank = s3c_get_bank(irq);
84
85 mask = __raw_readl(S5PC1XX_WKUP_INT_MASK(bank));
86 mask &= ~(s3c_eint_to_bit(irq));
87 __raw_writel(mask, S5PC1XX_WKUP_INT_MASK(bank));
88}
89
90static inline void s3c_irq_eint_ack(unsigned int irq)
91{
92 u32 bank = s3c_get_bank(irq);
93
94 __raw_writel(s3c_eint_to_bit(irq), S5PC1XX_WKUP_INT_PEND(bank));
95}
96
97static void s3c_irq_eint_maskack(unsigned int irq)
98{
99 /* compiler should in-line these */
100 s3c_irq_eint_mask(irq);
101 s3c_irq_eint_ack(irq);
102}
103
104static int s3c_irq_eint_set_type(unsigned int irq, unsigned int type)
105{
106 u32 bank = s3c_get_bank(irq);
107 int real = s3c_get_eint(irq);
108 int gpio, shift, sfn;
109 u32 ctrl, con = 0;
110
111 switch (type) {
112 case IRQ_TYPE_NONE:
113 printk(KERN_WARNING "No edge setting!\n");
114 break;
115
116 case IRQ_TYPE_EDGE_RISING:
117 con = S5PC1XX_WKUP_INT_RISEEDGE;
118 break;
119
120 case IRQ_TYPE_EDGE_FALLING:
121 con = S5PC1XX_WKUP_INT_FALLEDGE;
122 break;
123
124 case IRQ_TYPE_EDGE_BOTH:
125 con = S5PC1XX_WKUP_INT_BOTHEDGE;
126 break;
127
128 case IRQ_TYPE_LEVEL_LOW:
129 con = S5PC1XX_WKUP_INT_LOWLEV;
130 break;
131
132 case IRQ_TYPE_LEVEL_HIGH:
133 con = S5PC1XX_WKUP_INT_HILEV;
134 break;
135
136 default:
137 printk(KERN_ERR "No such irq type %d", type);
138 return -EINVAL;
139 }
140
141 gpio = real & (8 - 1);
142 shift = gpio << 2;
143
144 ctrl = __raw_readl(S5PC1XX_WKUP_INT_CON(bank));
145 ctrl &= ~(0x7 << shift);
146 ctrl |= con << shift;
147 __raw_writel(ctrl, S5PC1XX_WKUP_INT_CON(bank));
148
149 switch (real) {
150 case 0 ... 7:
151 gpio = S5PC100_GPH0(gpio);
152 break;
153 case 8 ... 15:
154 gpio = S5PC100_GPH1(gpio);
155 break;
156 case 16 ... 23:
157 gpio = S5PC100_GPH2(gpio);
158 break;
159 case 24 ... 31:
160 gpio = S5PC100_GPH3(gpio);
161 break;
162 default:
163 return -EINVAL;
164 }
165
166 sfn = S3C_GPIO_SFN(0x2);
167 s3c_gpio_cfgpin(gpio, sfn);
168
169 return 0;
170}
171
172static struct irq_chip s3c_irq_eint = {
173 .name = "EINT",
174 .mask = s3c_irq_eint_mask,
175 .unmask = s3c_irq_eint_unmask,
176 .mask_ack = s3c_irq_eint_maskack,
177 .ack = s3c_irq_eint_ack,
178 .set_type = s3c_irq_eint_set_type,
179 .set_wake = s3c_irqext_wake,
180};
181
182/* s3c_irq_demux_eint
183 *
184 * This function demuxes the IRQ from external interrupts,
185 * from IRQ_EINT(16) to IRQ_EINT(31). It is designed to be inlined into
186 * the specific handlers s3c_irq_demux_eintX_Y.
187 */
188static inline void s3c_irq_demux_eint(unsigned int start, unsigned int end)
189{
190 u32 status = __raw_readl(S5PC1XX_WKUP_INT_PEND((start >> 3)));
191 u32 mask = __raw_readl(S5PC1XX_WKUP_INT_MASK((start >> 3)));
192 unsigned int irq;
193
194 status &= ~mask;
195 status &= (1 << (end - start + 1)) - 1;
196
197 for (irq = IRQ_EINT(start); irq <= IRQ_EINT(end); irq++) {
198 if (status & 1)
199 generic_handle_irq(irq);
200
201 status >>= 1;
202 }
203}
204
205static void s3c_irq_demux_eint16_31(unsigned int irq, struct irq_desc *desc)
206{
207 s3c_irq_demux_eint(16, 23);
208 s3c_irq_demux_eint(24, 31);
209}
210
211/*
212 * Handle EINT0 ... EINT15 at VIC directly
213 */
214static void s3c_irq_vic_eint_mask(unsigned int irq)
215{
216 void __iomem *base = get_irq_chip_data(irq);
217 unsigned int real;
218
219 s3c_irq_eint_mask(irq);
220 real = s3c_get_eint(irq);
221 writel(1 << real, base + VIC_INT_ENABLE_CLEAR);
222}
223
224static void s3c_irq_vic_eint_unmask(unsigned int irq)
225{
226 void __iomem *base = get_irq_chip_data(irq);
227 unsigned int real;
228
229 s3c_irq_eint_unmask(irq);
230 real = s3c_get_eint(irq);
231 writel(1 << real, base + VIC_INT_ENABLE);
232}
233
234static inline void s3c_irq_vic_eint_ack(unsigned int irq)
235{
236 u32 bit;
237 u32 bank = s3c_get_bank(irq);
238
239 bit = s3c_eint_to_bit(irq);
240 __raw_writel(bit, S5PC1XX_WKUP_INT_PEND(bank));
241}
242
243static void s3c_irq_vic_eint_maskack(unsigned int irq)
244{
245 /* compiler should in-line these */
246 s3c_irq_vic_eint_mask(irq);
247 s3c_irq_vic_eint_ack(irq);
248}
249
250static struct irq_chip s3c_irq_vic_eint = {
251 .name = "EINT",
252 .mask = s3c_irq_vic_eint_mask,
253 .unmask = s3c_irq_vic_eint_unmask,
254 .mask_ack = s3c_irq_vic_eint_maskack,
255 .ack = s3c_irq_vic_eint_ack,
256 .set_type = s3c_irq_eint_set_type,
257 .set_wake = s3c_irqext_wake,
258};
259
260static int __init s5pc1xx_init_irq_eint(void)
261{
262 int irq;
263
264 for (irq = IRQ_EINT0; irq <= IRQ_EINT15; irq++) {
265 set_irq_chip(irq, &s3c_irq_vic_eint);
266 set_irq_handler(irq, handle_level_irq);
267 set_irq_flags(irq, IRQF_VALID);
268 }
269
270 for (irq = IRQ_EINT(16); irq <= IRQ_EINT(31); irq++) {
271 set_irq_chip(irq, &s3c_irq_eint);
272 set_irq_handler(irq, handle_level_irq);
273 set_irq_flags(irq, IRQF_VALID);
274 }
275
276 set_irq_chained_handler(IRQ_EINT16_31, s3c_irq_demux_eint16_31);
277
278 return 0;
279}
280
281arch_initcall(s5pc1xx_init_irq_eint);
diff --git a/arch/arm/plat-s5pc1xx/irq-gpio.c b/arch/arm/plat-s5pc1xx/irq-gpio.c
new file mode 100644
index 000000000000..fecca7a679b0
--- /dev/null
+++ b/arch/arm/plat-s5pc1xx/irq-gpio.c
@@ -0,0 +1,266 @@
1/*
2 * arch/arm/plat-s5pc1xx/irq-gpio.c
3 *
4 * Copyright (C) 2009 Samsung Electronics
5 *
6 * S5PC1XX - Interrupt handling for IRQ_GPIO${group}(x)
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#include <linux/kernel.h>
14#include <linux/interrupt.h>
15#include <linux/irq.h>
16#include <linux/io.h>
17#include <linux/gpio.h>
18
19#include <mach/map.h>
20#include <plat/gpio-cfg.h>
21
22#define S5PC1XX_GPIOREG(x) (S5PC1XX_VA_GPIO + (x))
23
24#define CON_OFFSET 0x700
25#define MASK_OFFSET 0x900
26#define PEND_OFFSET 0xA00
27#define CON_OFFSET_2 0xE00
28#define MASK_OFFSET_2 0xF00
29#define PEND_OFFSET_2 0xF40
30
31#define GPIOINT_LEVEL_LOW 0x0
32#define GPIOINT_LEVEL_HIGH 0x1
33#define GPIOINT_EDGE_FALLING 0x2
34#define GPIOINT_EDGE_RISING 0x3
35#define GPIOINT_EDGE_BOTH 0x4
36
37static int group_to_con_offset(int group)
38{
39 return group << 2;
40}
41
42static int group_to_mask_offset(int group)
43{
44 return group << 2;
45}
46
47static int group_to_pend_offset(int group)
48{
49 return group << 2;
50}
51
52static int s5pc1xx_get_start(unsigned int group)
53{
54 switch (group) {
55 case 0: return S5PC100_GPIO_A0_START;
56 case 1: return S5PC100_GPIO_A1_START;
57 case 2: return S5PC100_GPIO_B_START;
58 case 3: return S5PC100_GPIO_C_START;
59 case 4: return S5PC100_GPIO_D_START;
60 case 5: return S5PC100_GPIO_E0_START;
61 case 6: return S5PC100_GPIO_E1_START;
62 case 7: return S5PC100_GPIO_F0_START;
63 case 8: return S5PC100_GPIO_F1_START;
64 case 9: return S5PC100_GPIO_F2_START;
65 case 10: return S5PC100_GPIO_F3_START;
66 case 11: return S5PC100_GPIO_G0_START;
67 case 12: return S5PC100_GPIO_G1_START;
68 case 13: return S5PC100_GPIO_G2_START;
69 case 14: return S5PC100_GPIO_G3_START;
70 case 15: return S5PC100_GPIO_I_START;
71 case 16: return S5PC100_GPIO_J0_START;
72 case 17: return S5PC100_GPIO_J1_START;
73 case 18: return S5PC100_GPIO_J2_START;
74 case 19: return S5PC100_GPIO_J3_START;
75 case 20: return S5PC100_GPIO_J4_START;
76 default:
77 BUG();
78 }
79
80 return -EINVAL;
81}
82
83static int s5pc1xx_get_group(unsigned int irq)
84{
85 irq -= S3C_IRQ_GPIO(0);
86
87 switch (irq) {
88 case S5PC100_GPIO_A0_START ... S5PC100_GPIO_A1_START - 1:
89 return 0;
90 case S5PC100_GPIO_A1_START ... S5PC100_GPIO_B_START - 1:
91 return 1;
92 case S5PC100_GPIO_B_START ... S5PC100_GPIO_C_START - 1:
93 return 2;
94 case S5PC100_GPIO_C_START ... S5PC100_GPIO_D_START - 1:
95 return 3;
96 case S5PC100_GPIO_D_START ... S5PC100_GPIO_E0_START - 1:
97 return 4;
98 case S5PC100_GPIO_E0_START ... S5PC100_GPIO_E1_START - 1:
99 return 5;
100 case S5PC100_GPIO_E1_START ... S5PC100_GPIO_F0_START - 1:
101 return 6;
102 case S5PC100_GPIO_F0_START ... S5PC100_GPIO_F1_START - 1:
103 return 7;
104 case S5PC100_GPIO_F1_START ... S5PC100_GPIO_F2_START - 1:
105 return 8;
106 case S5PC100_GPIO_F2_START ... S5PC100_GPIO_F3_START - 1:
107 return 9;
108 case S5PC100_GPIO_F3_START ... S5PC100_GPIO_G0_START - 1:
109 return 10;
110 case S5PC100_GPIO_G0_START ... S5PC100_GPIO_G1_START - 1:
111 return 11;
112 case S5PC100_GPIO_G1_START ... S5PC100_GPIO_G2_START - 1:
113 return 12;
114 case S5PC100_GPIO_G2_START ... S5PC100_GPIO_G3_START - 1:
115 return 13;
116 case S5PC100_GPIO_G3_START ... S5PC100_GPIO_H0_START - 1:
117 return 14;
118 case S5PC100_GPIO_I_START ... S5PC100_GPIO_J0_START - 1:
119 return 15;
120 case S5PC100_GPIO_J0_START ... S5PC100_GPIO_J1_START - 1:
121 return 16;
122 case S5PC100_GPIO_J1_START ... S5PC100_GPIO_J2_START - 1:
123 return 17;
124 case S5PC100_GPIO_J2_START ... S5PC100_GPIO_J3_START - 1:
125 return 18;
126 case S5PC100_GPIO_J3_START ... S5PC100_GPIO_J4_START - 1:
127 return 19;
128 case S5PC100_GPIO_J4_START ... S5PC100_GPIO_K0_START - 1:
129 return 20;
130 default:
131 BUG();
132 }
133
134 return -EINVAL;
135}
136
137static int s5pc1xx_get_offset(unsigned int irq)
138{
139 struct gpio_chip *chip = get_irq_data(irq);
140 return irq - S3C_IRQ_GPIO(chip->base);
141}
142
143static void s5pc1xx_gpioint_ack(unsigned int irq)
144{
145 int group, offset, pend_offset;
146 unsigned int value;
147
148 group = s5pc1xx_get_group(irq);
149 offset = s5pc1xx_get_offset(irq);
150 pend_offset = group_to_pend_offset(group);
151
152 value = __raw_readl(S5PC1XX_GPIOREG(PEND_OFFSET) + pend_offset);
153 value |= 1 << offset;
154 __raw_writel(value, S5PC1XX_GPIOREG(PEND_OFFSET) + pend_offset);
155}
156
157static void s5pc1xx_gpioint_mask(unsigned int irq)
158{
159 int group, offset, mask_offset;
160 unsigned int value;
161
162 group = s5pc1xx_get_group(irq);
163 offset = s5pc1xx_get_offset(irq);
164 mask_offset = group_to_mask_offset(group);
165
166 value = __raw_readl(S5PC1XX_GPIOREG(MASK_OFFSET) + mask_offset);
167 value |= 1 << offset;
168 __raw_writel(value, S5PC1XX_GPIOREG(MASK_OFFSET) + mask_offset);
169}
170
171static void s5pc1xx_gpioint_unmask(unsigned int irq)
172{
173 int group, offset, mask_offset;
174 unsigned int value;
175
176 group = s5pc1xx_get_group(irq);
177 offset = s5pc1xx_get_offset(irq);
178 mask_offset = group_to_mask_offset(group);
179
180 value = __raw_readl(S5PC1XX_GPIOREG(MASK_OFFSET) + mask_offset);
181 value &= ~(1 << offset);
182 __raw_writel(value, S5PC1XX_GPIOREG(MASK_OFFSET) + mask_offset);
183}
184
185static void s5pc1xx_gpioint_mask_ack(unsigned int irq)
186{
187 s5pc1xx_gpioint_mask(irq);
188 s5pc1xx_gpioint_ack(irq);
189}
190
191static int s5pc1xx_gpioint_set_type(unsigned int irq, unsigned int type)
192{
193 int group, offset, con_offset;
194 unsigned int value;
195
196 group = s5pc1xx_get_group(irq);
197 offset = s5pc1xx_get_offset(irq);
198 con_offset = group_to_con_offset(group);
199
200 switch (type) {
201 case IRQ_TYPE_NONE:
202 printk(KERN_WARNING "No irq type\n");
203 return -EINVAL;
204 case IRQ_TYPE_EDGE_RISING:
205 type = GPIOINT_EDGE_RISING;
206 break;
207 case IRQ_TYPE_EDGE_FALLING:
208 type = GPIOINT_EDGE_FALLING;
209 break;
210 case IRQ_TYPE_EDGE_BOTH:
211 type = GPIOINT_EDGE_BOTH;
212 break;
213 case IRQ_TYPE_LEVEL_HIGH:
214 type = GPIOINT_LEVEL_HIGH;
215 break;
216 case IRQ_TYPE_LEVEL_LOW:
217 type = GPIOINT_LEVEL_LOW;
218 break;
219 default:
220 BUG();
221 }
222
223
224 value = __raw_readl(S5PC1XX_GPIOREG(CON_OFFSET) + con_offset);
225 value &= ~(0xf << (offset * 0x4));
226 value |= (type << (offset * 0x4));
227 __raw_writel(value, S5PC1XX_GPIOREG(CON_OFFSET) + con_offset);
228
229 return 0;
230}
231
232struct irq_chip s5pc1xx_gpioint = {
233 .name = "GPIO",
234 .ack = s5pc1xx_gpioint_ack,
235 .mask = s5pc1xx_gpioint_mask,
236 .mask_ack = s5pc1xx_gpioint_mask_ack,
237 .unmask = s5pc1xx_gpioint_unmask,
238 .set_type = s5pc1xx_gpioint_set_type,
239};
240
241void s5pc1xx_irq_gpioint_handler(unsigned int irq, struct irq_desc *desc)
242{
243 int group, offset, pend_offset, mask_offset;
244 int real_irq, group_end;
245 unsigned int pend, mask;
246
247 group_end = 21;
248
249 for (group = 0; group < group_end; group++) {
250 pend_offset = group_to_pend_offset(group);
251 pend = __raw_readl(S5PC1XX_GPIOREG(PEND_OFFSET) + pend_offset);
252 if (!pend)
253 continue;
254
255 mask_offset = group_to_mask_offset(group);
256 mask = __raw_readl(S5PC1XX_GPIOREG(MASK_OFFSET) + mask_offset);
257 pend &= ~mask;
258
259 for (offset = 0; offset < 8; offset++) {
260 if (pend & (1 << offset)) {
261 real_irq = s5pc1xx_get_start(group) + offset;
262 generic_handle_irq(S3C_IRQ_GPIO(real_irq));
263 }
264 }
265 }
266}
diff --git a/arch/arm/plat-s5pc1xx/irq.c b/arch/arm/plat-s5pc1xx/irq.c
index 80d6dd942cb8..e44fd04ef333 100644
--- a/arch/arm/plat-s5pc1xx/irq.c
+++ b/arch/arm/plat-s5pc1xx/irq.c
@@ -79,7 +79,7 @@ static void s3c_irq_timer_ack(unsigned int irq)
79{ 79{
80 u32 reg = __raw_readl(S3C64XX_TINT_CSTAT); 80 u32 reg = __raw_readl(S3C64XX_TINT_CSTAT);
81 81
82 reg &= 0x1f; 82 reg &= 0x1f; /* mask out pending interrupts */
83 reg |= (1 << 5) << (irq - IRQ_TIMER0); 83 reg |= (1 << 5) << (irq - IRQ_TIMER0);
84 __raw_writel(reg, S3C64XX_TINT_CSTAT); 84 __raw_writel(reg, S3C64XX_TINT_CSTAT);
85} 85}
diff --git a/arch/arm/plat-s5pc1xx/s5pc100-clock.c b/arch/arm/plat-s5pc1xx/s5pc100-clock.c
index 6b24035172fa..b436d44510c8 100644
--- a/arch/arm/plat-s5pc1xx/s5pc100-clock.c
+++ b/arch/arm/plat-s5pc1xx/s5pc100-clock.c
@@ -49,6 +49,7 @@ static struct clk clk_ext_xtal_mux = {
49#define clk_fin_hpll clk_ext_xtal_mux 49#define clk_fin_hpll clk_ext_xtal_mux
50 50
51#define clk_fout_mpll clk_mpll 51#define clk_fout_mpll clk_mpll
52#define clk_vclk_54m clk_54m
52 53
53struct clk_sources { 54struct clk_sources {
54 unsigned int nr_sources; 55 unsigned int nr_sources;
@@ -67,746 +68,327 @@ struct clksrc_clk {
67 void __iomem *reg_source; 68 void __iomem *reg_source;
68}; 69};
69 70
70static int clk_default_setrate(struct clk *clk, unsigned long rate) 71/* APLL */
71{ 72static struct clk clk_fout_apll = {
72 clk->rate = rate; 73 .name = "fout_apll",
73 return 1;
74}
75
76struct clk clk_27m = {
77 .name = "clk_27m",
78 .id = -1, 74 .id = -1,
79 .rate = 27000000, 75 .rate = 27000000,
80}; 76};
81 77
82static int clk_48m_ctrl(struct clk *clk, int enable) 78static struct clk *clk_src_apll_list[] = {
83{ 79 [0] = &clk_fin_apll,
84 unsigned long flags; 80 [1] = &clk_fout_apll,
85 u32 val; 81};
82
83static struct clk_sources clk_src_apll = {
84 .sources = clk_src_apll_list,
85 .nr_sources = ARRAY_SIZE(clk_src_apll_list),
86};
86 87
87 /* can't rely on clock lock, this register has other usages */ 88static struct clksrc_clk clk_mout_apll = {
88 local_irq_save(flags); 89 .clk = {
90 .name = "mout_apll",
91 .id = -1,
92 },
93 .shift = S5PC100_CLKSRC0_APLL_SHIFT,
94 .mask = S5PC100_CLKSRC0_APLL_MASK,
95 .sources = &clk_src_apll,
96 .reg_source = S5PC100_CLKSRC0,
97};
89 98
90 val = __raw_readl(S5PC1XX_CLK_SRC1); 99static unsigned long s5pc100_clk_dout_apll_get_rate(struct clk *clk)
91 if (enable) 100{
92 val |= S5PC100_CLKSRC1_CLK48M_MASK; 101 unsigned long rate = clk_get_rate(clk->parent);
93 else 102 unsigned int ratio;
94 val &= ~S5PC100_CLKSRC1_CLK48M_MASK;
95 103
96 __raw_writel(val, S5PC1XX_CLK_SRC1); 104 ratio = __raw_readl(S5PC100_CLKDIV0) & S5PC100_CLKDIV0_APLL_MASK;
97 local_irq_restore(flags); 105 ratio >>= S5PC100_CLKDIV0_APLL_SHIFT;
98 106
99 return 0; 107 return rate / (ratio + 1);
100} 108}
101 109
102struct clk clk_48m = { 110static struct clk clk_dout_apll = {
103 .name = "clk_48m", 111 .name = "dout_apll",
104 .id = -1, 112 .id = -1,
105 .rate = 48000000, 113 .parent = &clk_mout_apll.clk,
106 .enable = clk_48m_ctrl, 114 .get_rate = s5pc100_clk_dout_apll_get_rate,
107}; 115};
108 116
109struct clk clk_54m = { 117static unsigned long s5pc100_clk_arm_get_rate(struct clk *clk)
110 .name = "clk_54m", 118{
111 .id = -1, 119 unsigned long rate = clk_get_rate(clk->parent);
112 .rate = 54000000, 120 unsigned int ratio;
113};
114
115struct clk clk_hpll = {
116 .name = "hpll",
117 .id = -1,
118};
119 121
120struct clk clk_hd0 = { 122 ratio = __raw_readl(S5PC100_CLKDIV0) & S5PC100_CLKDIV0_ARM_MASK;
121 .name = "hclkd0", 123 ratio >>= S5PC100_CLKDIV0_ARM_SHIFT;
122 .id = -1,
123 .rate = 0,
124 .parent = NULL,
125 .ctrlbit = 0,
126 .set_rate = clk_default_setrate,
127};
128 124
129struct clk clk_pd0 = { 125 return rate / (ratio + 1);
130 .name = "pclkd0", 126}
131 .id = -1,
132 .rate = 0,
133 .parent = NULL,
134 .ctrlbit = 0,
135 .set_rate = clk_default_setrate,
136};
137 127
138static int s5pc1xx_clk_gate(void __iomem *reg, 128static unsigned long s5pc100_clk_arm_round_rate(struct clk *clk,
139 struct clk *clk, 129 unsigned long rate)
140 int enable)
141{ 130{
142 unsigned int ctrlbit = clk->ctrlbit; 131 unsigned long parent = clk_get_rate(clk->parent);
143 u32 con; 132 u32 div;
144 133
145 con = __raw_readl(reg); 134 if (parent < rate)
135 return rate;
146 136
147 if (enable) 137 div = (parent / rate) - 1;
148 con |= ctrlbit; 138 if (div > S5PC100_CLKDIV0_ARM_MASK)
149 else 139 div = S5PC100_CLKDIV0_ARM_MASK;
150 con &= ~ctrlbit;
151 140
152 __raw_writel(con, reg); 141 return parent / (div + 1);
153 return 0;
154} 142}
155 143
156static int s5pc1xx_clk_d00_ctrl(struct clk *clk, int enable) 144static int s5pc100_clk_arm_set_rate(struct clk *clk, unsigned long rate)
157{ 145{
158 return s5pc1xx_clk_gate(S5PC100_CLKGATE_D00, clk, enable); 146 unsigned long parent = clk_get_rate(clk->parent);
159} 147 u32 div;
148 u32 val;
160 149
161static int s5pc1xx_clk_d01_ctrl(struct clk *clk, int enable) 150 if (rate < parent / (S5PC100_CLKDIV0_ARM_MASK + 1))
162{ 151 return -EINVAL;
163 return s5pc1xx_clk_gate(S5PC100_CLKGATE_D01, clk, enable);
164}
165 152
166static int s5pc1xx_clk_d02_ctrl(struct clk *clk, int enable) 153 rate = clk_round_rate(clk, rate);
167{ 154 div = clk_get_rate(clk->parent) / rate;
168 return s5pc1xx_clk_gate(S5PC100_CLKGATE_D02, clk, enable);
169}
170 155
171static int s5pc1xx_clk_d10_ctrl(struct clk *clk, int enable) 156 val = __raw_readl(S5PC100_CLKDIV0);
172{ 157 val &= S5PC100_CLKDIV0_ARM_MASK;
173 return s5pc1xx_clk_gate(S5PC100_CLKGATE_D10, clk, enable); 158 val |= (div - 1);
174} 159 __raw_writel(val, S5PC100_CLKDIV0);
175 160
176static int s5pc1xx_clk_d11_ctrl(struct clk *clk, int enable) 161 return 0;
177{
178 return s5pc1xx_clk_gate(S5PC100_CLKGATE_D11, clk, enable);
179} 162}
180 163
181static int s5pc1xx_clk_d12_ctrl(struct clk *clk, int enable) 164static struct clk clk_arm = {
182{ 165 .name = "armclk",
183 return s5pc1xx_clk_gate(S5PC100_CLKGATE_D12, clk, enable); 166 .id = -1,
184} 167 .parent = &clk_dout_apll,
168 .get_rate = s5pc100_clk_arm_get_rate,
169 .set_rate = s5pc100_clk_arm_set_rate,
170 .round_rate = s5pc100_clk_arm_round_rate,
171};
185 172
186static int s5pc1xx_clk_d13_ctrl(struct clk *clk, int enable) 173static unsigned long s5pc100_clk_dout_d0_bus_get_rate(struct clk *clk)
187{ 174{
188 return s5pc1xx_clk_gate(S5PC100_CLKGATE_D13, clk, enable); 175 unsigned long rate = clk_get_rate(clk->parent);
189} 176 unsigned int ratio;
190 177
191static int s5pc1xx_clk_d14_ctrl(struct clk *clk, int enable) 178 ratio = __raw_readl(S5PC100_CLKDIV0) & S5PC100_CLKDIV0_D0_MASK;
192{ 179 ratio >>= S5PC100_CLKDIV0_D0_SHIFT;
193 return s5pc1xx_clk_gate(S5PC100_CLKGATE_D14, clk, enable);
194}
195 180
196static int s5pc1xx_clk_d15_ctrl(struct clk *clk, int enable) 181 return rate / (ratio + 1);
197{
198 return s5pc1xx_clk_gate(S5PC100_CLKGATE_D15, clk, enable);
199} 182}
200 183
201static int s5pc1xx_clk_d20_ctrl(struct clk *clk, int enable) 184static struct clk clk_dout_d0_bus = {
202{ 185 .name = "dout_d0_bus",
203 return s5pc1xx_clk_gate(S5PC100_CLKGATE_D20, clk, enable); 186 .id = -1,
204} 187 .parent = &clk_arm,
188 .get_rate = s5pc100_clk_dout_d0_bus_get_rate,
189};
205 190
206int s5pc1xx_sclk0_ctrl(struct clk *clk, int enable) 191static unsigned long s5pc100_clk_dout_pclkd0_get_rate(struct clk *clk)
207{ 192{
208 return s5pc1xx_clk_gate(S5PC100_SCLKGATE0, clk, enable); 193 unsigned long rate = clk_get_rate(clk->parent);
194 unsigned int ratio;
195
196 ratio = __raw_readl(S5PC100_CLKDIV0) & S5PC100_CLKDIV0_PCLKD0_MASK;
197 ratio >>= S5PC100_CLKDIV0_PCLKD0_SHIFT;
198
199 return rate / (ratio + 1);
209} 200}
210 201
211int s5pc1xx_sclk1_ctrl(struct clk *clk, int enable) 202static struct clk clk_dout_pclkd0 = {
203 .name = "dout_pclkd0",
204 .id = -1,
205 .parent = &clk_dout_d0_bus,
206 .get_rate = s5pc100_clk_dout_pclkd0_get_rate,
207};
208
209static unsigned long s5pc100_clk_dout_apll2_get_rate(struct clk *clk)
212{ 210{
213 return s5pc1xx_clk_gate(S5PC100_SCLKGATE1, clk, enable); 211 unsigned long rate = clk_get_rate(clk->parent);
212 unsigned int ratio;
213
214 ratio = __raw_readl(S5PC100_CLKDIV1) & S5PC100_CLKDIV1_APLL2_MASK;
215 ratio >>= S5PC100_CLKDIV1_APLL2_SHIFT;
216
217 return rate / (ratio + 1);
214} 218}
215 219
216static struct clk init_clocks_disable[] = { 220static struct clk clk_dout_apll2 = {
217 { 221 .name = "dout_apll2",
218 .name = "dsi", 222 .id = -1,
219 .id = -1, 223 .parent = &clk_mout_apll.clk,
220 .parent = &clk_p, 224 .get_rate = s5pc100_clk_dout_apll2_get_rate,
221 .enable = s5pc1xx_clk_d11_ctrl,
222 .ctrlbit = S5PC100_CLKGATE_D11_DSI,
223 }, {
224 .name = "csi",
225 .id = -1,
226 .parent = &clk_h,
227 .enable = s5pc1xx_clk_d11_ctrl,
228 .ctrlbit = S5PC100_CLKGATE_D11_CSI,
229 }, {
230 .name = "ccan0",
231 .id = 0,
232 .parent = &clk_p,
233 .enable = s5pc1xx_clk_d14_ctrl,
234 .ctrlbit = S5PC100_CLKGATE_D14_CCAN0,
235 }, {
236 .name = "ccan1",
237 .id = 1,
238 .parent = &clk_p,
239 .enable = s5pc1xx_clk_d14_ctrl,
240 .ctrlbit = S5PC100_CLKGATE_D14_CCAN1,
241 }, {
242 .name = "keypad",
243 .id = -1,
244 .parent = &clk_p,
245 .enable = s5pc1xx_clk_d15_ctrl,
246 .ctrlbit = S5PC100_CLKGATE_D15_KEYIF,
247 }, {
248 .name = "hclkd2",
249 .id = -1,
250 .parent = NULL,
251 .enable = s5pc1xx_clk_d20_ctrl,
252 .ctrlbit = S5PC100_CLKGATE_D20_HCLKD2,
253 }, {
254 .name = "iis-d2",
255 .id = -1,
256 .parent = NULL,
257 .enable = s5pc1xx_clk_d20_ctrl,
258 .ctrlbit = S5PC100_CLKGATE_D20_I2SD2,
259 }, {
260 .name = "otg",
261 .id = -1,
262 .parent = &clk_h,
263 .enable = s5pc1xx_clk_d10_ctrl,
264 .ctrlbit = S5PC100_CLKGATE_D10_USBOTG,
265 },
266}; 225};
267 226
268static struct clk init_clocks[] = { 227/* MPLL */
269 /* System1 (D0_0) devices */ 228static struct clk *clk_src_mpll_list[] = {
270 { 229 [0] = &clk_fin_mpll,
271 .name = "intc", 230 [1] = &clk_fout_mpll,
272 .id = -1, 231};
273 .parent = &clk_hd0,
274 .enable = s5pc1xx_clk_d00_ctrl,
275 .ctrlbit = S5PC100_CLKGATE_D00_INTC,
276 }, {
277 .name = "tzic",
278 .id = -1,
279 .parent = &clk_hd0,
280 .enable = s5pc1xx_clk_d00_ctrl,
281 .ctrlbit = S5PC100_CLKGATE_D00_TZIC,
282 }, {
283 .name = "cf-ata",
284 .id = -1,
285 .parent = &clk_hd0,
286 .enable = s5pc1xx_clk_d00_ctrl,
287 .ctrlbit = S5PC100_CLKGATE_D00_CFCON,
288 }, {
289 .name = "mdma",
290 .id = -1,
291 .parent = &clk_hd0,
292 .enable = s5pc1xx_clk_d00_ctrl,
293 .ctrlbit = S5PC100_CLKGATE_D00_MDMA,
294 }, {
295 .name = "g2d",
296 .id = -1,
297 .parent = &clk_hd0,
298 .enable = s5pc1xx_clk_d00_ctrl,
299 .ctrlbit = S5PC100_CLKGATE_D00_G2D,
300 }, {
301 .name = "secss",
302 .id = -1,
303 .parent = &clk_hd0,
304 .enable = s5pc1xx_clk_d00_ctrl,
305 .ctrlbit = S5PC100_CLKGATE_D00_SECSS,
306 }, {
307 .name = "cssys",
308 .id = -1,
309 .parent = &clk_hd0,
310 .enable = s5pc1xx_clk_d00_ctrl,
311 .ctrlbit = S5PC100_CLKGATE_D00_CSSYS,
312 },
313 232
314 /* Memory (D0_1) devices */ 233static struct clk_sources clk_src_mpll = {
315 { 234 .sources = clk_src_mpll_list,
316 .name = "dmc", 235 .nr_sources = ARRAY_SIZE(clk_src_mpll_list),
317 .id = -1, 236};
318 .parent = &clk_hd0,
319 .enable = s5pc1xx_clk_d01_ctrl,
320 .ctrlbit = S5PC100_CLKGATE_D01_DMC,
321 }, {
322 .name = "sromc",
323 .id = -1,
324 .parent = &clk_hd0,
325 .enable = s5pc1xx_clk_d01_ctrl,
326 .ctrlbit = S5PC100_CLKGATE_D01_SROMC,
327 }, {
328 .name = "onenand",
329 .id = -1,
330 .parent = &clk_hd0,
331 .enable = s5pc1xx_clk_d01_ctrl,
332 .ctrlbit = S5PC100_CLKGATE_D01_ONENAND,
333 }, {
334 .name = "nand",
335 .id = -1,
336 .parent = &clk_hd0,
337 .enable = s5pc1xx_clk_d01_ctrl,
338 .ctrlbit = S5PC100_CLKGATE_D01_NFCON,
339 }, {
340 .name = "intmem",
341 .id = -1,
342 .parent = &clk_hd0,
343 .enable = s5pc1xx_clk_d01_ctrl,
344 .ctrlbit = S5PC100_CLKGATE_D01_INTMEM,
345 }, {
346 .name = "ebi",
347 .id = -1,
348 .parent = &clk_hd0,
349 .enable = s5pc1xx_clk_d01_ctrl,
350 .ctrlbit = S5PC100_CLKGATE_D01_EBI,
351 },
352 237
353 /* System2 (D0_2) devices */ 238static struct clksrc_clk clk_mout_mpll = {
354 { 239 .clk = {
355 .name = "seckey", 240 .name = "mout_mpll",
356 .id = -1,
357 .parent = &clk_pd0,
358 .enable = s5pc1xx_clk_d02_ctrl,
359 .ctrlbit = S5PC100_CLKGATE_D02_SECKEY,
360 }, {
361 .name = "sdm",
362 .id = -1, 241 .id = -1,
363 .parent = &clk_hd0,
364 .enable = s5pc1xx_clk_d02_ctrl,
365 .ctrlbit = S5PC100_CLKGATE_D02_SDM,
366 }, 242 },
243 .shift = S5PC100_CLKSRC0_MPLL_SHIFT,
244 .mask = S5PC100_CLKSRC0_MPLL_MASK,
245 .sources = &clk_src_mpll,
246 .reg_source = S5PC100_CLKSRC0,
247};
367 248
368 /* File (D1_0) devices */ 249static struct clk *clkset_am_list[] = {
369 { 250 [0] = &clk_mout_mpll.clk,
370 .name = "pdma0", 251 [1] = &clk_dout_apll2,
371 .id = -1, 252};
372 .parent = &clk_h,
373 .enable = s5pc1xx_clk_d10_ctrl,
374 .ctrlbit = S5PC100_CLKGATE_D10_PDMA0,
375 }, {
376 .name = "pdma1",
377 .id = -1,
378 .parent = &clk_h,
379 .enable = s5pc1xx_clk_d10_ctrl,
380 .ctrlbit = S5PC100_CLKGATE_D10_PDMA1,
381 }, {
382 .name = "usb-host",
383 .id = -1,
384 .parent = &clk_h,
385 .enable = s5pc1xx_clk_d10_ctrl,
386 .ctrlbit = S5PC100_CLKGATE_D10_USBHOST,
387 }, {
388 .name = "modem",
389 .id = -1,
390 .parent = &clk_h,
391 .enable = s5pc1xx_clk_d10_ctrl,
392 .ctrlbit = S5PC100_CLKGATE_D10_MODEMIF,
393 }, {
394 .name = "hsmmc",
395 .id = 0,
396 .parent = &clk_h,
397 .enable = s5pc1xx_clk_d10_ctrl,
398 .ctrlbit = S5PC100_CLKGATE_D10_HSMMC0,
399 }, {
400 .name = "hsmmc",
401 .id = 1,
402 .parent = &clk_h,
403 .enable = s5pc1xx_clk_d10_ctrl,
404 .ctrlbit = S5PC100_CLKGATE_D10_HSMMC1,
405 }, {
406 .name = "hsmmc",
407 .id = 2,
408 .parent = &clk_h,
409 .enable = s5pc1xx_clk_d10_ctrl,
410 .ctrlbit = S5PC100_CLKGATE_D10_HSMMC2,
411 },
412 253
413 /* Multimedia1 (D1_1) devices */ 254static struct clk_sources clk_src_am = {
414 { 255 .sources = clkset_am_list,
415 .name = "lcd", 256 .nr_sources = ARRAY_SIZE(clkset_am_list),
416 .id = -1, 257};
417 .parent = &clk_h,
418 .enable = s5pc1xx_clk_d11_ctrl,
419 .ctrlbit = S5PC100_CLKGATE_D11_LCD,
420 }, {
421 .name = "rotator",
422 .id = -1,
423 .parent = &clk_h,
424 .enable = s5pc1xx_clk_d11_ctrl,
425 .ctrlbit = S5PC100_CLKGATE_D11_ROTATOR,
426 }, {
427 .name = "fimc",
428 .id = 0,
429 .parent = &clk_h,
430 .enable = s5pc1xx_clk_d11_ctrl,
431 .ctrlbit = S5PC100_CLKGATE_D11_FIMC0,
432 }, {
433 .name = "fimc",
434 .id = 1,
435 .parent = &clk_h,
436 .enable = s5pc1xx_clk_d11_ctrl,
437 .ctrlbit = S5PC100_CLKGATE_D11_FIMC1,
438 }, {
439 .name = "fimc",
440 .id = 2,
441 .parent = &clk_h,
442 .enable = s5pc1xx_clk_d11_ctrl,
443 .ctrlbit = S5PC100_CLKGATE_D11_FIMC2,
444 }, {
445 .name = "jpeg",
446 .id = -1,
447 .parent = &clk_h,
448 .enable = s5pc1xx_clk_d11_ctrl,
449 .ctrlbit = S5PC100_CLKGATE_D11_JPEG,
450 }, {
451 .name = "g3d",
452 .id = -1,
453 .parent = &clk_h,
454 .enable = s5pc1xx_clk_d11_ctrl,
455 .ctrlbit = S5PC100_CLKGATE_D11_G3D,
456 },
457 258
458 /* Multimedia2 (D1_2) devices */ 259static struct clksrc_clk clk_mout_am = {
459 { 260 .clk = {
460 .name = "tv", 261 .name = "mout_am",
461 .id = -1,
462 .parent = &clk_h,
463 .enable = s5pc1xx_clk_d12_ctrl,
464 .ctrlbit = S5PC100_CLKGATE_D12_TV,
465 }, {
466 .name = "vp",
467 .id = -1,
468 .parent = &clk_h,
469 .enable = s5pc1xx_clk_d12_ctrl,
470 .ctrlbit = S5PC100_CLKGATE_D12_VP,
471 }, {
472 .name = "mixer",
473 .id = -1,
474 .parent = &clk_h,
475 .enable = s5pc1xx_clk_d12_ctrl,
476 .ctrlbit = S5PC100_CLKGATE_D12_MIXER,
477 }, {
478 .name = "hdmi",
479 .id = -1,
480 .parent = &clk_h,
481 .enable = s5pc1xx_clk_d12_ctrl,
482 .ctrlbit = S5PC100_CLKGATE_D12_HDMI,
483 }, {
484 .name = "mfc",
485 .id = -1, 262 .id = -1,
486 .parent = &clk_h,
487 .enable = s5pc1xx_clk_d12_ctrl,
488 .ctrlbit = S5PC100_CLKGATE_D12_MFC,
489 }, 263 },
264 .shift = S5PC100_CLKSRC0_AMMUX_SHIFT,
265 .mask = S5PC100_CLKSRC0_AMMUX_MASK,
266 .sources = &clk_src_am,
267 .reg_source = S5PC100_CLKSRC0,
268};
490 269
491 /* System (D1_3) devices */ 270static unsigned long s5pc100_clk_dout_d1_bus_get_rate(struct clk *clk)
492 { 271{
493 .name = "chipid", 272 unsigned long rate = clk_get_rate(clk->parent);
494 .id = -1, 273 unsigned int ratio;
495 .parent = &clk_p,
496 .enable = s5pc1xx_clk_d13_ctrl,
497 .ctrlbit = S5PC100_CLKGATE_D13_CHIPID,
498 }, {
499 .name = "gpio",
500 .id = -1,
501 .parent = &clk_p,
502 .enable = s5pc1xx_clk_d13_ctrl,
503 .ctrlbit = S5PC100_CLKGATE_D13_GPIO,
504 }, {
505 .name = "apc",
506 .id = -1,
507 .parent = &clk_p,
508 .enable = s5pc1xx_clk_d13_ctrl,
509 .ctrlbit = S5PC100_CLKGATE_D13_APC,
510 }, {
511 .name = "iec",
512 .id = -1,
513 .parent = &clk_p,
514 .enable = s5pc1xx_clk_d13_ctrl,
515 .ctrlbit = S5PC100_CLKGATE_D13_IEC,
516 }, {
517 .name = "timers",
518 .id = -1,
519 .parent = &clk_p,
520 .enable = s5pc1xx_clk_d13_ctrl,
521 .ctrlbit = S5PC100_CLKGATE_D13_PWM,
522 }, {
523 .name = "systimer",
524 .id = -1,
525 .parent = &clk_p,
526 .enable = s5pc1xx_clk_d13_ctrl,
527 .ctrlbit = S5PC100_CLKGATE_D13_SYSTIMER,
528 }, {
529 .name = "watchdog",
530 .id = -1,
531 .parent = &clk_p,
532 .enable = s5pc1xx_clk_d13_ctrl,
533 .ctrlbit = S5PC100_CLKGATE_D13_WDT,
534 }, {
535 .name = "rtc",
536 .id = -1,
537 .parent = &clk_p,
538 .enable = s5pc1xx_clk_d13_ctrl,
539 .ctrlbit = S5PC100_CLKGATE_D13_RTC,
540 },
541 274
542 /* Connectivity (D1_4) devices */ 275 printk(KERN_DEBUG "%s: parent is %ld\n", __func__, rate);
543 {
544 .name = "uart",
545 .id = 0,
546 .parent = &clk_p,
547 .enable = s5pc1xx_clk_d14_ctrl,
548 .ctrlbit = S5PC100_CLKGATE_D14_UART0,
549 }, {
550 .name = "uart",
551 .id = 1,
552 .parent = &clk_p,
553 .enable = s5pc1xx_clk_d14_ctrl,
554 .ctrlbit = S5PC100_CLKGATE_D14_UART1,
555 }, {
556 .name = "uart",
557 .id = 2,
558 .parent = &clk_p,
559 .enable = s5pc1xx_clk_d14_ctrl,
560 .ctrlbit = S5PC100_CLKGATE_D14_UART2,
561 }, {
562 .name = "uart",
563 .id = 3,
564 .parent = &clk_p,
565 .enable = s5pc1xx_clk_d14_ctrl,
566 .ctrlbit = S5PC100_CLKGATE_D14_UART3,
567 }, {
568 .name = "i2c",
569 .id = -1,
570 .parent = &clk_p,
571 .enable = s5pc1xx_clk_d14_ctrl,
572 .ctrlbit = S5PC100_CLKGATE_D14_IIC,
573 }, {
574 .name = "hdmi-i2c",
575 .id = -1,
576 .parent = &clk_p,
577 .enable = s5pc1xx_clk_d14_ctrl,
578 .ctrlbit = S5PC100_CLKGATE_D14_HDMI_IIC,
579 }, {
580 .name = "spi",
581 .id = 0,
582 .parent = &clk_p,
583 .enable = s5pc1xx_clk_d14_ctrl,
584 .ctrlbit = S5PC100_CLKGATE_D14_SPI0,
585 }, {
586 .name = "spi",
587 .id = 1,
588 .parent = &clk_p,
589 .enable = s5pc1xx_clk_d14_ctrl,
590 .ctrlbit = S5PC100_CLKGATE_D14_SPI1,
591 }, {
592 .name = "spi",
593 .id = 2,
594 .parent = &clk_p,
595 .enable = s5pc1xx_clk_d14_ctrl,
596 .ctrlbit = S5PC100_CLKGATE_D14_SPI2,
597 }, {
598 .name = "irda",
599 .id = -1,
600 .parent = &clk_p,
601 .enable = s5pc1xx_clk_d14_ctrl,
602 .ctrlbit = S5PC100_CLKGATE_D14_IRDA,
603 }, {
604 .name = "hsitx",
605 .id = -1,
606 .parent = &clk_p,
607 .enable = s5pc1xx_clk_d14_ctrl,
608 .ctrlbit = S5PC100_CLKGATE_D14_HSITX,
609 }, {
610 .name = "hsirx",
611 .id = -1,
612 .parent = &clk_p,
613 .enable = s5pc1xx_clk_d14_ctrl,
614 .ctrlbit = S5PC100_CLKGATE_D14_HSIRX,
615 },
616 276
617 /* Audio (D1_5) devices */ 277 ratio = __raw_readl(S5PC100_CLKDIV1) & S5PC100_CLKDIV1_D1_MASK;
618 { 278 ratio >>= S5PC100_CLKDIV1_D1_SHIFT;
619 .name = "iis",
620 .id = 0,
621 .parent = &clk_p,
622 .enable = s5pc1xx_clk_d15_ctrl,
623 .ctrlbit = S5PC100_CLKGATE_D15_IIS0,
624 }, {
625 .name = "iis",
626 .id = 1,
627 .parent = &clk_p,
628 .enable = s5pc1xx_clk_d15_ctrl,
629 .ctrlbit = S5PC100_CLKGATE_D15_IIS1,
630 }, {
631 .name = "iis",
632 .id = 2,
633 .parent = &clk_p,
634 .enable = s5pc1xx_clk_d15_ctrl,
635 .ctrlbit = S5PC100_CLKGATE_D15_IIS2,
636 }, {
637 .name = "ac97",
638 .id = -1,
639 .parent = &clk_p,
640 .enable = s5pc1xx_clk_d15_ctrl,
641 .ctrlbit = S5PC100_CLKGATE_D15_AC97,
642 }, {
643 .name = "pcm",
644 .id = 0,
645 .parent = &clk_p,
646 .enable = s5pc1xx_clk_d15_ctrl,
647 .ctrlbit = S5PC100_CLKGATE_D15_PCM0,
648 }, {
649 .name = "pcm",
650 .id = 1,
651 .parent = &clk_p,
652 .enable = s5pc1xx_clk_d15_ctrl,
653 .ctrlbit = S5PC100_CLKGATE_D15_PCM1,
654 }, {
655 .name = "spdif",
656 .id = -1,
657 .parent = &clk_p,
658 .enable = s5pc1xx_clk_d15_ctrl,
659 .ctrlbit = S5PC100_CLKGATE_D15_SPDIF,
660 }, {
661 .name = "adc",
662 .id = -1,
663 .parent = &clk_p,
664 .enable = s5pc1xx_clk_d15_ctrl,
665 .ctrlbit = S5PC100_CLKGATE_D15_TSADC,
666 }, {
667 .name = "keyif",
668 .id = -1,
669 .parent = &clk_p,
670 .enable = s5pc1xx_clk_d15_ctrl,
671 .ctrlbit = S5PC100_CLKGATE_D15_KEYIF,
672 }, {
673 .name = "cg",
674 .id = -1,
675 .parent = &clk_p,
676 .enable = s5pc1xx_clk_d15_ctrl,
677 .ctrlbit = S5PC100_CLKGATE_D15_CG,
678 },
679 279
680 /* Audio (D2_0) devices: all disabled */ 280 return rate / (ratio + 1);
281}
681 282
682 /* Special Clocks 1 */ 283static struct clk clk_dout_d1_bus = {
683 { 284 .name = "dout_d1_bus",
684 .name = "sclk_hpm", 285 .id = -1,
685 .id = -1, 286 .parent = &clk_mout_am.clk,
686 .parent = NULL, 287 .get_rate = s5pc100_clk_dout_d1_bus_get_rate,
687 .enable = s5pc1xx_sclk0_ctrl, 288};
688 .ctrlbit = S5PC1XX_CLKGATE_SCLK0_HPM,
689 }, {
690 .name = "sclk_onenand",
691 .id = -1,
692 .parent = NULL,
693 .enable = s5pc1xx_sclk0_ctrl,
694 .ctrlbit = S5PC100_CLKGATE_SCLK0_ONENAND,
695 }, {
696 .name = "sclk_spi_48",
697 .id = 0,
698 .parent = &clk_48m,
699 .enable = s5pc1xx_sclk0_ctrl,
700 .ctrlbit = S5PC100_CLKGATE_SCLK0_SPI0_48,
701 }, {
702 .name = "sclk_spi_48",
703 .id = 1,
704 .parent = &clk_48m,
705 .enable = s5pc1xx_sclk0_ctrl,
706 .ctrlbit = S5PC100_CLKGATE_SCLK0_SPI1_48,
707 }, {
708 .name = "sclk_spi_48",
709 .id = 2,
710 .parent = &clk_48m,
711 .enable = s5pc1xx_sclk0_ctrl,
712 .ctrlbit = S5PC100_CLKGATE_SCLK0_SPI2_48,
713 }, {
714 .name = "sclk_mmc_48",
715 .id = 0,
716 .parent = &clk_48m,
717 .enable = s5pc1xx_sclk0_ctrl,
718 .ctrlbit = S5PC100_CLKGATE_SCLK0_MMC0_48,
719 }, {
720 .name = "sclk_mmc_48",
721 .id = 1,
722 .parent = &clk_48m,
723 .enable = s5pc1xx_sclk0_ctrl,
724 .ctrlbit = S5PC100_CLKGATE_SCLK0_MMC1_48,
725 }, {
726 .name = "sclk_mmc_48",
727 .id = 2,
728 .parent = &clk_48m,
729 .enable = s5pc1xx_sclk0_ctrl,
730 .ctrlbit = S5PC100_CLKGATE_SCLK0_MMC2_48,
731 },
732 289
733 /* Special Clocks 2 */ 290static struct clk *clkset_onenand_list[] = {
734 { 291 [0] = &clk_dout_d0_bus,
735 .name = "sclk_tv_54", 292 [1] = &clk_dout_d1_bus,
736 .id = -1, 293};
737 .parent = &clk_54m, 294
738 .enable = s5pc1xx_sclk1_ctrl, 295static struct clk_sources clk_src_onenand = {
739 .ctrlbit = S5PC100_CLKGATE_SCLK1_TV54, 296 .sources = clkset_onenand_list,
740 }, { 297 .nr_sources = ARRAY_SIZE(clkset_onenand_list),
741 .name = "sclk_vdac_54", 298};
742 .id = -1, 299
743 .parent = &clk_54m, 300static struct clksrc_clk clk_mout_onenand = {
744 .enable = s5pc1xx_sclk1_ctrl, 301 .clk = {
745 .ctrlbit = S5PC100_CLKGATE_SCLK1_VDAC54, 302 .name = "mout_onenand",
746 }, {
747 .name = "sclk_spdif",
748 .id = -1, 303 .id = -1,
749 .parent = NULL,
750 .enable = s5pc1xx_sclk1_ctrl,
751 .ctrlbit = S5PC100_CLKGATE_SCLK1_SPDIF,
752 }, 304 },
305 .shift = S5PC100_CLKSRC0_ONENAND_SHIFT,
306 .mask = S5PC100_CLKSRC0_ONENAND_MASK,
307 .sources = &clk_src_onenand,
308 .reg_source = S5PC100_CLKSRC0,
753}; 309};
754 310
755void __init s5pc1xx_register_clocks(void) 311static unsigned long s5pc100_clk_dout_pclkd1_get_rate(struct clk *clk)
756{ 312{
757 struct clk *clkp; 313 unsigned long rate = clk_get_rate(clk->parent);
758 int ret; 314 unsigned int ratio;
759 int ptr;
760 315
761 clkp = init_clocks; 316 printk(KERN_DEBUG "%s: parent is %ld\n", __func__, rate);
762 for (ptr = 0; ptr < ARRAY_SIZE(init_clocks); ptr++, clkp++) {
763 ret = s3c24xx_register_clock(clkp);
764 if (ret < 0) {
765 printk(KERN_ERR "Failed to register clock %s (%d)\n",
766 clkp->name, ret);
767 }
768 }
769 317
770 clkp = init_clocks_disable; 318 ratio = __raw_readl(S5PC100_CLKDIV1) & S5PC100_CLKDIV1_PCLKD1_MASK;
771 for (ptr = 0; ptr < ARRAY_SIZE(init_clocks_disable); ptr++, clkp++) { 319 ratio >>= S5PC100_CLKDIV1_PCLKD1_SHIFT;
772 320
773 ret = s3c24xx_register_clock(clkp); 321 return rate / (ratio + 1);
774 if (ret < 0) { 322}
775 printk(KERN_ERR "Failed to register clock %s (%d)\n",
776 clkp->name, ret);
777 }
778 323
779 (clkp->enable)(clkp, 0); 324static struct clk clk_dout_pclkd1 = {
780 } 325 .name = "dout_pclkd1",
326 .id = -1,
327 .parent = &clk_dout_d1_bus,
328 .get_rate = s5pc100_clk_dout_pclkd1_get_rate,
329};
330
331static unsigned long s5pc100_clk_dout_mpll2_get_rate(struct clk *clk)
332{
333 unsigned long rate = clk_get_rate(clk->parent);
334 unsigned int ratio;
335
336 printk(KERN_DEBUG "%s: parent is %ld\n", __func__, rate);
337
338 ratio = __raw_readl(S5PC100_CLKDIV1) & S5PC100_CLKDIV1_MPLL2_MASK;
339 ratio >>= S5PC100_CLKDIV1_MPLL2_SHIFT;
781 340
782 s3c_pwmclk_init(); 341 return rate / (ratio + 1);
783} 342}
784static struct clk clk_fout_apll = { 343
785 .name = "fout_apll", 344static struct clk clk_dout_mpll2 = {
345 .name = "dout_mpll2",
786 .id = -1, 346 .id = -1,
347 .parent = &clk_mout_am.clk,
348 .get_rate = s5pc100_clk_dout_mpll2_get_rate,
787}; 349};
788 350
789static struct clk *clk_src_apll_list[] = { 351static unsigned long s5pc100_clk_dout_cam_get_rate(struct clk *clk)
790 [0] = &clk_fin_apll, 352{
791 [1] = &clk_fout_apll, 353 unsigned long rate = clk_get_rate(clk->parent);
792}; 354 unsigned int ratio;
793 355
794static struct clk_sources clk_src_apll = { 356 printk(KERN_DEBUG "%s: parent is %ld\n", __func__, rate);
795 .sources = clk_src_apll_list, 357
796 .nr_sources = ARRAY_SIZE(clk_src_apll_list), 358 ratio = __raw_readl(S5PC100_CLKDIV1) & S5PC100_CLKDIV1_CAM_MASK;
359 ratio >>= S5PC100_CLKDIV1_CAM_SHIFT;
360
361 return rate / (ratio + 1);
362}
363
364static struct clk clk_dout_cam = {
365 .name = "dout_cam",
366 .id = -1,
367 .parent = &clk_dout_mpll2,
368 .get_rate = s5pc100_clk_dout_cam_get_rate,
797}; 369};
798 370
799static struct clksrc_clk clk_mout_apll = { 371static unsigned long s5pc100_clk_dout_mpll_get_rate(struct clk *clk)
800 .clk = { 372{
801 .name = "mout_apll", 373 unsigned long rate = clk_get_rate(clk->parent);
802 .id = -1, 374 unsigned int ratio;
803 }, 375
804 .shift = S5PC1XX_CLKSRC0_APLL_SHIFT, 376 printk(KERN_DEBUG "%s: parent is %ld\n", __func__, rate);
805 .mask = S5PC1XX_CLKSRC0_APLL_MASK, 377
806 .sources = &clk_src_apll, 378 ratio = __raw_readl(S5PC100_CLKDIV1) & S5PC100_CLKDIV1_MPLL_MASK;
807 .reg_source = S5PC1XX_CLK_SRC0, 379 ratio >>= S5PC100_CLKDIV1_MPLL_SHIFT;
380
381 return rate / (ratio + 1);
382}
383
384static struct clk clk_dout_mpll = {
385 .name = "dout_mpll",
386 .id = -1,
387 .parent = &clk_mout_am.clk,
388 .get_rate = s5pc100_clk_dout_mpll_get_rate,
808}; 389};
809 390
391/* EPLL */
810static struct clk clk_fout_epll = { 392static struct clk clk_fout_epll = {
811 .name = "fout_epll", 393 .name = "fout_epll",
812 .id = -1, 394 .id = -1,
@@ -827,91 +409,57 @@ static struct clksrc_clk clk_mout_epll = {
827 .name = "mout_epll", 409 .name = "mout_epll",
828 .id = -1, 410 .id = -1,
829 }, 411 },
830 .shift = S5PC1XX_CLKSRC0_EPLL_SHIFT, 412 .shift = S5PC100_CLKSRC0_EPLL_SHIFT,
831 .mask = S5PC1XX_CLKSRC0_EPLL_MASK, 413 .mask = S5PC100_CLKSRC0_EPLL_MASK,
832 .sources = &clk_src_epll, 414 .sources = &clk_src_epll,
833 .reg_source = S5PC1XX_CLK_SRC0, 415 .reg_source = S5PC100_CLKSRC0,
834}; 416};
835 417
836static struct clk *clk_src_mpll_list[] = { 418/* HPLL */
837 [0] = &clk_fin_mpll, 419static struct clk clk_fout_hpll = {
838 [1] = &clk_fout_mpll, 420 .name = "fout_hpll",
839};
840
841static struct clk_sources clk_src_mpll = {
842 .sources = clk_src_mpll_list,
843 .nr_sources = ARRAY_SIZE(clk_src_mpll_list),
844};
845
846static struct clksrc_clk clk_mout_mpll = {
847 .clk = {
848 .name = "mout_mpll",
849 .id = -1,
850 },
851 .shift = S5PC1XX_CLKSRC0_MPLL_SHIFT,
852 .mask = S5PC1XX_CLKSRC0_MPLL_MASK,
853 .sources = &clk_src_mpll,
854 .reg_source = S5PC1XX_CLK_SRC0,
855};
856
857static unsigned long s5pc1xx_clk_doutmpll_get_rate(struct clk *clk)
858{
859 unsigned long rate = clk_get_rate(clk->parent);
860 unsigned long clkdiv;
861
862 printk(KERN_DEBUG "%s: parent is %ld\n", __func__, rate);
863
864 clkdiv = __raw_readl(S5PC1XX_CLK_DIV1) & S5PC100_CLKDIV1_MPLL_MASK;
865 rate /= (clkdiv >> S5PC100_CLKDIV1_MPLL_SHIFT) + 1;
866
867 return rate;
868}
869
870static struct clk clk_dout_mpll = {
871 .name = "dout_mpll",
872 .id = -1, 421 .id = -1,
873 .parent = &clk_mout_mpll.clk,
874 .get_rate = s5pc1xx_clk_doutmpll_get_rate,
875}; 422};
876 423
877static unsigned long s5pc1xx_clk_doutmpll2_get_rate(struct clk *clk) 424static struct clk *clk_src_hpll_list[] = {
878{ 425 [0] = &clk_27m,
879 unsigned long rate = clk_get_rate(clk->parent); 426 [1] = &clk_fout_hpll,
880 unsigned long clkdiv;
881
882 printk(KERN_DEBUG "%s: parent is %ld\n", __func__, rate);
883
884 clkdiv = __raw_readl(S5PC1XX_CLK_DIV1) & S5PC100_CLKDIV1_MPLL2_MASK;
885 rate /= (clkdiv >> S5PC100_CLKDIV1_MPLL2_SHIFT) + 1;
886
887 return rate;
888}
889
890struct clk clk_dout_mpll2 = {
891 .name = "dout_mpll2",
892 .id = -1,
893 .parent = &clk_mout_mpll.clk,
894 .get_rate = s5pc1xx_clk_doutmpll2_get_rate,
895}; 427};
896 428
897static struct clk *clkset_uart_list[] = { 429static struct clk_sources clk_src_hpll = {
898 &clk_mout_epll.clk, 430 .sources = clk_src_hpll_list,
899 &clk_dout_mpll, 431 .nr_sources = ARRAY_SIZE(clk_src_hpll_list),
900 NULL,
901 NULL
902}; 432};
903 433
904static struct clk_sources clkset_uart = { 434static struct clksrc_clk clk_mout_hpll = {
905 .sources = clkset_uart_list, 435 .clk = {
906 .nr_sources = ARRAY_SIZE(clkset_uart_list), 436 .name = "mout_hpll",
437 .id = -1,
438 },
439 .shift = S5PC100_CLKSRC0_HPLL_SHIFT,
440 .mask = S5PC100_CLKSRC0_HPLL_MASK,
441 .sources = &clk_src_hpll,
442 .reg_source = S5PC100_CLKSRC0,
907}; 443};
908 444
445/* Peripherals */
446/*
447 * The peripheral clocks are all controlled via clocksource followed
448 * by an optional divider and gate stage. We currently roll this into
449 * one clock which hides the intermediate clock from the mux.
450 *
451 * Note, the JPEG clock can only be an even divider...
452 *
453 * The scaler and LCD clocks depend on the S5PC100 version, and also
454 * have a common parent divisor so are not included here.
455 */
456
909static inline struct clksrc_clk *to_clksrc(struct clk *clk) 457static inline struct clksrc_clk *to_clksrc(struct clk *clk)
910{ 458{
911 return container_of(clk, struct clksrc_clk, clk); 459 return container_of(clk, struct clksrc_clk, clk);
912} 460}
913 461
914static unsigned long s5pc1xx_getrate_clksrc(struct clk *clk) 462static unsigned long s5pc100_getrate_clksrc(struct clk *clk)
915{ 463{
916 struct clksrc_clk *sclk = to_clksrc(clk); 464 struct clksrc_clk *sclk = to_clksrc(clk);
917 unsigned long rate = clk_get_rate(clk->parent); 465 unsigned long rate = clk_get_rate(clk->parent);
@@ -925,7 +473,7 @@ static unsigned long s5pc1xx_getrate_clksrc(struct clk *clk)
925 return rate; 473 return rate;
926} 474}
927 475
928static int s5pc1xx_setrate_clksrc(struct clk *clk, unsigned long rate) 476static int s5pc100_setrate_clksrc(struct clk *clk, unsigned long rate)
929{ 477{
930 struct clksrc_clk *sclk = to_clksrc(clk); 478 struct clksrc_clk *sclk = to_clksrc(clk);
931 void __iomem *reg = sclk->reg_divider; 479 void __iomem *reg = sclk->reg_divider;
@@ -938,14 +486,14 @@ static int s5pc1xx_setrate_clksrc(struct clk *clk, unsigned long rate)
938 return -EINVAL; 486 return -EINVAL;
939 487
940 val = __raw_readl(reg); 488 val = __raw_readl(reg);
941 val &= ~(0xf << sclk->shift); 489 val &= ~(0xf << sclk->divider_shift);
942 val |= (div - 1) << sclk->shift; 490 val |= (div - 1) << sclk->divider_shift;
943 __raw_writel(val, reg); 491 __raw_writel(val, reg);
944 492
945 return 0; 493 return 0;
946} 494}
947 495
948static int s5pc1xx_setparent_clksrc(struct clk *clk, struct clk *parent) 496static int s5pc100_setparent_clksrc(struct clk *clk, struct clk *parent)
949{ 497{
950 struct clksrc_clk *sclk = to_clksrc(clk); 498 struct clksrc_clk *sclk = to_clksrc(clk);
951 struct clk_sources *srcs = sclk->sources; 499 struct clk_sources *srcs = sclk->sources;
@@ -970,7 +518,7 @@ static int s5pc1xx_setparent_clksrc(struct clk *clk, struct clk *parent)
970 return -EINVAL; 518 return -EINVAL;
971} 519}
972 520
973static unsigned long s5pc1xx_roundrate_clksrc(struct clk *clk, 521static unsigned long s5pc100_roundrate_clksrc(struct clk *clk,
974 unsigned long rate) 522 unsigned long rate)
975{ 523{
976 unsigned long parent_rate = clk_get_rate(clk->parent); 524 unsigned long parent_rate = clk_get_rate(clk->parent);
@@ -992,35 +540,466 @@ static unsigned long s5pc1xx_roundrate_clksrc(struct clk *clk,
992 return rate; 540 return rate;
993} 541}
994 542
543static struct clk *clkset_spi_list[] = {
544 &clk_mout_epll.clk,
545 &clk_dout_mpll2,
546 &clk_fin_epll,
547 &clk_mout_hpll.clk,
548};
549
550static struct clk_sources clkset_spi = {
551 .sources = clkset_spi_list,
552 .nr_sources = ARRAY_SIZE(clkset_spi_list),
553};
554
555static struct clksrc_clk clk_spi0 = {
556 .clk = {
557 .name = "spi_bus",
558 .id = 0,
559 .ctrlbit = S5PC100_CLKGATE_SCLK0_SPI0,
560 .enable = s5pc100_sclk0_ctrl,
561 .set_parent = s5pc100_setparent_clksrc,
562 .get_rate = s5pc100_getrate_clksrc,
563 .set_rate = s5pc100_setrate_clksrc,
564 .round_rate = s5pc100_roundrate_clksrc,
565 },
566 .shift = S5PC100_CLKSRC1_SPI0_SHIFT,
567 .mask = S5PC100_CLKSRC1_SPI0_MASK,
568 .sources = &clkset_spi,
569 .divider_shift = S5PC100_CLKDIV2_SPI0_SHIFT,
570 .reg_divider = S5PC100_CLKDIV2,
571 .reg_source = S5PC100_CLKSRC1,
572};
573
574static struct clksrc_clk clk_spi1 = {
575 .clk = {
576 .name = "spi_bus",
577 .id = 1,
578 .ctrlbit = S5PC100_CLKGATE_SCLK0_SPI1,
579 .enable = s5pc100_sclk0_ctrl,
580 .set_parent = s5pc100_setparent_clksrc,
581 .get_rate = s5pc100_getrate_clksrc,
582 .set_rate = s5pc100_setrate_clksrc,
583 .round_rate = s5pc100_roundrate_clksrc,
584 },
585 .shift = S5PC100_CLKSRC1_SPI1_SHIFT,
586 .mask = S5PC100_CLKSRC1_SPI1_MASK,
587 .sources = &clkset_spi,
588 .divider_shift = S5PC100_CLKDIV2_SPI1_SHIFT,
589 .reg_divider = S5PC100_CLKDIV2,
590 .reg_source = S5PC100_CLKSRC1,
591};
592
593static struct clksrc_clk clk_spi2 = {
594 .clk = {
595 .name = "spi_bus",
596 .id = 2,
597 .ctrlbit = S5PC100_CLKGATE_SCLK0_SPI2,
598 .enable = s5pc100_sclk0_ctrl,
599 .set_parent = s5pc100_setparent_clksrc,
600 .get_rate = s5pc100_getrate_clksrc,
601 .set_rate = s5pc100_setrate_clksrc,
602 .round_rate = s5pc100_roundrate_clksrc,
603 },
604 .shift = S5PC100_CLKSRC1_SPI2_SHIFT,
605 .mask = S5PC100_CLKSRC1_SPI2_MASK,
606 .sources = &clkset_spi,
607 .divider_shift = S5PC100_CLKDIV2_SPI2_SHIFT,
608 .reg_divider = S5PC100_CLKDIV2,
609 .reg_source = S5PC100_CLKSRC1,
610};
611
612static struct clk *clkset_uart_list[] = {
613 &clk_mout_epll.clk,
614 &clk_dout_mpll,
615};
616
617static struct clk_sources clkset_uart = {
618 .sources = clkset_uart_list,
619 .nr_sources = ARRAY_SIZE(clkset_uart_list),
620};
621
995static struct clksrc_clk clk_uart_uclk1 = { 622static struct clksrc_clk clk_uart_uclk1 = {
996 .clk = { 623 .clk = {
997 .name = "uclk1", 624 .name = "uclk1",
998 .id = -1, 625 .id = -1,
999 .ctrlbit = S5PC100_CLKGATE_SCLK0_UART, 626 .ctrlbit = S5PC100_CLKGATE_SCLK0_UART,
1000 .enable = s5pc1xx_sclk0_ctrl, 627 .enable = s5pc100_sclk0_ctrl,
1001 .set_parent = s5pc1xx_setparent_clksrc, 628 .set_parent = s5pc100_setparent_clksrc,
1002 .get_rate = s5pc1xx_getrate_clksrc, 629 .get_rate = s5pc100_getrate_clksrc,
1003 .set_rate = s5pc1xx_setrate_clksrc, 630 .set_rate = s5pc100_setrate_clksrc,
1004 .round_rate = s5pc1xx_roundrate_clksrc, 631 .round_rate = s5pc100_roundrate_clksrc,
1005 }, 632 },
1006 .shift = S5PC100_CLKSRC1_UART_SHIFT, 633 .shift = S5PC100_CLKSRC1_UART_SHIFT,
1007 .mask = S5PC100_CLKSRC1_UART_MASK, 634 .mask = S5PC100_CLKSRC1_UART_MASK,
1008 .sources = &clkset_uart, 635 .sources = &clkset_uart,
1009 .divider_shift = S5PC100_CLKDIV2_UART_SHIFT, 636 .divider_shift = S5PC100_CLKDIV2_UART_SHIFT,
1010 .reg_divider = S5PC1XX_CLK_DIV2, 637 .reg_divider = S5PC100_CLKDIV2,
1011 .reg_source = S5PC1XX_CLK_SRC1, 638 .reg_source = S5PC100_CLKSRC1,
639};
640
641static struct clk clk_iis_cd0 = {
642 .name = "iis_cdclk0",
643 .id = -1,
644};
645
646static struct clk clk_iis_cd1 = {
647 .name = "iis_cdclk1",
648 .id = -1,
649};
650
651static struct clk clk_iis_cd2 = {
652 .name = "iis_cdclk2",
653 .id = -1,
654};
655
656static struct clk clk_pcm_cd0 = {
657 .name = "pcm_cdclk0",
658 .id = -1,
659};
660
661static struct clk clk_pcm_cd1 = {
662 .name = "pcm_cdclk1",
663 .id = -1,
664};
665
666static struct clk *clkset_audio0_list[] = {
667 &clk_mout_epll.clk,
668 &clk_dout_mpll,
669 &clk_fin_epll,
670 &clk_iis_cd0,
671 &clk_pcm_cd0,
672 &clk_mout_hpll.clk,
673};
674
675static struct clk_sources clkset_audio0 = {
676 .sources = clkset_audio0_list,
677 .nr_sources = ARRAY_SIZE(clkset_audio0_list),
678};
679
680static struct clksrc_clk clk_audio0 = {
681 .clk = {
682 .name = "audio-bus",
683 .id = 0,
684 .ctrlbit = S5PC100_CLKGATE_SCLK1_AUDIO0,
685 .enable = s5pc100_sclk1_ctrl,
686 .set_parent = s5pc100_setparent_clksrc,
687 .get_rate = s5pc100_getrate_clksrc,
688 .set_rate = s5pc100_setrate_clksrc,
689 .round_rate = s5pc100_roundrate_clksrc,
690 },
691 .shift = S5PC100_CLKSRC3_AUDIO0_SHIFT,
692 .mask = S5PC100_CLKSRC3_AUDIO0_MASK,
693 .sources = &clkset_audio0,
694 .divider_shift = S5PC100_CLKDIV4_AUDIO0_SHIFT,
695 .reg_divider = S5PC100_CLKDIV4,
696 .reg_source = S5PC100_CLKSRC3,
697};
698
699static struct clk *clkset_audio1_list[] = {
700 &clk_mout_epll.clk,
701 &clk_dout_mpll,
702 &clk_fin_epll,
703 &clk_iis_cd1,
704 &clk_pcm_cd1,
705 &clk_mout_hpll.clk,
706};
707
708static struct clk_sources clkset_audio1 = {
709 .sources = clkset_audio1_list,
710 .nr_sources = ARRAY_SIZE(clkset_audio1_list),
711};
712
713static struct clksrc_clk clk_audio1 = {
714 .clk = {
715 .name = "audio-bus",
716 .id = 1,
717 .ctrlbit = S5PC100_CLKGATE_SCLK1_AUDIO1,
718 .enable = s5pc100_sclk1_ctrl,
719 .set_parent = s5pc100_setparent_clksrc,
720 .get_rate = s5pc100_getrate_clksrc,
721 .set_rate = s5pc100_setrate_clksrc,
722 .round_rate = s5pc100_roundrate_clksrc,
723 },
724 .shift = S5PC100_CLKSRC3_AUDIO1_SHIFT,
725 .mask = S5PC100_CLKSRC3_AUDIO1_MASK,
726 .sources = &clkset_audio1,
727 .divider_shift = S5PC100_CLKDIV4_AUDIO1_SHIFT,
728 .reg_divider = S5PC100_CLKDIV4,
729 .reg_source = S5PC100_CLKSRC3,
730};
731
732static struct clk *clkset_audio2_list[] = {
733 &clk_mout_epll.clk,
734 &clk_dout_mpll,
735 &clk_fin_epll,
736 &clk_iis_cd2,
737 &clk_mout_hpll.clk,
738};
739
740static struct clk_sources clkset_audio2 = {
741 .sources = clkset_audio2_list,
742 .nr_sources = ARRAY_SIZE(clkset_audio2_list),
743};
744
745static struct clksrc_clk clk_audio2 = {
746 .clk = {
747 .name = "audio-bus",
748 .id = 2,
749 .ctrlbit = S5PC100_CLKGATE_SCLK1_AUDIO2,
750 .enable = s5pc100_sclk1_ctrl,
751 .set_parent = s5pc100_setparent_clksrc,
752 .get_rate = s5pc100_getrate_clksrc,
753 .set_rate = s5pc100_setrate_clksrc,
754 .round_rate = s5pc100_roundrate_clksrc,
755 },
756 .shift = S5PC100_CLKSRC3_AUDIO2_SHIFT,
757 .mask = S5PC100_CLKSRC3_AUDIO2_MASK,
758 .sources = &clkset_audio2,
759 .divider_shift = S5PC100_CLKDIV4_AUDIO2_SHIFT,
760 .reg_divider = S5PC100_CLKDIV4,
761 .reg_source = S5PC100_CLKSRC3,
762};
763
764static struct clk *clkset_spdif_list[] = {
765 &clk_audio0.clk,
766 &clk_audio1.clk,
767 &clk_audio2.clk,
768};
769
770static struct clk_sources clkset_spdif = {
771 .sources = clkset_spdif_list,
772 .nr_sources = ARRAY_SIZE(clkset_spdif_list),
773};
774
775static struct clksrc_clk clk_spdif = {
776 .clk = {
777 .name = "spdif",
778 .id = -1,
779 },
780 .shift = S5PC100_CLKSRC3_SPDIF_SHIFT,
781 .mask = S5PC100_CLKSRC3_SPDIF_MASK,
782 .sources = &clkset_spdif,
783 .reg_source = S5PC100_CLKSRC3,
784};
785
786static struct clk *clkset_lcd_fimc_list[] = {
787 &clk_mout_epll.clk,
788 &clk_dout_mpll,
789 &clk_mout_hpll.clk,
790 &clk_vclk_54m,
791};
792
793static struct clk_sources clkset_lcd_fimc = {
794 .sources = clkset_lcd_fimc_list,
795 .nr_sources = ARRAY_SIZE(clkset_lcd_fimc_list),
796};
797
798static struct clksrc_clk clk_lcd = {
799 .clk = {
800 .name = "lcd",
801 .id = -1,
802 .ctrlbit = S5PC100_CLKGATE_SCLK1_LCD,
803 .enable = s5pc100_sclk1_ctrl,
804 .set_parent = s5pc100_setparent_clksrc,
805 .get_rate = s5pc100_getrate_clksrc,
806 .set_rate = s5pc100_setrate_clksrc,
807 .round_rate = s5pc100_roundrate_clksrc,
808 },
809 .shift = S5PC100_CLKSRC2_LCD_SHIFT,
810 .mask = S5PC100_CLKSRC2_LCD_MASK,
811 .sources = &clkset_lcd_fimc,
812 .divider_shift = S5PC100_CLKDIV3_LCD_SHIFT,
813 .reg_divider = S5PC100_CLKDIV3,
814 .reg_source = S5PC100_CLKSRC2,
815};
816
817static struct clksrc_clk clk_fimc0 = {
818 .clk = {
819 .name = "fimc",
820 .id = 0,
821 .ctrlbit = S5PC100_CLKGATE_SCLK1_FIMC0,
822 .enable = s5pc100_sclk1_ctrl,
823 .set_parent = s5pc100_setparent_clksrc,
824 .get_rate = s5pc100_getrate_clksrc,
825 .set_rate = s5pc100_setrate_clksrc,
826 .round_rate = s5pc100_roundrate_clksrc,
827 },
828 .shift = S5PC100_CLKSRC2_FIMC0_SHIFT,
829 .mask = S5PC100_CLKSRC2_FIMC0_MASK,
830 .sources = &clkset_lcd_fimc,
831 .divider_shift = S5PC100_CLKDIV3_FIMC0_SHIFT,
832 .reg_divider = S5PC100_CLKDIV3,
833 .reg_source = S5PC100_CLKSRC2,
834};
835
836static struct clksrc_clk clk_fimc1 = {
837 .clk = {
838 .name = "fimc",
839 .id = 1,
840 .ctrlbit = S5PC100_CLKGATE_SCLK1_FIMC1,
841 .enable = s5pc100_sclk1_ctrl,
842 .set_parent = s5pc100_setparent_clksrc,
843 .get_rate = s5pc100_getrate_clksrc,
844 .set_rate = s5pc100_setrate_clksrc,
845 .round_rate = s5pc100_roundrate_clksrc,
846 },
847 .shift = S5PC100_CLKSRC2_FIMC1_SHIFT,
848 .mask = S5PC100_CLKSRC2_FIMC1_MASK,
849 .sources = &clkset_lcd_fimc,
850 .divider_shift = S5PC100_CLKDIV3_FIMC1_SHIFT,
851 .reg_divider = S5PC100_CLKDIV3,
852 .reg_source = S5PC100_CLKSRC2,
853};
854
855static struct clksrc_clk clk_fimc2 = {
856 .clk = {
857 .name = "fimc",
858 .id = 2,
859 .ctrlbit = S5PC100_CLKGATE_SCLK1_FIMC2,
860 .enable = s5pc100_sclk1_ctrl,
861 .set_parent = s5pc100_setparent_clksrc,
862 .get_rate = s5pc100_getrate_clksrc,
863 .set_rate = s5pc100_setrate_clksrc,
864 .round_rate = s5pc100_roundrate_clksrc,
865 },
866 .shift = S5PC100_CLKSRC2_FIMC2_SHIFT,
867 .mask = S5PC100_CLKSRC2_FIMC2_MASK,
868 .sources = &clkset_lcd_fimc,
869 .divider_shift = S5PC100_CLKDIV3_FIMC2_SHIFT,
870 .reg_divider = S5PC100_CLKDIV3,
871 .reg_source = S5PC100_CLKSRC2,
872};
873
874static struct clk *clkset_mmc_list[] = {
875 &clk_mout_epll.clk,
876 &clk_dout_mpll,
877 &clk_fin_epll,
878 &clk_mout_hpll.clk ,
879};
880
881static struct clk_sources clkset_mmc = {
882 .sources = clkset_mmc_list,
883 .nr_sources = ARRAY_SIZE(clkset_mmc_list),
884};
885
886static struct clksrc_clk clk_mmc0 = {
887 .clk = {
888 .name = "mmc_bus",
889 .id = 0,
890 .ctrlbit = S5PC100_CLKGATE_SCLK0_MMC0,
891 .enable = s5pc100_sclk0_ctrl,
892 .set_parent = s5pc100_setparent_clksrc,
893 .get_rate = s5pc100_getrate_clksrc,
894 .set_rate = s5pc100_setrate_clksrc,
895 .round_rate = s5pc100_roundrate_clksrc,
896 },
897 .shift = S5PC100_CLKSRC2_MMC0_SHIFT,
898 .mask = S5PC100_CLKSRC2_MMC0_MASK,
899 .sources = &clkset_mmc,
900 .divider_shift = S5PC100_CLKDIV3_MMC0_SHIFT,
901 .reg_divider = S5PC100_CLKDIV3,
902 .reg_source = S5PC100_CLKSRC2,
903};
904
905static struct clksrc_clk clk_mmc1 = {
906 .clk = {
907 .name = "mmc_bus",
908 .id = 1,
909 .ctrlbit = S5PC100_CLKGATE_SCLK0_MMC1,
910 .enable = s5pc100_sclk0_ctrl,
911 .set_parent = s5pc100_setparent_clksrc,
912 .get_rate = s5pc100_getrate_clksrc,
913 .set_rate = s5pc100_setrate_clksrc,
914 .round_rate = s5pc100_roundrate_clksrc,
915 },
916 .shift = S5PC100_CLKSRC2_MMC1_SHIFT,
917 .mask = S5PC100_CLKSRC2_MMC1_MASK,
918 .sources = &clkset_mmc,
919 .divider_shift = S5PC100_CLKDIV3_MMC1_SHIFT,
920 .reg_divider = S5PC100_CLKDIV3,
921 .reg_source = S5PC100_CLKSRC2,
922};
923
924static struct clksrc_clk clk_mmc2 = {
925 .clk = {
926 .name = "mmc_bus",
927 .id = 2,
928 .ctrlbit = S5PC100_CLKGATE_SCLK0_MMC2,
929 .enable = s5pc100_sclk0_ctrl,
930 .set_parent = s5pc100_setparent_clksrc,
931 .get_rate = s5pc100_getrate_clksrc,
932 .set_rate = s5pc100_setrate_clksrc,
933 .round_rate = s5pc100_roundrate_clksrc,
934 },
935 .shift = S5PC100_CLKSRC2_MMC2_SHIFT,
936 .mask = S5PC100_CLKSRC2_MMC2_MASK,
937 .sources = &clkset_mmc,
938 .divider_shift = S5PC100_CLKDIV3_MMC2_SHIFT,
939 .reg_divider = S5PC100_CLKDIV3,
940 .reg_source = S5PC100_CLKSRC2,
941};
942
943
944static struct clk *clkset_usbhost_list[] = {
945 &clk_mout_epll.clk,
946 &clk_dout_mpll,
947 &clk_mout_hpll.clk,
948 &clk_48m,
949};
950
951static struct clk_sources clkset_usbhost = {
952 .sources = clkset_usbhost_list,
953 .nr_sources = ARRAY_SIZE(clkset_usbhost_list),
954};
955
956static struct clksrc_clk clk_usbhost = {
957 .clk = {
958 .name = "usbhost",
959 .id = -1,
960 .ctrlbit = S5PC100_CLKGATE_SCLK0_USBHOST,
961 .enable = s5pc100_sclk0_ctrl,
962 .set_parent = s5pc100_setparent_clksrc,
963 .get_rate = s5pc100_getrate_clksrc,
964 .set_rate = s5pc100_setrate_clksrc,
965 .round_rate = s5pc100_roundrate_clksrc,
966 },
967 .shift = S5PC100_CLKSRC1_UHOST_SHIFT,
968 .mask = S5PC100_CLKSRC1_UHOST_MASK,
969 .sources = &clkset_usbhost,
970 .divider_shift = S5PC100_CLKDIV2_UHOST_SHIFT,
971 .reg_divider = S5PC100_CLKDIV2,
972 .reg_source = S5PC100_CLKSRC1,
1012}; 973};
1013 974
1014/* Clock initialisation code */ 975/* Clock initialisation code */
1015 976
1016static struct clksrc_clk *init_parents[] = { 977static struct clksrc_clk *init_parents[] = {
1017 &clk_mout_apll, 978 &clk_mout_apll,
1018 &clk_mout_epll,
1019 &clk_mout_mpll, 979 &clk_mout_mpll,
980 &clk_mout_am,
981 &clk_mout_onenand,
982 &clk_mout_epll,
983 &clk_mout_hpll,
984 &clk_spi0,
985 &clk_spi1,
986 &clk_spi2,
1020 &clk_uart_uclk1, 987 &clk_uart_uclk1,
988 &clk_audio0,
989 &clk_audio1,
990 &clk_audio2,
991 &clk_spdif,
992 &clk_lcd,
993 &clk_fimc0,
994 &clk_fimc1,
995 &clk_fimc2,
996 &clk_mmc0,
997 &clk_mmc1,
998 &clk_mmc2,
999 &clk_usbhost,
1021}; 1000};
1022 1001
1023static void __init_or_cpufreq s5pc1xx_set_clksrc(struct clksrc_clk *clk) 1002static void __init_or_cpufreq s5pc100_set_clksrc(struct clksrc_clk *clk)
1024{ 1003{
1025 struct clk_sources *srcs = clk->sources; 1004 struct clk_sources *srcs = clk->sources;
1026 u32 clksrc = __raw_readl(clk->reg_source); 1005 u32 clksrc = __raw_readl(clk->reg_source);
@@ -1036,9 +1015,9 @@ static void __init_or_cpufreq s5pc1xx_set_clksrc(struct clksrc_clk *clk)
1036 1015
1037 clk->clk.parent = srcs->sources[clksrc]; 1016 clk->clk.parent = srcs->sources[clksrc];
1038 1017
1039 printk(KERN_INFO "%s: source is %s (%d), rate is %ld\n", 1018 printk(KERN_INFO "%s: source is %s (%d), rate is %ld.%03ld MHz\n",
1040 clk->clk.name, clk->clk.parent->name, clksrc, 1019 clk->clk.name, clk->clk.parent->name, clksrc,
1041 clk_get_rate(&clk->clk)); 1020 print_mhz(clk_get_rate(&clk->clk)));
1042} 1021}
1043 1022
1044#define GET_DIV(clk, field) ((((clk) & field##_MASK) >> field##_SHIFT) + 1) 1023#define GET_DIV(clk, field) ((((clk) & field##_MASK) >> field##_SHIFT) + 1)
@@ -1052,20 +1031,16 @@ void __init_or_cpufreq s5pc100_setup_clocks(void)
1052 unsigned long hclk; 1031 unsigned long hclk;
1053 unsigned long pclkd0; 1032 unsigned long pclkd0;
1054 unsigned long pclk; 1033 unsigned long pclk;
1055 unsigned long apll; 1034 unsigned long apll, mpll, epll, hpll;
1056 unsigned long mpll;
1057 unsigned long hpll;
1058 unsigned long epll;
1059 unsigned int ptr; 1035 unsigned int ptr;
1060 u32 clkdiv0, clkdiv1; 1036 u32 clkdiv0, clkdiv1;
1061 1037
1062 printk(KERN_DEBUG "%s: registering clocks\n", __func__); 1038 printk(KERN_DEBUG "%s: registering clocks\n", __func__);
1063 1039
1064 clkdiv0 = __raw_readl(S5PC1XX_CLK_DIV0); 1040 clkdiv0 = __raw_readl(S5PC100_CLKDIV0);
1065 clkdiv1 = __raw_readl(S5PC1XX_CLK_DIV1); 1041 clkdiv1 = __raw_readl(S5PC100_CLKDIV1);
1066 1042
1067 printk(KERN_DEBUG "%s: clkdiv0 = %08x, clkdiv1 = %08x\n", 1043 printk(KERN_DEBUG "%s: clkdiv0 = %08x, clkdiv1 = %08x\n", __func__, clkdiv0, clkdiv1);
1068 __func__, clkdiv0, clkdiv1);
1069 1044
1070 xtal_clk = clk_get(NULL, "xtal"); 1045 xtal_clk = clk_get(NULL, "xtal");
1071 BUG_ON(IS_ERR(xtal_clk)); 1046 BUG_ON(IS_ERR(xtal_clk));
@@ -1075,48 +1050,81 @@ void __init_or_cpufreq s5pc100_setup_clocks(void)
1075 1050
1076 printk(KERN_DEBUG "%s: xtal is %ld\n", __func__, xtal); 1051 printk(KERN_DEBUG "%s: xtal is %ld\n", __func__, xtal);
1077 1052
1078 apll = s5pc1xx_get_pll(xtal, __raw_readl(S5PC1XX_APLL_CON)); 1053 apll = s5pc1xx_get_pll(xtal, __raw_readl(S5PC100_APLL_CON));
1079 mpll = s5pc1xx_get_pll(xtal, __raw_readl(S5PC1XX_MPLL_CON)); 1054 mpll = s5pc1xx_get_pll(xtal, __raw_readl(S5PC100_MPLL_CON));
1080 epll = s5pc1xx_get_pll(xtal, __raw_readl(S5PC1XX_EPLL_CON)); 1055 epll = s5pc1xx_get_pll(xtal, __raw_readl(S5PC100_EPLL_CON));
1081 hpll = s5pc1xx_get_pll(xtal, __raw_readl(S5PC100_HPLL_CON)); 1056 hpll = s5pc1xx_get_pll(xtal, __raw_readl(S5PC100_HPLL_CON));
1082 1057
1083 printk(KERN_INFO "S5PC100: PLL settings, A=%ld, M=%ld, E=%ld, H=%ld\n", 1058 printk(KERN_INFO "S5PC100: Apll=%ld.%03ld Mhz, Mpll=%ld.%03ld Mhz"
1084 apll, mpll, epll, hpll); 1059 ", Epll=%ld.%03ld Mhz, Hpll=%ld.%03ld Mhz\n",
1060 print_mhz(apll), print_mhz(mpll),
1061 print_mhz(epll), print_mhz(hpll));
1085 1062
1086 armclk = apll / GET_DIV(clkdiv0, S5PC1XX_CLKDIV0_APLL); 1063 armclk = apll / GET_DIV(clkdiv0, S5PC100_CLKDIV0_APLL);
1087 armclk = armclk / GET_DIV(clkdiv0, S5PC100_CLKDIV0_ARM); 1064 armclk = armclk / GET_DIV(clkdiv0, S5PC100_CLKDIV0_ARM);
1088 hclkd0 = armclk / GET_DIV(clkdiv0, S5PC100_CLKDIV0_D0); 1065 hclkd0 = armclk / GET_DIV(clkdiv0, S5PC100_CLKDIV0_D0);
1089 pclkd0 = hclkd0 / GET_DIV(clkdiv0, S5PC100_CLKDIV0_PCLKD0); 1066 pclkd0 = hclkd0 / GET_DIV(clkdiv0, S5PC100_CLKDIV0_PCLKD0);
1090 hclk = mpll / GET_DIV(clkdiv1, S5PC100_CLKDIV1_D1); 1067 hclk = mpll / GET_DIV(clkdiv1, S5PC100_CLKDIV1_D1);
1091 pclk = hclk / GET_DIV(clkdiv1, S5PC100_CLKDIV1_PCLKD1); 1068 pclk = hclk / GET_DIV(clkdiv1, S5PC100_CLKDIV1_PCLKD1);
1092 1069
1093 printk(KERN_INFO "S5PC100: ARMCLK=%ld, HCLKD0=%ld, PCLKD0=%ld, HCLK=%ld, PCLK=%ld\n", 1070 printk(KERN_INFO "S5PC100: ARMCLK=%ld.%03ld MHz, HCLKD0=%ld.%03ld MHz,"
1094 armclk, hclkd0, pclkd0, hclk, pclk); 1071 " PCLKD0=%ld.%03ld MHz\n, HCLK=%ld.%03ld MHz,"
1072 " PCLK=%ld.%03ld MHz\n",
1073 print_mhz(armclk), print_mhz(hclkd0),
1074 print_mhz(pclkd0), print_mhz(hclk), print_mhz(pclk));
1095 1075
1096 clk_fout_apll.rate = apll; 1076 clk_fout_apll.rate = apll;
1097 clk_fout_mpll.rate = mpll; 1077 clk_fout_mpll.rate = mpll;
1098 clk_fout_epll.rate = epll; 1078 clk_fout_epll.rate = epll;
1099 clk_fout_apll.rate = apll; 1079 clk_fout_hpll.rate = hpll;
1100 1080
1101 clk_h.rate = hclk; 1081 clk_h.rate = hclk;
1102 clk_p.rate = pclk; 1082 clk_p.rate = pclk;
1083 clk_f.rate = armclk;
1103 1084
1104 for (ptr = 0; ptr < ARRAY_SIZE(init_parents); ptr++) 1085 for (ptr = 0; ptr < ARRAY_SIZE(init_parents); ptr++)
1105 s5pc1xx_set_clksrc(init_parents[ptr]); 1086 s5pc100_set_clksrc(init_parents[ptr]);
1106} 1087}
1107 1088
1108static struct clk *clks[] __initdata = { 1089static struct clk *clks[] __initdata = {
1109 &clk_ext_xtal_mux, 1090 &clk_ext_xtal_mux,
1110 &clk_mout_epll.clk, 1091 &clk_mout_apll.clk,
1111 &clk_fout_epll, 1092 &clk_dout_apll,
1093 &clk_dout_d0_bus,
1094 &clk_dout_pclkd0,
1095 &clk_dout_apll2,
1112 &clk_mout_mpll.clk, 1096 &clk_mout_mpll.clk,
1097 &clk_mout_am.clk,
1098 &clk_dout_d1_bus,
1099 &clk_mout_onenand.clk,
1100 &clk_dout_pclkd1,
1101 &clk_dout_mpll2,
1102 &clk_dout_cam,
1113 &clk_dout_mpll, 1103 &clk_dout_mpll,
1104 &clk_mout_epll.clk,
1105 &clk_fout_epll,
1106 &clk_iis_cd0,
1107 &clk_iis_cd1,
1108 &clk_iis_cd2,
1109 &clk_pcm_cd0,
1110 &clk_pcm_cd1,
1111 &clk_spi0.clk,
1112 &clk_spi1.clk,
1113 &clk_spi2.clk,
1114 &clk_uart_uclk1.clk, 1114 &clk_uart_uclk1.clk,
1115 &clk_ext, 1115 &clk_audio0.clk,
1116 &clk_epll, 1116 &clk_audio1.clk,
1117 &clk_27m, 1117 &clk_audio2.clk,
1118 &clk_48m, 1118 &clk_spdif.clk,
1119 &clk_54m, 1119 &clk_lcd.clk,
1120 &clk_fimc0.clk,
1121 &clk_fimc1.clk,
1122 &clk_fimc2.clk,
1123 &clk_mmc0.clk,
1124 &clk_mmc1.clk,
1125 &clk_mmc2.clk,
1126 &clk_usbhost.clk,
1127 &clk_arm,
1120}; 1128};
1121 1129
1122void __init s5pc100_register_clocks(void) 1130void __init s5pc100_register_clocks(void)
@@ -1133,7 +1141,4 @@ void __init s5pc100_register_clocks(void)
1133 clkp->name, ret); 1141 clkp->name, ret);
1134 } 1142 }
1135 } 1143 }
1136
1137 clk_mpll.parent = &clk_mout_mpll.clk;
1138 clk_epll.parent = &clk_mout_epll.clk;
1139} 1144}
diff --git a/arch/arm/plat-s5pc1xx/setup-fb-24bpp.c b/arch/arm/plat-s5pc1xx/setup-fb-24bpp.c
new file mode 100644
index 000000000000..1a63768a9a2e
--- /dev/null
+++ b/arch/arm/plat-s5pc1xx/setup-fb-24bpp.c
@@ -0,0 +1,49 @@
1/*
2 * linux/arch/arm/plat-s5pc100/setup-fb-24bpp.c
3 *
4 * Copyright 2009 Samsung Electronics
5 *
6 * Base S5PC1XX setup information for 24bpp LCD framebuffer
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#include <linux/kernel.h>
14#include <linux/types.h>
15#include <linux/fb.h>
16#include <linux/gpio.h>
17
18#include <mach/regs-fb.h>
19#include <mach/map.h>
20#include <plat/fb.h>
21#include <plat/gpio-cfg.h>
22#include <plat/gpio-cfg-s5pc1xx.h>
23
24#define DISR_OFFSET 0x7008
25
26void s5pc100_fb_gpio_setup_24bpp(void)
27{
28 unsigned int gpio = 0;
29
30 for (gpio = S5PC100_GPF0(0); gpio <= S5PC100_GPF0(7); gpio++) {
31 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
32 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
33 }
34
35 for (gpio = S5PC100_GPF1(0); gpio <= S5PC100_GPF1(7); gpio++) {
36 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
37 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
38 }
39
40 for (gpio = S5PC100_GPF2(0); gpio <= S5PC100_GPF2(7); gpio++) {
41 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
42 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
43 }
44
45 for (gpio = S5PC100_GPF3(0); gpio <= S5PC100_GPF3(3); gpio++) {
46 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
47 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
48 }
49}
diff --git a/arch/arm/plat-s5pc1xx/setup-i2c0.c b/arch/arm/plat-s5pc1xx/setup-i2c0.c
index 3d00c025fffb..5e4a7c3a231e 100644
--- a/arch/arm/plat-s5pc1xx/setup-i2c0.c
+++ b/arch/arm/plat-s5pc1xx/setup-i2c0.c
@@ -17,9 +17,14 @@
17 17
18struct platform_device; /* don't need the contents */ 18struct platform_device; /* don't need the contents */
19 19
20#include <linux/gpio.h>
20#include <plat/iic.h> 21#include <plat/iic.h>
22#include <plat/gpio-cfg.h>
21 23
22void s3c_i2c0_cfg_gpio(struct platform_device *dev) 24void s3c_i2c0_cfg_gpio(struct platform_device *dev)
23{ 25{
24 /* Pin configuration would be needed */ 26 s3c_gpio_cfgpin(S5PC100_GPD(3), S3C_GPIO_SFN(2));
27 s3c_gpio_setpull(S5PC100_GPD(3), S3C_GPIO_PULL_UP);
28 s3c_gpio_cfgpin(S5PC100_GPD(4), S3C_GPIO_SFN(2));
29 s3c_gpio_setpull(S5PC100_GPD(4), S3C_GPIO_PULL_UP);
25} 30}
diff --git a/arch/arm/plat-s5pc1xx/setup-i2c1.c b/arch/arm/plat-s5pc1xx/setup-i2c1.c
index c8f3ca42f51d..a0a8b4ae6ad8 100644
--- a/arch/arm/plat-s5pc1xx/setup-i2c1.c
+++ b/arch/arm/plat-s5pc1xx/setup-i2c1.c
@@ -17,9 +17,14 @@
17 17
18struct platform_device; /* don't need the contents */ 18struct platform_device; /* don't need the contents */
19 19
20#include <linux/gpio.h>
20#include <plat/iic.h> 21#include <plat/iic.h>
22#include <plat/gpio-cfg.h>
21 23
22void s3c_i2c1_cfg_gpio(struct platform_device *dev) 24void s3c_i2c1_cfg_gpio(struct platform_device *dev)
23{ 25{
24 /* Pin configuration would be needed */ 26 s3c_gpio_cfgpin(S5PC100_GPD(5), S3C_GPIO_SFN(2));
27 s3c_gpio_setpull(S5PC100_GPD(5), S3C_GPIO_PULL_UP);
28 s3c_gpio_cfgpin(S5PC100_GPD(6), S3C_GPIO_SFN(2));
29 s3c_gpio_setpull(S5PC100_GPD(6), S3C_GPIO_PULL_UP);
25} 30}
diff --git a/arch/arm/plat-s5pc1xx/setup-sdhci-gpio.c b/arch/arm/plat-s5pc1xx/setup-sdhci-gpio.c
new file mode 100644
index 000000000000..185c8941e644
--- /dev/null
+++ b/arch/arm/plat-s5pc1xx/setup-sdhci-gpio.c
@@ -0,0 +1,86 @@
1/* linux/arch/arm/plat-s5pc1xx/setup-sdhci-gpio.c
2 *
3 * Copyright 2009 Samsung Eletronics
4 *
5 * S5PC1XX - Helper functions for setting up SDHCI device(s) GPIO (HSMMC)
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10*/
11
12#include <linux/kernel.h>
13#include <linux/types.h>
14#include <linux/interrupt.h>
15#include <linux/platform_device.h>
16#include <linux/io.h>
17#include <linux/gpio.h>
18#include <linux/mmc/host.h>
19#include <linux/mmc/card.h>
20
21#include <plat/gpio-cfg.h>
22#include <plat/regs-sdhci.h>
23
24void s5pc100_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
25{
26 unsigned int gpio;
27 unsigned int end;
28 unsigned int num;
29
30 num = width;
31 /* In case of 8 width, we should decrease the 2 */
32 if (width == 8)
33 num = width - 2;
34
35 end = S5PC100_GPG0(2 + num);
36
37 /* Set all the necessary GPG0/GPG1 pins to special-function 0 */
38 for (gpio = S5PC100_GPG0(0); gpio < end; gpio++) {
39 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
40 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
41 }
42
43 if (width == 8) {
44 for (gpio = S5PC100_GPG1(0); gpio <= S5PC100_GPG1(1); gpio++) {
45 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
46 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
47 }
48 }
49
50 s3c_gpio_setpull(S5PC100_GPG1(2), S3C_GPIO_PULL_UP);
51 s3c_gpio_cfgpin(S5PC100_GPG1(2), S3C_GPIO_SFN(2));
52}
53
54void s5pc100_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)
55{
56 unsigned int gpio;
57 unsigned int end;
58
59 end = S5PC100_GPG2(2 + width);
60
61 /* Set all the necessary GPG2 pins to special-function 2 */
62 for (gpio = S5PC100_GPG2(0); gpio < end; gpio++) {
63 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
64 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
65 }
66
67 s3c_gpio_setpull(S5PC100_GPG2(6), S3C_GPIO_PULL_UP);
68 s3c_gpio_cfgpin(S5PC100_GPG2(6), S3C_GPIO_SFN(2));
69}
70
71void s5pc100_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width)
72{
73 unsigned int gpio;
74 unsigned int end;
75
76 end = S5PC100_GPG3(2 + width);
77
78 /* Set all the necessary GPG3 pins to special-function 2 */
79 for (gpio = S5PC100_GPG3(0); gpio < end; gpio++) {
80 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
81 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
82 }
83
84 s3c_gpio_setpull(S5PC100_GPG3(6), S3C_GPIO_PULL_UP);
85 s3c_gpio_cfgpin(S5PC100_GPG3(6), S3C_GPIO_SFN(2));
86}
diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig
new file mode 100644
index 000000000000..486a0d6301e7
--- /dev/null
+++ b/arch/arm/plat-samsung/Kconfig
@@ -0,0 +1,17 @@
1# arch/arm/plat-samsung/Kconfig
2#
3# Copyright 2009 Simtec Electronics
4#
5# Licensed under GPLv2
6
7config PLAT_SAMSUNG
8 bool
9 depends on ARCH_S3C2410 || ARCH_S3C24A0 || ARCH_S3C64XX || ARCH_S5PC1XX
10 default y
11 help
12 Base platform code for all Samsung SoC based systems
13
14if PLAT_SAMSUNG
15
16
17endif
diff --git a/arch/arm/plat-samsung/Makefile b/arch/arm/plat-samsung/Makefile
new file mode 100644
index 000000000000..4478b9f7dc34
--- /dev/null
+++ b/arch/arm/plat-samsung/Makefile
@@ -0,0 +1,11 @@
1# arch/arm/plat-s3c64xx/Makefile
2#
3# Copyright 2009 Simtec Electronics
4#
5# Licensed under GPLv2
6
7obj-y :=
8obj-m :=
9obj-n := dummy.o
10obj- :=
11
diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types
index 94be7bb6cb9a..07b976da6174 100644
--- a/arch/arm/tools/mach-types
+++ b/arch/arm/tools/mach-types
@@ -12,7 +12,7 @@
12# 12#
13# http://www.arm.linux.org.uk/developer/machines/?action=new 13# http://www.arm.linux.org.uk/developer/machines/?action=new
14# 14#
15# Last update: Fri Sep 18 21:42:00 2009 15# Last update: Wed Nov 25 22:14:58 2009
16# 16#
17# machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number 17# machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number
18# 18#
@@ -928,7 +928,7 @@ palmt5 MACH_PALMT5 PALMT5 917
928palmtc MACH_PALMTC PALMTC 918 928palmtc MACH_PALMTC PALMTC 918
929omap_apollon MACH_OMAP_APOLLON OMAP_APOLLON 919 929omap_apollon MACH_OMAP_APOLLON OMAP_APOLLON 919
930mxc30030evb MACH_MXC30030EVB MXC30030EVB 920 930mxc30030evb MACH_MXC30030EVB MXC30030EVB 920
931rea_2d MACH_REA_2D REA_2D 921 931rea_cpu2 MACH_REA_2D REA_2D 921
932eti3e524 MACH_TI3E524 TI3E524 922 932eti3e524 MACH_TI3E524 TI3E524 922
933ateb9200 MACH_ATEB9200 ATEB9200 923 933ateb9200 MACH_ATEB9200 ATEB9200 923
934auckland MACH_AUCKLAND AUCKLAND 924 934auckland MACH_AUCKLAND AUCKLAND 924
@@ -2421,3 +2421,118 @@ liberty MACH_LIBERTY LIBERTY 2434
2421mh355 MACH_MH355 MH355 2435 2421mh355 MACH_MH355 MH355 2435
2422pc7802 MACH_PC7802 PC7802 2436 2422pc7802 MACH_PC7802 PC7802 2436
2423gnet_sgc MACH_GNET_SGC GNET_SGC 2437 2423gnet_sgc MACH_GNET_SGC GNET_SGC 2437
2424einstein15 MACH_EINSTEIN15 EINSTEIN15 2438
2425cmpd MACH_CMPD CMPD 2439
2426davinci_hase1 MACH_DAVINCI_HASE1 DAVINCI_HASE1 2440
2427lgeincitephone MACH_LGEINCITEPHONE LGEINCITEPHONE 2441
2428ea313x MACH_EA313X EA313X 2442
2429fwbd_39064 MACH_FWBD_39064 FWBD_39064 2443
2430fwbd_390128 MACH_FWBD_390128 FWBD_390128 2444
2431pelco_moe MACH_PELCO_MOE PELCO_MOE 2445
2432minimix27 MACH_MINIMIX27 MINIMIX27 2446
2433omap3_thunder MACH_OMAP3_THUNDER OMAP3_THUNDER 2447
2434passionc MACH_PASSIONC PASSIONC 2448
2435mx27amata MACH_MX27AMATA MX27AMATA 2449
2436bgat1 MACH_BGAT1 BGAT1 2450
2437buzz MACH_BUZZ BUZZ 2451
2438mb9g20 MACH_MB9G20 MB9G20 2452
2439yushan MACH_YUSHAN YUSHAN 2453
2440lizard MACH_LIZARD LIZARD 2454
2441omap3polycom MACH_OMAP3POLYCOM OMAP3POLYCOM 2455
2442smdkv210 MACH_SMDKV210 SMDKV210 2456
2443bravo MACH_BRAVO BRAVO 2457
2444siogentoo1 MACH_SIOGENTOO1 SIOGENTOO1 2458
2445siogentoo2 MACH_SIOGENTOO2 SIOGENTOO2 2459
2446sm3k MACH_SM3K SM3K 2460
2447acer_tempo_f900 MACH_ACER_TEMPO_F900 ACER_TEMPO_F900 2461
2448sst61vc010_dev MACH_SST61VC010_DEV SST61VC010_DEV 2462
2449glittertind MACH_GLITTERTIND GLITTERTIND 2463
2450omap_zoom3 MACH_OMAP_ZOOM3 OMAP_ZOOM3 2464
2451omap_3630sdp MACH_OMAP_3630SDP OMAP_3630SDP 2465
2452cybook2440 MACH_CYBOOK2440 CYBOOK2440 2466
2453torino_s MACH_TORINO_S TORINO_S 2467
2454havana MACH_HAVANA HAVANA 2468
2455beaumont_11 MACH_BEAUMONT_11 BEAUMONT_11 2469
2456vanguard MACH_VANGUARD VANGUARD 2470
2457s5pc110_draco MACH_S5PC110_DRACO S5PC110_DRACO 2471
2458cartesio_two MACH_CARTESIO_TWO CARTESIO_TWO 2472
2459aster MACH_ASTER ASTER 2473
2460voguesv210 MACH_VOGUESV210 VOGUESV210 2474
2461acm500x MACH_ACM500X ACM500X 2475
2462km9260 MACH_KM9260 KM9260 2476
2463nideflexg1 MACH_NIDEFLEXG1 NIDEFLEXG1 2477
2464ctera_plug_io MACH_CTERA_PLUG_IO CTERA_PLUG_IO 2478
2465smartq7 MACH_SMARTQ7 SMARTQ7 2479
2466at91sam9g10ek2 MACH_AT91SAM9G10EK2 AT91SAM9G10EK2 2480
2467asusp527 MACH_ASUSP527 ASUSP527 2481
2468at91sam9g20mpm2 MACH_AT91SAM9G20MPM2 AT91SAM9G20MPM2 2482
2469topasa900 MACH_TOPASA900 TOPASA900 2483
2470electrum_100 MACH_ELECTRUM_100 ELECTRUM_100 2484
2471mx51grb MACH_MX51GRB MX51GRB 2485
2472xea300 MACH_XEA300 XEA300 2486
2473htcstartrek MACH_HTCSTARTREK HTCSTARTREK 2487
2474lima MACH_LIMA LIMA 2488
2475csb740 MACH_CSB740 CSB740 2489
2476usb_s8815 MACH_USB_S8815 USB_S8815 2490
2477watson_efm_plugin MACH_WATSON_EFM_PLUGIN WATSON_EFM_PLUGIN 2491
2478milkyway MACH_MILKYWAY MILKYWAY 2492
2479g4evm MACH_G4EVM G4EVM 2493
2480picomod6 MACH_PICOMOD6 PICOMOD6 2494
2481omapl138_hawkboard MACH_OMAPL138_HAWKBOARD OMAPL138_HAWKBOARD 2495
2482ip6000 MACH_IP6000 IP6000 2496
2483ip6010 MACH_IP6010 IP6010 2497
2484utm400 MACH_UTM400 UTM400 2498
2485omap3_zybex MACH_OMAP3_ZYBEX OMAP3_ZYBEX 2499
2486wireless_space MACH_WIRELESS_SPACE WIRELESS_SPACE 2500
2487sx560 MACH_SX560 SX560 2501
2488ts41x MACH_TS41X TS41X 2502
2489elphel10373 MACH_ELPHEL10373 ELPHEL10373 2503
2490rhobot MACH_RHOBOT RHOBOT 2504
2491mx51_refresh MACH_MX51_REFRESH MX51_REFRESH 2505
2492ls9260 MACH_LS9260 LS9260 2506
2493shank MACH_SHANK SHANK 2507
2494qsd8x50_st1 MACH_QSD8X50_ST1 QSD8X50_ST1 2508
2495at91sam9m10ekes MACH_AT91SAM9M10EKES AT91SAM9M10EKES 2509
2496hiram MACH_HIRAM HIRAM 2510
2497phy3250 MACH_PHY3250 PHY3250 2511
2498ea3250 MACH_EA3250 EA3250 2512
2499fdi3250 MACH_FDI3250 FDI3250 2513
2500whitestone MACH_WHITESTONE WHITESTONE 2514
2501at91sam9263nit MACH_AT91SAM9263NIT AT91SAM9263NIT 2515
2502ccmx51 MACH_CCMX51 CCMX51 2516
2503ccmx51js MACH_CCMX51JS CCMX51JS 2517
2504ccwmx51 MACH_CCWMX51 CCWMX51 2518
2505ccwmx51js MACH_CCWMX51JS CCWMX51JS 2519
2506mini6410 MACH_MINI6410 MINI6410 2520
2507tiny6410 MACH_TINY6410 TINY6410 2521
2508nano6410 MACH_NANO6410 NANO6410 2522
2509at572d940hfnldb MACH_AT572D940HFNLDB AT572D940HFNLDB 2523
2510htcleo MACH_HTCLEO HTCLEO 2524
2511avp13 MACH_AVP13 AVP13 2525
2512xxsvideod MACH_XXSVIDEOD XXSVIDEOD 2526
2513vpnext MACH_VPNEXT VPNEXT 2527
2514swarco_itc3 MACH_SWARCO_ITC3 SWARCO_ITC3 2528
2515tx51 MACH_TX51 TX51 2529
2516dolby_cat1021 MACH_DOLBY_CAT1021 DOLBY_CAT1021 2530
2517mx28evk MACH_MX28EVK MX28EVK 2531
2518phoenix260 MACH_PHOENIX260 PHOENIX260 2532
2519uvaca_stork MACH_UVACA_STORK UVACA_STORK 2533
2520smartq5 MACH_SMARTQ5 SMARTQ5 2534
2521all3078 MACH_ALL3078 ALL3078 2535
2522ctera_2bay_ds MACH_CTERA_2BAY_DS CTERA_2BAY_DS 2536
2523siogentoo3 MACH_SIOGENTOO3 SIOGENTOO3 2537
2524epb5000 MACH_EPB5000 EPB5000 2538
2525hy9263 MACH_HY9263 HY9263 2539
2526acer_tempo_m900 MACH_ACER_TEMPO_M900 ACER_TEMPO_M900 2540
2527acer_tempo_dx650 MACH_ACER_TEMPO_DX900 ACER_TEMPO_DX900 2541
2528acer_tempo_x960 MACH_ACER_TEMPO_X960 ACER_TEMPO_X960 2542
2529acer_eten_v900 MACH_ACER_ETEN_V900 ACER_ETEN_V900 2543
2530acer_eten_x900 MACH_ACER_ETEN_X900 ACER_ETEN_X900 2544
2531bonnell MACH_BONNELL BONNELL 2545
2532oht_mx27 MACH_OHT_MX27 OHT_MX27 2546
2533htcquartz MACH_HTCQUARTZ HTCQUARTZ 2547
2534davinci_dm6467tevm MACH_DAVINCI_DM6467TEVM DAVINCI_DM6467TEVM 2548
2535c3ax03 MACH_C3AX03 C3AX03 2549
2536mxt_td60 MACH_MXT_TD60 MXT_TD60 2550
2537esyx MACH_ESYX ESYX 2551
2538bulldog MACH_BULLDOG BULLDOG 2553
diff --git a/arch/avr32/Kconfig b/arch/avr32/Kconfig
index 35e3bd9858df..d856354f4272 100644
--- a/arch/avr32/Kconfig
+++ b/arch/avr32/Kconfig
@@ -92,6 +92,7 @@ config PLATFORM_AT32AP
92 select PERFORMANCE_COUNTERS 92 select PERFORMANCE_COUNTERS
93 select ARCH_REQUIRE_GPIOLIB 93 select ARCH_REQUIRE_GPIOLIB
94 select GENERIC_ALLOCATOR 94 select GENERIC_ALLOCATOR
95 select HAVE_FB_ATMEL
95 96
96# 97#
97# CPU types 98# CPU types
diff --git a/arch/avr32/include/asm/bug.h b/arch/avr32/include/asm/bug.h
index 331d45bab18f..2aa373cc61b5 100644
--- a/arch/avr32/include/asm/bug.h
+++ b/arch/avr32/include/asm/bug.h
@@ -52,7 +52,7 @@
52#define BUG() \ 52#define BUG() \
53 do { \ 53 do { \
54 _BUG_OR_WARN(0); \ 54 _BUG_OR_WARN(0); \
55 for (;;); \ 55 unreachable(); \
56 } while (0) 56 } while (0)
57 57
58#define WARN_ON(condition) \ 58#define WARN_ON(condition) \
diff --git a/arch/avr32/include/asm/cacheflush.h b/arch/avr32/include/asm/cacheflush.h
index 670674749b20..96e53820bbbd 100644
--- a/arch/avr32/include/asm/cacheflush.h
+++ b/arch/avr32/include/asm/cacheflush.h
@@ -107,6 +107,7 @@ extern void flush_icache_page(struct vm_area_struct *vma, struct page *page);
107 * do something here, but only for certain configurations. No such 107 * do something here, but only for certain configurations. No such
108 * configurations exist at this time. 108 * configurations exist at this time.
109 */ 109 */
110#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 0
110#define flush_dcache_page(page) do { } while (0) 111#define flush_dcache_page(page) do { } while (0)
111#define flush_dcache_mmap_lock(page) do { } while (0) 112#define flush_dcache_mmap_lock(page) do { } while (0)
112#define flush_dcache_mmap_unlock(page) do { } while (0) 113#define flush_dcache_mmap_unlock(page) do { } while (0)
diff --git a/arch/avr32/include/asm/socket.h b/arch/avr32/include/asm/socket.h
index fe863f9794d5..c8d1fae49476 100644
--- a/arch/avr32/include/asm/socket.h
+++ b/arch/avr32/include/asm/socket.h
@@ -60,4 +60,6 @@
60#define SO_PROTOCOL 38 60#define SO_PROTOCOL 38
61#define SO_DOMAIN 39 61#define SO_DOMAIN 39
62 62
63#define SO_RXQ_OVFL 40
64
63#endif /* __ASM_AVR32_SOCKET_H */ 65#endif /* __ASM_AVR32_SOCKET_H */
diff --git a/arch/avr32/kernel/syscall_table.S b/arch/avr32/kernel/syscall_table.S
index 7ee0057613b3..e76bad16b0f0 100644
--- a/arch/avr32/kernel/syscall_table.S
+++ b/arch/avr32/kernel/syscall_table.S
@@ -295,4 +295,5 @@ sys_call_table:
295 .long sys_signalfd 295 .long sys_signalfd
296 .long sys_ni_syscall /* 280, was sys_timerfd */ 296 .long sys_ni_syscall /* 280, was sys_timerfd */
297 .long sys_eventfd 297 .long sys_eventfd
298 .long sys_recvmmsg
298 .long sys_ni_syscall /* r8 is saturated at nr_syscalls */ 299 .long sys_ni_syscall /* r8 is saturated at nr_syscalls */
diff --git a/arch/blackfin/include/asm/cacheflush.h b/arch/blackfin/include/asm/cacheflush.h
index af03a36c7a4e..417eaac7fe99 100644
--- a/arch/blackfin/include/asm/cacheflush.h
+++ b/arch/blackfin/include/asm/cacheflush.h
@@ -68,9 +68,11 @@ do { memcpy(dst, src, len); \
68#endif 68#endif
69#if defined(CONFIG_BFIN_EXTMEM_WRITEBACK) || defined(CONFIG_BFIN_L2_WRITEBACK) 69#if defined(CONFIG_BFIN_EXTMEM_WRITEBACK) || defined(CONFIG_BFIN_L2_WRITEBACK)
70# define flush_dcache_range(start,end) blackfin_dcache_flush_range((start), (end)) 70# define flush_dcache_range(start,end) blackfin_dcache_flush_range((start), (end))
71#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1
71# define flush_dcache_page(page) blackfin_dflush_page(page_address(page)) 72# define flush_dcache_page(page) blackfin_dflush_page(page_address(page))
72#else 73#else
73# define flush_dcache_range(start,end) do { } while (0) 74# define flush_dcache_range(start,end) do { } while (0)
75#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 0
74# define flush_dcache_page(page) do { } while (0) 76# define flush_dcache_page(page) do { } while (0)
75#endif 77#endif
76 78
diff --git a/arch/blackfin/kernel/bfin_dma_5xx.c b/arch/blackfin/kernel/bfin_dma_5xx.c
index 1f170216d2f9..3946aff4f414 100644
--- a/arch/blackfin/kernel/bfin_dma_5xx.c
+++ b/arch/blackfin/kernel/bfin_dma_5xx.c
@@ -225,8 +225,13 @@ int blackfin_dma_suspend(void)
225void blackfin_dma_resume(void) 225void blackfin_dma_resume(void)
226{ 226{
227 int i; 227 int i;
228 for (i = 0; i < MAX_DMA_SUSPEND_CHANNELS; ++i) 228
229 dma_ch[i].regs->peripheral_map = dma_ch[i].saved_peripheral_map; 229 for (i = 0; i < MAX_DMA_CHANNELS; ++i) {
230 dma_ch[i].regs->cfg = 0;
231
232 if (i < MAX_DMA_SUSPEND_CHANNELS)
233 dma_ch[i].regs->peripheral_map = dma_ch[i].saved_peripheral_map;
234 }
230} 235}
231#endif 236#endif
232 237
diff --git a/arch/blackfin/kernel/cplb-mpu/cplbinit.c b/arch/blackfin/kernel/cplb-mpu/cplbinit.c
index f7b9cdce8239..b52c1f8c4bc0 100644
--- a/arch/blackfin/kernel/cplb-mpu/cplbinit.c
+++ b/arch/blackfin/kernel/cplb-mpu/cplbinit.c
@@ -38,7 +38,7 @@ void __init generate_cplb_tables_cpu(unsigned int cpu)
38 38
39#ifdef CONFIG_BFIN_EXTMEM_DCACHEABLE 39#ifdef CONFIG_BFIN_EXTMEM_DCACHEABLE
40 d_cache = CPLB_L1_CHBL; 40 d_cache = CPLB_L1_CHBL;
41#ifdef CONFIG_BFIN_EXTMEM_WRITETROUGH 41#ifdef CONFIG_BFIN_EXTMEM_WRITETHROUGH
42 d_cache |= CPLB_L1_AOW | CPLB_WT; 42 d_cache |= CPLB_L1_AOW | CPLB_WT;
43#endif 43#endif
44#endif 44#endif
diff --git a/arch/blackfin/kernel/process.c b/arch/blackfin/kernel/process.c
index 430ae39456e8..45876427eb2d 100644
--- a/arch/blackfin/kernel/process.c
+++ b/arch/blackfin/kernel/process.c
@@ -151,7 +151,7 @@ void start_thread(struct pt_regs *regs, unsigned long new_ip, unsigned long new_
151 regs->pc = new_ip; 151 regs->pc = new_ip;
152 if (current->mm) 152 if (current->mm)
153 regs->p5 = current->mm->start_data; 153 regs->p5 = current->mm->start_data;
154#ifdef CONFIG_SMP 154#ifndef CONFIG_SMP
155 task_thread_info(current)->l1_task_info.stack_start = 155 task_thread_info(current)->l1_task_info.stack_start =
156 (void *)current->mm->context.stack_start; 156 (void *)current->mm->context.stack_start;
157 task_thread_info(current)->l1_task_info.lowest_sp = (void *)new_sp; 157 task_thread_info(current)->l1_task_info.lowest_sp = (void *)new_sp;
@@ -215,22 +215,18 @@ copy_thread(unsigned long clone_flags,
215/* 215/*
216 * sys_execve() executes a new program. 216 * sys_execve() executes a new program.
217 */ 217 */
218
219asmlinkage int sys_execve(char __user *name, char __user * __user *argv, char __user * __user *envp) 218asmlinkage int sys_execve(char __user *name, char __user * __user *argv, char __user * __user *envp)
220{ 219{
221 int error; 220 int error;
222 char *filename; 221 char *filename;
223 struct pt_regs *regs = (struct pt_regs *)((&name) + 6); 222 struct pt_regs *regs = (struct pt_regs *)((&name) + 6);
224 223
225 lock_kernel();
226 filename = getname(name); 224 filename = getname(name);
227 error = PTR_ERR(filename); 225 error = PTR_ERR(filename);
228 if (IS_ERR(filename)) 226 if (IS_ERR(filename))
229 goto out; 227 return error;
230 error = do_execve(filename, argv, envp, regs); 228 error = do_execve(filename, argv, envp, regs);
231 putname(filename); 229 putname(filename);
232 out:
233 unlock_kernel();
234 return error; 230 return error;
235} 231}
236 232
diff --git a/arch/blackfin/kernel/ptrace.c b/arch/blackfin/kernel/ptrace.c
index 0982b5d5af10..56b0ba12175f 100644
--- a/arch/blackfin/kernel/ptrace.c
+++ b/arch/blackfin/kernel/ptrace.c
@@ -315,7 +315,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
315 case BFIN_MEM_ACCESS_CORE: 315 case BFIN_MEM_ACCESS_CORE:
316 case BFIN_MEM_ACCESS_CORE_ONLY: 316 case BFIN_MEM_ACCESS_CORE_ONLY:
317 copied = access_process_vm(child, addr, &data, 317 copied = access_process_vm(child, addr, &data,
318 to_copy, 0); 318 to_copy, 1);
319 if (copied) 319 if (copied)
320 break; 320 break;
321 321
diff --git a/arch/blackfin/mach-bf518/include/mach/anomaly.h b/arch/blackfin/mach-bf518/include/mach/anomaly.h
index e9c65390edd1..2829dd0400f1 100644
--- a/arch/blackfin/mach-bf518/include/mach/anomaly.h
+++ b/arch/blackfin/mach-bf518/include/mach/anomaly.h
@@ -1,9 +1,13 @@
1/* 1/*
2 * File: include/asm-blackfin/mach-bf518/anomaly.h 2 * DO NOT EDIT THIS FILE
3 * Bugs: Enter bugs at http://blackfin.uclinux.org/ 3 * This file is under version control at
4 * svn://sources.blackfin.uclinux.org/toolchain/trunk/proc-defs/header-frags/
5 * and can be replaced with that version at any time
6 * DO NOT EDIT THIS FILE
4 * 7 *
5 * Copyright (C) 2004-2009 Analog Devices Inc. 8 * Copyright 2004-2009 Analog Devices Inc.
6 * Licensed under the GPL-2 or later. 9 * Licensed under the ADI BSD license.
10 * https://docs.blackfin.uclinux.org/doku.php?id=adi_bsd
7 */ 11 */
8 12
9/* This file should be up to date with: 13/* This file should be up to date with:
@@ -70,6 +74,10 @@
70#define ANOMALY_05000461 (1) 74#define ANOMALY_05000461 (1)
71/* Synchronization Problem at Startup May Cause SPORT Transmit Channels to Misalign */ 75/* Synchronization Problem at Startup May Cause SPORT Transmit Channels to Misalign */
72#define ANOMALY_05000462 (1) 76#define ANOMALY_05000462 (1)
77/* Interrupted 32-Bit SPORT Data Register Access Results In Underflow */
78#define ANOMALY_05000473 (1)
79/* TESTSET Instruction Cannot Be Interrupted */
80#define ANOMALY_05000477 (1)
73 81
74/* Anomalies that don't exist on this proc */ 82/* Anomalies that don't exist on this proc */
75#define ANOMALY_05000099 (0) 83#define ANOMALY_05000099 (0)
@@ -133,5 +141,7 @@
133#define ANOMALY_05000450 (0) 141#define ANOMALY_05000450 (0)
134#define ANOMALY_05000465 (0) 142#define ANOMALY_05000465 (0)
135#define ANOMALY_05000467 (0) 143#define ANOMALY_05000467 (0)
144#define ANOMALY_05000474 (0)
145#define ANOMALY_05000475 (0)
136 146
137#endif 147#endif
diff --git a/arch/blackfin/mach-bf527/include/mach/anomaly.h b/arch/blackfin/mach-bf527/include/mach/anomaly.h
index 3f9052687fa8..02040df8ec80 100644
--- a/arch/blackfin/mach-bf527/include/mach/anomaly.h
+++ b/arch/blackfin/mach-bf527/include/mach/anomaly.h
@@ -1,14 +1,18 @@
1/* 1/*
2 * File: include/asm-blackfin/mach-bf527/anomaly.h 2 * DO NOT EDIT THIS FILE
3 * Bugs: Enter bugs at http://blackfin.uclinux.org/ 3 * This file is under version control at
4 * svn://sources.blackfin.uclinux.org/toolchain/trunk/proc-defs/header-frags/
5 * and can be replaced with that version at any time
6 * DO NOT EDIT THIS FILE
4 * 7 *
5 * Copyright (C) 2004-2009 Analog Devices Inc. 8 * Copyright 2004-2009 Analog Devices Inc.
6 * Licensed under the GPL-2 or later. 9 * Licensed under the ADI BSD license.
10 * https://docs.blackfin.uclinux.org/doku.php?id=adi_bsd
7 */ 11 */
8 12
9/* This file should be up to date with: 13/* This file should be up to date with:
10 * - Revision D, 08/14/2009; ADSP-BF526 Blackfin Processor Anomaly List 14 * - Revision D, 08/14/2009; ADSP-BF526 Blackfin Processor Anomaly List
11 * - Revision F, 03/03/2009; ADSP-BF527 Blackfin Processor Anomaly List 15 * - Revision G, 08/25/2009; ADSP-BF527 Blackfin Processor Anomaly List
12 */ 16 */
13 17
14#ifndef _MACH_ANOMALY_H_ 18#ifndef _MACH_ANOMALY_H_
@@ -200,6 +204,10 @@
200#define ANOMALY_05000467 (1) 204#define ANOMALY_05000467 (1)
201/* PLL Latches Incorrect Settings During Reset */ 205/* PLL Latches Incorrect Settings During Reset */
202#define ANOMALY_05000469 (1) 206#define ANOMALY_05000469 (1)
207/* Interrupted 32-Bit SPORT Data Register Access Results In Underflow */
208#define ANOMALY_05000473 (1)
209/* TESTSET Instruction Cannot Be Interrupted */
210#define ANOMALY_05000477 (1)
203 211
204/* Anomalies that don't exist on this proc */ 212/* Anomalies that don't exist on this proc */
205#define ANOMALY_05000099 (0) 213#define ANOMALY_05000099 (0)
@@ -250,5 +258,7 @@
250#define ANOMALY_05000412 (0) 258#define ANOMALY_05000412 (0)
251#define ANOMALY_05000447 (0) 259#define ANOMALY_05000447 (0)
252#define ANOMALY_05000448 (0) 260#define ANOMALY_05000448 (0)
261#define ANOMALY_05000474 (0)
262#define ANOMALY_05000475 (0)
253 263
254#endif 264#endif
diff --git a/arch/blackfin/mach-bf533/include/mach/anomaly.h b/arch/blackfin/mach-bf533/include/mach/anomaly.h
index cd83db2fb1a1..9b3f7a27714d 100644
--- a/arch/blackfin/mach-bf533/include/mach/anomaly.h
+++ b/arch/blackfin/mach-bf533/include/mach/anomaly.h
@@ -1,9 +1,13 @@
1/* 1/*
2 * File: include/asm-blackfin/mach-bf533/anomaly.h 2 * DO NOT EDIT THIS FILE
3 * Bugs: Enter bugs at http://blackfin.uclinux.org/ 3 * This file is under version control at
4 * svn://sources.blackfin.uclinux.org/toolchain/trunk/proc-defs/header-frags/
5 * and can be replaced with that version at any time
6 * DO NOT EDIT THIS FILE
4 * 7 *
5 * Copyright (C) 2004-2009 Analog Devices Inc. 8 * Copyright 2004-2009 Analog Devices Inc.
6 * Licensed under the GPL-2 or later. 9 * Licensed under the ADI BSD license.
10 * https://docs.blackfin.uclinux.org/doku.php?id=adi_bsd
7 */ 11 */
8 12
9/* This file should be up to date with: 13/* This file should be up to date with:
@@ -202,6 +206,10 @@
202#define ANOMALY_05000443 (1) 206#define ANOMALY_05000443 (1)
203/* False Hardware Error when RETI Points to Invalid Memory */ 207/* False Hardware Error when RETI Points to Invalid Memory */
204#define ANOMALY_05000461 (1) 208#define ANOMALY_05000461 (1)
209/* Interrupted 32-Bit SPORT Data Register Access Results In Underflow */
210#define ANOMALY_05000473 (1)
211/* TESTSET Instruction Cannot Be Interrupted */
212#define ANOMALY_05000477 (1)
205 213
206/* These anomalies have been "phased" out of analog.com anomaly sheets and are 214/* These anomalies have been "phased" out of analog.com anomaly sheets and are
207 * here to show running on older silicon just isn't feasible. 215 * here to show running on older silicon just isn't feasible.
@@ -349,5 +357,7 @@
349#define ANOMALY_05000450 (0) 357#define ANOMALY_05000450 (0)
350#define ANOMALY_05000465 (0) 358#define ANOMALY_05000465 (0)
351#define ANOMALY_05000467 (0) 359#define ANOMALY_05000467 (0)
360#define ANOMALY_05000474 (0)
361#define ANOMALY_05000475 (0)
352 362
353#endif 363#endif
diff --git a/arch/blackfin/mach-bf537/include/mach/anomaly.h b/arch/blackfin/mach-bf537/include/mach/anomaly.h
index f091ad2d8ea8..d2c427bc6656 100644
--- a/arch/blackfin/mach-bf537/include/mach/anomaly.h
+++ b/arch/blackfin/mach-bf537/include/mach/anomaly.h
@@ -1,9 +1,13 @@
1/* 1/*
2 * File: include/asm-blackfin/mach-bf537/anomaly.h 2 * DO NOT EDIT THIS FILE
3 * Bugs: Enter bugs at http://blackfin.uclinux.org/ 3 * This file is under version control at
4 * svn://sources.blackfin.uclinux.org/toolchain/trunk/proc-defs/header-frags/
5 * and can be replaced with that version at any time
6 * DO NOT EDIT THIS FILE
4 * 7 *
5 * Copyright (C) 2004-2009 Analog Devices Inc. 8 * Copyright 2004-2009 Analog Devices Inc.
6 * Licensed under the GPL-2 or later. 9 * Licensed under the ADI BSD license.
10 * https://docs.blackfin.uclinux.org/doku.php?id=adi_bsd
7 */ 11 */
8 12
9/* This file should be up to date with: 13/* This file should be up to date with:
@@ -156,6 +160,10 @@
156#define ANOMALY_05000443 (1) 160#define ANOMALY_05000443 (1)
157/* False Hardware Error when RETI Points to Invalid Memory */ 161/* False Hardware Error when RETI Points to Invalid Memory */
158#define ANOMALY_05000461 (1) 162#define ANOMALY_05000461 (1)
163/* Interrupted 32-Bit SPORT Data Register Access Results In Underflow */
164#define ANOMALY_05000473 (1)
165/* TESTSET Instruction Cannot Be Interrupted */
166#define ANOMALY_05000477 (1)
159 167
160/* Anomalies that don't exist on this proc */ 168/* Anomalies that don't exist on this proc */
161#define ANOMALY_05000099 (0) 169#define ANOMALY_05000099 (0)
@@ -202,5 +210,7 @@
202#define ANOMALY_05000450 (0) 210#define ANOMALY_05000450 (0)
203#define ANOMALY_05000465 (0) 211#define ANOMALY_05000465 (0)
204#define ANOMALY_05000467 (0) 212#define ANOMALY_05000467 (0)
213#define ANOMALY_05000474 (0)
214#define ANOMALY_05000475 (0)
205 215
206#endif 216#endif
diff --git a/arch/blackfin/mach-bf538/include/mach/anomaly.h b/arch/blackfin/mach-bf538/include/mach/anomaly.h
index 26b76083e14c..d882b7e6f59b 100644
--- a/arch/blackfin/mach-bf538/include/mach/anomaly.h
+++ b/arch/blackfin/mach-bf538/include/mach/anomaly.h
@@ -1,9 +1,13 @@
1/* 1/*
2 * File: include/asm-blackfin/mach-bf538/anomaly.h 2 * DO NOT EDIT THIS FILE
3 * Bugs: Enter bugs at http://blackfin.uclinux.org/ 3 * This file is under version control at
4 * svn://sources.blackfin.uclinux.org/toolchain/trunk/proc-defs/header-frags/
5 * and can be replaced with that version at any time
6 * DO NOT EDIT THIS FILE
4 * 7 *
5 * Copyright (C) 2004-2009 Analog Devices Inc. 8 * Copyright 2004-2009 Analog Devices Inc.
6 * Licensed under the GPL-2 or later. 9 * Licensed under the ADI BSD license.
10 * https://docs.blackfin.uclinux.org/doku.php?id=adi_bsd
7 */ 11 */
8 12
9/* This file should be up to date with: 13/* This file should be up to date with:
@@ -128,6 +132,10 @@
128#define ANOMALY_05000443 (1) 132#define ANOMALY_05000443 (1)
129/* False Hardware Error when RETI Points to Invalid Memory */ 133/* False Hardware Error when RETI Points to Invalid Memory */
130#define ANOMALY_05000461 (1) 134#define ANOMALY_05000461 (1)
135/* Interrupted 32-Bit SPORT Data Register Access Results In Underflow */
136#define ANOMALY_05000473 (1)
137/* TESTSET Instruction Cannot Be Interrupted */
138#define ANOMALY_05000477 (1)
131 139
132/* Anomalies that don't exist on this proc */ 140/* Anomalies that don't exist on this proc */
133#define ANOMALY_05000099 (0) 141#define ANOMALY_05000099 (0)
@@ -176,5 +184,7 @@
176#define ANOMALY_05000450 (0) 184#define ANOMALY_05000450 (0)
177#define ANOMALY_05000465 (0) 185#define ANOMALY_05000465 (0)
178#define ANOMALY_05000467 (0) 186#define ANOMALY_05000467 (0)
187#define ANOMALY_05000474 (0)
188#define ANOMALY_05000475 (0)
179 189
180#endif 190#endif
diff --git a/arch/blackfin/mach-bf548/include/mach/anomaly.h b/arch/blackfin/mach-bf548/include/mach/anomaly.h
index 52b116ae522a..7d08c7524498 100644
--- a/arch/blackfin/mach-bf548/include/mach/anomaly.h
+++ b/arch/blackfin/mach-bf548/include/mach/anomaly.h
@@ -1,9 +1,13 @@
1/* 1/*
2 * File: include/asm-blackfin/mach-bf548/anomaly.h 2 * DO NOT EDIT THIS FILE
3 * Bugs: Enter bugs at http://blackfin.uclinux.org/ 3 * This file is under version control at
4 * svn://sources.blackfin.uclinux.org/toolchain/trunk/proc-defs/header-frags/
5 * and can be replaced with that version at any time
6 * DO NOT EDIT THIS FILE
4 * 7 *
5 * Copyright (C) 2004-2009 Analog Devices Inc. 8 * Copyright 2004-2009 Analog Devices Inc.
6 * Licensed under the GPL-2 or later. 9 * Licensed under the ADI BSD license.
10 * https://docs.blackfin.uclinux.org/doku.php?id=adi_bsd
7 */ 11 */
8 12
9/* This file should be up to date with: 13/* This file should be up to date with:
@@ -24,6 +28,8 @@
24#define ANOMALY_05000119 (1) 28#define ANOMALY_05000119 (1)
25/* Rx.H Cannot Be Used to Access 16-bit System MMR Registers */ 29/* Rx.H Cannot Be Used to Access 16-bit System MMR Registers */
26#define ANOMALY_05000122 (1) 30#define ANOMALY_05000122 (1)
31/* Data Corruption with Cached External Memory and Non-Cached On-Chip L2 Memory */
32#define ANOMALY_05000220 (1)
27/* False Hardware Error from an Access in the Shadow of a Conditional Branch */ 33/* False Hardware Error from an Access in the Shadow of a Conditional Branch */
28#define ANOMALY_05000245 (1) 34#define ANOMALY_05000245 (1)
29/* Sensitivity To Noise with Slow Input Edge Rates on External SPORT TX and RX Clocks */ 35/* Sensitivity To Noise with Slow Input Edge Rates on External SPORT TX and RX Clocks */
@@ -200,6 +206,14 @@
200#define ANOMALY_05000466 (1) 206#define ANOMALY_05000466 (1)
201/* Possible RX data corruption when control & data EP FIFOs are accessed via the core */ 207/* Possible RX data corruption when control & data EP FIFOs are accessed via the core */
202#define ANOMALY_05000467 (1) 208#define ANOMALY_05000467 (1)
209/* Interrupted 32-Bit SPORT Data Register Access Results In Underflow */
210#define ANOMALY_05000473 (1)
211/* Access to DDR-SDRAM causes system hang under certain PLL/VR settings */
212#define ANOMALY_05000474 (1)
213/* Core Hang With L2/L3 Configured in Writeback Cache Mode */
214#define ANOMALY_05000475 (1)
215/* TESTSET Instruction Cannot Be Interrupted */
216#define ANOMALY_05000477 (1)
203 217
204/* Anomalies that don't exist on this proc */ 218/* Anomalies that don't exist on this proc */
205#define ANOMALY_05000099 (0) 219#define ANOMALY_05000099 (0)
@@ -215,7 +229,6 @@
215#define ANOMALY_05000198 (0) 229#define ANOMALY_05000198 (0)
216#define ANOMALY_05000202 (0) 230#define ANOMALY_05000202 (0)
217#define ANOMALY_05000215 (0) 231#define ANOMALY_05000215 (0)
218#define ANOMALY_05000220 (0)
219#define ANOMALY_05000227 (0) 232#define ANOMALY_05000227 (0)
220#define ANOMALY_05000230 (0) 233#define ANOMALY_05000230 (0)
221#define ANOMALY_05000231 (0) 234#define ANOMALY_05000231 (0)
diff --git a/arch/blackfin/mach-bf561/atomic.S b/arch/blackfin/mach-bf561/atomic.S
index 0261a5e751b3..f99f174b129f 100644
--- a/arch/blackfin/mach-bf561/atomic.S
+++ b/arch/blackfin/mach-bf561/atomic.S
@@ -19,6 +19,16 @@
19 \reg\().h = _corelock; 19 \reg\().h = _corelock;
20.endm 20.endm
21 21
22.macro safe_testset addr:req, scratch:req
23#if ANOMALY_05000477
24 cli \scratch;
25 testset (\addr);
26 sti \scratch;
27#else
28 testset (\addr);
29#endif
30.endm
31
22/* 32/*
23 * r0 = address of atomic data to flush and invalidate (32bit). 33 * r0 = address of atomic data to flush and invalidate (32bit).
24 * 34 *
@@ -33,7 +43,7 @@ ENTRY(_get_core_lock)
33 cli r0; 43 cli r0;
34 coreslot_loadaddr p0; 44 coreslot_loadaddr p0;
35.Lretry_corelock: 45.Lretry_corelock:
36 testset (p0); 46 safe_testset p0, r2;
37 if cc jump .Ldone_corelock; 47 if cc jump .Ldone_corelock;
38 SSYNC(r2); 48 SSYNC(r2);
39 jump .Lretry_corelock 49 jump .Lretry_corelock
@@ -56,7 +66,7 @@ ENTRY(_get_core_lock_noflush)
56 cli r0; 66 cli r0;
57 coreslot_loadaddr p0; 67 coreslot_loadaddr p0;
58.Lretry_corelock_noflush: 68.Lretry_corelock_noflush:
59 testset (p0); 69 safe_testset p0, r2;
60 if cc jump .Ldone_corelock_noflush; 70 if cc jump .Ldone_corelock_noflush;
61 SSYNC(r2); 71 SSYNC(r2);
62 jump .Lretry_corelock_noflush 72 jump .Lretry_corelock_noflush
diff --git a/arch/blackfin/mach-bf561/include/mach/anomaly.h b/arch/blackfin/mach-bf561/include/mach/anomaly.h
index 70da495c9665..5ddc981e9937 100644
--- a/arch/blackfin/mach-bf561/include/mach/anomaly.h
+++ b/arch/blackfin/mach-bf561/include/mach/anomaly.h
@@ -1,9 +1,13 @@
1/* 1/*
2 * File: include/asm-blackfin/mach-bf561/anomaly.h 2 * DO NOT EDIT THIS FILE
3 * Bugs: Enter bugs at http://blackfin.uclinux.org/ 3 * This file is under version control at
4 * svn://sources.blackfin.uclinux.org/toolchain/trunk/proc-defs/header-frags/
5 * and can be replaced with that version at any time
6 * DO NOT EDIT THIS FILE
4 * 7 *
5 * Copyright (C) 2004-2009 Analog Devices Inc. 8 * Copyright 2004-2009 Analog Devices Inc.
6 * Licensed under the GPL-2 or later. 9 * Licensed under the ADI BSD license.
10 * https://docs.blackfin.uclinux.org/doku.php?id=adi_bsd
7 */ 11 */
8 12
9/* This file should be up to date with: 13/* This file should be up to date with:
@@ -213,7 +217,11 @@
213/* Disabling Peripherals with DMA Running May Cause DMA System Instability */ 217/* Disabling Peripherals with DMA Running May Cause DMA System Instability */
214#define ANOMALY_05000278 (__SILICON_REVISION__ < 5) 218#define ANOMALY_05000278 (__SILICON_REVISION__ < 5)
215/* False Hardware Error Exception when ISR Context Is Not Restored */ 219/* False Hardware Error Exception when ISR Context Is Not Restored */
216#define ANOMALY_05000281 (__SILICON_REVISION__ < 5) 220/* Temporarily walk around for bug 5423 till this issue is confirmed by
221 * official anomaly document. It looks 05000281 still exists on bf561
222 * v0.5.
223 */
224#define ANOMALY_05000281 (__SILICON_REVISION__ <= 5)
217/* System MMR Write Is Stalled Indefinitely when Killed in a Particular Stage */ 225/* System MMR Write Is Stalled Indefinitely when Killed in a Particular Stage */
218#define ANOMALY_05000283 (1) 226#define ANOMALY_05000283 (1)
219/* Reads Will Receive Incorrect Data under Certain Conditions */ 227/* Reads Will Receive Incorrect Data under Certain Conditions */
@@ -280,6 +288,12 @@
280#define ANOMALY_05000443 (1) 288#define ANOMALY_05000443 (1)
281/* False Hardware Error when RETI Points to Invalid Memory */ 289/* False Hardware Error when RETI Points to Invalid Memory */
282#define ANOMALY_05000461 (1) 290#define ANOMALY_05000461 (1)
291/* Interrupted 32-Bit SPORT Data Register Access Results In Underflow */
292#define ANOMALY_05000473 (1)
293/* Core Hang With L2/L3 Configured in Writeback Cache Mode */
294#define ANOMALY_05000475 (__SILICON_REVISION__ < 4)
295/* TESTSET Instruction Cannot Be Interrupted */
296#define ANOMALY_05000477 (1)
283 297
284/* Anomalies that don't exist on this proc */ 298/* Anomalies that don't exist on this proc */
285#define ANOMALY_05000119 (0) 299#define ANOMALY_05000119 (0)
@@ -304,5 +318,6 @@
304#define ANOMALY_05000450 (0) 318#define ANOMALY_05000450 (0)
305#define ANOMALY_05000465 (0) 319#define ANOMALY_05000465 (0)
306#define ANOMALY_05000467 (0) 320#define ANOMALY_05000467 (0)
321#define ANOMALY_05000474 (0)
307 322
308#endif 323#endif
diff --git a/arch/blackfin/mach-common/arch_checks.c b/arch/blackfin/mach-common/arch_checks.c
index 9dbafcdcf479..f2ca211a76a0 100644
--- a/arch/blackfin/mach-common/arch_checks.c
+++ b/arch/blackfin/mach-common/arch_checks.c
@@ -57,3 +57,8 @@
57 (!defined(CONFIG_BFIN_EXTMEM_DCACHEABLE) && defined(CONFIG_BFIN_L2_WRITEBACK))) 57 (!defined(CONFIG_BFIN_EXTMEM_DCACHEABLE) && defined(CONFIG_BFIN_L2_WRITEBACK)))
58# error You are exposing Anomaly 220 in this config, either config L2 as Write Through, or make External Memory WB. 58# error You are exposing Anomaly 220 in this config, either config L2 as Write Through, or make External Memory WB.
59#endif 59#endif
60
61#if ANOMALY_05000475 && \
62 (defined(CONFIG_BFIN_EXTMEM_WRITEBACK) || defined(CONFIG_BFIN_L2_WRITEBACK))
63# error "Anomaly 475 does not allow you to use Write Back cache with L2 or External Memory"
64#endif
diff --git a/arch/blackfin/mach-common/entry.S b/arch/blackfin/mach-common/entry.S
index 94a0375cbdcf..a50637a8b9bd 100644
--- a/arch/blackfin/mach-common/entry.S
+++ b/arch/blackfin/mach-common/entry.S
@@ -1600,6 +1600,7 @@ ENTRY(_sys_call_table)
1600 .long _sys_pwritev 1600 .long _sys_pwritev
1601 .long _sys_rt_tgsigqueueinfo 1601 .long _sys_rt_tgsigqueueinfo
1602 .long _sys_perf_event_open 1602 .long _sys_perf_event_open
1603 .long _sys_recvmmsg /* 370 */
1603 1604
1604 .rept NR_syscalls-(.-_sys_call_table)/4 1605 .rept NR_syscalls-(.-_sys_call_table)/4
1605 .long _sys_ni_syscall 1606 .long _sys_ni_syscall
diff --git a/arch/blackfin/mach-common/smp.c b/arch/blackfin/mach-common/smp.c
index d98585f3237d..d92b168c8328 100644
--- a/arch/blackfin/mach-common/smp.c
+++ b/arch/blackfin/mach-common/smp.c
@@ -276,10 +276,9 @@ void smp_send_reschedule(int cpu)
276 if (cpu_is_offline(cpu)) 276 if (cpu_is_offline(cpu))
277 return; 277 return;
278 278
279 msg = kmalloc(sizeof(*msg), GFP_ATOMIC); 279 msg = kzalloc(sizeof(*msg), GFP_ATOMIC);
280 if (!msg) 280 if (!msg)
281 return; 281 return;
282 memset(msg, 0, sizeof(msg));
283 INIT_LIST_HEAD(&msg->list); 282 INIT_LIST_HEAD(&msg->list);
284 msg->type = BFIN_IPI_RESCHEDULE; 283 msg->type = BFIN_IPI_RESCHEDULE;
285 284
@@ -305,10 +304,9 @@ void smp_send_stop(void)
305 if (cpus_empty(callmap)) 304 if (cpus_empty(callmap))
306 return; 305 return;
307 306
308 msg = kmalloc(sizeof(*msg), GFP_ATOMIC); 307 msg = kzalloc(sizeof(*msg), GFP_ATOMIC);
309 if (!msg) 308 if (!msg)
310 return; 309 return;
311 memset(msg, 0, sizeof(msg));
312 INIT_LIST_HEAD(&msg->list); 310 INIT_LIST_HEAD(&msg->list);
313 msg->type = BFIN_IPI_CPU_STOP; 311 msg->type = BFIN_IPI_CPU_STOP;
314 312
diff --git a/arch/cris/include/asm/cacheflush.h b/arch/cris/include/asm/cacheflush.h
index cf60e3f69f8d..36795bca605e 100644
--- a/arch/cris/include/asm/cacheflush.h
+++ b/arch/cris/include/asm/cacheflush.h
@@ -12,6 +12,7 @@
12#define flush_cache_dup_mm(mm) do { } while (0) 12#define flush_cache_dup_mm(mm) do { } while (0)
13#define flush_cache_range(vma, start, end) do { } while (0) 13#define flush_cache_range(vma, start, end) do { } while (0)
14#define flush_cache_page(vma, vmaddr, pfn) do { } while (0) 14#define flush_cache_page(vma, vmaddr, pfn) do { } while (0)
15#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 0
15#define flush_dcache_page(page) do { } while (0) 16#define flush_dcache_page(page) do { } while (0)
16#define flush_dcache_mmap_lock(mapping) do { } while (0) 17#define flush_dcache_mmap_lock(mapping) do { } while (0)
17#define flush_dcache_mmap_unlock(mapping) do { } while (0) 18#define flush_dcache_mmap_unlock(mapping) do { } while (0)
diff --git a/arch/cris/include/asm/socket.h b/arch/cris/include/asm/socket.h
index 45ec49bdb7b1..1a4a61909ca8 100644
--- a/arch/cris/include/asm/socket.h
+++ b/arch/cris/include/asm/socket.h
@@ -62,6 +62,8 @@
62#define SO_PROTOCOL 38 62#define SO_PROTOCOL 38
63#define SO_DOMAIN 39 63#define SO_DOMAIN 39
64 64
65#define SO_RXQ_OVFL 40
66
65#endif /* _ASM_SOCKET_H */ 67#endif /* _ASM_SOCKET_H */
66 68
67 69
diff --git a/arch/frv/include/asm/cacheflush.h b/arch/frv/include/asm/cacheflush.h
index 432a69e7f3d4..edbac54ae015 100644
--- a/arch/frv/include/asm/cacheflush.h
+++ b/arch/frv/include/asm/cacheflush.h
@@ -47,6 +47,7 @@ static inline void __flush_cache_all(void)
47} 47}
48 48
49/* dcache/icache coherency... */ 49/* dcache/icache coherency... */
50#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1
50#ifdef CONFIG_MMU 51#ifdef CONFIG_MMU
51extern void flush_dcache_page(struct page *page); 52extern void flush_dcache_page(struct page *page);
52#else 53#else
diff --git a/arch/frv/include/asm/socket.h b/arch/frv/include/asm/socket.h
index 2dea726095c2..a6b26880c1ec 100644
--- a/arch/frv/include/asm/socket.h
+++ b/arch/frv/include/asm/socket.h
@@ -60,5 +60,7 @@
60#define SO_PROTOCOL 38 60#define SO_PROTOCOL 38
61#define SO_DOMAIN 39 61#define SO_DOMAIN 39
62 62
63#define SO_RXQ_OVFL 40
64
63#endif /* _ASM_SOCKET_H */ 65#endif /* _ASM_SOCKET_H */
64 66
diff --git a/arch/frv/kernel/pm.c b/arch/frv/kernel/pm.c
index 0d4d3e3a4cfc..5fa3889d858b 100644
--- a/arch/frv/kernel/pm.c
+++ b/arch/frv/kernel/pm.c
@@ -211,37 +211,6 @@ static int cmode_procctl(ctl_table *ctl, int write,
211 return try_set_cmode(new_cmode)?:*lenp; 211 return try_set_cmode(new_cmode)?:*lenp;
212} 212}
213 213
214static int cmode_sysctl(ctl_table *table,
215 void __user *oldval, size_t __user *oldlenp,
216 void __user *newval, size_t newlen)
217{
218 if (oldval && oldlenp) {
219 size_t oldlen;
220
221 if (get_user(oldlen, oldlenp))
222 return -EFAULT;
223
224 if (oldlen != sizeof(int))
225 return -EINVAL;
226
227 if (put_user(clock_cmode_current, (unsigned __user *)oldval) ||
228 put_user(sizeof(int), oldlenp))
229 return -EFAULT;
230 }
231 if (newval && newlen) {
232 int new_cmode;
233
234 if (newlen != sizeof(int))
235 return -EINVAL;
236
237 if (get_user(new_cmode, (int __user *)newval))
238 return -EFAULT;
239
240 return try_set_cmode(new_cmode)?:1;
241 }
242 return 1;
243}
244
245static int try_set_p0(int new_p0) 214static int try_set_p0(int new_p0)
246{ 215{
247 unsigned long flags, clkc; 216 unsigned long flags, clkc;
@@ -314,37 +283,6 @@ static int p0_procctl(ctl_table *ctl, int write,
314 return try_set_p0(new_p0)?:*lenp; 283 return try_set_p0(new_p0)?:*lenp;
315} 284}
316 285
317static int p0_sysctl(ctl_table *table,
318 void __user *oldval, size_t __user *oldlenp,
319 void __user *newval, size_t newlen)
320{
321 if (oldval && oldlenp) {
322 size_t oldlen;
323
324 if (get_user(oldlen, oldlenp))
325 return -EFAULT;
326
327 if (oldlen != sizeof(int))
328 return -EINVAL;
329
330 if (put_user(clock_p0_current, (unsigned __user *)oldval) ||
331 put_user(sizeof(int), oldlenp))
332 return -EFAULT;
333 }
334 if (newval && newlen) {
335 int new_p0;
336
337 if (newlen != sizeof(int))
338 return -EINVAL;
339
340 if (get_user(new_p0, (int __user *)newval))
341 return -EFAULT;
342
343 return try_set_p0(new_p0)?:1;
344 }
345 return 1;
346}
347
348static int cm_procctl(ctl_table *ctl, int write, 286static int cm_procctl(ctl_table *ctl, int write,
349 void __user *buffer, size_t *lenp, loff_t *fpos) 287 void __user *buffer, size_t *lenp, loff_t *fpos)
350{ 288{
@@ -358,87 +296,47 @@ static int cm_procctl(ctl_table *ctl, int write,
358 return try_set_cm(new_cm)?:*lenp; 296 return try_set_cm(new_cm)?:*lenp;
359} 297}
360 298
361static int cm_sysctl(ctl_table *table,
362 void __user *oldval, size_t __user *oldlenp,
363 void __user *newval, size_t newlen)
364{
365 if (oldval && oldlenp) {
366 size_t oldlen;
367
368 if (get_user(oldlen, oldlenp))
369 return -EFAULT;
370
371 if (oldlen != sizeof(int))
372 return -EINVAL;
373
374 if (put_user(clock_cm_current, (unsigned __user *)oldval) ||
375 put_user(sizeof(int), oldlenp))
376 return -EFAULT;
377 }
378 if (newval && newlen) {
379 int new_cm;
380
381 if (newlen != sizeof(int))
382 return -EINVAL;
383
384 if (get_user(new_cm, (int __user *)newval))
385 return -EFAULT;
386
387 return try_set_cm(new_cm)?:1;
388 }
389 return 1;
390}
391
392
393static struct ctl_table pm_table[] = 299static struct ctl_table pm_table[] =
394{ 300{
395 { 301 {
396 .ctl_name = CTL_PM_SUSPEND,
397 .procname = "suspend", 302 .procname = "suspend",
398 .data = NULL, 303 .data = NULL,
399 .maxlen = 0, 304 .maxlen = 0,
400 .mode = 0200, 305 .mode = 0200,
401 .proc_handler = &sysctl_pm_do_suspend, 306 .proc_handler = sysctl_pm_do_suspend,
402 }, 307 },
403 { 308 {
404 .ctl_name = CTL_PM_CMODE,
405 .procname = "cmode", 309 .procname = "cmode",
406 .data = &clock_cmode_current, 310 .data = &clock_cmode_current,
407 .maxlen = sizeof(int), 311 .maxlen = sizeof(int),
408 .mode = 0644, 312 .mode = 0644,
409 .proc_handler = &cmode_procctl, 313 .proc_handler = cmode_procctl,
410 .strategy = &cmode_sysctl,
411 }, 314 },
412 { 315 {
413 .ctl_name = CTL_PM_P0,
414 .procname = "p0", 316 .procname = "p0",
415 .data = &clock_p0_current, 317 .data = &clock_p0_current,
416 .maxlen = sizeof(int), 318 .maxlen = sizeof(int),
417 .mode = 0644, 319 .mode = 0644,
418 .proc_handler = &p0_procctl, 320 .proc_handler = p0_procctl,
419 .strategy = &p0_sysctl,
420 }, 321 },
421 { 322 {
422 .ctl_name = CTL_PM_CM,
423 .procname = "cm", 323 .procname = "cm",
424 .data = &clock_cm_current, 324 .data = &clock_cm_current,
425 .maxlen = sizeof(int), 325 .maxlen = sizeof(int),
426 .mode = 0644, 326 .mode = 0644,
427 .proc_handler = &cm_procctl, 327 .proc_handler = cm_procctl,
428 .strategy = &cm_sysctl,
429 }, 328 },
430 { .ctl_name = 0} 329 { }
431}; 330};
432 331
433static struct ctl_table pm_dir_table[] = 332static struct ctl_table pm_dir_table[] =
434{ 333{
435 { 334 {
436 .ctl_name = CTL_PM,
437 .procname = "pm", 335 .procname = "pm",
438 .mode = 0555, 336 .mode = 0555,
439 .child = pm_table, 337 .child = pm_table,
440 }, 338 },
441 { .ctl_name = 0} 339 { }
442}; 340};
443 341
444/* 342/*
diff --git a/arch/frv/kernel/process.c b/arch/frv/kernel/process.c
index 904255938216..21d0fd19276d 100644
--- a/arch/frv/kernel/process.c
+++ b/arch/frv/kernel/process.c
@@ -255,15 +255,12 @@ asmlinkage int sys_execve(char __user *name, char __user * __user *argv, char __
255 int error; 255 int error;
256 char * filename; 256 char * filename;
257 257
258 lock_kernel();
259 filename = getname(name); 258 filename = getname(name);
260 error = PTR_ERR(filename); 259 error = PTR_ERR(filename);
261 if (IS_ERR(filename)) 260 if (IS_ERR(filename))
262 goto out; 261 return error;
263 error = do_execve(filename, argv, envp, __frame); 262 error = do_execve(filename, argv, envp, __frame);
264 putname(filename); 263 putname(filename);
265 out:
266 unlock_kernel();
267 return error; 264 return error;
268} 265}
269 266
diff --git a/arch/frv/kernel/sysctl.c b/arch/frv/kernel/sysctl.c
index 3e9d7e03fb95..035516cb7a97 100644
--- a/arch/frv/kernel/sysctl.c
+++ b/arch/frv/kernel/sysctl.c
@@ -176,21 +176,19 @@ static int procctl_frv_pin_cxnr(ctl_table *table, int write, struct file *filp,
176static struct ctl_table frv_table[] = 176static struct ctl_table frv_table[] =
177{ 177{
178 { 178 {
179 .ctl_name = 1,
180 .procname = "cache-mode", 179 .procname = "cache-mode",
181 .data = NULL, 180 .data = NULL,
182 .maxlen = 0, 181 .maxlen = 0,
183 .mode = 0644, 182 .mode = 0644,
184 .proc_handler = &procctl_frv_cachemode, 183 .proc_handler = procctl_frv_cachemode,
185 }, 184 },
186#ifdef CONFIG_MMU 185#ifdef CONFIG_MMU
187 { 186 {
188 .ctl_name = 2,
189 .procname = "pin-cxnr", 187 .procname = "pin-cxnr",
190 .data = NULL, 188 .data = NULL,
191 .maxlen = 0, 189 .maxlen = 0,
192 .mode = 0644, 190 .mode = 0644,
193 .proc_handler = &procctl_frv_pin_cxnr 191 .proc_handler = procctl_frv_pin_cxnr
194 }, 192 },
195#endif 193#endif
196 {} 194 {}
@@ -203,7 +201,6 @@ static struct ctl_table frv_table[] =
203static struct ctl_table frv_dir_table[] = 201static struct ctl_table frv_dir_table[] =
204{ 202{
205 { 203 {
206 .ctl_name = CTL_FRV,
207 .procname = "frv", 204 .procname = "frv",
208 .mode = 0555, 205 .mode = 0555,
209 .child = frv_table 206 .child = frv_table
diff --git a/arch/h8300/include/asm/cacheflush.h b/arch/h8300/include/asm/cacheflush.h
index 5ffdca217b95..4cf2df20c1ce 100644
--- a/arch/h8300/include/asm/cacheflush.h
+++ b/arch/h8300/include/asm/cacheflush.h
@@ -15,6 +15,7 @@
15#define flush_cache_dup_mm(mm) do { } while (0) 15#define flush_cache_dup_mm(mm) do { } while (0)
16#define flush_cache_range(vma,a,b) 16#define flush_cache_range(vma,a,b)
17#define flush_cache_page(vma,p,pfn) 17#define flush_cache_page(vma,p,pfn)
18#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 0
18#define flush_dcache_page(page) 19#define flush_dcache_page(page)
19#define flush_dcache_mmap_lock(mapping) 20#define flush_dcache_mmap_lock(mapping)
20#define flush_dcache_mmap_unlock(mapping) 21#define flush_dcache_mmap_unlock(mapping)
diff --git a/arch/h8300/include/asm/socket.h b/arch/h8300/include/asm/socket.h
index 1547f01c8e22..04c0f4596eb5 100644
--- a/arch/h8300/include/asm/socket.h
+++ b/arch/h8300/include/asm/socket.h
@@ -60,4 +60,6 @@
60#define SO_PROTOCOL 38 60#define SO_PROTOCOL 38
61#define SO_DOMAIN 39 61#define SO_DOMAIN 39
62 62
63#define SO_RXQ_OVFL 40
64
63#endif /* _ASM_SOCKET_H */ 65#endif /* _ASM_SOCKET_H */
diff --git a/arch/h8300/kernel/process.c b/arch/h8300/kernel/process.c
index e2f33d0f9969..bd883faa983d 100644
--- a/arch/h8300/kernel/process.c
+++ b/arch/h8300/kernel/process.c
@@ -218,15 +218,12 @@ asmlinkage int sys_execve(char *name, char **argv, char **envp,int dummy,...)
218 char * filename; 218 char * filename;
219 struct pt_regs *regs = (struct pt_regs *) ((unsigned char *)&dummy-4); 219 struct pt_regs *regs = (struct pt_regs *) ((unsigned char *)&dummy-4);
220 220
221 lock_kernel();
222 filename = getname(name); 221 filename = getname(name);
223 error = PTR_ERR(filename); 222 error = PTR_ERR(filename);
224 if (IS_ERR(filename)) 223 if (IS_ERR(filename))
225 goto out; 224 return error;
226 error = do_execve(filename, argv, envp, regs); 225 error = do_execve(filename, argv, envp, regs);
227 putname(filename); 226 putname(filename);
228out:
229 unlock_kernel();
230 return error; 227 return error;
231} 228}
232 229
diff --git a/arch/ia64/ia32/ia32_entry.S b/arch/ia64/ia32/ia32_entry.S
index af9405cd70e5..10c37510f4b4 100644
--- a/arch/ia64/ia32/ia32_entry.S
+++ b/arch/ia64/ia32/ia32_entry.S
@@ -327,7 +327,7 @@ ia32_syscall_table:
327 data8 compat_sys_writev 327 data8 compat_sys_writev
328 data8 sys_getsid 328 data8 sys_getsid
329 data8 sys_fdatasync 329 data8 sys_fdatasync
330 data8 sys32_sysctl 330 data8 compat_sys_sysctl
331 data8 sys_mlock /* 150 */ 331 data8 sys_mlock /* 150 */
332 data8 sys_munlock 332 data8 sys_munlock
333 data8 sys_mlockall 333 data8 sys_mlockall
diff --git a/arch/ia64/ia32/sys_ia32.c b/arch/ia64/ia32/sys_ia32.c
index 625ed8f76fce..429ec968c9ee 100644
--- a/arch/ia64/ia32/sys_ia32.c
+++ b/arch/ia64/ia32/sys_ia32.c
@@ -1628,61 +1628,6 @@ sys32_msync (unsigned int start, unsigned int len, int flags)
1628 return sys_msync(addr, len + (start - addr), flags); 1628 return sys_msync(addr, len + (start - addr), flags);
1629} 1629}
1630 1630
1631struct sysctl32 {
1632 unsigned int name;
1633 int nlen;
1634 unsigned int oldval;
1635 unsigned int oldlenp;
1636 unsigned int newval;
1637 unsigned int newlen;
1638 unsigned int __unused[4];
1639};
1640
1641#ifdef CONFIG_SYSCTL_SYSCALL
1642asmlinkage long
1643sys32_sysctl (struct sysctl32 __user *args)
1644{
1645 struct sysctl32 a32;
1646 mm_segment_t old_fs = get_fs ();
1647 void __user *oldvalp, *newvalp;
1648 size_t oldlen;
1649 int __user *namep;
1650 long ret;
1651
1652 if (copy_from_user(&a32, args, sizeof(a32)))
1653 return -EFAULT;
1654
1655 /*
1656 * We need to pre-validate these because we have to disable address checking
1657 * before calling do_sysctl() because of OLDLEN but we can't run the risk of the
1658 * user specifying bad addresses here. Well, since we're dealing with 32 bit
1659 * addresses, we KNOW that access_ok() will always succeed, so this is an
1660 * expensive NOP, but so what...
1661 */
1662 namep = (int __user *) compat_ptr(a32.name);
1663 oldvalp = compat_ptr(a32.oldval);
1664 newvalp = compat_ptr(a32.newval);
1665
1666 if ((oldvalp && get_user(oldlen, (int __user *) compat_ptr(a32.oldlenp)))
1667 || !access_ok(VERIFY_WRITE, namep, 0)
1668 || !access_ok(VERIFY_WRITE, oldvalp, 0)
1669 || !access_ok(VERIFY_WRITE, newvalp, 0))
1670 return -EFAULT;
1671
1672 set_fs(KERNEL_DS);
1673 lock_kernel();
1674 ret = do_sysctl(namep, a32.nlen, oldvalp, (size_t __user *) &oldlen,
1675 newvalp, (size_t) a32.newlen);
1676 unlock_kernel();
1677 set_fs(old_fs);
1678
1679 if (oldvalp && put_user (oldlen, (int __user *) compat_ptr(a32.oldlenp)))
1680 return -EFAULT;
1681
1682 return ret;
1683}
1684#endif
1685
1686asmlinkage long 1631asmlinkage long
1687sys32_newuname (struct new_utsname __user *name) 1632sys32_newuname (struct new_utsname __user *name)
1688{ 1633{
diff --git a/arch/ia64/include/asm/cacheflush.h b/arch/ia64/include/asm/cacheflush.h
index c8ce2719fee8..429eefc93ee7 100644
--- a/arch/ia64/include/asm/cacheflush.h
+++ b/arch/ia64/include/asm/cacheflush.h
@@ -25,6 +25,7 @@
25#define flush_cache_vmap(start, end) do { } while (0) 25#define flush_cache_vmap(start, end) do { } while (0)
26#define flush_cache_vunmap(start, end) do { } while (0) 26#define flush_cache_vunmap(start, end) do { } while (0)
27 27
28#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1
28#define flush_dcache_page(page) \ 29#define flush_dcache_page(page) \
29do { \ 30do { \
30 clear_bit(PG_arch_1, &(page)->flags); \ 31 clear_bit(PG_arch_1, &(page)->flags); \
diff --git a/arch/ia64/include/asm/kvm.h b/arch/ia64/include/asm/kvm.h
index 18a7e49abbc5..bc90c75adf67 100644
--- a/arch/ia64/include/asm/kvm.h
+++ b/arch/ia64/include/asm/kvm.h
@@ -60,6 +60,7 @@ struct kvm_ioapic_state {
60#define KVM_IRQCHIP_PIC_MASTER 0 60#define KVM_IRQCHIP_PIC_MASTER 0
61#define KVM_IRQCHIP_PIC_SLAVE 1 61#define KVM_IRQCHIP_PIC_SLAVE 1
62#define KVM_IRQCHIP_IOAPIC 2 62#define KVM_IRQCHIP_IOAPIC 2
63#define KVM_NR_IRQCHIPS 3
63 64
64#define KVM_CONTEXT_SIZE 8*1024 65#define KVM_CONTEXT_SIZE 8*1024
65 66
diff --git a/arch/ia64/include/asm/kvm_host.h b/arch/ia64/include/asm/kvm_host.h
index d9b6325a9328..a362e67e0ca6 100644
--- a/arch/ia64/include/asm/kvm_host.h
+++ b/arch/ia64/include/asm/kvm_host.h
@@ -475,7 +475,6 @@ struct kvm_arch {
475 struct list_head assigned_dev_head; 475 struct list_head assigned_dev_head;
476 struct iommu_domain *iommu_domain; 476 struct iommu_domain *iommu_domain;
477 int iommu_flags; 477 int iommu_flags;
478 struct hlist_head irq_ack_notifier_list;
479 478
480 unsigned long irq_sources_bitmap; 479 unsigned long irq_sources_bitmap;
481 unsigned long irq_states[KVM_IOAPIC_NUM_PINS]; 480 unsigned long irq_states[KVM_IOAPIC_NUM_PINS];
diff --git a/arch/ia64/include/asm/socket.h b/arch/ia64/include/asm/socket.h
index 0b0d5ff062e5..51427eaa51ba 100644
--- a/arch/ia64/include/asm/socket.h
+++ b/arch/ia64/include/asm/socket.h
@@ -69,4 +69,6 @@
69#define SO_PROTOCOL 38 69#define SO_PROTOCOL 38
70#define SO_DOMAIN 39 70#define SO_DOMAIN 39
71 71
72#define SO_RXQ_OVFL 40
73
72#endif /* _ASM_IA64_SOCKET_H */ 74#endif /* _ASM_IA64_SOCKET_H */
diff --git a/arch/ia64/include/asm/swiotlb.h b/arch/ia64/include/asm/swiotlb.h
index dcbaea7ce128..f0acde68aaea 100644
--- a/arch/ia64/include/asm/swiotlb.h
+++ b/arch/ia64/include/asm/swiotlb.h
@@ -4,8 +4,6 @@
4#include <linux/dma-mapping.h> 4#include <linux/dma-mapping.h>
5#include <linux/swiotlb.h> 5#include <linux/swiotlb.h>
6 6
7extern int swiotlb_force;
8
9#ifdef CONFIG_SWIOTLB 7#ifdef CONFIG_SWIOTLB
10extern int swiotlb; 8extern int swiotlb;
11extern void pci_swiotlb_init(void); 9extern void pci_swiotlb_init(void);
diff --git a/arch/ia64/include/asm/unistd.h b/arch/ia64/include/asm/unistd.h
index 5a5347f5c4e4..9c72e36c5281 100644
--- a/arch/ia64/include/asm/unistd.h
+++ b/arch/ia64/include/asm/unistd.h
@@ -311,11 +311,12 @@
311#define __NR_preadv 1319 311#define __NR_preadv 1319
312#define __NR_pwritev 1320 312#define __NR_pwritev 1320
313#define __NR_rt_tgsigqueueinfo 1321 313#define __NR_rt_tgsigqueueinfo 1321
314#define __NR_rt_recvmmsg 1322
314 315
315#ifdef __KERNEL__ 316#ifdef __KERNEL__
316 317
317 318
318#define NR_syscalls 298 /* length of syscall table */ 319#define NR_syscalls 299 /* length of syscall table */
319 320
320/* 321/*
321 * The following defines stop scripts/checksyscalls.sh from complaining about 322 * The following defines stop scripts/checksyscalls.sh from complaining about
diff --git a/arch/ia64/kernel/crash.c b/arch/ia64/kernel/crash.c
index 6631a9dfafdc..b942f4032d7a 100644
--- a/arch/ia64/kernel/crash.c
+++ b/arch/ia64/kernel/crash.c
@@ -239,32 +239,29 @@ kdump_init_notifier(struct notifier_block *self, unsigned long val, void *data)
239#ifdef CONFIG_SYSCTL 239#ifdef CONFIG_SYSCTL
240static ctl_table kdump_ctl_table[] = { 240static ctl_table kdump_ctl_table[] = {
241 { 241 {
242 .ctl_name = CTL_UNNUMBERED,
243 .procname = "kdump_on_init", 242 .procname = "kdump_on_init",
244 .data = &kdump_on_init, 243 .data = &kdump_on_init,
245 .maxlen = sizeof(int), 244 .maxlen = sizeof(int),
246 .mode = 0644, 245 .mode = 0644,
247 .proc_handler = &proc_dointvec, 246 .proc_handler = proc_dointvec,
248 }, 247 },
249 { 248 {
250 .ctl_name = CTL_UNNUMBERED,
251 .procname = "kdump_on_fatal_mca", 249 .procname = "kdump_on_fatal_mca",
252 .data = &kdump_on_fatal_mca, 250 .data = &kdump_on_fatal_mca,
253 .maxlen = sizeof(int), 251 .maxlen = sizeof(int),
254 .mode = 0644, 252 .mode = 0644,
255 .proc_handler = &proc_dointvec, 253 .proc_handler = proc_dointvec,
256 }, 254 },
257 { .ctl_name = 0 } 255 { }
258}; 256};
259 257
260static ctl_table sys_table[] = { 258static ctl_table sys_table[] = {
261 { 259 {
262 .ctl_name = CTL_KERN,
263 .procname = "kernel", 260 .procname = "kernel",
264 .mode = 0555, 261 .mode = 0555,
265 .child = kdump_ctl_table, 262 .child = kdump_ctl_table,
266 }, 263 },
267 { .ctl_name = 0 } 264 { }
268}; 265};
269#endif 266#endif
270 267
diff --git a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S
index d0e7d37017b4..d75b872ca4dc 100644
--- a/arch/ia64/kernel/entry.S
+++ b/arch/ia64/kernel/entry.S
@@ -1806,6 +1806,7 @@ sys_call_table:
1806 data8 sys_preadv 1806 data8 sys_preadv
1807 data8 sys_pwritev // 1320 1807 data8 sys_pwritev // 1320
1808 data8 sys_rt_tgsigqueueinfo 1808 data8 sys_rt_tgsigqueueinfo
1809 data8 sys_recvmmsg
1809 1810
1810 .org sys_call_table + 8*NR_syscalls // guard against failures to increase NR_syscalls 1811 .org sys_call_table + 8*NR_syscalls // guard against failures to increase NR_syscalls
1811#endif /* __IA64_ASM_PARAVIRTUALIZED_NATIVE */ 1812#endif /* __IA64_ASM_PARAVIRTUALIZED_NATIVE */
diff --git a/arch/ia64/kernel/pci-swiotlb.c b/arch/ia64/kernel/pci-swiotlb.c
index 285aae8431c6..53292abf846c 100644
--- a/arch/ia64/kernel/pci-swiotlb.c
+++ b/arch/ia64/kernel/pci-swiotlb.c
@@ -41,7 +41,7 @@ struct dma_map_ops swiotlb_dma_ops = {
41void __init swiotlb_dma_init(void) 41void __init swiotlb_dma_init(void)
42{ 42{
43 dma_ops = &swiotlb_dma_ops; 43 dma_ops = &swiotlb_dma_ops;
44 swiotlb_init(); 44 swiotlb_init(1);
45} 45}
46 46
47void __init pci_swiotlb_init(void) 47void __init pci_swiotlb_init(void)
@@ -51,7 +51,7 @@ void __init pci_swiotlb_init(void)
51 swiotlb = 1; 51 swiotlb = 1;
52 printk(KERN_INFO "PCI-DMA: Re-initialize machine vector.\n"); 52 printk(KERN_INFO "PCI-DMA: Re-initialize machine vector.\n");
53 machvec_init("dig"); 53 machvec_init("dig");
54 swiotlb_init(); 54 swiotlb_init(1);
55 dma_ops = &swiotlb_dma_ops; 55 dma_ops = &swiotlb_dma_ops;
56#else 56#else
57 panic("Unable to find Intel IOMMU"); 57 panic("Unable to find Intel IOMMU");
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index f1782705b1f7..402698b6689f 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -522,42 +522,37 @@ EXPORT_SYMBOL(pfm_sysctl);
522 522
523static ctl_table pfm_ctl_table[]={ 523static ctl_table pfm_ctl_table[]={
524 { 524 {
525 .ctl_name = CTL_UNNUMBERED,
526 .procname = "debug", 525 .procname = "debug",
527 .data = &pfm_sysctl.debug, 526 .data = &pfm_sysctl.debug,
528 .maxlen = sizeof(int), 527 .maxlen = sizeof(int),
529 .mode = 0666, 528 .mode = 0666,
530 .proc_handler = &proc_dointvec, 529 .proc_handler = proc_dointvec,
531 }, 530 },
532 { 531 {
533 .ctl_name = CTL_UNNUMBERED,
534 .procname = "debug_ovfl", 532 .procname = "debug_ovfl",
535 .data = &pfm_sysctl.debug_ovfl, 533 .data = &pfm_sysctl.debug_ovfl,
536 .maxlen = sizeof(int), 534 .maxlen = sizeof(int),
537 .mode = 0666, 535 .mode = 0666,
538 .proc_handler = &proc_dointvec, 536 .proc_handler = proc_dointvec,
539 }, 537 },
540 { 538 {
541 .ctl_name = CTL_UNNUMBERED,
542 .procname = "fastctxsw", 539 .procname = "fastctxsw",
543 .data = &pfm_sysctl.fastctxsw, 540 .data = &pfm_sysctl.fastctxsw,
544 .maxlen = sizeof(int), 541 .maxlen = sizeof(int),
545 .mode = 0600, 542 .mode = 0600,
546 .proc_handler = &proc_dointvec, 543 .proc_handler = proc_dointvec,
547 }, 544 },
548 { 545 {
549 .ctl_name = CTL_UNNUMBERED,
550 .procname = "expert_mode", 546 .procname = "expert_mode",
551 .data = &pfm_sysctl.expert_mode, 547 .data = &pfm_sysctl.expert_mode,
552 .maxlen = sizeof(int), 548 .maxlen = sizeof(int),
553 .mode = 0600, 549 .mode = 0600,
554 .proc_handler = &proc_dointvec, 550 .proc_handler = proc_dointvec,
555 }, 551 },
556 {} 552 {}
557}; 553};
558static ctl_table pfm_sysctl_dir[] = { 554static ctl_table pfm_sysctl_dir[] = {
559 { 555 {
560 .ctl_name = CTL_UNNUMBERED,
561 .procname = "perfmon", 556 .procname = "perfmon",
562 .mode = 0555, 557 .mode = 0555,
563 .child = pfm_ctl_table, 558 .child = pfm_ctl_table,
@@ -566,7 +561,6 @@ static ctl_table pfm_sysctl_dir[] = {
566}; 561};
567static ctl_table pfm_sysctl_root[] = { 562static ctl_table pfm_sysctl_root[] = {
568 { 563 {
569 .ctl_name = CTL_KERN,
570 .procname = "kernel", 564 .procname = "kernel",
571 .mode = 0555, 565 .mode = 0555,
572 .child = pfm_sysctl_dir, 566 .child = pfm_sysctl_dir,
diff --git a/arch/ia64/kernel/time.c b/arch/ia64/kernel/time.c
index 4990495d7531..a35c661e5e89 100644
--- a/arch/ia64/kernel/time.c
+++ b/arch/ia64/kernel/time.c
@@ -473,7 +473,7 @@ void update_vsyscall_tz(void)
473{ 473{
474} 474}
475 475
476void update_vsyscall(struct timespec *wall, struct clocksource *c) 476void update_vsyscall(struct timespec *wall, struct clocksource *c, u32 mult)
477{ 477{
478 unsigned long flags; 478 unsigned long flags;
479 479
@@ -481,7 +481,7 @@ void update_vsyscall(struct timespec *wall, struct clocksource *c)
481 481
482 /* copy fsyscall clock data */ 482 /* copy fsyscall clock data */
483 fsyscall_gtod_data.clk_mask = c->mask; 483 fsyscall_gtod_data.clk_mask = c->mask;
484 fsyscall_gtod_data.clk_mult = c->mult; 484 fsyscall_gtod_data.clk_mult = mult;
485 fsyscall_gtod_data.clk_shift = c->shift; 485 fsyscall_gtod_data.clk_shift = c->shift;
486 fsyscall_gtod_data.clk_fsys_mmio = c->fsys_mmio; 486 fsyscall_gtod_data.clk_fsys_mmio = c->fsys_mmio;
487 fsyscall_gtod_data.clk_cycle_last = c->cycle_last; 487 fsyscall_gtod_data.clk_cycle_last = c->cycle_last;
diff --git a/arch/ia64/kvm/Makefile b/arch/ia64/kvm/Makefile
index 0bb99b732908..1089b3e918ac 100644
--- a/arch/ia64/kvm/Makefile
+++ b/arch/ia64/kvm/Makefile
@@ -49,7 +49,7 @@ EXTRA_CFLAGS += -Ivirt/kvm -Iarch/ia64/kvm/
49EXTRA_AFLAGS += -Ivirt/kvm -Iarch/ia64/kvm/ 49EXTRA_AFLAGS += -Ivirt/kvm -Iarch/ia64/kvm/
50 50
51common-objs = $(addprefix ../../../virt/kvm/, kvm_main.o ioapic.o \ 51common-objs = $(addprefix ../../../virt/kvm/, kvm_main.o ioapic.o \
52 coalesced_mmio.o irq_comm.o) 52 coalesced_mmio.o irq_comm.o assigned-dev.o)
53 53
54ifeq ($(CONFIG_IOMMU_API),y) 54ifeq ($(CONFIG_IOMMU_API),y)
55common-objs += $(addprefix ../../../virt/kvm/, iommu.o) 55common-objs += $(addprefix ../../../virt/kvm/, iommu.o)
diff --git a/arch/ia64/kvm/kvm-ia64.c b/arch/ia64/kvm/kvm-ia64.c
index 0ad09f05efa9..5fdeec5fddcf 100644
--- a/arch/ia64/kvm/kvm-ia64.c
+++ b/arch/ia64/kvm/kvm-ia64.c
@@ -124,7 +124,7 @@ long ia64_pal_vp_create(u64 *vpd, u64 *host_iva, u64 *opt_handler)
124 124
125static DEFINE_SPINLOCK(vp_lock); 125static DEFINE_SPINLOCK(vp_lock);
126 126
127void kvm_arch_hardware_enable(void *garbage) 127int kvm_arch_hardware_enable(void *garbage)
128{ 128{
129 long status; 129 long status;
130 long tmp_base; 130 long tmp_base;
@@ -137,7 +137,7 @@ void kvm_arch_hardware_enable(void *garbage)
137 slot = ia64_itr_entry(0x3, KVM_VMM_BASE, pte, KVM_VMM_SHIFT); 137 slot = ia64_itr_entry(0x3, KVM_VMM_BASE, pte, KVM_VMM_SHIFT);
138 local_irq_restore(saved_psr); 138 local_irq_restore(saved_psr);
139 if (slot < 0) 139 if (slot < 0)
140 return; 140 return -EINVAL;
141 141
142 spin_lock(&vp_lock); 142 spin_lock(&vp_lock);
143 status = ia64_pal_vp_init_env(kvm_vsa_base ? 143 status = ia64_pal_vp_init_env(kvm_vsa_base ?
@@ -145,7 +145,7 @@ void kvm_arch_hardware_enable(void *garbage)
145 __pa(kvm_vm_buffer), KVM_VM_BUFFER_BASE, &tmp_base); 145 __pa(kvm_vm_buffer), KVM_VM_BUFFER_BASE, &tmp_base);
146 if (status != 0) { 146 if (status != 0) {
147 printk(KERN_WARNING"kvm: Failed to Enable VT Support!!!!\n"); 147 printk(KERN_WARNING"kvm: Failed to Enable VT Support!!!!\n");
148 return ; 148 return -EINVAL;
149 } 149 }
150 150
151 if (!kvm_vsa_base) { 151 if (!kvm_vsa_base) {
@@ -154,6 +154,8 @@ void kvm_arch_hardware_enable(void *garbage)
154 } 154 }
155 spin_unlock(&vp_lock); 155 spin_unlock(&vp_lock);
156 ia64_ptr_entry(0x3, slot); 156 ia64_ptr_entry(0x3, slot);
157
158 return 0;
157} 159}
158 160
159void kvm_arch_hardware_disable(void *garbage) 161void kvm_arch_hardware_disable(void *garbage)
@@ -851,8 +853,7 @@ static int kvm_vm_ioctl_get_irqchip(struct kvm *kvm,
851 r = 0; 853 r = 0;
852 switch (chip->chip_id) { 854 switch (chip->chip_id) {
853 case KVM_IRQCHIP_IOAPIC: 855 case KVM_IRQCHIP_IOAPIC:
854 memcpy(&chip->chip.ioapic, ioapic_irqchip(kvm), 856 r = kvm_get_ioapic(kvm, &chip->chip.ioapic);
855 sizeof(struct kvm_ioapic_state));
856 break; 857 break;
857 default: 858 default:
858 r = -EINVAL; 859 r = -EINVAL;
@@ -868,9 +869,7 @@ static int kvm_vm_ioctl_set_irqchip(struct kvm *kvm, struct kvm_irqchip *chip)
868 r = 0; 869 r = 0;
869 switch (chip->chip_id) { 870 switch (chip->chip_id) {
870 case KVM_IRQCHIP_IOAPIC: 871 case KVM_IRQCHIP_IOAPIC:
871 memcpy(ioapic_irqchip(kvm), 872 r = kvm_set_ioapic(kvm, &chip->chip.ioapic);
872 &chip->chip.ioapic,
873 sizeof(struct kvm_ioapic_state));
874 break; 873 break;
875 default: 874 default:
876 r = -EINVAL; 875 r = -EINVAL;
@@ -944,7 +943,7 @@ long kvm_arch_vm_ioctl(struct file *filp,
944{ 943{
945 struct kvm *kvm = filp->private_data; 944 struct kvm *kvm = filp->private_data;
946 void __user *argp = (void __user *)arg; 945 void __user *argp = (void __user *)arg;
947 int r = -EINVAL; 946 int r = -ENOTTY;
948 947
949 switch (ioctl) { 948 switch (ioctl) {
950 case KVM_SET_MEMORY_REGION: { 949 case KVM_SET_MEMORY_REGION: {
@@ -985,10 +984,8 @@ long kvm_arch_vm_ioctl(struct file *filp,
985 goto out; 984 goto out;
986 if (irqchip_in_kernel(kvm)) { 985 if (irqchip_in_kernel(kvm)) {
987 __s32 status; 986 __s32 status;
988 mutex_lock(&kvm->irq_lock);
989 status = kvm_set_irq(kvm, KVM_USERSPACE_IRQ_SOURCE_ID, 987 status = kvm_set_irq(kvm, KVM_USERSPACE_IRQ_SOURCE_ID,
990 irq_event.irq, irq_event.level); 988 irq_event.irq, irq_event.level);
991 mutex_unlock(&kvm->irq_lock);
992 if (ioctl == KVM_IRQ_LINE_STATUS) { 989 if (ioctl == KVM_IRQ_LINE_STATUS) {
993 irq_event.status = status; 990 irq_event.status = status;
994 if (copy_to_user(argp, &irq_event, 991 if (copy_to_user(argp, &irq_event,
diff --git a/arch/m32r/include/asm/cacheflush.h b/arch/m32r/include/asm/cacheflush.h
index 78587c958146..8e8e04516c39 100644
--- a/arch/m32r/include/asm/cacheflush.h
+++ b/arch/m32r/include/asm/cacheflush.h
@@ -12,6 +12,7 @@ extern void _flush_cache_copyback_all(void);
12#define flush_cache_dup_mm(mm) do { } while (0) 12#define flush_cache_dup_mm(mm) do { } while (0)
13#define flush_cache_range(vma, start, end) do { } while (0) 13#define flush_cache_range(vma, start, end) do { } while (0)
14#define flush_cache_page(vma, vmaddr, pfn) do { } while (0) 14#define flush_cache_page(vma, vmaddr, pfn) do { } while (0)
15#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 0
15#define flush_dcache_page(page) do { } while (0) 16#define flush_dcache_page(page) do { } while (0)
16#define flush_dcache_mmap_lock(mapping) do { } while (0) 17#define flush_dcache_mmap_lock(mapping) do { } while (0)
17#define flush_dcache_mmap_unlock(mapping) do { } while (0) 18#define flush_dcache_mmap_unlock(mapping) do { } while (0)
@@ -33,6 +34,7 @@ extern void smp_flush_cache_all(void);
33#define flush_cache_dup_mm(mm) do { } while (0) 34#define flush_cache_dup_mm(mm) do { } while (0)
34#define flush_cache_range(vma, start, end) do { } while (0) 35#define flush_cache_range(vma, start, end) do { } while (0)
35#define flush_cache_page(vma, vmaddr, pfn) do { } while (0) 36#define flush_cache_page(vma, vmaddr, pfn) do { } while (0)
37#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 0
36#define flush_dcache_page(page) do { } while (0) 38#define flush_dcache_page(page) do { } while (0)
37#define flush_dcache_mmap_lock(mapping) do { } while (0) 39#define flush_dcache_mmap_lock(mapping) do { } while (0)
38#define flush_dcache_mmap_unlock(mapping) do { } while (0) 40#define flush_dcache_mmap_unlock(mapping) do { } while (0)
@@ -46,6 +48,7 @@ extern void smp_flush_cache_all(void);
46#define flush_cache_dup_mm(mm) do { } while (0) 48#define flush_cache_dup_mm(mm) do { } while (0)
47#define flush_cache_range(vma, start, end) do { } while (0) 49#define flush_cache_range(vma, start, end) do { } while (0)
48#define flush_cache_page(vma, vmaddr, pfn) do { } while (0) 50#define flush_cache_page(vma, vmaddr, pfn) do { } while (0)
51#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 0
49#define flush_dcache_page(page) do { } while (0) 52#define flush_dcache_page(page) do { } while (0)
50#define flush_dcache_mmap_lock(mapping) do { } while (0) 53#define flush_dcache_mmap_lock(mapping) do { } while (0)
51#define flush_dcache_mmap_unlock(mapping) do { } while (0) 54#define flush_dcache_mmap_unlock(mapping) do { } while (0)
diff --git a/arch/m32r/include/asm/socket.h b/arch/m32r/include/asm/socket.h
index 3390a864f224..469787c30098 100644
--- a/arch/m32r/include/asm/socket.h
+++ b/arch/m32r/include/asm/socket.h
@@ -60,4 +60,6 @@
60#define SO_PROTOCOL 38 60#define SO_PROTOCOL 38
61#define SO_DOMAIN 39 61#define SO_DOMAIN 39
62 62
63#define SO_RXQ_OVFL 40
64
63#endif /* _ASM_M32R_SOCKET_H */ 65#endif /* _ASM_M32R_SOCKET_H */
diff --git a/arch/m68k/include/asm/cacheflush_mm.h b/arch/m68k/include/asm/cacheflush_mm.h
index 16bf375fdbe1..73de7c89d8e0 100644
--- a/arch/m68k/include/asm/cacheflush_mm.h
+++ b/arch/m68k/include/asm/cacheflush_mm.h
@@ -128,6 +128,7 @@ static inline void __flush_page_to_ram(void *vaddr)
128 } 128 }
129} 129}
130 130
131#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1
131#define flush_dcache_page(page) __flush_page_to_ram(page_address(page)) 132#define flush_dcache_page(page) __flush_page_to_ram(page_address(page))
132#define flush_dcache_mmap_lock(mapping) do { } while (0) 133#define flush_dcache_mmap_lock(mapping) do { } while (0)
133#define flush_dcache_mmap_unlock(mapping) do { } while (0) 134#define flush_dcache_mmap_unlock(mapping) do { } while (0)
diff --git a/arch/m68k/include/asm/cacheflush_no.h b/arch/m68k/include/asm/cacheflush_no.h
index c65f00a94553..89f195656be7 100644
--- a/arch/m68k/include/asm/cacheflush_no.h
+++ b/arch/m68k/include/asm/cacheflush_no.h
@@ -12,6 +12,7 @@
12#define flush_cache_range(vma, start, end) __flush_cache_all() 12#define flush_cache_range(vma, start, end) __flush_cache_all()
13#define flush_cache_page(vma, vmaddr) do { } while (0) 13#define flush_cache_page(vma, vmaddr) do { } while (0)
14#define flush_dcache_range(start,len) __flush_cache_all() 14#define flush_dcache_range(start,len) __flush_cache_all()
15#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 0
15#define flush_dcache_page(page) do { } while (0) 16#define flush_dcache_page(page) do { } while (0)
16#define flush_dcache_mmap_lock(mapping) do { } while (0) 17#define flush_dcache_mmap_lock(mapping) do { } while (0)
17#define flush_dcache_mmap_unlock(mapping) do { } while (0) 18#define flush_dcache_mmap_unlock(mapping) do { } while (0)
diff --git a/arch/m68k/include/asm/ptrace.h b/arch/m68k/include/asm/ptrace.h
index 8c9194b98548..a6ab663bcc2e 100644
--- a/arch/m68k/include/asm/ptrace.h
+++ b/arch/m68k/include/asm/ptrace.h
@@ -71,6 +71,8 @@ struct switch_stack {
71#define PTRACE_GETFPREGS 14 71#define PTRACE_GETFPREGS 14
72#define PTRACE_SETFPREGS 15 72#define PTRACE_SETFPREGS 15
73 73
74#define PTRACE_SINGLEBLOCK 33 /* resume execution until next branch */
75
74#ifdef __KERNEL__ 76#ifdef __KERNEL__
75 77
76#ifndef PS_S 78#ifndef PS_S
@@ -82,6 +84,21 @@ struct switch_stack {
82#define instruction_pointer(regs) ((regs)->pc) 84#define instruction_pointer(regs) ((regs)->pc)
83#define profile_pc(regs) instruction_pointer(regs) 85#define profile_pc(regs) instruction_pointer(regs)
84extern void show_regs(struct pt_regs *); 86extern void show_regs(struct pt_regs *);
87
88/*
89 * These are defined as per linux/ptrace.h, which see.
90 */
91struct task_struct;
92
93#define arch_has_single_step() (1)
94extern void user_enable_single_step(struct task_struct *);
95extern void user_disable_single_step(struct task_struct *);
96
97#ifdef CONFIG_MMU
98#define arch_has_block_step() (1)
99extern void user_enable_block_step(struct task_struct *);
100#endif
101
85#endif /* __KERNEL__ */ 102#endif /* __KERNEL__ */
86#endif /* __ASSEMBLY__ */ 103#endif /* __ASSEMBLY__ */
87#endif /* _M68K_PTRACE_H */ 104#endif /* _M68K_PTRACE_H */
diff --git a/arch/m68k/include/asm/socket.h b/arch/m68k/include/asm/socket.h
index eee01cce921b..9bf49c87d954 100644
--- a/arch/m68k/include/asm/socket.h
+++ b/arch/m68k/include/asm/socket.h
@@ -60,4 +60,6 @@
60#define SO_PROTOCOL 38 60#define SO_PROTOCOL 38
61#define SO_DOMAIN 39 61#define SO_DOMAIN 39
62 62
63#define SO_RXQ_OVFL 40
64
63#endif /* _ASM_SOCKET_H */ 65#endif /* _ASM_SOCKET_H */
diff --git a/arch/m68k/include/asm/thread_info_mm.h b/arch/m68k/include/asm/thread_info_mm.h
index b6da3882be9b..167e518db41b 100644
--- a/arch/m68k/include/asm/thread_info_mm.h
+++ b/arch/m68k/include/asm/thread_info_mm.h
@@ -4,10 +4,12 @@
4#ifndef ASM_OFFSETS_C 4#ifndef ASM_OFFSETS_C
5#include <asm/asm-offsets.h> 5#include <asm/asm-offsets.h>
6#endif 6#endif
7#include <asm/current.h>
8#include <asm/types.h> 7#include <asm/types.h>
9#include <asm/page.h> 8#include <asm/page.h>
10 9
10#ifndef __ASSEMBLY__
11#include <asm/current.h>
12
11struct thread_info { 13struct thread_info {
12 struct task_struct *task; /* main task structure */ 14 struct task_struct *task; /* main task structure */
13 unsigned long flags; 15 unsigned long flags;
@@ -16,6 +18,7 @@ struct thread_info {
16 __u32 cpu; /* should always be 0 on m68k */ 18 __u32 cpu; /* should always be 0 on m68k */
17 struct restart_block restart_block; 19 struct restart_block restart_block;
18}; 20};
21#endif /* __ASSEMBLY__ */
19 22
20#define PREEMPT_ACTIVE 0x4000000 23#define PREEMPT_ACTIVE 0x4000000
21 24
diff --git a/arch/m68k/kernel/entry.S b/arch/m68k/kernel/entry.S
index c5b33634c980..77fc7c16bf48 100644
--- a/arch/m68k/kernel/entry.S
+++ b/arch/m68k/kernel/entry.S
@@ -179,7 +179,11 @@ do_signal_return:
179 addql #8,%sp 179 addql #8,%sp
180 RESTORE_SWITCH_STACK 180 RESTORE_SWITCH_STACK
181 addql #4,%sp 181 addql #4,%sp
182 jbra resume_userspace 182 tstl %d0
183 jeq resume_userspace
184 | when single stepping into handler stop at the first insn
185 btst #6,%curptr@(TASK_INFO+TINFO_FLAGS+2)
186 jeq resume_userspace
183 187
184do_delayed_trace: 188do_delayed_trace:
185 bclr #7,%sp@(PT_OFF_SR) | clear trace bit in SR 189 bclr #7,%sp@(PT_OFF_SR) | clear trace bit in SR
diff --git a/arch/m68k/kernel/process.c b/arch/m68k/kernel/process.c
index 41230c595a8e..05296593e718 100644
--- a/arch/m68k/kernel/process.c
+++ b/arch/m68k/kernel/process.c
@@ -317,15 +317,12 @@ asmlinkage int sys_execve(char __user *name, char __user * __user *argv, char __
317 char * filename; 317 char * filename;
318 struct pt_regs *regs = (struct pt_regs *) &name; 318 struct pt_regs *regs = (struct pt_regs *) &name;
319 319
320 lock_kernel();
321 filename = getname(name); 320 filename = getname(name);
322 error = PTR_ERR(filename); 321 error = PTR_ERR(filename);
323 if (IS_ERR(filename)) 322 if (IS_ERR(filename))
324 goto out; 323 return error;
325 error = do_execve(filename, argv, envp, regs); 324 error = do_execve(filename, argv, envp, regs);
326 putname(filename); 325 putname(filename);
327out:
328 unlock_kernel();
329 return error; 326 return error;
330} 327}
331 328
diff --git a/arch/m68k/kernel/ptrace.c b/arch/m68k/kernel/ptrace.c
index 2075543c2d92..1fc217e5f06b 100644
--- a/arch/m68k/kernel/ptrace.c
+++ b/arch/m68k/kernel/ptrace.c
@@ -35,7 +35,9 @@
35#define SR_MASK 0x001f 35#define SR_MASK 0x001f
36 36
37/* sets the trace bits. */ 37/* sets the trace bits. */
38#define TRACE_BITS 0x8000 38#define TRACE_BITS 0xC000
39#define T1_BIT 0x8000
40#define T0_BIT 0x4000
39 41
40/* Find the stack offset for a register, relative to thread.esp0. */ 42/* Find the stack offset for a register, relative to thread.esp0. */
41#define PT_REG(reg) ((long)&((struct pt_regs *)0)->reg) 43#define PT_REG(reg) ((long)&((struct pt_regs *)0)->reg)
@@ -44,7 +46,7 @@
44/* Mapping from PT_xxx to the stack offset at which the register is 46/* Mapping from PT_xxx to the stack offset at which the register is
45 saved. Notice that usp has no stack-slot and needs to be treated 47 saved. Notice that usp has no stack-slot and needs to be treated
46 specially (see get_reg/put_reg below). */ 48 specially (see get_reg/put_reg below). */
47static int regoff[] = { 49static const int regoff[] = {
48 [0] = PT_REG(d1), 50 [0] = PT_REG(d1),
49 [1] = PT_REG(d2), 51 [1] = PT_REG(d2),
50 [2] = PT_REG(d3), 52 [2] = PT_REG(d3),
@@ -79,6 +81,14 @@ static inline long get_reg(struct task_struct *task, int regno)
79 addr = (unsigned long *)(task->thread.esp0 + regoff[regno]); 81 addr = (unsigned long *)(task->thread.esp0 + regoff[regno]);
80 else 82 else
81 return 0; 83 return 0;
84 /* Need to take stkadj into account. */
85 if (regno == PT_SR || regno == PT_PC) {
86 long stkadj = *(long *)(task->thread.esp0 + PT_REG(stkadj));
87 addr = (unsigned long *) ((unsigned long)addr + stkadj);
88 /* The sr is actually a 16 bit register. */
89 if (regno == PT_SR)
90 return *(unsigned short *)addr;
91 }
82 return *addr; 92 return *addr;
83} 93}
84 94
@@ -96,6 +106,16 @@ static inline int put_reg(struct task_struct *task, int regno,
96 addr = (unsigned long *)(task->thread.esp0 + regoff[regno]); 106 addr = (unsigned long *)(task->thread.esp0 + regoff[regno]);
97 else 107 else
98 return -1; 108 return -1;
109 /* Need to take stkadj into account. */
110 if (regno == PT_SR || regno == PT_PC) {
111 long stkadj = *(long *)(task->thread.esp0 + PT_REG(stkadj));
112 addr = (unsigned long *) ((unsigned long)addr + stkadj);
113 /* The sr is actually a 16 bit register. */
114 if (regno == PT_SR) {
115 *(unsigned short *)addr = data;
116 return 0;
117 }
118 }
99 *addr = data; 119 *addr = data;
100 return 0; 120 return 0;
101} 121}
@@ -105,7 +125,7 @@ static inline int put_reg(struct task_struct *task, int regno,
105 */ 125 */
106static inline void singlestep_disable(struct task_struct *child) 126static inline void singlestep_disable(struct task_struct *child)
107{ 127{
108 unsigned long tmp = get_reg(child, PT_SR) & ~(TRACE_BITS << 16); 128 unsigned long tmp = get_reg(child, PT_SR) & ~TRACE_BITS;
109 put_reg(child, PT_SR, tmp); 129 put_reg(child, PT_SR, tmp);
110 clear_tsk_thread_flag(child, TIF_DELAYED_TRACE); 130 clear_tsk_thread_flag(child, TIF_DELAYED_TRACE);
111} 131}
@@ -118,18 +138,30 @@ void ptrace_disable(struct task_struct *child)
118 singlestep_disable(child); 138 singlestep_disable(child);
119} 139}
120 140
141void user_enable_single_step(struct task_struct *child)
142{
143 unsigned long tmp = get_reg(child, PT_SR) & ~TRACE_BITS;
144 put_reg(child, PT_SR, tmp | T1_BIT);
145 set_tsk_thread_flag(child, TIF_DELAYED_TRACE);
146}
147
148void user_enable_block_step(struct task_struct *child)
149{
150 unsigned long tmp = get_reg(child, PT_SR) & ~TRACE_BITS;
151 put_reg(child, PT_SR, tmp | T0_BIT);
152}
153
154void user_disable_single_step(struct task_struct *child)
155{
156 singlestep_disable(child);
157}
158
121long arch_ptrace(struct task_struct *child, long request, long addr, long data) 159long arch_ptrace(struct task_struct *child, long request, long addr, long data)
122{ 160{
123 unsigned long tmp; 161 unsigned long tmp;
124 int i, ret = 0; 162 int i, ret = 0;
125 163
126 switch (request) { 164 switch (request) {
127 /* when I and D space are separate, these will need to be fixed. */
128 case PTRACE_PEEKTEXT: /* read word at location addr. */
129 case PTRACE_PEEKDATA:
130 ret = generic_ptrace_peekdata(child, addr, data);
131 break;
132
133 /* read the word at location addr in the USER area. */ 165 /* read the word at location addr in the USER area. */
134 case PTRACE_PEEKUSR: 166 case PTRACE_PEEKUSR:
135 if (addr & 3) 167 if (addr & 3)
@@ -138,8 +170,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
138 170
139 if (addr >= 0 && addr < 19) { 171 if (addr >= 0 && addr < 19) {
140 tmp = get_reg(child, addr); 172 tmp = get_reg(child, addr);
141 if (addr == PT_SR)
142 tmp >>= 16;
143 } else if (addr >= 21 && addr < 49) { 173 } else if (addr >= 21 && addr < 49) {
144 tmp = child->thread.fp[addr - 21]; 174 tmp = child->thread.fp[addr - 21];
145 /* Convert internal fpu reg representation 175 /* Convert internal fpu reg representation
@@ -149,16 +179,10 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
149 tmp = ((tmp & 0xffff0000) << 15) | 179 tmp = ((tmp & 0xffff0000) << 15) |
150 ((tmp & 0x0000ffff) << 16); 180 ((tmp & 0x0000ffff) << 16);
151 } else 181 } else
152 break; 182 goto out_eio;
153 ret = put_user(tmp, (unsigned long *)data); 183 ret = put_user(tmp, (unsigned long *)data);
154 break; 184 break;
155 185
156 /* when I and D space are separate, this will have to be fixed. */
157 case PTRACE_POKETEXT: /* write the word at location addr. */
158 case PTRACE_POKEDATA:
159 ret = generic_ptrace_pokedata(child, addr, data);
160 break;
161
162 case PTRACE_POKEUSR: /* write the word at location addr in the USER area */ 186 case PTRACE_POKEUSR: /* write the word at location addr in the USER area */
163 if (addr & 3) 187 if (addr & 3)
164 goto out_eio; 188 goto out_eio;
@@ -166,9 +190,9 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
166 190
167 if (addr == PT_SR) { 191 if (addr == PT_SR) {
168 data &= SR_MASK; 192 data &= SR_MASK;
169 data <<= 16; 193 data |= get_reg(child, PT_SR) & ~SR_MASK;
170 data |= get_reg(child, PT_SR) & ~(SR_MASK << 16); 194 }
171 } else if (addr >= 0 && addr < 19) { 195 if (addr >= 0 && addr < 19) {
172 if (put_reg(child, addr, data)) 196 if (put_reg(child, addr, data))
173 goto out_eio; 197 goto out_eio;
174 } else if (addr >= 21 && addr < 48) { 198 } else if (addr >= 21 && addr < 48) {
@@ -185,52 +209,9 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
185 goto out_eio; 209 goto out_eio;
186 break; 210 break;
187 211
188 case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */
189 case PTRACE_CONT: /* restart after signal. */
190 if (!valid_signal(data))
191 goto out_eio;
192
193 if (request == PTRACE_SYSCALL)
194 set_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
195 else
196 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
197 child->exit_code = data;
198 singlestep_disable(child);
199 wake_up_process(child);
200 break;
201
202 /*
203 * make the child exit. Best I can do is send it a sigkill.
204 * perhaps it should be put in the status that it wants to
205 * exit.
206 */
207 case PTRACE_KILL:
208 if (child->exit_state == EXIT_ZOMBIE) /* already dead */
209 break;
210 child->exit_code = SIGKILL;
211 singlestep_disable(child);
212 wake_up_process(child);
213 break;
214
215 case PTRACE_SINGLESTEP: /* set the trap flag. */
216 if (!valid_signal(data))
217 goto out_eio;
218
219 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
220 tmp = get_reg(child, PT_SR) | (TRACE_BITS << 16);
221 put_reg(child, PT_SR, tmp);
222 set_tsk_thread_flag(child, TIF_DELAYED_TRACE);
223
224 child->exit_code = data;
225 /* give it a chance to run. */
226 wake_up_process(child);
227 break;
228
229 case PTRACE_GETREGS: /* Get all gp regs from the child. */ 212 case PTRACE_GETREGS: /* Get all gp regs from the child. */
230 for (i = 0; i < 19; i++) { 213 for (i = 0; i < 19; i++) {
231 tmp = get_reg(child, i); 214 tmp = get_reg(child, i);
232 if (i == PT_SR)
233 tmp >>= 16;
234 ret = put_user(tmp, (unsigned long *)data); 215 ret = put_user(tmp, (unsigned long *)data);
235 if (ret) 216 if (ret)
236 break; 217 break;
@@ -245,8 +226,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
245 break; 226 break;
246 if (i == PT_SR) { 227 if (i == PT_SR) {
247 tmp &= SR_MASK; 228 tmp &= SR_MASK;
248 tmp <<= 16; 229 tmp |= get_reg(child, PT_SR) & ~SR_MASK;
249 tmp |= get_reg(child, PT_SR) & ~(SR_MASK << 16);
250 } 230 }
251 put_reg(child, i, tmp); 231 put_reg(child, i, tmp);
252 data += sizeof(long); 232 data += sizeof(long);
diff --git a/arch/m68k/kernel/vmlinux-std.lds b/arch/m68k/kernel/vmlinux-std.lds
index 47eac19e8f61..878be5f38cad 100644
--- a/arch/m68k/kernel/vmlinux-std.lds
+++ b/arch/m68k/kernel/vmlinux-std.lds
@@ -2,6 +2,7 @@
2 2
3#include <asm-generic/vmlinux.lds.h> 3#include <asm-generic/vmlinux.lds.h>
4#include <asm/page.h> 4#include <asm/page.h>
5#include <asm/thread_info.h>
5 6
6OUTPUT_FORMAT("elf32-m68k", "elf32-m68k", "elf32-m68k") 7OUTPUT_FORMAT("elf32-m68k", "elf32-m68k", "elf32-m68k")
7OUTPUT_ARCH(m68k) 8OUTPUT_ARCH(m68k)
@@ -22,73 +23,37 @@ SECTIONS
22 23
23 _etext = .; /* End of text section */ 24 _etext = .; /* End of text section */
24 25
25 . = ALIGN(16); /* Exception table */ 26 EXCEPTION_TABLE(16)
26 __start___ex_table = .;
27 __ex_table : { *(__ex_table) }
28 __stop___ex_table = .;
29 27
30 RODATA 28 RODATA
31 29
32 .data : { /* Data */ 30 RW_DATA_SECTION(16, PAGE_SIZE, THREAD_SIZE)
33 DATA_DATA
34 CONSTRUCTORS
35 }
36 31
37 . = ALIGN(16); 32 BSS_SECTION(0, 0, 0)
38 .data.cacheline_aligned : { *(.data.cacheline_aligned) }
39
40 .bss : { *(.bss) } /* BSS */
41 33
42 _edata = .; /* End of data section */ 34 _edata = .; /* End of data section */
43 35
44 /* will be freed after init */ 36 /* will be freed after init */
45 . = ALIGN(PAGE_SIZE); /* Init code and data */ 37 . = ALIGN(PAGE_SIZE); /* Init code and data */
46 __init_begin = .; 38 __init_begin = .;
47 .init.text : { 39 INIT_TEXT_SECTION(PAGE_SIZE) :data
48 _sinittext = .; 40 INIT_DATA_SECTION(16)
49 INIT_TEXT
50 _einittext = .;
51 } :data
52 .init.data : { INIT_DATA }
53 . = ALIGN(16);
54 __setup_start = .;
55 .init.setup : { *(.init.setup) }
56 __setup_end = .;
57 __initcall_start = .;
58 .initcall.init : {
59 INITCALLS
60 }
61 __initcall_end = .;
62 __con_initcall_start = .;
63 .con_initcall.init : { *(.con_initcall.init) }
64 __con_initcall_end = .;
65 .m68k_fixup : { 41 .m68k_fixup : {
66 __start_fixup = .; 42 __start_fixup = .;
67 *(.m68k_fixup) 43 *(.m68k_fixup)
68 __stop_fixup = .; 44 __stop_fixup = .;
69 } 45 }
70 SECURITY_INIT
71#ifdef CONFIG_BLK_DEV_INITRD
72 . = ALIGN(8192);
73 __initramfs_start = .;
74 .init.ramfs : { *(.init.ramfs) }
75 __initramfs_end = .;
76#endif
77 NOTES 46 NOTES
78 . = ALIGN(8192); 47 .init_end : {
79 __init_end = .; 48 /* This ALIGN be in a section so that _end is at the end of the
80 49 load segment. */
81 .data.init_task : { *(.data.init_task) } /* The initial task and kernel stack */ 50 . = ALIGN(PAGE_SIZE);
51 __init_end = .;
52 }
82 53
83 _end = . ; 54 _end = . ;
84 55
85 /* Stabs debugging sections. */ 56 STABS_DEBUG
86 .stab 0 : { *(.stab) }
87 .stabstr 0 : { *(.stabstr) }
88 .stab.excl 0 : { *(.stab.excl) }
89 .stab.exclstr 0 : { *(.stab.exclstr) }
90 .stab.index 0 : { *(.stab.index) }
91 .stab.indexstr 0 : { *(.stab.indexstr) }
92 .comment 0 : { *(.comment) } 57 .comment 0 : { *(.comment) }
93 58
94 /* Sections to be discarded */ 59 /* Sections to be discarded */
diff --git a/arch/m68k/kernel/vmlinux-sun3.lds b/arch/m68k/kernel/vmlinux-sun3.lds
index 03efaf04d7d7..1ad6b7ad2c17 100644
--- a/arch/m68k/kernel/vmlinux-sun3.lds
+++ b/arch/m68k/kernel/vmlinux-sun3.lds
@@ -2,6 +2,7 @@
2 2
3#include <asm-generic/vmlinux.lds.h> 3#include <asm-generic/vmlinux.lds.h>
4#include <asm/page.h> 4#include <asm/page.h>
5#include <asm/thread_info.h>
5 6
6OUTPUT_FORMAT("elf32-m68k", "elf32-m68k", "elf32-m68k") 7OUTPUT_FORMAT("elf32-m68k", "elf32-m68k", "elf32-m68k")
7OUTPUT_ARCH(m68k) 8OUTPUT_ARCH(m68k)
@@ -23,14 +24,8 @@ SECTIONS
23 24
24 _etext = .; /* End of text section */ 25 _etext = .; /* End of text section */
25 26
26 .data : { /* Data */ 27 EXCEPTION_TABLE(16) :data
27 DATA_DATA 28 RW_DATA_SECTION(16, PAGE_SIZE, THREAD_SIZE) :data
28 CONSTRUCTORS
29 . = ALIGN(16); /* Exception table */
30 __start___ex_table = .;
31 *(__ex_table)
32 __stop___ex_table = .;
33 } :data
34 /* End of data goes *here* so that freeing init code works properly. */ 29 /* End of data goes *here* so that freeing init code works properly. */
35 _edata = .; 30 _edata = .;
36 NOTES 31 NOTES
@@ -38,56 +33,21 @@ SECTIONS
38 /* will be freed after init */ 33 /* will be freed after init */
39 . = ALIGN(PAGE_SIZE); /* Init code and data */ 34 . = ALIGN(PAGE_SIZE); /* Init code and data */
40__init_begin = .; 35__init_begin = .;
41 .init.text : { 36 INIT_TEXT_SECTION(PAGE_SIZE)
42 _sinittext = .; 37 INIT_DATA_SECTION(16)
43 INIT_TEXT
44 _einittext = .;
45 }
46 .init.data : { INIT_DATA }
47 . = ALIGN(16);
48 __setup_start = .;
49 .init.setup : { *(.init.setup) }
50 __setup_end = .;
51 __initcall_start = .;
52 .initcall.init : {
53 INITCALLS
54 }
55 __initcall_end = .;
56 __con_initcall_start = .;
57 .con_initcall.init : { *(.con_initcall.init) }
58 __con_initcall_end = .;
59 .m68k_fixup : { 38 .m68k_fixup : {
60 __start_fixup = .; 39 __start_fixup = .;
61 *(.m68k_fixup) 40 *(.m68k_fixup)
62 __stop_fixup = .; 41 __stop_fixup = .;
63 } 42 }
64 SECURITY_INIT
65#ifdef CONFIG_BLK_DEV_INITRD
66 . = ALIGN(PAGE_SIZE);
67 __initramfs_start = .;
68 .init.ramfs : { *(.init.ramfs) }
69 __initramfs_end = .;
70#endif
71 . = ALIGN(PAGE_SIZE); 43 . = ALIGN(PAGE_SIZE);
72 __init_end = .; 44 __init_end = .;
73 .data.init.task : { *(.data.init_task) }
74
75 45
76 .bss : { *(.bss) } /* BSS */ 46 BSS_SECTION(0, 0, 0)
77 47
78 _end = . ; 48 _end = . ;
79 49
80 .crap : { 50 STABS_DEBUG
81 /* Stabs debugging sections. */
82 *(.stab)
83 *(.stabstr)
84 *(.stab.excl)
85 *(.stab.exclstr)
86 *(.stab.index)
87 *(.stab.indexstr)
88 *(.comment)
89 *(.note)
90 }
91 51
92 /* Sections to be discarded */ 52 /* Sections to be discarded */
93 DISCARDS 53 DISCARDS
diff --git a/arch/m68knommu/kernel/process.c b/arch/m68knommu/kernel/process.c
index 8f8f4abab2ff..5c9ecd427090 100644
--- a/arch/m68knommu/kernel/process.c
+++ b/arch/m68knommu/kernel/process.c
@@ -352,15 +352,12 @@ asmlinkage int sys_execve(char *name, char **argv, char **envp)
352 char * filename; 352 char * filename;
353 struct pt_regs *regs = (struct pt_regs *) &name; 353 struct pt_regs *regs = (struct pt_regs *) &name;
354 354
355 lock_kernel();
356 filename = getname(name); 355 filename = getname(name);
357 error = PTR_ERR(filename); 356 error = PTR_ERR(filename);
358 if (IS_ERR(filename)) 357 if (IS_ERR(filename))
359 goto out; 358 return error;
360 error = do_execve(filename, argv, envp, regs); 359 error = do_execve(filename, argv, envp, regs);
361 putname(filename); 360 putname(filename);
362out:
363 unlock_kernel();
364 return error; 361 return error;
365} 362}
366 363
diff --git a/arch/m68knommu/kernel/ptrace.c b/arch/m68knommu/kernel/ptrace.c
index ef70ca070ce2..4d3828959fb0 100644
--- a/arch/m68knommu/kernel/ptrace.c
+++ b/arch/m68knommu/kernel/ptrace.c
@@ -86,6 +86,20 @@ static inline int put_reg(struct task_struct *task, int regno,
86 return 0; 86 return 0;
87} 87}
88 88
89void user_enable_single_step(struct task_struct *task)
90{
91 unsigned long srflags;
92 srflags = get_reg(task, PT_SR) | (TRACE_BITS << 16);
93 put_reg(task, PT_SR, srflags);
94}
95
96void user_disable_single_step(struct task_struct *task)
97{
98 unsigned long srflags;
99 srflags = get_reg(task, PT_SR) & ~(TRACE_BITS << 16);
100 put_reg(task, PT_SR, srflags);
101}
102
89/* 103/*
90 * Called by kernel/ptrace.c when detaching.. 104 * Called by kernel/ptrace.c when detaching..
91 * 105 *
@@ -93,10 +107,8 @@ static inline int put_reg(struct task_struct *task, int regno,
93 */ 107 */
94void ptrace_disable(struct task_struct *child) 108void ptrace_disable(struct task_struct *child)
95{ 109{
96 unsigned long tmp;
97 /* make sure the single step bit is not set. */ 110 /* make sure the single step bit is not set. */
98 tmp = get_reg(child, PT_SR) & ~(TRACE_BITS << 16); 111 user_disable_single_step(child);
99 put_reg(child, PT_SR, tmp);
100} 112}
101 113
102long arch_ptrace(struct task_struct *child, long request, long addr, long data) 114long arch_ptrace(struct task_struct *child, long request, long addr, long data)
diff --git a/arch/microblaze/include/asm/cacheflush.h b/arch/microblaze/include/asm/cacheflush.h
index f989d6aad648..088076e657b3 100644
--- a/arch/microblaze/include/asm/cacheflush.h
+++ b/arch/microblaze/include/asm/cacheflush.h
@@ -37,6 +37,7 @@
37#define flush_cache_page(vma, vmaddr, pfn) do { } while (0) 37#define flush_cache_page(vma, vmaddr, pfn) do { } while (0)
38 38
39#define flush_dcache_range(start, end) __invalidate_dcache_range(start, end) 39#define flush_dcache_range(start, end) __invalidate_dcache_range(start, end)
40#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 0
40#define flush_dcache_page(page) do { } while (0) 41#define flush_dcache_page(page) do { } while (0)
41#define flush_dcache_mmap_lock(mapping) do { } while (0) 42#define flush_dcache_mmap_lock(mapping) do { } while (0)
42#define flush_dcache_mmap_unlock(mapping) do { } while (0) 43#define flush_dcache_mmap_unlock(mapping) do { } while (0)
diff --git a/arch/microblaze/include/asm/prom.h b/arch/microblaze/include/asm/prom.h
index 37e6f305a68e..ef3ec1d6ceb3 100644
--- a/arch/microblaze/include/asm/prom.h
+++ b/arch/microblaze/include/asm/prom.h
@@ -12,23 +12,15 @@
12 * 2 of the License, or (at your option) any later version. 12 * 2 of the License, or (at your option) any later version.
13 */ 13 */
14 14
15#include <linux/of.h> /* linux/of.h gets to determine #include ordering */
16
15#ifndef _ASM_MICROBLAZE_PROM_H 17#ifndef _ASM_MICROBLAZE_PROM_H
16#define _ASM_MICROBLAZE_PROM_H 18#define _ASM_MICROBLAZE_PROM_H
17#ifdef __KERNEL__ 19#ifdef __KERNEL__
18
19/* Definitions used by the flattened device tree */
20#define OF_DT_HEADER 0xd00dfeed /* marker */
21#define OF_DT_BEGIN_NODE 0x1 /* Start of node, full name */
22#define OF_DT_END_NODE 0x2 /* End node */
23#define OF_DT_PROP 0x3 /* Property: name off, size, content */
24#define OF_DT_NOP 0x4 /* nop */
25#define OF_DT_END 0x9
26
27#define OF_DT_VERSION 0x10
28
29#ifndef __ASSEMBLY__ 20#ifndef __ASSEMBLY__
30 21
31#include <linux/types.h> 22#include <linux/types.h>
23#include <linux/of_fdt.h>
32#include <linux/proc_fs.h> 24#include <linux/proc_fs.h>
33#include <linux/platform_device.h> 25#include <linux/platform_device.h>
34#include <asm/irq.h> 26#include <asm/irq.h>
@@ -41,122 +33,19 @@
41#define of_prop_cmp(s1, s2) strcmp((s1), (s2)) 33#define of_prop_cmp(s1, s2) strcmp((s1), (s2))
42#define of_node_cmp(s1, s2) strcasecmp((s1), (s2)) 34#define of_node_cmp(s1, s2) strcasecmp((s1), (s2))
43 35
44/*
45 * This is what gets passed to the kernel by prom_init or kexec
46 *
47 * The dt struct contains the device tree structure, full pathes and
48 * property contents. The dt strings contain a separate block with just
49 * the strings for the property names, and is fully page aligned and
50 * self contained in a page, so that it can be kept around by the kernel,
51 * each property name appears only once in this page (cheap compression)
52 *
53 * the mem_rsvmap contains a map of reserved ranges of physical memory,
54 * passing it here instead of in the device-tree itself greatly simplifies
55 * the job of everybody. It's just a list of u64 pairs (base/size) that
56 * ends when size is 0
57 */
58struct boot_param_header {
59 u32 magic; /* magic word OF_DT_HEADER */
60 u32 totalsize; /* total size of DT block */
61 u32 off_dt_struct; /* offset to structure */
62 u32 off_dt_strings; /* offset to strings */
63 u32 off_mem_rsvmap; /* offset to memory reserve map */
64 u32 version; /* format version */
65 u32 last_comp_version; /* last compatible version */
66 /* version 2 fields below */
67 u32 boot_cpuid_phys; /* Physical CPU id we're booting on */
68 /* version 3 fields below */
69 u32 dt_strings_size; /* size of the DT strings block */
70 /* version 17 fields below */
71 u32 dt_struct_size; /* size of the DT structure block */
72};
73
74typedef u32 phandle;
75typedef u32 ihandle;
76
77struct property {
78 char *name;
79 int length;
80 void *value;
81 struct property *next;
82};
83
84struct device_node {
85 const char *name;
86 const char *type;
87 phandle node;
88 phandle linux_phandle;
89 char *full_name;
90
91 struct property *properties;
92 struct property *deadprops; /* removed properties */
93 struct device_node *parent;
94 struct device_node *child;
95 struct device_node *sibling;
96 struct device_node *next; /* next device of same type */
97 struct device_node *allnext; /* next in list of all nodes */
98 struct proc_dir_entry *pde; /* this node's proc directory */
99 struct kref kref;
100 unsigned long _flags;
101 void *data;
102};
103
104extern struct device_node *of_chosen; 36extern struct device_node *of_chosen;
105 37
106static inline int of_node_check_flag(struct device_node *n, unsigned long flag)
107{
108 return test_bit(flag, &n->_flags);
109}
110
111static inline void of_node_set_flag(struct device_node *n, unsigned long flag)
112{
113 set_bit(flag, &n->_flags);
114}
115
116#define HAVE_ARCH_DEVTREE_FIXUPS 38#define HAVE_ARCH_DEVTREE_FIXUPS
117 39
118static inline void set_node_proc_entry(struct device_node *dn,
119 struct proc_dir_entry *de)
120{
121 dn->pde = de;
122}
123
124extern struct device_node *allnodes; /* temporary while merging */ 40extern struct device_node *allnodes; /* temporary while merging */
125extern rwlock_t devtree_lock; /* temporary while merging */ 41extern rwlock_t devtree_lock; /* temporary while merging */
126 42
127extern struct device_node *of_find_all_nodes(struct device_node *prev);
128extern struct device_node *of_node_get(struct device_node *node);
129extern void of_node_put(struct device_node *node);
130
131/* For scanning the flat device-tree at boot time */
132extern int __init of_scan_flat_dt(int (*it)(unsigned long node,
133 const char *uname, int depth,
134 void *data),
135 void *data);
136extern void *__init of_get_flat_dt_prop(unsigned long node, const char *name,
137 unsigned long *size);
138extern int __init
139 of_flat_dt_is_compatible(unsigned long node, const char *name);
140extern unsigned long __init of_get_flat_dt_root(void);
141
142/* For updating the device tree at runtime */ 43/* For updating the device tree at runtime */
143extern void of_attach_node(struct device_node *); 44extern void of_attach_node(struct device_node *);
144extern void of_detach_node(struct device_node *); 45extern void of_detach_node(struct device_node *);
145 46
146/* Other Prototypes */ 47/* Other Prototypes */
147extern void finish_device_tree(void);
148extern void unflatten_device_tree(void);
149extern int early_uartlite_console(void); 48extern int early_uartlite_console(void);
150extern void early_init_devtree(void *);
151extern int machine_is_compatible(const char *compat);
152extern void print_properties(struct device_node *node);
153extern int prom_n_intr_cells(struct device_node *np);
154extern void prom_get_irq_senses(unsigned char *senses, int off, int max);
155extern int prom_add_property(struct device_node *np, struct property *prop);
156extern int prom_remove_property(struct device_node *np, struct property *prop);
157extern int prom_update_property(struct device_node *np,
158 struct property *newprop,
159 struct property *oldprop);
160 49
161extern struct resource *request_OF_resource(struct device_node *node, 50extern struct resource *request_OF_resource(struct device_node *node,
162 int index, const char *name_postfix); 51 int index, const char *name_postfix);
@@ -166,18 +55,6 @@ extern int release_OF_resource(struct device_node *node, int index);
166 * OF address retreival & translation 55 * OF address retreival & translation
167 */ 56 */
168 57
169/* Helper to read a big number; size is in cells (not bytes) */
170static inline u64 of_read_number(const u32 *cell, int size)
171{
172 u64 r = 0;
173 while (size--)
174 r = (r << 32) | *(cell++);
175 return r;
176}
177
178/* Like of_read_number, but we want an unsigned long result */
179#define of_read_ulong(cell, size) of_read_number(cell, size)
180
181/* Translate an OF address block into a CPU physical address 58/* Translate an OF address block into a CPU physical address
182 */ 59 */
183extern u64 of_translate_address(struct device_node *np, const u32 *addr); 60extern u64 of_translate_address(struct device_node *np, const u32 *addr);
@@ -305,12 +182,6 @@ extern int of_irq_to_resource(struct device_node *dev, int index,
305 */ 182 */
306extern void __iomem *of_iomap(struct device_node *device, int index); 183extern void __iomem *of_iomap(struct device_node *device, int index);
307 184
308/*
309 * NB: This is here while we transition from using asm/prom.h
310 * to linux/of.h
311 */
312#include <linux/of.h>
313
314#endif /* __ASSEMBLY__ */ 185#endif /* __ASSEMBLY__ */
315#endif /* __KERNEL__ */ 186#endif /* __KERNEL__ */
316#endif /* _ASM_MICROBLAZE_PROM_H */ 187#endif /* _ASM_MICROBLAZE_PROM_H */
diff --git a/arch/microblaze/kernel/head.S b/arch/microblaze/kernel/head.S
index 697ce3007f30..30916193fcc7 100644
--- a/arch/microblaze/kernel/head.S
+++ b/arch/microblaze/kernel/head.S
@@ -31,7 +31,7 @@
31#include <linux/linkage.h> 31#include <linux/linkage.h>
32#include <asm/thread_info.h> 32#include <asm/thread_info.h>
33#include <asm/page.h> 33#include <asm/page.h>
34#include <asm/prom.h> /* for OF_DT_HEADER */ 34#include <linux/of_fdt.h> /* for OF_DT_HEADER */
35 35
36#ifdef CONFIG_MMU 36#ifdef CONFIG_MMU
37#include <asm/setup.h> /* COMMAND_LINE_SIZE */ 37#include <asm/setup.h> /* COMMAND_LINE_SIZE */
diff --git a/arch/microblaze/kernel/prom.c b/arch/microblaze/kernel/prom.c
index c005cc6f1aaf..b817df172aa9 100644
--- a/arch/microblaze/kernel/prom.c
+++ b/arch/microblaze/kernel/prom.c
@@ -860,29 +860,6 @@ struct device_node *of_find_node_by_phandle(phandle handle)
860EXPORT_SYMBOL(of_find_node_by_phandle); 860EXPORT_SYMBOL(of_find_node_by_phandle);
861 861
862/** 862/**
863 * of_find_all_nodes - Get next node in global list
864 * @prev: Previous node or NULL to start iteration
865 * of_node_put() will be called on it
866 *
867 * Returns a node pointer with refcount incremented, use
868 * of_node_put() on it when done.
869 */
870struct device_node *of_find_all_nodes(struct device_node *prev)
871{
872 struct device_node *np;
873
874 read_lock(&devtree_lock);
875 np = prev ? prev->allnext : allnodes;
876 for (; np != NULL; np = np->allnext)
877 if (of_node_get(np))
878 break;
879 of_node_put(prev);
880 read_unlock(&devtree_lock);
881 return np;
882}
883EXPORT_SYMBOL(of_find_all_nodes);
884
885/**
886 * of_node_get - Increment refcount of a node 863 * of_node_get - Increment refcount of a node
887 * @node: Node to inc refcount, NULL is supported to 864 * @node: Node to inc refcount, NULL is supported to
888 * simplify writing of callers 865 * simplify writing of callers
diff --git a/arch/microblaze/kernel/syscall_table.S b/arch/microblaze/kernel/syscall_table.S
index ecec19155135..c1ab1dc10898 100644
--- a/arch/microblaze/kernel/syscall_table.S
+++ b/arch/microblaze/kernel/syscall_table.S
@@ -371,3 +371,4 @@ ENTRY(sys_call_table)
371 .long sys_ni_syscall 371 .long sys_ni_syscall
372 .long sys_rt_tgsigqueueinfo /* 365 */ 372 .long sys_rt_tgsigqueueinfo /* 365 */
373 .long sys_perf_event_open 373 .long sys_perf_event_open
374 .long sys_recvmmsg
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 1aad0d9f5074..fd7620f025fa 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -358,7 +358,14 @@ config SGI_IP22
358 select SWAP_IO_SPACE 358 select SWAP_IO_SPACE
359 select SYS_HAS_CPU_R4X00 359 select SYS_HAS_CPU_R4X00
360 select SYS_HAS_CPU_R5000 360 select SYS_HAS_CPU_R5000
361 select SYS_HAS_EARLY_PRINTK 361 #
362 # Disable EARLY_PRINTK for now since it leads to overwritten prom
363 # memory during early boot on some machines.
364 #
365 # See http://www.linux-mips.org/cgi-bin/mesg.cgi?a=linux-mips&i=20091119164009.GA15038%40deprecation.cyrius.com
366 # for a more details discussion
367 #
368 # select SYS_HAS_EARLY_PRINTK
362 select SYS_SUPPORTS_32BIT_KERNEL 369 select SYS_SUPPORTS_32BIT_KERNEL
363 select SYS_SUPPORTS_64BIT_KERNEL 370 select SYS_SUPPORTS_64BIT_KERNEL
364 select SYS_SUPPORTS_BIG_ENDIAN 371 select SYS_SUPPORTS_BIG_ENDIAN
@@ -410,7 +417,14 @@ config SGI_IP28
410 select SGI_HAS_ZILOG 417 select SGI_HAS_ZILOG
411 select SWAP_IO_SPACE 418 select SWAP_IO_SPACE
412 select SYS_HAS_CPU_R10000 419 select SYS_HAS_CPU_R10000
413 select SYS_HAS_EARLY_PRINTK 420 #
421 # Disable EARLY_PRINTK for now since it leads to overwritten prom
422 # memory during early boot on some machines.
423 #
424 # See http://www.linux-mips.org/cgi-bin/mesg.cgi?a=linux-mips&i=20091119164009.GA15038%40deprecation.cyrius.com
425 # for a more details discussion
426 #
427 # select SYS_HAS_EARLY_PRINTK
414 select SYS_SUPPORTS_64BIT_KERNEL 428 select SYS_SUPPORTS_64BIT_KERNEL
415 select SYS_SUPPORTS_BIG_ENDIAN 429 select SYS_SUPPORTS_BIG_ENDIAN
416 help 430 help
@@ -1439,6 +1453,7 @@ choice
1439 1453
1440config PAGE_SIZE_4KB 1454config PAGE_SIZE_4KB
1441 bool "4kB" 1455 bool "4kB"
1456 depends on !CPU_LOONGSON2
1442 help 1457 help
1443 This option select the standard 4kB Linux page size. On some 1458 This option select the standard 4kB Linux page size. On some
1444 R3000-family processors this is the only available page size. Using 1459 R3000-family processors this is the only available page size. Using
@@ -1763,7 +1778,7 @@ config SYS_SUPPORTS_SMARTMIPS
1763 1778
1764config ARCH_FLATMEM_ENABLE 1779config ARCH_FLATMEM_ENABLE
1765 def_bool y 1780 def_bool y
1766 depends on !NUMA 1781 depends on !NUMA && !CPU_LOONGSON2
1767 1782
1768config ARCH_DISCONTIGMEM_ENABLE 1783config ARCH_DISCONTIGMEM_ENABLE
1769 bool 1784 bool
diff --git a/arch/mips/include/asm/bug.h b/arch/mips/include/asm/bug.h
index 6cf29c26e873..540c98a810d1 100644
--- a/arch/mips/include/asm/bug.h
+++ b/arch/mips/include/asm/bug.h
@@ -11,9 +11,7 @@
11static inline void __noreturn BUG(void) 11static inline void __noreturn BUG(void)
12{ 12{
13 __asm__ __volatile__("break %0" : : "i" (BRK_BUG)); 13 __asm__ __volatile__("break %0" : : "i" (BRK_BUG));
14 /* Fool GCC into thinking the function doesn't return. */ 14 unreachable();
15 while (1)
16 ;
17} 15}
18 16
19#define HAVE_ARCH_BUG 17#define HAVE_ARCH_BUG
diff --git a/arch/mips/include/asm/cacheflush.h b/arch/mips/include/asm/cacheflush.h
index 03b1d69b142f..40bb9fde205f 100644
--- a/arch/mips/include/asm/cacheflush.h
+++ b/arch/mips/include/asm/cacheflush.h
@@ -38,6 +38,7 @@ extern void (*flush_cache_range)(struct vm_area_struct *vma,
38extern void (*flush_cache_page)(struct vm_area_struct *vma, unsigned long page, unsigned long pfn); 38extern void (*flush_cache_page)(struct vm_area_struct *vma, unsigned long page, unsigned long pfn);
39extern void __flush_dcache_page(struct page *page); 39extern void __flush_dcache_page(struct page *page);
40 40
41#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1
41static inline void flush_dcache_page(struct page *page) 42static inline void flush_dcache_page(struct page *page)
42{ 43{
43 if (cpu_has_dc_aliases || !cpu_has_ic_fills_f_dc) 44 if (cpu_has_dc_aliases || !cpu_has_ic_fills_f_dc)
diff --git a/arch/mips/include/asm/mman.h b/arch/mips/include/asm/mman.h
index a2250f390a29..c892bfb3e2c1 100644
--- a/arch/mips/include/asm/mman.h
+++ b/arch/mips/include/asm/mman.h
@@ -75,6 +75,7 @@
75 75
76#define MADV_MERGEABLE 12 /* KSM may merge identical pages */ 76#define MADV_MERGEABLE 12 /* KSM may merge identical pages */
77#define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages */ 77#define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages */
78#define MADV_HWPOISON 100 /* poison a page for testing */
78 79
79/* compatibility flags */ 80/* compatibility flags */
80#define MAP_FILE 0 81#define MAP_FILE 0
diff --git a/arch/mips/include/asm/socket.h b/arch/mips/include/asm/socket.h
index ae05accd9fe4..9de5190f2487 100644
--- a/arch/mips/include/asm/socket.h
+++ b/arch/mips/include/asm/socket.h
@@ -80,6 +80,8 @@ To add: #define SO_REUSEPORT 0x0200 /* Allow local address and port reuse. */
80#define SO_TIMESTAMPING 37 80#define SO_TIMESTAMPING 37
81#define SCM_TIMESTAMPING SO_TIMESTAMPING 81#define SCM_TIMESTAMPING SO_TIMESTAMPING
82 82
83#define SO_RXQ_OVFL 40
84
83#ifdef __KERNEL__ 85#ifdef __KERNEL__
84 86
85/** sock_type - Socket types 87/** sock_type - Socket types
diff --git a/arch/mips/include/asm/system.h b/arch/mips/include/asm/system.h
index fcf5f98d90cc..83b5509e09e8 100644
--- a/arch/mips/include/asm/system.h
+++ b/arch/mips/include/asm/system.h
@@ -12,6 +12,7 @@
12#ifndef _ASM_SYSTEM_H 12#ifndef _ASM_SYSTEM_H
13#define _ASM_SYSTEM_H 13#define _ASM_SYSTEM_H
14 14
15#include <linux/kernel.h>
15#include <linux/types.h> 16#include <linux/types.h>
16#include <linux/irqflags.h> 17#include <linux/irqflags.h>
17 18
@@ -193,10 +194,6 @@ extern __u64 __xchg_u64_unsupported_on_32bit_kernels(volatile __u64 * m, __u64 v
193#define __xchg_u64 __xchg_u64_unsupported_on_32bit_kernels 194#define __xchg_u64 __xchg_u64_unsupported_on_32bit_kernels
194#endif 195#endif
195 196
196/* This function doesn't exist, so you'll get a linker error
197 if something tries to do an invalid xchg(). */
198extern void __xchg_called_with_bad_pointer(void);
199
200static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size) 197static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size)
201{ 198{
202 switch (size) { 199 switch (size) {
@@ -205,11 +202,17 @@ static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int siz
205 case 8: 202 case 8:
206 return __xchg_u64(ptr, x); 203 return __xchg_u64(ptr, x);
207 } 204 }
208 __xchg_called_with_bad_pointer(); 205
209 return x; 206 return x;
210} 207}
211 208
212#define xchg(ptr, x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x), (ptr), sizeof(*(ptr)))) 209#define xchg(ptr, x) \
210({ \
211 BUILD_BUG_ON(sizeof(*(ptr)) & ~0xc); \
212 \
213 ((__typeof__(*(ptr))) \
214 __xchg((unsigned long)(x), (ptr), sizeof(*(ptr)))); \
215})
213 216
214extern void set_handler(unsigned long offset, void *addr, unsigned long len); 217extern void set_handler(unsigned long offset, void *addr, unsigned long len);
215extern void set_uncached_handler(unsigned long offset, void *addr, unsigned long len); 218extern void set_uncached_handler(unsigned long offset, void *addr, unsigned long len);
diff --git a/arch/mips/include/asm/time.h b/arch/mips/include/asm/time.h
index df6a430de5eb..c7f1bfef1574 100644
--- a/arch/mips/include/asm/time.h
+++ b/arch/mips/include/asm/time.h
@@ -84,8 +84,16 @@ static inline int init_mips_clocksource(void)
84#endif 84#endif
85} 85}
86 86
87extern void clocksource_set_clock(struct clocksource *cs, unsigned int clock); 87static inline void clocksource_set_clock(struct clocksource *cs,
88extern void clockevent_set_clock(struct clock_event_device *cd, 88 unsigned int clock)
89 unsigned int clock); 89{
90 clocksource_calc_mult_shift(cs, clock, 4);
91}
92
93static inline void clockevent_set_clock(struct clock_event_device *cd,
94 unsigned int clock)
95{
96 clockevents_calc_mult_shift(cd, clock, 4);
97}
90 98
91#endif /* _ASM_TIME_H */ 99#endif /* _ASM_TIME_H */
diff --git a/arch/mips/include/asm/unistd.h b/arch/mips/include/asm/unistd.h
index 8c9dfa9e9018..65c679ecbe6b 100644
--- a/arch/mips/include/asm/unistd.h
+++ b/arch/mips/include/asm/unistd.h
@@ -355,16 +355,17 @@
355#define __NR_rt_tgsigqueueinfo (__NR_Linux + 332) 355#define __NR_rt_tgsigqueueinfo (__NR_Linux + 332)
356#define __NR_perf_event_open (__NR_Linux + 333) 356#define __NR_perf_event_open (__NR_Linux + 333)
357#define __NR_accept4 (__NR_Linux + 334) 357#define __NR_accept4 (__NR_Linux + 334)
358#define __NR_recvmmsg (__NR_Linux + 335)
358 359
359/* 360/*
360 * Offset of the last Linux o32 flavoured syscall 361 * Offset of the last Linux o32 flavoured syscall
361 */ 362 */
362#define __NR_Linux_syscalls 334 363#define __NR_Linux_syscalls 335
363 364
364#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ 365#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
365 366
366#define __NR_O32_Linux 4000 367#define __NR_O32_Linux 4000
367#define __NR_O32_Linux_syscalls 334 368#define __NR_O32_Linux_syscalls 335
368 369
369#if _MIPS_SIM == _MIPS_SIM_ABI64 370#if _MIPS_SIM == _MIPS_SIM_ABI64
370 371
@@ -666,16 +667,17 @@
666#define __NR_rt_tgsigqueueinfo (__NR_Linux + 291) 667#define __NR_rt_tgsigqueueinfo (__NR_Linux + 291)
667#define __NR_perf_event_open (__NR_Linux + 292) 668#define __NR_perf_event_open (__NR_Linux + 292)
668#define __NR_accept4 (__NR_Linux + 293) 669#define __NR_accept4 (__NR_Linux + 293)
670#define __NR_recvmmsg (__NR_Linux + 294)
669 671
670/* 672/*
671 * Offset of the last Linux 64-bit flavoured syscall 673 * Offset of the last Linux 64-bit flavoured syscall
672 */ 674 */
673#define __NR_Linux_syscalls 293 675#define __NR_Linux_syscalls 294
674 676
675#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ 677#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
676 678
677#define __NR_64_Linux 5000 679#define __NR_64_Linux 5000
678#define __NR_64_Linux_syscalls 293 680#define __NR_64_Linux_syscalls 294
679 681
680#if _MIPS_SIM == _MIPS_SIM_NABI32 682#if _MIPS_SIM == _MIPS_SIM_NABI32
681 683
@@ -981,16 +983,17 @@
981#define __NR_rt_tgsigqueueinfo (__NR_Linux + 295) 983#define __NR_rt_tgsigqueueinfo (__NR_Linux + 295)
982#define __NR_perf_event_open (__NR_Linux + 296) 984#define __NR_perf_event_open (__NR_Linux + 296)
983#define __NR_accept4 (__NR_Linux + 297) 985#define __NR_accept4 (__NR_Linux + 297)
986#define __NR_recvmmsg (__NR_Linux + 298)
984 987
985/* 988/*
986 * Offset of the last N32 flavoured syscall 989 * Offset of the last N32 flavoured syscall
987 */ 990 */
988#define __NR_Linux_syscalls 297 991#define __NR_Linux_syscalls 298
989 992
990#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ 993#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
991 994
992#define __NR_N32_Linux 6000 995#define __NR_N32_Linux 6000
993#define __NR_N32_Linux_syscalls 297 996#define __NR_N32_Linux_syscalls 298
994 997
995#ifdef __KERNEL__ 998#ifdef __KERNEL__
996 999
diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c
index b77fefaff9da..1a2793efdc4e 100644
--- a/arch/mips/kernel/linux32.c
+++ b/arch/mips/kernel/linux32.c
@@ -265,67 +265,6 @@ SYSCALL_DEFINE5(n32_msgrcv, int, msqid, u32, msgp, size_t, msgsz,
265} 265}
266#endif 266#endif
267 267
268struct sysctl_args32
269{
270 compat_caddr_t name;
271 int nlen;
272 compat_caddr_t oldval;
273 compat_caddr_t oldlenp;
274 compat_caddr_t newval;
275 compat_size_t newlen;
276 unsigned int __unused[4];
277};
278
279#ifdef CONFIG_SYSCTL_SYSCALL
280
281SYSCALL_DEFINE1(32_sysctl, struct sysctl_args32 __user *, args)
282{
283 struct sysctl_args32 tmp;
284 int error;
285 size_t oldlen;
286 size_t __user *oldlenp = NULL;
287 unsigned long addr = (((unsigned long)&args->__unused[0]) + 7) & ~7;
288
289 if (copy_from_user(&tmp, args, sizeof(tmp)))
290 return -EFAULT;
291
292 if (tmp.oldval && tmp.oldlenp) {
293 /* Duh, this is ugly and might not work if sysctl_args
294 is in read-only memory, but do_sysctl does indirectly
295 a lot of uaccess in both directions and we'd have to
296 basically copy the whole sysctl.c here, and
297 glibc's __sysctl uses rw memory for the structure
298 anyway. */
299 if (get_user(oldlen, (u32 __user *)A(tmp.oldlenp)) ||
300 put_user(oldlen, (size_t __user *)addr))
301 return -EFAULT;
302 oldlenp = (size_t __user *)addr;
303 }
304
305 lock_kernel();
306 error = do_sysctl((int __user *)A(tmp.name), tmp.nlen, (void __user *)A(tmp.oldval),
307 oldlenp, (void __user *)A(tmp.newval), tmp.newlen);
308 unlock_kernel();
309 if (oldlenp) {
310 if (!error) {
311 if (get_user(oldlen, (size_t __user *)addr) ||
312 put_user(oldlen, (u32 __user *)A(tmp.oldlenp)))
313 error = -EFAULT;
314 }
315 copy_to_user(args->__unused, tmp.__unused, sizeof(tmp.__unused));
316 }
317 return error;
318}
319
320#else
321
322SYSCALL_DEFINE1(32_sysctl, struct sysctl_args32 __user *, args)
323{
324 return -ENOSYS;
325}
326
327#endif /* CONFIG_SYSCTL_SYSCALL */
328
329SYSCALL_DEFINE1(32_newuname, struct new_utsname __user *, name) 268SYSCALL_DEFINE1(32_newuname, struct new_utsname __user *, name)
330{ 269{
331 int ret = 0; 270 int ret = 0;
diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S
index fd2a9bb620d6..17202bbe843f 100644
--- a/arch/mips/kernel/scall32-o32.S
+++ b/arch/mips/kernel/scall32-o32.S
@@ -583,6 +583,7 @@ einval: li v0, -ENOSYS
583 sys sys_rt_tgsigqueueinfo 4 583 sys sys_rt_tgsigqueueinfo 4
584 sys sys_perf_event_open 5 584 sys sys_perf_event_open 5
585 sys sys_accept4 4 585 sys sys_accept4 4
586 sys sys_recvmmsg 5
586 .endm 587 .endm
587 588
588 /* We pre-compute the number of _instruction_ bytes needed to 589 /* We pre-compute the number of _instruction_ bytes needed to
diff --git a/arch/mips/kernel/scall64-64.S b/arch/mips/kernel/scall64-64.S
index 18bf7f32c5e4..a8a6c596eb04 100644
--- a/arch/mips/kernel/scall64-64.S
+++ b/arch/mips/kernel/scall64-64.S
@@ -420,4 +420,5 @@ sys_call_table:
420 PTR sys_rt_tgsigqueueinfo 420 PTR sys_rt_tgsigqueueinfo
421 PTR sys_perf_event_open 421 PTR sys_perf_event_open
422 PTR sys_accept4 422 PTR sys_accept4
423 PTR sys_recvmmsg
423 .size sys_call_table,.-sys_call_table 424 .size sys_call_table,.-sys_call_table
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S
index 6ebc07976694..66b5a48676dd 100644
--- a/arch/mips/kernel/scall64-n32.S
+++ b/arch/mips/kernel/scall64-n32.S
@@ -272,7 +272,7 @@ EXPORT(sysn32_call_table)
272 PTR sys_munlockall 272 PTR sys_munlockall
273 PTR sys_vhangup /* 6150 */ 273 PTR sys_vhangup /* 6150 */
274 PTR sys_pivot_root 274 PTR sys_pivot_root
275 PTR sys_32_sysctl 275 PTR compat_sys_sysctl
276 PTR sys_prctl 276 PTR sys_prctl
277 PTR compat_sys_adjtimex 277 PTR compat_sys_adjtimex
278 PTR compat_sys_setrlimit /* 6155 */ 278 PTR compat_sys_setrlimit /* 6155 */
@@ -418,4 +418,5 @@ EXPORT(sysn32_call_table)
418 PTR compat_sys_rt_tgsigqueueinfo /* 5295 */ 418 PTR compat_sys_rt_tgsigqueueinfo /* 5295 */
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 .size sysn32_call_table,.-sysn32_call_table 422 .size sysn32_call_table,.-sysn32_call_table
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S
index 14dde4ca932e..515f9eab2b28 100644
--- a/arch/mips/kernel/scall64-o32.S
+++ b/arch/mips/kernel/scall64-o32.S
@@ -356,7 +356,7 @@ sys_call_table:
356 PTR sys_ni_syscall /* 4150 */ 356 PTR sys_ni_syscall /* 4150 */
357 PTR sys_getsid 357 PTR sys_getsid
358 PTR sys_fdatasync 358 PTR sys_fdatasync
359 PTR sys_32_sysctl 359 PTR compat_sys_sysctl
360 PTR sys_mlock 360 PTR sys_mlock
361 PTR sys_munlock /* 4155 */ 361 PTR sys_munlock /* 4155 */
362 PTR sys_mlockall 362 PTR sys_mlockall
@@ -538,4 +538,5 @@ sys_call_table:
538 PTR compat_sys_rt_tgsigqueueinfo 538 PTR compat_sys_rt_tgsigqueueinfo
539 PTR sys_perf_event_open 539 PTR sys_perf_event_open
540 PTR sys_accept4 540 PTR sys_accept4
541 PTR compat_sys_recvmmsg
541 .size sys_call_table,.-sys_call_table 542 .size sys_call_table,.-sys_call_table
diff --git a/arch/mips/kernel/syscall.c b/arch/mips/kernel/syscall.c
index 3fe1fcfa2e73..fe0d79805603 100644
--- a/arch/mips/kernel/syscall.c
+++ b/arch/mips/kernel/syscall.c
@@ -306,6 +306,7 @@ static inline int mips_atomic_set(struct pt_regs *regs,
306 306
307 if (cpu_has_llsc && R10000_LLSC_WAR) { 307 if (cpu_has_llsc && R10000_LLSC_WAR) {
308 __asm__ __volatile__ ( 308 __asm__ __volatile__ (
309 " .set mips3 \n"
309 " li %[err], 0 \n" 310 " li %[err], 0 \n"
310 "1: ll %[old], (%[addr]) \n" 311 "1: ll %[old], (%[addr]) \n"
311 " move %[tmp], %[new] \n" 312 " move %[tmp], %[new] \n"
@@ -320,6 +321,7 @@ static inline int mips_atomic_set(struct pt_regs *regs,
320 " "STR(PTR)" 1b, 4b \n" 321 " "STR(PTR)" 1b, 4b \n"
321 " "STR(PTR)" 2b, 4b \n" 322 " "STR(PTR)" 2b, 4b \n"
322 " .previous \n" 323 " .previous \n"
324 " .set mips0 \n"
323 : [old] "=&r" (old), 325 : [old] "=&r" (old),
324 [err] "=&r" (err), 326 [err] "=&r" (err),
325 [tmp] "=&r" (tmp) 327 [tmp] "=&r" (tmp)
@@ -329,6 +331,7 @@ static inline int mips_atomic_set(struct pt_regs *regs,
329 : "memory"); 331 : "memory");
330 } else if (cpu_has_llsc) { 332 } else if (cpu_has_llsc) {
331 __asm__ __volatile__ ( 333 __asm__ __volatile__ (
334 " .set mips3 \n"
332 " li %[err], 0 \n" 335 " li %[err], 0 \n"
333 "1: ll %[old], (%[addr]) \n" 336 "1: ll %[old], (%[addr]) \n"
334 " move %[tmp], %[new] \n" 337 " move %[tmp], %[new] \n"
@@ -347,6 +350,7 @@ static inline int mips_atomic_set(struct pt_regs *regs,
347 " "STR(PTR)" 1b, 5b \n" 350 " "STR(PTR)" 1b, 5b \n"
348 " "STR(PTR)" 2b, 5b \n" 351 " "STR(PTR)" 2b, 5b \n"
349 " .previous \n" 352 " .previous \n"
353 " .set mips0 \n"
350 : [old] "=&r" (old), 354 : [old] "=&r" (old),
351 [err] "=&r" (err), 355 [err] "=&r" (err),
352 [tmp] "=&r" (tmp) 356 [tmp] "=&r" (tmp)
diff --git a/arch/mips/kernel/time.c b/arch/mips/kernel/time.c
index 1f467d534642..fb7497405510 100644
--- a/arch/mips/kernel/time.c
+++ b/arch/mips/kernel/time.c
@@ -71,39 +71,6 @@ EXPORT_SYMBOL(perf_irq);
71 71
72unsigned int mips_hpt_frequency; 72unsigned int mips_hpt_frequency;
73 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 __cpuinit 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
107/* 74/*
108 * This function exists in order to cause an error due to a duplicate 75 * This function exists in order to cause an error due to a duplicate
109 * definition if platform code should have its own implementation. The hook 76 * definition if platform code should have its own implementation. The hook
diff --git a/arch/mips/lasat/sysctl.c b/arch/mips/lasat/sysctl.c
index b3deed8db619..14b9a28a4aec 100644
--- a/arch/mips/lasat/sysctl.c
+++ b/arch/mips/lasat/sysctl.c
@@ -37,23 +37,6 @@
37#include "ds1603.h" 37#include "ds1603.h"
38#endif 38#endif
39 39
40/* Strategy function to write EEPROM after changing string entry */
41int sysctl_lasatstring(ctl_table *table,
42 void *oldval, size_t *oldlenp,
43 void *newval, size_t newlen)
44{
45 int r;
46
47 r = sysctl_string(table, oldval, oldlenp, newval, newlen);
48 if (r < 0)
49 return r;
50
51 if (newval && newlen)
52 lasat_write_eeprom_info();
53
54 return 0;
55}
56
57 40
58/* And the same for proc */ 41/* And the same for proc */
59int proc_dolasatstring(ctl_table *table, int write, 42int proc_dolasatstring(ctl_table *table, int write,
@@ -113,46 +96,6 @@ int proc_dolasatrtc(ctl_table *table, int write,
113} 96}
114#endif 97#endif
115 98
116/* Sysctl for setting the IP addresses */
117int sysctl_lasat_intvec(ctl_table *table,
118 void *oldval, size_t *oldlenp,
119 void *newval, size_t newlen)
120{
121 int r;
122
123 r = sysctl_intvec(table, oldval, oldlenp, newval, newlen);
124 if (r < 0)
125 return r;
126
127 if (newval && newlen)
128 lasat_write_eeprom_info();
129
130 return 0;
131}
132
133#ifdef CONFIG_DS1603
134/* Same for RTC */
135int sysctl_lasat_rtc(ctl_table *table,
136 void *oldval, size_t *oldlenp,
137 void *newval, size_t newlen)
138{
139 struct timespec ts;
140 int r;
141
142 read_persistent_clock(&ts);
143 rtctmp = ts.tv_sec;
144 if (rtctmp < 0)
145 rtctmp = 0;
146 r = sysctl_intvec(table, oldval, oldlenp, newval, newlen);
147 if (r < 0)
148 return r;
149 if (newval && newlen)
150 rtc_mips_set_mmss(rtctmp);
151
152 return r;
153}
154#endif
155
156#ifdef CONFIG_INET 99#ifdef CONFIG_INET
157int proc_lasat_ip(ctl_table *table, int write, 100int proc_lasat_ip(ctl_table *table, int write,
158 void *buffer, size_t *lenp, loff_t *ppos) 101 void *buffer, size_t *lenp, loff_t *ppos)
@@ -214,23 +157,6 @@ int proc_lasat_ip(ctl_table *table, int write,
214} 157}
215#endif 158#endif
216 159
217static int sysctl_lasat_prid(ctl_table *table,
218 void *oldval, size_t *oldlenp,
219 void *newval, size_t newlen)
220{
221 int r;
222
223 r = sysctl_intvec(table, oldval, oldlenp, newval, newlen);
224 if (r < 0)
225 return r;
226 if (newval && newlen) {
227 lasat_board_info.li_eeprom_info.prid = *(int *)newval;
228 lasat_write_eeprom_info();
229 lasat_init_board_info();
230 }
231 return 0;
232}
233
234int proc_lasat_prid(ctl_table *table, int write, 160int proc_lasat_prid(ctl_table *table, int write,
235 void *buffer, size_t *lenp, loff_t *ppos) 161 void *buffer, size_t *lenp, loff_t *ppos)
236{ 162{
@@ -252,115 +178,92 @@ extern int lasat_boot_to_service;
252 178
253static ctl_table lasat_table[] = { 179static ctl_table lasat_table[] = {
254 { 180 {
255 .ctl_name = CTL_UNNUMBERED,
256 .procname = "cpu-hz", 181 .procname = "cpu-hz",
257 .data = &lasat_board_info.li_cpu_hz, 182 .data = &lasat_board_info.li_cpu_hz,
258 .maxlen = sizeof(int), 183 .maxlen = sizeof(int),
259 .mode = 0444, 184 .mode = 0444,
260 .proc_handler = &proc_dointvec, 185 .proc_handler = proc_dointvec,
261 .strategy = &sysctl_intvec
262 }, 186 },
263 { 187 {
264 .ctl_name = CTL_UNNUMBERED,
265 .procname = "bus-hz", 188 .procname = "bus-hz",
266 .data = &lasat_board_info.li_bus_hz, 189 .data = &lasat_board_info.li_bus_hz,
267 .maxlen = sizeof(int), 190 .maxlen = sizeof(int),
268 .mode = 0444, 191 .mode = 0444,
269 .proc_handler = &proc_dointvec, 192 .proc_handler = proc_dointvec,
270 .strategy = &sysctl_intvec
271 }, 193 },
272 { 194 {
273 .ctl_name = CTL_UNNUMBERED,
274 .procname = "bmid", 195 .procname = "bmid",
275 .data = &lasat_board_info.li_bmid, 196 .data = &lasat_board_info.li_bmid,
276 .maxlen = sizeof(int), 197 .maxlen = sizeof(int),
277 .mode = 0444, 198 .mode = 0444,
278 .proc_handler = &proc_dointvec, 199 .proc_handler = proc_dointvec,
279 .strategy = &sysctl_intvec
280 }, 200 },
281 { 201 {
282 .ctl_name = CTL_UNNUMBERED,
283 .procname = "prid", 202 .procname = "prid",
284 .data = &lasat_board_info.li_prid, 203 .data = &lasat_board_info.li_prid,
285 .maxlen = sizeof(int), 204 .maxlen = sizeof(int),
286 .mode = 0644, 205 .mode = 0644,
287 .proc_handler = &proc_lasat_prid, 206 .proc_handler = proc_lasat_prid,
288 .strategy = &sysctl_lasat_prid 207. },
289 },
290#ifdef CONFIG_INET 208#ifdef CONFIG_INET
291 { 209 {
292 .ctl_name = CTL_UNNUMBERED,
293 .procname = "ipaddr", 210 .procname = "ipaddr",
294 .data = &lasat_board_info.li_eeprom_info.ipaddr, 211 .data = &lasat_board_info.li_eeprom_info.ipaddr,
295 .maxlen = sizeof(int), 212 .maxlen = sizeof(int),
296 .mode = 0644, 213 .mode = 0644,
297 .proc_handler = &proc_lasat_ip, 214 .proc_handler = proc_lasat_ip,
298 .strategy = &sysctl_lasat_intvec
299 }, 215 },
300 { 216 {
301 .ctl_name = CTL_UNNUMBERED,
302 .procname = "netmask", 217 .procname = "netmask",
303 .data = &lasat_board_info.li_eeprom_info.netmask, 218 .data = &lasat_board_info.li_eeprom_info.netmask,
304 .maxlen = sizeof(int), 219 .maxlen = sizeof(int),
305 .mode = 0644, 220 .mode = 0644,
306 .proc_handler = &proc_lasat_ip, 221 .proc_handler = proc_lasat_ip,
307 .strategy = &sysctl_lasat_intvec
308 }, 222 },
309#endif 223#endif
310 { 224 {
311 .ctl_name = CTL_UNNUMBERED,
312 .procname = "passwd_hash", 225 .procname = "passwd_hash",
313 .data = &lasat_board_info.li_eeprom_info.passwd_hash, 226 .data = &lasat_board_info.li_eeprom_info.passwd_hash,
314 .maxlen = 227 .maxlen =
315 sizeof(lasat_board_info.li_eeprom_info.passwd_hash), 228 sizeof(lasat_board_info.li_eeprom_info.passwd_hash),
316 .mode = 0600, 229 .mode = 0600,
317 .proc_handler = &proc_dolasatstring, 230 .proc_handler = proc_dolasatstring,
318 .strategy = &sysctl_lasatstring
319 }, 231 },
320 { 232 {
321 .ctl_name = CTL_UNNUMBERED,
322 .procname = "boot-service", 233 .procname = "boot-service",
323 .data = &lasat_boot_to_service, 234 .data = &lasat_boot_to_service,
324 .maxlen = sizeof(int), 235 .maxlen = sizeof(int),
325 .mode = 0644, 236 .mode = 0644,
326 .proc_handler = &proc_dointvec, 237 .proc_handler = proc_dointvec,
327 .strategy = &sysctl_intvec
328 }, 238 },
329#ifdef CONFIG_DS1603 239#ifdef CONFIG_DS1603
330 { 240 {
331 .ctl_name = CTL_UNNUMBERED,
332 .procname = "rtc", 241 .procname = "rtc",
333 .data = &rtctmp, 242 .data = &rtctmp,
334 .maxlen = sizeof(int), 243 .maxlen = sizeof(int),
335 .mode = 0644, 244 .mode = 0644,
336 .proc_handler = &proc_dolasatrtc, 245 .proc_handler = proc_dolasatrtc,
337 .strategy = &sysctl_lasat_rtc
338 }, 246 },
339#endif 247#endif
340 { 248 {
341 .ctl_name = CTL_UNNUMBERED,
342 .procname = "namestr", 249 .procname = "namestr",
343 .data = &lasat_board_info.li_namestr, 250 .data = &lasat_board_info.li_namestr,
344 .maxlen = sizeof(lasat_board_info.li_namestr), 251 .maxlen = sizeof(lasat_board_info.li_namestr),
345 .mode = 0444, 252 .mode = 0444,
346 .proc_handler = &proc_dostring, 253 .proc_handler = proc_dostring,
347 .strategy = &sysctl_string
348 }, 254 },
349 { 255 {
350 .ctl_name = CTL_UNNUMBERED,
351 .procname = "typestr", 256 .procname = "typestr",
352 .data = &lasat_board_info.li_typestr, 257 .data = &lasat_board_info.li_typestr,
353 .maxlen = sizeof(lasat_board_info.li_typestr), 258 .maxlen = sizeof(lasat_board_info.li_typestr),
354 .mode = 0444, 259 .mode = 0444,
355 .proc_handler = &proc_dostring, 260 .proc_handler = proc_dostring,
356 .strategy = &sysctl_string
357 }, 261 },
358 {} 262 {}
359}; 263};
360 264
361static ctl_table lasat_root_table[] = { 265static ctl_table lasat_root_table[] = {
362 { 266 {
363 .ctl_name = CTL_UNNUMBERED,
364 .procname = "lasat", 267 .procname = "lasat",
365 .mode = 0555, 268 .mode = 0555,
366 .child = lasat_table 269 .child = lasat_table
diff --git a/arch/mips/rb532/devices.c b/arch/mips/rb532/devices.c
index 9f40e1ff9b4f..041fc1afc3f4 100644
--- a/arch/mips/rb532/devices.c
+++ b/arch/mips/rb532/devices.c
@@ -110,7 +110,6 @@ static struct korina_device korina_dev0_data = {
110static struct platform_device korina_dev0 = { 110static struct platform_device korina_dev0 = {
111 .id = -1, 111 .id = -1,
112 .name = "korina", 112 .name = "korina",
113 .dev.driver_data = &korina_dev0_data,
114 .resource = korina_dev0_res, 113 .resource = korina_dev0_res,
115 .num_resources = ARRAY_SIZE(korina_dev0_res), 114 .num_resources = ARRAY_SIZE(korina_dev0_res),
116}; 115};
@@ -332,6 +331,8 @@ static int __init plat_setup_devices(void)
332 /* set the uart clock to the current cpu frequency */ 331 /* set the uart clock to the current cpu frequency */
333 rb532_uart_res[0].uartclk = idt_cpu_freq; 332 rb532_uart_res[0].uartclk = idt_cpu_freq;
334 333
334 dev_set_drvdata(&korina_dev0.dev, &korina_dev0_data);
335
335 return platform_add_devices(rb532_devs, ARRAY_SIZE(rb532_devs)); 336 return platform_add_devices(rb532_devs, ARRAY_SIZE(rb532_devs));
336} 337}
337 338
diff --git a/arch/mn10300/include/asm/cacheflush.h b/arch/mn10300/include/asm/cacheflush.h
index 1a55d61f0d06..29e692f7f030 100644
--- a/arch/mn10300/include/asm/cacheflush.h
+++ b/arch/mn10300/include/asm/cacheflush.h
@@ -26,6 +26,7 @@
26#define flush_cache_page(vma, vmaddr, pfn) do {} while (0) 26#define flush_cache_page(vma, vmaddr, pfn) do {} while (0)
27#define flush_cache_vmap(start, end) do {} while (0) 27#define flush_cache_vmap(start, end) do {} while (0)
28#define flush_cache_vunmap(start, end) do {} while (0) 28#define flush_cache_vunmap(start, end) do {} while (0)
29#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 0
29#define flush_dcache_page(page) do {} while (0) 30#define flush_dcache_page(page) do {} while (0)
30#define flush_dcache_mmap_lock(mapping) do {} while (0) 31#define flush_dcache_mmap_lock(mapping) do {} while (0)
31#define flush_dcache_mmap_unlock(mapping) do {} while (0) 32#define flush_dcache_mmap_unlock(mapping) do {} while (0)
diff --git a/arch/mn10300/include/asm/socket.h b/arch/mn10300/include/asm/socket.h
index 4df75af29d76..4e60c4281288 100644
--- a/arch/mn10300/include/asm/socket.h
+++ b/arch/mn10300/include/asm/socket.h
@@ -60,4 +60,6 @@
60#define SO_PROTOCOL 38 60#define SO_PROTOCOL 38
61#define SO_DOMAIN 39 61#define SO_DOMAIN 39
62 62
63#define SO_RXQ_OVFL 40
64
63#endif /* _ASM_SOCKET_H */ 65#endif /* _ASM_SOCKET_H */
diff --git a/arch/mn10300/kernel/process.c b/arch/mn10300/kernel/process.c
index 892cce82867e..ec8a21df1142 100644
--- a/arch/mn10300/kernel/process.c
+++ b/arch/mn10300/kernel/process.c
@@ -275,16 +275,12 @@ asmlinkage long sys_execve(char __user *name,
275 char *filename; 275 char *filename;
276 int error; 276 int error;
277 277
278 lock_kernel();
279
280 filename = getname(name); 278 filename = getname(name);
281 error = PTR_ERR(filename); 279 error = PTR_ERR(filename);
282 if (!IS_ERR(filename)) { 280 if (IS_ERR(filename))
283 error = do_execve(filename, argv, envp, __frame); 281 return error;
284 putname(filename); 282 error = do_execve(filename, argv, envp, __frame);
285 } 283 putname(filename);
286
287 unlock_kernel();
288 return error; 284 return error;
289} 285}
290 286
diff --git a/arch/parisc/include/asm/cacheflush.h b/arch/parisc/include/asm/cacheflush.h
index 724395143f26..7a73b615c23d 100644
--- a/arch/parisc/include/asm/cacheflush.h
+++ b/arch/parisc/include/asm/cacheflush.h
@@ -42,6 +42,7 @@ void flush_cache_mm(struct mm_struct *mm);
42#define flush_cache_vmap(start, end) flush_cache_all() 42#define flush_cache_vmap(start, end) flush_cache_all()
43#define flush_cache_vunmap(start, end) flush_cache_all() 43#define flush_cache_vunmap(start, end) flush_cache_all()
44 44
45#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1
45extern void flush_dcache_page(struct page *page); 46extern void flush_dcache_page(struct page *page);
46 47
47#define flush_dcache_mmap_lock(mapping) \ 48#define flush_dcache_mmap_lock(mapping) \
diff --git a/arch/parisc/include/asm/socket.h b/arch/parisc/include/asm/socket.h
index 960b1e5d8e16..225b7d6a1a0a 100644
--- a/arch/parisc/include/asm/socket.h
+++ b/arch/parisc/include/asm/socket.h
@@ -59,6 +59,8 @@
59#define SO_TIMESTAMPING 0x4020 59#define SO_TIMESTAMPING 0x4020
60#define SCM_TIMESTAMPING SO_TIMESTAMPING 60#define SCM_TIMESTAMPING SO_TIMESTAMPING
61 61
62#define SO_RXQ_OVFL 0x4021
63
62/* O_NONBLOCK clashes with the bits used for socket types. Therefore we 64/* O_NONBLOCK clashes with the bits used for socket types. Therefore we
63 * have to define SOCK_NONBLOCK to a different value here. 65 * have to define SOCK_NONBLOCK to a different value here.
64 */ 66 */
diff --git a/arch/parisc/kernel/sys_parisc32.c b/arch/parisc/kernel/sys_parisc32.c
index 561388b17c91..76d23ec8dfaa 100644
--- a/arch/parisc/kernel/sys_parisc32.c
+++ b/arch/parisc/kernel/sys_parisc32.c
@@ -90,77 +90,6 @@ asmlinkage long sys32_unimplemented(int r26, int r25, int r24, int r23,
90 return -ENOSYS; 90 return -ENOSYS;
91} 91}
92 92
93#ifdef CONFIG_SYSCTL
94
95struct __sysctl_args32 {
96 u32 name;
97 int nlen;
98 u32 oldval;
99 u32 oldlenp;
100 u32 newval;
101 u32 newlen;
102 u32 __unused[4];
103};
104
105asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args)
106{
107#ifndef CONFIG_SYSCTL_SYSCALL
108 return -ENOSYS;
109#else
110 struct __sysctl_args32 tmp;
111 int error;
112 unsigned int oldlen32;
113 size_t oldlen, __user *oldlenp = NULL;
114 unsigned long addr = (((long __force)&args->__unused[0]) + 7) & ~7;
115
116 DBG(("sysctl32(%p)\n", args));
117
118 if (copy_from_user(&tmp, args, sizeof(tmp)))
119 return -EFAULT;
120
121 if (tmp.oldval && tmp.oldlenp) {
122 /* Duh, this is ugly and might not work if sysctl_args
123 is in read-only memory, but do_sysctl does indirectly
124 a lot of uaccess in both directions and we'd have to
125 basically copy the whole sysctl.c here, and
126 glibc's __sysctl uses rw memory for the structure
127 anyway. */
128 /* a possibly better hack than this, which will avoid the
129 * problem if the struct is read only, is to push the
130 * 'oldlen' value out to the user's stack instead. -PB
131 */
132 if (get_user(oldlen32, (u32 *)(u64)tmp.oldlenp))
133 return -EFAULT;
134 oldlen = oldlen32;
135 if (put_user(oldlen, (size_t *)addr))
136 return -EFAULT;
137 oldlenp = (size_t *)addr;
138 }
139
140 lock_kernel();
141 error = do_sysctl((int __user *)(u64)tmp.name, tmp.nlen,
142 (void __user *)(u64)tmp.oldval, oldlenp,
143 (void __user *)(u64)tmp.newval, tmp.newlen);
144 unlock_kernel();
145 if (oldlenp) {
146 if (!error) {
147 if (get_user(oldlen, (size_t *)addr)) {
148 error = -EFAULT;
149 } else {
150 oldlen32 = oldlen;
151 if (put_user(oldlen32, (u32 *)(u64)tmp.oldlenp))
152 error = -EFAULT;
153 }
154 }
155 if (copy_to_user(args->__unused, tmp.__unused, sizeof(tmp.__unused)))
156 error = -EFAULT;
157 }
158 return error;
159#endif
160}
161
162#endif /* CONFIG_SYSCTL */
163
164asmlinkage long sys32_sched_rr_get_interval(pid_t pid, 93asmlinkage long sys32_sched_rr_get_interval(pid_t pid,
165 struct compat_timespec __user *interval) 94 struct compat_timespec __user *interval)
166{ 95{
diff --git a/arch/parisc/kernel/syscall_table.S b/arch/parisc/kernel/syscall_table.S
index 843f423dec67..01c4fcf8f481 100644
--- a/arch/parisc/kernel/syscall_table.S
+++ b/arch/parisc/kernel/syscall_table.S
@@ -234,7 +234,7 @@
234 ENTRY_SAME(getsid) 234 ENTRY_SAME(getsid)
235 ENTRY_SAME(fdatasync) 235 ENTRY_SAME(fdatasync)
236 /* struct __sysctl_args is a mess */ 236 /* struct __sysctl_args is a mess */
237 ENTRY_DIFF(sysctl) 237 ENTRY_COMP(sysctl)
238 ENTRY_SAME(mlock) /* 150 */ 238 ENTRY_SAME(mlock) /* 150 */
239 ENTRY_SAME(munlock) 239 ENTRY_SAME(munlock)
240 ENTRY_SAME(mlockall) 240 ENTRY_SAME(mlockall)
diff --git a/arch/parisc/kernel/unwind.c b/arch/parisc/kernel/unwind.c
index 69dad5a850a8..a36799e85693 100644
--- a/arch/parisc/kernel/unwind.c
+++ b/arch/parisc/kernel/unwind.c
@@ -28,7 +28,7 @@
28#define dbg(x...) 28#define dbg(x...)
29#endif 29#endif
30 30
31#define KERNEL_START (KERNEL_BINARY_TEXT_START - 0x1000) 31#define KERNEL_START (KERNEL_BINARY_TEXT_START)
32 32
33extern struct unwind_table_entry __start___unwind[]; 33extern struct unwind_table_entry __start___unwind[];
34extern struct unwind_table_entry __stop___unwind[]; 34extern struct unwind_table_entry __stop___unwind[];
diff --git a/arch/parisc/kernel/vmlinux.lds.S b/arch/parisc/kernel/vmlinux.lds.S
index fda4baa059b5..9dab4a4e09f7 100644
--- a/arch/parisc/kernel/vmlinux.lds.S
+++ b/arch/parisc/kernel/vmlinux.lds.S
@@ -78,9 +78,6 @@ SECTIONS
78 */ 78 */
79 . = ALIGN(PAGE_SIZE); 79 . = ALIGN(PAGE_SIZE);
80 data_start = .; 80 data_start = .;
81 EXCEPTION_TABLE(16)
82
83 NOTES
84 81
85 /* unwind info */ 82 /* unwind info */
86 .PARISC.unwind : { 83 .PARISC.unwind : {
@@ -89,6 +86,9 @@ SECTIONS
89 __stop___unwind = .; 86 __stop___unwind = .;
90 } 87 }
91 88
89 EXCEPTION_TABLE(16)
90 NOTES
91
92 /* Data */ 92 /* Data */
93 RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE) 93 RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE)
94 94
diff --git a/arch/powerpc/Kconfig.debug b/arch/powerpc/Kconfig.debug
index 3b1005185390..bf3382f1904d 100644
--- a/arch/powerpc/Kconfig.debug
+++ b/arch/powerpc/Kconfig.debug
@@ -46,7 +46,7 @@ config DEBUG_STACK_USAGE
46 46
47config HCALL_STATS 47config HCALL_STATS
48 bool "Hypervisor call instrumentation" 48 bool "Hypervisor call instrumentation"
49 depends on PPC_PSERIES && DEBUG_FS 49 depends on PPC_PSERIES && DEBUG_FS && TRACEPOINTS
50 help 50 help
51 Adds code to keep track of the number of hypervisor calls made and 51 Adds code to keep track of the number of hypervisor calls made and
52 the amount of time spent in hypervisor calls. Wall time spent in 52 the amount of time spent in hypervisor calls. Wall time spent in
diff --git a/arch/powerpc/configs/pseries_defconfig b/arch/powerpc/configs/pseries_defconfig
index f1889abb89b1..c568329723b8 100644
--- a/arch/powerpc/configs/pseries_defconfig
+++ b/arch/powerpc/configs/pseries_defconfig
@@ -1683,7 +1683,7 @@ CONFIG_HAVE_ARCH_KGDB=y
1683CONFIG_DEBUG_STACKOVERFLOW=y 1683CONFIG_DEBUG_STACKOVERFLOW=y
1684# CONFIG_DEBUG_STACK_USAGE is not set 1684# CONFIG_DEBUG_STACK_USAGE is not set
1685# CONFIG_DEBUG_PAGEALLOC is not set 1685# CONFIG_DEBUG_PAGEALLOC is not set
1686CONFIG_HCALL_STATS=y 1686# CONFIG_HCALL_STATS is not set
1687# CONFIG_CODE_PATCHING_SELFTEST is not set 1687# CONFIG_CODE_PATCHING_SELFTEST is not set
1688# CONFIG_FTR_FIXUP_SELFTEST is not set 1688# CONFIG_FTR_FIXUP_SELFTEST is not set
1689# CONFIG_MSI_BITMAP_SELFTEST is not set 1689# CONFIG_MSI_BITMAP_SELFTEST is not set
diff --git a/arch/powerpc/include/asm/cacheflush.h b/arch/powerpc/include/asm/cacheflush.h
index ba667a383b8c..ab9e402518e8 100644
--- a/arch/powerpc/include/asm/cacheflush.h
+++ b/arch/powerpc/include/asm/cacheflush.h
@@ -25,6 +25,7 @@
25#define flush_cache_vmap(start, end) do { } while (0) 25#define flush_cache_vmap(start, end) do { } while (0)
26#define flush_cache_vunmap(start, end) do { } while (0) 26#define flush_cache_vunmap(start, end) do { } while (0)
27 27
28#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1
28extern void flush_dcache_page(struct page *page); 29extern void flush_dcache_page(struct page *page);
29#define flush_dcache_mmap_lock(mapping) do { } while (0) 30#define flush_dcache_mmap_lock(mapping) do { } while (0)
30#define flush_dcache_mmap_unlock(mapping) do { } while (0) 31#define flush_dcache_mmap_unlock(mapping) do { } while (0)
diff --git a/arch/powerpc/include/asm/emulated_ops.h b/arch/powerpc/include/asm/emulated_ops.h
index 9154e8526732..f0fb4fc1f6e6 100644
--- a/arch/powerpc/include/asm/emulated_ops.h
+++ b/arch/powerpc/include/asm/emulated_ops.h
@@ -19,6 +19,7 @@
19#define _ASM_POWERPC_EMULATED_OPS_H 19#define _ASM_POWERPC_EMULATED_OPS_H
20 20
21#include <asm/atomic.h> 21#include <asm/atomic.h>
22#include <linux/perf_event.h>
22 23
23 24
24#ifdef CONFIG_PPC_EMULATED_STATS 25#ifdef CONFIG_PPC_EMULATED_STATS
@@ -57,7 +58,7 @@ extern u32 ppc_warn_emulated;
57 58
58extern void ppc_warn_emulated_print(const char *type); 59extern void ppc_warn_emulated_print(const char *type);
59 60
60#define PPC_WARN_EMULATED(type) \ 61#define __PPC_WARN_EMULATED(type) \
61 do { \ 62 do { \
62 atomic_inc(&ppc_emulated.type.val); \ 63 atomic_inc(&ppc_emulated.type.val); \
63 if (ppc_warn_emulated) \ 64 if (ppc_warn_emulated) \
@@ -66,8 +67,22 @@ extern void ppc_warn_emulated_print(const char *type);
66 67
67#else /* !CONFIG_PPC_EMULATED_STATS */ 68#else /* !CONFIG_PPC_EMULATED_STATS */
68 69
69#define PPC_WARN_EMULATED(type) do { } while (0) 70#define __PPC_WARN_EMULATED(type) do { } while (0)
70 71
71#endif /* !CONFIG_PPC_EMULATED_STATS */ 72#endif /* !CONFIG_PPC_EMULATED_STATS */
72 73
74#define PPC_WARN_EMULATED(type, regs) \
75 do { \
76 perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, \
77 1, 0, regs, 0); \
78 __PPC_WARN_EMULATED(type); \
79 } while (0)
80
81#define PPC_WARN_ALIGNMENT(type, regs) \
82 do { \
83 perf_sw_event(PERF_COUNT_SW_ALIGNMENT_FAULTS, \
84 1, 0, regs, regs->dar); \
85 __PPC_WARN_EMULATED(type); \
86 } while (0)
87
73#endif /* _ASM_POWERPC_EMULATED_OPS_H */ 88#endif /* _ASM_POWERPC_EMULATED_OPS_H */
diff --git a/arch/powerpc/include/asm/hvcall.h b/arch/powerpc/include/asm/hvcall.h
index 6251a4b10be7..c27caac47ad1 100644
--- a/arch/powerpc/include/asm/hvcall.h
+++ b/arch/powerpc/include/asm/hvcall.h
@@ -274,6 +274,8 @@ struct hcall_stats {
274 unsigned long num_calls; /* number of calls (on this CPU) */ 274 unsigned long num_calls; /* number of calls (on this CPU) */
275 unsigned long tb_total; /* total wall time (mftb) of calls. */ 275 unsigned long tb_total; /* total wall time (mftb) of calls. */
276 unsigned long purr_total; /* total cpu time (PURR) of calls. */ 276 unsigned long purr_total; /* total cpu time (PURR) of calls. */
277 unsigned long tb_start;
278 unsigned long purr_start;
277}; 279};
278#define HCALL_STAT_ARRAY_SIZE ((MAX_HCALL_OPCODE >> 2) + 1) 280#define HCALL_STAT_ARRAY_SIZE ((MAX_HCALL_OPCODE >> 2) + 1)
279 281
diff --git a/arch/powerpc/include/asm/kmap_types.h b/arch/powerpc/include/asm/kmap_types.h
index b6bac6f61c16..916369575c97 100644
--- a/arch/powerpc/include/asm/kmap_types.h
+++ b/arch/powerpc/include/asm/kmap_types.h
@@ -29,5 +29,16 @@ enum km_type {
29 KM_TYPE_NR 29 KM_TYPE_NR
30}; 30};
31 31
32/*
33 * This is a temporary build fix that (so they say on lkml....) should no longer
34 * be required after 2.6.33, because of changes planned to the kmap code.
35 * Let's try to remove this cruft then.
36 */
37#ifdef CONFIG_DEBUG_HIGHMEM
38#define KM_NMI (-1)
39#define KM_NMI_PTE (-1)
40#define KM_IRQ_PTE (-1)
41#endif
42
32#endif /* __KERNEL__ */ 43#endif /* __KERNEL__ */
33#endif /* _ASM_POWERPC_KMAP_TYPES_H */ 44#endif /* _ASM_POWERPC_KMAP_TYPES_H */
diff --git a/arch/powerpc/include/asm/pmac_low_i2c.h b/arch/powerpc/include/asm/pmac_low_i2c.h
index 131011bd7e76..01d71826d92f 100644
--- a/arch/powerpc/include/asm/pmac_low_i2c.h
+++ b/arch/powerpc/include/asm/pmac_low_i2c.h
@@ -72,11 +72,7 @@ extern int pmac_i2c_get_type(struct pmac_i2c_bus *bus);
72extern int pmac_i2c_get_flags(struct pmac_i2c_bus *bus); 72extern int pmac_i2c_get_flags(struct pmac_i2c_bus *bus);
73extern int pmac_i2c_get_channel(struct pmac_i2c_bus *bus); 73extern int pmac_i2c_get_channel(struct pmac_i2c_bus *bus);
74 74
75/* i2c layer adapter attach/detach */ 75/* i2c layer adapter helpers */
76extern void pmac_i2c_attach_adapter(struct pmac_i2c_bus *bus,
77 struct i2c_adapter *adapter);
78extern void pmac_i2c_detach_adapter(struct pmac_i2c_bus *bus,
79 struct i2c_adapter *adapter);
80extern struct i2c_adapter *pmac_i2c_get_adapter(struct pmac_i2c_bus *bus); 76extern struct i2c_adapter *pmac_i2c_get_adapter(struct pmac_i2c_bus *bus);
81extern struct pmac_i2c_bus *pmac_i2c_adapter_to_bus(struct i2c_adapter *adapter); 77extern struct pmac_i2c_bus *pmac_i2c_adapter_to_bus(struct i2c_adapter *adapter);
82 78
diff --git a/arch/powerpc/include/asm/prom.h b/arch/powerpc/include/asm/prom.h
index 6ff04185d2aa..2ab9cbd98826 100644
--- a/arch/powerpc/include/asm/prom.h
+++ b/arch/powerpc/include/asm/prom.h
@@ -1,3 +1,4 @@
1#include <linux/of.h> /* linux/of.h gets to determine #include ordering */
1#ifndef _POWERPC_PROM_H 2#ifndef _POWERPC_PROM_H
2#define _POWERPC_PROM_H 3#define _POWERPC_PROM_H
3#ifdef __KERNEL__ 4#ifdef __KERNEL__
@@ -16,6 +17,7 @@
16 * 2 of the License, or (at your option) any later version. 17 * 2 of the License, or (at your option) any later version.
17 */ 18 */
18#include <linux/types.h> 19#include <linux/types.h>
20#include <linux/of_fdt.h>
19#include <linux/proc_fs.h> 21#include <linux/proc_fs.h>
20#include <linux/platform_device.h> 22#include <linux/platform_device.h>
21#include <asm/irq.h> 23#include <asm/irq.h>
@@ -28,133 +30,14 @@
28#define of_prop_cmp(s1, s2) strcmp((s1), (s2)) 30#define of_prop_cmp(s1, s2) strcmp((s1), (s2))
29#define of_node_cmp(s1, s2) strcasecmp((s1), (s2)) 31#define of_node_cmp(s1, s2) strcasecmp((s1), (s2))
30 32
31/* Definitions used by the flattened device tree */
32#define OF_DT_HEADER 0xd00dfeed /* marker */
33#define OF_DT_BEGIN_NODE 0x1 /* Start of node, full name */
34#define OF_DT_END_NODE 0x2 /* End node */
35#define OF_DT_PROP 0x3 /* Property: name off, size,
36 * content */
37#define OF_DT_NOP 0x4 /* nop */
38#define OF_DT_END 0x9
39
40#define OF_DT_VERSION 0x10
41
42/*
43 * This is what gets passed to the kernel by prom_init or kexec
44 *
45 * The dt struct contains the device tree structure, full pathes and
46 * property contents. The dt strings contain a separate block with just
47 * the strings for the property names, and is fully page aligned and
48 * self contained in a page, so that it can be kept around by the kernel,
49 * each property name appears only once in this page (cheap compression)
50 *
51 * the mem_rsvmap contains a map of reserved ranges of physical memory,
52 * passing it here instead of in the device-tree itself greatly simplifies
53 * the job of everybody. It's just a list of u64 pairs (base/size) that
54 * ends when size is 0
55 */
56struct boot_param_header
57{
58 u32 magic; /* magic word OF_DT_HEADER */
59 u32 totalsize; /* total size of DT block */
60 u32 off_dt_struct; /* offset to structure */
61 u32 off_dt_strings; /* offset to strings */
62 u32 off_mem_rsvmap; /* offset to memory reserve map */
63 u32 version; /* format version */
64 u32 last_comp_version; /* last compatible version */
65 /* version 2 fields below */
66 u32 boot_cpuid_phys; /* Physical CPU id we're booting on */
67 /* version 3 fields below */
68 u32 dt_strings_size; /* size of the DT strings block */
69 /* version 17 fields below */
70 u32 dt_struct_size; /* size of the DT structure block */
71};
72
73
74
75typedef u32 phandle;
76typedef u32 ihandle;
77
78struct property {
79 char *name;
80 int length;
81 void *value;
82 struct property *next;
83};
84
85struct device_node {
86 const char *name;
87 const char *type;
88 phandle node;
89 phandle linux_phandle;
90 char *full_name;
91
92 struct property *properties;
93 struct property *deadprops; /* removed properties */
94 struct device_node *parent;
95 struct device_node *child;
96 struct device_node *sibling;
97 struct device_node *next; /* next device of same type */
98 struct device_node *allnext; /* next in list of all nodes */
99 struct proc_dir_entry *pde; /* this node's proc directory */
100 struct kref kref;
101 unsigned long _flags;
102 void *data;
103};
104
105extern struct device_node *of_chosen; 33extern struct device_node *of_chosen;
106 34
107static inline int of_node_check_flag(struct device_node *n, unsigned long flag)
108{
109 return test_bit(flag, &n->_flags);
110}
111
112static inline void of_node_set_flag(struct device_node *n, unsigned long flag)
113{
114 set_bit(flag, &n->_flags);
115}
116
117
118#define HAVE_ARCH_DEVTREE_FIXUPS 35#define HAVE_ARCH_DEVTREE_FIXUPS
119 36
120static inline void set_node_proc_entry(struct device_node *dn, struct proc_dir_entry *de)
121{
122 dn->pde = de;
123}
124
125
126extern struct device_node *of_find_all_nodes(struct device_node *prev);
127extern struct device_node *of_node_get(struct device_node *node);
128extern void of_node_put(struct device_node *node);
129
130/* For scanning the flat device-tree at boot time */
131extern int __init of_scan_flat_dt(int (*it)(unsigned long node,
132 const char *uname, int depth,
133 void *data),
134 void *data);
135extern void* __init of_get_flat_dt_prop(unsigned long node, const char *name,
136 unsigned long *size);
137extern int __init of_flat_dt_is_compatible(unsigned long node, const char *name);
138extern unsigned long __init of_get_flat_dt_root(void);
139
140/* For updating the device tree at runtime */ 37/* For updating the device tree at runtime */
141extern void of_attach_node(struct device_node *); 38extern void of_attach_node(struct device_node *);
142extern void of_detach_node(struct device_node *); 39extern void of_detach_node(struct device_node *);
143 40
144/* Other Prototypes */
145extern void finish_device_tree(void);
146extern void unflatten_device_tree(void);
147extern void early_init_devtree(void *);
148extern int machine_is_compatible(const char *compat);
149extern void print_properties(struct device_node *node);
150extern int prom_n_intr_cells(struct device_node* np);
151extern void prom_get_irq_senses(unsigned char *senses, int off, int max);
152extern int prom_add_property(struct device_node* np, struct property* prop);
153extern int prom_remove_property(struct device_node *np, struct property *prop);
154extern int prom_update_property(struct device_node *np,
155 struct property *newprop,
156 struct property *oldprop);
157
158#ifdef CONFIG_PPC32 41#ifdef CONFIG_PPC32
159/* 42/*
160 * PCI <-> OF matching functions 43 * PCI <-> OF matching functions
@@ -178,26 +61,6 @@ extern int release_OF_resource(struct device_node* node, int index);
178 * OF address retreival & translation 61 * OF address retreival & translation
179 */ 62 */
180 63
181
182/* Helper to read a big number; size is in cells (not bytes) */
183static inline u64 of_read_number(const u32 *cell, int size)
184{
185 u64 r = 0;
186 while (size--)
187 r = (r << 32) | *(cell++);
188 return r;
189}
190
191/* Like of_read_number, but we want an unsigned long result */
192#ifdef CONFIG_PPC32
193static inline unsigned long of_read_ulong(const u32 *cell, int size)
194{
195 return cell[size-1];
196}
197#else
198#define of_read_ulong(cell, size) of_read_number(cell, size)
199#endif
200
201/* Translate an OF address block into a CPU physical address 64/* Translate an OF address block into a CPU physical address
202 */ 65 */
203extern u64 of_translate_address(struct device_node *np, const u32 *addr); 66extern u64 of_translate_address(struct device_node *np, const u32 *addr);
@@ -349,11 +212,5 @@ extern int of_irq_to_resource(struct device_node *dev, int index,
349 */ 212 */
350extern void __iomem *of_iomap(struct device_node *device, int index); 213extern void __iomem *of_iomap(struct device_node *device, int index);
351 214
352/*
353 * NB: This is here while we transition from using asm/prom.h
354 * to linux/of.h
355 */
356#include <linux/of.h>
357
358#endif /* __KERNEL__ */ 215#endif /* __KERNEL__ */
359#endif /* _POWERPC_PROM_H */ 216#endif /* _POWERPC_PROM_H */
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
index 6315edc205d8..bc8dd53f718a 100644
--- a/arch/powerpc/include/asm/reg.h
+++ b/arch/powerpc/include/asm/reg.h
@@ -489,6 +489,8 @@
489#define SPRN_MMCR1 798 489#define SPRN_MMCR1 798
490#define SPRN_MMCRA 0x312 490#define SPRN_MMCRA 0x312
491#define MMCRA_SDSYNC 0x80000000UL /* SDAR synced with SIAR */ 491#define MMCRA_SDSYNC 0x80000000UL /* SDAR synced with SIAR */
492#define MMCRA_SDAR_DCACHE_MISS 0x40000000UL
493#define MMCRA_SDAR_ERAT_MISS 0x20000000UL
492#define MMCRA_SIHV 0x10000000UL /* state of MSR HV when SIAR set */ 494#define MMCRA_SIHV 0x10000000UL /* state of MSR HV when SIAR set */
493#define MMCRA_SIPR 0x08000000UL /* state of MSR PR when SIAR set */ 495#define MMCRA_SIPR 0x08000000UL /* state of MSR PR when SIAR set */
494#define MMCRA_SLOT 0x07000000UL /* SLOT bits (37-39) */ 496#define MMCRA_SLOT 0x07000000UL /* SLOT bits (37-39) */
diff --git a/arch/powerpc/include/asm/socket.h b/arch/powerpc/include/asm/socket.h
index 3ab8b3e6feb0..866f7606da68 100644
--- a/arch/powerpc/include/asm/socket.h
+++ b/arch/powerpc/include/asm/socket.h
@@ -67,4 +67,6 @@
67#define SO_PROTOCOL 38 67#define SO_PROTOCOL 38
68#define SO_DOMAIN 39 68#define SO_DOMAIN 39
69 69
70#define SO_RXQ_OVFL 40
71
70#endif /* _ASM_POWERPC_SOCKET_H */ 72#endif /* _ASM_POWERPC_SOCKET_H */
diff --git a/arch/powerpc/include/asm/trace.h b/arch/powerpc/include/asm/trace.h
new file mode 100644
index 000000000000..cbe2297d68b6
--- /dev/null
+++ b/arch/powerpc/include/asm/trace.h
@@ -0,0 +1,133 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM powerpc
3
4#if !defined(_TRACE_POWERPC_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_POWERPC_H
6
7#include <linux/tracepoint.h>
8
9struct pt_regs;
10
11TRACE_EVENT(irq_entry,
12
13 TP_PROTO(struct pt_regs *regs),
14
15 TP_ARGS(regs),
16
17 TP_STRUCT__entry(
18 __field(struct pt_regs *, regs)
19 ),
20
21 TP_fast_assign(
22 __entry->regs = regs;
23 ),
24
25 TP_printk("pt_regs=%p", __entry->regs)
26);
27
28TRACE_EVENT(irq_exit,
29
30 TP_PROTO(struct pt_regs *regs),
31
32 TP_ARGS(regs),
33
34 TP_STRUCT__entry(
35 __field(struct pt_regs *, regs)
36 ),
37
38 TP_fast_assign(
39 __entry->regs = regs;
40 ),
41
42 TP_printk("pt_regs=%p", __entry->regs)
43);
44
45TRACE_EVENT(timer_interrupt_entry,
46
47 TP_PROTO(struct pt_regs *regs),
48
49 TP_ARGS(regs),
50
51 TP_STRUCT__entry(
52 __field(struct pt_regs *, regs)
53 ),
54
55 TP_fast_assign(
56 __entry->regs = regs;
57 ),
58
59 TP_printk("pt_regs=%p", __entry->regs)
60);
61
62TRACE_EVENT(timer_interrupt_exit,
63
64 TP_PROTO(struct pt_regs *regs),
65
66 TP_ARGS(regs),
67
68 TP_STRUCT__entry(
69 __field(struct pt_regs *, regs)
70 ),
71
72 TP_fast_assign(
73 __entry->regs = regs;
74 ),
75
76 TP_printk("pt_regs=%p", __entry->regs)
77);
78
79#ifdef CONFIG_PPC_PSERIES
80extern void hcall_tracepoint_regfunc(void);
81extern void hcall_tracepoint_unregfunc(void);
82
83TRACE_EVENT_FN(hcall_entry,
84
85 TP_PROTO(unsigned long opcode, unsigned long *args),
86
87 TP_ARGS(opcode, args),
88
89 TP_STRUCT__entry(
90 __field(unsigned long, opcode)
91 ),
92
93 TP_fast_assign(
94 __entry->opcode = opcode;
95 ),
96
97 TP_printk("opcode=%lu", __entry->opcode),
98
99 hcall_tracepoint_regfunc, hcall_tracepoint_unregfunc
100);
101
102TRACE_EVENT_FN(hcall_exit,
103
104 TP_PROTO(unsigned long opcode, unsigned long retval,
105 unsigned long *retbuf),
106
107 TP_ARGS(opcode, retval, retbuf),
108
109 TP_STRUCT__entry(
110 __field(unsigned long, opcode)
111 __field(unsigned long, retval)
112 ),
113
114 TP_fast_assign(
115 __entry->opcode = opcode;
116 __entry->retval = retval;
117 ),
118
119 TP_printk("opcode=%lu retval=%lu", __entry->opcode, __entry->retval),
120
121 hcall_tracepoint_regfunc, hcall_tracepoint_unregfunc
122);
123#endif
124
125#endif /* _TRACE_POWERPC_H */
126
127#undef TRACE_INCLUDE_PATH
128#undef TRACE_INCLUDE_FILE
129
130#define TRACE_INCLUDE_PATH asm
131#define TRACE_INCLUDE_FILE trace
132
133#include <trace/define_trace.h>
diff --git a/arch/powerpc/kernel/align.c b/arch/powerpc/kernel/align.c
index a5b632e52fae..3839839f83c7 100644
--- a/arch/powerpc/kernel/align.c
+++ b/arch/powerpc/kernel/align.c
@@ -732,7 +732,7 @@ int fix_alignment(struct pt_regs *regs)
732 732
733#ifdef CONFIG_SPE 733#ifdef CONFIG_SPE
734 if ((instr >> 26) == 0x4) { 734 if ((instr >> 26) == 0x4) {
735 PPC_WARN_EMULATED(spe); 735 PPC_WARN_ALIGNMENT(spe, regs);
736 return emulate_spe(regs, reg, instr); 736 return emulate_spe(regs, reg, instr);
737 } 737 }
738#endif 738#endif
@@ -786,7 +786,7 @@ int fix_alignment(struct pt_regs *regs)
786 flags |= SPLT; 786 flags |= SPLT;
787 nb = 8; 787 nb = 8;
788 } 788 }
789 PPC_WARN_EMULATED(vsx); 789 PPC_WARN_ALIGNMENT(vsx, regs);
790 return emulate_vsx(addr, reg, areg, regs, flags, nb); 790 return emulate_vsx(addr, reg, areg, regs, flags, nb);
791 } 791 }
792#endif 792#endif
@@ -794,7 +794,7 @@ int fix_alignment(struct pt_regs *regs)
794 * the exception of DCBZ which is handled as a special case here 794 * the exception of DCBZ which is handled as a special case here
795 */ 795 */
796 if (instr == DCBZ) { 796 if (instr == DCBZ) {
797 PPC_WARN_EMULATED(dcbz); 797 PPC_WARN_ALIGNMENT(dcbz, regs);
798 return emulate_dcbz(regs, addr); 798 return emulate_dcbz(regs, addr);
799 } 799 }
800 if (unlikely(nb == 0)) 800 if (unlikely(nb == 0))
@@ -804,7 +804,7 @@ int fix_alignment(struct pt_regs *regs)
804 * function 804 * function
805 */ 805 */
806 if (flags & M) { 806 if (flags & M) {
807 PPC_WARN_EMULATED(multiple); 807 PPC_WARN_ALIGNMENT(multiple, regs);
808 return emulate_multiple(regs, addr, reg, nb, 808 return emulate_multiple(regs, addr, reg, nb,
809 flags, instr, swiz); 809 flags, instr, swiz);
810 } 810 }
@@ -825,11 +825,11 @@ int fix_alignment(struct pt_regs *regs)
825 825
826 /* Special case for 16-byte FP loads and stores */ 826 /* Special case for 16-byte FP loads and stores */
827 if (nb == 16) { 827 if (nb == 16) {
828 PPC_WARN_EMULATED(fp_pair); 828 PPC_WARN_ALIGNMENT(fp_pair, regs);
829 return emulate_fp_pair(addr, reg, flags); 829 return emulate_fp_pair(addr, reg, flags);
830 } 830 }
831 831
832 PPC_WARN_EMULATED(unaligned); 832 PPC_WARN_ALIGNMENT(unaligned, regs);
833 833
834 /* If we are loading, get the data from user space, else 834 /* If we are loading, get the data from user space, else
835 * get it from register values 835 * get it from register values
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
index 9763267e38b4..bdcb557d470a 100644
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -551,7 +551,7 @@ restore:
551BEGIN_FW_FTR_SECTION 551BEGIN_FW_FTR_SECTION
552 ld r5,SOFTE(r1) 552 ld r5,SOFTE(r1)
553FW_FTR_SECTION_ELSE 553FW_FTR_SECTION_ELSE
554 b iseries_check_pending_irqs 554 b .Liseries_check_pending_irqs
555ALT_FW_FTR_SECTION_END_IFCLR(FW_FEATURE_ISERIES) 555ALT_FW_FTR_SECTION_END_IFCLR(FW_FEATURE_ISERIES)
5562: 5562:
557 TRACE_AND_RESTORE_IRQ(r5); 557 TRACE_AND_RESTORE_IRQ(r5);
@@ -623,7 +623,7 @@ ALT_FW_FTR_SECTION_END_IFCLR(FW_FEATURE_ISERIES)
623 623
624#endif /* CONFIG_PPC_BOOK3E */ 624#endif /* CONFIG_PPC_BOOK3E */
625 625
626iseries_check_pending_irqs: 626.Liseries_check_pending_irqs:
627#ifdef CONFIG_PPC_ISERIES 627#ifdef CONFIG_PPC_ISERIES
628 ld r5,SOFTE(r1) 628 ld r5,SOFTE(r1)
629 cmpdi 0,r5,0 629 cmpdi 0,r5,0
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
index 1808876edcc9..c7eb4e0eb86c 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -185,12 +185,15 @@ END_FTR_SECTION_IFSET(CPU_FTR_REAL_LE)
185 * prolog code of the PerformanceMonitor one. A little 185 * prolog code of the PerformanceMonitor one. A little
186 * trickery is thus necessary 186 * trickery is thus necessary
187 */ 187 */
188performance_monitor_pSeries_1:
188 . = 0xf00 189 . = 0xf00
189 b performance_monitor_pSeries 190 b performance_monitor_pSeries
190 191
192altivec_unavailable_pSeries_1:
191 . = 0xf20 193 . = 0xf20
192 b altivec_unavailable_pSeries 194 b altivec_unavailable_pSeries
193 195
196vsx_unavailable_pSeries_1:
194 . = 0xf40 197 . = 0xf40
195 b vsx_unavailable_pSeries 198 b vsx_unavailable_pSeries
196 199
diff --git a/arch/powerpc/kernel/idle.c b/arch/powerpc/kernel/idle.c
index 88d9c1d5e5fb..049dda60e475 100644
--- a/arch/powerpc/kernel/idle.c
+++ b/arch/powerpc/kernel/idle.c
@@ -110,18 +110,16 @@ int powersave_nap;
110 */ 110 */
111static ctl_table powersave_nap_ctl_table[]={ 111static ctl_table powersave_nap_ctl_table[]={
112 { 112 {
113 .ctl_name = KERN_PPC_POWERSAVE_NAP,
114 .procname = "powersave-nap", 113 .procname = "powersave-nap",
115 .data = &powersave_nap, 114 .data = &powersave_nap,
116 .maxlen = sizeof(int), 115 .maxlen = sizeof(int),
117 .mode = 0644, 116 .mode = 0644,
118 .proc_handler = &proc_dointvec, 117 .proc_handler = proc_dointvec,
119 }, 118 },
120 {} 119 {}
121}; 120};
122static ctl_table powersave_nap_sysctl_root[] = { 121static ctl_table powersave_nap_sysctl_root[] = {
123 { 122 {
124 .ctl_name = CTL_KERN,
125 .procname = "kernel", 123 .procname = "kernel",
126 .mode = 0555, 124 .mode = 0555,
127 .child = powersave_nap_ctl_table, 125 .child = powersave_nap_ctl_table,
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index e5d121177984..02a334662cc0 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -70,6 +70,8 @@
70#include <asm/firmware.h> 70#include <asm/firmware.h>
71#include <asm/lv1call.h> 71#include <asm/lv1call.h>
72#endif 72#endif
73#define CREATE_TRACE_POINTS
74#include <asm/trace.h>
73 75
74int __irq_offset_value; 76int __irq_offset_value;
75static int ppc_spurious_interrupts; 77static int ppc_spurious_interrupts;
@@ -325,6 +327,8 @@ void do_IRQ(struct pt_regs *regs)
325 struct pt_regs *old_regs = set_irq_regs(regs); 327 struct pt_regs *old_regs = set_irq_regs(regs);
326 unsigned int irq; 328 unsigned int irq;
327 329
330 trace_irq_entry(regs);
331
328 irq_enter(); 332 irq_enter();
329 333
330 check_stack_overflow(); 334 check_stack_overflow();
@@ -348,6 +352,8 @@ void do_IRQ(struct pt_regs *regs)
348 timer_interrupt(regs); 352 timer_interrupt(regs);
349 } 353 }
350#endif 354#endif
355
356 trace_irq_exit(regs);
351} 357}
352 358
353void __init init_IRQ(void) 359void __init init_IRQ(void)
diff --git a/arch/powerpc/kernel/perf_event.c b/arch/powerpc/kernel/perf_event.c
index 87f1663584b0..1eb85fbf53a5 100644
--- a/arch/powerpc/kernel/perf_event.c
+++ b/arch/powerpc/kernel/perf_event.c
@@ -1165,7 +1165,7 @@ static void record_and_restart(struct perf_event *event, unsigned long val,
1165 */ 1165 */
1166 if (record) { 1166 if (record) {
1167 struct perf_sample_data data = { 1167 struct perf_sample_data data = {
1168 .addr = 0, 1168 .addr = ~0ULL,
1169 .period = event->hw.last_period, 1169 .period = event->hw.last_period,
1170 }; 1170 };
1171 1171
diff --git a/arch/powerpc/kernel/power5+-pmu.c b/arch/powerpc/kernel/power5+-pmu.c
index 0f4c1c73a6ad..199de527d411 100644
--- a/arch/powerpc/kernel/power5+-pmu.c
+++ b/arch/powerpc/kernel/power5+-pmu.c
@@ -73,10 +73,6 @@
73#define MMCR1_PMCSEL_MSK 0x7f 73#define MMCR1_PMCSEL_MSK 0x7f
74 74
75/* 75/*
76 * Bits in MMCRA
77 */
78
79/*
80 * Layout of constraint bits: 76 * Layout of constraint bits:
81 * 6666555555555544444444443333333333222222222211111111110000000000 77 * 6666555555555544444444443333333333222222222211111111110000000000
82 * 3210987654321098765432109876543210987654321098765432109876543210 78 * 3210987654321098765432109876543210987654321098765432109876543210
diff --git a/arch/powerpc/kernel/power5-pmu.c b/arch/powerpc/kernel/power5-pmu.c
index c351b3a57fbb..98b6a729a9dd 100644
--- a/arch/powerpc/kernel/power5-pmu.c
+++ b/arch/powerpc/kernel/power5-pmu.c
@@ -73,10 +73,6 @@
73#define MMCR1_PMCSEL_MSK 0x7f 73#define MMCR1_PMCSEL_MSK 0x7f
74 74
75/* 75/*
76 * Bits in MMCRA
77 */
78
79/*
80 * Layout of constraint bits: 76 * Layout of constraint bits:
81 * 6666555555555544444444443333333333222222222211111111110000000000 77 * 6666555555555544444444443333333333222222222211111111110000000000
82 * 3210987654321098765432109876543210987654321098765432109876543210 78 * 3210987654321098765432109876543210987654321098765432109876543210
@@ -390,7 +386,7 @@ static int power5_compute_mmcr(u64 event[], int n_ev,
390 unsigned int hwc[], unsigned long mmcr[]) 386 unsigned int hwc[], unsigned long mmcr[])
391{ 387{
392 unsigned long mmcr1 = 0; 388 unsigned long mmcr1 = 0;
393 unsigned long mmcra = 0; 389 unsigned long mmcra = MMCRA_SDAR_DCACHE_MISS | MMCRA_SDAR_ERAT_MISS;
394 unsigned int pmc, unit, byte, psel; 390 unsigned int pmc, unit, byte, psel;
395 unsigned int ttm, grp; 391 unsigned int ttm, grp;
396 int i, isbus, bit, grsel; 392 int i, isbus, bit, grsel;
diff --git a/arch/powerpc/kernel/power6-pmu.c b/arch/powerpc/kernel/power6-pmu.c
index ca399ba5034c..84a607bda8fb 100644
--- a/arch/powerpc/kernel/power6-pmu.c
+++ b/arch/powerpc/kernel/power6-pmu.c
@@ -178,7 +178,7 @@ static int p6_compute_mmcr(u64 event[], int n_ev,
178 unsigned int hwc[], unsigned long mmcr[]) 178 unsigned int hwc[], unsigned long mmcr[])
179{ 179{
180 unsigned long mmcr1 = 0; 180 unsigned long mmcr1 = 0;
181 unsigned long mmcra = 0; 181 unsigned long mmcra = MMCRA_SDAR_DCACHE_MISS | MMCRA_SDAR_ERAT_MISS;
182 int i; 182 int i;
183 unsigned int pmc, ev, b, u, s, psel; 183 unsigned int pmc, ev, b, u, s, psel;
184 unsigned int ttmset = 0; 184 unsigned int ttmset = 0;
diff --git a/arch/powerpc/kernel/power7-pmu.c b/arch/powerpc/kernel/power7-pmu.c
index 28a4daacdc02..852f7b7f6b40 100644
--- a/arch/powerpc/kernel/power7-pmu.c
+++ b/arch/powerpc/kernel/power7-pmu.c
@@ -51,10 +51,6 @@
51#define MMCR1_PMCSEL_MSK 0xff 51#define MMCR1_PMCSEL_MSK 0xff
52 52
53/* 53/*
54 * Bits in MMCRA
55 */
56
57/*
58 * Layout of constraint bits: 54 * Layout of constraint bits:
59 * 6666555555555544444444443333333333222222222211111111110000000000 55 * 6666555555555544444444443333333333222222222211111111110000000000
60 * 3210987654321098765432109876543210987654321098765432109876543210 56 * 3210987654321098765432109876543210987654321098765432109876543210
@@ -230,7 +226,7 @@ static int power7_compute_mmcr(u64 event[], int n_ev,
230 unsigned int hwc[], unsigned long mmcr[]) 226 unsigned int hwc[], unsigned long mmcr[])
231{ 227{
232 unsigned long mmcr1 = 0; 228 unsigned long mmcr1 = 0;
233 unsigned long mmcra = 0; 229 unsigned long mmcra = MMCRA_SDAR_DCACHE_MISS | MMCRA_SDAR_ERAT_MISS;
234 unsigned int pmc, unit, combine, l2sel, psel; 230 unsigned int pmc, unit, combine, l2sel, psel;
235 unsigned int pmc_inuse = 0; 231 unsigned int pmc_inuse = 0;
236 int i; 232 int i;
diff --git a/arch/powerpc/kernel/ppc970-pmu.c b/arch/powerpc/kernel/ppc970-pmu.c
index 479574413a93..8eff48e20dba 100644
--- a/arch/powerpc/kernel/ppc970-pmu.c
+++ b/arch/powerpc/kernel/ppc970-pmu.c
@@ -84,10 +84,6 @@ static short mmcr1_adder_bits[8] = {
84}; 84};
85 85
86/* 86/*
87 * Bits in MMCRA
88 */
89
90/*
91 * Layout of constraint bits: 87 * Layout of constraint bits:
92 * 6666555555555544444444443333333333222222222211111111110000000000 88 * 6666555555555544444444443333333333222222222211111111110000000000
93 * 3210987654321098765432109876543210987654321098765432109876543210 89 * 3210987654321098765432109876543210987654321098765432109876543210
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index d4405b95bfaa..4ec300862466 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -1317,29 +1317,6 @@ struct device_node *of_find_next_cache_node(struct device_node *np)
1317} 1317}
1318 1318
1319/** 1319/**
1320 * of_find_all_nodes - Get next node in global list
1321 * @prev: Previous node or NULL to start iteration
1322 * of_node_put() will be called on it
1323 *
1324 * Returns a node pointer with refcount incremented, use
1325 * of_node_put() on it when done.
1326 */
1327struct device_node *of_find_all_nodes(struct device_node *prev)
1328{
1329 struct device_node *np;
1330
1331 read_lock(&devtree_lock);
1332 np = prev ? prev->allnext : allnodes;
1333 for (; np != 0; np = np->allnext)
1334 if (of_node_get(np))
1335 break;
1336 of_node_put(prev);
1337 read_unlock(&devtree_lock);
1338 return np;
1339}
1340EXPORT_SYMBOL(of_find_all_nodes);
1341
1342/**
1343 * of_node_get - Increment refcount of a node 1320 * of_node_get - Increment refcount of a node
1344 * @node: Node to inc refcount, NULL is supported to 1321 * @node: Node to inc refcount, NULL is supported to
1345 * simplify writing of callers 1322 * simplify writing of callers
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index 4271f7a655a3..845c72ab7357 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -660,6 +660,7 @@ late_initcall(check_cache_coherency);
660 660
661#ifdef CONFIG_DEBUG_FS 661#ifdef CONFIG_DEBUG_FS
662struct dentry *powerpc_debugfs_root; 662struct dentry *powerpc_debugfs_root;
663EXPORT_SYMBOL(powerpc_debugfs_root);
663 664
664static int powerpc_debugfs_init(void) 665static int powerpc_debugfs_init(void)
665{ 666{
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index 53bcf3d792db..b152de3e64d4 100644
--- a/arch/powerpc/kernel/setup_32.c
+++ b/arch/powerpc/kernel/setup_32.c
@@ -345,7 +345,7 @@ void __init setup_arch(char **cmdline_p)
345 345
346#ifdef CONFIG_SWIOTLB 346#ifdef CONFIG_SWIOTLB
347 if (ppc_swiotlb_enable) 347 if (ppc_swiotlb_enable)
348 swiotlb_init(); 348 swiotlb_init(1);
349#endif 349#endif
350 350
351 paging_init(); 351 paging_init();
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 04f638d82fb3..df2c9e932b37 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -550,7 +550,7 @@ void __init setup_arch(char **cmdline_p)
550 550
551#ifdef CONFIG_SWIOTLB 551#ifdef CONFIG_SWIOTLB
552 if (ppc_swiotlb_enable) 552 if (ppc_swiotlb_enable)
553 swiotlb_init(); 553 swiotlb_init(1);
554#endif 554#endif
555 555
556 paging_init(); 556 paging_init();
diff --git a/arch/powerpc/kernel/sys_ppc32.c b/arch/powerpc/kernel/sys_ppc32.c
index b97c2d67f4ac..c5a4732bcc48 100644
--- a/arch/powerpc/kernel/sys_ppc32.c
+++ b/arch/powerpc/kernel/sys_ppc32.c
@@ -520,58 +520,6 @@ asmlinkage long compat_sys_umask(u32 mask)
520 return sys_umask((int)mask); 520 return sys_umask((int)mask);
521} 521}
522 522
523#ifdef CONFIG_SYSCTL_SYSCALL
524struct __sysctl_args32 {
525 u32 name;
526 int nlen;
527 u32 oldval;
528 u32 oldlenp;
529 u32 newval;
530 u32 newlen;
531 u32 __unused[4];
532};
533
534asmlinkage long compat_sys_sysctl(struct __sysctl_args32 __user *args)
535{
536 struct __sysctl_args32 tmp;
537 int error;
538 size_t oldlen;
539 size_t __user *oldlenp = NULL;
540 unsigned long addr = (((unsigned long)&args->__unused[0]) + 7) & ~7;
541
542 if (copy_from_user(&tmp, args, sizeof(tmp)))
543 return -EFAULT;
544
545 if (tmp.oldval && tmp.oldlenp) {
546 /* Duh, this is ugly and might not work if sysctl_args
547 is in read-only memory, but do_sysctl does indirectly
548 a lot of uaccess in both directions and we'd have to
549 basically copy the whole sysctl.c here, and
550 glibc's __sysctl uses rw memory for the structure
551 anyway. */
552 oldlenp = (size_t __user *)addr;
553 if (get_user(oldlen, (compat_size_t __user *)compat_ptr(tmp.oldlenp)) ||
554 put_user(oldlen, oldlenp))
555 return -EFAULT;
556 }
557
558 lock_kernel();
559 error = do_sysctl(compat_ptr(tmp.name), tmp.nlen,
560 compat_ptr(tmp.oldval), oldlenp,
561 compat_ptr(tmp.newval), tmp.newlen);
562 unlock_kernel();
563 if (oldlenp) {
564 if (!error) {
565 if (get_user(oldlen, oldlenp) ||
566 put_user(oldlen, (compat_size_t __user *)compat_ptr(tmp.oldlenp)))
567 error = -EFAULT;
568 }
569 copy_to_user(args->__unused, tmp.__unused, sizeof(tmp.__unused));
570 }
571 return error;
572}
573#endif
574
575unsigned long compat_sys_mmap2(unsigned long addr, size_t len, 523unsigned long compat_sys_mmap2(unsigned long addr, size_t len,
576 unsigned long prot, unsigned long flags, 524 unsigned long prot, unsigned long flags,
577 unsigned long fd, unsigned long pgoff) 525 unsigned long fd, unsigned long pgoff)
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index a136a11c490d..674800b242d6 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -54,6 +54,7 @@
54#include <linux/irq.h> 54#include <linux/irq.h>
55#include <linux/delay.h> 55#include <linux/delay.h>
56#include <linux/perf_event.h> 56#include <linux/perf_event.h>
57#include <asm/trace.h>
57 58
58#include <asm/io.h> 59#include <asm/io.h>
59#include <asm/processor.h> 60#include <asm/processor.h>
@@ -571,6 +572,8 @@ void timer_interrupt(struct pt_regs * regs)
571 struct clock_event_device *evt = &decrementer->event; 572 struct clock_event_device *evt = &decrementer->event;
572 u64 now; 573 u64 now;
573 574
575 trace_timer_interrupt_entry(regs);
576
574 /* Ensure a positive value is written to the decrementer, or else 577 /* Ensure a positive value is written to the decrementer, or else
575 * some CPUs will continuue to take decrementer exceptions */ 578 * some CPUs will continuue to take decrementer exceptions */
576 set_dec(DECREMENTER_MAX); 579 set_dec(DECREMENTER_MAX);
@@ -590,6 +593,7 @@ void timer_interrupt(struct pt_regs * regs)
590 now = decrementer->next_tb - now; 593 now = decrementer->next_tb - now;
591 if (now <= DECREMENTER_MAX) 594 if (now <= DECREMENTER_MAX)
592 set_dec((int)now); 595 set_dec((int)now);
596 trace_timer_interrupt_exit(regs);
593 return; 597 return;
594 } 598 }
595 old_regs = set_irq_regs(regs); 599 old_regs = set_irq_regs(regs);
@@ -620,6 +624,8 @@ void timer_interrupt(struct pt_regs * regs)
620 624
621 irq_exit(); 625 irq_exit();
622 set_irq_regs(old_regs); 626 set_irq_regs(old_regs);
627
628 trace_timer_interrupt_exit(regs);
623} 629}
624 630
625void wakeup_decrementer(void) 631void wakeup_decrementer(void)
@@ -828,7 +834,8 @@ static cycle_t timebase_read(struct clocksource *cs)
828 return (cycle_t)get_tb(); 834 return (cycle_t)get_tb();
829} 835}
830 836
831void update_vsyscall(struct timespec *wall_time, struct clocksource *clock) 837void update_vsyscall(struct timespec *wall_time, struct clocksource *clock,
838 u32 mult)
832{ 839{
833 u64 t2x, stamp_xsec; 840 u64 t2x, stamp_xsec;
834 841
@@ -841,7 +848,7 @@ void update_vsyscall(struct timespec *wall_time, struct clocksource *clock)
841 848
842 /* XXX this assumes clock->shift == 22 */ 849 /* XXX this assumes clock->shift == 22 */
843 /* 4611686018 ~= 2^(20+64-22) / 1e9 */ 850 /* 4611686018 ~= 2^(20+64-22) / 1e9 */
844 t2x = (u64) clock->mult * 4611686018ULL; 851 t2x = (u64) mult * 4611686018ULL;
845 stamp_xsec = (u64) xtime.tv_nsec * XSEC_PER_SEC; 852 stamp_xsec = (u64) xtime.tv_nsec * XSEC_PER_SEC;
846 do_div(stamp_xsec, 1000000000); 853 do_div(stamp_xsec, 1000000000);
847 stamp_xsec += (u64) xtime.tv_sec * XSEC_PER_SEC; 854 stamp_xsec += (u64) xtime.tv_sec * XSEC_PER_SEC;
@@ -918,7 +925,7 @@ static void register_decrementer_clockevent(int cpu)
918 *dec = decrementer_clockevent; 925 *dec = decrementer_clockevent;
919 dec->cpumask = cpumask_of(cpu); 926 dec->cpumask = cpumask_of(cpu);
920 927
921 printk(KERN_DEBUG "clockevent: %s mult[%lx] shift[%d] cpu[%d]\n", 928 printk(KERN_DEBUG "clockevent: %s mult[%x] shift[%d] cpu[%d]\n",
922 dec->name, dec->mult, dec->shift, cpu); 929 dec->name, dec->mult, dec->shift, cpu);
923 930
924 clockevents_register_device(dec); 931 clockevents_register_device(dec);
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index 6f0ae1a9bfae..9d1f9354d6ca 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -759,7 +759,7 @@ static int emulate_instruction(struct pt_regs *regs)
759 759
760 /* Emulate the mfspr rD, PVR. */ 760 /* Emulate the mfspr rD, PVR. */
761 if ((instword & PPC_INST_MFSPR_PVR_MASK) == PPC_INST_MFSPR_PVR) { 761 if ((instword & PPC_INST_MFSPR_PVR_MASK) == PPC_INST_MFSPR_PVR) {
762 PPC_WARN_EMULATED(mfpvr); 762 PPC_WARN_EMULATED(mfpvr, regs);
763 rd = (instword >> 21) & 0x1f; 763 rd = (instword >> 21) & 0x1f;
764 regs->gpr[rd] = mfspr(SPRN_PVR); 764 regs->gpr[rd] = mfspr(SPRN_PVR);
765 return 0; 765 return 0;
@@ -767,7 +767,7 @@ static int emulate_instruction(struct pt_regs *regs)
767 767
768 /* Emulating the dcba insn is just a no-op. */ 768 /* Emulating the dcba insn is just a no-op. */
769 if ((instword & PPC_INST_DCBA_MASK) == PPC_INST_DCBA) { 769 if ((instword & PPC_INST_DCBA_MASK) == PPC_INST_DCBA) {
770 PPC_WARN_EMULATED(dcba); 770 PPC_WARN_EMULATED(dcba, regs);
771 return 0; 771 return 0;
772 } 772 }
773 773
@@ -776,7 +776,7 @@ static int emulate_instruction(struct pt_regs *regs)
776 int shift = (instword >> 21) & 0x1c; 776 int shift = (instword >> 21) & 0x1c;
777 unsigned long msk = 0xf0000000UL >> shift; 777 unsigned long msk = 0xf0000000UL >> shift;
778 778
779 PPC_WARN_EMULATED(mcrxr); 779 PPC_WARN_EMULATED(mcrxr, regs);
780 regs->ccr = (regs->ccr & ~msk) | ((regs->xer >> shift) & msk); 780 regs->ccr = (regs->ccr & ~msk) | ((regs->xer >> shift) & msk);
781 regs->xer &= ~0xf0000000UL; 781 regs->xer &= ~0xf0000000UL;
782 return 0; 782 return 0;
@@ -784,19 +784,19 @@ static int emulate_instruction(struct pt_regs *regs)
784 784
785 /* Emulate load/store string insn. */ 785 /* Emulate load/store string insn. */
786 if ((instword & PPC_INST_STRING_GEN_MASK) == PPC_INST_STRING) { 786 if ((instword & PPC_INST_STRING_GEN_MASK) == PPC_INST_STRING) {
787 PPC_WARN_EMULATED(string); 787 PPC_WARN_EMULATED(string, regs);
788 return emulate_string_inst(regs, instword); 788 return emulate_string_inst(regs, instword);
789 } 789 }
790 790
791 /* Emulate the popcntb (Population Count Bytes) instruction. */ 791 /* Emulate the popcntb (Population Count Bytes) instruction. */
792 if ((instword & PPC_INST_POPCNTB_MASK) == PPC_INST_POPCNTB) { 792 if ((instword & PPC_INST_POPCNTB_MASK) == PPC_INST_POPCNTB) {
793 PPC_WARN_EMULATED(popcntb); 793 PPC_WARN_EMULATED(popcntb, regs);
794 return emulate_popcntb_inst(regs, instword); 794 return emulate_popcntb_inst(regs, instword);
795 } 795 }
796 796
797 /* Emulate isel (Integer Select) instruction */ 797 /* Emulate isel (Integer Select) instruction */
798 if ((instword & PPC_INST_ISEL_MASK) == PPC_INST_ISEL) { 798 if ((instword & PPC_INST_ISEL_MASK) == PPC_INST_ISEL) {
799 PPC_WARN_EMULATED(isel); 799 PPC_WARN_EMULATED(isel, regs);
800 return emulate_isel(regs, instword); 800 return emulate_isel(regs, instword);
801 } 801 }
802 802
@@ -995,7 +995,7 @@ void SoftwareEmulation(struct pt_regs *regs)
995#ifdef CONFIG_MATH_EMULATION 995#ifdef CONFIG_MATH_EMULATION
996 errcode = do_mathemu(regs); 996 errcode = do_mathemu(regs);
997 if (errcode >= 0) 997 if (errcode >= 0)
998 PPC_WARN_EMULATED(math); 998 PPC_WARN_EMULATED(math, regs);
999 999
1000 switch (errcode) { 1000 switch (errcode) {
1001 case 0: 1001 case 0:
@@ -1018,7 +1018,7 @@ void SoftwareEmulation(struct pt_regs *regs)
1018#elif defined(CONFIG_8XX_MINIMAL_FPEMU) 1018#elif defined(CONFIG_8XX_MINIMAL_FPEMU)
1019 errcode = Soft_emulate_8xx(regs); 1019 errcode = Soft_emulate_8xx(regs);
1020 if (errcode >= 0) 1020 if (errcode >= 0)
1021 PPC_WARN_EMULATED(8xx); 1021 PPC_WARN_EMULATED(8xx, regs);
1022 1022
1023 switch (errcode) { 1023 switch (errcode) {
1024 case 0: 1024 case 0:
@@ -1129,7 +1129,7 @@ void altivec_assist_exception(struct pt_regs *regs)
1129 1129
1130 flush_altivec_to_thread(current); 1130 flush_altivec_to_thread(current);
1131 1131
1132 PPC_WARN_EMULATED(altivec); 1132 PPC_WARN_EMULATED(altivec, regs);
1133 err = emulate_altivec(regs); 1133 err = emulate_altivec(regs);
1134 if (err == 0) { 1134 if (err == 0) {
1135 regs->nip += 4; /* skip emulated instruction */ 1135 regs->nip += 4; /* skip emulated instruction */
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
index 2a4551f78f60..5902bbc2411e 100644
--- a/arch/powerpc/kvm/powerpc.c
+++ b/arch/powerpc/kvm/powerpc.c
@@ -78,8 +78,9 @@ int kvmppc_emulate_mmio(struct kvm_run *run, struct kvm_vcpu *vcpu)
78 return r; 78 return r;
79} 79}
80 80
81void kvm_arch_hardware_enable(void *garbage) 81int kvm_arch_hardware_enable(void *garbage)
82{ 82{
83 return 0;
83} 84}
84 85
85void kvm_arch_hardware_disable(void *garbage) 86void kvm_arch_hardware_disable(void *garbage)
@@ -421,7 +422,7 @@ long kvm_arch_vm_ioctl(struct file *filp,
421 422
422 switch (ioctl) { 423 switch (ioctl) {
423 default: 424 default:
424 r = -EINVAL; 425 r = -ENOTTY;
425 } 426 }
426 427
427 return r; 428 return r;
diff --git a/arch/powerpc/kvm/timing.h b/arch/powerpc/kvm/timing.h
index 806ef67868bd..8167d42a776f 100644
--- a/arch/powerpc/kvm/timing.h
+++ b/arch/powerpc/kvm/timing.h
@@ -51,7 +51,7 @@ static inline void kvmppc_account_exit_stat(struct kvm_vcpu *vcpu, int type)
51 51
52 /* The BUILD_BUG_ON below breaks in funny ways, commented out 52 /* The BUILD_BUG_ON below breaks in funny ways, commented out
53 * for now ... -BenH 53 * for now ... -BenH
54 BUILD_BUG_ON(__builtin_constant_p(type)); 54 BUILD_BUG_ON(!__builtin_constant_p(type));
55 */ 55 */
56 switch (type) { 56 switch (type) {
57 case EXT_INTR_EXITS: 57 case EXT_INTR_EXITS:
diff --git a/arch/powerpc/lib/copypage_64.S b/arch/powerpc/lib/copypage_64.S
index 75f3267fdc30..e68beac0a171 100644
--- a/arch/powerpc/lib/copypage_64.S
+++ b/arch/powerpc/lib/copypage_64.S
@@ -26,11 +26,11 @@ BEGIN_FTR_SECTION
26 srd r8,r5,r11 26 srd r8,r5,r11
27 27
28 mtctr r8 28 mtctr r8
29setup: 29.Lsetup:
30 dcbt r9,r4 30 dcbt r9,r4
31 dcbz r9,r3 31 dcbz r9,r3
32 add r9,r9,r12 32 add r9,r9,r12
33 bdnz setup 33 bdnz .Lsetup
34END_FTR_SECTION_IFSET(CPU_FTR_CP_USE_DCBTZ) 34END_FTR_SECTION_IFSET(CPU_FTR_CP_USE_DCBTZ)
35 addi r3,r3,-8 35 addi r3,r3,-8
36 srdi r8,r5,7 /* page is copied in 128 byte strides */ 36 srdi r8,r5,7 /* page is copied in 128 byte strides */
diff --git a/arch/powerpc/platforms/powermac/low_i2c.c b/arch/powerpc/platforms/powermac/low_i2c.c
index 414ca9849f23..345e2da56767 100644
--- a/arch/powerpc/platforms/powermac/low_i2c.c
+++ b/arch/powerpc/platforms/powermac/low_i2c.c
@@ -42,6 +42,7 @@
42#include <linux/interrupt.h> 42#include <linux/interrupt.h>
43#include <linux/timer.h> 43#include <linux/timer.h>
44#include <linux/mutex.h> 44#include <linux/mutex.h>
45#include <linux/i2c.h>
45#include <asm/keylargo.h> 46#include <asm/keylargo.h>
46#include <asm/uninorth.h> 47#include <asm/uninorth.h>
47#include <asm/io.h> 48#include <asm/io.h>
@@ -80,7 +81,7 @@ struct pmac_i2c_bus
80 struct device_node *busnode; 81 struct device_node *busnode;
81 int type; 82 int type;
82 int flags; 83 int flags;
83 struct i2c_adapter *adapter; 84 struct i2c_adapter adapter;
84 void *hostdata; 85 void *hostdata;
85 int channel; /* some hosts have multiple */ 86 int channel; /* some hosts have multiple */
86 int mode; /* current mode */ 87 int mode; /* current mode */
@@ -1014,25 +1015,9 @@ int pmac_i2c_get_channel(struct pmac_i2c_bus *bus)
1014EXPORT_SYMBOL_GPL(pmac_i2c_get_channel); 1015EXPORT_SYMBOL_GPL(pmac_i2c_get_channel);
1015 1016
1016 1017
1017void pmac_i2c_attach_adapter(struct pmac_i2c_bus *bus,
1018 struct i2c_adapter *adapter)
1019{
1020 WARN_ON(bus->adapter != NULL);
1021 bus->adapter = adapter;
1022}
1023EXPORT_SYMBOL_GPL(pmac_i2c_attach_adapter);
1024
1025void pmac_i2c_detach_adapter(struct pmac_i2c_bus *bus,
1026 struct i2c_adapter *adapter)
1027{
1028 WARN_ON(bus->adapter != adapter);
1029 bus->adapter = NULL;
1030}
1031EXPORT_SYMBOL_GPL(pmac_i2c_detach_adapter);
1032
1033struct i2c_adapter *pmac_i2c_get_adapter(struct pmac_i2c_bus *bus) 1018struct i2c_adapter *pmac_i2c_get_adapter(struct pmac_i2c_bus *bus)
1034{ 1019{
1035 return bus->adapter; 1020 return &bus->adapter;
1036} 1021}
1037EXPORT_SYMBOL_GPL(pmac_i2c_get_adapter); 1022EXPORT_SYMBOL_GPL(pmac_i2c_get_adapter);
1038 1023
@@ -1041,7 +1026,7 @@ struct pmac_i2c_bus *pmac_i2c_adapter_to_bus(struct i2c_adapter *adapter)
1041 struct pmac_i2c_bus *bus; 1026 struct pmac_i2c_bus *bus;
1042 1027
1043 list_for_each_entry(bus, &pmac_i2c_busses, link) 1028 list_for_each_entry(bus, &pmac_i2c_busses, link)
1044 if (bus->adapter == adapter) 1029 if (&bus->adapter == adapter)
1045 return bus; 1030 return bus;
1046 return NULL; 1031 return NULL;
1047} 1032}
@@ -1053,7 +1038,7 @@ int pmac_i2c_match_adapter(struct device_node *dev, struct i2c_adapter *adapter)
1053 1038
1054 if (bus == NULL) 1039 if (bus == NULL)
1055 return 0; 1040 return 0;
1056 return (bus->adapter == adapter); 1041 return (&bus->adapter == adapter);
1057} 1042}
1058EXPORT_SYMBOL_GPL(pmac_i2c_match_adapter); 1043EXPORT_SYMBOL_GPL(pmac_i2c_match_adapter);
1059 1044
diff --git a/arch/powerpc/platforms/pseries/hvCall.S b/arch/powerpc/platforms/pseries/hvCall.S
index c1427b3634ec..383a5d0e9818 100644
--- a/arch/powerpc/platforms/pseries/hvCall.S
+++ b/arch/powerpc/platforms/pseries/hvCall.S
@@ -14,68 +14,94 @@
14 14
15#define STK_PARM(i) (48 + ((i)-3)*8) 15#define STK_PARM(i) (48 + ((i)-3)*8)
16 16
17#ifdef CONFIG_HCALL_STATS 17#ifdef CONFIG_TRACEPOINTS
18
19 .section ".toc","aw"
20
21 .globl hcall_tracepoint_refcount
22hcall_tracepoint_refcount:
23 .llong 0
24
25 .section ".text"
26
18/* 27/*
19 * precall must preserve all registers. use unused STK_PARM() 28 * precall must preserve all registers. use unused STK_PARM()
20 * areas to save snapshots and opcode. 29 * areas to save snapshots and opcode. We branch around this
30 * in early init (eg when populating the MMU hashtable) by using an
31 * unconditional cpu feature.
21 */ 32 */
22#define HCALL_INST_PRECALL \ 33#define HCALL_INST_PRECALL(FIRST_REG) \
23 std r3,STK_PARM(r3)(r1); /* save opcode */ \
24 mftb r0; /* get timebase and */ \
25 std r0,STK_PARM(r5)(r1); /* save for later */ \
26BEGIN_FTR_SECTION; \ 34BEGIN_FTR_SECTION; \
27 mfspr r0,SPRN_PURR; /* get PURR and */ \ 35 b 1f; \
28 std r0,STK_PARM(r6)(r1); /* save for later */ \ 36END_FTR_SECTION(0, 1); \
29END_FTR_SECTION_IFSET(CPU_FTR_PURR); 37 ld r12,hcall_tracepoint_refcount@toc(r2); \
30 38 cmpdi r12,0; \
39 beq+ 1f; \
40 mflr r0; \
41 std r3,STK_PARM(r3)(r1); \
42 std r4,STK_PARM(r4)(r1); \
43 std r5,STK_PARM(r5)(r1); \
44 std r6,STK_PARM(r6)(r1); \
45 std r7,STK_PARM(r7)(r1); \
46 std r8,STK_PARM(r8)(r1); \
47 std r9,STK_PARM(r9)(r1); \
48 std r10,STK_PARM(r10)(r1); \
49 std r0,16(r1); \
50 addi r4,r1,STK_PARM(FIRST_REG); \
51 stdu r1,-STACK_FRAME_OVERHEAD(r1); \
52 bl .__trace_hcall_entry; \
53 addi r1,r1,STACK_FRAME_OVERHEAD; \
54 ld r0,16(r1); \
55 ld r3,STK_PARM(r3)(r1); \
56 ld r4,STK_PARM(r4)(r1); \
57 ld r5,STK_PARM(r5)(r1); \
58 ld r6,STK_PARM(r6)(r1); \
59 ld r7,STK_PARM(r7)(r1); \
60 ld r8,STK_PARM(r8)(r1); \
61 ld r9,STK_PARM(r9)(r1); \
62 ld r10,STK_PARM(r10)(r1); \
63 mtlr r0; \
641:
65
31/* 66/*
32 * postcall is performed immediately before function return which 67 * postcall is performed immediately before function return which
33 * allows liberal use of volatile registers. We branch around this 68 * allows liberal use of volatile registers. We branch around this
34 * in early init (eg when populating the MMU hashtable) by using an 69 * in early init (eg when populating the MMU hashtable) by using an
35 * unconditional cpu feature. 70 * unconditional cpu feature.
36 */ 71 */
37#define HCALL_INST_POSTCALL \ 72#define __HCALL_INST_POSTCALL \
38BEGIN_FTR_SECTION; \ 73BEGIN_FTR_SECTION; \
39 b 1f; \ 74 b 1f; \
40END_FTR_SECTION(0, 1); \ 75END_FTR_SECTION(0, 1); \
41 ld r4,STK_PARM(r3)(r1); /* validate opcode */ \ 76 ld r12,hcall_tracepoint_refcount@toc(r2); \
42 cmpldi cr7,r4,MAX_HCALL_OPCODE; \ 77 cmpdi r12,0; \
43 bgt- cr7,1f; \ 78 beq+ 1f; \
44 \ 79 mflr r0; \
45 /* get time and PURR snapshots after hcall */ \ 80 ld r6,STK_PARM(r3)(r1); \
46 mftb r7; /* timebase after */ \ 81 std r3,STK_PARM(r3)(r1); \
47BEGIN_FTR_SECTION; \ 82 mr r4,r3; \
48 mfspr r8,SPRN_PURR; /* PURR after */ \ 83 mr r3,r6; \
49 ld r6,STK_PARM(r6)(r1); /* PURR before */ \ 84 std r0,16(r1); \
50 subf r6,r6,r8; /* delta */ \ 85 stdu r1,-STACK_FRAME_OVERHEAD(r1); \
51END_FTR_SECTION_IFSET(CPU_FTR_PURR); \ 86 bl .__trace_hcall_exit; \
52 ld r5,STK_PARM(r5)(r1); /* timebase before */ \ 87 addi r1,r1,STACK_FRAME_OVERHEAD; \
53 subf r5,r5,r7; /* time delta */ \ 88 ld r0,16(r1); \
54 \ 89 ld r3,STK_PARM(r3)(r1); \
55 /* calculate address of stat structure r4 = opcode */ \ 90 mtlr r0; \
56 srdi r4,r4,2; /* index into array */ \
57 mulli r4,r4,HCALL_STAT_SIZE; \
58 LOAD_REG_ADDR(r7, per_cpu__hcall_stats); \
59 add r4,r4,r7; \
60 ld r7,PACA_DATA_OFFSET(r13); /* per cpu offset */ \
61 add r4,r4,r7; \
62 \
63 /* update stats */ \
64 ld r7,HCALL_STAT_CALLS(r4); /* count */ \
65 addi r7,r7,1; \
66 std r7,HCALL_STAT_CALLS(r4); \
67 ld r7,HCALL_STAT_TB(r4); /* timebase */ \
68 add r7,r7,r5; \
69 std r7,HCALL_STAT_TB(r4); \
70BEGIN_FTR_SECTION; \
71 ld r7,HCALL_STAT_PURR(r4); /* PURR */ \
72 add r7,r7,r6; \
73 std r7,HCALL_STAT_PURR(r4); \
74END_FTR_SECTION_IFSET(CPU_FTR_PURR); \
751: 911:
92
93#define HCALL_INST_POSTCALL_NORETS \
94 li r5,0; \
95 __HCALL_INST_POSTCALL
96
97#define HCALL_INST_POSTCALL(BUFREG) \
98 mr r5,BUFREG; \
99 __HCALL_INST_POSTCALL
100
76#else 101#else
77#define HCALL_INST_PRECALL 102#define HCALL_INST_PRECALL(FIRST_ARG)
78#define HCALL_INST_POSTCALL 103#define HCALL_INST_POSTCALL_NORETS
104#define HCALL_INST_POSTCALL(BUFREG)
79#endif 105#endif
80 106
81 .text 107 .text
@@ -86,11 +112,11 @@ _GLOBAL(plpar_hcall_norets)
86 mfcr r0 112 mfcr r0
87 stw r0,8(r1) 113 stw r0,8(r1)
88 114
89 HCALL_INST_PRECALL 115 HCALL_INST_PRECALL(r4)
90 116
91 HVSC /* invoke the hypervisor */ 117 HVSC /* invoke the hypervisor */
92 118
93 HCALL_INST_POSTCALL 119 HCALL_INST_POSTCALL_NORETS
94 120
95 lwz r0,8(r1) 121 lwz r0,8(r1)
96 mtcrf 0xff,r0 122 mtcrf 0xff,r0
@@ -102,7 +128,7 @@ _GLOBAL(plpar_hcall)
102 mfcr r0 128 mfcr r0
103 stw r0,8(r1) 129 stw r0,8(r1)
104 130
105 HCALL_INST_PRECALL 131 HCALL_INST_PRECALL(r5)
106 132
107 std r4,STK_PARM(r4)(r1) /* Save ret buffer */ 133 std r4,STK_PARM(r4)(r1) /* Save ret buffer */
108 134
@@ -121,7 +147,7 @@ _GLOBAL(plpar_hcall)
121 std r6, 16(r12) 147 std r6, 16(r12)
122 std r7, 24(r12) 148 std r7, 24(r12)
123 149
124 HCALL_INST_POSTCALL 150 HCALL_INST_POSTCALL(r12)
125 151
126 lwz r0,8(r1) 152 lwz r0,8(r1)
127 mtcrf 0xff,r0 153 mtcrf 0xff,r0
@@ -168,7 +194,7 @@ _GLOBAL(plpar_hcall9)
168 mfcr r0 194 mfcr r0
169 stw r0,8(r1) 195 stw r0,8(r1)
170 196
171 HCALL_INST_PRECALL 197 HCALL_INST_PRECALL(r5)
172 198
173 std r4,STK_PARM(r4)(r1) /* Save ret buffer */ 199 std r4,STK_PARM(r4)(r1) /* Save ret buffer */
174 200
@@ -196,7 +222,7 @@ _GLOBAL(plpar_hcall9)
196 std r11,56(r12) 222 std r11,56(r12)
197 std r0, 64(r12) 223 std r0, 64(r12)
198 224
199 HCALL_INST_POSTCALL 225 HCALL_INST_POSTCALL(r12)
200 226
201 lwz r0,8(r1) 227 lwz r0,8(r1)
202 mtcrf 0xff,r0 228 mtcrf 0xff,r0
diff --git a/arch/powerpc/platforms/pseries/hvCall_inst.c b/arch/powerpc/platforms/pseries/hvCall_inst.c
index 3631a4f277eb..2f58c71b7259 100644
--- a/arch/powerpc/platforms/pseries/hvCall_inst.c
+++ b/arch/powerpc/platforms/pseries/hvCall_inst.c
@@ -26,6 +26,7 @@
26#include <asm/hvcall.h> 26#include <asm/hvcall.h>
27#include <asm/firmware.h> 27#include <asm/firmware.h>
28#include <asm/cputable.h> 28#include <asm/cputable.h>
29#include <asm/trace.h>
29 30
30DEFINE_PER_CPU(struct hcall_stats[HCALL_STAT_ARRAY_SIZE], hcall_stats); 31DEFINE_PER_CPU(struct hcall_stats[HCALL_STAT_ARRAY_SIZE], hcall_stats);
31 32
@@ -100,6 +101,35 @@ static const struct file_operations hcall_inst_seq_fops = {
100#define HCALL_ROOT_DIR "hcall_inst" 101#define HCALL_ROOT_DIR "hcall_inst"
101#define CPU_NAME_BUF_SIZE 32 102#define CPU_NAME_BUF_SIZE 32
102 103
104
105static void probe_hcall_entry(unsigned long opcode, unsigned long *args)
106{
107 struct hcall_stats *h;
108
109 if (opcode > MAX_HCALL_OPCODE)
110 return;
111
112 h = &get_cpu_var(hcall_stats)[opcode / 4];
113 h->tb_start = mftb();
114 h->purr_start = mfspr(SPRN_PURR);
115}
116
117static void probe_hcall_exit(unsigned long opcode, unsigned long retval,
118 unsigned long *retbuf)
119{
120 struct hcall_stats *h;
121
122 if (opcode > MAX_HCALL_OPCODE)
123 return;
124
125 h = &__get_cpu_var(hcall_stats)[opcode / 4];
126 h->num_calls++;
127 h->tb_total = mftb() - h->tb_start;
128 h->purr_total = mfspr(SPRN_PURR) - h->purr_start;
129
130 put_cpu_var(hcall_stats);
131}
132
103static int __init hcall_inst_init(void) 133static int __init hcall_inst_init(void)
104{ 134{
105 struct dentry *hcall_root; 135 struct dentry *hcall_root;
@@ -110,6 +140,14 @@ static int __init hcall_inst_init(void)
110 if (!firmware_has_feature(FW_FEATURE_LPAR)) 140 if (!firmware_has_feature(FW_FEATURE_LPAR))
111 return 0; 141 return 0;
112 142
143 if (register_trace_hcall_entry(probe_hcall_entry))
144 return -EINVAL;
145
146 if (register_trace_hcall_exit(probe_hcall_exit)) {
147 unregister_trace_hcall_entry(probe_hcall_entry);
148 return -EINVAL;
149 }
150
113 hcall_root = debugfs_create_dir(HCALL_ROOT_DIR, NULL); 151 hcall_root = debugfs_create_dir(HCALL_ROOT_DIR, NULL);
114 if (!hcall_root) 152 if (!hcall_root)
115 return -ENOMEM; 153 return -ENOMEM;
diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c
index 903eb9eec687..0707653612ba 100644
--- a/arch/powerpc/platforms/pseries/lpar.c
+++ b/arch/powerpc/platforms/pseries/lpar.c
@@ -39,6 +39,7 @@
39#include <asm/cputable.h> 39#include <asm/cputable.h>
40#include <asm/udbg.h> 40#include <asm/udbg.h>
41#include <asm/smp.h> 41#include <asm/smp.h>
42#include <asm/trace.h>
42 43
43#include "plpar_wrappers.h" 44#include "plpar_wrappers.h"
44#include "pseries.h" 45#include "pseries.h"
@@ -661,3 +662,35 @@ void arch_free_page(struct page *page, int order)
661EXPORT_SYMBOL(arch_free_page); 662EXPORT_SYMBOL(arch_free_page);
662 663
663#endif 664#endif
665
666#ifdef CONFIG_TRACEPOINTS
667/*
668 * We optimise our hcall path by placing hcall_tracepoint_refcount
669 * directly in the TOC so we can check if the hcall tracepoints are
670 * enabled via a single load.
671 */
672
673/* NB: reg/unreg are called while guarded with the tracepoints_mutex */
674extern long hcall_tracepoint_refcount;
675
676void hcall_tracepoint_regfunc(void)
677{
678 hcall_tracepoint_refcount++;
679}
680
681void hcall_tracepoint_unregfunc(void)
682{
683 hcall_tracepoint_refcount--;
684}
685
686void __trace_hcall_entry(unsigned long opcode, unsigned long *args)
687{
688 trace_hcall_entry(opcode, args);
689}
690
691void __trace_hcall_exit(long opcode, unsigned long retval,
692 unsigned long *retbuf)
693{
694 trace_hcall_exit(opcode, retval, retbuf);
695}
696#endif
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index 43c0acad7160..c80235206c01 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -95,6 +95,34 @@ config S390
95 select HAVE_ARCH_TRACEHOOK 95 select HAVE_ARCH_TRACEHOOK
96 select INIT_ALL_POSSIBLE 96 select INIT_ALL_POSSIBLE
97 select HAVE_PERF_EVENTS 97 select HAVE_PERF_EVENTS
98 select ARCH_INLINE_SPIN_TRYLOCK
99 select ARCH_INLINE_SPIN_TRYLOCK_BH
100 select ARCH_INLINE_SPIN_LOCK
101 select ARCH_INLINE_SPIN_LOCK_BH
102 select ARCH_INLINE_SPIN_LOCK_IRQ
103 select ARCH_INLINE_SPIN_LOCK_IRQSAVE
104 select ARCH_INLINE_SPIN_UNLOCK
105 select ARCH_INLINE_SPIN_UNLOCK_BH
106 select ARCH_INLINE_SPIN_UNLOCK_IRQ
107 select ARCH_INLINE_SPIN_UNLOCK_IRQRESTORE
108 select ARCH_INLINE_READ_TRYLOCK
109 select ARCH_INLINE_READ_LOCK
110 select ARCH_INLINE_READ_LOCK_BH
111 select ARCH_INLINE_READ_LOCK_IRQ
112 select ARCH_INLINE_READ_LOCK_IRQSAVE
113 select ARCH_INLINE_READ_UNLOCK
114 select ARCH_INLINE_READ_UNLOCK_BH
115 select ARCH_INLINE_READ_UNLOCK_IRQ
116 select ARCH_INLINE_READ_UNLOCK_IRQRESTORE
117 select ARCH_INLINE_WRITE_TRYLOCK
118 select ARCH_INLINE_WRITE_LOCK
119 select ARCH_INLINE_WRITE_LOCK_BH
120 select ARCH_INLINE_WRITE_LOCK_IRQ
121 select ARCH_INLINE_WRITE_LOCK_IRQSAVE
122 select ARCH_INLINE_WRITE_UNLOCK
123 select ARCH_INLINE_WRITE_UNLOCK_BH
124 select ARCH_INLINE_WRITE_UNLOCK_IRQ
125 select ARCH_INLINE_WRITE_UNLOCK_IRQRESTORE
98 126
99config SCHED_OMIT_FRAME_POINTER 127config SCHED_OMIT_FRAME_POINTER
100 bool 128 bool
@@ -192,23 +220,8 @@ config AUDIT_ARCH
192 bool 220 bool
193 default y 221 default y
194 222
195config S390_SWITCH_AMODE
196 bool "Switch kernel/user addressing modes"
197 help
198 This option allows to switch the addressing modes of kernel and user
199 space. The kernel parameter switch_amode=on will enable this feature,
200 default is disabled. Enabling this (via kernel parameter) on machines
201 earlier than IBM System z9-109 EC/BC will reduce system performance.
202
203 Note that this option will also be selected by selecting the execute
204 protection option below. Enabling the execute protection via the
205 noexec kernel parameter will also switch the addressing modes,
206 independent of the switch_amode kernel parameter.
207
208
209config S390_EXEC_PROTECT 223config S390_EXEC_PROTECT
210 bool "Data execute protection" 224 bool "Data execute protection"
211 select S390_SWITCH_AMODE
212 help 225 help
213 This option allows to enable a buffer overflow protection for user 226 This option allows to enable a buffer overflow protection for user
214 space programs and it also selects the addressing mode option above. 227 space programs and it also selects the addressing mode option above.
diff --git a/arch/s390/appldata/appldata_base.c b/arch/s390/appldata/appldata_base.c
index b55fd7ed1c31..495589950dc7 100644
--- a/arch/s390/appldata/appldata_base.c
+++ b/arch/s390/appldata/appldata_base.c
@@ -61,12 +61,12 @@ static struct ctl_table appldata_table[] = {
61 { 61 {
62 .procname = "timer", 62 .procname = "timer",
63 .mode = S_IRUGO | S_IWUSR, 63 .mode = S_IRUGO | S_IWUSR,
64 .proc_handler = &appldata_timer_handler, 64 .proc_handler = appldata_timer_handler,
65 }, 65 },
66 { 66 {
67 .procname = "interval", 67 .procname = "interval",
68 .mode = S_IRUGO | S_IWUSR, 68 .mode = S_IRUGO | S_IWUSR,
69 .proc_handler = &appldata_interval_handler, 69 .proc_handler = appldata_interval_handler,
70 }, 70 },
71 { }, 71 { },
72}; 72};
diff --git a/arch/s390/appldata/appldata_net_sum.c b/arch/s390/appldata/appldata_net_sum.c
index fa741f84c5b9..4ce7fa95880f 100644
--- a/arch/s390/appldata/appldata_net_sum.c
+++ b/arch/s390/appldata/appldata_net_sum.c
@@ -83,8 +83,9 @@ static void appldata_get_net_sum_data(void *data)
83 rx_dropped = 0; 83 rx_dropped = 0;
84 tx_dropped = 0; 84 tx_dropped = 0;
85 collisions = 0; 85 collisions = 0;
86 read_lock(&dev_base_lock); 86
87 for_each_netdev(&init_net, dev) { 87 rcu_read_lock();
88 for_each_netdev_rcu(&init_net, dev) {
88 const struct net_device_stats *stats = dev_get_stats(dev); 89 const struct net_device_stats *stats = dev_get_stats(dev);
89 90
90 rx_packets += stats->rx_packets; 91 rx_packets += stats->rx_packets;
@@ -98,7 +99,8 @@ static void appldata_get_net_sum_data(void *data)
98 collisions += stats->collisions; 99 collisions += stats->collisions;
99 i++; 100 i++;
100 } 101 }
101 read_unlock(&dev_base_lock); 102 rcu_read_unlock();
103
102 net_data->nr_interfaces = i; 104 net_data->nr_interfaces = i;
103 net_data->rx_packets = rx_packets; 105 net_data->rx_packets = rx_packets;
104 net_data->tx_packets = tx_packets; 106 net_data->tx_packets = tx_packets;
diff --git a/arch/s390/crypto/prng.c b/arch/s390/crypto/prng.c
index b49c00ce65e9..a3209906739e 100644
--- a/arch/s390/crypto/prng.c
+++ b/arch/s390/crypto/prng.c
@@ -6,7 +6,6 @@
6#include <linux/fs.h> 6#include <linux/fs.h>
7#include <linux/init.h> 7#include <linux/init.h>
8#include <linux/kernel.h> 8#include <linux/kernel.h>
9#include <linux/smp_lock.h>
10#include <linux/miscdevice.h> 9#include <linux/miscdevice.h>
11#include <linux/module.h> 10#include <linux/module.h>
12#include <linux/moduleparam.h> 11#include <linux/moduleparam.h>
@@ -49,7 +48,6 @@ static unsigned char parm_block[32] = {
49 48
50static int prng_open(struct inode *inode, struct file *file) 49static int prng_open(struct inode *inode, struct file *file)
51{ 50{
52 cycle_kernel_lock();
53 return nonseekable_open(inode, file); 51 return nonseekable_open(inode, file);
54} 52}
55 53
diff --git a/arch/s390/defconfig b/arch/s390/defconfig
index ab4464486b7a..f4e53c6708dc 100644
--- a/arch/s390/defconfig
+++ b/arch/s390/defconfig
@@ -185,7 +185,6 @@ CONFIG_HOTPLUG_CPU=y
185CONFIG_COMPAT=y 185CONFIG_COMPAT=y
186CONFIG_SYSVIPC_COMPAT=y 186CONFIG_SYSVIPC_COMPAT=y
187CONFIG_AUDIT_ARCH=y 187CONFIG_AUDIT_ARCH=y
188CONFIG_S390_SWITCH_AMODE=y
189CONFIG_S390_EXEC_PROTECT=y 188CONFIG_S390_EXEC_PROTECT=y
190 189
191# 190#
diff --git a/arch/s390/include/asm/atomic.h b/arch/s390/include/asm/atomic.h
index ae7c8f9f94a5..2a113d6a7dfd 100644
--- a/arch/s390/include/asm/atomic.h
+++ b/arch/s390/include/asm/atomic.h
@@ -21,7 +21,7 @@
21#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2) 21#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2)
22 22
23#define __CS_LOOP(ptr, op_val, op_string) ({ \ 23#define __CS_LOOP(ptr, op_val, op_string) ({ \
24 typeof(ptr->counter) old_val, new_val; \ 24 int old_val, new_val; \
25 asm volatile( \ 25 asm volatile( \
26 " l %0,%2\n" \ 26 " l %0,%2\n" \
27 "0: lr %1,%0\n" \ 27 "0: lr %1,%0\n" \
@@ -38,7 +38,7 @@
38#else /* __GNUC__ */ 38#else /* __GNUC__ */
39 39
40#define __CS_LOOP(ptr, op_val, op_string) ({ \ 40#define __CS_LOOP(ptr, op_val, op_string) ({ \
41 typeof(ptr->counter) old_val, new_val; \ 41 int old_val, new_val; \
42 asm volatile( \ 42 asm volatile( \
43 " l %0,0(%3)\n" \ 43 " l %0,0(%3)\n" \
44 "0: lr %1,%0\n" \ 44 "0: lr %1,%0\n" \
@@ -143,7 +143,7 @@ static inline int atomic_add_unless(atomic_t *v, int a, int u)
143#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2) 143#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2)
144 144
145#define __CSG_LOOP(ptr, op_val, op_string) ({ \ 145#define __CSG_LOOP(ptr, op_val, op_string) ({ \
146 typeof(ptr->counter) old_val, new_val; \ 146 long long old_val, new_val; \
147 asm volatile( \ 147 asm volatile( \
148 " lg %0,%2\n" \ 148 " lg %0,%2\n" \
149 "0: lgr %1,%0\n" \ 149 "0: lgr %1,%0\n" \
@@ -160,7 +160,7 @@ static inline int atomic_add_unless(atomic_t *v, int a, int u)
160#else /* __GNUC__ */ 160#else /* __GNUC__ */
161 161
162#define __CSG_LOOP(ptr, op_val, op_string) ({ \ 162#define __CSG_LOOP(ptr, op_val, op_string) ({ \
163 typeof(ptr->counter) old_val, new_val; \ 163 long long old_val, new_val; \
164 asm volatile( \ 164 asm volatile( \
165 " lg %0,0(%3)\n" \ 165 " lg %0,0(%3)\n" \
166 "0: lgr %1,%0\n" \ 166 "0: lgr %1,%0\n" \
diff --git a/arch/s390/include/asm/bug.h b/arch/s390/include/asm/bug.h
index 7efd0abe8887..efb74fd5156e 100644
--- a/arch/s390/include/asm/bug.h
+++ b/arch/s390/include/asm/bug.h
@@ -49,7 +49,7 @@
49 49
50#define BUG() do { \ 50#define BUG() do { \
51 __EMIT_BUG(0); \ 51 __EMIT_BUG(0); \
52 for (;;); \ 52 unreachable(); \
53} while (0) 53} while (0)
54 54
55#define WARN_ON(x) ({ \ 55#define WARN_ON(x) ({ \
diff --git a/arch/s390/include/asm/cacheflush.h b/arch/s390/include/asm/cacheflush.h
index 49d5af916d01..405cc97c6249 100644
--- a/arch/s390/include/asm/cacheflush.h
+++ b/arch/s390/include/asm/cacheflush.h
@@ -10,6 +10,7 @@
10#define flush_cache_dup_mm(mm) do { } while (0) 10#define flush_cache_dup_mm(mm) do { } while (0)
11#define flush_cache_range(vma, start, end) do { } while (0) 11#define flush_cache_range(vma, start, end) do { } while (0)
12#define flush_cache_page(vma, vmaddr, pfn) do { } while (0) 12#define flush_cache_page(vma, vmaddr, pfn) do { } while (0)
13#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 0
13#define flush_dcache_page(page) do { } while (0) 14#define flush_dcache_page(page) do { } while (0)
14#define flush_dcache_mmap_lock(mapping) do { } while (0) 15#define flush_dcache_mmap_lock(mapping) do { } while (0)
15#define flush_dcache_mmap_unlock(mapping) do { } while (0) 16#define flush_dcache_mmap_unlock(mapping) do { } while (0)
diff --git a/arch/s390/include/asm/ccwdev.h b/arch/s390/include/asm/ccwdev.h
index 2a5419551176..f4bd346a52d3 100644
--- a/arch/s390/include/asm/ccwdev.h
+++ b/arch/s390/include/asm/ccwdev.h
@@ -142,6 +142,8 @@ struct ccw1;
142extern int ccw_device_set_options_mask(struct ccw_device *, unsigned long); 142extern int ccw_device_set_options_mask(struct ccw_device *, unsigned long);
143extern int ccw_device_set_options(struct ccw_device *, unsigned long); 143extern int ccw_device_set_options(struct ccw_device *, unsigned long);
144extern void ccw_device_clear_options(struct ccw_device *, unsigned long); 144extern void ccw_device_clear_options(struct ccw_device *, unsigned long);
145int ccw_device_is_pathgroup(struct ccw_device *cdev);
146int ccw_device_is_multipath(struct ccw_device *cdev);
145 147
146/* Allow for i/o completion notification after primary interrupt status. */ 148/* Allow for i/o completion notification after primary interrupt status. */
147#define CCWDEV_EARLY_NOTIFICATION 0x0001 149#define CCWDEV_EARLY_NOTIFICATION 0x0001
@@ -151,6 +153,8 @@ extern void ccw_device_clear_options(struct ccw_device *, unsigned long);
151#define CCWDEV_DO_PATHGROUP 0x0004 153#define CCWDEV_DO_PATHGROUP 0x0004
152/* Allow forced onlining of boxed devices. */ 154/* Allow forced onlining of boxed devices. */
153#define CCWDEV_ALLOW_FORCE 0x0008 155#define CCWDEV_ALLOW_FORCE 0x0008
156/* Try to use multipath mode. */
157#define CCWDEV_DO_MULTIPATH 0x0010
154 158
155extern int ccw_device_start(struct ccw_device *, struct ccw1 *, 159extern int ccw_device_start(struct ccw_device *, struct ccw1 *,
156 unsigned long, __u8, unsigned long); 160 unsigned long, __u8, unsigned long);
diff --git a/arch/s390/include/asm/cputime.h b/arch/s390/include/asm/cputime.h
index f23961ada7fb..258ba88b7b50 100644
--- a/arch/s390/include/asm/cputime.h
+++ b/arch/s390/include/asm/cputime.h
@@ -183,6 +183,7 @@ struct s390_idle_data {
183 unsigned long long idle_count; 183 unsigned long long idle_count;
184 unsigned long long idle_enter; 184 unsigned long long idle_enter;
185 unsigned long long idle_time; 185 unsigned long long idle_time;
186 int nohz_delay;
186}; 187};
187 188
188DECLARE_PER_CPU(struct s390_idle_data, s390_idle); 189DECLARE_PER_CPU(struct s390_idle_data, s390_idle);
@@ -198,4 +199,11 @@ static inline void s390_idle_check(void)
198 vtime_start_cpu(); 199 vtime_start_cpu();
199} 200}
200 201
202static inline int s390_nohz_delay(int cpu)
203{
204 return per_cpu(s390_idle, cpu).nohz_delay != 0;
205}
206
207#define arch_needs_cpu(cpu) s390_nohz_delay(cpu)
208
201#endif /* _S390_CPUTIME_H */ 209#endif /* _S390_CPUTIME_H */
diff --git a/arch/s390/include/asm/kvm.h b/arch/s390/include/asm/kvm.h
index 3dfcaeb5d7f4..82b32a100c7d 100644
--- a/arch/s390/include/asm/kvm.h
+++ b/arch/s390/include/asm/kvm.h
@@ -1,6 +1,5 @@
1#ifndef __LINUX_KVM_S390_H 1#ifndef __LINUX_KVM_S390_H
2#define __LINUX_KVM_S390_H 2#define __LINUX_KVM_S390_H
3
4/* 3/*
5 * asm-s390/kvm.h - KVM s390 specific structures and definitions 4 * asm-s390/kvm.h - KVM s390 specific structures and definitions
6 * 5 *
@@ -15,6 +14,8 @@
15 */ 14 */
16#include <linux/types.h> 15#include <linux/types.h>
17 16
17#define __KVM_S390
18
18/* for KVM_GET_REGS and KVM_SET_REGS */ 19/* for KVM_GET_REGS and KVM_SET_REGS */
19struct kvm_regs { 20struct kvm_regs {
20 /* general purpose regs for s390 */ 21 /* general purpose regs for s390 */
diff --git a/arch/s390/include/asm/mmu_context.h b/arch/s390/include/asm/mmu_context.h
index fc7edd6f41b6..976e273988c2 100644
--- a/arch/s390/include/asm/mmu_context.h
+++ b/arch/s390/include/asm/mmu_context.h
@@ -36,7 +36,7 @@ static inline int init_new_context(struct task_struct *tsk,
36 mm->context.has_pgste = 1; 36 mm->context.has_pgste = 1;
37 mm->context.alloc_pgste = 1; 37 mm->context.alloc_pgste = 1;
38 } else { 38 } else {
39 mm->context.noexec = s390_noexec; 39 mm->context.noexec = (user_mode == SECONDARY_SPACE_MODE);
40 mm->context.has_pgste = 0; 40 mm->context.has_pgste = 0;
41 mm->context.alloc_pgste = 0; 41 mm->context.alloc_pgste = 0;
42 } 42 }
@@ -58,7 +58,7 @@ static inline void update_mm(struct mm_struct *mm, struct task_struct *tsk)
58 pgd_t *pgd = mm->pgd; 58 pgd_t *pgd = mm->pgd;
59 59
60 S390_lowcore.user_asce = mm->context.asce_bits | __pa(pgd); 60 S390_lowcore.user_asce = mm->context.asce_bits | __pa(pgd);
61 if (switch_amode) { 61 if (user_mode != HOME_SPACE_MODE) {
62 /* Load primary space page table origin. */ 62 /* Load primary space page table origin. */
63 pgd = mm->context.noexec ? get_shadow_table(pgd) : pgd; 63 pgd = mm->context.noexec ? get_shadow_table(pgd) : pgd;
64 S390_lowcore.user_exec_asce = mm->context.asce_bits | __pa(pgd); 64 S390_lowcore.user_exec_asce = mm->context.asce_bits | __pa(pgd);
diff --git a/arch/s390/include/asm/pgalloc.h b/arch/s390/include/asm/pgalloc.h
index ddad5903341c..68940d0bad91 100644
--- a/arch/s390/include/asm/pgalloc.h
+++ b/arch/s390/include/asm/pgalloc.h
@@ -143,7 +143,8 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm)
143 spin_lock_init(&mm->context.list_lock); 143 spin_lock_init(&mm->context.list_lock);
144 INIT_LIST_HEAD(&mm->context.crst_list); 144 INIT_LIST_HEAD(&mm->context.crst_list);
145 INIT_LIST_HEAD(&mm->context.pgtable_list); 145 INIT_LIST_HEAD(&mm->context.pgtable_list);
146 return (pgd_t *) crst_table_alloc(mm, s390_noexec); 146 return (pgd_t *)
147 crst_table_alloc(mm, user_mode == SECONDARY_SPACE_MODE);
147} 148}
148#define pgd_free(mm, pgd) crst_table_free(mm, (unsigned long *) pgd) 149#define pgd_free(mm, pgd) crst_table_free(mm, (unsigned long *) pgd)
149 150
diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgtable.h
index 60a7b1a1702f..e2fa79cf0614 100644
--- a/arch/s390/include/asm/pgtable.h
+++ b/arch/s390/include/asm/pgtable.h
@@ -169,12 +169,13 @@ extern unsigned long VMALLOC_START;
169 * STL Segment-Table-Length: Segment-table length (STL+1*16 entries -> up to 2048) 169 * STL Segment-Table-Length: Segment-table length (STL+1*16 entries -> up to 2048)
170 * 170 *
171 * A 64 bit pagetable entry of S390 has following format: 171 * A 64 bit pagetable entry of S390 has following format:
172 * | PFRA |0IP0| OS | 172 * | PFRA |0IPC| OS |
173 * 0000000000111111111122222222223333333333444444444455555555556666 173 * 0000000000111111111122222222223333333333444444444455555555556666
174 * 0123456789012345678901234567890123456789012345678901234567890123 174 * 0123456789012345678901234567890123456789012345678901234567890123
175 * 175 *
176 * I Page-Invalid Bit: Page is not available for address-translation 176 * I Page-Invalid Bit: Page is not available for address-translation
177 * P Page-Protection Bit: Store access not possible for page 177 * P Page-Protection Bit: Store access not possible for page
178 * C Change-bit override: HW is not required to set change bit
178 * 179 *
179 * A 64 bit segmenttable entry of S390 has following format: 180 * A 64 bit segmenttable entry of S390 has following format:
180 * | P-table origin | TT 181 * | P-table origin | TT
@@ -218,6 +219,7 @@ extern unsigned long VMALLOC_START;
218 */ 219 */
219 220
220/* Hardware bits in the page table entry */ 221/* Hardware bits in the page table entry */
222#define _PAGE_CO 0x100 /* HW Change-bit override */
221#define _PAGE_RO 0x200 /* HW read-only bit */ 223#define _PAGE_RO 0x200 /* HW read-only bit */
222#define _PAGE_INVALID 0x400 /* HW invalid bit */ 224#define _PAGE_INVALID 0x400 /* HW invalid bit */
223 225
diff --git a/arch/s390/include/asm/setup.h b/arch/s390/include/asm/setup.h
index e37478e87286..52a779c337e8 100644
--- a/arch/s390/include/asm/setup.h
+++ b/arch/s390/include/asm/setup.h
@@ -49,17 +49,12 @@ extern unsigned long memory_end;
49 49
50void detect_memory_layout(struct mem_chunk chunk[]); 50void detect_memory_layout(struct mem_chunk chunk[]);
51 51
52#ifdef CONFIG_S390_SWITCH_AMODE 52#define PRIMARY_SPACE_MODE 0
53extern unsigned int switch_amode; 53#define ACCESS_REGISTER_MODE 1
54#else 54#define SECONDARY_SPACE_MODE 2
55#define switch_amode (0) 55#define HOME_SPACE_MODE 3
56#endif 56
57 57extern unsigned int user_mode;
58#ifdef CONFIG_S390_EXEC_PROTECT
59extern unsigned int s390_noexec;
60#else
61#define s390_noexec (0)
62#endif
63 58
64/* 59/*
65 * Machine features detected in head.S 60 * Machine features detected in head.S
diff --git a/arch/s390/include/asm/smp.h b/arch/s390/include/asm/smp.h
index a868b272c257..2ab1141eeb50 100644
--- a/arch/s390/include/asm/smp.h
+++ b/arch/s390/include/asm/smp.h
@@ -1,57 +1,22 @@
1/* 1/*
2 * include/asm-s390/smp.h 2 * Copyright IBM Corp. 1999,2009
3 * 3 * Author(s): Denis Joseph Barrow,
4 * S390 version 4 * Martin Schwidefsky <schwidefsky@de.ibm.com>,
5 * Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation 5 * Heiko Carstens <heiko.carstens@de.ibm.com>,
6 * Author(s): Denis Joseph Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com),
7 * Martin Schwidefsky (schwidefsky@de.ibm.com)
8 * Heiko Carstens (heiko.carstens@de.ibm.com)
9 */ 6 */
10#ifndef __ASM_SMP_H 7#ifndef __ASM_SMP_H
11#define __ASM_SMP_H 8#define __ASM_SMP_H
12 9
13#include <linux/threads.h> 10#ifdef CONFIG_SMP
14#include <linux/cpumask.h>
15#include <linux/bitops.h>
16 11
17#if defined(__KERNEL__) && defined(CONFIG_SMP) && !defined(__ASSEMBLY__)
18
19#include <asm/lowcore.h>
20#include <asm/sigp.h>
21#include <asm/ptrace.h>
22#include <asm/system.h> 12#include <asm/system.h>
23 13#include <asm/sigp.h>
24/*
25 s390 specific smp.c headers
26 */
27typedef struct
28{
29 int intresting;
30 sigp_ccode ccode;
31 __u32 status;
32 __u16 cpu;
33} sigp_info;
34 14
35extern void machine_restart_smp(char *); 15extern void machine_restart_smp(char *);
36extern void machine_halt_smp(void); 16extern void machine_halt_smp(void);
37extern void machine_power_off_smp(void); 17extern void machine_power_off_smp(void);
38 18
39#define NO_PROC_ID 0xFF /* No processor magic marker */
40
41/*
42 * This magic constant controls our willingness to transfer
43 * a process across CPUs. Such a transfer incurs misses on the L1
44 * cache, and on a P6 or P5 with multiple L2 caches L2 hits. My
45 * gut feeling is this will vary by board in value. For a board
46 * with separate L2 cache it probably depends also on the RSS, and
47 * for a board with shared L2 cache it ought to decay fast as other
48 * processes are run.
49 */
50
51#define PROC_CHANGE_PENALTY 20 /* Schedule penalty */
52
53#define raw_smp_processor_id() (S390_lowcore.cpu_nr) 19#define raw_smp_processor_id() (S390_lowcore.cpu_nr)
54#define cpu_logical_map(cpu) (cpu)
55 20
56extern int __cpu_disable (void); 21extern int __cpu_disable (void);
57extern void __cpu_die (unsigned int cpu); 22extern void __cpu_die (unsigned int cpu);
@@ -64,7 +29,9 @@ extern int smp_cpu_polarization[];
64extern void arch_send_call_function_single_ipi(int cpu); 29extern void arch_send_call_function_single_ipi(int cpu);
65extern void arch_send_call_function_ipi_mask(const struct cpumask *mask); 30extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);
66 31
67#endif 32extern union save_area *zfcpdump_save_areas[NR_CPUS + 1];
33
34#endif /* CONFIG_SMP */
68 35
69#ifdef CONFIG_HOTPLUG_CPU 36#ifdef CONFIG_HOTPLUG_CPU
70extern int smp_rescan_cpus(void); 37extern int smp_rescan_cpus(void);
@@ -72,5 +39,4 @@ extern int smp_rescan_cpus(void);
72static inline int smp_rescan_cpus(void) { return 0; } 39static inline int smp_rescan_cpus(void) { return 0; }
73#endif 40#endif
74 41
75extern union save_area *zfcpdump_save_areas[NR_CPUS + 1]; 42#endif /* __ASM_SMP_H */
76#endif
diff --git a/arch/s390/include/asm/socket.h b/arch/s390/include/asm/socket.h
index e42df89a0b85..fdff1e995c73 100644
--- a/arch/s390/include/asm/socket.h
+++ b/arch/s390/include/asm/socket.h
@@ -68,4 +68,6 @@
68#define SO_PROTOCOL 38 68#define SO_PROTOCOL 38
69#define SO_DOMAIN 39 69#define SO_DOMAIN 39
70 70
71#define SO_RXQ_OVFL 40
72
71#endif /* _ASM_SOCKET_H */ 73#endif /* _ASM_SOCKET_H */
diff --git a/arch/s390/include/asm/sockios.h b/arch/s390/include/asm/sockios.h
index f4fc16c7da59..6f60eee73242 100644
--- a/arch/s390/include/asm/sockios.h
+++ b/arch/s390/include/asm/sockios.h
@@ -1,21 +1,6 @@
1/* 1#ifndef _ASM_S390_SOCKIOS_H
2 * include/asm-s390/sockios.h 2#define _ASM_S390_SOCKIOS_H
3 *
4 * S390 version
5 *
6 * Derived from "include/asm-i386/sockios.h"
7 */
8 3
9#ifndef __ARCH_S390_SOCKIOS__ 4#include <asm-generic/sockios.h>
10#define __ARCH_S390_SOCKIOS__
11
12/* Socket-level I/O control calls. */
13#define FIOSETOWN 0x8901
14#define SIOCSPGRP 0x8902
15#define FIOGETOWN 0x8903
16#define SIOCGPGRP 0x8904
17#define SIOCATMARK 0x8905
18#define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */
19#define SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */
20 5
21#endif 6#endif
diff --git a/arch/s390/include/asm/spinlock.h b/arch/s390/include/asm/spinlock.h
index 41ce6861174e..c9af0d19c7ab 100644
--- a/arch/s390/include/asm/spinlock.h
+++ b/arch/s390/include/asm/spinlock.h
@@ -191,33 +191,4 @@ static inline int __raw_write_trylock(raw_rwlock_t *rw)
191#define _raw_read_relax(lock) cpu_relax() 191#define _raw_read_relax(lock) cpu_relax()
192#define _raw_write_relax(lock) cpu_relax() 192#define _raw_write_relax(lock) cpu_relax()
193 193
194#define __always_inline__spin_lock
195#define __always_inline__read_lock
196#define __always_inline__write_lock
197#define __always_inline__spin_lock_bh
198#define __always_inline__read_lock_bh
199#define __always_inline__write_lock_bh
200#define __always_inline__spin_lock_irq
201#define __always_inline__read_lock_irq
202#define __always_inline__write_lock_irq
203#define __always_inline__spin_lock_irqsave
204#define __always_inline__read_lock_irqsave
205#define __always_inline__write_lock_irqsave
206#define __always_inline__spin_trylock
207#define __always_inline__read_trylock
208#define __always_inline__write_trylock
209#define __always_inline__spin_trylock_bh
210#define __always_inline__spin_unlock
211#define __always_inline__read_unlock
212#define __always_inline__write_unlock
213#define __always_inline__spin_unlock_bh
214#define __always_inline__read_unlock_bh
215#define __always_inline__write_unlock_bh
216#define __always_inline__spin_unlock_irq
217#define __always_inline__read_unlock_irq
218#define __always_inline__write_unlock_irq
219#define __always_inline__spin_unlock_irqrestore
220#define __always_inline__read_unlock_irqrestore
221#define __always_inline__write_unlock_irqrestore
222
223#endif /* __ASM_SPINLOCK_H */ 194#endif /* __ASM_SPINLOCK_H */
diff --git a/arch/s390/include/asm/termbits.h b/arch/s390/include/asm/termbits.h
index 58731853d529..71bf6ac6a2b9 100644
--- a/arch/s390/include/asm/termbits.h
+++ b/arch/s390/include/asm/termbits.h
@@ -1,206 +1,6 @@
1/* 1#ifndef _ASM_S390_TERMBITS_H
2 * include/asm-s390/termbits.h 2#define _ASM_S390_TERMBITS_H
3 *
4 * S390 version
5 *
6 * Derived from "include/asm-i386/termbits.h"
7 */
8 3
9#ifndef __ARCH_S390_TERMBITS_H__ 4#include <asm-generic/termbits.h>
10#define __ARCH_S390_TERMBITS_H__
11
12#include <linux/posix_types.h>
13
14typedef unsigned char cc_t;
15typedef unsigned int speed_t;
16typedef unsigned int tcflag_t;
17
18#define NCCS 19
19struct termios {
20 tcflag_t c_iflag; /* input mode flags */
21 tcflag_t c_oflag; /* output mode flags */
22 tcflag_t c_cflag; /* control mode flags */
23 tcflag_t c_lflag; /* local mode flags */
24 cc_t c_line; /* line discipline */
25 cc_t c_cc[NCCS]; /* control characters */
26};
27
28struct termios2 {
29 tcflag_t c_iflag; /* input mode flags */
30 tcflag_t c_oflag; /* output mode flags */
31 tcflag_t c_cflag; /* control mode flags */
32 tcflag_t c_lflag; /* local mode flags */
33 cc_t c_line; /* line discipline */
34 cc_t c_cc[NCCS]; /* control characters */
35 speed_t c_ispeed; /* input speed */
36 speed_t c_ospeed; /* output speed */
37};
38
39struct ktermios {
40 tcflag_t c_iflag; /* input mode flags */
41 tcflag_t c_oflag; /* output mode flags */
42 tcflag_t c_cflag; /* control mode flags */
43 tcflag_t c_lflag; /* local mode flags */
44 cc_t c_line; /* line discipline */
45 cc_t c_cc[NCCS]; /* control characters */
46 speed_t c_ispeed; /* input speed */
47 speed_t c_ospeed; /* output speed */
48};
49
50/* c_cc characters */
51#define VINTR 0
52#define VQUIT 1
53#define VERASE 2
54#define VKILL 3
55#define VEOF 4
56#define VTIME 5
57#define VMIN 6
58#define VSWTC 7
59#define VSTART 8
60#define VSTOP 9
61#define VSUSP 10
62#define VEOL 11
63#define VREPRINT 12
64#define VDISCARD 13
65#define VWERASE 14
66#define VLNEXT 15
67#define VEOL2 16
68
69/* c_iflag bits */
70#define IGNBRK 0000001
71#define BRKINT 0000002
72#define IGNPAR 0000004
73#define PARMRK 0000010
74#define INPCK 0000020
75#define ISTRIP 0000040
76#define INLCR 0000100
77#define IGNCR 0000200
78#define ICRNL 0000400
79#define IUCLC 0001000
80#define IXON 0002000
81#define IXANY 0004000
82#define IXOFF 0010000
83#define IMAXBEL 0020000
84#define IUTF8 0040000
85
86/* c_oflag bits */
87#define OPOST 0000001
88#define OLCUC 0000002
89#define ONLCR 0000004
90#define OCRNL 0000010
91#define ONOCR 0000020
92#define ONLRET 0000040
93#define OFILL 0000100
94#define OFDEL 0000200
95#define NLDLY 0000400
96#define NL0 0000000
97#define NL1 0000400
98#define CRDLY 0003000
99#define CR0 0000000
100#define CR1 0001000
101#define CR2 0002000
102#define CR3 0003000
103#define TABDLY 0014000
104#define TAB0 0000000
105#define TAB1 0004000
106#define TAB2 0010000
107#define TAB3 0014000
108#define XTABS 0014000
109#define BSDLY 0020000
110#define BS0 0000000
111#define BS1 0020000
112#define VTDLY 0040000
113#define VT0 0000000
114#define VT1 0040000
115#define FFDLY 0100000
116#define FF0 0000000
117#define FF1 0100000
118
119/* c_cflag bit meaning */
120#define CBAUD 0010017
121#define B0 0000000 /* hang up */
122#define B50 0000001
123#define B75 0000002
124#define B110 0000003
125#define B134 0000004
126#define B150 0000005
127#define B200 0000006
128#define B300 0000007
129#define B600 0000010
130#define B1200 0000011
131#define B1800 0000012
132#define B2400 0000013
133#define B4800 0000014
134#define B9600 0000015
135#define B19200 0000016
136#define B38400 0000017
137#define EXTA B19200
138#define EXTB B38400
139#define CSIZE 0000060
140#define CS5 0000000
141#define CS6 0000020
142#define CS7 0000040
143#define CS8 0000060
144#define CSTOPB 0000100
145#define CREAD 0000200
146#define PARENB 0000400
147#define PARODD 0001000
148#define HUPCL 0002000
149#define CLOCAL 0004000
150#define CBAUDEX 0010000
151#define BOTHER 0010000
152#define B57600 0010001
153#define B115200 0010002
154#define B230400 0010003
155#define B460800 0010004
156#define B500000 0010005
157#define B576000 0010006
158#define B921600 0010007
159#define B1000000 0010010
160#define B1152000 0010011
161#define B1500000 0010012
162#define B2000000 0010013
163#define B2500000 0010014
164#define B3000000 0010015
165#define B3500000 0010016
166#define B4000000 0010017
167#define CIBAUD 002003600000 /* input baud rate */
168#define CMSPAR 010000000000 /* mark or space (stick) parity */
169#define CRTSCTS 020000000000 /* flow control */
170
171#define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */
172
173/* c_lflag bits */
174#define ISIG 0000001
175#define ICANON 0000002
176#define XCASE 0000004
177#define ECHO 0000010
178#define ECHOE 0000020
179#define ECHOK 0000040
180#define ECHONL 0000100
181#define NOFLSH 0000200
182#define TOSTOP 0000400
183#define ECHOCTL 0001000
184#define ECHOPRT 0002000
185#define ECHOKE 0004000
186#define FLUSHO 0010000
187#define PENDIN 0040000
188#define IEXTEN 0100000
189
190/* tcflow() and TCXONC use these */
191#define TCOOFF 0
192#define TCOON 1
193#define TCIOFF 2
194#define TCION 3
195
196/* tcflush() and TCFLSH use these */
197#define TCIFLUSH 0
198#define TCOFLUSH 1
199#define TCIOFLUSH 2
200
201/* tcsetattr uses these */
202#define TCSANOW 0
203#define TCSADRAIN 1
204#define TCSAFLUSH 2
205 5
206#endif 6#endif
diff --git a/arch/s390/include/asm/todclk.h b/arch/s390/include/asm/todclk.h
deleted file mode 100644
index c7f62055488a..000000000000
--- a/arch/s390/include/asm/todclk.h
+++ /dev/null
@@ -1,23 +0,0 @@
1/*
2 * File...........: linux/include/asm/todclk.h
3 * Author(s)......: Holger Smolinski <Holger.Smolinski@de.ibm.com>
4 * Bugreports.to..: <Linux390@de.ibm.com>
5 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000
6 *
7 * History of changes (starts July 2000)
8 */
9
10#ifndef __ASM_TODCLK_H
11#define __ASM_TODCLK_H
12
13#ifdef __KERNEL__
14
15#define TOD_uSEC (0x1000ULL)
16#define TOD_mSEC (1000 * TOD_uSEC)
17#define TOD_SEC (1000 * TOD_mSEC)
18#define TOD_MIN (60 * TOD_SEC)
19#define TOD_HOUR (60 * TOD_MIN)
20
21#endif
22
23#endif
diff --git a/arch/s390/include/asm/uaccess.h b/arch/s390/include/asm/uaccess.h
index 8377e91533d2..cbf0a8745bf4 100644
--- a/arch/s390/include/asm/uaccess.h
+++ b/arch/s390/include/asm/uaccess.h
@@ -93,6 +93,8 @@ extern struct uaccess_ops uaccess_mvcos;
93extern struct uaccess_ops uaccess_mvcos_switch; 93extern struct uaccess_ops uaccess_mvcos_switch;
94extern struct uaccess_ops uaccess_pt; 94extern struct uaccess_ops uaccess_pt;
95 95
96extern int __handle_fault(unsigned long, unsigned long, int);
97
96static inline int __put_user_fn(size_t size, void __user *ptr, void *x) 98static inline int __put_user_fn(size_t size, void __user *ptr, void *x)
97{ 99{
98 size = uaccess.copy_to_user_small(size, ptr, x); 100 size = uaccess.copy_to_user_small(size, ptr, x);
diff --git a/arch/s390/kernel/Makefile b/arch/s390/kernel/Makefile
index c7be8e10b87e..683f6381cc59 100644
--- a/arch/s390/kernel/Makefile
+++ b/arch/s390/kernel/Makefile
@@ -44,6 +44,7 @@ obj-$(CONFIG_KPROBES) += kprobes.o
44obj-$(CONFIG_FUNCTION_TRACER) += $(if $(CONFIG_64BIT),mcount64.o,mcount.o) 44obj-$(CONFIG_FUNCTION_TRACER) += $(if $(CONFIG_64BIT),mcount64.o,mcount.o)
45obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o 45obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o
46obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += ftrace.o 46obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += ftrace.o
47obj-$(CONFIG_FTRACE_SYSCALLS) += ftrace.o
47 48
48# Kexec part 49# Kexec part
49S390_KEXEC_OBJS := machine_kexec.o crash.o 50S390_KEXEC_OBJS := machine_kexec.o crash.o
diff --git a/arch/s390/kernel/compat_linux.c b/arch/s390/kernel/compat_linux.c
index 0debcec23a39..25c31d681402 100644
--- a/arch/s390/kernel/compat_linux.c
+++ b/arch/s390/kernel/compat_linux.c
@@ -31,14 +31,8 @@
31#include <linux/shm.h> 31#include <linux/shm.h>
32#include <linux/slab.h> 32#include <linux/slab.h>
33#include <linux/uio.h> 33#include <linux/uio.h>
34#include <linux/nfs_fs.h>
35#include <linux/quota.h> 34#include <linux/quota.h>
36#include <linux/module.h> 35#include <linux/module.h>
37#include <linux/sunrpc/svc.h>
38#include <linux/nfsd/nfsd.h>
39#include <linux/nfsd/cache.h>
40#include <linux/nfsd/xdr.h>
41#include <linux/nfsd/syscall.h>
42#include <linux/poll.h> 36#include <linux/poll.h>
43#include <linux/personality.h> 37#include <linux/personality.h>
44#include <linux/stat.h> 38#include <linux/stat.h>
@@ -527,59 +521,6 @@ asmlinkage long sys32_sendfile64(int out_fd, int in_fd,
527 return ret; 521 return ret;
528} 522}
529 523
530#ifdef CONFIG_SYSCTL_SYSCALL
531struct __sysctl_args32 {
532 u32 name;
533 int nlen;
534 u32 oldval;
535 u32 oldlenp;
536 u32 newval;
537 u32 newlen;
538 u32 __unused[4];
539};
540
541asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args)
542{
543 struct __sysctl_args32 tmp;
544 int error;
545 size_t oldlen;
546 size_t __user *oldlenp = NULL;
547 unsigned long addr = (((unsigned long)&args->__unused[0]) + 7) & ~7;
548
549 if (copy_from_user(&tmp, args, sizeof(tmp)))
550 return -EFAULT;
551
552 if (tmp.oldval && tmp.oldlenp) {
553 /* Duh, this is ugly and might not work if sysctl_args
554 is in read-only memory, but do_sysctl does indirectly
555 a lot of uaccess in both directions and we'd have to
556 basically copy the whole sysctl.c here, and
557 glibc's __sysctl uses rw memory for the structure
558 anyway. */
559 if (get_user(oldlen, (u32 __user *)compat_ptr(tmp.oldlenp)) ||
560 put_user(oldlen, (size_t __user *)addr))
561 return -EFAULT;
562 oldlenp = (size_t __user *)addr;
563 }
564
565 lock_kernel();
566 error = do_sysctl(compat_ptr(tmp.name), tmp.nlen, compat_ptr(tmp.oldval),
567 oldlenp, compat_ptr(tmp.newval), tmp.newlen);
568 unlock_kernel();
569 if (oldlenp) {
570 if (!error) {
571 if (get_user(oldlen, (size_t __user *)addr) ||
572 put_user(oldlen, (u32 __user *)compat_ptr(tmp.oldlenp)))
573 error = -EFAULT;
574 }
575 if (copy_to_user(args->__unused, tmp.__unused,
576 sizeof(tmp.__unused)))
577 error = -EFAULT;
578 }
579 return error;
580}
581#endif
582
583struct stat64_emu31 { 524struct stat64_emu31 {
584 unsigned long long st_dev; 525 unsigned long long st_dev;
585 unsigned int __pad1; 526 unsigned int __pad1;
diff --git a/arch/s390/kernel/compat_linux.h b/arch/s390/kernel/compat_linux.h
index c07f9ca05ade..cb97afc85c94 100644
--- a/arch/s390/kernel/compat_linux.h
+++ b/arch/s390/kernel/compat_linux.h
@@ -4,10 +4,6 @@
4#include <linux/compat.h> 4#include <linux/compat.h>
5#include <linux/socket.h> 5#include <linux/socket.h>
6#include <linux/syscalls.h> 6#include <linux/syscalls.h>
7#include <linux/nfs_fs.h>
8#include <linux/sunrpc/svc.h>
9#include <linux/nfsd/nfsd.h>
10#include <linux/nfsd/export.h>
11 7
12/* Macro that masks the high order bit of an 32 bit pointer and converts it*/ 8/* Macro that masks the high order bit of an 32 bit pointer and converts it*/
13/* to a 64 bit pointer */ 9/* to a 64 bit pointer */
@@ -162,7 +158,6 @@ struct ucontext32 {
162 compat_sigset_t uc_sigmask; /* mask last for extensibility */ 158 compat_sigset_t uc_sigmask; /* mask last for extensibility */
163}; 159};
164 160
165struct __sysctl_args32;
166struct stat64_emu31; 161struct stat64_emu31;
167struct mmap_arg_struct_emu31; 162struct mmap_arg_struct_emu31;
168struct fadvise64_64_args; 163struct fadvise64_64_args;
@@ -212,7 +207,6 @@ long sys32_sendfile(int out_fd, int in_fd, compat_off_t __user *offset,
212 size_t count); 207 size_t count);
213long sys32_sendfile64(int out_fd, int in_fd, compat_loff_t __user *offset, 208long sys32_sendfile64(int out_fd, int in_fd, compat_loff_t __user *offset,
214 s32 count); 209 s32 count);
215long sys32_sysctl(struct __sysctl_args32 __user *args);
216long sys32_stat64(char __user * filename, struct stat64_emu31 __user * statbuf); 210long sys32_stat64(char __user * filename, struct stat64_emu31 __user * statbuf);
217long sys32_lstat64(char __user * filename, 211long sys32_lstat64(char __user * filename,
218 struct stat64_emu31 __user * statbuf); 212 struct stat64_emu31 __user * statbuf);
diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S
index cbd9901dc0f8..30de2d0e52bb 100644
--- a/arch/s390/kernel/compat_wrapper.S
+++ b/arch/s390/kernel/compat_wrapper.S
@@ -689,8 +689,6 @@ sys32_fdatasync_wrapper:
689 llgfr %r2,%r2 # unsigned int 689 llgfr %r2,%r2 # unsigned int
690 jg sys_fdatasync # branch to system call 690 jg sys_fdatasync # branch to system call
691 691
692#sys32_sysctl_wrapper # tbd
693
694 .globl sys32_mlock_wrapper 692 .globl sys32_mlock_wrapper
695sys32_mlock_wrapper: 693sys32_mlock_wrapper:
696 llgfr %r2,%r2 # unsigned long 694 llgfr %r2,%r2 # unsigned long
@@ -1087,8 +1085,8 @@ sys32_stime_wrapper:
1087 1085
1088 .globl sys32_sysctl_wrapper 1086 .globl sys32_sysctl_wrapper
1089sys32_sysctl_wrapper: 1087sys32_sysctl_wrapper:
1090 llgtr %r2,%r2 # struct __sysctl_args32 * 1088 llgtr %r2,%r2 # struct compat_sysctl_args *
1091 jg sys32_sysctl 1089 jg compat_sys_sysctl
1092 1090
1093 .globl sys32_fstat64_wrapper 1091 .globl sys32_fstat64_wrapper
1094sys32_fstat64_wrapper: 1092sys32_fstat64_wrapper:
diff --git a/arch/s390/kernel/debug.c b/arch/s390/kernel/debug.c
index 20f282c911c2..071c81f179ef 100644
--- a/arch/s390/kernel/debug.c
+++ b/arch/s390/kernel/debug.c
@@ -893,35 +893,30 @@ s390dbf_procactive(ctl_table *table, int write,
893 893
894static struct ctl_table s390dbf_table[] = { 894static struct ctl_table s390dbf_table[] = {
895 { 895 {
896 .ctl_name = CTL_S390DBF_STOPPABLE,
897 .procname = "debug_stoppable", 896 .procname = "debug_stoppable",
898 .data = &debug_stoppable, 897 .data = &debug_stoppable,
899 .maxlen = sizeof(int), 898 .maxlen = sizeof(int),
900 .mode = S_IRUGO | S_IWUSR, 899 .mode = S_IRUGO | S_IWUSR,
901 .proc_handler = &proc_dointvec, 900 .proc_handler = proc_dointvec,
902 .strategy = &sysctl_intvec,
903 }, 901 },
904 { 902 {
905 .ctl_name = CTL_S390DBF_ACTIVE,
906 .procname = "debug_active", 903 .procname = "debug_active",
907 .data = &debug_active, 904 .data = &debug_active,
908 .maxlen = sizeof(int), 905 .maxlen = sizeof(int),
909 .mode = S_IRUGO | S_IWUSR, 906 .mode = S_IRUGO | S_IWUSR,
910 .proc_handler = &s390dbf_procactive, 907 .proc_handler = s390dbf_procactive,
911 .strategy = &sysctl_intvec,
912 }, 908 },
913 { .ctl_name = 0 } 909 { }
914}; 910};
915 911
916static struct ctl_table s390dbf_dir_table[] = { 912static struct ctl_table s390dbf_dir_table[] = {
917 { 913 {
918 .ctl_name = CTL_S390DBF,
919 .procname = "s390dbf", 914 .procname = "s390dbf",
920 .maxlen = 0, 915 .maxlen = 0,
921 .mode = S_IRUGO | S_IXUGO, 916 .mode = S_IRUGO | S_IXUGO,
922 .child = s390dbf_table, 917 .child = s390dbf_table,
923 }, 918 },
924 { .ctl_name = 0 } 919 { }
925}; 920};
926 921
927static struct ctl_table_header *s390dbf_sysctl_header; 922static struct ctl_table_header *s390dbf_sysctl_header;
diff --git a/arch/s390/kernel/ftrace.c b/arch/s390/kernel/ftrace.c
index f5fe34dd821b..5a82bc68193e 100644
--- a/arch/s390/kernel/ftrace.c
+++ b/arch/s390/kernel/ftrace.c
@@ -203,73 +203,10 @@ out:
203 203
204#ifdef CONFIG_FTRACE_SYSCALLS 204#ifdef CONFIG_FTRACE_SYSCALLS
205 205
206extern unsigned long __start_syscalls_metadata[];
207extern unsigned long __stop_syscalls_metadata[];
208extern unsigned int sys_call_table[]; 206extern unsigned int sys_call_table[];
209 207
210static struct syscall_metadata **syscalls_metadata; 208unsigned long __init arch_syscall_addr(int nr)
211
212struct syscall_metadata *syscall_nr_to_meta(int nr)
213{
214 if (!syscalls_metadata || nr >= NR_syscalls || nr < 0)
215 return NULL;
216
217 return syscalls_metadata[nr];
218}
219
220int syscall_name_to_nr(char *name)
221{
222 int i;
223
224 if (!syscalls_metadata)
225 return -1;
226 for (i = 0; i < NR_syscalls; i++)
227 if (syscalls_metadata[i])
228 if (!strcmp(syscalls_metadata[i]->name, name))
229 return i;
230 return -1;
231}
232
233void set_syscall_enter_id(int num, int id)
234{
235 syscalls_metadata[num]->enter_id = id;
236}
237
238void set_syscall_exit_id(int num, int id)
239{ 209{
240 syscalls_metadata[num]->exit_id = id; 210 return (unsigned long)sys_call_table[nr];
241}
242
243static struct syscall_metadata *find_syscall_meta(unsigned long syscall)
244{
245 struct syscall_metadata *start;
246 struct syscall_metadata *stop;
247 char str[KSYM_SYMBOL_LEN];
248
249 start = (struct syscall_metadata *)__start_syscalls_metadata;
250 stop = (struct syscall_metadata *)__stop_syscalls_metadata;
251 kallsyms_lookup(syscall, NULL, NULL, NULL, str);
252
253 for ( ; start < stop; start++) {
254 if (start->name && !strcmp(start->name + 3, str + 3))
255 return start;
256 }
257 return NULL;
258}
259
260static int __init arch_init_ftrace_syscalls(void)
261{
262 struct syscall_metadata *meta;
263 int i;
264 syscalls_metadata = kzalloc(sizeof(*syscalls_metadata) * NR_syscalls,
265 GFP_KERNEL);
266 if (!syscalls_metadata)
267 return -ENOMEM;
268 for (i = 0; i < NR_syscalls; i++) {
269 meta = find_syscall_meta((unsigned long)sys_call_table[i]);
270 syscalls_metadata[i] = meta;
271 }
272 return 0;
273} 211}
274arch_initcall(arch_init_ftrace_syscalls);
275#endif 212#endif
diff --git a/arch/s390/kernel/head64.S b/arch/s390/kernel/head64.S
index 6a250808092b..d984a2a380c3 100644
--- a/arch/s390/kernel/head64.S
+++ b/arch/s390/kernel/head64.S
@@ -83,6 +83,8 @@ startup_continue:
83 slr %r0,%r0 # set cpuid to zero 83 slr %r0,%r0 # set cpuid to zero
84 sigp %r1,%r0,0x12 # switch to esame mode 84 sigp %r1,%r0,0x12 # switch to esame mode
85 sam64 # switch to 64 bit mode 85 sam64 # switch to 64 bit mode
86 llgfr %r13,%r13 # clear high-order half of base reg
87 lmh %r0,%r15,.Lzero64-.LPG1(%r13) # clear high-order half
86 lctlg %c0,%c15,.Lctl-.LPG1(%r13) # load control registers 88 lctlg %c0,%c15,.Lctl-.LPG1(%r13) # load control registers
87 lg %r12,.Lparmaddr-.LPG1(%r13) # pointer to parameter area 89 lg %r12,.Lparmaddr-.LPG1(%r13) # pointer to parameter area
88 # move IPL device to lowcore 90 # move IPL device to lowcore
@@ -127,6 +129,7 @@ startup_continue:
127.L4malign:.quad 0xffffffffffc00000 129.L4malign:.quad 0xffffffffffc00000
128.Lscan2g:.quad 0x80000000 + 0x20000 - 8 # 2GB + 128K - 8 130.Lscan2g:.quad 0x80000000 + 0x20000 - 8 # 2GB + 128K - 8
129.Lnop: .long 0x07000700 131.Lnop: .long 0x07000700
132.Lzero64:.fill 16,4,0x0
130#ifdef CONFIG_ZFCPDUMP 133#ifdef CONFIG_ZFCPDUMP
131.Lcurrent_cpu: 134.Lcurrent_cpu:
132 .long 0x0 135 .long 0x0
diff --git a/arch/s390/kernel/s390_ext.c b/arch/s390/kernel/s390_ext.c
index 0de305b598ce..59618bcd99b7 100644
--- a/arch/s390/kernel/s390_ext.c
+++ b/arch/s390/kernel/s390_ext.c
@@ -126,6 +126,8 @@ void __irq_entry do_extint(struct pt_regs *regs, unsigned short code)
126 /* Serve timer interrupts first. */ 126 /* Serve timer interrupts first. */
127 clock_comparator_work(); 127 clock_comparator_work();
128 kstat_cpu(smp_processor_id()).irqs[EXTERNAL_INTERRUPT]++; 128 kstat_cpu(smp_processor_id()).irqs[EXTERNAL_INTERRUPT]++;
129 if (code != 0x1004)
130 __get_cpu_var(s390_idle).nohz_delay = 1;
129 index = ext_hash(code); 131 index = ext_hash(code);
130 for (p = ext_int_hash[index]; p; p = p->next) { 132 for (p = ext_int_hash[index]; p; p = p->next) {
131 if (likely(p->code == code)) 133 if (likely(p->code == code))
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index 061479ff029f..0663287fa1b3 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -305,9 +305,8 @@ static int __init early_parse_mem(char *p)
305} 305}
306early_param("mem", early_parse_mem); 306early_param("mem", early_parse_mem);
307 307
308#ifdef CONFIG_S390_SWITCH_AMODE 308unsigned int user_mode = HOME_SPACE_MODE;
309unsigned int switch_amode = 0; 309EXPORT_SYMBOL_GPL(user_mode);
310EXPORT_SYMBOL_GPL(switch_amode);
311 310
312static int set_amode_and_uaccess(unsigned long user_amode, 311static int set_amode_and_uaccess(unsigned long user_amode,
313 unsigned long user32_amode) 312 unsigned long user32_amode)
@@ -340,23 +339,29 @@ static int set_amode_and_uaccess(unsigned long user_amode,
340 */ 339 */
341static int __init early_parse_switch_amode(char *p) 340static int __init early_parse_switch_amode(char *p)
342{ 341{
343 switch_amode = 1; 342 if (user_mode != SECONDARY_SPACE_MODE)
343 user_mode = PRIMARY_SPACE_MODE;
344 return 0; 344 return 0;
345} 345}
346early_param("switch_amode", early_parse_switch_amode); 346early_param("switch_amode", early_parse_switch_amode);
347 347
348#else /* CONFIG_S390_SWITCH_AMODE */ 348static int __init early_parse_user_mode(char *p)
349static inline int set_amode_and_uaccess(unsigned long user_amode,
350 unsigned long user32_amode)
351{ 349{
350 if (p && strcmp(p, "primary") == 0)
351 user_mode = PRIMARY_SPACE_MODE;
352#ifdef CONFIG_S390_EXEC_PROTECT
353 else if (p && strcmp(p, "secondary") == 0)
354 user_mode = SECONDARY_SPACE_MODE;
355#endif
356 else if (!p || strcmp(p, "home") == 0)
357 user_mode = HOME_SPACE_MODE;
358 else
359 return 1;
352 return 0; 360 return 0;
353} 361}
354#endif /* CONFIG_S390_SWITCH_AMODE */ 362early_param("user_mode", early_parse_user_mode);
355 363
356#ifdef CONFIG_S390_EXEC_PROTECT 364#ifdef CONFIG_S390_EXEC_PROTECT
357unsigned int s390_noexec = 0;
358EXPORT_SYMBOL_GPL(s390_noexec);
359
360/* 365/*
361 * Enable execute protection? 366 * Enable execute protection?
362 */ 367 */
@@ -364,8 +369,7 @@ static int __init early_parse_noexec(char *p)
364{ 369{
365 if (!strncmp(p, "off", 3)) 370 if (!strncmp(p, "off", 3))
366 return 0; 371 return 0;
367 switch_amode = 1; 372 user_mode = SECONDARY_SPACE_MODE;
368 s390_noexec = 1;
369 return 0; 373 return 0;
370} 374}
371early_param("noexec", early_parse_noexec); 375early_param("noexec", early_parse_noexec);
@@ -373,7 +377,7 @@ early_param("noexec", early_parse_noexec);
373 377
374static void setup_addressing_mode(void) 378static void setup_addressing_mode(void)
375{ 379{
376 if (s390_noexec) { 380 if (user_mode == SECONDARY_SPACE_MODE) {
377 if (set_amode_and_uaccess(PSW_ASC_SECONDARY, 381 if (set_amode_and_uaccess(PSW_ASC_SECONDARY,
378 PSW32_ASC_SECONDARY)) 382 PSW32_ASC_SECONDARY))
379 pr_info("Execute protection active, " 383 pr_info("Execute protection active, "
@@ -381,7 +385,7 @@ static void setup_addressing_mode(void)
381 else 385 else
382 pr_info("Execute protection active, " 386 pr_info("Execute protection active, "
383 "mvcos not available\n"); 387 "mvcos not available\n");
384 } else if (switch_amode) { 388 } else if (user_mode == PRIMARY_SPACE_MODE) {
385 if (set_amode_and_uaccess(PSW_ASC_PRIMARY, PSW32_ASC_PRIMARY)) 389 if (set_amode_and_uaccess(PSW_ASC_PRIMARY, PSW32_ASC_PRIMARY))
386 pr_info("Address spaces switched, " 390 pr_info("Address spaces switched, "
387 "mvcos available\n"); 391 "mvcos available\n");
@@ -411,7 +415,7 @@ setup_lowcore(void)
411 lc->restart_psw.mask = PSW_BASE_BITS | PSW_DEFAULT_KEY; 415 lc->restart_psw.mask = PSW_BASE_BITS | PSW_DEFAULT_KEY;
412 lc->restart_psw.addr = 416 lc->restart_psw.addr =
413 PSW_ADDR_AMODE | (unsigned long) restart_int_handler; 417 PSW_ADDR_AMODE | (unsigned long) restart_int_handler;
414 if (switch_amode) 418 if (user_mode != HOME_SPACE_MODE)
415 lc->restart_psw.mask |= PSW_ASC_HOME; 419 lc->restart_psw.mask |= PSW_ASC_HOME;
416 lc->external_new_psw.mask = psw_kernel_bits; 420 lc->external_new_psw.mask = psw_kernel_bits;
417 lc->external_new_psw.addr = 421 lc->external_new_psw.addr =
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c
index 34162a0b2caa..65065ac48ed3 100644
--- a/arch/s390/kernel/time.c
+++ b/arch/s390/kernel/time.c
@@ -214,7 +214,8 @@ struct clocksource * __init clocksource_default_clock(void)
214 return &clocksource_tod; 214 return &clocksource_tod;
215} 215}
216 216
217void update_vsyscall(struct timespec *wall_time, struct clocksource *clock) 217void update_vsyscall(struct timespec *wall_time, struct clocksource *clock,
218 u32 mult)
218{ 219{
219 if (clock != &clocksource_tod) 220 if (clock != &clocksource_tod)
220 return; 221 return;
@@ -334,7 +335,7 @@ int get_sync_clock(unsigned long long *clock)
334 sw0 = atomic_read(sw_ptr); 335 sw0 = atomic_read(sw_ptr);
335 *clock = get_clock(); 336 *clock = get_clock();
336 sw1 = atomic_read(sw_ptr); 337 sw1 = atomic_read(sw_ptr);
337 put_cpu_var(clock_sync_sync); 338 put_cpu_var(clock_sync_word);
338 if (sw0 == sw1 && (sw0 & 0x80000000U)) 339 if (sw0 == sw1 && (sw0 & 0x80000000U))
339 /* Success: time is in sync. */ 340 /* Success: time is in sync. */
340 return 0; 341 return 0;
@@ -384,7 +385,7 @@ static inline int check_sync_clock(void)
384 385
385 sw_ptr = &get_cpu_var(clock_sync_word); 386 sw_ptr = &get_cpu_var(clock_sync_word);
386 rc = (atomic_read(sw_ptr) & 0x80000000U) != 0; 387 rc = (atomic_read(sw_ptr) & 0x80000000U) != 0;
387 put_cpu_var(clock_sync_sync); 388 put_cpu_var(clock_sync_word);
388 return rc; 389 return rc;
389} 390}
390 391
diff --git a/arch/s390/kernel/vdso.c b/arch/s390/kernel/vdso.c
index adfb32aa6d59..5f99e66c51c3 100644
--- a/arch/s390/kernel/vdso.c
+++ b/arch/s390/kernel/vdso.c
@@ -86,7 +86,8 @@ static void vdso_init_data(struct vdso_data *vd)
86 unsigned int facility_list; 86 unsigned int facility_list;
87 87
88 facility_list = stfl(); 88 facility_list = stfl();
89 vd->ectg_available = switch_amode && (facility_list & 1); 89 vd->ectg_available =
90 user_mode != HOME_SPACE_MODE && (facility_list & 1);
90} 91}
91 92
92#ifdef CONFIG_64BIT 93#ifdef CONFIG_64BIT
@@ -114,7 +115,7 @@ int vdso_alloc_per_cpu(int cpu, struct _lowcore *lowcore)
114 115
115 lowcore->vdso_per_cpu_data = __LC_PASTE; 116 lowcore->vdso_per_cpu_data = __LC_PASTE;
116 117
117 if (!switch_amode || !vdso_enabled) 118 if (user_mode == HOME_SPACE_MODE || !vdso_enabled)
118 return 0; 119 return 0;
119 120
120 segment_table = __get_free_pages(GFP_KERNEL, SEGMENT_ORDER); 121 segment_table = __get_free_pages(GFP_KERNEL, SEGMENT_ORDER);
@@ -160,7 +161,7 @@ void vdso_free_per_cpu(int cpu, struct _lowcore *lowcore)
160 unsigned long segment_table, page_table, page_frame; 161 unsigned long segment_table, page_table, page_frame;
161 u32 *psal, *aste; 162 u32 *psal, *aste;
162 163
163 if (!switch_amode || !vdso_enabled) 164 if (user_mode == HOME_SPACE_MODE || !vdso_enabled)
164 return; 165 return;
165 166
166 psal = (u32 *)(addr_t) lowcore->paste[4]; 167 psal = (u32 *)(addr_t) lowcore->paste[4];
@@ -184,7 +185,7 @@ static void __vdso_init_cr5(void *dummy)
184 185
185static void vdso_init_cr5(void) 186static void vdso_init_cr5(void)
186{ 187{
187 if (switch_amode && vdso_enabled) 188 if (user_mode != HOME_SPACE_MODE && vdso_enabled)
188 on_each_cpu(__vdso_init_cr5, NULL, 1); 189 on_each_cpu(__vdso_init_cr5, NULL, 1);
189} 190}
190#endif /* CONFIG_64BIT */ 191#endif /* CONFIG_64BIT */
diff --git a/arch/s390/kernel/vtime.c b/arch/s390/kernel/vtime.c
index c41bb0d416e1..b59a812a010e 100644
--- a/arch/s390/kernel/vtime.c
+++ b/arch/s390/kernel/vtime.c
@@ -167,6 +167,8 @@ void vtime_stop_cpu(void)
167 /* Wait for external, I/O or machine check interrupt. */ 167 /* Wait for external, I/O or machine check interrupt. */
168 psw.mask = psw_kernel_bits | PSW_MASK_WAIT | PSW_MASK_IO | PSW_MASK_EXT; 168 psw.mask = psw_kernel_bits | PSW_MASK_WAIT | PSW_MASK_IO | PSW_MASK_EXT;
169 169
170 idle->nohz_delay = 0;
171
170 /* Check if the CPU timer needs to be reprogrammed. */ 172 /* Check if the CPU timer needs to be reprogrammed. */
171 if (vq->do_spt) { 173 if (vq->do_spt) {
172 __u64 vmax = VTIMER_MAX_SLICE; 174 __u64 vmax = VTIMER_MAX_SLICE;
diff --git a/arch/s390/kvm/Kconfig b/arch/s390/kvm/Kconfig
index bf164fc21864..6ee55ae84ce2 100644
--- a/arch/s390/kvm/Kconfig
+++ b/arch/s390/kvm/Kconfig
@@ -20,7 +20,6 @@ config KVM
20 depends on HAVE_KVM && EXPERIMENTAL 20 depends on HAVE_KVM && EXPERIMENTAL
21 select PREEMPT_NOTIFIERS 21 select PREEMPT_NOTIFIERS
22 select ANON_INODES 22 select ANON_INODES
23 select S390_SWITCH_AMODE
24 ---help--- 23 ---help---
25 Support hosting paravirtualized guest machines using the SIE 24 Support hosting paravirtualized guest machines using the SIE
26 virtualization capability on the mainframe. This should work 25 virtualization capability on the mainframe. This should work
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index 07ced89740d7..f8bcaefd7d34 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -74,9 +74,10 @@ struct kvm_stats_debugfs_item debugfs_entries[] = {
74static unsigned long long *facilities; 74static unsigned long long *facilities;
75 75
76/* Section: not file related */ 76/* Section: not file related */
77void kvm_arch_hardware_enable(void *garbage) 77int kvm_arch_hardware_enable(void *garbage)
78{ 78{
79 /* every s390 is virtualization enabled ;-) */ 79 /* every s390 is virtualization enabled ;-) */
80 return 0;
80} 81}
81 82
82void kvm_arch_hardware_disable(void *garbage) 83void kvm_arch_hardware_disable(void *garbage)
@@ -116,10 +117,16 @@ long kvm_arch_dev_ioctl(struct file *filp,
116 117
117int kvm_dev_ioctl_check_extension(long ext) 118int kvm_dev_ioctl_check_extension(long ext)
118{ 119{
120 int r;
121
119 switch (ext) { 122 switch (ext) {
123 case KVM_CAP_S390_PSW:
124 r = 1;
125 break;
120 default: 126 default:
121 return 0; 127 r = 0;
122 } 128 }
129 return r;
123} 130}
124 131
125/* Section: vm related */ 132/* Section: vm related */
@@ -150,7 +157,7 @@ long kvm_arch_vm_ioctl(struct file *filp,
150 break; 157 break;
151 } 158 }
152 default: 159 default:
153 r = -EINVAL; 160 r = -ENOTTY;
154 } 161 }
155 162
156 return r; 163 return r;
@@ -419,8 +426,10 @@ static int kvm_arch_vcpu_ioctl_set_initial_psw(struct kvm_vcpu *vcpu, psw_t psw)
419 vcpu_load(vcpu); 426 vcpu_load(vcpu);
420 if (atomic_read(&vcpu->arch.sie_block->cpuflags) & CPUSTAT_RUNNING) 427 if (atomic_read(&vcpu->arch.sie_block->cpuflags) & CPUSTAT_RUNNING)
421 rc = -EBUSY; 428 rc = -EBUSY;
422 else 429 else {
423 vcpu->arch.sie_block->gpsw = psw; 430 vcpu->run->psw_mask = psw.mask;
431 vcpu->run->psw_addr = psw.addr;
432 }
424 vcpu_put(vcpu); 433 vcpu_put(vcpu);
425 return rc; 434 return rc;
426} 435}
@@ -508,9 +517,6 @@ rerun_vcpu:
508 517
509 switch (kvm_run->exit_reason) { 518 switch (kvm_run->exit_reason) {
510 case KVM_EXIT_S390_SIEIC: 519 case KVM_EXIT_S390_SIEIC:
511 vcpu->arch.sie_block->gpsw.mask = kvm_run->s390_sieic.mask;
512 vcpu->arch.sie_block->gpsw.addr = kvm_run->s390_sieic.addr;
513 break;
514 case KVM_EXIT_UNKNOWN: 520 case KVM_EXIT_UNKNOWN:
515 case KVM_EXIT_INTR: 521 case KVM_EXIT_INTR:
516 case KVM_EXIT_S390_RESET: 522 case KVM_EXIT_S390_RESET:
@@ -519,6 +525,9 @@ rerun_vcpu:
519 BUG(); 525 BUG();
520 } 526 }
521 527
528 vcpu->arch.sie_block->gpsw.mask = kvm_run->psw_mask;
529 vcpu->arch.sie_block->gpsw.addr = kvm_run->psw_addr;
530
522 might_fault(); 531 might_fault();
523 532
524 do { 533 do {
@@ -538,8 +547,6 @@ rerun_vcpu:
538 /* intercept cannot be handled in-kernel, prepare kvm-run */ 547 /* intercept cannot be handled in-kernel, prepare kvm-run */
539 kvm_run->exit_reason = KVM_EXIT_S390_SIEIC; 548 kvm_run->exit_reason = KVM_EXIT_S390_SIEIC;
540 kvm_run->s390_sieic.icptcode = vcpu->arch.sie_block->icptcode; 549 kvm_run->s390_sieic.icptcode = vcpu->arch.sie_block->icptcode;
541 kvm_run->s390_sieic.mask = vcpu->arch.sie_block->gpsw.mask;
542 kvm_run->s390_sieic.addr = vcpu->arch.sie_block->gpsw.addr;
543 kvm_run->s390_sieic.ipa = vcpu->arch.sie_block->ipa; 550 kvm_run->s390_sieic.ipa = vcpu->arch.sie_block->ipa;
544 kvm_run->s390_sieic.ipb = vcpu->arch.sie_block->ipb; 551 kvm_run->s390_sieic.ipb = vcpu->arch.sie_block->ipb;
545 rc = 0; 552 rc = 0;
@@ -551,6 +558,9 @@ rerun_vcpu:
551 rc = 0; 558 rc = 0;
552 } 559 }
553 560
561 kvm_run->psw_mask = vcpu->arch.sie_block->gpsw.mask;
562 kvm_run->psw_addr = vcpu->arch.sie_block->gpsw.addr;
563
554 if (vcpu->sigset_active) 564 if (vcpu->sigset_active)
555 sigprocmask(SIG_SETMASK, &sigsaved, NULL); 565 sigprocmask(SIG_SETMASK, &sigsaved, NULL);
556 566
diff --git a/arch/s390/kvm/sigp.c b/arch/s390/kvm/sigp.c
index 40c8c6748cfe..15ee1111de58 100644
--- a/arch/s390/kvm/sigp.c
+++ b/arch/s390/kvm/sigp.c
@@ -188,9 +188,9 @@ static int __sigp_set_prefix(struct kvm_vcpu *vcpu, u16 cpu_addr, u32 address,
188 188
189 /* make sure that the new value is valid memory */ 189 /* make sure that the new value is valid memory */
190 address = address & 0x7fffe000u; 190 address = address & 0x7fffe000u;
191 if ((copy_from_guest(vcpu, &tmp, 191 if ((copy_from_user(&tmp, (void __user *)
192 (u64) (address + vcpu->arch.sie_block->gmsor) , 1)) || 192 (address + vcpu->arch.sie_block->gmsor) , 1)) ||
193 (copy_from_guest(vcpu, &tmp, (u64) (address + 193 (copy_from_user(&tmp, (void __user *)(address +
194 vcpu->arch.sie_block->gmsor + PAGE_SIZE), 1))) { 194 vcpu->arch.sie_block->gmsor + PAGE_SIZE), 1))) {
195 *reg |= SIGP_STAT_INVALID_PARAMETER; 195 *reg |= SIGP_STAT_INVALID_PARAMETER;
196 return 1; /* invalid parameter */ 196 return 1; /* invalid parameter */
diff --git a/arch/s390/lib/uaccess_mvcos.c b/arch/s390/lib/uaccess_mvcos.c
index 58da3f461214..60455f104ea3 100644
--- a/arch/s390/lib/uaccess_mvcos.c
+++ b/arch/s390/lib/uaccess_mvcos.c
@@ -162,7 +162,6 @@ static size_t clear_user_mvcos(size_t size, void __user *to)
162 return size; 162 return size;
163} 163}
164 164
165#ifdef CONFIG_S390_SWITCH_AMODE
166static size_t strnlen_user_mvcos(size_t count, const char __user *src) 165static size_t strnlen_user_mvcos(size_t count, const char __user *src)
167{ 166{
168 char buf[256]; 167 char buf[256];
@@ -200,7 +199,6 @@ static size_t strncpy_from_user_mvcos(size_t count, const char __user *src,
200 } while ((len_str == len) && (done < count)); 199 } while ((len_str == len) && (done < count));
201 return done; 200 return done;
202} 201}
203#endif /* CONFIG_S390_SWITCH_AMODE */
204 202
205struct uaccess_ops uaccess_mvcos = { 203struct uaccess_ops uaccess_mvcos = {
206 .copy_from_user = copy_from_user_mvcos_check, 204 .copy_from_user = copy_from_user_mvcos_check,
@@ -215,7 +213,6 @@ struct uaccess_ops uaccess_mvcos = {
215 .futex_atomic_cmpxchg = futex_atomic_cmpxchg_std, 213 .futex_atomic_cmpxchg = futex_atomic_cmpxchg_std,
216}; 214};
217 215
218#ifdef CONFIG_S390_SWITCH_AMODE
219struct uaccess_ops uaccess_mvcos_switch = { 216struct uaccess_ops uaccess_mvcos_switch = {
220 .copy_from_user = copy_from_user_mvcos, 217 .copy_from_user = copy_from_user_mvcos,
221 .copy_from_user_small = copy_from_user_mvcos, 218 .copy_from_user_small = copy_from_user_mvcos,
@@ -228,4 +225,3 @@ struct uaccess_ops uaccess_mvcos_switch = {
228 .futex_atomic_op = futex_atomic_op_pt, 225 .futex_atomic_op = futex_atomic_op_pt,
229 .futex_atomic_cmpxchg = futex_atomic_cmpxchg_pt, 226 .futex_atomic_cmpxchg = futex_atomic_cmpxchg_pt,
230}; 227};
231#endif
diff --git a/arch/s390/lib/uaccess_pt.c b/arch/s390/lib/uaccess_pt.c
index cb5d59eab0ee..404f2de296dc 100644
--- a/arch/s390/lib/uaccess_pt.c
+++ b/arch/s390/lib/uaccess_pt.c
@@ -23,86 +23,21 @@ static inline pte_t *follow_table(struct mm_struct *mm, unsigned long addr)
23 23
24 pgd = pgd_offset(mm, addr); 24 pgd = pgd_offset(mm, addr);
25 if (pgd_none(*pgd) || unlikely(pgd_bad(*pgd))) 25 if (pgd_none(*pgd) || unlikely(pgd_bad(*pgd)))
26 return NULL; 26 return (pte_t *) 0x3a;
27 27
28 pud = pud_offset(pgd, addr); 28 pud = pud_offset(pgd, addr);
29 if (pud_none(*pud) || unlikely(pud_bad(*pud))) 29 if (pud_none(*pud) || unlikely(pud_bad(*pud)))
30 return NULL; 30 return (pte_t *) 0x3b;
31 31
32 pmd = pmd_offset(pud, addr); 32 pmd = pmd_offset(pud, addr);
33 if (pmd_none(*pmd) || unlikely(pmd_bad(*pmd))) 33 if (pmd_none(*pmd) || unlikely(pmd_bad(*pmd)))
34 return NULL; 34 return (pte_t *) 0x10;
35 35
36 return pte_offset_map(pmd, addr); 36 return pte_offset_map(pmd, addr);
37} 37}
38 38
39static int __handle_fault(struct mm_struct *mm, unsigned long address, 39static __always_inline size_t __user_copy_pt(unsigned long uaddr, void *kptr,
40 int write_access) 40 size_t n, int write_user)
41{
42 struct vm_area_struct *vma;
43 int ret = -EFAULT;
44 int fault;
45
46 if (in_atomic())
47 return ret;
48 down_read(&mm->mmap_sem);
49 vma = find_vma(mm, address);
50 if (unlikely(!vma))
51 goto out;
52 if (unlikely(vma->vm_start > address)) {
53 if (!(vma->vm_flags & VM_GROWSDOWN))
54 goto out;
55 if (expand_stack(vma, address))
56 goto out;
57 }
58
59 if (!write_access) {
60 /* page not present, check vm flags */
61 if (!(vma->vm_flags & (VM_READ | VM_EXEC | VM_WRITE)))
62 goto out;
63 } else {
64 if (!(vma->vm_flags & VM_WRITE))
65 goto out;
66 }
67
68survive:
69 fault = handle_mm_fault(mm, vma, address, write_access ? FAULT_FLAG_WRITE : 0);
70 if (unlikely(fault & VM_FAULT_ERROR)) {
71 if (fault & VM_FAULT_OOM)
72 goto out_of_memory;
73 else if (fault & VM_FAULT_SIGBUS)
74 goto out_sigbus;
75 BUG();
76 }
77 if (fault & VM_FAULT_MAJOR)
78 current->maj_flt++;
79 else
80 current->min_flt++;
81 ret = 0;
82out:
83 up_read(&mm->mmap_sem);
84 return ret;
85
86out_of_memory:
87 up_read(&mm->mmap_sem);
88 if (is_global_init(current)) {
89 yield();
90 down_read(&mm->mmap_sem);
91 goto survive;
92 }
93 printk("VM: killing process %s\n", current->comm);
94 return ret;
95
96out_sigbus:
97 up_read(&mm->mmap_sem);
98 current->thread.prot_addr = address;
99 current->thread.trap_no = 0x11;
100 force_sig(SIGBUS, current);
101 return ret;
102}
103
104static size_t __user_copy_pt(unsigned long uaddr, void *kptr,
105 size_t n, int write_user)
106{ 41{
107 struct mm_struct *mm = current->mm; 42 struct mm_struct *mm = current->mm;
108 unsigned long offset, pfn, done, size; 43 unsigned long offset, pfn, done, size;
@@ -114,12 +49,17 @@ retry:
114 spin_lock(&mm->page_table_lock); 49 spin_lock(&mm->page_table_lock);
115 do { 50 do {
116 pte = follow_table(mm, uaddr); 51 pte = follow_table(mm, uaddr);
117 if (!pte || !pte_present(*pte) || 52 if ((unsigned long) pte < 0x1000)
118 (write_user && !pte_write(*pte)))
119 goto fault; 53 goto fault;
54 if (!pte_present(*pte)) {
55 pte = (pte_t *) 0x11;
56 goto fault;
57 } else if (write_user && !pte_write(*pte)) {
58 pte = (pte_t *) 0x04;
59 goto fault;
60 }
120 61
121 pfn = pte_pfn(*pte); 62 pfn = pte_pfn(*pte);
122
123 offset = uaddr & (PAGE_SIZE - 1); 63 offset = uaddr & (PAGE_SIZE - 1);
124 size = min(n - done, PAGE_SIZE - offset); 64 size = min(n - done, PAGE_SIZE - offset);
125 if (write_user) { 65 if (write_user) {
@@ -137,7 +77,7 @@ retry:
137 return n - done; 77 return n - done;
138fault: 78fault:
139 spin_unlock(&mm->page_table_lock); 79 spin_unlock(&mm->page_table_lock);
140 if (__handle_fault(mm, uaddr, write_user)) 80 if (__handle_fault(uaddr, (unsigned long) pte, write_user))
141 return n - done; 81 return n - done;
142 goto retry; 82 goto retry;
143} 83}
@@ -146,30 +86,31 @@ fault:
146 * Do DAT for user address by page table walk, return kernel address. 86 * Do DAT for user address by page table walk, return kernel address.
147 * This function needs to be called with current->mm->page_table_lock held. 87 * This function needs to be called with current->mm->page_table_lock held.
148 */ 88 */
149static unsigned long __dat_user_addr(unsigned long uaddr) 89static __always_inline unsigned long __dat_user_addr(unsigned long uaddr)
150{ 90{
151 struct mm_struct *mm = current->mm; 91 struct mm_struct *mm = current->mm;
152 unsigned long pfn, ret; 92 unsigned long pfn;
153 pte_t *pte; 93 pte_t *pte;
154 int rc; 94 int rc;
155 95
156 ret = 0;
157retry: 96retry:
158 pte = follow_table(mm, uaddr); 97 pte = follow_table(mm, uaddr);
159 if (!pte || !pte_present(*pte)) 98 if ((unsigned long) pte < 0x1000)
160 goto fault; 99 goto fault;
100 if (!pte_present(*pte)) {
101 pte = (pte_t *) 0x11;
102 goto fault;
103 }
161 104
162 pfn = pte_pfn(*pte); 105 pfn = pte_pfn(*pte);
163 ret = (pfn << PAGE_SHIFT) + (uaddr & (PAGE_SIZE - 1)); 106 return (pfn << PAGE_SHIFT) + (uaddr & (PAGE_SIZE - 1));
164out:
165 return ret;
166fault: 107fault:
167 spin_unlock(&mm->page_table_lock); 108 spin_unlock(&mm->page_table_lock);
168 rc = __handle_fault(mm, uaddr, 0); 109 rc = __handle_fault(uaddr, (unsigned long) pte, 0);
169 spin_lock(&mm->page_table_lock); 110 spin_lock(&mm->page_table_lock);
170 if (rc) 111 if (!rc)
171 goto out; 112 goto retry;
172 goto retry; 113 return 0;
173} 114}
174 115
175size_t copy_from_user_pt(size_t n, const void __user *from, void *to) 116size_t copy_from_user_pt(size_t n, const void __user *from, void *to)
@@ -234,8 +175,12 @@ retry:
234 spin_lock(&mm->page_table_lock); 175 spin_lock(&mm->page_table_lock);
235 do { 176 do {
236 pte = follow_table(mm, uaddr); 177 pte = follow_table(mm, uaddr);
237 if (!pte || !pte_present(*pte)) 178 if ((unsigned long) pte < 0x1000)
179 goto fault;
180 if (!pte_present(*pte)) {
181 pte = (pte_t *) 0x11;
238 goto fault; 182 goto fault;
183 }
239 184
240 pfn = pte_pfn(*pte); 185 pfn = pte_pfn(*pte);
241 offset = uaddr & (PAGE_SIZE-1); 186 offset = uaddr & (PAGE_SIZE-1);
@@ -249,9 +194,8 @@ retry:
249 return done + 1; 194 return done + 1;
250fault: 195fault:
251 spin_unlock(&mm->page_table_lock); 196 spin_unlock(&mm->page_table_lock);
252 if (__handle_fault(mm, uaddr, 0)) { 197 if (__handle_fault(uaddr, (unsigned long) pte, 0))
253 return 0; 198 return 0;
254 }
255 goto retry; 199 goto retry;
256} 200}
257 201
@@ -284,7 +228,7 @@ static size_t copy_in_user_pt(size_t n, void __user *to,
284{ 228{
285 struct mm_struct *mm = current->mm; 229 struct mm_struct *mm = current->mm;
286 unsigned long offset_from, offset_to, offset_max, pfn_from, pfn_to, 230 unsigned long offset_from, offset_to, offset_max, pfn_from, pfn_to,
287 uaddr, done, size; 231 uaddr, done, size, error_code;
288 unsigned long uaddr_from = (unsigned long) from; 232 unsigned long uaddr_from = (unsigned long) from;
289 unsigned long uaddr_to = (unsigned long) to; 233 unsigned long uaddr_to = (unsigned long) to;
290 pte_t *pte_from, *pte_to; 234 pte_t *pte_from, *pte_to;
@@ -298,17 +242,28 @@ static size_t copy_in_user_pt(size_t n, void __user *to,
298retry: 242retry:
299 spin_lock(&mm->page_table_lock); 243 spin_lock(&mm->page_table_lock);
300 do { 244 do {
245 write_user = 0;
246 uaddr = uaddr_from;
301 pte_from = follow_table(mm, uaddr_from); 247 pte_from = follow_table(mm, uaddr_from);
302 if (!pte_from || !pte_present(*pte_from)) { 248 error_code = (unsigned long) pte_from;
303 uaddr = uaddr_from; 249 if (error_code < 0x1000)
304 write_user = 0; 250 goto fault;
251 if (!pte_present(*pte_from)) {
252 error_code = 0x11;
305 goto fault; 253 goto fault;
306 } 254 }
307 255
256 write_user = 1;
257 uaddr = uaddr_to;
308 pte_to = follow_table(mm, uaddr_to); 258 pte_to = follow_table(mm, uaddr_to);
309 if (!pte_to || !pte_present(*pte_to) || !pte_write(*pte_to)) { 259 error_code = (unsigned long) pte_to;
310 uaddr = uaddr_to; 260 if (error_code < 0x1000)
311 write_user = 1; 261 goto fault;
262 if (!pte_present(*pte_to)) {
263 error_code = 0x11;
264 goto fault;
265 } else if (!pte_write(*pte_to)) {
266 error_code = 0x04;
312 goto fault; 267 goto fault;
313 } 268 }
314 269
@@ -329,7 +284,7 @@ retry:
329 return n - done; 284 return n - done;
330fault: 285fault:
331 spin_unlock(&mm->page_table_lock); 286 spin_unlock(&mm->page_table_lock);
332 if (__handle_fault(mm, uaddr, write_user)) 287 if (__handle_fault(uaddr, error_code, write_user))
333 return n - done; 288 return n - done;
334 goto retry; 289 goto retry;
335} 290}
diff --git a/arch/s390/mm/cmm.c b/arch/s390/mm/cmm.c
index b201135cc18c..76a3637b88e0 100644
--- a/arch/s390/mm/cmm.c
+++ b/arch/s390/mm/cmm.c
@@ -18,6 +18,7 @@
18#include <linux/swap.h> 18#include <linux/swap.h>
19#include <linux/kthread.h> 19#include <linux/kthread.h>
20#include <linux/oom.h> 20#include <linux/oom.h>
21#include <linux/suspend.h>
21 22
22#include <asm/pgalloc.h> 23#include <asm/pgalloc.h>
23#include <asm/uaccess.h> 24#include <asm/uaccess.h>
@@ -44,6 +45,7 @@ static volatile long cmm_pages_target;
44static volatile long cmm_timed_pages_target; 45static volatile long cmm_timed_pages_target;
45static long cmm_timeout_pages; 46static long cmm_timeout_pages;
46static long cmm_timeout_seconds; 47static long cmm_timeout_seconds;
48static int cmm_suspended;
47 49
48static struct cmm_page_array *cmm_page_list; 50static struct cmm_page_array *cmm_page_list;
49static struct cmm_page_array *cmm_timed_page_list; 51static struct cmm_page_array *cmm_timed_page_list;
@@ -147,9 +149,9 @@ cmm_thread(void *dummy)
147 149
148 while (1) { 150 while (1) {
149 rc = wait_event_interruptible(cmm_thread_wait, 151 rc = wait_event_interruptible(cmm_thread_wait,
150 (cmm_pages != cmm_pages_target || 152 (!cmm_suspended && (cmm_pages != cmm_pages_target ||
151 cmm_timed_pages != cmm_timed_pages_target || 153 cmm_timed_pages != cmm_timed_pages_target)) ||
152 kthread_should_stop())); 154 kthread_should_stop());
153 if (kthread_should_stop() || rc == -ERESTARTSYS) { 155 if (kthread_should_stop() || rc == -ERESTARTSYS) {
154 cmm_pages_target = cmm_pages; 156 cmm_pages_target = cmm_pages;
155 cmm_timed_pages_target = cmm_timed_pages; 157 cmm_timed_pages_target = cmm_timed_pages;
@@ -343,30 +345,29 @@ static struct ctl_table cmm_table[] = {
343 { 345 {
344 .procname = "cmm_pages", 346 .procname = "cmm_pages",
345 .mode = 0644, 347 .mode = 0644,
346 .proc_handler = &cmm_pages_handler, 348 .proc_handler = cmm_pages_handler,
347 }, 349 },
348 { 350 {
349 .procname = "cmm_timed_pages", 351 .procname = "cmm_timed_pages",
350 .mode = 0644, 352 .mode = 0644,
351 .proc_handler = &cmm_pages_handler, 353 .proc_handler = cmm_pages_handler,
352 }, 354 },
353 { 355 {
354 .procname = "cmm_timeout", 356 .procname = "cmm_timeout",
355 .mode = 0644, 357 .mode = 0644,
356 .proc_handler = &cmm_timeout_handler, 358 .proc_handler = cmm_timeout_handler,
357 }, 359 },
358 { .ctl_name = 0 } 360 { }
359}; 361};
360 362
361static struct ctl_table cmm_dir_table[] = { 363static struct ctl_table cmm_dir_table[] = {
362 { 364 {
363 .ctl_name = CTL_VM,
364 .procname = "vm", 365 .procname = "vm",
365 .maxlen = 0, 366 .maxlen = 0,
366 .mode = 0555, 367 .mode = 0555,
367 .child = cmm_table, 368 .child = cmm_table,
368 }, 369 },
369 { .ctl_name = 0 } 370 { }
370}; 371};
371#endif 372#endif
372 373
@@ -411,6 +412,38 @@ cmm_smsg_target(char *from, char *msg)
411 412
412static struct ctl_table_header *cmm_sysctl_header; 413static struct ctl_table_header *cmm_sysctl_header;
413 414
415static int cmm_suspend(void)
416{
417 cmm_suspended = 1;
418 cmm_free_pages(cmm_pages, &cmm_pages, &cmm_page_list);
419 cmm_free_pages(cmm_timed_pages, &cmm_timed_pages, &cmm_timed_page_list);
420 return 0;
421}
422
423static int cmm_resume(void)
424{
425 cmm_suspended = 0;
426 cmm_kick_thread();
427 return 0;
428}
429
430static int cmm_power_event(struct notifier_block *this,
431 unsigned long event, void *ptr)
432{
433 switch (event) {
434 case PM_POST_HIBERNATION:
435 return cmm_resume();
436 case PM_HIBERNATION_PREPARE:
437 return cmm_suspend();
438 default:
439 return NOTIFY_DONE;
440 }
441}
442
443static struct notifier_block cmm_power_notifier = {
444 .notifier_call = cmm_power_event,
445};
446
414static int 447static int
415cmm_init (void) 448cmm_init (void)
416{ 449{
@@ -419,7 +452,7 @@ cmm_init (void)
419#ifdef CONFIG_CMM_PROC 452#ifdef CONFIG_CMM_PROC
420 cmm_sysctl_header = register_sysctl_table(cmm_dir_table); 453 cmm_sysctl_header = register_sysctl_table(cmm_dir_table);
421 if (!cmm_sysctl_header) 454 if (!cmm_sysctl_header)
422 goto out; 455 goto out_sysctl;
423#endif 456#endif
424#ifdef CONFIG_CMM_IUCV 457#ifdef CONFIG_CMM_IUCV
425 rc = smsg_register_callback(SMSG_PREFIX, cmm_smsg_target); 458 rc = smsg_register_callback(SMSG_PREFIX, cmm_smsg_target);
@@ -429,17 +462,21 @@ cmm_init (void)
429 rc = register_oom_notifier(&cmm_oom_nb); 462 rc = register_oom_notifier(&cmm_oom_nb);
430 if (rc < 0) 463 if (rc < 0)
431 goto out_oom_notify; 464 goto out_oom_notify;
465 rc = register_pm_notifier(&cmm_power_notifier);
466 if (rc)
467 goto out_pm;
432 init_waitqueue_head(&cmm_thread_wait); 468 init_waitqueue_head(&cmm_thread_wait);
433 init_timer(&cmm_timer); 469 init_timer(&cmm_timer);
434 cmm_thread_ptr = kthread_run(cmm_thread, NULL, "cmmthread"); 470 cmm_thread_ptr = kthread_run(cmm_thread, NULL, "cmmthread");
435 rc = IS_ERR(cmm_thread_ptr) ? PTR_ERR(cmm_thread_ptr) : 0; 471 rc = IS_ERR(cmm_thread_ptr) ? PTR_ERR(cmm_thread_ptr) : 0;
436 if (!rc) 472 if (rc)
437 goto out; 473 goto out_kthread;
438 /* 474 return 0;
439 * kthread_create failed. undo all the stuff from above again.
440 */
441 unregister_oom_notifier(&cmm_oom_nb);
442 475
476out_kthread:
477 unregister_pm_notifier(&cmm_power_notifier);
478out_pm:
479 unregister_oom_notifier(&cmm_oom_nb);
443out_oom_notify: 480out_oom_notify:
444#ifdef CONFIG_CMM_IUCV 481#ifdef CONFIG_CMM_IUCV
445 smsg_unregister_callback(SMSG_PREFIX, cmm_smsg_target); 482 smsg_unregister_callback(SMSG_PREFIX, cmm_smsg_target);
@@ -447,8 +484,8 @@ out_smsg:
447#endif 484#endif
448#ifdef CONFIG_CMM_PROC 485#ifdef CONFIG_CMM_PROC
449 unregister_sysctl_table(cmm_sysctl_header); 486 unregister_sysctl_table(cmm_sysctl_header);
487out_sysctl:
450#endif 488#endif
451out:
452 return rc; 489 return rc;
453} 490}
454 491
@@ -456,6 +493,7 @@ static void
456cmm_exit(void) 493cmm_exit(void)
457{ 494{
458 kthread_stop(cmm_thread_ptr); 495 kthread_stop(cmm_thread_ptr);
496 unregister_pm_notifier(&cmm_power_notifier);
459 unregister_oom_notifier(&cmm_oom_nb); 497 unregister_oom_notifier(&cmm_oom_nb);
460 cmm_free_pages(cmm_pages, &cmm_pages, &cmm_page_list); 498 cmm_free_pages(cmm_pages, &cmm_pages, &cmm_page_list);
461 cmm_free_pages(cmm_timed_pages, &cmm_timed_pages, &cmm_timed_page_list); 499 cmm_free_pages(cmm_timed_pages, &cmm_timed_pages, &cmm_timed_page_list);
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c
index 6d507462967a..fc102e70d9c2 100644
--- a/arch/s390/mm/fault.c
+++ b/arch/s390/mm/fault.c
@@ -34,16 +34,15 @@
34#include <asm/pgtable.h> 34#include <asm/pgtable.h>
35#include <asm/s390_ext.h> 35#include <asm/s390_ext.h>
36#include <asm/mmu_context.h> 36#include <asm/mmu_context.h>
37#include <asm/compat.h>
37#include "../kernel/entry.h" 38#include "../kernel/entry.h"
38 39
39#ifndef CONFIG_64BIT 40#ifndef CONFIG_64BIT
40#define __FAIL_ADDR_MASK 0x7ffff000 41#define __FAIL_ADDR_MASK 0x7ffff000
41#define __FIXUP_MASK 0x7fffffff
42#define __SUBCODE_MASK 0x0200 42#define __SUBCODE_MASK 0x0200
43#define __PF_RES_FIELD 0ULL 43#define __PF_RES_FIELD 0ULL
44#else /* CONFIG_64BIT */ 44#else /* CONFIG_64BIT */
45#define __FAIL_ADDR_MASK -4096L 45#define __FAIL_ADDR_MASK -4096L
46#define __FIXUP_MASK ~0L
47#define __SUBCODE_MASK 0x0600 46#define __SUBCODE_MASK 0x0600
48#define __PF_RES_FIELD 0x8000000000000000ULL 47#define __PF_RES_FIELD 0x8000000000000000ULL
49#endif /* CONFIG_64BIT */ 48#endif /* CONFIG_64BIT */
@@ -52,11 +51,15 @@
52extern int sysctl_userprocess_debug; 51extern int sysctl_userprocess_debug;
53#endif 52#endif
54 53
55#ifdef CONFIG_KPROBES 54#define VM_FAULT_BADCONTEXT 0x010000
56static inline int notify_page_fault(struct pt_regs *regs, long err) 55#define VM_FAULT_BADMAP 0x020000
56#define VM_FAULT_BADACCESS 0x040000
57
58static inline int notify_page_fault(struct pt_regs *regs)
57{ 59{
58 int ret = 0; 60 int ret = 0;
59 61
62#ifdef CONFIG_KPROBES
60 /* kprobe_running() needs smp_processor_id() */ 63 /* kprobe_running() needs smp_processor_id() */
61 if (!user_mode(regs)) { 64 if (!user_mode(regs)) {
62 preempt_disable(); 65 preempt_disable();
@@ -64,15 +67,9 @@ static inline int notify_page_fault(struct pt_regs *regs, long err)
64 ret = 1; 67 ret = 1;
65 preempt_enable(); 68 preempt_enable();
66 } 69 }
67 70#endif
68 return ret; 71 return ret;
69} 72}
70#else
71static inline int notify_page_fault(struct pt_regs *regs, long err)
72{
73 return 0;
74}
75#endif
76 73
77 74
78/* 75/*
@@ -100,57 +97,50 @@ void bust_spinlocks(int yes)
100 97
101/* 98/*
102 * Returns the address space associated with the fault. 99 * Returns the address space associated with the fault.
103 * Returns 0 for kernel space, 1 for user space and 100 * Returns 0 for kernel space and 1 for user space.
104 * 2 for code execution in user space with noexec=on.
105 */ 101 */
106static inline int check_space(struct task_struct *tsk) 102static inline int user_space_fault(unsigned long trans_exc_code)
107{ 103{
108 /* 104 /*
109 * The lowest two bits of S390_lowcore.trans_exc_code 105 * The lowest two bits of the translation exception
110 * indicate which paging table was used. 106 * identification indicate which paging table was used.
111 */ 107 */
112 int desc = S390_lowcore.trans_exc_code & 3; 108 trans_exc_code &= 3;
113 109 if (trans_exc_code == 2)
114 if (desc == 3) /* Home Segment Table Descriptor */ 110 /* Access via secondary space, set_fs setting decides */
115 return switch_amode == 0; 111 return current->thread.mm_segment.ar4;
116 if (desc == 2) /* Secondary Segment Table Descriptor */ 112 if (user_mode == HOME_SPACE_MODE)
117 return tsk->thread.mm_segment.ar4; 113 /* User space if the access has been done via home space. */
118#ifdef CONFIG_S390_SWITCH_AMODE 114 return trans_exc_code == 3;
119 if (unlikely(desc == 1)) { /* STD determined via access register */ 115 /*
120 /* %a0 always indicates primary space. */ 116 * If the user space is not the home space the kernel runs in home
121 if (S390_lowcore.exc_access_id != 0) { 117 * space. Access via secondary space has already been covered,
122 save_access_regs(tsk->thread.acrs); 118 * access via primary space or access register is from user space
123 /* 119 * and access via home space is from the kernel.
124 * An alet of 0 indicates primary space. 120 */
125 * An alet of 1 indicates secondary space. 121 return trans_exc_code != 3;
126 * Any other alet values generate an
127 * alen-translation exception.
128 */
129 if (tsk->thread.acrs[S390_lowcore.exc_access_id])
130 return tsk->thread.mm_segment.ar4;
131 }
132 }
133#endif
134 /* Primary Segment Table Descriptor */
135 return switch_amode << s390_noexec;
136} 122}
137 123
138/* 124/*
139 * Send SIGSEGV to task. This is an external routine 125 * Send SIGSEGV to task. This is an external routine
140 * to keep the stack usage of do_page_fault small. 126 * to keep the stack usage of do_page_fault small.
141 */ 127 */
142static void do_sigsegv(struct pt_regs *regs, unsigned long error_code, 128static noinline void do_sigsegv(struct pt_regs *regs, long int_code,
143 int si_code, unsigned long address) 129 int si_code, unsigned long trans_exc_code)
144{ 130{
145 struct siginfo si; 131 struct siginfo si;
132 unsigned long address;
146 133
134 address = trans_exc_code & __FAIL_ADDR_MASK;
135 current->thread.prot_addr = address;
136 current->thread.trap_no = int_code;
147#if defined(CONFIG_SYSCTL) || defined(CONFIG_PROCESS_DEBUG) 137#if defined(CONFIG_SYSCTL) || defined(CONFIG_PROCESS_DEBUG)
148#if defined(CONFIG_SYSCTL) 138#if defined(CONFIG_SYSCTL)
149 if (sysctl_userprocess_debug) 139 if (sysctl_userprocess_debug)
150#endif 140#endif
151 { 141 {
152 printk("User process fault: interruption code 0x%lX\n", 142 printk("User process fault: interruption code 0x%lX\n",
153 error_code); 143 int_code);
154 printk("failing address: %lX\n", address); 144 printk("failing address: %lX\n", address);
155 show_regs(regs); 145 show_regs(regs);
156 } 146 }
@@ -161,13 +151,14 @@ static void do_sigsegv(struct pt_regs *regs, unsigned long error_code,
161 force_sig_info(SIGSEGV, &si, current); 151 force_sig_info(SIGSEGV, &si, current);
162} 152}
163 153
164static void do_no_context(struct pt_regs *regs, unsigned long error_code, 154static noinline void do_no_context(struct pt_regs *regs, long int_code,
165 unsigned long address) 155 unsigned long trans_exc_code)
166{ 156{
167 const struct exception_table_entry *fixup; 157 const struct exception_table_entry *fixup;
158 unsigned long address;
168 159
169 /* Are we prepared to handle this kernel fault? */ 160 /* Are we prepared to handle this kernel fault? */
170 fixup = search_exception_tables(regs->psw.addr & __FIXUP_MASK); 161 fixup = search_exception_tables(regs->psw.addr & PSW_ADDR_INSN);
171 if (fixup) { 162 if (fixup) {
172 regs->psw.addr = fixup->fixup | PSW_ADDR_AMODE; 163 regs->psw.addr = fixup->fixup | PSW_ADDR_AMODE;
173 return; 164 return;
@@ -177,129 +168,149 @@ static void do_no_context(struct pt_regs *regs, unsigned long error_code,
177 * Oops. The kernel tried to access some bad page. We'll have to 168 * Oops. The kernel tried to access some bad page. We'll have to
178 * terminate things with extreme prejudice. 169 * terminate things with extreme prejudice.
179 */ 170 */
180 if (check_space(current) == 0) 171 address = trans_exc_code & __FAIL_ADDR_MASK;
172 if (!user_space_fault(trans_exc_code))
181 printk(KERN_ALERT "Unable to handle kernel pointer dereference" 173 printk(KERN_ALERT "Unable to handle kernel pointer dereference"
182 " at virtual kernel address %p\n", (void *)address); 174 " at virtual kernel address %p\n", (void *)address);
183 else 175 else
184 printk(KERN_ALERT "Unable to handle kernel paging request" 176 printk(KERN_ALERT "Unable to handle kernel paging request"
185 " at virtual user address %p\n", (void *)address); 177 " at virtual user address %p\n", (void *)address);
186 178
187 die("Oops", regs, error_code); 179 die("Oops", regs, int_code);
188 do_exit(SIGKILL); 180 do_exit(SIGKILL);
189} 181}
190 182
191static void do_low_address(struct pt_regs *regs, unsigned long error_code) 183static noinline void do_low_address(struct pt_regs *regs, long int_code,
184 unsigned long trans_exc_code)
192{ 185{
193 /* Low-address protection hit in kernel mode means 186 /* Low-address protection hit in kernel mode means
194 NULL pointer write access in kernel mode. */ 187 NULL pointer write access in kernel mode. */
195 if (regs->psw.mask & PSW_MASK_PSTATE) { 188 if (regs->psw.mask & PSW_MASK_PSTATE) {
196 /* Low-address protection hit in user mode 'cannot happen'. */ 189 /* Low-address protection hit in user mode 'cannot happen'. */
197 die ("Low-address protection", regs, error_code); 190 die ("Low-address protection", regs, int_code);
198 do_exit(SIGKILL); 191 do_exit(SIGKILL);
199 } 192 }
200 193
201 do_no_context(regs, error_code, 0); 194 do_no_context(regs, int_code, trans_exc_code);
202} 195}
203 196
204static void do_sigbus(struct pt_regs *regs, unsigned long error_code, 197static noinline void do_sigbus(struct pt_regs *regs, long int_code,
205 unsigned long address) 198 unsigned long trans_exc_code)
206{ 199{
207 struct task_struct *tsk = current; 200 struct task_struct *tsk = current;
208 struct mm_struct *mm = tsk->mm;
209 201
210 up_read(&mm->mmap_sem);
211 /* 202 /*
212 * Send a sigbus, regardless of whether we were in kernel 203 * Send a sigbus, regardless of whether we were in kernel
213 * or user mode. 204 * or user mode.
214 */ 205 */
215 tsk->thread.prot_addr = address; 206 tsk->thread.prot_addr = trans_exc_code & __FAIL_ADDR_MASK;
216 tsk->thread.trap_no = error_code; 207 tsk->thread.trap_no = int_code;
217 force_sig(SIGBUS, tsk); 208 force_sig(SIGBUS, tsk);
218
219 /* Kernel mode? Handle exceptions or die */
220 if (!(regs->psw.mask & PSW_MASK_PSTATE))
221 do_no_context(regs, error_code, address);
222} 209}
223 210
224#ifdef CONFIG_S390_EXEC_PROTECT 211#ifdef CONFIG_S390_EXEC_PROTECT
225static int signal_return(struct mm_struct *mm, struct pt_regs *regs, 212static noinline int signal_return(struct pt_regs *regs, long int_code,
226 unsigned long address, unsigned long error_code) 213 unsigned long trans_exc_code)
227{ 214{
228 u16 instruction; 215 u16 instruction;
229 int rc; 216 int rc;
230#ifdef CONFIG_COMPAT
231 int compat;
232#endif
233 217
234 pagefault_disable();
235 rc = __get_user(instruction, (u16 __user *) regs->psw.addr); 218 rc = __get_user(instruction, (u16 __user *) regs->psw.addr);
236 pagefault_enable();
237 if (rc)
238 return -EFAULT;
239 219
240 up_read(&mm->mmap_sem); 220 if (!rc && instruction == 0x0a77) {
241 clear_tsk_thread_flag(current, TIF_SINGLE_STEP); 221 clear_tsk_thread_flag(current, TIF_SINGLE_STEP);
242#ifdef CONFIG_COMPAT 222 if (is_compat_task())
243 compat = is_compat_task(); 223 sys32_sigreturn();
244 if (compat && instruction == 0x0a77) 224 else
245 sys32_sigreturn(); 225 sys_sigreturn();
246 else if (compat && instruction == 0x0aad) 226 } else if (!rc && instruction == 0x0aad) {
247 sys32_rt_sigreturn(); 227 clear_tsk_thread_flag(current, TIF_SINGLE_STEP);
248 else 228 if (is_compat_task())
249#endif 229 sys32_rt_sigreturn();
250 if (instruction == 0x0a77) 230 else
251 sys_sigreturn(); 231 sys_rt_sigreturn();
252 else if (instruction == 0x0aad) 232 } else
253 sys_rt_sigreturn(); 233 do_sigsegv(regs, int_code, SEGV_MAPERR, trans_exc_code);
254 else {
255 current->thread.prot_addr = address;
256 current->thread.trap_no = error_code;
257 do_sigsegv(regs, error_code, SEGV_MAPERR, address);
258 }
259 return 0; 234 return 0;
260} 235}
261#endif /* CONFIG_S390_EXEC_PROTECT */ 236#endif /* CONFIG_S390_EXEC_PROTECT */
262 237
238static noinline void do_fault_error(struct pt_regs *regs, long int_code,
239 unsigned long trans_exc_code, int fault)
240{
241 int si_code;
242
243 switch (fault) {
244 case VM_FAULT_BADACCESS:
245#ifdef CONFIG_S390_EXEC_PROTECT
246 if ((regs->psw.mask & PSW_MASK_ASC) == PSW_ASC_SECONDARY &&
247 (trans_exc_code & 3) == 0) {
248 signal_return(regs, int_code, trans_exc_code);
249 break;
250 }
251#endif /* CONFIG_S390_EXEC_PROTECT */
252 case VM_FAULT_BADMAP:
253 /* Bad memory access. Check if it is kernel or user space. */
254 if (regs->psw.mask & PSW_MASK_PSTATE) {
255 /* User mode accesses just cause a SIGSEGV */
256 si_code = (fault == VM_FAULT_BADMAP) ?
257 SEGV_MAPERR : SEGV_ACCERR;
258 do_sigsegv(regs, int_code, si_code, trans_exc_code);
259 return;
260 }
261 case VM_FAULT_BADCONTEXT:
262 do_no_context(regs, int_code, trans_exc_code);
263 break;
264 default: /* fault & VM_FAULT_ERROR */
265 if (fault & VM_FAULT_OOM)
266 pagefault_out_of_memory();
267 else if (fault & VM_FAULT_SIGBUS) {
268 do_sigbus(regs, int_code, trans_exc_code);
269 /* Kernel mode? Handle exceptions or die */
270 if (!(regs->psw.mask & PSW_MASK_PSTATE))
271 do_no_context(regs, int_code, trans_exc_code);
272 } else
273 BUG();
274 break;
275 }
276}
277
263/* 278/*
264 * This routine handles page faults. It determines the address, 279 * This routine handles page faults. It determines the address,
265 * and the problem, and then passes it off to one of the appropriate 280 * and the problem, and then passes it off to one of the appropriate
266 * routines. 281 * routines.
267 * 282 *
268 * error_code: 283 * interruption code (int_code):
269 * 04 Protection -> Write-Protection (suprression) 284 * 04 Protection -> Write-Protection (suprression)
270 * 10 Segment translation -> Not present (nullification) 285 * 10 Segment translation -> Not present (nullification)
271 * 11 Page translation -> Not present (nullification) 286 * 11 Page translation -> Not present (nullification)
272 * 3b Region third trans. -> Not present (nullification) 287 * 3b Region third trans. -> Not present (nullification)
273 */ 288 */
274static inline void 289static inline int do_exception(struct pt_regs *regs, int access,
275do_exception(struct pt_regs *regs, unsigned long error_code, int write) 290 unsigned long trans_exc_code)
276{ 291{
277 struct task_struct *tsk; 292 struct task_struct *tsk;
278 struct mm_struct *mm; 293 struct mm_struct *mm;
279 struct vm_area_struct *vma; 294 struct vm_area_struct *vma;
280 unsigned long address; 295 unsigned long address;
281 int space;
282 int si_code;
283 int fault; 296 int fault;
284 297
285 if (notify_page_fault(regs, error_code)) 298 if (notify_page_fault(regs))
286 return; 299 return 0;
287 300
288 tsk = current; 301 tsk = current;
289 mm = tsk->mm; 302 mm = tsk->mm;
290 303
291 /* get the failing address and the affected space */
292 address = S390_lowcore.trans_exc_code & __FAIL_ADDR_MASK;
293 space = check_space(tsk);
294
295 /* 304 /*
296 * Verify that the fault happened in user space, that 305 * Verify that the fault happened in user space, that
297 * we are not in an interrupt and that there is a 306 * we are not in an interrupt and that there is a
298 * user context. 307 * user context.
299 */ 308 */
300 if (unlikely(space == 0 || in_atomic() || !mm)) 309 fault = VM_FAULT_BADCONTEXT;
301 goto no_context; 310 if (unlikely(!user_space_fault(trans_exc_code) || in_atomic() || !mm))
311 goto out;
302 312
313 address = trans_exc_code & __FAIL_ADDR_MASK;
303 /* 314 /*
304 * When we get here, the fault happened in the current 315 * When we get here, the fault happened in the current
305 * task's user address space, so we can switch on the 316 * task's user address space, so we can switch on the
@@ -309,42 +320,26 @@ do_exception(struct pt_regs *regs, unsigned long error_code, int write)
309 perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, 0, regs, address); 320 perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, 0, regs, address);
310 down_read(&mm->mmap_sem); 321 down_read(&mm->mmap_sem);
311 322
312 si_code = SEGV_MAPERR; 323 fault = VM_FAULT_BADMAP;
313 vma = find_vma(mm, address); 324 vma = find_vma(mm, address);
314 if (!vma) 325 if (!vma)
315 goto bad_area; 326 goto out_up;
316
317#ifdef CONFIG_S390_EXEC_PROTECT
318 if (unlikely((space == 2) && !(vma->vm_flags & VM_EXEC)))
319 if (!signal_return(mm, regs, address, error_code))
320 /*
321 * signal_return() has done an up_read(&mm->mmap_sem)
322 * if it returns 0.
323 */
324 return;
325#endif
326 327
327 if (vma->vm_start <= address) 328 if (unlikely(vma->vm_start > address)) {
328 goto good_area; 329 if (!(vma->vm_flags & VM_GROWSDOWN))
329 if (!(vma->vm_flags & VM_GROWSDOWN)) 330 goto out_up;
330 goto bad_area; 331 if (expand_stack(vma, address))
331 if (expand_stack(vma, address)) 332 goto out_up;
332 goto bad_area;
333/*
334 * Ok, we have a good vm_area for this memory access, so
335 * we can handle it..
336 */
337good_area:
338 si_code = SEGV_ACCERR;
339 if (!write) {
340 /* page not present, check vm flags */
341 if (!(vma->vm_flags & (VM_READ | VM_EXEC | VM_WRITE)))
342 goto bad_area;
343 } else {
344 if (!(vma->vm_flags & VM_WRITE))
345 goto bad_area;
346 } 333 }
347 334
335 /*
336 * Ok, we have a good vm_area for this memory access, so
337 * we can handle it..
338 */
339 fault = VM_FAULT_BADACCESS;
340 if (unlikely(!(vma->vm_flags & access)))
341 goto out_up;
342
348 if (is_vm_hugetlb_page(vma)) 343 if (is_vm_hugetlb_page(vma))
349 address &= HPAGE_MASK; 344 address &= HPAGE_MASK;
350 /* 345 /*
@@ -352,18 +347,11 @@ good_area:
352 * make sure we exit gracefully rather than endlessly redo 347 * make sure we exit gracefully rather than endlessly redo
353 * the fault. 348 * the fault.
354 */ 349 */
355 fault = handle_mm_fault(mm, vma, address, write ? FAULT_FLAG_WRITE : 0); 350 fault = handle_mm_fault(mm, vma, address,
356 if (unlikely(fault & VM_FAULT_ERROR)) { 351 (access == VM_WRITE) ? FAULT_FLAG_WRITE : 0);
357 if (fault & VM_FAULT_OOM) { 352 if (unlikely(fault & VM_FAULT_ERROR))
358 up_read(&mm->mmap_sem); 353 goto out_up;
359 pagefault_out_of_memory(); 354
360 return;
361 } else if (fault & VM_FAULT_SIGBUS) {
362 do_sigbus(regs, error_code, address);
363 return;
364 }
365 BUG();
366 }
367 if (fault & VM_FAULT_MAJOR) { 355 if (fault & VM_FAULT_MAJOR) {
368 tsk->maj_flt++; 356 tsk->maj_flt++;
369 perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, 0, 357 perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, 0,
@@ -373,74 +361,69 @@ good_area:
373 perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1, 0, 361 perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1, 0,
374 regs, address); 362 regs, address);
375 } 363 }
376 up_read(&mm->mmap_sem);
377 /* 364 /*
378 * The instruction that caused the program check will 365 * The instruction that caused the program check will
379 * be repeated. Don't signal single step via SIGTRAP. 366 * be repeated. Don't signal single step via SIGTRAP.
380 */ 367 */
381 clear_tsk_thread_flag(tsk, TIF_SINGLE_STEP); 368 clear_tsk_thread_flag(tsk, TIF_SINGLE_STEP);
382 return; 369 fault = 0;
383 370out_up:
384/*
385 * Something tried to access memory that isn't in our memory map..
386 * Fix it, but check if it's kernel or user first..
387 */
388bad_area:
389 up_read(&mm->mmap_sem); 371 up_read(&mm->mmap_sem);
390 372out:
391 /* User mode accesses just cause a SIGSEGV */ 373 return fault;
392 if (regs->psw.mask & PSW_MASK_PSTATE) {
393 tsk->thread.prot_addr = address;
394 tsk->thread.trap_no = error_code;
395 do_sigsegv(regs, error_code, si_code, address);
396 return;
397 }
398
399no_context:
400 do_no_context(regs, error_code, address);
401} 374}
402 375
403void __kprobes do_protection_exception(struct pt_regs *regs, 376void __kprobes do_protection_exception(struct pt_regs *regs, long int_code)
404 long error_code)
405{ 377{
378 unsigned long trans_exc_code = S390_lowcore.trans_exc_code;
379 int fault;
380
406 /* Protection exception is supressing, decrement psw address. */ 381 /* Protection exception is supressing, decrement psw address. */
407 regs->psw.addr -= (error_code >> 16); 382 regs->psw.addr -= (int_code >> 16);
408 /* 383 /*
409 * Check for low-address protection. This needs to be treated 384 * Check for low-address protection. This needs to be treated
410 * as a special case because the translation exception code 385 * as a special case because the translation exception code
411 * field is not guaranteed to contain valid data in this case. 386 * field is not guaranteed to contain valid data in this case.
412 */ 387 */
413 if (unlikely(!(S390_lowcore.trans_exc_code & 4))) { 388 if (unlikely(!(trans_exc_code & 4))) {
414 do_low_address(regs, error_code); 389 do_low_address(regs, int_code, trans_exc_code);
415 return; 390 return;
416 } 391 }
417 do_exception(regs, 4, 1); 392 fault = do_exception(regs, VM_WRITE, trans_exc_code);
393 if (unlikely(fault))
394 do_fault_error(regs, 4, trans_exc_code, fault);
418} 395}
419 396
420void __kprobes do_dat_exception(struct pt_regs *regs, long error_code) 397void __kprobes do_dat_exception(struct pt_regs *regs, long int_code)
421{ 398{
422 do_exception(regs, error_code & 0xff, 0); 399 unsigned long trans_exc_code = S390_lowcore.trans_exc_code;
400 int access, fault;
401
402 access = VM_READ | VM_EXEC | VM_WRITE;
403#ifdef CONFIG_S390_EXEC_PROTECT
404 if ((regs->psw.mask & PSW_MASK_ASC) == PSW_ASC_SECONDARY &&
405 (trans_exc_code & 3) == 0)
406 access = VM_EXEC;
407#endif
408 fault = do_exception(regs, access, trans_exc_code);
409 if (unlikely(fault))
410 do_fault_error(regs, int_code & 255, trans_exc_code, fault);
423} 411}
424 412
425#ifdef CONFIG_64BIT 413#ifdef CONFIG_64BIT
426void __kprobes do_asce_exception(struct pt_regs *regs, unsigned long error_code) 414void __kprobes do_asce_exception(struct pt_regs *regs, long int_code)
427{ 415{
428 struct mm_struct *mm; 416 unsigned long trans_exc_code = S390_lowcore.trans_exc_code;
417 struct mm_struct *mm = current->mm;
429 struct vm_area_struct *vma; 418 struct vm_area_struct *vma;
430 unsigned long address;
431 int space;
432
433 mm = current->mm;
434 address = S390_lowcore.trans_exc_code & __FAIL_ADDR_MASK;
435 space = check_space(current);
436 419
437 if (unlikely(space == 0 || in_atomic() || !mm)) 420 if (unlikely(!user_space_fault(trans_exc_code) || in_atomic() || !mm))
438 goto no_context; 421 goto no_context;
439 422
440 local_irq_enable(); 423 local_irq_enable();
441 424
442 down_read(&mm->mmap_sem); 425 down_read(&mm->mmap_sem);
443 vma = find_vma(mm, address); 426 vma = find_vma(mm, trans_exc_code & __FAIL_ADDR_MASK);
444 up_read(&mm->mmap_sem); 427 up_read(&mm->mmap_sem);
445 428
446 if (vma) { 429 if (vma) {
@@ -450,17 +433,38 @@ void __kprobes do_asce_exception(struct pt_regs *regs, unsigned long error_code)
450 433
451 /* User mode accesses just cause a SIGSEGV */ 434 /* User mode accesses just cause a SIGSEGV */
452 if (regs->psw.mask & PSW_MASK_PSTATE) { 435 if (regs->psw.mask & PSW_MASK_PSTATE) {
453 current->thread.prot_addr = address; 436 do_sigsegv(regs, int_code, SEGV_MAPERR, trans_exc_code);
454 current->thread.trap_no = error_code;
455 do_sigsegv(regs, error_code, SEGV_MAPERR, address);
456 return; 437 return;
457 } 438 }
458 439
459no_context: 440no_context:
460 do_no_context(regs, error_code, address); 441 do_no_context(regs, int_code, trans_exc_code);
461} 442}
462#endif 443#endif
463 444
445int __handle_fault(unsigned long uaddr, unsigned long int_code, int write_user)
446{
447 struct pt_regs regs;
448 int access, fault;
449
450 regs.psw.mask = psw_kernel_bits;
451 if (!irqs_disabled())
452 regs.psw.mask |= PSW_MASK_IO | PSW_MASK_EXT;
453 regs.psw.addr = (unsigned long) __builtin_return_address(0);
454 regs.psw.addr |= PSW_ADDR_AMODE;
455 uaddr &= PAGE_MASK;
456 access = write_user ? VM_WRITE : VM_READ;
457 fault = do_exception(&regs, access, uaddr | 2);
458 if (unlikely(fault)) {
459 if (fault & VM_FAULT_OOM) {
460 pagefault_out_of_memory();
461 fault = 0;
462 } else if (fault & VM_FAULT_SIGBUS)
463 do_sigbus(&regs, int_code, uaddr);
464 }
465 return fault ? -EFAULT : 0;
466}
467
464#ifdef CONFIG_PFAULT 468#ifdef CONFIG_PFAULT
465/* 469/*
466 * 'pfault' pseudo page faults routines. 470 * 'pfault' pseudo page faults routines.
@@ -522,7 +526,7 @@ void pfault_fini(void)
522 : : "a" (&refbk), "m" (refbk) : "cc"); 526 : : "a" (&refbk), "m" (refbk) : "cc");
523} 527}
524 528
525static void pfault_interrupt(__u16 error_code) 529static void pfault_interrupt(__u16 int_code)
526{ 530{
527 struct task_struct *tsk; 531 struct task_struct *tsk;
528 __u16 subcode; 532 __u16 subcode;
diff --git a/arch/s390/mm/pgtable.c b/arch/s390/mm/pgtable.c
index 2757c5616a07..ad621e06ada3 100644
--- a/arch/s390/mm/pgtable.c
+++ b/arch/s390/mm/pgtable.c
@@ -269,7 +269,7 @@ int s390_enable_sie(void)
269 struct mm_struct *mm, *old_mm; 269 struct mm_struct *mm, *old_mm;
270 270
271 /* Do we have switched amode? If no, we cannot do sie */ 271 /* Do we have switched amode? If no, we cannot do sie */
272 if (!switch_amode) 272 if (user_mode == HOME_SPACE_MODE)
273 return -EINVAL; 273 return -EINVAL;
274 274
275 /* Do we have pgstes? if yes, we are done */ 275 /* Do we have pgstes? if yes, we are done */
diff --git a/arch/s390/mm/vmem.c b/arch/s390/mm/vmem.c
index 5f91a38d7592..300ab012b0fd 100644
--- a/arch/s390/mm/vmem.c
+++ b/arch/s390/mm/vmem.c
@@ -70,8 +70,12 @@ static pte_t __ref *vmem_pte_alloc(void)
70 pte = alloc_bootmem(PTRS_PER_PTE * sizeof(pte_t)); 70 pte = alloc_bootmem(PTRS_PER_PTE * sizeof(pte_t));
71 if (!pte) 71 if (!pte)
72 return NULL; 72 return NULL;
73 clear_table((unsigned long *) pte, _PAGE_TYPE_EMPTY, 73 if (MACHINE_HAS_HPAGE)
74 PTRS_PER_PTE * sizeof(pte_t)); 74 clear_table((unsigned long *) pte, _PAGE_TYPE_EMPTY | _PAGE_CO,
75 PTRS_PER_PTE * sizeof(pte_t));
76 else
77 clear_table((unsigned long *) pte, _PAGE_TYPE_EMPTY,
78 PTRS_PER_PTE * sizeof(pte_t));
75 return pte; 79 return pte;
76} 80}
77 81
@@ -112,7 +116,8 @@ static int vmem_add_mem(unsigned long start, unsigned long size, int ro)
112 if (MACHINE_HAS_HPAGE && !(address & ~HPAGE_MASK) && 116 if (MACHINE_HAS_HPAGE && !(address & ~HPAGE_MASK) &&
113 (address + HPAGE_SIZE <= start + size) && 117 (address + HPAGE_SIZE <= start + size) &&
114 (address >= HPAGE_SIZE)) { 118 (address >= HPAGE_SIZE)) {
115 pte_val(pte) |= _SEGMENT_ENTRY_LARGE; 119 pte_val(pte) |= _SEGMENT_ENTRY_LARGE |
120 _SEGMENT_ENTRY_CO;
116 pmd_val(*pm_dir) = pte_val(pte); 121 pmd_val(*pm_dir) = pte_val(pte);
117 address += HPAGE_SIZE - PAGE_SIZE; 122 address += HPAGE_SIZE - PAGE_SIZE;
118 continue; 123 continue;
diff --git a/arch/score/include/asm/cacheflush.h b/arch/score/include/asm/cacheflush.h
index 07cc8fc457cd..caaba24036e3 100644
--- a/arch/score/include/asm/cacheflush.h
+++ b/arch/score/include/asm/cacheflush.h
@@ -16,6 +16,7 @@ extern void flush_icache_range(unsigned long start, unsigned long end);
16extern void flush_dcache_range(unsigned long start, unsigned long end); 16extern void flush_dcache_range(unsigned long start, unsigned long end);
17 17
18#define flush_cache_dup_mm(mm) do {} while (0) 18#define flush_cache_dup_mm(mm) do {} while (0)
19#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 0
19#define flush_dcache_page(page) do {} while (0) 20#define flush_dcache_page(page) do {} while (0)
20#define flush_dcache_mmap_lock(mapping) do {} while (0) 21#define flush_dcache_mmap_lock(mapping) do {} while (0)
21#define flush_dcache_mmap_unlock(mapping) do {} while (0) 22#define flush_dcache_mmap_unlock(mapping) do {} while (0)
diff --git a/arch/sh/boards/mach-hp6xx/setup.c b/arch/sh/boards/mach-hp6xx/setup.c
index 8f305b36358b..e6dd5e96321e 100644
--- a/arch/sh/boards/mach-hp6xx/setup.c
+++ b/arch/sh/boards/mach-hp6xx/setup.c
@@ -13,6 +13,7 @@
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/platform_device.h> 14#include <linux/platform_device.h>
15#include <linux/irq.h> 15#include <linux/irq.h>
16#include <sound/sh_dac_audio.h>
16#include <asm/hd64461.h> 17#include <asm/hd64461.h>
17#include <asm/io.h> 18#include <asm/io.h>
18#include <mach/hp6xx.h> 19#include <mach/hp6xx.h>
@@ -51,9 +52,63 @@ static struct platform_device jornadakbd_device = {
51 .id = -1, 52 .id = -1,
52}; 53};
53 54
55static void dac_audio_start(struct dac_audio_pdata *pdata)
56{
57 u16 v;
58 u8 v8;
59
60 /* HP Jornada 680/690 speaker on */
61 v = inw(HD64461_GPADR);
62 v &= ~HD64461_GPADR_SPEAKER;
63 outw(v, HD64461_GPADR);
64
65 /* HP Palmtop 620lx/660lx speaker on */
66 v8 = inb(PKDR);
67 v8 &= ~PKDR_SPEAKER;
68 outb(v8, PKDR);
69
70 sh_dac_enable(pdata->channel);
71}
72
73static void dac_audio_stop(struct dac_audio_pdata *pdata)
74{
75 u16 v;
76 u8 v8;
77
78 /* HP Jornada 680/690 speaker off */
79 v = inw(HD64461_GPADR);
80 v |= HD64461_GPADR_SPEAKER;
81 outw(v, HD64461_GPADR);
82
83 /* HP Palmtop 620lx/660lx speaker off */
84 v8 = inb(PKDR);
85 v8 |= PKDR_SPEAKER;
86 outb(v8, PKDR);
87
88 sh_dac_output(0, pdata->channel);
89 sh_dac_disable(pdata->channel);
90}
91
92static struct dac_audio_pdata dac_audio_platform_data = {
93 .buffer_size = 64000,
94 .channel = 1,
95 .start = dac_audio_start,
96 .stop = dac_audio_stop,
97};
98
99static struct platform_device dac_audio_device = {
100 .name = "dac_audio",
101 .id = -1,
102 .dev = {
103 .platform_data = &dac_audio_platform_data,
104 }
105
106};
107
54static struct platform_device *hp6xx_devices[] __initdata = { 108static struct platform_device *hp6xx_devices[] __initdata = {
55 &cf_ide_device, 109 &cf_ide_device,
56 &jornadakbd_device, 110 &jornadakbd_device,
111 &dac_audio_device,
57}; 112};
58 113
59static void __init hp6xx_init_irq(void) 114static void __init hp6xx_init_irq(void)
diff --git a/arch/sh/boards/mach-se/7724/setup.c b/arch/sh/boards/mach-se/7724/setup.c
index da01fc0dc881..4b0f0c0dc2b8 100644
--- a/arch/sh/boards/mach-se/7724/setup.c
+++ b/arch/sh/boards/mach-se/7724/setup.c
@@ -314,6 +314,9 @@ static struct platform_device fsi_device = {
314 .dev = { 314 .dev = {
315 .platform_data = &fsi_info, 315 .platform_data = &fsi_info,
316 }, 316 },
317 .archdata = {
318 .hwblk_id = HWBLK_SPU, /* FSI needs SPU hwblk */
319 },
317}; 320};
318 321
319/* KEYSC in SoC (Needs SW33-2 set to ON) */ 322/* KEYSC in SoC (Needs SW33-2 set to ON) */
diff --git a/arch/sh/include/asm/cacheflush.h b/arch/sh/include/asm/cacheflush.h
index c29918f3c819..dda96eb3e7c0 100644
--- a/arch/sh/include/asm/cacheflush.h
+++ b/arch/sh/include/asm/cacheflush.h
@@ -42,6 +42,7 @@ extern void flush_cache_page(struct vm_area_struct *vma,
42 unsigned long addr, unsigned long pfn); 42 unsigned long addr, unsigned long pfn);
43extern void flush_cache_range(struct vm_area_struct *vma, 43extern void flush_cache_range(struct vm_area_struct *vma,
44 unsigned long start, unsigned long end); 44 unsigned long start, unsigned long end);
45#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1
45extern void flush_dcache_page(struct page *page); 46extern void flush_dcache_page(struct page *page);
46extern void flush_icache_range(unsigned long start, unsigned long end); 47extern void flush_icache_range(unsigned long start, unsigned long end);
47extern void flush_icache_page(struct vm_area_struct *vma, 48extern void flush_icache_page(struct vm_area_struct *vma,
diff --git a/arch/sh/include/asm/sh_eth.h b/arch/sh/include/asm/sh_eth.h
index acf99700deed..f739061e2ee4 100644
--- a/arch/sh/include/asm/sh_eth.h
+++ b/arch/sh/include/asm/sh_eth.h
@@ -7,6 +7,7 @@ struct sh_eth_plat_data {
7 int phy; 7 int phy;
8 int edmac_endian; 8 int edmac_endian;
9 9
10 unsigned char mac_addr[6];
10 unsigned no_ether_link:1; 11 unsigned no_ether_link:1;
11 unsigned ether_link_active_low:1; 12 unsigned ether_link_active_low:1;
12}; 13};
diff --git a/arch/sh/include/mach-common/mach/hp6xx.h b/arch/sh/include/mach-common/mach/hp6xx.h
index 0d4165a32dcd..bcc301ac12f4 100644
--- a/arch/sh/include/mach-common/mach/hp6xx.h
+++ b/arch/sh/include/mach-common/mach/hp6xx.h
@@ -29,6 +29,9 @@
29 29
30#define PKDR_LED_GREEN 0x10 30#define PKDR_LED_GREEN 0x10
31 31
32/* HP Palmtop 620lx/660lx speaker on/off */
33#define PKDR_SPEAKER 0x20
34
32#define SCPDR_TS_SCAN_ENABLE 0x20 35#define SCPDR_TS_SCAN_ENABLE 0x20
33#define SCPDR_TS_SCAN_Y 0x02 36#define SCPDR_TS_SCAN_Y 0x02
34#define SCPDR_TS_SCAN_X 0x01 37#define SCPDR_TS_SCAN_X 0x01
@@ -42,6 +45,7 @@
42#define ADC_CHANNEL_BACKUP 4 45#define ADC_CHANNEL_BACKUP 4
43#define ADC_CHANNEL_CHARGE 5 46#define ADC_CHANNEL_CHARGE 5
44 47
48/* HP Jornada 680/690 speaker on/off */
45#define HD64461_GPADR_SPEAKER 0x01 49#define HD64461_GPADR_SPEAKER 0x01
46#define HD64461_GPADR_PCMCIA0 (0x02|0x08) 50#define HD64461_GPADR_PCMCIA0 (0x02|0x08)
47 51
diff --git a/arch/sh/kernel/syscalls_64.S b/arch/sh/kernel/syscalls_64.S
index 5bfde6c77498..07d2aaea9ae8 100644
--- a/arch/sh/kernel/syscalls_64.S
+++ b/arch/sh/kernel/syscalls_64.S
@@ -391,3 +391,4 @@ sys_call_table:
391 .long sys_pwritev 391 .long sys_pwritev
392 .long sys_rt_tgsigqueueinfo 392 .long sys_rt_tgsigqueueinfo
393 .long sys_perf_event_open 393 .long sys_perf_event_open
394 .long sys_recvmmsg /* 365 */
diff --git a/arch/sh/kernel/traps_64.c b/arch/sh/kernel/traps_64.c
index 267e5ebbb475..75c0cbe2eda0 100644
--- a/arch/sh/kernel/traps_64.c
+++ b/arch/sh/kernel/traps_64.c
@@ -877,44 +877,39 @@ static int misaligned_fixup(struct pt_regs *regs)
877 877
878static ctl_table unaligned_table[] = { 878static ctl_table unaligned_table[] = {
879 { 879 {
880 .ctl_name = CTL_UNNUMBERED,
881 .procname = "kernel_reports", 880 .procname = "kernel_reports",
882 .data = &kernel_mode_unaligned_fixup_count, 881 .data = &kernel_mode_unaligned_fixup_count,
883 .maxlen = sizeof(int), 882 .maxlen = sizeof(int),
884 .mode = 0644, 883 .mode = 0644,
885 .proc_handler = &proc_dointvec 884 .proc_handler = proc_dointvec
886 }, 885 },
887 { 886 {
888 .ctl_name = CTL_UNNUMBERED,
889 .procname = "user_reports", 887 .procname = "user_reports",
890 .data = &user_mode_unaligned_fixup_count, 888 .data = &user_mode_unaligned_fixup_count,
891 .maxlen = sizeof(int), 889 .maxlen = sizeof(int),
892 .mode = 0644, 890 .mode = 0644,
893 .proc_handler = &proc_dointvec 891 .proc_handler = proc_dointvec
894 }, 892 },
895 { 893 {
896 .ctl_name = CTL_UNNUMBERED,
897 .procname = "user_enable", 894 .procname = "user_enable",
898 .data = &user_mode_unaligned_fixup_enable, 895 .data = &user_mode_unaligned_fixup_enable,
899 .maxlen = sizeof(int), 896 .maxlen = sizeof(int),
900 .mode = 0644, 897 .mode = 0644,
901 .proc_handler = &proc_dointvec}, 898 .proc_handler = proc_dointvec},
902 {} 899 {}
903}; 900};
904 901
905static ctl_table unaligned_root[] = { 902static ctl_table unaligned_root[] = {
906 { 903 {
907 .ctl_name = CTL_UNNUMBERED,
908 .procname = "unaligned_fixup", 904 .procname = "unaligned_fixup",
909 .mode = 0555, 905 .mode = 0555,
910 unaligned_table 906 .child = unaligned_table
911 }, 907 },
912 {} 908 {}
913}; 909};
914 910
915static ctl_table sh64_root[] = { 911static ctl_table sh64_root[] = {
916 { 912 {
917 .ctl_name = CTL_UNNUMBERED,
918 .procname = "sh64", 913 .procname = "sh64",
919 .mode = 0555, 914 .mode = 0555,
920 .child = unaligned_root 915 .child = unaligned_root
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index 05ef5380a687..33ac1a9ac881 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -221,6 +221,13 @@ config SPARC64_SMP
221 default y 221 default y
222 depends on SPARC64 && SMP 222 depends on SPARC64 && SMP
223 223
224config EARLYFB
225 bool "Support for early boot text console"
226 default y
227 depends on SPARC64
228 help
229 Say Y here to enable a faster early framebuffer boot console.
230
224choice 231choice
225 prompt "Kernel page size" if SPARC64 232 prompt "Kernel page size" if SPARC64
226 default SPARC64_PAGE_SIZE_8KB 233 default SPARC64_PAGE_SIZE_8KB
diff --git a/arch/sparc/Makefile b/arch/sparc/Makefile
index dfe272d14465..113225b241e0 100644
--- a/arch/sparc/Makefile
+++ b/arch/sparc/Makefile
@@ -27,6 +27,7 @@ AS := $(AS) -32
27LDFLAGS := -m elf32_sparc 27LDFLAGS := -m elf32_sparc
28CHECKFLAGS += -D__sparc__ 28CHECKFLAGS += -D__sparc__
29export BITS := 32 29export BITS := 32
30UTS_MACHINE := sparc
30 31
31#KBUILD_CFLAGS += -g -pipe -fcall-used-g5 -fcall-used-g7 32#KBUILD_CFLAGS += -g -pipe -fcall-used-g5 -fcall-used-g7
32KBUILD_CFLAGS += -m32 -pipe -mno-fpu -fcall-used-g5 -fcall-used-g7 33KBUILD_CFLAGS += -m32 -pipe -mno-fpu -fcall-used-g5 -fcall-used-g7
@@ -46,6 +47,7 @@ CHECKFLAGS += -D__sparc__ -D__sparc_v9__ -D__arch64__ -m64
46 47
47LDFLAGS := -m elf64_sparc 48LDFLAGS := -m elf64_sparc
48export BITS := 64 49export BITS := 64
50UTS_MACHINE := sparc64
49 51
50KBUILD_CFLAGS += -m64 -pipe -mno-fpu -mcpu=ultrasparc -mcmodel=medlow \ 52KBUILD_CFLAGS += -m64 -pipe -mno-fpu -mcpu=ultrasparc -mcmodel=medlow \
51 -ffixed-g4 -ffixed-g5 -fcall-used-g7 -Wno-sign-compare \ 53 -ffixed-g4 -ffixed-g5 -fcall-used-g7 -Wno-sign-compare \
diff --git a/arch/sparc/include/asm/btext.h b/arch/sparc/include/asm/btext.h
new file mode 100644
index 000000000000..9b2bc6b6ed0a
--- /dev/null
+++ b/arch/sparc/include/asm/btext.h
@@ -0,0 +1,6 @@
1#ifndef _SPARC_BTEXT_H
2#define _SPARC_BTEXT_H
3
4extern int btext_find_display(void);
5
6#endif /* _SPARC_BTEXT_H */
diff --git a/arch/sparc/include/asm/cacheflush_32.h b/arch/sparc/include/asm/cacheflush_32.h
index 68ac10910271..2e468773f250 100644
--- a/arch/sparc/include/asm/cacheflush_32.h
+++ b/arch/sparc/include/asm/cacheflush_32.h
@@ -75,6 +75,7 @@ BTFIXUPDEF_CALL(void, flush_sig_insns, struct mm_struct *, unsigned long)
75 75
76extern void sparc_flush_page_to_ram(struct page *page); 76extern void sparc_flush_page_to_ram(struct page *page);
77 77
78#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1
78#define flush_dcache_page(page) sparc_flush_page_to_ram(page) 79#define flush_dcache_page(page) sparc_flush_page_to_ram(page)
79#define flush_dcache_mmap_lock(mapping) do { } while (0) 80#define flush_dcache_mmap_lock(mapping) do { } while (0)
80#define flush_dcache_mmap_unlock(mapping) do { } while (0) 81#define flush_dcache_mmap_unlock(mapping) do { } while (0)
diff --git a/arch/sparc/include/asm/cacheflush_64.h b/arch/sparc/include/asm/cacheflush_64.h
index c43321729b3b..b95384033e89 100644
--- a/arch/sparc/include/asm/cacheflush_64.h
+++ b/arch/sparc/include/asm/cacheflush_64.h
@@ -37,6 +37,7 @@ extern void flush_dcache_page_all(struct mm_struct *mm, struct page *page);
37#endif 37#endif
38 38
39extern void __flush_dcache_range(unsigned long start, unsigned long end); 39extern void __flush_dcache_range(unsigned long start, unsigned long end);
40#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1
40extern void flush_dcache_page(struct page *page); 41extern void flush_dcache_page(struct page *page);
41 42
42#define flush_icache_page(vma, pg) do { } while(0) 43#define flush_icache_page(vma, pg) do { } while(0)
diff --git a/arch/sparc/include/asm/leon.h b/arch/sparc/include/asm/leon.h
index 28a42b73f64f..3ea5964c43b4 100644
--- a/arch/sparc/include/asm/leon.h
+++ b/arch/sparc/include/asm/leon.h
@@ -148,7 +148,7 @@ static inline unsigned long leon_load_reg(unsigned long paddr)
148 return retval; 148 return retval;
149} 149}
150 150
151extern inline void leon_srmmu_disabletlb(void) 151static inline void leon_srmmu_disabletlb(void)
152{ 152{
153 unsigned int retval; 153 unsigned int retval;
154 __asm__ __volatile__("lda [%%g0] %2, %0\n\t" : "=r"(retval) : "r"(0), 154 __asm__ __volatile__("lda [%%g0] %2, %0\n\t" : "=r"(retval) : "r"(0),
@@ -158,7 +158,7 @@ extern inline void leon_srmmu_disabletlb(void)
158 "i"(ASI_LEON_MMUREGS) : "memory"); 158 "i"(ASI_LEON_MMUREGS) : "memory");
159} 159}
160 160
161extern inline void leon_srmmu_enabletlb(void) 161static inline void leon_srmmu_enabletlb(void)
162{ 162{
163 unsigned int retval; 163 unsigned int retval;
164 __asm__ __volatile__("lda [%%g0] %2, %0\n\t" : "=r"(retval) : "r"(0), 164 __asm__ __volatile__("lda [%%g0] %2, %0\n\t" : "=r"(retval) : "r"(0),
@@ -190,7 +190,7 @@ extern void leon_init_IRQ(void);
190 190
191extern unsigned long last_valid_pfn; 191extern unsigned long last_valid_pfn;
192 192
193extern inline unsigned long sparc_leon3_get_dcachecfg(void) 193static inline unsigned long sparc_leon3_get_dcachecfg(void)
194{ 194{
195 unsigned int retval; 195 unsigned int retval;
196 __asm__ __volatile__("lda [%1] %2, %0\n\t" : 196 __asm__ __volatile__("lda [%1] %2, %0\n\t" :
@@ -201,7 +201,7 @@ extern inline unsigned long sparc_leon3_get_dcachecfg(void)
201} 201}
202 202
203/* enable snooping */ 203/* enable snooping */
204extern inline void sparc_leon3_enable_snooping(void) 204static inline void sparc_leon3_enable_snooping(void)
205{ 205{
206 __asm__ __volatile__ ("lda [%%g0] 2, %%l1\n\t" 206 __asm__ __volatile__ ("lda [%%g0] 2, %%l1\n\t"
207 "set 0x800000, %%l2\n\t" 207 "set 0x800000, %%l2\n\t"
@@ -209,7 +209,14 @@ extern inline void sparc_leon3_enable_snooping(void)
209 "sta %%l2, [%%g0] 2\n\t" : : : "l1", "l2"); 209 "sta %%l2, [%%g0] 2\n\t" : : : "l1", "l2");
210}; 210};
211 211
212extern inline void sparc_leon3_disable_cache(void) 212static inline int sparc_leon3_snooping_enabled(void)
213{
214 u32 cctrl;
215 __asm__ __volatile__("lda [%%g0] 2, %0\n\t" : "=r"(cctrl));
216 return (cctrl >> 23) & 1;
217};
218
219static inline void sparc_leon3_disable_cache(void)
213{ 220{
214 __asm__ __volatile__ ("lda [%%g0] 2, %%l1\n\t" 221 __asm__ __volatile__ ("lda [%%g0] 2, %%l1\n\t"
215 "set 0x00000f, %%l2\n\t" 222 "set 0x00000f, %%l2\n\t"
@@ -340,6 +347,30 @@ extern int leon_flush_needed(void);
340extern void leon_switch_mm(void); 347extern void leon_switch_mm(void);
341extern int srmmu_swprobe_trace; 348extern int srmmu_swprobe_trace;
342 349
350#ifdef CONFIG_SMP
351extern int leon_smp_nrcpus(void);
352extern void leon_clear_profile_irq(int cpu);
353extern void leon_smp_done(void);
354extern void leon_boot_cpus(void);
355extern int leon_boot_one_cpu(int i);
356void leon_init_smp(void);
357extern void cpu_probe(void);
358extern void cpu_idle(void);
359extern void init_IRQ(void);
360extern void cpu_panic(void);
361extern int __leon_processor_id(void);
362void leon_enable_irq_cpu(unsigned int irq_nr, unsigned int cpu);
363
364extern unsigned int real_irq_entry[], smpleon_ticker[];
365extern unsigned int patchme_maybe_smp_msg[];
366extern unsigned long trapbase_cpu1[];
367extern unsigned long trapbase_cpu2[];
368extern unsigned long trapbase_cpu3[];
369extern unsigned int t_nmi[], linux_trap_ipi15_leon[];
370extern unsigned int linux_trap_ipi15_sun4m[];
371
372#endif /* CONFIG_SMP */
373
343#endif /* __KERNEL__ */ 374#endif /* __KERNEL__ */
344 375
345#endif /* __ASSEMBLY__ */ 376#endif /* __ASSEMBLY__ */
@@ -356,6 +387,10 @@ extern int srmmu_swprobe_trace;
356#define leon_switch_mm() do {} while (0) 387#define leon_switch_mm() do {} while (0)
357#define leon_init_IRQ() do {} while (0) 388#define leon_init_IRQ() do {} while (0)
358#define init_leon() do {} while (0) 389#define init_leon() do {} while (0)
390#define leon_smp_done() do {} while (0)
391#define leon_boot_cpus() do {} while (0)
392#define leon_boot_one_cpu(i) 1
393#define leon_init_smp() do {} while (0)
359 394
360#endif /* !defined(CONFIG_SPARC_LEON) */ 395#endif /* !defined(CONFIG_SPARC_LEON) */
361 396
diff --git a/arch/sparc/include/asm/prom.h b/arch/sparc/include/asm/prom.h
index 82a190d7efc1..f845828ca4c6 100644
--- a/arch/sparc/include/asm/prom.h
+++ b/arch/sparc/include/asm/prom.h
@@ -1,3 +1,4 @@
1#include <linux/of.h> /* linux/of.h gets to determine #include ordering */
1#ifndef _SPARC_PROM_H 2#ifndef _SPARC_PROM_H
2#define _SPARC_PROM_H 3#define _SPARC_PROM_H
3#ifdef __KERNEL__ 4#ifdef __KERNEL__
@@ -28,50 +29,11 @@
28#define of_prop_cmp(s1, s2) strcasecmp((s1), (s2)) 29#define of_prop_cmp(s1, s2) strcasecmp((s1), (s2))
29#define of_node_cmp(s1, s2) strcmp((s1), (s2)) 30#define of_node_cmp(s1, s2) strcmp((s1), (s2))
30 31
31typedef u32 phandle;
32typedef u32 ihandle;
33
34struct property {
35 char *name;
36 int length;
37 void *value;
38 struct property *next;
39 unsigned long _flags;
40 unsigned int unique_id;
41};
42
43struct of_irq_controller;
44struct device_node {
45 const char *name;
46 const char *type;
47 phandle node;
48 char *path_component_name;
49 char *full_name;
50
51 struct property *properties;
52 struct property *deadprops; /* removed properties */
53 struct device_node *parent;
54 struct device_node *child;
55 struct device_node *sibling;
56 struct device_node *next; /* next device of same type */
57 struct device_node *allnext; /* next in list of all nodes */
58 struct proc_dir_entry *pde; /* this node's proc directory */
59 struct kref kref;
60 unsigned long _flags;
61 void *data;
62 unsigned int unique_id;
63
64 struct of_irq_controller *irq_trans;
65};
66
67struct of_irq_controller { 32struct of_irq_controller {
68 unsigned int (*irq_build)(struct device_node *, unsigned int, void *); 33 unsigned int (*irq_build)(struct device_node *, unsigned int, void *);
69 void *data; 34 void *data;
70}; 35};
71 36
72#define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags)
73#define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags)
74
75extern struct device_node *of_find_node_by_cpuid(int cpuid); 37extern struct device_node *of_find_node_by_cpuid(int cpuid);
76extern int of_set_property(struct device_node *node, const char *name, void *val, int len); 38extern int of_set_property(struct device_node *node, const char *name, void *val, int len);
77extern struct mutex of_set_property_mutex; 39extern struct mutex of_set_property_mutex;
@@ -89,15 +51,6 @@ extern void prom_build_devicetree(void);
89extern void of_populate_present_mask(void); 51extern void of_populate_present_mask(void);
90extern void of_fill_in_cpu_data(void); 52extern void of_fill_in_cpu_data(void);
91 53
92/* Dummy ref counting routines - to be implemented later */
93static inline struct device_node *of_node_get(struct device_node *node)
94{
95 return node;
96}
97static inline void of_node_put(struct device_node *node)
98{
99}
100
101/* These routines are here to provide compatibility with how powerpc 54/* These routines are here to provide compatibility with how powerpc
102 * handles IRQ mapping for OF device nodes. We precompute and permanently 55 * handles IRQ mapping for OF device nodes. We precompute and permanently
103 * register them in the of_device objects, whereas powerpc computes them 56 * register them in the of_device objects, whereas powerpc computes them
@@ -108,12 +61,6 @@ static inline void irq_dispose_mapping(unsigned int virq)
108{ 61{
109} 62}
110 63
111/*
112 * NB: This is here while we transition from using asm/prom.h
113 * to linux/of.h
114 */
115#include <linux/of.h>
116
117extern struct device_node *of_console_device; 64extern struct device_node *of_console_device;
118extern char *of_console_path; 65extern char *of_console_path;
119extern char *of_console_options; 66extern char *of_console_options;
diff --git a/arch/sparc/include/asm/rwsem.h b/arch/sparc/include/asm/rwsem.h
index 1dc129ac2feb..6e5621006f85 100644
--- a/arch/sparc/include/asm/rwsem.h
+++ b/arch/sparc/include/asm/rwsem.h
@@ -35,8 +35,8 @@ struct rw_semaphore {
35#endif 35#endif
36 36
37#define __RWSEM_INITIALIZER(name) \ 37#define __RWSEM_INITIALIZER(name) \
38{ RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, LIST_HEAD_INIT((name).wait_list) \ 38{ RWSEM_UNLOCKED_VALUE, __SPIN_LOCK_UNLOCKED((name).wait_lock), \
39 __RWSEM_DEP_MAP_INIT(name) } 39 LIST_HEAD_INIT((name).wait_list) __RWSEM_DEP_MAP_INIT(name) }
40 40
41#define DECLARE_RWSEM(name) \ 41#define DECLARE_RWSEM(name) \
42 struct rw_semaphore name = __RWSEM_INITIALIZER(name) 42 struct rw_semaphore name = __RWSEM_INITIALIZER(name)
diff --git a/arch/sparc/include/asm/smp_32.h b/arch/sparc/include/asm/smp_32.h
index 58101dc70493..841905c10215 100644
--- a/arch/sparc/include/asm/smp_32.h
+++ b/arch/sparc/include/asm/smp_32.h
@@ -106,6 +106,15 @@ static inline int hard_smp4d_processor_id(void)
106 return cpuid; 106 return cpuid;
107} 107}
108 108
109extern inline int hard_smpleon_processor_id(void)
110{
111 int cpuid;
112 __asm__ __volatile__("rd %%asr17,%0\n\t"
113 "srl %0,28,%0" :
114 "=&r" (cpuid) : );
115 return cpuid;
116}
117
109#ifndef MODULE 118#ifndef MODULE
110static inline int hard_smp_processor_id(void) 119static inline int hard_smp_processor_id(void)
111{ 120{
diff --git a/arch/sparc/include/asm/socket.h b/arch/sparc/include/asm/socket.h
index 3a5ae3d12088..9d3fefcff2f5 100644
--- a/arch/sparc/include/asm/socket.h
+++ b/arch/sparc/include/asm/socket.h
@@ -56,6 +56,8 @@
56#define SO_TIMESTAMPING 0x0023 56#define SO_TIMESTAMPING 0x0023
57#define SCM_TIMESTAMPING SO_TIMESTAMPING 57#define SCM_TIMESTAMPING SO_TIMESTAMPING
58 58
59#define SO_RXQ_OVFL 0x0024
60
59/* Security levels - as per NRL IPv6 - don't actually do anything */ 61/* Security levels - as per NRL IPv6 - don't actually do anything */
60#define SO_SECURITY_AUTHENTICATION 0x5001 62#define SO_SECURITY_AUTHENTICATION 0x5001
61#define SO_SECURITY_ENCRYPTION_TRANSPORT 0x5002 63#define SO_SECURITY_ENCRYPTION_TRANSPORT 0x5002
diff --git a/arch/sparc/include/asm/unistd.h b/arch/sparc/include/asm/unistd.h
index 42f2316c3eaa..d8d25bd97121 100644
--- a/arch/sparc/include/asm/unistd.h
+++ b/arch/sparc/include/asm/unistd.h
@@ -396,8 +396,9 @@
396#define __NR_pwritev 325 396#define __NR_pwritev 325
397#define __NR_rt_tgsigqueueinfo 326 397#define __NR_rt_tgsigqueueinfo 326
398#define __NR_perf_event_open 327 398#define __NR_perf_event_open 327
399#define __NR_recvmmsg 328
399 400
400#define NR_SYSCALLS 328 401#define NR_SYSCALLS 329
401 402
402#ifdef __32bit_syscall_numbers__ 403#ifdef __32bit_syscall_numbers__
403/* Sparc 32-bit only has the "setresuid32", "getresuid32" variants, 404/* Sparc 32-bit only has the "setresuid32", "getresuid32" variants,
diff --git a/arch/sparc/kernel/Makefile b/arch/sparc/kernel/Makefile
index 5b47fab9966e..c6316142db4e 100644
--- a/arch/sparc/kernel/Makefile
+++ b/arch/sparc/kernel/Makefile
@@ -72,7 +72,7 @@ obj-y += dma.o
72obj-$(CONFIG_SPARC32_PCI) += pcic.o 72obj-$(CONFIG_SPARC32_PCI) += pcic.o
73 73
74obj-$(CONFIG_SMP) += trampoline_$(BITS).o smp_$(BITS).o 74obj-$(CONFIG_SMP) += trampoline_$(BITS).o smp_$(BITS).o
75obj-$(CONFIG_SPARC32_SMP) += sun4m_smp.o sun4d_smp.o 75obj-$(CONFIG_SPARC32_SMP) += sun4m_smp.o sun4d_smp.o leon_smp.o
76obj-$(CONFIG_SPARC64_SMP) += hvtramp.o 76obj-$(CONFIG_SPARC64_SMP) += hvtramp.o
77 77
78obj-y += auxio_$(BITS).o 78obj-y += auxio_$(BITS).o
@@ -87,6 +87,7 @@ obj-$(CONFIG_KGDB) += kgdb_$(BITS).o
87obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o 87obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o
88CFLAGS_REMOVE_ftrace.o := -pg 88CFLAGS_REMOVE_ftrace.o := -pg
89 89
90obj-$(CONFIG_EARLYFB) += btext.o
90obj-$(CONFIG_STACKTRACE) += stacktrace.o 91obj-$(CONFIG_STACKTRACE) += stacktrace.o
91# sparc64 PCI 92# sparc64 PCI
92obj-$(CONFIG_SPARC64_PCI) += pci.o pci_common.o psycho_common.o 93obj-$(CONFIG_SPARC64_PCI) += pci.o pci_common.o psycho_common.o
diff --git a/arch/sparc/kernel/apc.c b/arch/sparc/kernel/apc.c
index 9c115823c4b5..71ec90b9e316 100644
--- a/arch/sparc/kernel/apc.c
+++ b/arch/sparc/kernel/apc.c
@@ -10,7 +10,6 @@
10#include <linux/errno.h> 10#include <linux/errno.h>
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/miscdevice.h> 12#include <linux/miscdevice.h>
13#include <linux/smp_lock.h>
14#include <linux/pm.h> 13#include <linux/pm.h>
15#include <linux/of.h> 14#include <linux/of.h>
16#include <linux/of_device.h> 15#include <linux/of_device.h>
@@ -76,7 +75,6 @@ static inline void apc_free(struct of_device *op)
76 75
77static int apc_open(struct inode *inode, struct file *f) 76static int apc_open(struct inode *inode, struct file *f)
78{ 77{
79 cycle_kernel_lock();
80 return 0; 78 return 0;
81} 79}
82 80
@@ -87,61 +85,46 @@ static int apc_release(struct inode *inode, struct file *f)
87 85
88static long apc_ioctl(struct file *f, unsigned int cmd, unsigned long __arg) 86static long apc_ioctl(struct file *f, unsigned int cmd, unsigned long __arg)
89{ 87{
90 __u8 inarg, __user *arg; 88 __u8 inarg, __user *arg = (__u8 __user *) __arg;
91
92 arg = (__u8 __user *) __arg;
93
94 lock_kernel();
95 89
96 switch (cmd) { 90 switch (cmd) {
97 case APCIOCGFANCTL: 91 case APCIOCGFANCTL:
98 if (put_user(apc_readb(APC_FANCTL_REG) & APC_REGMASK, arg)) { 92 if (put_user(apc_readb(APC_FANCTL_REG) & APC_REGMASK, arg))
99 unlock_kernel();
100 return -EFAULT; 93 return -EFAULT;
101 }
102 break; 94 break;
103 95
104 case APCIOCGCPWR: 96 case APCIOCGCPWR:
105 if (put_user(apc_readb(APC_CPOWER_REG) & APC_REGMASK, arg)) { 97 if (put_user(apc_readb(APC_CPOWER_REG) & APC_REGMASK, arg))
106 unlock_kernel();
107 return -EFAULT; 98 return -EFAULT;
108 }
109 break; 99 break;
110 100
111 case APCIOCGBPORT: 101 case APCIOCGBPORT:
112 if (put_user(apc_readb(APC_BPORT_REG) & APC_BPMASK, arg)) { 102 if (put_user(apc_readb(APC_BPORT_REG) & APC_BPMASK, arg))
113 unlock_kernel();
114 return -EFAULT; 103 return -EFAULT;
115 }
116 break; 104 break;
117 105
118 case APCIOCSFANCTL: 106 case APCIOCSFANCTL:
119 if (get_user(inarg, arg)) { 107 if (get_user(inarg, arg))
120 unlock_kernel();
121 return -EFAULT; 108 return -EFAULT;
122 }
123 apc_writeb(inarg & APC_REGMASK, APC_FANCTL_REG); 109 apc_writeb(inarg & APC_REGMASK, APC_FANCTL_REG);
124 break; 110 break;
111
125 case APCIOCSCPWR: 112 case APCIOCSCPWR:
126 if (get_user(inarg, arg)) { 113 if (get_user(inarg, arg))
127 unlock_kernel();
128 return -EFAULT; 114 return -EFAULT;
129 }
130 apc_writeb(inarg & APC_REGMASK, APC_CPOWER_REG); 115 apc_writeb(inarg & APC_REGMASK, APC_CPOWER_REG);
131 break; 116 break;
117
132 case APCIOCSBPORT: 118 case APCIOCSBPORT:
133 if (get_user(inarg, arg)) { 119 if (get_user(inarg, arg))
134 unlock_kernel();
135 return -EFAULT; 120 return -EFAULT;
136 }
137 apc_writeb(inarg & APC_BPMASK, APC_BPORT_REG); 121 apc_writeb(inarg & APC_BPMASK, APC_BPORT_REG);
138 break; 122 break;
123
139 default: 124 default:
140 unlock_kernel();
141 return -EINVAL; 125 return -EINVAL;
142 }; 126 };
143 127
144 unlock_kernel();
145 return 0; 128 return 0;
146} 129}
147 130
diff --git a/arch/sparc/kernel/auxio_32.c b/arch/sparc/kernel/auxio_32.c
index 45c41232fc4c..ee8d214cae1e 100644
--- a/arch/sparc/kernel/auxio_32.c
+++ b/arch/sparc/kernel/auxio_32.c
@@ -28,6 +28,7 @@ void __init auxio_probe(void)
28 struct resource r; 28 struct resource r;
29 29
30 switch (sparc_cpu_model) { 30 switch (sparc_cpu_model) {
31 case sparc_leon:
31 case sun4d: 32 case sun4d:
32 case sun4: 33 case sun4:
33 return; 34 return;
diff --git a/arch/sparc/kernel/btext.c b/arch/sparc/kernel/btext.c
new file mode 100644
index 000000000000..8cc2d56ffe9a
--- /dev/null
+++ b/arch/sparc/kernel/btext.c
@@ -0,0 +1,673 @@
1/*
2 * Procedures for drawing on the screen early on in the boot process.
3 *
4 * Benjamin Herrenschmidt <benh@kernel.crashing.org>
5 */
6#include <linux/kernel.h>
7#include <linux/string.h>
8#include <linux/init.h>
9#include <linux/module.h>
10#include <linux/console.h>
11
12#include <asm/btext.h>
13#include <asm/oplib.h>
14#include <asm/io.h>
15
16#define NO_SCROLL
17
18#ifndef NO_SCROLL
19static void scrollscreen(void);
20#endif
21
22static void draw_byte(unsigned char c, long locX, long locY);
23static void draw_byte_32(unsigned char *bits, unsigned int *base, int rb);
24static void draw_byte_16(unsigned char *bits, unsigned int *base, int rb);
25static void draw_byte_8(unsigned char *bits, unsigned int *base, int rb);
26
27#define __force_data __attribute__((__section__(".data")))
28
29static int g_loc_X __force_data;
30static int g_loc_Y __force_data;
31static int g_max_loc_X __force_data;
32static int g_max_loc_Y __force_data;
33
34static int dispDeviceRowBytes __force_data;
35static int dispDeviceDepth __force_data;
36static int dispDeviceRect[4] __force_data;
37static unsigned char *dispDeviceBase __force_data;
38
39#define cmapsz (16*256)
40
41static unsigned char vga_font[cmapsz];
42
43static int __init btext_initialize(unsigned int node)
44{
45 unsigned int width, height, depth, pitch;
46 unsigned long address = 0;
47 u32 prop;
48
49 if (prom_getproperty(node, "width", (char *)&width, 4) < 0)
50 return -EINVAL;
51 if (prom_getproperty(node, "height", (char *)&height, 4) < 0)
52 return -EINVAL;
53 if (prom_getproperty(node, "depth", (char *)&depth, 4) < 0)
54 return -EINVAL;
55 pitch = width * ((depth + 7) / 8);
56
57 if (prom_getproperty(node, "linebytes", (char *)&prop, 4) >= 0 &&
58 prop != 0xffffffffu)
59 pitch = prop;
60
61 if (pitch == 1)
62 pitch = 0x1000;
63
64 if (prom_getproperty(node, "address", (char *)&prop, 4) >= 0)
65 address = prop;
66
67 /* FIXME: Add support for PCI reg properties. Right now, only
68 * reliable on macs
69 */
70 if (address == 0)
71 return -EINVAL;
72
73 g_loc_X = 0;
74 g_loc_Y = 0;
75 g_max_loc_X = width / 8;
76 g_max_loc_Y = height / 16;
77 dispDeviceBase = (unsigned char *)address;
78 dispDeviceRowBytes = pitch;
79 dispDeviceDepth = depth == 15 ? 16 : depth;
80 dispDeviceRect[0] = dispDeviceRect[1] = 0;
81 dispDeviceRect[2] = width;
82 dispDeviceRect[3] = height;
83
84 return 0;
85}
86
87/* Calc the base address of a given point (x,y) */
88static unsigned char * calc_base(int x, int y)
89{
90 unsigned char *base = dispDeviceBase;
91
92 base += (x + dispDeviceRect[0]) * (dispDeviceDepth >> 3);
93 base += (y + dispDeviceRect[1]) * dispDeviceRowBytes;
94 return base;
95}
96
97static void btext_clearscreen(void)
98{
99 unsigned int *base = (unsigned int *)calc_base(0, 0);
100 unsigned long width = ((dispDeviceRect[2] - dispDeviceRect[0]) *
101 (dispDeviceDepth >> 3)) >> 2;
102 int i,j;
103
104 for (i=0; i<(dispDeviceRect[3] - dispDeviceRect[1]); i++)
105 {
106 unsigned int *ptr = base;
107 for(j=width; j; --j)
108 *(ptr++) = 0;
109 base += (dispDeviceRowBytes >> 2);
110 }
111}
112
113#ifndef NO_SCROLL
114static void scrollscreen(void)
115{
116 unsigned int *src = (unsigned int *)calc_base(0,16);
117 unsigned int *dst = (unsigned int *)calc_base(0,0);
118 unsigned long width = ((dispDeviceRect[2] - dispDeviceRect[0]) *
119 (dispDeviceDepth >> 3)) >> 2;
120 int i,j;
121
122 for (i=0; i<(dispDeviceRect[3] - dispDeviceRect[1] - 16); i++)
123 {
124 unsigned int *src_ptr = src;
125 unsigned int *dst_ptr = dst;
126 for(j=width; j; --j)
127 *(dst_ptr++) = *(src_ptr++);
128 src += (dispDeviceRowBytes >> 2);
129 dst += (dispDeviceRowBytes >> 2);
130 }
131 for (i=0; i<16; i++)
132 {
133 unsigned int *dst_ptr = dst;
134 for(j=width; j; --j)
135 *(dst_ptr++) = 0;
136 dst += (dispDeviceRowBytes >> 2);
137 }
138}
139#endif /* ndef NO_SCROLL */
140
141void btext_drawchar(char c)
142{
143 int cline = 0;
144#ifdef NO_SCROLL
145 int x;
146#endif
147 switch (c) {
148 case '\b':
149 if (g_loc_X > 0)
150 --g_loc_X;
151 break;
152 case '\t':
153 g_loc_X = (g_loc_X & -8) + 8;
154 break;
155 case '\r':
156 g_loc_X = 0;
157 break;
158 case '\n':
159 g_loc_X = 0;
160 g_loc_Y++;
161 cline = 1;
162 break;
163 default:
164 draw_byte(c, g_loc_X++, g_loc_Y);
165 }
166 if (g_loc_X >= g_max_loc_X) {
167 g_loc_X = 0;
168 g_loc_Y++;
169 cline = 1;
170 }
171#ifndef NO_SCROLL
172 while (g_loc_Y >= g_max_loc_Y) {
173 scrollscreen();
174 g_loc_Y--;
175 }
176#else
177 /* wrap around from bottom to top of screen so we don't
178 waste time scrolling each line. -- paulus. */
179 if (g_loc_Y >= g_max_loc_Y)
180 g_loc_Y = 0;
181 if (cline) {
182 for (x = 0; x < g_max_loc_X; ++x)
183 draw_byte(' ', x, g_loc_Y);
184 }
185#endif
186}
187
188static void btext_drawtext(const char *c, unsigned int len)
189{
190 while (len--)
191 btext_drawchar(*c++);
192}
193
194static void draw_byte(unsigned char c, long locX, long locY)
195{
196 unsigned char *base = calc_base(locX << 3, locY << 4);
197 unsigned char *font = &vga_font[((unsigned int)c) * 16];
198 int rb = dispDeviceRowBytes;
199
200 switch(dispDeviceDepth) {
201 case 24:
202 case 32:
203 draw_byte_32(font, (unsigned int *)base, rb);
204 break;
205 case 15:
206 case 16:
207 draw_byte_16(font, (unsigned int *)base, rb);
208 break;
209 case 8:
210 draw_byte_8(font, (unsigned int *)base, rb);
211 break;
212 }
213}
214
215static unsigned int expand_bits_8[16] = {
216 0x00000000,
217 0x000000ff,
218 0x0000ff00,
219 0x0000ffff,
220 0x00ff0000,
221 0x00ff00ff,
222 0x00ffff00,
223 0x00ffffff,
224 0xff000000,
225 0xff0000ff,
226 0xff00ff00,
227 0xff00ffff,
228 0xffff0000,
229 0xffff00ff,
230 0xffffff00,
231 0xffffffff
232};
233
234static unsigned int expand_bits_16[4] = {
235 0x00000000,
236 0x0000ffff,
237 0xffff0000,
238 0xffffffff
239};
240
241
242static void draw_byte_32(unsigned char *font, unsigned int *base, int rb)
243{
244 int l, bits;
245 int fg = 0xFFFFFFFFUL;
246 int bg = 0x00000000UL;
247
248 for (l = 0; l < 16; ++l)
249 {
250 bits = *font++;
251 base[0] = (-(bits >> 7) & fg) ^ bg;
252 base[1] = (-((bits >> 6) & 1) & fg) ^ bg;
253 base[2] = (-((bits >> 5) & 1) & fg) ^ bg;
254 base[3] = (-((bits >> 4) & 1) & fg) ^ bg;
255 base[4] = (-((bits >> 3) & 1) & fg) ^ bg;
256 base[5] = (-((bits >> 2) & 1) & fg) ^ bg;
257 base[6] = (-((bits >> 1) & 1) & fg) ^ bg;
258 base[7] = (-(bits & 1) & fg) ^ bg;
259 base = (unsigned int *) ((char *)base + rb);
260 }
261}
262
263static void draw_byte_16(unsigned char *font, unsigned int *base, int rb)
264{
265 int l, bits;
266 int fg = 0xFFFFFFFFUL;
267 int bg = 0x00000000UL;
268 unsigned int *eb = (int *)expand_bits_16;
269
270 for (l = 0; l < 16; ++l)
271 {
272 bits = *font++;
273 base[0] = (eb[bits >> 6] & fg) ^ bg;
274 base[1] = (eb[(bits >> 4) & 3] & fg) ^ bg;
275 base[2] = (eb[(bits >> 2) & 3] & fg) ^ bg;
276 base[3] = (eb[bits & 3] & fg) ^ bg;
277 base = (unsigned int *) ((char *)base + rb);
278 }
279}
280
281static void draw_byte_8(unsigned char *font, unsigned int *base, int rb)
282{
283 int l, bits;
284 int fg = 0x0F0F0F0FUL;
285 int bg = 0x00000000UL;
286 unsigned int *eb = (int *)expand_bits_8;
287
288 for (l = 0; l < 16; ++l)
289 {
290 bits = *font++;
291 base[0] = (eb[bits >> 4] & fg) ^ bg;
292 base[1] = (eb[bits & 0xf] & fg) ^ bg;
293 base = (unsigned int *) ((char *)base + rb);
294 }
295}
296
297static void btext_console_write(struct console *con, const char *s,
298 unsigned int n)
299{
300 btext_drawtext(s, n);
301}
302
303static struct console btext_console = {
304 .name = "btext",
305 .write = btext_console_write,
306 .flags = CON_PRINTBUFFER | CON_ENABLED | CON_BOOT | CON_ANYTIME,
307 .index = 0,
308};
309
310int __init btext_find_display(void)
311{
312 unsigned int node;
313 char type[32];
314 int ret;
315
316 node = prom_inst2pkg(prom_stdout);
317 if (prom_getproperty(node, "device_type", type, 32) < 0)
318 return -ENODEV;
319 if (strcmp(type, "display"))
320 return -ENODEV;
321
322 ret = btext_initialize(node);
323 if (!ret) {
324 btext_clearscreen();
325 register_console(&btext_console);
326 }
327 return ret;
328}
329
330static unsigned char vga_font[cmapsz] = {
3310x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3320x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x81, 0xa5, 0x81, 0x81, 0xbd,
3330x99, 0x81, 0x81, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0xff,
3340xdb, 0xff, 0xff, 0xc3, 0xe7, 0xff, 0xff, 0x7e, 0x00, 0x00, 0x00, 0x00,
3350x00, 0x00, 0x00, 0x00, 0x6c, 0xfe, 0xfe, 0xfe, 0xfe, 0x7c, 0x38, 0x10,
3360x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x7c, 0xfe,
3370x7c, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18,
3380x3c, 0x3c, 0xe7, 0xe7, 0xe7, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00,
3390x00, 0x00, 0x00, 0x18, 0x3c, 0x7e, 0xff, 0xff, 0x7e, 0x18, 0x18, 0x3c,
3400x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c,
3410x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
3420xff, 0xff, 0xe7, 0xc3, 0xc3, 0xe7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
3430x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0x42, 0x42, 0x66, 0x3c, 0x00,
3440x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc3, 0x99, 0xbd,
3450xbd, 0x99, 0xc3, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x1e, 0x0e,
3460x1a, 0x32, 0x78, 0xcc, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00,
3470x00, 0x00, 0x3c, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x7e, 0x18, 0x18,
3480x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x33, 0x3f, 0x30, 0x30, 0x30,
3490x30, 0x70, 0xf0, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x63,
3500x7f, 0x63, 0x63, 0x63, 0x63, 0x67, 0xe7, 0xe6, 0xc0, 0x00, 0x00, 0x00,
3510x00, 0x00, 0x00, 0x18, 0x18, 0xdb, 0x3c, 0xe7, 0x3c, 0xdb, 0x18, 0x18,
3520x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfe, 0xf8,
3530xf0, 0xe0, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x0e,
3540x1e, 0x3e, 0xfe, 0x3e, 0x1e, 0x0e, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00,
3550x00, 0x00, 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, 0x7e, 0x3c, 0x18, 0x00,
3560x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
3570x66, 0x00, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xdb,
3580xdb, 0xdb, 0x7b, 0x1b, 0x1b, 0x1b, 0x1b, 0x1b, 0x00, 0x00, 0x00, 0x00,
3590x00, 0x7c, 0xc6, 0x60, 0x38, 0x6c, 0xc6, 0xc6, 0x6c, 0x38, 0x0c, 0xc6,
3600x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3610xfe, 0xfe, 0xfe, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c,
3620x7e, 0x18, 0x18, 0x18, 0x7e, 0x3c, 0x18, 0x7e, 0x00, 0x00, 0x00, 0x00,
3630x00, 0x00, 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
3640x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
3650x18, 0x7e, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3660x00, 0x18, 0x0c, 0xfe, 0x0c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3670x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x60, 0xfe, 0x60, 0x30, 0x00, 0x00,
3680x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0,
3690xc0, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3700x00, 0x24, 0x66, 0xff, 0x66, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3710x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x38, 0x7c, 0x7c, 0xfe, 0xfe, 0x00,
3720x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe, 0x7c, 0x7c,
3730x38, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3740x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3750x00, 0x00, 0x18, 0x3c, 0x3c, 0x3c, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18,
3760x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x24, 0x00, 0x00, 0x00,
3770x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6c,
3780x6c, 0xfe, 0x6c, 0x6c, 0x6c, 0xfe, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00,
3790x18, 0x18, 0x7c, 0xc6, 0xc2, 0xc0, 0x7c, 0x06, 0x06, 0x86, 0xc6, 0x7c,
3800x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc2, 0xc6, 0x0c, 0x18,
3810x30, 0x60, 0xc6, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c,
3820x6c, 0x38, 0x76, 0xdc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00,
3830x00, 0x30, 0x30, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3840x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x18, 0x30, 0x30, 0x30, 0x30,
3850x30, 0x30, 0x18, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x18,
3860x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00,
3870x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x3c, 0xff, 0x3c, 0x66, 0x00, 0x00,
3880x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7e,
3890x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3900x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00,
3910x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00,
3920x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3930x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3940x02, 0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00,
3950x00, 0x00, 0x7c, 0xc6, 0xc6, 0xce, 0xde, 0xf6, 0xe6, 0xc6, 0xc6, 0x7c,
3960x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x38, 0x78, 0x18, 0x18, 0x18,
3970x18, 0x18, 0x18, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6,
3980x06, 0x0c, 0x18, 0x30, 0x60, 0xc0, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00,
3990x00, 0x00, 0x7c, 0xc6, 0x06, 0x06, 0x3c, 0x06, 0x06, 0x06, 0xc6, 0x7c,
4000x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x1c, 0x3c, 0x6c, 0xcc, 0xfe,
4010x0c, 0x0c, 0x0c, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc0,
4020xc0, 0xc0, 0xfc, 0x06, 0x06, 0x06, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
4030x00, 0x00, 0x38, 0x60, 0xc0, 0xc0, 0xfc, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c,
4040x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc6, 0x06, 0x06, 0x0c, 0x18,
4050x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6,
4060xc6, 0xc6, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
4070x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x06, 0x06, 0x0c, 0x78,
4080x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00,
4090x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
4100x18, 0x18, 0x00, 0x00, 0x00, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00,
4110x00, 0x00, 0x00, 0x06, 0x0c, 0x18, 0x30, 0x60, 0x30, 0x18, 0x0c, 0x06,
4120x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00,
4130x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60,
4140x30, 0x18, 0x0c, 0x06, 0x0c, 0x18, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00,
4150x00, 0x00, 0x7c, 0xc6, 0xc6, 0x0c, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18,
4160x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xde, 0xde,
4170xde, 0xdc, 0xc0, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38,
4180x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00,
4190x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x66, 0x66, 0x66, 0x66, 0xfc,
4200x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0xc2, 0xc0, 0xc0, 0xc0,
4210xc0, 0xc2, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x6c,
4220x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x6c, 0xf8, 0x00, 0x00, 0x00, 0x00,
4230x00, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x60, 0x62, 0x66, 0xfe,
4240x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68,
4250x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66,
4260xc2, 0xc0, 0xc0, 0xde, 0xc6, 0xc6, 0x66, 0x3a, 0x00, 0x00, 0x00, 0x00,
4270x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6,
4280x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x18,
4290x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x0c,
4300x0c, 0x0c, 0x0c, 0x0c, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00,
4310x00, 0x00, 0xe6, 0x66, 0x66, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0x66, 0xe6,
4320x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x60, 0x60, 0x60, 0x60, 0x60,
4330x60, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xe7,
4340xff, 0xff, 0xdb, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0x00, 0x00, 0x00, 0x00,
4350x00, 0x00, 0xc6, 0xe6, 0xf6, 0xfe, 0xde, 0xce, 0xc6, 0xc6, 0xc6, 0xc6,
4360x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6,
4370xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x66,
4380x66, 0x66, 0x7c, 0x60, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00,
4390x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xd6, 0xde, 0x7c,
4400x0c, 0x0e, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x6c,
4410x66, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6,
4420xc6, 0x60, 0x38, 0x0c, 0x06, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
4430x00, 0x00, 0xff, 0xdb, 0x99, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c,
4440x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6,
4450xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3,
4460xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0x66, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00,
4470x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xdb, 0xdb, 0xff, 0x66, 0x66,
4480x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3, 0x66, 0x3c, 0x18, 0x18,
4490x3c, 0x66, 0xc3, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3,
4500xc3, 0x66, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00,
4510x00, 0x00, 0xff, 0xc3, 0x86, 0x0c, 0x18, 0x30, 0x60, 0xc1, 0xc3, 0xff,
4520x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x30, 0x30, 0x30, 0x30, 0x30,
4530x30, 0x30, 0x30, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
4540xc0, 0xe0, 0x70, 0x38, 0x1c, 0x0e, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00,
4550x00, 0x00, 0x3c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x3c,
4560x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0x00, 0x00, 0x00, 0x00,
4570x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
4580x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00,
4590x30, 0x30, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
4600x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x0c, 0x7c,
4610xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x60,
4620x60, 0x78, 0x6c, 0x66, 0x66, 0x66, 0x66, 0x7c, 0x00, 0x00, 0x00, 0x00,
4630x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc0, 0xc0, 0xc0, 0xc6, 0x7c,
4640x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x0c, 0x0c, 0x3c, 0x6c, 0xcc,
4650xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
4660x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
4670x00, 0x00, 0x38, 0x6c, 0x64, 0x60, 0xf0, 0x60, 0x60, 0x60, 0x60, 0xf0,
4680x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xcc, 0xcc,
4690xcc, 0xcc, 0xcc, 0x7c, 0x0c, 0xcc, 0x78, 0x00, 0x00, 0x00, 0xe0, 0x60,
4700x60, 0x6c, 0x76, 0x66, 0x66, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00,
4710x00, 0x00, 0x18, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c,
4720x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x00, 0x0e, 0x06, 0x06,
4730x06, 0x06, 0x06, 0x06, 0x66, 0x66, 0x3c, 0x00, 0x00, 0x00, 0xe0, 0x60,
4740x60, 0x66, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00,
4750x00, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c,
4760x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0xff, 0xdb,
4770xdb, 0xdb, 0xdb, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
4780x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00,
4790x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c,
4800x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x66, 0x66,
4810x66, 0x66, 0x66, 0x7c, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00,
4820x00, 0x76, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x7c, 0x0c, 0x0c, 0x1e, 0x00,
4830x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x76, 0x66, 0x60, 0x60, 0x60, 0xf0,
4840x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0x60,
4850x38, 0x0c, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x30,
4860x30, 0xfc, 0x30, 0x30, 0x30, 0x30, 0x36, 0x1c, 0x00, 0x00, 0x00, 0x00,
4870x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76,
4880x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3, 0xc3,
4890xc3, 0x66, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
4900x00, 0xc3, 0xc3, 0xc3, 0xdb, 0xdb, 0xff, 0x66, 0x00, 0x00, 0x00, 0x00,
4910x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0x66, 0x3c, 0x18, 0x3c, 0x66, 0xc3,
4920x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0xc6,
4930xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x0c, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00,
4940x00, 0xfe, 0xcc, 0x18, 0x30, 0x60, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00,
4950x00, 0x00, 0x0e, 0x18, 0x18, 0x18, 0x70, 0x18, 0x18, 0x18, 0x18, 0x0e,
4960x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x00, 0x18,
4970x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x18,
4980x18, 0x18, 0x0e, 0x18, 0x18, 0x18, 0x18, 0x70, 0x00, 0x00, 0x00, 0x00,
4990x00, 0x00, 0x76, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
5000x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6,
5010xc6, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66,
5020xc2, 0xc0, 0xc0, 0xc0, 0xc2, 0x66, 0x3c, 0x0c, 0x06, 0x7c, 0x00, 0x00,
5030x00, 0x00, 0xcc, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76,
5040x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x18, 0x30, 0x00, 0x7c, 0xc6, 0xfe,
5050xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c,
5060x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00,
5070x00, 0x00, 0xcc, 0x00, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76,
5080x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x18, 0x00, 0x78, 0x0c, 0x7c,
5090xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0x38,
5100x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00,
5110x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0x60, 0x60, 0x66, 0x3c, 0x0c, 0x06,
5120x3c, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0x00, 0x7c, 0xc6, 0xfe,
5130xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00,
5140x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
5150x00, 0x60, 0x30, 0x18, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c,
5160x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x00, 0x00, 0x38, 0x18, 0x18,
5170x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c, 0x66,
5180x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00,
5190x00, 0x60, 0x30, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c,
5200x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6,
5210xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0x38, 0x00,
5220x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00,
5230x18, 0x30, 0x60, 0x00, 0xfe, 0x66, 0x60, 0x7c, 0x60, 0x60, 0x66, 0xfe,
5240x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6e, 0x3b, 0x1b,
5250x7e, 0xd8, 0xdc, 0x77, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x6c,
5260xcc, 0xcc, 0xfe, 0xcc, 0xcc, 0xcc, 0xcc, 0xce, 0x00, 0x00, 0x00, 0x00,
5270x00, 0x10, 0x38, 0x6c, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c,
5280x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x00, 0x7c, 0xc6, 0xc6,
5290xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x18,
5300x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
5310x00, 0x30, 0x78, 0xcc, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76,
5320x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x18, 0x00, 0xcc, 0xcc, 0xcc,
5330xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00,
5340x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x0c, 0x78, 0x00,
5350x00, 0xc6, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c,
5360x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6,
5370xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7e,
5380xc3, 0xc0, 0xc0, 0xc0, 0xc3, 0x7e, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00,
5390x00, 0x38, 0x6c, 0x64, 0x60, 0xf0, 0x60, 0x60, 0x60, 0x60, 0xe6, 0xfc,
5400x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0x66, 0x3c, 0x18, 0xff, 0x18,
5410xff, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x66, 0x66,
5420x7c, 0x62, 0x66, 0x6f, 0x66, 0x66, 0x66, 0xf3, 0x00, 0x00, 0x00, 0x00,
5430x00, 0x0e, 0x1b, 0x18, 0x18, 0x18, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18,
5440xd8, 0x70, 0x00, 0x00, 0x00, 0x18, 0x30, 0x60, 0x00, 0x78, 0x0c, 0x7c,
5450xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x18, 0x30,
5460x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00,
5470x00, 0x18, 0x30, 0x60, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c,
5480x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x30, 0x60, 0x00, 0xcc, 0xcc, 0xcc,
5490xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xdc,
5500x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00,
5510x76, 0xdc, 0x00, 0xc6, 0xe6, 0xf6, 0xfe, 0xde, 0xce, 0xc6, 0xc6, 0xc6,
5520x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x6c, 0x6c, 0x3e, 0x00, 0x7e, 0x00,
5530x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0x6c,
5540x38, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
5550x00, 0x00, 0x30, 0x30, 0x00, 0x30, 0x30, 0x60, 0xc0, 0xc6, 0xc6, 0x7c,
5560x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc0,
5570xc0, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
5580x00, 0x00, 0xfe, 0x06, 0x06, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00,
5590x00, 0xc0, 0xc0, 0xc2, 0xc6, 0xcc, 0x18, 0x30, 0x60, 0xce, 0x9b, 0x06,
5600x0c, 0x1f, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0xc2, 0xc6, 0xcc, 0x18, 0x30,
5610x66, 0xce, 0x96, 0x3e, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18,
5620x00, 0x18, 0x18, 0x18, 0x3c, 0x3c, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00,
5630x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x6c, 0xd8, 0x6c, 0x36, 0x00, 0x00,
5640x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x6c, 0x36,
5650x6c, 0xd8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x44, 0x11, 0x44,
5660x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44,
5670x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa,
5680x55, 0xaa, 0x55, 0xaa, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77,
5690xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0x18, 0x18, 0x18, 0x18,
5700x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
5710x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x18, 0x18, 0x18, 0x18,
5720x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x18, 0xf8,
5730x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x36, 0x36, 0x36, 0x36,
5740x36, 0x36, 0x36, 0xf6, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
5750x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x36, 0x36, 0x36, 0x36,
5760x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x18, 0xf8,
5770x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x36, 0x36, 0x36, 0x36,
5780x36, 0xf6, 0x06, 0xf6, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
5790x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
5800x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x06, 0xf6,
5810x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
5820x36, 0xf6, 0x06, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
5830x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xfe, 0x00, 0x00, 0x00, 0x00,
5840x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x18, 0xf8,
5850x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
5860x00, 0x00, 0x00, 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
5870x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x00, 0x00, 0x00, 0x00,
5880x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff,
5890x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
5900x00, 0x00, 0x00, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
5910x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x18, 0x18, 0x18, 0x18,
5920x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
5930x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18,
5940x18, 0x18, 0x18, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
5950x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x18, 0x1f, 0x18, 0x18, 0x18, 0x18,
5960x18, 0x18, 0x18, 0x18, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x37,
5970x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
5980x36, 0x37, 0x30, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
5990x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x30, 0x37, 0x36, 0x36, 0x36, 0x36,
6000x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xf7, 0x00, 0xff,
6010x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6020x00, 0xff, 0x00, 0xf7, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
6030x36, 0x36, 0x36, 0x36, 0x36, 0x37, 0x30, 0x37, 0x36, 0x36, 0x36, 0x36,
6040x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff,
6050x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x36, 0x36, 0x36,
6060x36, 0xf7, 0x00, 0xf7, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
6070x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00,
6080x00, 0x00, 0x00, 0x00, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xff,
6090x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6100x00, 0xff, 0x00, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
6110x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x36, 0x36, 0x36, 0x36,
6120x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x3f,
6130x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18,
6140x18, 0x1f, 0x18, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6150x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x18, 0x1f, 0x18, 0x18, 0x18, 0x18,
6160x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f,
6170x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
6180x36, 0x36, 0x36, 0xff, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
6190x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0x18, 0xff, 0x18, 0x18, 0x18, 0x18,
6200x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8,
6210x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6220x00, 0x00, 0x00, 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
6230xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
6240xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
6250xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0,
6260xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0,
6270x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f,
6280x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
6290x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6300x00, 0x76, 0xdc, 0xd8, 0xd8, 0xd8, 0xdc, 0x76, 0x00, 0x00, 0x00, 0x00,
6310x00, 0x00, 0x78, 0xcc, 0xcc, 0xcc, 0xd8, 0xcc, 0xc6, 0xc6, 0xc6, 0xcc,
6320x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc6, 0xc6, 0xc0, 0xc0, 0xc0,
6330xc0, 0xc0, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6340xfe, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00,
6350x00, 0x00, 0x00, 0xfe, 0xc6, 0x60, 0x30, 0x18, 0x30, 0x60, 0xc6, 0xfe,
6360x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0xd8, 0xd8,
6370xd8, 0xd8, 0xd8, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6380x66, 0x66, 0x66, 0x66, 0x66, 0x7c, 0x60, 0x60, 0xc0, 0x00, 0x00, 0x00,
6390x00, 0x00, 0x00, 0x00, 0x76, 0xdc, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
6400x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x18, 0x3c, 0x66, 0x66,
6410x66, 0x3c, 0x18, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38,
6420x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0x6c, 0x38, 0x00, 0x00, 0x00, 0x00,
6430x00, 0x00, 0x38, 0x6c, 0xc6, 0xc6, 0xc6, 0x6c, 0x6c, 0x6c, 0x6c, 0xee,
6440x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x30, 0x18, 0x0c, 0x3e, 0x66,
6450x66, 0x66, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6460x00, 0x7e, 0xdb, 0xdb, 0xdb, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6470x00, 0x00, 0x00, 0x03, 0x06, 0x7e, 0xdb, 0xdb, 0xf3, 0x7e, 0x60, 0xc0,
6480x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x30, 0x60, 0x60, 0x7c, 0x60,
6490x60, 0x60, 0x30, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c,
6500xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00,
6510x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0xfe, 0x00, 0x00, 0xfe, 0x00,
6520x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7e, 0x18,
6530x18, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30,
6540x18, 0x0c, 0x06, 0x0c, 0x18, 0x30, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00,
6550x00, 0x00, 0x00, 0x0c, 0x18, 0x30, 0x60, 0x30, 0x18, 0x0c, 0x00, 0x7e,
6560x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x1b, 0x1b, 0x1b, 0x18, 0x18,
6570x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
6580x18, 0x18, 0x18, 0x18, 0xd8, 0xd8, 0xd8, 0x70, 0x00, 0x00, 0x00, 0x00,
6590x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x7e, 0x00, 0x18, 0x18, 0x00,
6600x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xdc, 0x00,
6610x76, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0x6c,
6620x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6630x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00,
6640x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6650x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0c, 0x0c,
6660x0c, 0x0c, 0x0c, 0xec, 0x6c, 0x6c, 0x3c, 0x1c, 0x00, 0x00, 0x00, 0x00,
6670x00, 0xd8, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00,
6680x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0xd8, 0x30, 0x60, 0xc8, 0xf8, 0x00,
6690x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6700x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00,
6710x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6720x00, 0x00, 0x00, 0x00,
673};
diff --git a/arch/sparc/kernel/cpu.c b/arch/sparc/kernel/cpu.c
index 1446df90ef85..e447938d39cf 100644
--- a/arch/sparc/kernel/cpu.c
+++ b/arch/sparc/kernel/cpu.c
@@ -185,6 +185,17 @@ static const struct manufacturer_info __initconst manufacturer_info[] = {
185 FPU(-1, NULL) 185 FPU(-1, NULL)
186 } 186 }
187},{ 187},{
188 0xF, /* Aeroflex Gaisler */
189 .cpu_info = {
190 CPU(3, "LEON"),
191 CPU(-1, NULL)
192 },
193 .fpu_info = {
194 FPU(2, "GRFPU"),
195 FPU(3, "GRFPU-Lite"),
196 FPU(-1, NULL)
197 }
198},{
188 0x17, 199 0x17,
189 .cpu_info = { 200 .cpu_info = {
190 CPU_PMU(0x10, "TI UltraSparc I (SpitFire)", "ultra12"), 201 CPU_PMU(0x10, "TI UltraSparc I (SpitFire)", "ultra12"),
diff --git a/arch/sparc/kernel/entry.S b/arch/sparc/kernel/entry.S
index f41ecc5ac0b4..ec9c7bc67d21 100644
--- a/arch/sparc/kernel/entry.S
+++ b/arch/sparc/kernel/entry.S
@@ -400,6 +400,39 @@ linux_trap_ipi15_sun4d:
400 /* FIXME */ 400 /* FIXME */
4011: b,a 1b 4011: b,a 1b
402 402
403#ifdef CONFIG_SPARC_LEON
404
405 .globl smpleon_ticker
406 /* SMP per-cpu ticker interrupts are handled specially. */
407smpleon_ticker:
408 SAVE_ALL
409 or %l0, PSR_PIL, %g2
410 wr %g2, 0x0, %psr
411 WRITE_PAUSE
412 wr %g2, PSR_ET, %psr
413 WRITE_PAUSE
414 call leon_percpu_timer_interrupt
415 add %sp, STACKFRAME_SZ, %o0
416 wr %l0, PSR_ET, %psr
417 WRITE_PAUSE
418 RESTORE_ALL
419
420 .align 4
421 .globl linux_trap_ipi15_leon
422linux_trap_ipi15_leon:
423 SAVE_ALL
424 or %l0, PSR_PIL, %l4
425 wr %l4, 0x0, %psr
426 WRITE_PAUSE
427 wr %l4, PSR_ET, %psr
428 WRITE_PAUSE
429 call leon_cross_call_irq
430 nop
431 b ret_trap_lockless_ipi
432 clr %l6
433
434#endif /* CONFIG_SPARC_LEON */
435
403#endif /* CONFIG_SMP */ 436#endif /* CONFIG_SMP */
404 437
405 /* This routine handles illegal instructions and privileged 438 /* This routine handles illegal instructions and privileged
diff --git a/arch/sparc/kernel/head_32.S b/arch/sparc/kernel/head_32.S
index 439d82a95ac9..21bb2590d4ae 100644
--- a/arch/sparc/kernel/head_32.S
+++ b/arch/sparc/kernel/head_32.S
@@ -811,9 +811,31 @@ found_version:
811got_prop: 811got_prop:
812#ifdef CONFIG_SPARC_LEON 812#ifdef CONFIG_SPARC_LEON
813 /* no cpu-type check is needed, it is a SPARC-LEON */ 813 /* no cpu-type check is needed, it is a SPARC-LEON */
814#ifdef CONFIG_SMP
815 ba leon_smp_init
816 nop
817
818 .global leon_smp_init
819leon_smp_init:
820 sethi %hi(boot_cpu_id), %g1 ! master always 0
821 stb %g0, [%g1 + %lo(boot_cpu_id)]
822 sethi %hi(boot_cpu_id4), %g1 ! master always 0
823 stb %g0, [%g1 + %lo(boot_cpu_id4)]
824
825 rd %asr17,%g1
826 srl %g1,28,%g1
827
828 cmp %g0,%g1
829 beq sun4c_continue_boot !continue with master
830 nop
831
832 ba leon_smp_cpu_startup
833 nop
834#else
814 ba sun4c_continue_boot 835 ba sun4c_continue_boot
815 nop 836 nop
816#endif 837#endif
838#endif
817 set cputypval, %o2 839 set cputypval, %o2
818 ldub [%o2 + 0x4], %l1 840 ldub [%o2 + 0x4], %l1
819 841
diff --git a/arch/sparc/kernel/ioport.c b/arch/sparc/kernel/ioport.c
index 9f61fd8cbb7b..3c8c44f6a41c 100644
--- a/arch/sparc/kernel/ioport.c
+++ b/arch/sparc/kernel/ioport.c
@@ -48,8 +48,13 @@
48#include <asm/dma.h> 48#include <asm/dma.h>
49#include <asm/iommu.h> 49#include <asm/iommu.h>
50#include <asm/io-unit.h> 50#include <asm/io-unit.h>
51#include <asm/leon.h>
51 52
53#ifdef CONFIG_SPARC_LEON
54#define mmu_inval_dma_area(p, l) leon_flush_dcache_all()
55#else
52#define mmu_inval_dma_area(p, l) /* Anton pulled it out for 2.4.0-xx */ 56#define mmu_inval_dma_area(p, l) /* Anton pulled it out for 2.4.0-xx */
57#endif
53 58
54static struct resource *_sparc_find_resource(struct resource *r, 59static struct resource *_sparc_find_resource(struct resource *r,
55 unsigned long); 60 unsigned long);
diff --git a/arch/sparc/kernel/irq_64.c b/arch/sparc/kernel/irq_64.c
index 8ab1d4728a4b..ce996f97855f 100644
--- a/arch/sparc/kernel/irq_64.c
+++ b/arch/sparc/kernel/irq_64.c
@@ -187,7 +187,7 @@ int show_interrupts(struct seq_file *p, void *v)
187 for_each_online_cpu(j) 187 for_each_online_cpu(j)
188 seq_printf(p, "%10u ", kstat_irqs_cpu(i, j)); 188 seq_printf(p, "%10u ", kstat_irqs_cpu(i, j));
189#endif 189#endif
190 seq_printf(p, " %9s", irq_desc[i].chip->typename); 190 seq_printf(p, " %9s", irq_desc[i].chip->name);
191 seq_printf(p, " %s", action->name); 191 seq_printf(p, " %s", action->name);
192 192
193 for (action=action->next; action; action = action->next) 193 for (action=action->next; action; action = action->next)
@@ -484,7 +484,7 @@ static void sun4v_virq_eoi(unsigned int virt_irq)
484} 484}
485 485
486static struct irq_chip sun4u_irq = { 486static struct irq_chip sun4u_irq = {
487 .typename = "sun4u", 487 .name = "sun4u",
488 .enable = sun4u_irq_enable, 488 .enable = sun4u_irq_enable,
489 .disable = sun4u_irq_disable, 489 .disable = sun4u_irq_disable,
490 .eoi = sun4u_irq_eoi, 490 .eoi = sun4u_irq_eoi,
@@ -492,7 +492,7 @@ static struct irq_chip sun4u_irq = {
492}; 492};
493 493
494static struct irq_chip sun4v_irq = { 494static struct irq_chip sun4v_irq = {
495 .typename = "sun4v", 495 .name = "sun4v",
496 .enable = sun4v_irq_enable, 496 .enable = sun4v_irq_enable,
497 .disable = sun4v_irq_disable, 497 .disable = sun4v_irq_disable,
498 .eoi = sun4v_irq_eoi, 498 .eoi = sun4v_irq_eoi,
@@ -500,7 +500,7 @@ static struct irq_chip sun4v_irq = {
500}; 500};
501 501
502static struct irq_chip sun4v_virq = { 502static struct irq_chip sun4v_virq = {
503 .typename = "vsun4v", 503 .name = "vsun4v",
504 .enable = sun4v_virq_enable, 504 .enable = sun4v_virq_enable,
505 .disable = sun4v_virq_disable, 505 .disable = sun4v_virq_disable,
506 .eoi = sun4v_virq_eoi, 506 .eoi = sun4v_virq_eoi,
diff --git a/arch/sparc/kernel/leon_kernel.c b/arch/sparc/kernel/leon_kernel.c
index 54d8a5bd4824..87f1760c0aa2 100644
--- a/arch/sparc/kernel/leon_kernel.c
+++ b/arch/sparc/kernel/leon_kernel.c
@@ -12,11 +12,14 @@
12#include <linux/of_platform.h> 12#include <linux/of_platform.h>
13#include <linux/interrupt.h> 13#include <linux/interrupt.h>
14#include <linux/of_device.h> 14#include <linux/of_device.h>
15
15#include <asm/oplib.h> 16#include <asm/oplib.h>
16#include <asm/timer.h> 17#include <asm/timer.h>
17#include <asm/prom.h> 18#include <asm/prom.h>
18#include <asm/leon.h> 19#include <asm/leon.h>
19#include <asm/leon_amba.h> 20#include <asm/leon_amba.h>
21#include <asm/traps.h>
22#include <asm/cacheflush.h>
20 23
21#include "prom.h" 24#include "prom.h"
22#include "irq.h" 25#include "irq.h"
@@ -115,6 +118,21 @@ void __init leon_init_timers(irq_handler_t counter_fn)
115 (((1000000 / 100) - 1))); 118 (((1000000 / 100) - 1)));
116 LEON3_BYPASS_STORE_PA(&leon3_gptimer_regs->e[0].ctrl, 0); 119 LEON3_BYPASS_STORE_PA(&leon3_gptimer_regs->e[0].ctrl, 0);
117 120
121#ifdef CONFIG_SMP
122 leon_percpu_timer_dev[0].start = (int)leon3_gptimer_regs;
123 leon_percpu_timer_dev[0].irq = leon3_gptimer_irq+1;
124
125 if (!(LEON3_BYPASS_LOAD_PA(&leon3_gptimer_regs->config) &
126 (1<<LEON3_GPTIMER_SEPIRQ))) {
127 prom_printf("irq timer not configured with seperate irqs \n");
128 BUG();
129 }
130
131 LEON3_BYPASS_STORE_PA(&leon3_gptimer_regs->e[1].val, 0);
132 LEON3_BYPASS_STORE_PA(&leon3_gptimer_regs->e[1].rld, (((1000000/100) - 1)));
133 LEON3_BYPASS_STORE_PA(&leon3_gptimer_regs->e[1].ctrl, 0);
134# endif
135
118 } else { 136 } else {
119 printk(KERN_ERR "No Timer/irqctrl found\n"); 137 printk(KERN_ERR "No Timer/irqctrl found\n");
120 BUG(); 138 BUG();
@@ -130,11 +148,41 @@ void __init leon_init_timers(irq_handler_t counter_fn)
130 prom_halt(); 148 prom_halt();
131 } 149 }
132 150
151# ifdef CONFIG_SMP
152 {
153 unsigned long flags;
154 struct tt_entry *trap_table = &sparc_ttable[SP_TRAP_IRQ1 + (leon_percpu_timer_dev[0].irq - 1)];
155
156 /* For SMP we use the level 14 ticker, however the bootup code
157 * has copied the firmwares level 14 vector into boot cpu's
158 * trap table, we must fix this now or we get squashed.
159 */
160 local_irq_save(flags);
161
162 patchme_maybe_smp_msg[0] = 0x01000000; /* NOP out the branch */
163
164 /* Adjust so that we jump directly to smpleon_ticker */
165 trap_table->inst_three += smpleon_ticker - real_irq_entry;
166
167 local_flush_cache_all();
168 local_irq_restore(flags);
169 }
170# endif
171
133 if (leon3_gptimer_regs) { 172 if (leon3_gptimer_regs) {
134 LEON3_BYPASS_STORE_PA(&leon3_gptimer_regs->e[0].ctrl, 173 LEON3_BYPASS_STORE_PA(&leon3_gptimer_regs->e[0].ctrl,
135 LEON3_GPTIMER_EN | 174 LEON3_GPTIMER_EN |
136 LEON3_GPTIMER_RL | 175 LEON3_GPTIMER_RL |
137 LEON3_GPTIMER_LD | LEON3_GPTIMER_IRQEN); 176 LEON3_GPTIMER_LD | LEON3_GPTIMER_IRQEN);
177
178#ifdef CONFIG_SMP
179 LEON3_BYPASS_STORE_PA(&leon3_gptimer_regs->e[1].ctrl,
180 LEON3_GPTIMER_EN |
181 LEON3_GPTIMER_RL |
182 LEON3_GPTIMER_LD |
183 LEON3_GPTIMER_IRQEN);
184#endif
185
138 } 186 }
139} 187}
140 188
@@ -175,6 +223,42 @@ void __init leon_node_init(struct device_node *dp, struct device_node ***nextp)
175 } 223 }
176} 224}
177 225
226#ifdef CONFIG_SMP
227
228void leon_set_cpu_int(int cpu, int level)
229{
230 unsigned long mask;
231 mask = get_irqmask(level);
232 LEON3_BYPASS_STORE_PA(&leon3_irqctrl_regs->force[cpu], mask);
233}
234
235static void leon_clear_ipi(int cpu, int level)
236{
237 unsigned long mask;
238 mask = get_irqmask(level);
239 LEON3_BYPASS_STORE_PA(&leon3_irqctrl_regs->force[cpu], mask<<16);
240}
241
242static void leon_set_udt(int cpu)
243{
244}
245
246void leon_clear_profile_irq(int cpu)
247{
248}
249
250void leon_enable_irq_cpu(unsigned int irq_nr, unsigned int cpu)
251{
252 unsigned long mask, flags, *addr;
253 mask = get_irqmask(irq_nr);
254 local_irq_save(flags);
255 addr = (unsigned long *)&(leon3_irqctrl_regs->mask[cpu]);
256 LEON3_BYPASS_STORE_PA(addr, (LEON3_BYPASS_LOAD_PA(addr) | (mask)));
257 local_irq_restore(flags);
258}
259
260#endif
261
178void __init leon_init_IRQ(void) 262void __init leon_init_IRQ(void)
179{ 263{
180 sparc_init_timers = leon_init_timers; 264 sparc_init_timers = leon_init_timers;
diff --git a/arch/sparc/kernel/leon_smp.c b/arch/sparc/kernel/leon_smp.c
new file mode 100644
index 000000000000..05c0dadd6371
--- /dev/null
+++ b/arch/sparc/kernel/leon_smp.c
@@ -0,0 +1,468 @@
1/* leon_smp.c: Sparc-Leon SMP support.
2 *
3 * based on sun4m_smp.c
4 * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
5 * Copyright (C) 2009 Daniel Hellstrom (daniel@gaisler.com) Aeroflex Gaisler AB
6 * Copyright (C) 2009 Konrad Eisele (konrad@gaisler.com) Aeroflex Gaisler AB
7 */
8
9#include <asm/head.h>
10
11#include <linux/kernel.h>
12#include <linux/sched.h>
13#include <linux/threads.h>
14#include <linux/smp.h>
15#include <linux/smp_lock.h>
16#include <linux/interrupt.h>
17#include <linux/kernel_stat.h>
18#include <linux/init.h>
19#include <linux/spinlock.h>
20#include <linux/mm.h>
21#include <linux/swap.h>
22#include <linux/profile.h>
23#include <linux/pm.h>
24#include <linux/delay.h>
25
26#include <asm/cacheflush.h>
27#include <asm/tlbflush.h>
28
29#include <asm/ptrace.h>
30#include <asm/atomic.h>
31#include <asm/irq_regs.h>
32
33#include <asm/delay.h>
34#include <asm/irq.h>
35#include <asm/page.h>
36#include <asm/pgalloc.h>
37#include <asm/pgtable.h>
38#include <asm/oplib.h>
39#include <asm/cpudata.h>
40#include <asm/asi.h>
41#include <asm/leon.h>
42#include <asm/leon_amba.h>
43
44#ifdef CONFIG_SPARC_LEON
45
46#include "irq.h"
47
48extern ctxd_t *srmmu_ctx_table_phys;
49static int smp_processors_ready;
50extern volatile unsigned long cpu_callin_map[NR_CPUS];
51extern unsigned char boot_cpu_id;
52extern cpumask_t smp_commenced_mask;
53void __init leon_configure_cache_smp(void);
54
55static inline unsigned long do_swap(volatile unsigned long *ptr,
56 unsigned long val)
57{
58 __asm__ __volatile__("swapa [%1] %2, %0\n\t" : "=&r"(val)
59 : "r"(ptr), "i"(ASI_LEON_DCACHE_MISS)
60 : "memory");
61 return val;
62}
63
64static void smp_setup_percpu_timer(void);
65
66void __cpuinit leon_callin(void)
67{
68 int cpuid = hard_smpleon_processor_id();
69
70 local_flush_cache_all();
71 local_flush_tlb_all();
72 leon_configure_cache_smp();
73
74 /* Get our local ticker going. */
75 smp_setup_percpu_timer();
76
77 calibrate_delay();
78 smp_store_cpu_info(cpuid);
79
80 local_flush_cache_all();
81 local_flush_tlb_all();
82
83 /*
84 * Unblock the master CPU _only_ when the scheduler state
85 * of all secondary CPUs will be up-to-date, so after
86 * the SMP initialization the master will be just allowed
87 * to call the scheduler code.
88 * Allow master to continue.
89 */
90 do_swap(&cpu_callin_map[cpuid], 1);
91
92 local_flush_cache_all();
93 local_flush_tlb_all();
94
95 cpu_probe();
96
97 /* Fix idle thread fields. */
98 __asm__ __volatile__("ld [%0], %%g6\n\t" : : "r"(&current_set[cpuid])
99 : "memory" /* paranoid */);
100
101 /* Attach to the address space of init_task. */
102 atomic_inc(&init_mm.mm_count);
103 current->active_mm = &init_mm;
104
105 while (!cpu_isset(cpuid, smp_commenced_mask))
106 mb();
107
108 local_irq_enable();
109 cpu_set(cpuid, cpu_online_map);
110}
111
112/*
113 * Cycle through the processors asking the PROM to start each one.
114 */
115
116extern struct linux_prom_registers smp_penguin_ctable;
117
118void __init leon_configure_cache_smp(void)
119{
120 unsigned long cfg = sparc_leon3_get_dcachecfg();
121 int me = smp_processor_id();
122
123 if (ASI_LEON3_SYSCTRL_CFG_SSIZE(cfg) > 4) {
124 printk(KERN_INFO "Note: SMP with snooping only works on 4k cache, found %dk(0x%x) on cpu %d, disabling caches\n",
125 (unsigned int)ASI_LEON3_SYSCTRL_CFG_SSIZE(cfg),
126 (unsigned int)cfg, (unsigned int)me);
127 sparc_leon3_disable_cache();
128 } else {
129 if (cfg & ASI_LEON3_SYSCTRL_CFG_SNOOPING) {
130 sparc_leon3_enable_snooping();
131 } else {
132 printk(KERN_INFO "Note: You have to enable snooping in the vhdl model cpu %d, disabling caches\n",
133 me);
134 sparc_leon3_disable_cache();
135 }
136 }
137
138 local_flush_cache_all();
139 local_flush_tlb_all();
140}
141
142void leon_smp_setbroadcast(unsigned int mask)
143{
144 int broadcast =
145 ((LEON3_BYPASS_LOAD_PA(&(leon3_irqctrl_regs->mpstatus)) >>
146 LEON3_IRQMPSTATUS_BROADCAST) & 1);
147 if (!broadcast) {
148 prom_printf("######## !!!! The irqmp-ctrl must have broadcast enabled, smp wont work !!!!! ####### nr cpus: %d\n",
149 leon_smp_nrcpus());
150 if (leon_smp_nrcpus() > 1) {
151 BUG();
152 } else {
153 prom_printf("continue anyway\n");
154 return;
155 }
156 }
157 LEON_BYPASS_STORE_PA(&(leon3_irqctrl_regs->mpbroadcast), mask);
158}
159
160unsigned int leon_smp_getbroadcast(void)
161{
162 unsigned int mask;
163 mask = LEON_BYPASS_LOAD_PA(&(leon3_irqctrl_regs->mpbroadcast));
164 return mask;
165}
166
167int leon_smp_nrcpus(void)
168{
169 int nrcpu =
170 ((LEON3_BYPASS_LOAD_PA(&(leon3_irqctrl_regs->mpstatus)) >>
171 LEON3_IRQMPSTATUS_CPUNR) & 0xf) + 1;
172 return nrcpu;
173}
174
175void __init leon_boot_cpus(void)
176{
177 int nrcpu = leon_smp_nrcpus();
178 int me = smp_processor_id();
179
180 printk(KERN_INFO "%d:(%d:%d) cpus mpirq at 0x%x \n", (unsigned int)me,
181 (unsigned int)nrcpu, (unsigned int)NR_CPUS,
182 (unsigned int)&(leon3_irqctrl_regs->mpstatus));
183
184 leon_enable_irq_cpu(LEON3_IRQ_CROSS_CALL, me);
185 leon_enable_irq_cpu(LEON3_IRQ_TICKER, me);
186 leon_enable_irq_cpu(LEON3_IRQ_RESCHEDULE, me);
187
188 leon_smp_setbroadcast(1 << LEON3_IRQ_TICKER);
189
190 leon_configure_cache_smp();
191 smp_setup_percpu_timer();
192 local_flush_cache_all();
193
194}
195
196int __cpuinit leon_boot_one_cpu(int i)
197{
198
199 struct task_struct *p;
200 int timeout;
201
202 /* Cook up an idler for this guy. */
203 p = fork_idle(i);
204
205 current_set[i] = task_thread_info(p);
206
207 /* See trampoline.S:leon_smp_cpu_startup for details...
208 * Initialize the contexts table
209 * Since the call to prom_startcpu() trashes the structure,
210 * we need to re-initialize it for each cpu
211 */
212 smp_penguin_ctable.which_io = 0;
213 smp_penguin_ctable.phys_addr = (unsigned int)srmmu_ctx_table_phys;
214 smp_penguin_ctable.reg_size = 0;
215
216 /* whirrr, whirrr, whirrrrrrrrr... */
217 printk(KERN_INFO "Starting CPU %d : (irqmp: 0x%x)\n", (unsigned int)i,
218 (unsigned int)&leon3_irqctrl_regs->mpstatus);
219 local_flush_cache_all();
220
221 LEON_BYPASS_STORE_PA(&(leon3_irqctrl_regs->mpstatus), 1 << i);
222
223 /* wheee... it's going... */
224 for (timeout = 0; timeout < 10000; timeout++) {
225 if (cpu_callin_map[i])
226 break;
227 udelay(200);
228 }
229 printk(KERN_INFO "Started CPU %d \n", (unsigned int)i);
230
231 if (!(cpu_callin_map[i])) {
232 printk(KERN_ERR "Processor %d is stuck.\n", i);
233 return -ENODEV;
234 } else {
235 leon_enable_irq_cpu(LEON3_IRQ_CROSS_CALL, i);
236 leon_enable_irq_cpu(LEON3_IRQ_TICKER, i);
237 leon_enable_irq_cpu(LEON3_IRQ_RESCHEDULE, i);
238 }
239
240 local_flush_cache_all();
241 return 0;
242}
243
244void __init leon_smp_done(void)
245{
246
247 int i, first;
248 int *prev;
249
250 /* setup cpu list for irq rotation */
251 first = 0;
252 prev = &first;
253 for (i = 0; i < NR_CPUS; i++) {
254 if (cpu_online(i)) {
255 *prev = i;
256 prev = &cpu_data(i).next;
257 }
258 }
259 *prev = first;
260 local_flush_cache_all();
261
262 /* Free unneeded trap tables */
263 if (!cpu_isset(1, cpu_present_map)) {
264 ClearPageReserved(virt_to_page(trapbase_cpu1));
265 init_page_count(virt_to_page(trapbase_cpu1));
266 free_page((unsigned long)trapbase_cpu1);
267 totalram_pages++;
268 num_physpages++;
269 }
270 if (!cpu_isset(2, cpu_present_map)) {
271 ClearPageReserved(virt_to_page(trapbase_cpu2));
272 init_page_count(virt_to_page(trapbase_cpu2));
273 free_page((unsigned long)trapbase_cpu2);
274 totalram_pages++;
275 num_physpages++;
276 }
277 if (!cpu_isset(3, cpu_present_map)) {
278 ClearPageReserved(virt_to_page(trapbase_cpu3));
279 init_page_count(virt_to_page(trapbase_cpu3));
280 free_page((unsigned long)trapbase_cpu3);
281 totalram_pages++;
282 num_physpages++;
283 }
284 /* Ok, they are spinning and ready to go. */
285 smp_processors_ready = 1;
286
287}
288
289void leon_irq_rotate(int cpu)
290{
291}
292
293static struct smp_funcall {
294 smpfunc_t func;
295 unsigned long arg1;
296 unsigned long arg2;
297 unsigned long arg3;
298 unsigned long arg4;
299 unsigned long arg5;
300 unsigned long processors_in[NR_CPUS]; /* Set when ipi entered. */
301 unsigned long processors_out[NR_CPUS]; /* Set when ipi exited. */
302} ccall_info;
303
304static DEFINE_SPINLOCK(cross_call_lock);
305
306/* Cross calls must be serialized, at least currently. */
307static void leon_cross_call(smpfunc_t func, cpumask_t mask, unsigned long arg1,
308 unsigned long arg2, unsigned long arg3,
309 unsigned long arg4)
310{
311 if (smp_processors_ready) {
312 register int high = NR_CPUS - 1;
313 unsigned long flags;
314
315 spin_lock_irqsave(&cross_call_lock, flags);
316
317 {
318 /* If you make changes here, make sure gcc generates proper code... */
319 register smpfunc_t f asm("i0") = func;
320 register unsigned long a1 asm("i1") = arg1;
321 register unsigned long a2 asm("i2") = arg2;
322 register unsigned long a3 asm("i3") = arg3;
323 register unsigned long a4 asm("i4") = arg4;
324 register unsigned long a5 asm("i5") = 0;
325
326 __asm__ __volatile__("std %0, [%6]\n\t"
327 "std %2, [%6 + 8]\n\t"
328 "std %4, [%6 + 16]\n\t" : :
329 "r"(f), "r"(a1), "r"(a2), "r"(a3),
330 "r"(a4), "r"(a5),
331 "r"(&ccall_info.func));
332 }
333
334 /* Init receive/complete mapping, plus fire the IPI's off. */
335 {
336 register int i;
337
338 cpu_clear(smp_processor_id(), mask);
339 cpus_and(mask, cpu_online_map, mask);
340 for (i = 0; i <= high; i++) {
341 if (cpu_isset(i, mask)) {
342 ccall_info.processors_in[i] = 0;
343 ccall_info.processors_out[i] = 0;
344 set_cpu_int(i, LEON3_IRQ_CROSS_CALL);
345
346 }
347 }
348 }
349
350 {
351 register int i;
352
353 i = 0;
354 do {
355 if (!cpu_isset(i, mask))
356 continue;
357
358 while (!ccall_info.processors_in[i])
359 barrier();
360 } while (++i <= high);
361
362 i = 0;
363 do {
364 if (!cpu_isset(i, mask))
365 continue;
366
367 while (!ccall_info.processors_out[i])
368 barrier();
369 } while (++i <= high);
370 }
371
372 spin_unlock_irqrestore(&cross_call_lock, flags);
373 }
374}
375
376/* Running cross calls. */
377void leon_cross_call_irq(void)
378{
379 int i = smp_processor_id();
380
381 ccall_info.processors_in[i] = 1;
382 ccall_info.func(ccall_info.arg1, ccall_info.arg2, ccall_info.arg3,
383 ccall_info.arg4, ccall_info.arg5);
384 ccall_info.processors_out[i] = 1;
385}
386
387void leon_percpu_timer_interrupt(struct pt_regs *regs)
388{
389 struct pt_regs *old_regs;
390 int cpu = smp_processor_id();
391
392 old_regs = set_irq_regs(regs);
393
394 leon_clear_profile_irq(cpu);
395
396 profile_tick(CPU_PROFILING);
397
398 if (!--prof_counter(cpu)) {
399 int user = user_mode(regs);
400
401 irq_enter();
402 update_process_times(user);
403 irq_exit();
404
405 prof_counter(cpu) = prof_multiplier(cpu);
406 }
407 set_irq_regs(old_regs);
408}
409
410static void __init smp_setup_percpu_timer(void)
411{
412 int cpu = smp_processor_id();
413
414 prof_counter(cpu) = prof_multiplier(cpu) = 1;
415}
416
417void __init leon_blackbox_id(unsigned *addr)
418{
419 int rd = *addr & 0x3e000000;
420 int rs1 = rd >> 11;
421
422 /* patch places where ___b_hard_smp_processor_id appears */
423 addr[0] = 0x81444000 | rd; /* rd %asr17, reg */
424 addr[1] = 0x8130201c | rd | rs1; /* srl reg, 0x1c, reg */
425 addr[2] = 0x01000000; /* nop */
426}
427
428void __init leon_blackbox_current(unsigned *addr)
429{
430 int rd = *addr & 0x3e000000;
431 int rs1 = rd >> 11;
432
433 /* patch LOAD_CURRENT macro where ___b_load_current appears */
434 addr[0] = 0x81444000 | rd; /* rd %asr17, reg */
435 addr[2] = 0x8130201c | rd | rs1; /* srl reg, 0x1c, reg */
436 addr[4] = 0x81282002 | rd | rs1; /* sll reg, 0x2, reg */
437
438}
439
440/*
441 * CPU idle callback function
442 * See .../arch/sparc/kernel/process.c
443 */
444void pmc_leon_idle(void)
445{
446 __asm__ volatile ("mov %g0, %asr19");
447}
448
449void __init leon_init_smp(void)
450{
451 /* Patch ipi15 trap table */
452 t_nmi[1] = t_nmi[1] + (linux_trap_ipi15_leon - linux_trap_ipi15_sun4m);
453
454 BTFIXUPSET_BLACKBOX(hard_smp_processor_id, leon_blackbox_id);
455 BTFIXUPSET_BLACKBOX(load_current, leon_blackbox_current);
456 BTFIXUPSET_CALL(smp_cross_call, leon_cross_call, BTFIXUPCALL_NORM);
457 BTFIXUPSET_CALL(__hard_smp_processor_id, __leon_processor_id,
458 BTFIXUPCALL_NORM);
459
460#ifndef PMC_NO_IDLE
461 /* Assign power management IDLE handler */
462 pm_idle = pmc_leon_idle;
463 printk(KERN_INFO "leon: power management initialized\n");
464#endif
465
466}
467
468#endif /* CONFIG_SPARC_LEON */
diff --git a/arch/sparc/kernel/pci_msi.c b/arch/sparc/kernel/pci_msi.c
index f1be37a7b123..e1b0541feb19 100644
--- a/arch/sparc/kernel/pci_msi.c
+++ b/arch/sparc/kernel/pci_msi.c
@@ -112,7 +112,7 @@ static void free_msi(struct pci_pbm_info *pbm, int msi_num)
112} 112}
113 113
114static struct irq_chip msi_irq = { 114static struct irq_chip msi_irq = {
115 .typename = "PCI-MSI", 115 .name = "PCI-MSI",
116 .mask = mask_msi_irq, 116 .mask = mask_msi_irq,
117 .unmask = unmask_msi_irq, 117 .unmask = unmask_msi_irq,
118 .enable = unmask_msi_irq, 118 .enable = unmask_msi_irq,
diff --git a/arch/sparc/kernel/setup_64.c b/arch/sparc/kernel/setup_64.c
index 21180339cb09..a2a79e76344f 100644
--- a/arch/sparc/kernel/setup_64.c
+++ b/arch/sparc/kernel/setup_64.c
@@ -46,6 +46,7 @@
46#include <asm/setup.h> 46#include <asm/setup.h>
47#include <asm/mmu.h> 47#include <asm/mmu.h>
48#include <asm/ns87303.h> 48#include <asm/ns87303.h>
49#include <asm/btext.h>
49 50
50#ifdef CONFIG_IP_PNP 51#ifdef CONFIG_IP_PNP
51#include <net/ipconfig.h> 52#include <net/ipconfig.h>
@@ -286,7 +287,10 @@ void __init setup_arch(char **cmdline_p)
286 parse_early_param(); 287 parse_early_param();
287 288
288 boot_flags_init(*cmdline_p); 289 boot_flags_init(*cmdline_p);
289 register_console(&prom_early_console); 290#ifdef CONFIG_EARLYFB
291 if (btext_find_display())
292#endif
293 register_console(&prom_early_console);
290 294
291 if (tlb_type == hypervisor) 295 if (tlb_type == hypervisor)
292 printk("ARCH: SUN4V\n"); 296 printk("ARCH: SUN4V\n");
diff --git a/arch/sparc/kernel/smp_32.c b/arch/sparc/kernel/smp_32.c
index 132d81fb2616..91c10fb70858 100644
--- a/arch/sparc/kernel/smp_32.c
+++ b/arch/sparc/kernel/smp_32.c
@@ -32,6 +32,7 @@
32#include <asm/cacheflush.h> 32#include <asm/cacheflush.h>
33#include <asm/tlbflush.h> 33#include <asm/tlbflush.h>
34#include <asm/cpudata.h> 34#include <asm/cpudata.h>
35#include <asm/leon.h>
35 36
36#include "irq.h" 37#include "irq.h"
37 38
@@ -96,6 +97,9 @@ void __init smp_cpus_done(unsigned int max_cpus)
96 case sun4d: 97 case sun4d:
97 smp4d_smp_done(); 98 smp4d_smp_done();
98 break; 99 break;
100 case sparc_leon:
101 leon_smp_done();
102 break;
99 case sun4e: 103 case sun4e:
100 printk("SUN4E\n"); 104 printk("SUN4E\n");
101 BUG(); 105 BUG();
@@ -306,6 +310,9 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
306 case sun4d: 310 case sun4d:
307 smp4d_boot_cpus(); 311 smp4d_boot_cpus();
308 break; 312 break;
313 case sparc_leon:
314 leon_boot_cpus();
315 break;
309 case sun4e: 316 case sun4e:
310 printk("SUN4E\n"); 317 printk("SUN4E\n");
311 BUG(); 318 BUG();
@@ -376,6 +383,9 @@ int __cpuinit __cpu_up(unsigned int cpu)
376 case sun4d: 383 case sun4d:
377 ret = smp4d_boot_one_cpu(cpu); 384 ret = smp4d_boot_one_cpu(cpu);
378 break; 385 break;
386 case sparc_leon:
387 ret = leon_boot_one_cpu(cpu);
388 break;
379 case sun4e: 389 case sun4e:
380 printk("SUN4E\n"); 390 printk("SUN4E\n");
381 BUG(); 391 BUG();
diff --git a/arch/sparc/kernel/sys_sparc32.c b/arch/sparc/kernel/sys_sparc32.c
index 04e28b2671c8..00abe87e5b51 100644
--- a/arch/sparc/kernel/sys_sparc32.c
+++ b/arch/sparc/kernel/sys_sparc32.c
@@ -26,11 +26,6 @@
26#include <linux/nfs_fs.h> 26#include <linux/nfs_fs.h>
27#include <linux/quota.h> 27#include <linux/quota.h>
28#include <linux/module.h> 28#include <linux/module.h>
29#include <linux/sunrpc/svc.h>
30#include <linux/nfsd/nfsd.h>
31#include <linux/nfsd/cache.h>
32#include <linux/nfsd/xdr.h>
33#include <linux/nfsd/syscall.h>
34#include <linux/poll.h> 29#include <linux/poll.h>
35#include <linux/personality.h> 30#include <linux/personality.h>
36#include <linux/stat.h> 31#include <linux/stat.h>
@@ -591,63 +586,6 @@ out:
591 return ret; 586 return ret;
592} 587}
593 588
594struct __sysctl_args32 {
595 u32 name;
596 int nlen;
597 u32 oldval;
598 u32 oldlenp;
599 u32 newval;
600 u32 newlen;
601 u32 __unused[4];
602};
603
604asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args)
605{
606#ifndef CONFIG_SYSCTL_SYSCALL
607 return -ENOSYS;
608#else
609 struct __sysctl_args32 tmp;
610 int error;
611 size_t oldlen, __user *oldlenp = NULL;
612 unsigned long addr = (((unsigned long)&args->__unused[0]) + 7UL) & ~7UL;
613
614 if (copy_from_user(&tmp, args, sizeof(tmp)))
615 return -EFAULT;
616
617 if (tmp.oldval && tmp.oldlenp) {
618 /* Duh, this is ugly and might not work if sysctl_args
619 is in read-only memory, but do_sysctl does indirectly
620 a lot of uaccess in both directions and we'd have to
621 basically copy the whole sysctl.c here, and
622 glibc's __sysctl uses rw memory for the structure
623 anyway. */
624 if (get_user(oldlen, (u32 __user *)(unsigned long)tmp.oldlenp) ||
625 put_user(oldlen, (size_t __user *)addr))
626 return -EFAULT;
627 oldlenp = (size_t __user *)addr;
628 }
629
630 lock_kernel();
631 error = do_sysctl((int __user *)(unsigned long) tmp.name,
632 tmp.nlen,
633 (void __user *)(unsigned long) tmp.oldval,
634 oldlenp,
635 (void __user *)(unsigned long) tmp.newval,
636 tmp.newlen);
637 unlock_kernel();
638 if (oldlenp) {
639 if (!error) {
640 if (get_user(oldlen, (size_t __user *)addr) ||
641 put_user(oldlen, (u32 __user *)(unsigned long) tmp.oldlenp))
642 error = -EFAULT;
643 }
644 if (copy_to_user(args->__unused, tmp.__unused, sizeof(tmp.__unused)))
645 error = -EFAULT;
646 }
647 return error;
648#endif
649}
650
651long sys32_lookup_dcookie(unsigned long cookie_high, 589long sys32_lookup_dcookie(unsigned long cookie_high,
652 unsigned long cookie_low, 590 unsigned long cookie_low,
653 char __user *buf, size_t len) 591 char __user *buf, size_t len)
diff --git a/arch/sparc/kernel/systbls_32.S b/arch/sparc/kernel/systbls_32.S
index 0f1658d37490..ceb1530f8aa6 100644
--- a/arch/sparc/kernel/systbls_32.S
+++ b/arch/sparc/kernel/systbls_32.S
@@ -82,5 +82,5 @@ sys_call_table:
82/*310*/ .long sys_utimensat, sys_signalfd, sys_timerfd_create, sys_eventfd, sys_fallocate 82/*310*/ .long sys_utimensat, sys_signalfd, sys_timerfd_create, sys_eventfd, sys_fallocate
83/*315*/ .long sys_timerfd_settime, sys_timerfd_gettime, sys_signalfd4, sys_eventfd2, sys_epoll_create1 83/*315*/ .long sys_timerfd_settime, sys_timerfd_gettime, sys_signalfd4, sys_eventfd2, sys_epoll_create1
84/*320*/ .long sys_dup3, sys_pipe2, sys_inotify_init1, sys_accept4, sys_preadv 84/*320*/ .long sys_dup3, sys_pipe2, sys_inotify_init1, sys_accept4, sys_preadv
85/*325*/ .long sys_pwritev, sys_rt_tgsigqueueinfo, sys_perf_event_open 85/*325*/ .long sys_pwritev, sys_rt_tgsigqueueinfo, sys_perf_event_open, sys_recvmmsg
86 86
diff --git a/arch/sparc/kernel/systbls_64.S b/arch/sparc/kernel/systbls_64.S
index 009825f6e73c..cc8e7862e95a 100644
--- a/arch/sparc/kernel/systbls_64.S
+++ b/arch/sparc/kernel/systbls_64.S
@@ -68,7 +68,7 @@ sys_call_table32:
68 .word compat_sys_fstatfs64, sys_llseek, sys_mlock, sys_munlock, sys32_mlockall 68 .word compat_sys_fstatfs64, sys_llseek, sys_mlock, sys_munlock, sys32_mlockall
69/*240*/ .word sys_munlockall, sys32_sched_setparam, sys32_sched_getparam, sys32_sched_setscheduler, sys32_sched_getscheduler 69/*240*/ .word sys_munlockall, sys32_sched_setparam, sys32_sched_getparam, sys32_sched_setscheduler, sys32_sched_getscheduler
70 .word sys_sched_yield, sys32_sched_get_priority_max, sys32_sched_get_priority_min, sys32_sched_rr_get_interval, compat_sys_nanosleep 70 .word sys_sched_yield, sys32_sched_get_priority_max, sys32_sched_get_priority_min, sys32_sched_rr_get_interval, compat_sys_nanosleep
71/*250*/ .word sys32_mremap, sys32_sysctl, sys32_getsid, sys_fdatasync, sys32_nfsservctl 71/*250*/ .word sys32_mremap, compat_sys_sysctl, sys32_getsid, sys_fdatasync, sys32_nfsservctl
72 .word sys32_sync_file_range, compat_sys_clock_settime, compat_sys_clock_gettime, compat_sys_clock_getres, sys32_clock_nanosleep 72 .word sys32_sync_file_range, compat_sys_clock_settime, compat_sys_clock_gettime, compat_sys_clock_getres, sys32_clock_nanosleep
73/*260*/ .word compat_sys_sched_getaffinity, compat_sys_sched_setaffinity, sys32_timer_settime, compat_sys_timer_gettime, sys_timer_getoverrun 73/*260*/ .word compat_sys_sched_getaffinity, compat_sys_sched_setaffinity, sys32_timer_settime, compat_sys_timer_gettime, sys_timer_getoverrun
74 .word sys_timer_delete, compat_sys_timer_create, sys_ni_syscall, compat_sys_io_setup, sys_io_destroy 74 .word sys_timer_delete, compat_sys_timer_create, sys_ni_syscall, compat_sys_io_setup, sys_io_destroy
@@ -83,7 +83,7 @@ sys_call_table32:
83/*310*/ .word compat_sys_utimensat, compat_sys_signalfd, sys_timerfd_create, sys_eventfd, compat_sys_fallocate 83/*310*/ .word compat_sys_utimensat, compat_sys_signalfd, sys_timerfd_create, sys_eventfd, compat_sys_fallocate
84 .word compat_sys_timerfd_settime, compat_sys_timerfd_gettime, compat_sys_signalfd4, sys_eventfd2, sys_epoll_create1 84 .word compat_sys_timerfd_settime, compat_sys_timerfd_gettime, compat_sys_signalfd4, sys_eventfd2, sys_epoll_create1
85/*320*/ .word sys_dup3, sys_pipe2, sys_inotify_init1, sys_accept4, compat_sys_preadv 85/*320*/ .word sys_dup3, sys_pipe2, sys_inotify_init1, sys_accept4, compat_sys_preadv
86 .word compat_sys_pwritev, compat_sys_rt_tgsigqueueinfo, sys_perf_event_open 86 .word compat_sys_pwritev, compat_sys_rt_tgsigqueueinfo, sys_perf_event_open, compat_sys_recvmmsg
87 87
88#endif /* CONFIG_COMPAT */ 88#endif /* CONFIG_COMPAT */
89 89
@@ -158,4 +158,4 @@ sys_call_table:
158/*310*/ .word sys_utimensat, sys_signalfd, sys_timerfd_create, sys_eventfd, sys_fallocate 158/*310*/ .word sys_utimensat, sys_signalfd, sys_timerfd_create, sys_eventfd, sys_fallocate
159 .word sys_timerfd_settime, sys_timerfd_gettime, sys_signalfd4, sys_eventfd2, sys_epoll_create1 159 .word sys_timerfd_settime, sys_timerfd_gettime, sys_signalfd4, sys_eventfd2, sys_epoll_create1
160/*320*/ .word sys_dup3, sys_pipe2, sys_inotify_init1, sys_accept4, sys_preadv 160/*320*/ .word sys_dup3, sys_pipe2, sys_inotify_init1, sys_accept4, sys_preadv
161 .word sys_pwritev, sys_rt_tgsigqueueinfo, sys_perf_event_open 161 .word sys_pwritev, sys_rt_tgsigqueueinfo, sys_perf_event_open, sys_recvmmsg
diff --git a/arch/sparc/kernel/time_32.c b/arch/sparc/kernel/time_32.c
index 614ac7b4a9dd..5b2f595fe65b 100644
--- a/arch/sparc/kernel/time_32.c
+++ b/arch/sparc/kernel/time_32.c
@@ -210,9 +210,6 @@ static void __init sbus_time_init(void)
210 btfixup(); 210 btfixup();
211 211
212 sparc_init_timers(timer_interrupt); 212 sparc_init_timers(timer_interrupt);
213
214 /* Now that OBP ticker has been silenced, it is safe to enable IRQ. */
215 local_irq_enable();
216} 213}
217 214
218void __init time_init(void) 215void __init time_init(void)
diff --git a/arch/sparc/kernel/time_64.c b/arch/sparc/kernel/time_64.c
index da1218e8ee87..63f73ae8a892 100644
--- a/arch/sparc/kernel/time_64.c
+++ b/arch/sparc/kernel/time_64.c
@@ -847,7 +847,7 @@ void __init time_init(void)
847 sparc64_clockevent.min_delta_ns = 847 sparc64_clockevent.min_delta_ns =
848 clockevent_delta2ns(0xF, &sparc64_clockevent); 848 clockevent_delta2ns(0xF, &sparc64_clockevent);
849 849
850 printk("clockevent: mult[%lx] shift[%d]\n", 850 printk("clockevent: mult[%ux] shift[%d]\n",
851 sparc64_clockevent.mult, sparc64_clockevent.shift); 851 sparc64_clockevent.mult, sparc64_clockevent.shift);
852 852
853 setup_sparc64_timer(); 853 setup_sparc64_timer();
diff --git a/arch/sparc/kernel/trampoline_32.S b/arch/sparc/kernel/trampoline_32.S
index 5e235c52d667..691f484e03b3 100644
--- a/arch/sparc/kernel/trampoline_32.S
+++ b/arch/sparc/kernel/trampoline_32.S
@@ -15,7 +15,7 @@
15#include <asm/contregs.h> 15#include <asm/contregs.h>
16#include <asm/thread_info.h> 16#include <asm/thread_info.h>
17 17
18 .globl sun4m_cpu_startup, __smp4m_processor_id 18 .globl sun4m_cpu_startup, __smp4m_processor_id, __leon_processor_id
19 .globl sun4d_cpu_startup, __smp4d_processor_id 19 .globl sun4d_cpu_startup, __smp4d_processor_id
20 20
21 __CPUINIT 21 __CPUINIT
@@ -106,6 +106,12 @@ __smp4d_processor_id:
106 retl 106 retl
107 mov %g1, %o7 107 mov %g1, %o7
108 108
109__leon_processor_id:
110 rd %asr17,%g2
111 srl %g2,28,%g2
112 retl
113 mov %g1, %o7
114
109/* CPUID in bootbus can be found at PA 0xff0140000 */ 115/* CPUID in bootbus can be found at PA 0xff0140000 */
110#define SUN4D_BOOTBUS_CPUID 0xf0140000 116#define SUN4D_BOOTBUS_CPUID 0xf0140000
111 117
@@ -160,3 +166,64 @@ sun4d_cpu_startup:
160 nop 166 nop
161 167
162 b,a smp_do_cpu_idle 168 b,a smp_do_cpu_idle
169
170#ifdef CONFIG_SPARC_LEON
171
172 __CPUINIT
173 .align 4
174 .global leon_smp_cpu_startup, smp_penguin_ctable
175
176leon_smp_cpu_startup:
177
178 set smp_penguin_ctable,%g1
179 ld [%g1+4],%g1
180 srl %g1,4,%g1
181 set 0x00000100,%g5 /* SRMMU_CTXTBL_PTR */
182 sta %g1, [%g5] ASI_M_MMUREGS
183
184 /* Set up a sane %psr -- PIL<0xf> S<0x1> PS<0x1> CWP<0x0> */
185 set (PSR_PIL | PSR_S | PSR_PS), %g1
186 wr %g1, 0x0, %psr ! traps off though
187 WRITE_PAUSE
188
189 /* Our %wim is one behind CWP */
190 mov 2, %g1
191 wr %g1, 0x0, %wim
192 WRITE_PAUSE
193
194 /* Set tbr - we use just one trap table. */
195 set trapbase, %g1
196 wr %g1, 0x0, %tbr
197 WRITE_PAUSE
198
199 /* Get our CPU id */
200 rd %asr17,%g3
201
202 /* Give ourselves a stack and curptr. */
203 set current_set, %g5
204 srl %g3, 28, %g4
205 sll %g4, 2, %g4
206 ld [%g5 + %g4], %g6
207
208 sethi %hi(THREAD_SIZE - STACKFRAME_SZ), %sp
209 or %sp, %lo(THREAD_SIZE - STACKFRAME_SZ), %sp
210 add %g6, %sp, %sp
211
212 /* Turn on traps (PSR_ET). */
213 rd %psr, %g1
214 wr %g1, PSR_ET, %psr ! traps on
215 WRITE_PAUSE
216
217 /* Init our caches, etc. */
218 set poke_srmmu, %g5
219 ld [%g5], %g5
220 call %g5
221 nop
222
223 /* Start this processor. */
224 call leon_callin
225 nop
226
227 b,a smp_do_cpu_idle
228
229#endif
diff --git a/arch/sparc/mm/init_64.h b/arch/sparc/mm/init_64.h
index c2f772dbd556..77d1b313e344 100644
--- a/arch/sparc/mm/init_64.h
+++ b/arch/sparc/mm/init_64.h
@@ -45,7 +45,7 @@ extern void free_initmem(void);
45#define VMEMMAP_ALIGN(x) (((x)+VMEMMAP_CHUNK-1UL)&VMEMMAP_CHUNK_MASK) 45#define VMEMMAP_ALIGN(x) (((x)+VMEMMAP_CHUNK-1UL)&VMEMMAP_CHUNK_MASK)
46 46
47#define VMEMMAP_SIZE ((((1UL << MAX_PHYSADDR_BITS) >> PAGE_SHIFT) * \ 47#define VMEMMAP_SIZE ((((1UL << MAX_PHYSADDR_BITS) >> PAGE_SHIFT) * \
48 sizeof(struct page *)) >> VMEMMAP_CHUNK_SHIFT) 48 sizeof(struct page)) >> VMEMMAP_CHUNK_SHIFT)
49extern unsigned long vmemmap_table[VMEMMAP_SIZE]; 49extern unsigned long vmemmap_table[VMEMMAP_SIZE];
50#endif 50#endif
51 51
diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c
index 509b1ffeba66..367321a030dd 100644
--- a/arch/sparc/mm/srmmu.c
+++ b/arch/sparc/mm/srmmu.c
@@ -1990,7 +1990,7 @@ void __init poke_leonsparc(void)
1990void __init init_leon(void) 1990void __init init_leon(void)
1991{ 1991{
1992 1992
1993 srmmu_name = "Leon"; 1993 srmmu_name = "LEON";
1994 1994
1995 BTFIXUPSET_CALL(flush_cache_all, leon_flush_cache_all, 1995 BTFIXUPSET_CALL(flush_cache_all, leon_flush_cache_all,
1996 BTFIXUPCALL_NORM); 1996 BTFIXUPCALL_NORM);
@@ -2037,8 +2037,6 @@ static void __init get_srmmu_type(void)
2037 2037
2038 /* First, check for sparc-leon. */ 2038 /* First, check for sparc-leon. */
2039 if (sparc_cpu_model == sparc_leon) { 2039 if (sparc_cpu_model == sparc_leon) {
2040 psr_typ = 0xf; /* hardcoded ids for older models/simulators */
2041 psr_vers = 2;
2042 init_leon(); 2040 init_leon();
2043 return; 2041 return;
2044 } 2042 }
@@ -2301,7 +2299,8 @@ void __init ld_mmu_srmmu(void)
2301 BTFIXUPSET_CALL(flush_cache_mm, smp_flush_cache_mm, BTFIXUPCALL_NORM); 2299 BTFIXUPSET_CALL(flush_cache_mm, smp_flush_cache_mm, BTFIXUPCALL_NORM);
2302 BTFIXUPSET_CALL(flush_cache_range, smp_flush_cache_range, BTFIXUPCALL_NORM); 2300 BTFIXUPSET_CALL(flush_cache_range, smp_flush_cache_range, BTFIXUPCALL_NORM);
2303 BTFIXUPSET_CALL(flush_cache_page, smp_flush_cache_page, BTFIXUPCALL_NORM); 2301 BTFIXUPSET_CALL(flush_cache_page, smp_flush_cache_page, BTFIXUPCALL_NORM);
2304 if (sparc_cpu_model != sun4d) { 2302 if (sparc_cpu_model != sun4d &&
2303 sparc_cpu_model != sparc_leon) {
2305 BTFIXUPSET_CALL(flush_tlb_all, smp_flush_tlb_all, BTFIXUPCALL_NORM); 2304 BTFIXUPSET_CALL(flush_tlb_all, smp_flush_tlb_all, BTFIXUPCALL_NORM);
2306 BTFIXUPSET_CALL(flush_tlb_mm, smp_flush_tlb_mm, BTFIXUPCALL_NORM); 2305 BTFIXUPSET_CALL(flush_tlb_mm, smp_flush_tlb_mm, BTFIXUPCALL_NORM);
2307 BTFIXUPSET_CALL(flush_tlb_range, smp_flush_tlb_range, BTFIXUPCALL_NORM); 2306 BTFIXUPSET_CALL(flush_tlb_range, smp_flush_tlb_range, BTFIXUPCALL_NORM);
@@ -2330,6 +2329,8 @@ void __init ld_mmu_srmmu(void)
2330#ifdef CONFIG_SMP 2329#ifdef CONFIG_SMP
2331 if (sparc_cpu_model == sun4d) 2330 if (sparc_cpu_model == sun4d)
2332 sun4d_init_smp(); 2331 sun4d_init_smp();
2332 else if (sparc_cpu_model == sparc_leon)
2333 leon_init_smp();
2333 else 2334 else
2334 sun4m_init_smp(); 2335 sun4m_init_smp();
2335#endif 2336#endif
diff --git a/arch/um/drivers/mmapper_kern.c b/arch/um/drivers/mmapper_kern.c
index eb240323c40a..d22f9e5c0eac 100644
--- a/arch/um/drivers/mmapper_kern.c
+++ b/arch/um/drivers/mmapper_kern.c
@@ -16,7 +16,7 @@
16#include <linux/miscdevice.h> 16#include <linux/miscdevice.h>
17#include <linux/module.h> 17#include <linux/module.h>
18#include <linux/mm.h> 18#include <linux/mm.h>
19#include <linux/smp_lock.h> 19
20#include <asm/uaccess.h> 20#include <asm/uaccess.h>
21#include "mem_user.h" 21#include "mem_user.h"
22 22
@@ -78,7 +78,6 @@ out:
78 78
79static int mmapper_open(struct inode *inode, struct file *file) 79static int mmapper_open(struct inode *inode, struct file *file)
80{ 80{
81 cycle_kernel_lock();
82 return 0; 81 return 0;
83} 82}
84 83
@@ -115,18 +114,16 @@ static int __init mmapper_init(void)
115 v_buf = (char *) find_iomem("mmapper", &mmapper_size); 114 v_buf = (char *) find_iomem("mmapper", &mmapper_size);
116 if (mmapper_size == 0) { 115 if (mmapper_size == 0) {
117 printk(KERN_ERR "mmapper_init - find_iomem failed\n"); 116 printk(KERN_ERR "mmapper_init - find_iomem failed\n");
118 goto out; 117 return -ENODEV;
119 } 118 }
119 p_buf = __pa(v_buf);
120 120
121 err = misc_register(&mmapper_dev); 121 err = misc_register(&mmapper_dev);
122 if (err) { 122 if (err) {
123 printk(KERN_ERR "mmapper - misc_register failed, err = %d\n", 123 printk(KERN_ERR "mmapper - misc_register failed, err = %d\n",
124 err); 124 err);
125 goto out; 125 return err;;
126 } 126 }
127
128 p_buf = __pa(v_buf);
129out:
130 return 0; 127 return 0;
131} 128}
132 129
diff --git a/arch/um/drivers/random.c b/arch/um/drivers/random.c
index 6eabb7022a2d..4949044773ba 100644
--- a/arch/um/drivers/random.c
+++ b/arch/um/drivers/random.c
@@ -7,7 +7,6 @@
7 * of the GNU General Public License, incorporated herein by reference. 7 * of the GNU General Public License, incorporated herein by reference.
8 */ 8 */
9#include <linux/sched.h> 9#include <linux/sched.h>
10#include <linux/smp_lock.h>
11#include <linux/module.h> 10#include <linux/module.h>
12#include <linux/fs.h> 11#include <linux/fs.h>
13#include <linux/interrupt.h> 12#include <linux/interrupt.h>
@@ -34,8 +33,6 @@ static DECLARE_WAIT_QUEUE_HEAD(host_read_wait);
34 33
35static int rng_dev_open (struct inode *inode, struct file *filp) 34static int rng_dev_open (struct inode *inode, struct file *filp)
36{ 35{
37 cycle_kernel_lock();
38
39 /* enforce read-only access to this chrdev */ 36 /* enforce read-only access to this chrdev */
40 if ((filp->f_mode & FMODE_READ) == 0) 37 if ((filp->f_mode & FMODE_READ) == 0)
41 return -EINVAL; 38 return -EINVAL;
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 72ace9515a07..32a1918e1b88 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -49,7 +49,9 @@ config X86
49 select HAVE_KERNEL_GZIP 49 select HAVE_KERNEL_GZIP
50 select HAVE_KERNEL_BZIP2 50 select HAVE_KERNEL_BZIP2
51 select HAVE_KERNEL_LZMA 51 select HAVE_KERNEL_LZMA
52 select HAVE_HW_BREAKPOINT
52 select HAVE_ARCH_KMEMCHECK 53 select HAVE_ARCH_KMEMCHECK
54 select HAVE_USER_RETURN_NOTIFIER
53 55
54config OUTPUT_FORMAT 56config OUTPUT_FORMAT
55 string 57 string
@@ -1330,7 +1332,9 @@ config MATH_EMULATION
1330 kernel, it won't hurt. 1332 kernel, it won't hurt.
1331 1333
1332config MTRR 1334config MTRR
1333 bool "MTRR (Memory Type Range Register) support" 1335 bool
1336 default y
1337 prompt "MTRR (Memory Type Range Register) support" if EMBEDDED
1334 ---help--- 1338 ---help---
1335 On Intel P6 family processors (Pentium Pro, Pentium II and later) 1339 On Intel P6 family processors (Pentium Pro, Pentium II and later)
1336 the Memory Type Range Registers (MTRRs) may be used to control 1340 the Memory Type Range Registers (MTRRs) may be used to control
@@ -1396,7 +1400,8 @@ config MTRR_SANITIZER_SPARE_REG_NR_DEFAULT
1396 1400
1397config X86_PAT 1401config X86_PAT
1398 bool 1402 bool
1399 prompt "x86 PAT support" 1403 default y
1404 prompt "x86 PAT support" if EMBEDDED
1400 depends on MTRR 1405 depends on MTRR
1401 ---help--- 1406 ---help---
1402 Use PAT attributes to setup page level cache control. 1407 Use PAT attributes to setup page level cache control.
@@ -1602,7 +1607,7 @@ config COMPAT_VDSO
1602 depends on X86_32 || IA32_EMULATION 1607 depends on X86_32 || IA32_EMULATION
1603 ---help--- 1608 ---help---
1604 Map the 32-bit VDSO to the predictable old-style address too. 1609 Map the 32-bit VDSO to the predictable old-style address too.
1605 ---help--- 1610
1606 Say N here if you are running a sufficiently recent glibc 1611 Say N here if you are running a sufficiently recent glibc
1607 version (2.3.3 or later), to remove the high-mapped 1612 version (2.3.3 or later), to remove the high-mapped
1608 VDSO mapping and to exclusively use the randomized VDSO. 1613 VDSO mapping and to exclusively use the randomized VDSO.
diff --git a/arch/x86/Kconfig.cpu b/arch/x86/Kconfig.cpu
index 2649840d888f..08e442bc3ab9 100644
--- a/arch/x86/Kconfig.cpu
+++ b/arch/x86/Kconfig.cpu
@@ -301,15 +301,11 @@ config X86_CPU
301 301
302# 302#
303# Define implied options from the CPU selection here 303# Define implied options from the CPU selection here
304config X86_L1_CACHE_BYTES 304config X86_INTERNODE_CACHE_SHIFT
305 int 305 int
306 default "128" if MPSC 306 default "12" if X86_VSMP
307 default "64" if GENERIC_CPU || MK8 || MCORE2 || MATOM || X86_32 307 default "7" if NUMA
308 308 default X86_L1_CACHE_SHIFT
309config X86_INTERNODE_CACHE_BYTES
310 int
311 default "4096" if X86_VSMP
312 default X86_L1_CACHE_BYTES if !X86_VSMP
313 309
314config X86_CMPXCHG 310config X86_CMPXCHG
315 def_bool X86_64 || (X86_32 && !M386) 311 def_bool X86_64 || (X86_32 && !M386)
@@ -317,9 +313,9 @@ config X86_CMPXCHG
317config X86_L1_CACHE_SHIFT 313config X86_L1_CACHE_SHIFT
318 int 314 int
319 default "7" if MPENTIUM4 || MPSC 315 default "7" if MPENTIUM4 || MPSC
316 default "6" if MK7 || MK8 || MPENTIUMM || MCORE2 || MATOM || MVIAC7 || X86_GENERIC || GENERIC_CPU
320 default "4" if X86_ELAN || M486 || M386 || MGEODEGX1 317 default "4" if X86_ELAN || M486 || M386 || MGEODEGX1
321 default "5" if MWINCHIP3D || MWINCHIPC6 || MCRUSOE || MEFFICEON || MCYRIXIII || MK6 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || M586 || MVIAC3_2 || MGEODE_LX 318 default "5" if MWINCHIP3D || MWINCHIPC6 || MCRUSOE || MEFFICEON || MCYRIXIII || MK6 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || M586 || MVIAC3_2 || MGEODE_LX
322 default "6" if MK7 || MK8 || MPENTIUMM || MCORE2 || MATOM || MVIAC7 || X86_GENERIC || GENERIC_CPU
323 319
324config X86_XADD 320config X86_XADD
325 def_bool y 321 def_bool y
@@ -406,7 +402,7 @@ config X86_CMPXCHG64
406# generates cmov. 402# generates cmov.
407config X86_CMOV 403config X86_CMOV
408 def_bool y 404 def_bool y
409 depends on (MK8 || MK7 || MCORE2 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MCRUSOE || MEFFICEON || X86_64 || MATOM) 405 depends on (MK8 || MK7 || MCORE2 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MCRUSOE || MEFFICEON || X86_64 || MATOM || MGEODE_LX)
410 406
411config X86_MINIMUM_CPU_FAMILY 407config X86_MINIMUM_CPU_FAMILY
412 int 408 int
diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug
index d105f29bb6bb..731318e5ac1d 100644
--- a/arch/x86/Kconfig.debug
+++ b/arch/x86/Kconfig.debug
@@ -186,6 +186,15 @@ config X86_DS_SELFTEST
186config HAVE_MMIOTRACE_SUPPORT 186config HAVE_MMIOTRACE_SUPPORT
187 def_bool y 187 def_bool y
188 188
189config X86_DECODER_SELFTEST
190 bool "x86 instruction decoder selftest"
191 depends on DEBUG_KERNEL
192 ---help---
193 Perform x86 instruction decoder selftests at build time.
194 This option is useful for checking the sanity of x86 instruction
195 decoder code.
196 If unsure, say "N".
197
189# 198#
190# IO delay types: 199# IO delay types:
191# 200#
@@ -287,4 +296,18 @@ config OPTIMIZE_INLINING
287 296
288 If unsure, say N. 297 If unsure, say N.
289 298
299config DEBUG_STRICT_USER_COPY_CHECKS
300 bool "Strict copy size checks"
301 depends on DEBUG_KERNEL && !TRACE_BRANCH_PROFILING
302 ---help---
303 Enabling this option turns a certain set of sanity checks for user
304 copy operations into compile time failures.
305
306 The copy_from_user() etc checks are there to help test if there
307 are sufficient security checks on the length argument of
308 the copy operation, by having gcc prove that the argument is
309 within bounds.
310
311 If unsure, or if you run an older (pre 4.4) gcc, say N.
312
290endmenu 313endmenu
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index d2d24c9ee64d..78b32be55e9e 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -155,6 +155,9 @@ all: bzImage
155KBUILD_IMAGE := $(boot)/bzImage 155KBUILD_IMAGE := $(boot)/bzImage
156 156
157bzImage: vmlinux 157bzImage: vmlinux
158ifeq ($(CONFIG_X86_DECODER_SELFTEST),y)
159 $(Q)$(MAKE) $(build)=arch/x86/tools posttest
160endif
158 $(Q)$(MAKE) $(build)=$(boot) $(KBUILD_IMAGE) 161 $(Q)$(MAKE) $(build)=$(boot) $(KBUILD_IMAGE)
159 $(Q)mkdir -p $(objtree)/arch/$(UTS_MACHINE)/boot 162 $(Q)mkdir -p $(objtree)/arch/$(UTS_MACHINE)/boot
160 $(Q)ln -fsn ../../x86/boot/bzImage $(objtree)/arch/$(UTS_MACHINE)/boot/$@ 163 $(Q)ln -fsn ../../x86/boot/bzImage $(objtree)/arch/$(UTS_MACHINE)/boot/$@
diff --git a/arch/x86/Makefile_32.cpu b/arch/x86/Makefile_32.cpu
index 30e9a264f69d..1255d953c65d 100644
--- a/arch/x86/Makefile_32.cpu
+++ b/arch/x86/Makefile_32.cpu
@@ -41,11 +41,18 @@ cflags-$(CONFIG_X86_ELAN) += -march=i486
41 41
42# Geode GX1 support 42# Geode GX1 support
43cflags-$(CONFIG_MGEODEGX1) += -march=pentium-mmx 43cflags-$(CONFIG_MGEODEGX1) += -march=pentium-mmx
44 44cflags-$(CONFIG_MGEODE_LX) += $(call cc-option,-march=geode,-march=pentium-mmx)
45# add at the end to overwrite eventual tuning options from earlier 45# add at the end to overwrite eventual tuning options from earlier
46# cpu entries 46# cpu entries
47cflags-$(CONFIG_X86_GENERIC) += $(call tune,generic,$(call tune,i686)) 47cflags-$(CONFIG_X86_GENERIC) += $(call tune,generic,$(call tune,i686))
48 48
49# Work around the pentium-mmx code generator madness of gcc4.4.x which
50# does stack alignment by generating horrible code _before_ the mcount
51# prologue (push %ebp, mov %esp, %ebp) which breaks the function graph
52# tracer assumptions. For i686, generic, core2 this is set by the
53# compiler anyway
54cflags-$(CONFIG_FUNCTION_GRAPH_TRACER) += $(call cc-option,-maccumulate-outgoing-args)
55
49# Bug fix for binutils: this option is required in order to keep 56# Bug fix for binutils: this option is required in order to keep
50# binutils from generating NOPL instructions against our will. 57# binutils from generating NOPL instructions against our will.
51ifneq ($(CONFIG_X86_P6_NOP),y) 58ifneq ($(CONFIG_X86_P6_NOP),y)
diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S
index 077e1b69198e..faff0dc9c06a 100644
--- a/arch/x86/boot/compressed/head_64.S
+++ b/arch/x86/boot/compressed/head_64.S
@@ -107,8 +107,7 @@ ENTRY(startup_32)
107 lgdt gdt(%ebp) 107 lgdt gdt(%ebp)
108 108
109 /* Enable PAE mode */ 109 /* Enable PAE mode */
110 xorl %eax, %eax 110 movl $(X86_CR4_PAE), %eax
111 orl $(X86_CR4_PAE), %eax
112 movl %eax, %cr4 111 movl %eax, %cr4
113 112
114 /* 113 /*
diff --git a/arch/x86/boot/compressed/vmlinux.lds.S b/arch/x86/boot/compressed/vmlinux.lds.S
index f4193bb48782..a6f1a59a5b0c 100644
--- a/arch/x86/boot/compressed/vmlinux.lds.S
+++ b/arch/x86/boot/compressed/vmlinux.lds.S
@@ -4,6 +4,7 @@ OUTPUT_FORMAT(CONFIG_OUTPUT_FORMAT, CONFIG_OUTPUT_FORMAT, CONFIG_OUTPUT_FORMAT)
4 4
5#undef i386 5#undef i386
6 6
7#include <asm/cache.h>
7#include <asm/page_types.h> 8#include <asm/page_types.h>
8 9
9#ifdef CONFIG_X86_64 10#ifdef CONFIG_X86_64
@@ -46,7 +47,7 @@ SECTIONS
46 *(.data.*) 47 *(.data.*)
47 _edata = . ; 48 _edata = . ;
48 } 49 }
49 . = ALIGN(CONFIG_X86_L1_CACHE_BYTES); 50 . = ALIGN(L1_CACHE_BYTES);
50 .bss : { 51 .bss : {
51 _bss = . ; 52 _bss = . ;
52 *(.bss) 53 *(.bss)
diff --git a/arch/x86/boot/video.c b/arch/x86/boot/video.c
index d42da3802499..f767164cd5df 100644
--- a/arch/x86/boot/video.c
+++ b/arch/x86/boot/video.c
@@ -27,6 +27,12 @@ static void store_cursor_position(void)
27 27
28 boot_params.screen_info.orig_x = oreg.dl; 28 boot_params.screen_info.orig_x = oreg.dl;
29 boot_params.screen_info.orig_y = oreg.dh; 29 boot_params.screen_info.orig_y = oreg.dh;
30
31 if (oreg.ch & 0x20)
32 boot_params.screen_info.flags |= VIDEO_FLAGS_NOCURSOR;
33
34 if ((oreg.ch & 0x1f) > (oreg.cl & 0x1f))
35 boot_params.screen_info.flags |= VIDEO_FLAGS_NOCURSOR;
30} 36}
31 37
32static void store_video_mode(void) 38static void store_video_mode(void)
diff --git a/arch/x86/crypto/Makefile b/arch/x86/crypto/Makefile
index cfb0010fa940..1a58ad89fdf7 100644
--- a/arch/x86/crypto/Makefile
+++ b/arch/x86/crypto/Makefile
@@ -12,6 +12,7 @@ obj-$(CONFIG_CRYPTO_AES_X86_64) += aes-x86_64.o
12obj-$(CONFIG_CRYPTO_TWOFISH_X86_64) += twofish-x86_64.o 12obj-$(CONFIG_CRYPTO_TWOFISH_X86_64) += twofish-x86_64.o
13obj-$(CONFIG_CRYPTO_SALSA20_X86_64) += salsa20-x86_64.o 13obj-$(CONFIG_CRYPTO_SALSA20_X86_64) += salsa20-x86_64.o
14obj-$(CONFIG_CRYPTO_AES_NI_INTEL) += aesni-intel.o 14obj-$(CONFIG_CRYPTO_AES_NI_INTEL) += aesni-intel.o
15obj-$(CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL) += ghash-clmulni-intel.o
15 16
16obj-$(CONFIG_CRYPTO_CRC32C_INTEL) += crc32c-intel.o 17obj-$(CONFIG_CRYPTO_CRC32C_INTEL) += crc32c-intel.o
17 18
@@ -24,3 +25,5 @@ twofish-x86_64-y := twofish-x86_64-asm_64.o twofish_glue.o
24salsa20-x86_64-y := salsa20-x86_64-asm_64.o salsa20_glue.o 25salsa20-x86_64-y := salsa20-x86_64-asm_64.o salsa20_glue.o
25 26
26aesni-intel-y := aesni-intel_asm.o aesni-intel_glue.o 27aesni-intel-y := aesni-intel_asm.o aesni-intel_glue.o
28
29ghash-clmulni-intel-y := ghash-clmulni-intel_asm.o ghash-clmulni-intel_glue.o
diff --git a/arch/x86/crypto/aesni-intel_asm.S b/arch/x86/crypto/aesni-intel_asm.S
index eb0566e83319..20bb0e1ac681 100644
--- a/arch/x86/crypto/aesni-intel_asm.S
+++ b/arch/x86/crypto/aesni-intel_asm.S
@@ -16,6 +16,7 @@
16 */ 16 */
17 17
18#include <linux/linkage.h> 18#include <linux/linkage.h>
19#include <asm/inst.h>
19 20
20.text 21.text
21 22
@@ -122,103 +123,72 @@ ENTRY(aesni_set_key)
122 movups 0x10(%rsi), %xmm2 # other user key 123 movups 0x10(%rsi), %xmm2 # other user key
123 movaps %xmm2, (%rcx) 124 movaps %xmm2, (%rcx)
124 add $0x10, %rcx 125 add $0x10, %rcx
125 # aeskeygenassist $0x1, %xmm2, %xmm1 # round 1 126 AESKEYGENASSIST 0x1 %xmm2 %xmm1 # round 1
126 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xca, 0x01
127 call _key_expansion_256a 127 call _key_expansion_256a
128 # aeskeygenassist $0x1, %xmm0, %xmm1 128 AESKEYGENASSIST 0x1 %xmm0 %xmm1
129 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xc8, 0x01
130 call _key_expansion_256b 129 call _key_expansion_256b
131 # aeskeygenassist $0x2, %xmm2, %xmm1 # round 2 130 AESKEYGENASSIST 0x2 %xmm2 %xmm1 # round 2
132 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xca, 0x02
133 call _key_expansion_256a 131 call _key_expansion_256a
134 # aeskeygenassist $0x2, %xmm0, %xmm1 132 AESKEYGENASSIST 0x2 %xmm0 %xmm1
135 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xc8, 0x02
136 call _key_expansion_256b 133 call _key_expansion_256b
137 # aeskeygenassist $0x4, %xmm2, %xmm1 # round 3 134 AESKEYGENASSIST 0x4 %xmm2 %xmm1 # round 3
138 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xca, 0x04
139 call _key_expansion_256a 135 call _key_expansion_256a
140 # aeskeygenassist $0x4, %xmm0, %xmm1 136 AESKEYGENASSIST 0x4 %xmm0 %xmm1
141 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xc8, 0x04
142 call _key_expansion_256b 137 call _key_expansion_256b
143 # aeskeygenassist $0x8, %xmm2, %xmm1 # round 4 138 AESKEYGENASSIST 0x8 %xmm2 %xmm1 # round 4
144 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xca, 0x08
145 call _key_expansion_256a 139 call _key_expansion_256a
146 # aeskeygenassist $0x8, %xmm0, %xmm1 140 AESKEYGENASSIST 0x8 %xmm0 %xmm1
147 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xc8, 0x08
148 call _key_expansion_256b 141 call _key_expansion_256b
149 # aeskeygenassist $0x10, %xmm2, %xmm1 # round 5 142 AESKEYGENASSIST 0x10 %xmm2 %xmm1 # round 5
150 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xca, 0x10
151 call _key_expansion_256a 143 call _key_expansion_256a
152 # aeskeygenassist $0x10, %xmm0, %xmm1 144 AESKEYGENASSIST 0x10 %xmm0 %xmm1
153 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xc8, 0x10
154 call _key_expansion_256b 145 call _key_expansion_256b
155 # aeskeygenassist $0x20, %xmm2, %xmm1 # round 6 146 AESKEYGENASSIST 0x20 %xmm2 %xmm1 # round 6
156 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xca, 0x20
157 call _key_expansion_256a 147 call _key_expansion_256a
158 # aeskeygenassist $0x20, %xmm0, %xmm1 148 AESKEYGENASSIST 0x20 %xmm0 %xmm1
159 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xc8, 0x20
160 call _key_expansion_256b 149 call _key_expansion_256b
161 # aeskeygenassist $0x40, %xmm2, %xmm1 # round 7 150 AESKEYGENASSIST 0x40 %xmm2 %xmm1 # round 7
162 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xca, 0x40
163 call _key_expansion_256a 151 call _key_expansion_256a
164 jmp .Ldec_key 152 jmp .Ldec_key
165.Lenc_key192: 153.Lenc_key192:
166 movq 0x10(%rsi), %xmm2 # other user key 154 movq 0x10(%rsi), %xmm2 # other user key
167 # aeskeygenassist $0x1, %xmm2, %xmm1 # round 1 155 AESKEYGENASSIST 0x1 %xmm2 %xmm1 # round 1
168 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xca, 0x01
169 call _key_expansion_192a 156 call _key_expansion_192a
170 # aeskeygenassist $0x2, %xmm2, %xmm1 # round 2 157 AESKEYGENASSIST 0x2 %xmm2 %xmm1 # round 2
171 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xca, 0x02
172 call _key_expansion_192b 158 call _key_expansion_192b
173 # aeskeygenassist $0x4, %xmm2, %xmm1 # round 3 159 AESKEYGENASSIST 0x4 %xmm2 %xmm1 # round 3
174 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xca, 0x04
175 call _key_expansion_192a 160 call _key_expansion_192a
176 # aeskeygenassist $0x8, %xmm2, %xmm1 # round 4 161 AESKEYGENASSIST 0x8 %xmm2 %xmm1 # round 4
177 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xca, 0x08
178 call _key_expansion_192b 162 call _key_expansion_192b
179 # aeskeygenassist $0x10, %xmm2, %xmm1 # round 5 163 AESKEYGENASSIST 0x10 %xmm2 %xmm1 # round 5
180 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xca, 0x10
181 call _key_expansion_192a 164 call _key_expansion_192a
182 # aeskeygenassist $0x20, %xmm2, %xmm1 # round 6 165 AESKEYGENASSIST 0x20 %xmm2 %xmm1 # round 6
183 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xca, 0x20
184 call _key_expansion_192b 166 call _key_expansion_192b
185 # aeskeygenassist $0x40, %xmm2, %xmm1 # round 7 167 AESKEYGENASSIST 0x40 %xmm2 %xmm1 # round 7
186 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xca, 0x40
187 call _key_expansion_192a 168 call _key_expansion_192a
188 # aeskeygenassist $0x80, %xmm2, %xmm1 # round 8 169 AESKEYGENASSIST 0x80 %xmm2 %xmm1 # round 8
189 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xca, 0x80
190 call _key_expansion_192b 170 call _key_expansion_192b
191 jmp .Ldec_key 171 jmp .Ldec_key
192.Lenc_key128: 172.Lenc_key128:
193 # aeskeygenassist $0x1, %xmm0, %xmm1 # round 1 173 AESKEYGENASSIST 0x1 %xmm0 %xmm1 # round 1
194 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xc8, 0x01
195 call _key_expansion_128 174 call _key_expansion_128
196 # aeskeygenassist $0x2, %xmm0, %xmm1 # round 2 175 AESKEYGENASSIST 0x2 %xmm0 %xmm1 # round 2
197 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xc8, 0x02
198 call _key_expansion_128 176 call _key_expansion_128
199 # aeskeygenassist $0x4, %xmm0, %xmm1 # round 3 177 AESKEYGENASSIST 0x4 %xmm0 %xmm1 # round 3
200 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xc8, 0x04
201 call _key_expansion_128 178 call _key_expansion_128
202 # aeskeygenassist $0x8, %xmm0, %xmm1 # round 4 179 AESKEYGENASSIST 0x8 %xmm0 %xmm1 # round 4
203 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xc8, 0x08
204 call _key_expansion_128 180 call _key_expansion_128
205 # aeskeygenassist $0x10, %xmm0, %xmm1 # round 5 181 AESKEYGENASSIST 0x10 %xmm0 %xmm1 # round 5
206 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xc8, 0x10
207 call _key_expansion_128 182 call _key_expansion_128
208 # aeskeygenassist $0x20, %xmm0, %xmm1 # round 6 183 AESKEYGENASSIST 0x20 %xmm0 %xmm1 # round 6
209 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xc8, 0x20
210 call _key_expansion_128 184 call _key_expansion_128
211 # aeskeygenassist $0x40, %xmm0, %xmm1 # round 7 185 AESKEYGENASSIST 0x40 %xmm0 %xmm1 # round 7
212 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xc8, 0x40
213 call _key_expansion_128 186 call _key_expansion_128
214 # aeskeygenassist $0x80, %xmm0, %xmm1 # round 8 187 AESKEYGENASSIST 0x80 %xmm0 %xmm1 # round 8
215 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xc8, 0x80
216 call _key_expansion_128 188 call _key_expansion_128
217 # aeskeygenassist $0x1b, %xmm0, %xmm1 # round 9 189 AESKEYGENASSIST 0x1b %xmm0 %xmm1 # round 9
218 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xc8, 0x1b
219 call _key_expansion_128 190 call _key_expansion_128
220 # aeskeygenassist $0x36, %xmm0, %xmm1 # round 10 191 AESKEYGENASSIST 0x36 %xmm0 %xmm1 # round 10
221 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xc8, 0x36
222 call _key_expansion_128 192 call _key_expansion_128
223.Ldec_key: 193.Ldec_key:
224 sub $0x10, %rcx 194 sub $0x10, %rcx
@@ -231,8 +201,7 @@ ENTRY(aesni_set_key)
231.align 4 201.align 4
232.Ldec_key_loop: 202.Ldec_key_loop:
233 movaps (%rdi), %xmm0 203 movaps (%rdi), %xmm0
234 # aesimc %xmm0, %xmm1 204 AESIMC %xmm0 %xmm1
235 .byte 0x66, 0x0f, 0x38, 0xdb, 0xc8
236 movaps %xmm1, (%rsi) 205 movaps %xmm1, (%rsi)
237 add $0x10, %rdi 206 add $0x10, %rdi
238 sub $0x10, %rsi 207 sub $0x10, %rsi
@@ -274,51 +243,37 @@ _aesni_enc1:
274 je .Lenc192 243 je .Lenc192
275 add $0x20, TKEYP 244 add $0x20, TKEYP
276 movaps -0x60(TKEYP), KEY 245 movaps -0x60(TKEYP), KEY
277 # aesenc KEY, STATE 246 AESENC KEY STATE
278 .byte 0x66, 0x0f, 0x38, 0xdc, 0xc2
279 movaps -0x50(TKEYP), KEY 247 movaps -0x50(TKEYP), KEY
280 # aesenc KEY, STATE 248 AESENC KEY STATE
281 .byte 0x66, 0x0f, 0x38, 0xdc, 0xc2
282.align 4 249.align 4
283.Lenc192: 250.Lenc192:
284 movaps -0x40(TKEYP), KEY 251 movaps -0x40(TKEYP), KEY
285 # aesenc KEY, STATE 252 AESENC KEY STATE
286 .byte 0x66, 0x0f, 0x38, 0xdc, 0xc2
287 movaps -0x30(TKEYP), KEY 253 movaps -0x30(TKEYP), KEY
288 # aesenc KEY, STATE 254 AESENC KEY STATE
289 .byte 0x66, 0x0f, 0x38, 0xdc, 0xc2
290.align 4 255.align 4
291.Lenc128: 256.Lenc128:
292 movaps -0x20(TKEYP), KEY 257 movaps -0x20(TKEYP), KEY
293 # aesenc KEY, STATE 258 AESENC KEY STATE
294 .byte 0x66, 0x0f, 0x38, 0xdc, 0xc2
295 movaps -0x10(TKEYP), KEY 259 movaps -0x10(TKEYP), KEY
296 # aesenc KEY, STATE 260 AESENC KEY STATE
297 .byte 0x66, 0x0f, 0x38, 0xdc, 0xc2
298 movaps (TKEYP), KEY 261 movaps (TKEYP), KEY
299 # aesenc KEY, STATE 262 AESENC KEY STATE
300 .byte 0x66, 0x0f, 0x38, 0xdc, 0xc2
301 movaps 0x10(TKEYP), KEY 263 movaps 0x10(TKEYP), KEY
302 # aesenc KEY, STATE 264 AESENC KEY STATE
303 .byte 0x66, 0x0f, 0x38, 0xdc, 0xc2
304 movaps 0x20(TKEYP), KEY 265 movaps 0x20(TKEYP), KEY
305 # aesenc KEY, STATE 266 AESENC KEY STATE
306 .byte 0x66, 0x0f, 0x38, 0xdc, 0xc2
307 movaps 0x30(TKEYP), KEY 267 movaps 0x30(TKEYP), KEY
308 # aesenc KEY, STATE 268 AESENC KEY STATE
309 .byte 0x66, 0x0f, 0x38, 0xdc, 0xc2
310 movaps 0x40(TKEYP), KEY 269 movaps 0x40(TKEYP), KEY
311 # aesenc KEY, STATE 270 AESENC KEY STATE
312 .byte 0x66, 0x0f, 0x38, 0xdc, 0xc2
313 movaps 0x50(TKEYP), KEY 271 movaps 0x50(TKEYP), KEY
314 # aesenc KEY, STATE 272 AESENC KEY STATE
315 .byte 0x66, 0x0f, 0x38, 0xdc, 0xc2
316 movaps 0x60(TKEYP), KEY 273 movaps 0x60(TKEYP), KEY
317 # aesenc KEY, STATE 274 AESENC KEY STATE
318 .byte 0x66, 0x0f, 0x38, 0xdc, 0xc2
319 movaps 0x70(TKEYP), KEY 275 movaps 0x70(TKEYP), KEY
320 # aesenclast KEY, STATE # last round 276 AESENCLAST KEY STATE
321 .byte 0x66, 0x0f, 0x38, 0xdd, 0xc2
322 ret 277 ret
323 278
324/* 279/*
@@ -353,135 +308,79 @@ _aesni_enc4:
353 je .L4enc192 308 je .L4enc192
354 add $0x20, TKEYP 309 add $0x20, TKEYP
355 movaps -0x60(TKEYP), KEY 310 movaps -0x60(TKEYP), KEY
356 # aesenc KEY, STATE1 311 AESENC KEY STATE1
357 .byte 0x66, 0x0f, 0x38, 0xdc, 0xc2 312 AESENC KEY STATE2
358 # aesenc KEY, STATE2 313 AESENC KEY STATE3
359 .byte 0x66, 0x0f, 0x38, 0xdc, 0xe2 314 AESENC KEY STATE4
360 # aesenc KEY, STATE3
361 .byte 0x66, 0x0f, 0x38, 0xdc, 0xea
362 # aesenc KEY, STATE4
363 .byte 0x66, 0x0f, 0x38, 0xdc, 0xf2
364 movaps -0x50(TKEYP), KEY 315 movaps -0x50(TKEYP), KEY
365 # aesenc KEY, STATE1 316 AESENC KEY STATE1
366 .byte 0x66, 0x0f, 0x38, 0xdc, 0xc2 317 AESENC KEY STATE2
367 # aesenc KEY, STATE2 318 AESENC KEY STATE3
368 .byte 0x66, 0x0f, 0x38, 0xdc, 0xe2 319 AESENC KEY STATE4
369 # aesenc KEY, STATE3
370 .byte 0x66, 0x0f, 0x38, 0xdc, 0xea
371 # aesenc KEY, STATE4
372 .byte 0x66, 0x0f, 0x38, 0xdc, 0xf2
373#.align 4 320#.align 4
374.L4enc192: 321.L4enc192:
375 movaps -0x40(TKEYP), KEY 322 movaps -0x40(TKEYP), KEY
376 # aesenc KEY, STATE1 323 AESENC KEY STATE1
377 .byte 0x66, 0x0f, 0x38, 0xdc, 0xc2 324 AESENC KEY STATE2
378 # aesenc KEY, STATE2 325 AESENC KEY STATE3
379 .byte 0x66, 0x0f, 0x38, 0xdc, 0xe2 326 AESENC KEY STATE4
380 # aesenc KEY, STATE3
381 .byte 0x66, 0x0f, 0x38, 0xdc, 0xea
382 # aesenc KEY, STATE4
383 .byte 0x66, 0x0f, 0x38, 0xdc, 0xf2
384 movaps -0x30(TKEYP), KEY 327 movaps -0x30(TKEYP), KEY
385 # aesenc KEY, STATE1 328 AESENC KEY STATE1
386 .byte 0x66, 0x0f, 0x38, 0xdc, 0xc2 329 AESENC KEY STATE2
387 # aesenc KEY, STATE2 330 AESENC KEY STATE3
388 .byte 0x66, 0x0f, 0x38, 0xdc, 0xe2 331 AESENC KEY STATE4
389 # aesenc KEY, STATE3
390 .byte 0x66, 0x0f, 0x38, 0xdc, 0xea
391 # aesenc KEY, STATE4
392 .byte 0x66, 0x0f, 0x38, 0xdc, 0xf2
393#.align 4 332#.align 4
394.L4enc128: 333.L4enc128:
395 movaps -0x20(TKEYP), KEY 334 movaps -0x20(TKEYP), KEY
396 # aesenc KEY, STATE1 335 AESENC KEY STATE1
397 .byte 0x66, 0x0f, 0x38, 0xdc, 0xc2 336 AESENC KEY STATE2
398 # aesenc KEY, STATE2 337 AESENC KEY STATE3
399 .byte 0x66, 0x0f, 0x38, 0xdc, 0xe2 338 AESENC KEY STATE4
400 # aesenc KEY, STATE3
401 .byte 0x66, 0x0f, 0x38, 0xdc, 0xea
402 # aesenc KEY, STATE4
403 .byte 0x66, 0x0f, 0x38, 0xdc, 0xf2
404 movaps -0x10(TKEYP), KEY 339 movaps -0x10(TKEYP), KEY
405 # aesenc KEY, STATE1 340 AESENC KEY STATE1
406 .byte 0x66, 0x0f, 0x38, 0xdc, 0xc2 341 AESENC KEY STATE2
407 # aesenc KEY, STATE2 342 AESENC KEY STATE3
408 .byte 0x66, 0x0f, 0x38, 0xdc, 0xe2 343 AESENC KEY STATE4
409 # aesenc KEY, STATE3
410 .byte 0x66, 0x0f, 0x38, 0xdc, 0xea
411 # aesenc KEY, STATE4
412 .byte 0x66, 0x0f, 0x38, 0xdc, 0xf2
413 movaps (TKEYP), KEY 344 movaps (TKEYP), KEY
414 # aesenc KEY, STATE1 345 AESENC KEY STATE1
415 .byte 0x66, 0x0f, 0x38, 0xdc, 0xc2 346 AESENC KEY STATE2
416 # aesenc KEY, STATE2 347 AESENC KEY STATE3
417 .byte 0x66, 0x0f, 0x38, 0xdc, 0xe2 348 AESENC KEY STATE4
418 # aesenc KEY, STATE3
419 .byte 0x66, 0x0f, 0x38, 0xdc, 0xea
420 # aesenc KEY, STATE4
421 .byte 0x66, 0x0f, 0x38, 0xdc, 0xf2
422 movaps 0x10(TKEYP), KEY 349 movaps 0x10(TKEYP), KEY
423 # aesenc KEY, STATE1 350 AESENC KEY STATE1
424 .byte 0x66, 0x0f, 0x38, 0xdc, 0xc2 351 AESENC KEY STATE2
425 # aesenc KEY, STATE2 352 AESENC KEY STATE3
426 .byte 0x66, 0x0f, 0x38, 0xdc, 0xe2 353 AESENC KEY STATE4
427 # aesenc KEY, STATE3
428 .byte 0x66, 0x0f, 0x38, 0xdc, 0xea
429 # aesenc KEY, STATE4
430 .byte 0x66, 0x0f, 0x38, 0xdc, 0xf2
431 movaps 0x20(TKEYP), KEY 354 movaps 0x20(TKEYP), KEY
432 # aesenc KEY, STATE1 355 AESENC KEY STATE1
433 .byte 0x66, 0x0f, 0x38, 0xdc, 0xc2 356 AESENC KEY STATE2
434 # aesenc KEY, STATE2 357 AESENC KEY STATE3
435 .byte 0x66, 0x0f, 0x38, 0xdc, 0xe2 358 AESENC KEY STATE4
436 # aesenc KEY, STATE3
437 .byte 0x66, 0x0f, 0x38, 0xdc, 0xea
438 # aesenc KEY, STATE4
439 .byte 0x66, 0x0f, 0x38, 0xdc, 0xf2
440 movaps 0x30(TKEYP), KEY 359 movaps 0x30(TKEYP), KEY
441 # aesenc KEY, STATE1 360 AESENC KEY STATE1
442 .byte 0x66, 0x0f, 0x38, 0xdc, 0xc2 361 AESENC KEY STATE2
443 # aesenc KEY, STATE2 362 AESENC KEY STATE3
444 .byte 0x66, 0x0f, 0x38, 0xdc, 0xe2 363 AESENC KEY STATE4
445 # aesenc KEY, STATE3
446 .byte 0x66, 0x0f, 0x38, 0xdc, 0xea
447 # aesenc KEY, STATE4
448 .byte 0x66, 0x0f, 0x38, 0xdc, 0xf2
449 movaps 0x40(TKEYP), KEY 364 movaps 0x40(TKEYP), KEY
450 # aesenc KEY, STATE1 365 AESENC KEY STATE1
451 .byte 0x66, 0x0f, 0x38, 0xdc, 0xc2 366 AESENC KEY STATE2
452 # aesenc KEY, STATE2 367 AESENC KEY STATE3
453 .byte 0x66, 0x0f, 0x38, 0xdc, 0xe2 368 AESENC KEY STATE4
454 # aesenc KEY, STATE3
455 .byte 0x66, 0x0f, 0x38, 0xdc, 0xea
456 # aesenc KEY, STATE4
457 .byte 0x66, 0x0f, 0x38, 0xdc, 0xf2
458 movaps 0x50(TKEYP), KEY 369 movaps 0x50(TKEYP), KEY
459 # aesenc KEY, STATE1 370 AESENC KEY STATE1
460 .byte 0x66, 0x0f, 0x38, 0xdc, 0xc2 371 AESENC KEY STATE2
461 # aesenc KEY, STATE2 372 AESENC KEY STATE3
462 .byte 0x66, 0x0f, 0x38, 0xdc, 0xe2 373 AESENC KEY STATE4
463 # aesenc KEY, STATE3
464 .byte 0x66, 0x0f, 0x38, 0xdc, 0xea
465 # aesenc KEY, STATE4
466 .byte 0x66, 0x0f, 0x38, 0xdc, 0xf2
467 movaps 0x60(TKEYP), KEY 374 movaps 0x60(TKEYP), KEY
468 # aesenc KEY, STATE1 375 AESENC KEY STATE1
469 .byte 0x66, 0x0f, 0x38, 0xdc, 0xc2 376 AESENC KEY STATE2
470 # aesenc KEY, STATE2 377 AESENC KEY STATE3
471 .byte 0x66, 0x0f, 0x38, 0xdc, 0xe2 378 AESENC KEY STATE4
472 # aesenc KEY, STATE3
473 .byte 0x66, 0x0f, 0x38, 0xdc, 0xea
474 # aesenc KEY, STATE4
475 .byte 0x66, 0x0f, 0x38, 0xdc, 0xf2
476 movaps 0x70(TKEYP), KEY 379 movaps 0x70(TKEYP), KEY
477 # aesenclast KEY, STATE1 # last round 380 AESENCLAST KEY STATE1 # last round
478 .byte 0x66, 0x0f, 0x38, 0xdd, 0xc2 381 AESENCLAST KEY STATE2
479 # aesenclast KEY, STATE2 382 AESENCLAST KEY STATE3
480 .byte 0x66, 0x0f, 0x38, 0xdd, 0xe2 383 AESENCLAST KEY STATE4
481 # aesenclast KEY, STATE3
482 .byte 0x66, 0x0f, 0x38, 0xdd, 0xea
483 # aesenclast KEY, STATE4
484 .byte 0x66, 0x0f, 0x38, 0xdd, 0xf2
485 ret 384 ret
486 385
487/* 386/*
@@ -518,51 +417,37 @@ _aesni_dec1:
518 je .Ldec192 417 je .Ldec192
519 add $0x20, TKEYP 418 add $0x20, TKEYP
520 movaps -0x60(TKEYP), KEY 419 movaps -0x60(TKEYP), KEY
521 # aesdec KEY, STATE 420 AESDEC KEY STATE
522 .byte 0x66, 0x0f, 0x38, 0xde, 0xc2
523 movaps -0x50(TKEYP), KEY 421 movaps -0x50(TKEYP), KEY
524 # aesdec KEY, STATE 422 AESDEC KEY STATE
525 .byte 0x66, 0x0f, 0x38, 0xde, 0xc2
526.align 4 423.align 4
527.Ldec192: 424.Ldec192:
528 movaps -0x40(TKEYP), KEY 425 movaps -0x40(TKEYP), KEY
529 # aesdec KEY, STATE 426 AESDEC KEY STATE
530 .byte 0x66, 0x0f, 0x38, 0xde, 0xc2
531 movaps -0x30(TKEYP), KEY 427 movaps -0x30(TKEYP), KEY
532 # aesdec KEY, STATE 428 AESDEC KEY STATE
533 .byte 0x66, 0x0f, 0x38, 0xde, 0xc2
534.align 4 429.align 4
535.Ldec128: 430.Ldec128:
536 movaps -0x20(TKEYP), KEY 431 movaps -0x20(TKEYP), KEY
537 # aesdec KEY, STATE 432 AESDEC KEY STATE
538 .byte 0x66, 0x0f, 0x38, 0xde, 0xc2
539 movaps -0x10(TKEYP), KEY 433 movaps -0x10(TKEYP), KEY
540 # aesdec KEY, STATE 434 AESDEC KEY STATE
541 .byte 0x66, 0x0f, 0x38, 0xde, 0xc2
542 movaps (TKEYP), KEY 435 movaps (TKEYP), KEY
543 # aesdec KEY, STATE 436 AESDEC KEY STATE
544 .byte 0x66, 0x0f, 0x38, 0xde, 0xc2
545 movaps 0x10(TKEYP), KEY 437 movaps 0x10(TKEYP), KEY
546 # aesdec KEY, STATE 438 AESDEC KEY STATE
547 .byte 0x66, 0x0f, 0x38, 0xde, 0xc2
548 movaps 0x20(TKEYP), KEY 439 movaps 0x20(TKEYP), KEY
549 # aesdec KEY, STATE 440 AESDEC KEY STATE
550 .byte 0x66, 0x0f, 0x38, 0xde, 0xc2
551 movaps 0x30(TKEYP), KEY 441 movaps 0x30(TKEYP), KEY
552 # aesdec KEY, STATE 442 AESDEC KEY STATE
553 .byte 0x66, 0x0f, 0x38, 0xde, 0xc2
554 movaps 0x40(TKEYP), KEY 443 movaps 0x40(TKEYP), KEY
555 # aesdec KEY, STATE 444 AESDEC KEY STATE
556 .byte 0x66, 0x0f, 0x38, 0xde, 0xc2
557 movaps 0x50(TKEYP), KEY 445 movaps 0x50(TKEYP), KEY
558 # aesdec KEY, STATE 446 AESDEC KEY STATE
559 .byte 0x66, 0x0f, 0x38, 0xde, 0xc2
560 movaps 0x60(TKEYP), KEY 447 movaps 0x60(TKEYP), KEY
561 # aesdec KEY, STATE 448 AESDEC KEY STATE
562 .byte 0x66, 0x0f, 0x38, 0xde, 0xc2
563 movaps 0x70(TKEYP), KEY 449 movaps 0x70(TKEYP), KEY
564 # aesdeclast KEY, STATE # last round 450 AESDECLAST KEY STATE
565 .byte 0x66, 0x0f, 0x38, 0xdf, 0xc2
566 ret 451 ret
567 452
568/* 453/*
@@ -597,135 +482,79 @@ _aesni_dec4:
597 je .L4dec192 482 je .L4dec192
598 add $0x20, TKEYP 483 add $0x20, TKEYP
599 movaps -0x60(TKEYP), KEY 484 movaps -0x60(TKEYP), KEY
600 # aesdec KEY, STATE1 485 AESDEC KEY STATE1
601 .byte 0x66, 0x0f, 0x38, 0xde, 0xc2 486 AESDEC KEY STATE2
602 # aesdec KEY, STATE2 487 AESDEC KEY STATE3
603 .byte 0x66, 0x0f, 0x38, 0xde, 0xe2 488 AESDEC KEY STATE4
604 # aesdec KEY, STATE3
605 .byte 0x66, 0x0f, 0x38, 0xde, 0xea
606 # aesdec KEY, STATE4
607 .byte 0x66, 0x0f, 0x38, 0xde, 0xf2
608 movaps -0x50(TKEYP), KEY 489 movaps -0x50(TKEYP), KEY
609 # aesdec KEY, STATE1 490 AESDEC KEY STATE1
610 .byte 0x66, 0x0f, 0x38, 0xde, 0xc2 491 AESDEC KEY STATE2
611 # aesdec KEY, STATE2 492 AESDEC KEY STATE3
612 .byte 0x66, 0x0f, 0x38, 0xde, 0xe2 493 AESDEC KEY STATE4
613 # aesdec KEY, STATE3
614 .byte 0x66, 0x0f, 0x38, 0xde, 0xea
615 # aesdec KEY, STATE4
616 .byte 0x66, 0x0f, 0x38, 0xde, 0xf2
617.align 4 494.align 4
618.L4dec192: 495.L4dec192:
619 movaps -0x40(TKEYP), KEY 496 movaps -0x40(TKEYP), KEY
620 # aesdec KEY, STATE1 497 AESDEC KEY STATE1
621 .byte 0x66, 0x0f, 0x38, 0xde, 0xc2 498 AESDEC KEY STATE2
622 # aesdec KEY, STATE2 499 AESDEC KEY STATE3
623 .byte 0x66, 0x0f, 0x38, 0xde, 0xe2 500 AESDEC KEY STATE4
624 # aesdec KEY, STATE3
625 .byte 0x66, 0x0f, 0x38, 0xde, 0xea
626 # aesdec KEY, STATE4
627 .byte 0x66, 0x0f, 0x38, 0xde, 0xf2
628 movaps -0x30(TKEYP), KEY 501 movaps -0x30(TKEYP), KEY
629 # aesdec KEY, STATE1 502 AESDEC KEY STATE1
630 .byte 0x66, 0x0f, 0x38, 0xde, 0xc2 503 AESDEC KEY STATE2
631 # aesdec KEY, STATE2 504 AESDEC KEY STATE3
632 .byte 0x66, 0x0f, 0x38, 0xde, 0xe2 505 AESDEC KEY STATE4
633 # aesdec KEY, STATE3
634 .byte 0x66, 0x0f, 0x38, 0xde, 0xea
635 # aesdec KEY, STATE4
636 .byte 0x66, 0x0f, 0x38, 0xde, 0xf2
637.align 4 506.align 4
638.L4dec128: 507.L4dec128:
639 movaps -0x20(TKEYP), KEY 508 movaps -0x20(TKEYP), KEY
640 # aesdec KEY, STATE1 509 AESDEC KEY STATE1
641 .byte 0x66, 0x0f, 0x38, 0xde, 0xc2 510 AESDEC KEY STATE2
642 # aesdec KEY, STATE2 511 AESDEC KEY STATE3
643 .byte 0x66, 0x0f, 0x38, 0xde, 0xe2 512 AESDEC KEY STATE4
644 # aesdec KEY, STATE3
645 .byte 0x66, 0x0f, 0x38, 0xde, 0xea
646 # aesdec KEY, STATE4
647 .byte 0x66, 0x0f, 0x38, 0xde, 0xf2
648 movaps -0x10(TKEYP), KEY 513 movaps -0x10(TKEYP), KEY
649 # aesdec KEY, STATE1 514 AESDEC KEY STATE1
650 .byte 0x66, 0x0f, 0x38, 0xde, 0xc2 515 AESDEC KEY STATE2
651 # aesdec KEY, STATE2 516 AESDEC KEY STATE3
652 .byte 0x66, 0x0f, 0x38, 0xde, 0xe2 517 AESDEC KEY STATE4
653 # aesdec KEY, STATE3
654 .byte 0x66, 0x0f, 0x38, 0xde, 0xea
655 # aesdec KEY, STATE4
656 .byte 0x66, 0x0f, 0x38, 0xde, 0xf2
657 movaps (TKEYP), KEY 518 movaps (TKEYP), KEY
658 # aesdec KEY, STATE1 519 AESDEC KEY STATE1
659 .byte 0x66, 0x0f, 0x38, 0xde, 0xc2 520 AESDEC KEY STATE2
660 # aesdec KEY, STATE2 521 AESDEC KEY STATE3
661 .byte 0x66, 0x0f, 0x38, 0xde, 0xe2 522 AESDEC KEY STATE4
662 # aesdec KEY, STATE3
663 .byte 0x66, 0x0f, 0x38, 0xde, 0xea
664 # aesdec KEY, STATE4
665 .byte 0x66, 0x0f, 0x38, 0xde, 0xf2
666 movaps 0x10(TKEYP), KEY 523 movaps 0x10(TKEYP), KEY
667 # aesdec KEY, STATE1 524 AESDEC KEY STATE1
668 .byte 0x66, 0x0f, 0x38, 0xde, 0xc2 525 AESDEC KEY STATE2
669 # aesdec KEY, STATE2 526 AESDEC KEY STATE3
670 .byte 0x66, 0x0f, 0x38, 0xde, 0xe2 527 AESDEC KEY STATE4
671 # aesdec KEY, STATE3
672 .byte 0x66, 0x0f, 0x38, 0xde, 0xea
673 # aesdec KEY, STATE4
674 .byte 0x66, 0x0f, 0x38, 0xde, 0xf2
675 movaps 0x20(TKEYP), KEY 528 movaps 0x20(TKEYP), KEY
676 # aesdec KEY, STATE1 529 AESDEC KEY STATE1
677 .byte 0x66, 0x0f, 0x38, 0xde, 0xc2 530 AESDEC KEY STATE2
678 # aesdec KEY, STATE2 531 AESDEC KEY STATE3
679 .byte 0x66, 0x0f, 0x38, 0xde, 0xe2 532 AESDEC KEY STATE4
680 # aesdec KEY, STATE3
681 .byte 0x66, 0x0f, 0x38, 0xde, 0xea
682 # aesdec KEY, STATE4
683 .byte 0x66, 0x0f, 0x38, 0xde, 0xf2
684 movaps 0x30(TKEYP), KEY 533 movaps 0x30(TKEYP), KEY
685 # aesdec KEY, STATE1 534 AESDEC KEY STATE1
686 .byte 0x66, 0x0f, 0x38, 0xde, 0xc2 535 AESDEC KEY STATE2
687 # aesdec KEY, STATE2 536 AESDEC KEY STATE3
688 .byte 0x66, 0x0f, 0x38, 0xde, 0xe2 537 AESDEC KEY STATE4
689 # aesdec KEY, STATE3
690 .byte 0x66, 0x0f, 0x38, 0xde, 0xea
691 # aesdec KEY, STATE4
692 .byte 0x66, 0x0f, 0x38, 0xde, 0xf2
693 movaps 0x40(TKEYP), KEY 538 movaps 0x40(TKEYP), KEY
694 # aesdec KEY, STATE1 539 AESDEC KEY STATE1
695 .byte 0x66, 0x0f, 0x38, 0xde, 0xc2 540 AESDEC KEY STATE2
696 # aesdec KEY, STATE2 541 AESDEC KEY STATE3
697 .byte 0x66, 0x0f, 0x38, 0xde, 0xe2 542 AESDEC KEY STATE4
698 # aesdec KEY, STATE3
699 .byte 0x66, 0x0f, 0x38, 0xde, 0xea
700 # aesdec KEY, STATE4
701 .byte 0x66, 0x0f, 0x38, 0xde, 0xf2
702 movaps 0x50(TKEYP), KEY 543 movaps 0x50(TKEYP), KEY
703 # aesdec KEY, STATE1 544 AESDEC KEY STATE1
704 .byte 0x66, 0x0f, 0x38, 0xde, 0xc2 545 AESDEC KEY STATE2
705 # aesdec KEY, STATE2 546 AESDEC KEY STATE3
706 .byte 0x66, 0x0f, 0x38, 0xde, 0xe2 547 AESDEC KEY STATE4
707 # aesdec KEY, STATE3
708 .byte 0x66, 0x0f, 0x38, 0xde, 0xea
709 # aesdec KEY, STATE4
710 .byte 0x66, 0x0f, 0x38, 0xde, 0xf2
711 movaps 0x60(TKEYP), KEY 548 movaps 0x60(TKEYP), KEY
712 # aesdec KEY, STATE1 549 AESDEC KEY STATE1
713 .byte 0x66, 0x0f, 0x38, 0xde, 0xc2 550 AESDEC KEY STATE2
714 # aesdec KEY, STATE2 551 AESDEC KEY STATE3
715 .byte 0x66, 0x0f, 0x38, 0xde, 0xe2 552 AESDEC KEY STATE4
716 # aesdec KEY, STATE3
717 .byte 0x66, 0x0f, 0x38, 0xde, 0xea
718 # aesdec KEY, STATE4
719 .byte 0x66, 0x0f, 0x38, 0xde, 0xf2
720 movaps 0x70(TKEYP), KEY 553 movaps 0x70(TKEYP), KEY
721 # aesdeclast KEY, STATE1 # last round 554 AESDECLAST KEY STATE1 # last round
722 .byte 0x66, 0x0f, 0x38, 0xdf, 0xc2 555 AESDECLAST KEY STATE2
723 # aesdeclast KEY, STATE2 556 AESDECLAST KEY STATE3
724 .byte 0x66, 0x0f, 0x38, 0xdf, 0xe2 557 AESDECLAST KEY STATE4
725 # aesdeclast KEY, STATE3
726 .byte 0x66, 0x0f, 0x38, 0xdf, 0xea
727 # aesdeclast KEY, STATE4
728 .byte 0x66, 0x0f, 0x38, 0xdf, 0xf2
729 ret 558 ret
730 559
731/* 560/*
diff --git a/arch/x86/crypto/ghash-clmulni-intel_asm.S b/arch/x86/crypto/ghash-clmulni-intel_asm.S
new file mode 100644
index 000000000000..1eb7f90cb7b9
--- /dev/null
+++ b/arch/x86/crypto/ghash-clmulni-intel_asm.S
@@ -0,0 +1,157 @@
1/*
2 * Accelerated GHASH implementation with Intel PCLMULQDQ-NI
3 * instructions. This file contains accelerated part of ghash
4 * implementation. More information about PCLMULQDQ can be found at:
5 *
6 * http://software.intel.com/en-us/articles/carry-less-multiplication-and-its-usage-for-computing-the-gcm-mode/
7 *
8 * Copyright (c) 2009 Intel Corp.
9 * Author: Huang Ying <ying.huang@intel.com>
10 * Vinodh Gopal
11 * Erdinc Ozturk
12 * Deniz Karakoyunlu
13 *
14 * This program is free software; you can redistribute it and/or modify it
15 * under the terms of the GNU General Public License version 2 as published
16 * by the Free Software Foundation.
17 */
18
19#include <linux/linkage.h>
20#include <asm/inst.h>
21
22.data
23
24.align 16
25.Lbswap_mask:
26 .octa 0x000102030405060708090a0b0c0d0e0f
27.Lpoly:
28 .octa 0xc2000000000000000000000000000001
29.Ltwo_one:
30 .octa 0x00000001000000000000000000000001
31
32#define DATA %xmm0
33#define SHASH %xmm1
34#define T1 %xmm2
35#define T2 %xmm3
36#define T3 %xmm4
37#define BSWAP %xmm5
38#define IN1 %xmm6
39
40.text
41
42/*
43 * __clmul_gf128mul_ble: internal ABI
44 * input:
45 * DATA: operand1
46 * SHASH: operand2, hash_key << 1 mod poly
47 * output:
48 * DATA: operand1 * operand2 mod poly
49 * changed:
50 * T1
51 * T2
52 * T3
53 */
54__clmul_gf128mul_ble:
55 movaps DATA, T1
56 pshufd $0b01001110, DATA, T2
57 pshufd $0b01001110, SHASH, T3
58 pxor DATA, T2
59 pxor SHASH, T3
60
61 PCLMULQDQ 0x00 SHASH DATA # DATA = a0 * b0
62 PCLMULQDQ 0x11 SHASH T1 # T1 = a1 * b1
63 PCLMULQDQ 0x00 T3 T2 # T2 = (a1 + a0) * (b1 + b0)
64 pxor DATA, T2
65 pxor T1, T2 # T2 = a0 * b1 + a1 * b0
66
67 movaps T2, T3
68 pslldq $8, T3
69 psrldq $8, T2
70 pxor T3, DATA
71 pxor T2, T1 # <T1:DATA> is result of
72 # carry-less multiplication
73
74 # first phase of the reduction
75 movaps DATA, T3
76 psllq $1, T3
77 pxor DATA, T3
78 psllq $5, T3
79 pxor DATA, T3
80 psllq $57, T3
81 movaps T3, T2
82 pslldq $8, T2
83 psrldq $8, T3
84 pxor T2, DATA
85 pxor T3, T1
86
87 # second phase of the reduction
88 movaps DATA, T2
89 psrlq $5, T2
90 pxor DATA, T2
91 psrlq $1, T2
92 pxor DATA, T2
93 psrlq $1, T2
94 pxor T2, T1
95 pxor T1, DATA
96 ret
97
98/* void clmul_ghash_mul(char *dst, const be128 *shash) */
99ENTRY(clmul_ghash_mul)
100 movups (%rdi), DATA
101 movups (%rsi), SHASH
102 movaps .Lbswap_mask, BSWAP
103 PSHUFB_XMM BSWAP DATA
104 call __clmul_gf128mul_ble
105 PSHUFB_XMM BSWAP DATA
106 movups DATA, (%rdi)
107 ret
108
109/*
110 * void clmul_ghash_update(char *dst, const char *src, unsigned int srclen,
111 * const be128 *shash);
112 */
113ENTRY(clmul_ghash_update)
114 cmp $16, %rdx
115 jb .Lupdate_just_ret # check length
116 movaps .Lbswap_mask, BSWAP
117 movups (%rdi), DATA
118 movups (%rcx), SHASH
119 PSHUFB_XMM BSWAP DATA
120.align 4
121.Lupdate_loop:
122 movups (%rsi), IN1
123 PSHUFB_XMM BSWAP IN1
124 pxor IN1, DATA
125 call __clmul_gf128mul_ble
126 sub $16, %rdx
127 add $16, %rsi
128 cmp $16, %rdx
129 jge .Lupdate_loop
130 PSHUFB_XMM BSWAP DATA
131 movups DATA, (%rdi)
132.Lupdate_just_ret:
133 ret
134
135/*
136 * void clmul_ghash_setkey(be128 *shash, const u8 *key);
137 *
138 * Calculate hash_key << 1 mod poly
139 */
140ENTRY(clmul_ghash_setkey)
141 movaps .Lbswap_mask, BSWAP
142 movups (%rsi), %xmm0
143 PSHUFB_XMM BSWAP %xmm0
144 movaps %xmm0, %xmm1
145 psllq $1, %xmm0
146 psrlq $63, %xmm1
147 movaps %xmm1, %xmm2
148 pslldq $8, %xmm1
149 psrldq $8, %xmm2
150 por %xmm1, %xmm0
151 # reduction
152 pshufd $0b00100100, %xmm2, %xmm1
153 pcmpeqd .Ltwo_one, %xmm1
154 pand .Lpoly, %xmm1
155 pxor %xmm1, %xmm0
156 movups %xmm0, (%rdi)
157 ret
diff --git a/arch/x86/crypto/ghash-clmulni-intel_glue.c b/arch/x86/crypto/ghash-clmulni-intel_glue.c
new file mode 100644
index 000000000000..cbcc8d8ea93a
--- /dev/null
+++ b/arch/x86/crypto/ghash-clmulni-intel_glue.c
@@ -0,0 +1,333 @@
1/*
2 * Accelerated GHASH implementation with Intel PCLMULQDQ-NI
3 * instructions. This file contains glue code.
4 *
5 * Copyright (c) 2009 Intel Corp.
6 * Author: Huang Ying <ying.huang@intel.com>
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License version 2 as published
10 * by the Free Software Foundation.
11 */
12
13#include <linux/module.h>
14#include <linux/init.h>
15#include <linux/kernel.h>
16#include <linux/crypto.h>
17#include <crypto/algapi.h>
18#include <crypto/cryptd.h>
19#include <crypto/gf128mul.h>
20#include <crypto/internal/hash.h>
21#include <asm/i387.h>
22
23#define GHASH_BLOCK_SIZE 16
24#define GHASH_DIGEST_SIZE 16
25
26void clmul_ghash_mul(char *dst, const be128 *shash);
27
28void clmul_ghash_update(char *dst, const char *src, unsigned int srclen,
29 const be128 *shash);
30
31void clmul_ghash_setkey(be128 *shash, const u8 *key);
32
33struct ghash_async_ctx {
34 struct cryptd_ahash *cryptd_tfm;
35};
36
37struct ghash_ctx {
38 be128 shash;
39};
40
41struct ghash_desc_ctx {
42 u8 buffer[GHASH_BLOCK_SIZE];
43 u32 bytes;
44};
45
46static int ghash_init(struct shash_desc *desc)
47{
48 struct ghash_desc_ctx *dctx = shash_desc_ctx(desc);
49
50 memset(dctx, 0, sizeof(*dctx));
51
52 return 0;
53}
54
55static int ghash_setkey(struct crypto_shash *tfm,
56 const u8 *key, unsigned int keylen)
57{
58 struct ghash_ctx *ctx = crypto_shash_ctx(tfm);
59
60 if (keylen != GHASH_BLOCK_SIZE) {
61 crypto_shash_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN);
62 return -EINVAL;
63 }
64
65 clmul_ghash_setkey(&ctx->shash, key);
66
67 return 0;
68}
69
70static int ghash_update(struct shash_desc *desc,
71 const u8 *src, unsigned int srclen)
72{
73 struct ghash_desc_ctx *dctx = shash_desc_ctx(desc);
74 struct ghash_ctx *ctx = crypto_shash_ctx(desc->tfm);
75 u8 *dst = dctx->buffer;
76
77 kernel_fpu_begin();
78 if (dctx->bytes) {
79 int n = min(srclen, dctx->bytes);
80 u8 *pos = dst + (GHASH_BLOCK_SIZE - dctx->bytes);
81
82 dctx->bytes -= n;
83 srclen -= n;
84
85 while (n--)
86 *pos++ ^= *src++;
87
88 if (!dctx->bytes)
89 clmul_ghash_mul(dst, &ctx->shash);
90 }
91
92 clmul_ghash_update(dst, src, srclen, &ctx->shash);
93 kernel_fpu_end();
94
95 if (srclen & 0xf) {
96 src += srclen - (srclen & 0xf);
97 srclen &= 0xf;
98 dctx->bytes = GHASH_BLOCK_SIZE - srclen;
99 while (srclen--)
100 *dst++ ^= *src++;
101 }
102
103 return 0;
104}
105
106static void ghash_flush(struct ghash_ctx *ctx, struct ghash_desc_ctx *dctx)
107{
108 u8 *dst = dctx->buffer;
109
110 if (dctx->bytes) {
111 u8 *tmp = dst + (GHASH_BLOCK_SIZE - dctx->bytes);
112
113 while (dctx->bytes--)
114 *tmp++ ^= 0;
115
116 kernel_fpu_begin();
117 clmul_ghash_mul(dst, &ctx->shash);
118 kernel_fpu_end();
119 }
120
121 dctx->bytes = 0;
122}
123
124static int ghash_final(struct shash_desc *desc, u8 *dst)
125{
126 struct ghash_desc_ctx *dctx = shash_desc_ctx(desc);
127 struct ghash_ctx *ctx = crypto_shash_ctx(desc->tfm);
128 u8 *buf = dctx->buffer;
129
130 ghash_flush(ctx, dctx);
131 memcpy(dst, buf, GHASH_BLOCK_SIZE);
132
133 return 0;
134}
135
136static struct shash_alg ghash_alg = {
137 .digestsize = GHASH_DIGEST_SIZE,
138 .init = ghash_init,
139 .update = ghash_update,
140 .final = ghash_final,
141 .setkey = ghash_setkey,
142 .descsize = sizeof(struct ghash_desc_ctx),
143 .base = {
144 .cra_name = "__ghash",
145 .cra_driver_name = "__ghash-pclmulqdqni",
146 .cra_priority = 0,
147 .cra_flags = CRYPTO_ALG_TYPE_SHASH,
148 .cra_blocksize = GHASH_BLOCK_SIZE,
149 .cra_ctxsize = sizeof(struct ghash_ctx),
150 .cra_module = THIS_MODULE,
151 .cra_list = LIST_HEAD_INIT(ghash_alg.base.cra_list),
152 },
153};
154
155static int ghash_async_init(struct ahash_request *req)
156{
157 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
158 struct ghash_async_ctx *ctx = crypto_ahash_ctx(tfm);
159 struct ahash_request *cryptd_req = ahash_request_ctx(req);
160 struct cryptd_ahash *cryptd_tfm = ctx->cryptd_tfm;
161
162 if (!irq_fpu_usable()) {
163 memcpy(cryptd_req, req, sizeof(*req));
164 ahash_request_set_tfm(cryptd_req, &cryptd_tfm->base);
165 return crypto_ahash_init(cryptd_req);
166 } else {
167 struct shash_desc *desc = cryptd_shash_desc(cryptd_req);
168 struct crypto_shash *child = cryptd_ahash_child(cryptd_tfm);
169
170 desc->tfm = child;
171 desc->flags = req->base.flags;
172 return crypto_shash_init(desc);
173 }
174}
175
176static int ghash_async_update(struct ahash_request *req)
177{
178 struct ahash_request *cryptd_req = ahash_request_ctx(req);
179
180 if (!irq_fpu_usable()) {
181 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
182 struct ghash_async_ctx *ctx = crypto_ahash_ctx(tfm);
183 struct cryptd_ahash *cryptd_tfm = ctx->cryptd_tfm;
184
185 memcpy(cryptd_req, req, sizeof(*req));
186 ahash_request_set_tfm(cryptd_req, &cryptd_tfm->base);
187 return crypto_ahash_update(cryptd_req);
188 } else {
189 struct shash_desc *desc = cryptd_shash_desc(cryptd_req);
190 return shash_ahash_update(req, desc);
191 }
192}
193
194static int ghash_async_final(struct ahash_request *req)
195{
196 struct ahash_request *cryptd_req = ahash_request_ctx(req);
197
198 if (!irq_fpu_usable()) {
199 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
200 struct ghash_async_ctx *ctx = crypto_ahash_ctx(tfm);
201 struct cryptd_ahash *cryptd_tfm = ctx->cryptd_tfm;
202
203 memcpy(cryptd_req, req, sizeof(*req));
204 ahash_request_set_tfm(cryptd_req, &cryptd_tfm->base);
205 return crypto_ahash_final(cryptd_req);
206 } else {
207 struct shash_desc *desc = cryptd_shash_desc(cryptd_req);
208 return crypto_shash_final(desc, req->result);
209 }
210}
211
212static int ghash_async_digest(struct ahash_request *req)
213{
214 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
215 struct ghash_async_ctx *ctx = crypto_ahash_ctx(tfm);
216 struct ahash_request *cryptd_req = ahash_request_ctx(req);
217 struct cryptd_ahash *cryptd_tfm = ctx->cryptd_tfm;
218
219 if (!irq_fpu_usable()) {
220 memcpy(cryptd_req, req, sizeof(*req));
221 ahash_request_set_tfm(cryptd_req, &cryptd_tfm->base);
222 return crypto_ahash_digest(cryptd_req);
223 } else {
224 struct shash_desc *desc = cryptd_shash_desc(cryptd_req);
225 struct crypto_shash *child = cryptd_ahash_child(cryptd_tfm);
226
227 desc->tfm = child;
228 desc->flags = req->base.flags;
229 return shash_ahash_digest(req, desc);
230 }
231}
232
233static int ghash_async_setkey(struct crypto_ahash *tfm, const u8 *key,
234 unsigned int keylen)
235{
236 struct ghash_async_ctx *ctx = crypto_ahash_ctx(tfm);
237 struct crypto_ahash *child = &ctx->cryptd_tfm->base;
238 int err;
239
240 crypto_ahash_clear_flags(child, CRYPTO_TFM_REQ_MASK);
241 crypto_ahash_set_flags(child, crypto_ahash_get_flags(tfm)
242 & CRYPTO_TFM_REQ_MASK);
243 err = crypto_ahash_setkey(child, key, keylen);
244 crypto_ahash_set_flags(tfm, crypto_ahash_get_flags(child)
245 & CRYPTO_TFM_RES_MASK);
246
247 return 0;
248}
249
250static int ghash_async_init_tfm(struct crypto_tfm *tfm)
251{
252 struct cryptd_ahash *cryptd_tfm;
253 struct ghash_async_ctx *ctx = crypto_tfm_ctx(tfm);
254
255 cryptd_tfm = cryptd_alloc_ahash("__ghash-pclmulqdqni", 0, 0);
256 if (IS_ERR(cryptd_tfm))
257 return PTR_ERR(cryptd_tfm);
258 ctx->cryptd_tfm = cryptd_tfm;
259 crypto_ahash_set_reqsize(__crypto_ahash_cast(tfm),
260 sizeof(struct ahash_request) +
261 crypto_ahash_reqsize(&cryptd_tfm->base));
262
263 return 0;
264}
265
266static void ghash_async_exit_tfm(struct crypto_tfm *tfm)
267{
268 struct ghash_async_ctx *ctx = crypto_tfm_ctx(tfm);
269
270 cryptd_free_ahash(ctx->cryptd_tfm);
271}
272
273static struct ahash_alg ghash_async_alg = {
274 .init = ghash_async_init,
275 .update = ghash_async_update,
276 .final = ghash_async_final,
277 .setkey = ghash_async_setkey,
278 .digest = ghash_async_digest,
279 .halg = {
280 .digestsize = GHASH_DIGEST_SIZE,
281 .base = {
282 .cra_name = "ghash",
283 .cra_driver_name = "ghash-clmulni",
284 .cra_priority = 400,
285 .cra_flags = CRYPTO_ALG_TYPE_AHASH | CRYPTO_ALG_ASYNC,
286 .cra_blocksize = GHASH_BLOCK_SIZE,
287 .cra_type = &crypto_ahash_type,
288 .cra_module = THIS_MODULE,
289 .cra_list = LIST_HEAD_INIT(ghash_async_alg.halg.base.cra_list),
290 .cra_init = ghash_async_init_tfm,
291 .cra_exit = ghash_async_exit_tfm,
292 },
293 },
294};
295
296static int __init ghash_pclmulqdqni_mod_init(void)
297{
298 int err;
299
300 if (!cpu_has_pclmulqdq) {
301 printk(KERN_INFO "Intel PCLMULQDQ-NI instructions are not"
302 " detected.\n");
303 return -ENODEV;
304 }
305
306 err = crypto_register_shash(&ghash_alg);
307 if (err)
308 goto err_out;
309 err = crypto_register_ahash(&ghash_async_alg);
310 if (err)
311 goto err_shash;
312
313 return 0;
314
315err_shash:
316 crypto_unregister_shash(&ghash_alg);
317err_out:
318 return err;
319}
320
321static void __exit ghash_pclmulqdqni_mod_exit(void)
322{
323 crypto_unregister_ahash(&ghash_async_alg);
324 crypto_unregister_shash(&ghash_alg);
325}
326
327module_init(ghash_pclmulqdqni_mod_init);
328module_exit(ghash_pclmulqdqni_mod_exit);
329
330MODULE_LICENSE("GPL");
331MODULE_DESCRIPTION("GHASH Message Digest Algorithm, "
332 "acclerated by PCLMULQDQ-NI");
333MODULE_ALIAS("ghash");
diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S
index 581b0568fe19..4eefdca9832b 100644
--- a/arch/x86/ia32/ia32entry.S
+++ b/arch/x86/ia32/ia32entry.S
@@ -653,7 +653,7 @@ ia32_sys_call_table:
653 .quad compat_sys_writev 653 .quad compat_sys_writev
654 .quad sys_getsid 654 .quad sys_getsid
655 .quad sys_fdatasync 655 .quad sys_fdatasync
656 .quad sys32_sysctl /* sysctl */ 656 .quad compat_sys_sysctl /* sysctl */
657 .quad sys_mlock /* 150 */ 657 .quad sys_mlock /* 150 */
658 .quad sys_munlock 658 .quad sys_munlock
659 .quad sys_mlockall 659 .quad sys_mlockall
@@ -841,4 +841,5 @@ ia32_sys_call_table:
841 .quad compat_sys_pwritev 841 .quad compat_sys_pwritev
842 .quad compat_sys_rt_tgsigqueueinfo /* 335 */ 842 .quad compat_sys_rt_tgsigqueueinfo /* 335 */
843 .quad sys_perf_event_open 843 .quad sys_perf_event_open
844 .quad compat_sys_recvmmsg
844ia32_syscall_end: 845ia32_syscall_end:
diff --git a/arch/x86/ia32/sys_ia32.c b/arch/x86/ia32/sys_ia32.c
index 9f5527198825..df82c0e48ded 100644
--- a/arch/x86/ia32/sys_ia32.c
+++ b/arch/x86/ia32/sys_ia32.c
@@ -434,62 +434,6 @@ asmlinkage long sys32_rt_sigqueueinfo(int pid, int sig,
434 return ret; 434 return ret;
435} 435}
436 436
437#ifdef CONFIG_SYSCTL_SYSCALL
438struct sysctl_ia32 {
439 unsigned int name;
440 int nlen;
441 unsigned int oldval;
442 unsigned int oldlenp;
443 unsigned int newval;
444 unsigned int newlen;
445 unsigned int __unused[4];
446};
447
448
449asmlinkage long sys32_sysctl(struct sysctl_ia32 __user *args32)
450{
451 struct sysctl_ia32 a32;
452 mm_segment_t old_fs = get_fs();
453 void __user *oldvalp, *newvalp;
454 size_t oldlen;
455 int __user *namep;
456 long ret;
457
458 if (copy_from_user(&a32, args32, sizeof(a32)))
459 return -EFAULT;
460
461 /*
462 * We need to pre-validate these because we have to disable
463 * address checking before calling do_sysctl() because of
464 * OLDLEN but we can't run the risk of the user specifying bad
465 * addresses here. Well, since we're dealing with 32 bit
466 * addresses, we KNOW that access_ok() will always succeed, so
467 * this is an expensive NOP, but so what...
468 */
469 namep = compat_ptr(a32.name);
470 oldvalp = compat_ptr(a32.oldval);
471 newvalp = compat_ptr(a32.newval);
472
473 if ((oldvalp && get_user(oldlen, (int __user *)compat_ptr(a32.oldlenp)))
474 || !access_ok(VERIFY_WRITE, namep, 0)
475 || !access_ok(VERIFY_WRITE, oldvalp, 0)
476 || !access_ok(VERIFY_WRITE, newvalp, 0))
477 return -EFAULT;
478
479 set_fs(KERNEL_DS);
480 lock_kernel();
481 ret = do_sysctl(namep, a32.nlen, oldvalp, (size_t __user *)&oldlen,
482 newvalp, (size_t) a32.newlen);
483 unlock_kernel();
484 set_fs(old_fs);
485
486 if (oldvalp && put_user(oldlen, (int __user *)compat_ptr(a32.oldlenp)))
487 return -EFAULT;
488
489 return ret;
490}
491#endif
492
493/* warning: next two assume little endian */ 437/* warning: next two assume little endian */
494asmlinkage long sys32_pread(unsigned int fd, char __user *ubuf, u32 count, 438asmlinkage long sys32_pread(unsigned int fd, char __user *ubuf, u32 count,
495 u32 poslo, u32 poshi) 439 u32 poslo, u32 poshi)
diff --git a/arch/x86/include/asm/Kbuild b/arch/x86/include/asm/Kbuild
index 4a8e80cdcfa5..9f828f87ca35 100644
--- a/arch/x86/include/asm/Kbuild
+++ b/arch/x86/include/asm/Kbuild
@@ -10,6 +10,7 @@ header-y += ptrace-abi.h
10header-y += sigcontext32.h 10header-y += sigcontext32.h
11header-y += ucontext.h 11header-y += ucontext.h
12header-y += processor-flags.h 12header-y += processor-flags.h
13header-y += hw_breakpoint.h
13 14
14unifdef-y += e820.h 15unifdef-y += e820.h
15unifdef-y += ist.h 16unifdef-y += ist.h
diff --git a/arch/x86/include/asm/a.out-core.h b/arch/x86/include/asm/a.out-core.h
index bb70e397aa84..7a15588e45d4 100644
--- a/arch/x86/include/asm/a.out-core.h
+++ b/arch/x86/include/asm/a.out-core.h
@@ -17,6 +17,7 @@
17 17
18#include <linux/user.h> 18#include <linux/user.h>
19#include <linux/elfcore.h> 19#include <linux/elfcore.h>
20#include <asm/debugreg.h>
20 21
21/* 22/*
22 * fill in the user structure for an a.out core dump 23 * fill in the user structure for an a.out core dump
@@ -32,14 +33,7 @@ static inline void aout_dump_thread(struct pt_regs *regs, struct user *dump)
32 >> PAGE_SHIFT; 33 >> PAGE_SHIFT;
33 dump->u_dsize -= dump->u_tsize; 34 dump->u_dsize -= dump->u_tsize;
34 dump->u_ssize = 0; 35 dump->u_ssize = 0;
35 dump->u_debugreg[0] = current->thread.debugreg0; 36 aout_dump_debugregs(dump);
36 dump->u_debugreg[1] = current->thread.debugreg1;
37 dump->u_debugreg[2] = current->thread.debugreg2;
38 dump->u_debugreg[3] = current->thread.debugreg3;
39 dump->u_debugreg[4] = 0;
40 dump->u_debugreg[5] = 0;
41 dump->u_debugreg[6] = current->thread.debugreg6;
42 dump->u_debugreg[7] = current->thread.debugreg7;
43 37
44 if (dump->start_stack < TASK_SIZE) 38 if (dump->start_stack < TASK_SIZE)
45 dump->u_ssize = ((unsigned long)(TASK_SIZE - dump->start_stack)) 39 dump->u_ssize = ((unsigned long)(TASK_SIZE - dump->start_stack))
diff --git a/arch/x86/include/asm/acpi.h b/arch/x86/include/asm/acpi.h
index 4518dc500903..60d2b2db0bc5 100644
--- a/arch/x86/include/asm/acpi.h
+++ b/arch/x86/include/asm/acpi.h
@@ -118,7 +118,7 @@ extern void acpi_restore_state_mem(void);
118extern unsigned long acpi_wakeup_address; 118extern unsigned long acpi_wakeup_address;
119 119
120/* early initialization routine */ 120/* early initialization routine */
121extern void acpi_reserve_bootmem(void); 121extern void acpi_reserve_wakeup_memory(void);
122 122
123/* 123/*
124 * Check if the CPU can handle C2 and deeper 124 * Check if the CPU can handle C2 and deeper
@@ -158,6 +158,7 @@ struct bootnode;
158 158
159#ifdef CONFIG_ACPI_NUMA 159#ifdef CONFIG_ACPI_NUMA
160extern int acpi_numa; 160extern int acpi_numa;
161extern int acpi_get_nodes(struct bootnode *physnodes);
161extern int acpi_scan_nodes(unsigned long start, unsigned long end); 162extern int acpi_scan_nodes(unsigned long start, unsigned long end);
162#define NR_NODE_MEMBLKS (MAX_NUMNODES*2) 163#define NR_NODE_MEMBLKS (MAX_NUMNODES*2)
163extern void acpi_fake_nodes(const struct bootnode *fake_nodes, 164extern void acpi_fake_nodes(const struct bootnode *fake_nodes,
diff --git a/arch/x86/include/asm/alternative-asm.h b/arch/x86/include/asm/alternative-asm.h
index e2077d343c33..b97f786a48d5 100644
--- a/arch/x86/include/asm/alternative-asm.h
+++ b/arch/x86/include/asm/alternative-asm.h
@@ -1,17 +1,13 @@
1#ifdef __ASSEMBLY__ 1#ifdef __ASSEMBLY__
2 2
3#ifdef CONFIG_X86_32 3#include <asm/asm.h>
4# define X86_ALIGN .long
5#else
6# define X86_ALIGN .quad
7#endif
8 4
9#ifdef CONFIG_SMP 5#ifdef CONFIG_SMP
10 .macro LOCK_PREFIX 6 .macro LOCK_PREFIX
111: lock 71: lock
12 .section .smp_locks,"a" 8 .section .smp_locks,"a"
13 .align 4 9 _ASM_ALIGN
14 X86_ALIGN 1b 10 _ASM_PTR 1b
15 .previous 11 .previous
16 .endm 12 .endm
17#else 13#else
diff --git a/arch/x86/include/asm/alternative.h b/arch/x86/include/asm/alternative.h
index c240efc74e00..69b74a7b877f 100644
--- a/arch/x86/include/asm/alternative.h
+++ b/arch/x86/include/asm/alternative.h
@@ -84,6 +84,7 @@ static inline void alternatives_smp_switch(int smp) {}
84 " .byte " __stringify(feature) "\n" /* feature bit */ \ 84 " .byte " __stringify(feature) "\n" /* feature bit */ \
85 " .byte 662b-661b\n" /* sourcelen */ \ 85 " .byte 662b-661b\n" /* sourcelen */ \
86 " .byte 664f-663f\n" /* replacementlen */ \ 86 " .byte 664f-663f\n" /* replacementlen */ \
87 " .byte 0xff + (664f-663f) - (662b-661b)\n" /* rlen <= slen */ \
87 ".previous\n" \ 88 ".previous\n" \
88 ".section .altinstr_replacement, \"ax\"\n" \ 89 ".section .altinstr_replacement, \"ax\"\n" \
89 "663:\n\t" newinstr "\n664:\n" /* replacement */ \ 90 "663:\n\t" newinstr "\n664:\n" /* replacement */ \
diff --git a/arch/x86/include/asm/amd_iommu.h b/arch/x86/include/asm/amd_iommu.h
index 4b180897e6b5..5af2982133b5 100644
--- a/arch/x86/include/asm/amd_iommu.h
+++ b/arch/x86/include/asm/amd_iommu.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2007-2008 Advanced Micro Devices, Inc. 2 * Copyright (C) 2007-2009 Advanced Micro Devices, Inc.
3 * Author: Joerg Roedel <joerg.roedel@amd.com> 3 * Author: Joerg Roedel <joerg.roedel@amd.com>
4 * Leo Duran <leo.duran@amd.com> 4 * Leo Duran <leo.duran@amd.com>
5 * 5 *
@@ -23,19 +23,13 @@
23#include <linux/irqreturn.h> 23#include <linux/irqreturn.h>
24 24
25#ifdef CONFIG_AMD_IOMMU 25#ifdef CONFIG_AMD_IOMMU
26extern int amd_iommu_init(void); 26
27extern int amd_iommu_init_dma_ops(void);
28extern int amd_iommu_init_passthrough(void);
29extern void amd_iommu_detect(void); 27extern void amd_iommu_detect(void);
30extern irqreturn_t amd_iommu_int_handler(int irq, void *data); 28
31extern void amd_iommu_flush_all_domains(void);
32extern void amd_iommu_flush_all_devices(void);
33extern void amd_iommu_shutdown(void);
34extern void amd_iommu_apply_erratum_63(u16 devid);
35#else 29#else
36static inline int amd_iommu_init(void) { return -ENODEV; } 30
37static inline void amd_iommu_detect(void) { } 31static inline void amd_iommu_detect(void) { }
38static inline void amd_iommu_shutdown(void) { } 32
39#endif 33#endif
40 34
41#endif /* _ASM_X86_AMD_IOMMU_H */ 35#endif /* _ASM_X86_AMD_IOMMU_H */
diff --git a/arch/x86/include/asm/amd_iommu_proto.h b/arch/x86/include/asm/amd_iommu_proto.h
new file mode 100644
index 000000000000..84786fb9a23b
--- /dev/null
+++ b/arch/x86/include/asm/amd_iommu_proto.h
@@ -0,0 +1,38 @@
1/*
2 * Copyright (C) 2009 Advanced Micro Devices, Inc.
3 * Author: Joerg Roedel <joerg.roedel@amd.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 as published
7 * by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19#ifndef _ASM_X86_AMD_IOMMU_PROTO_H
20#define _ASM_X86_AMD_IOMMU_PROTO_H
21
22struct amd_iommu;
23
24extern int amd_iommu_init_dma_ops(void);
25extern int amd_iommu_init_passthrough(void);
26extern irqreturn_t amd_iommu_int_handler(int irq, void *data);
27extern void amd_iommu_flush_all_domains(void);
28extern void amd_iommu_flush_all_devices(void);
29extern void amd_iommu_apply_erratum_63(u16 devid);
30extern void amd_iommu_reset_cmd_buffer(struct amd_iommu *iommu);
31
32#ifndef CONFIG_AMD_IOMMU_STATS
33
34static inline void amd_iommu_stats_init(void) { }
35
36#endif /* !CONFIG_AMD_IOMMU_STATS */
37
38#endif /* _ASM_X86_AMD_IOMMU_PROTO_H */
diff --git a/arch/x86/include/asm/amd_iommu_types.h b/arch/x86/include/asm/amd_iommu_types.h
index 2a2cc7a78a81..ba19ad4c47d0 100644
--- a/arch/x86/include/asm/amd_iommu_types.h
+++ b/arch/x86/include/asm/amd_iommu_types.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2007-2008 Advanced Micro Devices, Inc. 2 * Copyright (C) 2007-2009 Advanced Micro Devices, Inc.
3 * Author: Joerg Roedel <joerg.roedel@amd.com> 3 * Author: Joerg Roedel <joerg.roedel@amd.com>
4 * Leo Duran <leo.duran@amd.com> 4 * Leo Duran <leo.duran@amd.com>
5 * 5 *
@@ -25,6 +25,11 @@
25#include <linux/spinlock.h> 25#include <linux/spinlock.h>
26 26
27/* 27/*
28 * Maximum number of IOMMUs supported
29 */
30#define MAX_IOMMUS 32
31
32/*
28 * some size calculation constants 33 * some size calculation constants
29 */ 34 */
30#define DEV_TABLE_ENTRY_SIZE 32 35#define DEV_TABLE_ENTRY_SIZE 32
@@ -206,6 +211,9 @@ extern bool amd_iommu_dump;
206 printk(KERN_INFO "AMD-Vi: " format, ## arg); \ 211 printk(KERN_INFO "AMD-Vi: " format, ## arg); \
207 } while(0); 212 } while(0);
208 213
214/* global flag if IOMMUs cache non-present entries */
215extern bool amd_iommu_np_cache;
216
209/* 217/*
210 * Make iterating over all IOMMUs easier 218 * Make iterating over all IOMMUs easier
211 */ 219 */
@@ -226,6 +234,8 @@ extern bool amd_iommu_dump;
226 * independent of their use. 234 * independent of their use.
227 */ 235 */
228struct protection_domain { 236struct protection_domain {
237 struct list_head list; /* for list of all protection domains */
238 struct list_head dev_list; /* List of all devices in this domain */
229 spinlock_t lock; /* mostly used to lock the page table*/ 239 spinlock_t lock; /* mostly used to lock the page table*/
230 u16 id; /* the domain id written to the device table */ 240 u16 id; /* the domain id written to the device table */
231 int mode; /* paging mode (0-6 levels) */ 241 int mode; /* paging mode (0-6 levels) */
@@ -233,7 +243,20 @@ struct protection_domain {
233 unsigned long flags; /* flags to find out type of domain */ 243 unsigned long flags; /* flags to find out type of domain */
234 bool updated; /* complete domain flush required */ 244 bool updated; /* complete domain flush required */
235 unsigned dev_cnt; /* devices assigned to this domain */ 245 unsigned dev_cnt; /* devices assigned to this domain */
246 unsigned dev_iommu[MAX_IOMMUS]; /* per-IOMMU reference count */
236 void *priv; /* private data */ 247 void *priv; /* private data */
248
249};
250
251/*
252 * This struct contains device specific data for the IOMMU
253 */
254struct iommu_dev_data {
255 struct list_head list; /* For domain->dev_list */
256 struct device *dev; /* Device this data belong to */
257 struct device *alias; /* The Alias Device */
258 struct protection_domain *domain; /* Domain the device is bound to */
259 atomic_t bind; /* Domain attach reverent count */
237}; 260};
238 261
239/* 262/*
@@ -291,6 +314,9 @@ struct dma_ops_domain {
291struct amd_iommu { 314struct amd_iommu {
292 struct list_head list; 315 struct list_head list;
293 316
317 /* Index within the IOMMU array */
318 int index;
319
294 /* locks the accesses to the hardware */ 320 /* locks the accesses to the hardware */
295 spinlock_t lock; 321 spinlock_t lock;
296 322
@@ -357,6 +383,21 @@ struct amd_iommu {
357extern struct list_head amd_iommu_list; 383extern struct list_head amd_iommu_list;
358 384
359/* 385/*
386 * Array with pointers to each IOMMU struct
387 * The indices are referenced in the protection domains
388 */
389extern struct amd_iommu *amd_iommus[MAX_IOMMUS];
390
391/* Number of IOMMUs present in the system */
392extern int amd_iommus_present;
393
394/*
395 * Declarations for the global list of all protection domains
396 */
397extern spinlock_t amd_iommu_pd_lock;
398extern struct list_head amd_iommu_pd_list;
399
400/*
360 * Structure defining one entry in the device table 401 * Structure defining one entry in the device table
361 */ 402 */
362struct dev_table_entry { 403struct dev_table_entry {
@@ -416,15 +457,9 @@ extern unsigned amd_iommu_aperture_order;
416/* largest PCI device id we expect translation requests for */ 457/* largest PCI device id we expect translation requests for */
417extern u16 amd_iommu_last_bdf; 458extern u16 amd_iommu_last_bdf;
418 459
419/* data structures for protection domain handling */
420extern struct protection_domain **amd_iommu_pd_table;
421
422/* allocation bitmap for domain ids */ 460/* allocation bitmap for domain ids */
423extern unsigned long *amd_iommu_pd_alloc_bitmap; 461extern unsigned long *amd_iommu_pd_alloc_bitmap;
424 462
425/* will be 1 if device isolation is enabled */
426extern bool amd_iommu_isolate;
427
428/* 463/*
429 * If true, the addresses will be flushed on unmap time, not when 464 * If true, the addresses will be flushed on unmap time, not when
430 * they are reused 465 * they are reused
@@ -462,11 +497,6 @@ struct __iommu_counter {
462#define ADD_STATS_COUNTER(name, x) 497#define ADD_STATS_COUNTER(name, x)
463#define SUB_STATS_COUNTER(name, x) 498#define SUB_STATS_COUNTER(name, x)
464 499
465static inline void amd_iommu_stats_init(void) { }
466
467#endif /* CONFIG_AMD_IOMMU_STATS */ 500#endif /* CONFIG_AMD_IOMMU_STATS */
468 501
469/* some function prototypes */
470extern void amd_iommu_reset_cmd_buffer(struct amd_iommu *iommu);
471
472#endif /* _ASM_X86_AMD_IOMMU_TYPES_H */ 502#endif /* _ASM_X86_AMD_IOMMU_TYPES_H */
diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
index 474d80d3e6cc..b4ac2cdcb64f 100644
--- a/arch/x86/include/asm/apic.h
+++ b/arch/x86/include/asm/apic.h
@@ -297,20 +297,20 @@ struct apic {
297 int disable_esr; 297 int disable_esr;
298 298
299 int dest_logical; 299 int dest_logical;
300 unsigned long (*check_apicid_used)(physid_mask_t bitmap, int apicid); 300 unsigned long (*check_apicid_used)(physid_mask_t *map, int apicid);
301 unsigned long (*check_apicid_present)(int apicid); 301 unsigned long (*check_apicid_present)(int apicid);
302 302
303 void (*vector_allocation_domain)(int cpu, struct cpumask *retmask); 303 void (*vector_allocation_domain)(int cpu, struct cpumask *retmask);
304 void (*init_apic_ldr)(void); 304 void (*init_apic_ldr)(void);
305 305
306 physid_mask_t (*ioapic_phys_id_map)(physid_mask_t map); 306 void (*ioapic_phys_id_map)(physid_mask_t *phys_map, physid_mask_t *retmap);
307 307
308 void (*setup_apic_routing)(void); 308 void (*setup_apic_routing)(void);
309 int (*multi_timer_check)(int apic, int irq); 309 int (*multi_timer_check)(int apic, int irq);
310 int (*apicid_to_node)(int logical_apicid); 310 int (*apicid_to_node)(int logical_apicid);
311 int (*cpu_to_logical_apicid)(int cpu); 311 int (*cpu_to_logical_apicid)(int cpu);
312 int (*cpu_present_to_apicid)(int mps_cpu); 312 int (*cpu_present_to_apicid)(int mps_cpu);
313 physid_mask_t (*apicid_to_cpu_present)(int phys_apicid); 313 void (*apicid_to_cpu_present)(int phys_apicid, physid_mask_t *retmap);
314 void (*setup_portio_remap)(void); 314 void (*setup_portio_remap)(void);
315 int (*check_phys_apicid_present)(int phys_apicid); 315 int (*check_phys_apicid_present)(int phys_apicid);
316 void (*enable_apic_mode)(void); 316 void (*enable_apic_mode)(void);
@@ -488,6 +488,8 @@ static inline unsigned int read_apic_id(void)
488 488
489extern void default_setup_apic_routing(void); 489extern void default_setup_apic_routing(void);
490 490
491extern struct apic apic_noop;
492
491#ifdef CONFIG_X86_32 493#ifdef CONFIG_X86_32
492 494
493extern struct apic apic_default; 495extern struct apic apic_default;
@@ -532,9 +534,9 @@ default_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
532 return (unsigned int)(mask1 & mask2 & mask3); 534 return (unsigned int)(mask1 & mask2 & mask3);
533} 535}
534 536
535static inline unsigned long default_check_apicid_used(physid_mask_t bitmap, int apicid) 537static inline unsigned long default_check_apicid_used(physid_mask_t *map, int apicid)
536{ 538{
537 return physid_isset(apicid, bitmap); 539 return physid_isset(apicid, *map);
538} 540}
539 541
540static inline unsigned long default_check_apicid_present(int bit) 542static inline unsigned long default_check_apicid_present(int bit)
@@ -542,9 +544,9 @@ static inline unsigned long default_check_apicid_present(int bit)
542 return physid_isset(bit, phys_cpu_present_map); 544 return physid_isset(bit, phys_cpu_present_map);
543} 545}
544 546
545static inline physid_mask_t default_ioapic_phys_id_map(physid_mask_t phys_map) 547static inline void default_ioapic_phys_id_map(physid_mask_t *phys_map, physid_mask_t *retmap)
546{ 548{
547 return phys_map; 549 *retmap = *phys_map;
548} 550}
549 551
550/* Mapping from cpu number to logical apicid */ 552/* Mapping from cpu number to logical apicid */
@@ -583,11 +585,6 @@ extern int default_cpu_present_to_apicid(int mps_cpu);
583extern int default_check_phys_apicid_present(int phys_apicid); 585extern int default_check_phys_apicid_present(int phys_apicid);
584#endif 586#endif
585 587
586static inline physid_mask_t default_apicid_to_cpu_present(int phys_apicid)
587{
588 return physid_mask_of_physid(phys_apicid);
589}
590
591#endif /* CONFIG_X86_LOCAL_APIC */ 588#endif /* CONFIG_X86_LOCAL_APIC */
592 589
593#ifdef CONFIG_X86_32 590#ifdef CONFIG_X86_32
diff --git a/arch/x86/include/asm/apicdef.h b/arch/x86/include/asm/apicdef.h
index 3b62da926de9..7fe3b3060f08 100644
--- a/arch/x86/include/asm/apicdef.h
+++ b/arch/x86/include/asm/apicdef.h
@@ -11,6 +11,12 @@
11#define IO_APIC_DEFAULT_PHYS_BASE 0xfec00000 11#define IO_APIC_DEFAULT_PHYS_BASE 0xfec00000
12#define APIC_DEFAULT_PHYS_BASE 0xfee00000 12#define APIC_DEFAULT_PHYS_BASE 0xfee00000
13 13
14/*
15 * This is the IO-APIC register space as specified
16 * by Intel docs:
17 */
18#define IO_APIC_SLOT_SIZE 1024
19
14#define APIC_ID 0x20 20#define APIC_ID 0x20
15 21
16#define APIC_LVR 0x30 22#define APIC_LVR 0x30
diff --git a/arch/x86/include/asm/apicnum.h b/arch/x86/include/asm/apicnum.h
deleted file mode 100644
index 82f613c607ce..000000000000
--- a/arch/x86/include/asm/apicnum.h
+++ /dev/null
@@ -1,12 +0,0 @@
1#ifndef _ASM_X86_APICNUM_H
2#define _ASM_X86_APICNUM_H
3
4/* define MAX_IO_APICS */
5#ifdef CONFIG_X86_32
6# define MAX_IO_APICS 64
7#else
8# define MAX_IO_APICS 128
9# define MAX_LOCAL_APIC 32768
10#endif
11
12#endif /* _ASM_X86_APICNUM_H */
diff --git a/arch/x86/include/asm/bug.h b/arch/x86/include/asm/bug.h
index d9cf1cd156d2..f654d1bb17fb 100644
--- a/arch/x86/include/asm/bug.h
+++ b/arch/x86/include/asm/bug.h
@@ -22,14 +22,14 @@ do { \
22 ".popsection" \ 22 ".popsection" \
23 : : "i" (__FILE__), "i" (__LINE__), \ 23 : : "i" (__FILE__), "i" (__LINE__), \
24 "i" (sizeof(struct bug_entry))); \ 24 "i" (sizeof(struct bug_entry))); \
25 for (;;) ; \ 25 unreachable(); \
26} while (0) 26} while (0)
27 27
28#else 28#else
29#define BUG() \ 29#define BUG() \
30do { \ 30do { \
31 asm volatile("ud2"); \ 31 asm volatile("ud2"); \
32 for (;;) ; \ 32 unreachable(); \
33} while (0) 33} while (0)
34#endif 34#endif
35 35
diff --git a/arch/x86/include/asm/cache.h b/arch/x86/include/asm/cache.h
index 549860d3be8f..2f9047cfaaca 100644
--- a/arch/x86/include/asm/cache.h
+++ b/arch/x86/include/asm/cache.h
@@ -9,12 +9,13 @@
9 9
10#define __read_mostly __attribute__((__section__(".data.read_mostly"))) 10#define __read_mostly __attribute__((__section__(".data.read_mostly")))
11 11
12#define INTERNODE_CACHE_SHIFT CONFIG_X86_INTERNODE_CACHE_SHIFT
13#define INTERNODE_CACHE_BYTES (1 << INTERNODE_CACHE_SHIFT)
14
12#ifdef CONFIG_X86_VSMP 15#ifdef CONFIG_X86_VSMP
13/* vSMP Internode cacheline shift */
14#define INTERNODE_CACHE_SHIFT (12)
15#ifdef CONFIG_SMP 16#ifdef CONFIG_SMP
16#define __cacheline_aligned_in_smp \ 17#define __cacheline_aligned_in_smp \
17 __attribute__((__aligned__(1 << (INTERNODE_CACHE_SHIFT)))) \ 18 __attribute__((__aligned__(INTERNODE_CACHE_BYTES))) \
18 __page_aligned_data 19 __page_aligned_data
19#endif 20#endif
20#endif 21#endif
diff --git a/arch/x86/include/asm/cacheflush.h b/arch/x86/include/asm/cacheflush.h
index b54f6afe7ec4..634c40a739a6 100644
--- a/arch/x86/include/asm/cacheflush.h
+++ b/arch/x86/include/asm/cacheflush.h
@@ -12,6 +12,7 @@ static inline void flush_cache_range(struct vm_area_struct *vma,
12 unsigned long start, unsigned long end) { } 12 unsigned long start, unsigned long end) { }
13static inline void flush_cache_page(struct vm_area_struct *vma, 13static inline void flush_cache_page(struct vm_area_struct *vma,
14 unsigned long vmaddr, unsigned long pfn) { } 14 unsigned long vmaddr, unsigned long pfn) { }
15#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 0
15static inline void flush_dcache_page(struct page *page) { } 16static inline void flush_dcache_page(struct page *page) { }
16static inline void flush_dcache_mmap_lock(struct address_space *mapping) { } 17static inline void flush_dcache_mmap_lock(struct address_space *mapping) { }
17static inline void flush_dcache_mmap_unlock(struct address_space *mapping) { } 18static inline void flush_dcache_mmap_unlock(struct address_space *mapping) { }
@@ -176,6 +177,7 @@ void clflush_cache_range(void *addr, unsigned int size);
176#ifdef CONFIG_DEBUG_RODATA 177#ifdef CONFIG_DEBUG_RODATA
177void mark_rodata_ro(void); 178void mark_rodata_ro(void);
178extern const int rodata_test_data; 179extern const int rodata_test_data;
180extern int kernel_set_to_readonly;
179void set_kernel_text_rw(void); 181void set_kernel_text_rw(void);
180void set_kernel_text_ro(void); 182void set_kernel_text_ro(void);
181#else 183#else
diff --git a/arch/x86/include/asm/calgary.h b/arch/x86/include/asm/calgary.h
index b03bedb62aa7..0918654305af 100644
--- a/arch/x86/include/asm/calgary.h
+++ b/arch/x86/include/asm/calgary.h
@@ -62,10 +62,8 @@ struct cal_chipset_ops {
62extern int use_calgary; 62extern int use_calgary;
63 63
64#ifdef CONFIG_CALGARY_IOMMU 64#ifdef CONFIG_CALGARY_IOMMU
65extern int calgary_iommu_init(void);
66extern void detect_calgary(void); 65extern void detect_calgary(void);
67#else 66#else
68static inline int calgary_iommu_init(void) { return 1; }
69static inline void detect_calgary(void) { return; } 67static inline void detect_calgary(void) { return; }
70#endif 68#endif
71 69
diff --git a/arch/x86/include/asm/cmpxchg_32.h b/arch/x86/include/asm/cmpxchg_32.h
index ee1931be6593..ffb9bb6b6c37 100644
--- a/arch/x86/include/asm/cmpxchg_32.h
+++ b/arch/x86/include/asm/cmpxchg_32.h
@@ -8,14 +8,50 @@
8 * you need to test for the feature in boot_cpu_data. 8 * you need to test for the feature in boot_cpu_data.
9 */ 9 */
10 10
11#define xchg(ptr, v) \ 11extern void __xchg_wrong_size(void);
12 ((__typeof__(*(ptr)))__xchg((unsigned long)(v), (ptr), sizeof(*(ptr)))) 12
13/*
14 * Note: no "lock" prefix even on SMP: xchg always implies lock anyway
15 * Note 2: xchg has side effect, so that attribute volatile is necessary,
16 * but generally the primitive is invalid, *ptr is output argument. --ANK
17 */
13 18
14struct __xchg_dummy { 19struct __xchg_dummy {
15 unsigned long a[100]; 20 unsigned long a[100];
16}; 21};
17#define __xg(x) ((struct __xchg_dummy *)(x)) 22#define __xg(x) ((struct __xchg_dummy *)(x))
18 23
24#define __xchg(x, ptr, size) \
25({ \
26 __typeof(*(ptr)) __x = (x); \
27 switch (size) { \
28 case 1: \
29 asm volatile("xchgb %b0,%1" \
30 : "=q" (__x) \
31 : "m" (*__xg(ptr)), "0" (__x) \
32 : "memory"); \
33 break; \
34 case 2: \
35 asm volatile("xchgw %w0,%1" \
36 : "=r" (__x) \
37 : "m" (*__xg(ptr)), "0" (__x) \
38 : "memory"); \
39 break; \
40 case 4: \
41 asm volatile("xchgl %0,%1" \
42 : "=r" (__x) \
43 : "m" (*__xg(ptr)), "0" (__x) \
44 : "memory"); \
45 break; \
46 default: \
47 __xchg_wrong_size(); \
48 } \
49 __x; \
50})
51
52#define xchg(ptr, v) \
53 __xchg((v), (ptr), sizeof(*ptr))
54
19/* 55/*
20 * The semantics of XCHGCMP8B are a bit strange, this is why 56 * The semantics of XCHGCMP8B are a bit strange, this is why
21 * there is a loop and the loading of %%eax and %%edx has to 57 * there is a loop and the loading of %%eax and %%edx has to
@@ -71,57 +107,63 @@ static inline void __set_64bit_var(unsigned long long *ptr,
71 (unsigned int)((value) >> 32)) \ 107 (unsigned int)((value) >> 32)) \
72 : __set_64bit(ptr, ll_low((value)), ll_high((value)))) 108 : __set_64bit(ptr, ll_low((value)), ll_high((value))))
73 109
74/* 110extern void __cmpxchg_wrong_size(void);
75 * Note: no "lock" prefix even on SMP: xchg always implies lock anyway
76 * Note 2: xchg has side effect, so that attribute volatile is necessary,
77 * but generally the primitive is invalid, *ptr is output argument. --ANK
78 */
79static inline unsigned long __xchg(unsigned long x, volatile void *ptr,
80 int size)
81{
82 switch (size) {
83 case 1:
84 asm volatile("xchgb %b0,%1"
85 : "=q" (x)
86 : "m" (*__xg(ptr)), "0" (x)
87 : "memory");
88 break;
89 case 2:
90 asm volatile("xchgw %w0,%1"
91 : "=r" (x)
92 : "m" (*__xg(ptr)), "0" (x)
93 : "memory");
94 break;
95 case 4:
96 asm volatile("xchgl %0,%1"
97 : "=r" (x)
98 : "m" (*__xg(ptr)), "0" (x)
99 : "memory");
100 break;
101 }
102 return x;
103}
104 111
105/* 112/*
106 * Atomic compare and exchange. Compare OLD with MEM, if identical, 113 * Atomic compare and exchange. Compare OLD with MEM, if identical,
107 * store NEW in MEM. Return the initial value in MEM. Success is 114 * store NEW in MEM. Return the initial value in MEM. Success is
108 * indicated by comparing RETURN with OLD. 115 * indicated by comparing RETURN with OLD.
109 */ 116 */
117#define __raw_cmpxchg(ptr, old, new, size, lock) \
118({ \
119 __typeof__(*(ptr)) __ret; \
120 __typeof__(*(ptr)) __old = (old); \
121 __typeof__(*(ptr)) __new = (new); \
122 switch (size) { \
123 case 1: \
124 asm volatile(lock "cmpxchgb %b1,%2" \
125 : "=a"(__ret) \
126 : "q"(__new), "m"(*__xg(ptr)), "0"(__old) \
127 : "memory"); \
128 break; \
129 case 2: \
130 asm volatile(lock "cmpxchgw %w1,%2" \
131 : "=a"(__ret) \
132 : "r"(__new), "m"(*__xg(ptr)), "0"(__old) \
133 : "memory"); \
134 break; \
135 case 4: \
136 asm volatile(lock "cmpxchgl %1,%2" \
137 : "=a"(__ret) \
138 : "r"(__new), "m"(*__xg(ptr)), "0"(__old) \
139 : "memory"); \
140 break; \
141 default: \
142 __cmpxchg_wrong_size(); \
143 } \
144 __ret; \
145})
146
147#define __cmpxchg(ptr, old, new, size) \
148 __raw_cmpxchg((ptr), (old), (new), (size), LOCK_PREFIX)
149
150#define __sync_cmpxchg(ptr, old, new, size) \
151 __raw_cmpxchg((ptr), (old), (new), (size), "lock; ")
152
153#define __cmpxchg_local(ptr, old, new, size) \
154 __raw_cmpxchg((ptr), (old), (new), (size), "")
110 155
111#ifdef CONFIG_X86_CMPXCHG 156#ifdef CONFIG_X86_CMPXCHG
112#define __HAVE_ARCH_CMPXCHG 1 157#define __HAVE_ARCH_CMPXCHG 1
113#define cmpxchg(ptr, o, n) \ 158
114 ((__typeof__(*(ptr)))__cmpxchg((ptr), (unsigned long)(o), \ 159#define cmpxchg(ptr, old, new) \
115 (unsigned long)(n), \ 160 __cmpxchg((ptr), (old), (new), sizeof(*ptr))
116 sizeof(*(ptr)))) 161
117#define sync_cmpxchg(ptr, o, n) \ 162#define sync_cmpxchg(ptr, old, new) \
118 ((__typeof__(*(ptr)))__sync_cmpxchg((ptr), (unsigned long)(o), \ 163 __sync_cmpxchg((ptr), (old), (new), sizeof(*ptr))
119 (unsigned long)(n), \ 164
120 sizeof(*(ptr)))) 165#define cmpxchg_local(ptr, old, new) \
121#define cmpxchg_local(ptr, o, n) \ 166 __cmpxchg_local((ptr), (old), (new), sizeof(*ptr))
122 ((__typeof__(*(ptr)))__cmpxchg_local((ptr), (unsigned long)(o), \
123 (unsigned long)(n), \
124 sizeof(*(ptr))))
125#endif 167#endif
126 168
127#ifdef CONFIG_X86_CMPXCHG64 169#ifdef CONFIG_X86_CMPXCHG64
@@ -133,94 +175,6 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr,
133 (unsigned long long)(n))) 175 (unsigned long long)(n)))
134#endif 176#endif
135 177
136static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
137 unsigned long new, int size)
138{
139 unsigned long prev;
140 switch (size) {
141 case 1:
142 asm volatile(LOCK_PREFIX "cmpxchgb %b1,%2"
143 : "=a"(prev)
144 : "q"(new), "m"(*__xg(ptr)), "0"(old)
145 : "memory");
146 return prev;
147 case 2:
148 asm volatile(LOCK_PREFIX "cmpxchgw %w1,%2"
149 : "=a"(prev)
150 : "r"(new), "m"(*__xg(ptr)), "0"(old)
151 : "memory");
152 return prev;
153 case 4:
154 asm volatile(LOCK_PREFIX "cmpxchgl %1,%2"
155 : "=a"(prev)
156 : "r"(new), "m"(*__xg(ptr)), "0"(old)
157 : "memory");
158 return prev;
159 }
160 return old;
161}
162
163/*
164 * Always use locked operations when touching memory shared with a
165 * hypervisor, since the system may be SMP even if the guest kernel
166 * isn't.
167 */
168static inline unsigned long __sync_cmpxchg(volatile void *ptr,
169 unsigned long old,
170 unsigned long new, int size)
171{
172 unsigned long prev;
173 switch (size) {
174 case 1:
175 asm volatile("lock; cmpxchgb %b1,%2"
176 : "=a"(prev)
177 : "q"(new), "m"(*__xg(ptr)), "0"(old)
178 : "memory");
179 return prev;
180 case 2:
181 asm volatile("lock; cmpxchgw %w1,%2"
182 : "=a"(prev)
183 : "r"(new), "m"(*__xg(ptr)), "0"(old)
184 : "memory");
185 return prev;
186 case 4:
187 asm volatile("lock; cmpxchgl %1,%2"
188 : "=a"(prev)
189 : "r"(new), "m"(*__xg(ptr)), "0"(old)
190 : "memory");
191 return prev;
192 }
193 return old;
194}
195
196static inline unsigned long __cmpxchg_local(volatile void *ptr,
197 unsigned long old,
198 unsigned long new, int size)
199{
200 unsigned long prev;
201 switch (size) {
202 case 1:
203 asm volatile("cmpxchgb %b1,%2"
204 : "=a"(prev)
205 : "q"(new), "m"(*__xg(ptr)), "0"(old)
206 : "memory");
207 return prev;
208 case 2:
209 asm volatile("cmpxchgw %w1,%2"
210 : "=a"(prev)
211 : "r"(new), "m"(*__xg(ptr)), "0"(old)
212 : "memory");
213 return prev;
214 case 4:
215 asm volatile("cmpxchgl %1,%2"
216 : "=a"(prev)
217 : "r"(new), "m"(*__xg(ptr)), "0"(old)
218 : "memory");
219 return prev;
220 }
221 return old;
222}
223
224static inline unsigned long long __cmpxchg64(volatile void *ptr, 178static inline unsigned long long __cmpxchg64(volatile void *ptr,
225 unsigned long long old, 179 unsigned long long old,
226 unsigned long long new) 180 unsigned long long new)
diff --git a/arch/x86/include/asm/cmpxchg_64.h b/arch/x86/include/asm/cmpxchg_64.h
index 52de72e0de8c..485ae415faec 100644
--- a/arch/x86/include/asm/cmpxchg_64.h
+++ b/arch/x86/include/asm/cmpxchg_64.h
@@ -3,9 +3,6 @@
3 3
4#include <asm/alternative.h> /* Provides LOCK_PREFIX */ 4#include <asm/alternative.h> /* Provides LOCK_PREFIX */
5 5
6#define xchg(ptr, v) ((__typeof__(*(ptr)))__xchg((unsigned long)(v), \
7 (ptr), sizeof(*(ptr))))
8
9#define __xg(x) ((volatile long *)(x)) 6#define __xg(x) ((volatile long *)(x))
10 7
11static inline void set_64bit(volatile unsigned long *ptr, unsigned long val) 8static inline void set_64bit(volatile unsigned long *ptr, unsigned long val)
@@ -15,167 +12,118 @@ static inline void set_64bit(volatile unsigned long *ptr, unsigned long val)
15 12
16#define _set_64bit set_64bit 13#define _set_64bit set_64bit
17 14
15extern void __xchg_wrong_size(void);
16extern void __cmpxchg_wrong_size(void);
17
18/* 18/*
19 * Note: no "lock" prefix even on SMP: xchg always implies lock anyway 19 * Note: no "lock" prefix even on SMP: xchg always implies lock anyway
20 * Note 2: xchg has side effect, so that attribute volatile is necessary, 20 * Note 2: xchg has side effect, so that attribute volatile is necessary,
21 * but generally the primitive is invalid, *ptr is output argument. --ANK 21 * but generally the primitive is invalid, *ptr is output argument. --ANK
22 */ 22 */
23static inline unsigned long __xchg(unsigned long x, volatile void *ptr, 23#define __xchg(x, ptr, size) \
24 int size) 24({ \
25{ 25 __typeof(*(ptr)) __x = (x); \
26 switch (size) { 26 switch (size) { \
27 case 1: 27 case 1: \
28 asm volatile("xchgb %b0,%1" 28 asm volatile("xchgb %b0,%1" \
29 : "=q" (x) 29 : "=q" (__x) \
30 : "m" (*__xg(ptr)), "0" (x) 30 : "m" (*__xg(ptr)), "0" (__x) \
31 : "memory"); 31 : "memory"); \
32 break; 32 break; \
33 case 2: 33 case 2: \
34 asm volatile("xchgw %w0,%1" 34 asm volatile("xchgw %w0,%1" \
35 : "=r" (x) 35 : "=r" (__x) \
36 : "m" (*__xg(ptr)), "0" (x) 36 : "m" (*__xg(ptr)), "0" (__x) \
37 : "memory"); 37 : "memory"); \
38 break; 38 break; \
39 case 4: 39 case 4: \
40 asm volatile("xchgl %k0,%1" 40 asm volatile("xchgl %k0,%1" \
41 : "=r" (x) 41 : "=r" (__x) \
42 : "m" (*__xg(ptr)), "0" (x) 42 : "m" (*__xg(ptr)), "0" (__x) \
43 : "memory"); 43 : "memory"); \
44 break; 44 break; \
45 case 8: 45 case 8: \
46 asm volatile("xchgq %0,%1" 46 asm volatile("xchgq %0,%1" \
47 : "=r" (x) 47 : "=r" (__x) \
48 : "m" (*__xg(ptr)), "0" (x) 48 : "m" (*__xg(ptr)), "0" (__x) \
49 : "memory"); 49 : "memory"); \
50 break; 50 break; \
51 } 51 default: \
52 return x; 52 __xchg_wrong_size(); \
53} 53 } \
54 __x; \
55})
56
57#define xchg(ptr, v) \
58 __xchg((v), (ptr), sizeof(*ptr))
59
60#define __HAVE_ARCH_CMPXCHG 1
54 61
55/* 62/*
56 * Atomic compare and exchange. Compare OLD with MEM, if identical, 63 * Atomic compare and exchange. Compare OLD with MEM, if identical,
57 * store NEW in MEM. Return the initial value in MEM. Success is 64 * store NEW in MEM. Return the initial value in MEM. Success is
58 * indicated by comparing RETURN with OLD. 65 * indicated by comparing RETURN with OLD.
59 */ 66 */
67#define __raw_cmpxchg(ptr, old, new, size, lock) \
68({ \
69 __typeof__(*(ptr)) __ret; \
70 __typeof__(*(ptr)) __old = (old); \
71 __typeof__(*(ptr)) __new = (new); \
72 switch (size) { \
73 case 1: \
74 asm volatile(lock "cmpxchgb %b1,%2" \
75 : "=a"(__ret) \
76 : "q"(__new), "m"(*__xg(ptr)), "0"(__old) \
77 : "memory"); \
78 break; \
79 case 2: \
80 asm volatile(lock "cmpxchgw %w1,%2" \
81 : "=a"(__ret) \
82 : "r"(__new), "m"(*__xg(ptr)), "0"(__old) \
83 : "memory"); \
84 break; \
85 case 4: \
86 asm volatile(lock "cmpxchgl %k1,%2" \
87 : "=a"(__ret) \
88 : "r"(__new), "m"(*__xg(ptr)), "0"(__old) \
89 : "memory"); \
90 break; \
91 case 8: \
92 asm volatile(lock "cmpxchgq %1,%2" \
93 : "=a"(__ret) \
94 : "r"(__new), "m"(*__xg(ptr)), "0"(__old) \
95 : "memory"); \
96 break; \
97 default: \
98 __cmpxchg_wrong_size(); \
99 } \
100 __ret; \
101})
60 102
61#define __HAVE_ARCH_CMPXCHG 1 103#define __cmpxchg(ptr, old, new, size) \
104 __raw_cmpxchg((ptr), (old), (new), (size), LOCK_PREFIX)
62 105
63static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old, 106#define __sync_cmpxchg(ptr, old, new, size) \
64 unsigned long new, int size) 107 __raw_cmpxchg((ptr), (old), (new), (size), "lock; ")
65{
66 unsigned long prev;
67 switch (size) {
68 case 1:
69 asm volatile(LOCK_PREFIX "cmpxchgb %b1,%2"
70 : "=a"(prev)
71 : "q"(new), "m"(*__xg(ptr)), "0"(old)
72 : "memory");
73 return prev;
74 case 2:
75 asm volatile(LOCK_PREFIX "cmpxchgw %w1,%2"
76 : "=a"(prev)
77 : "r"(new), "m"(*__xg(ptr)), "0"(old)
78 : "memory");
79 return prev;
80 case 4:
81 asm volatile(LOCK_PREFIX "cmpxchgl %k1,%2"
82 : "=a"(prev)
83 : "r"(new), "m"(*__xg(ptr)), "0"(old)
84 : "memory");
85 return prev;
86 case 8:
87 asm volatile(LOCK_PREFIX "cmpxchgq %1,%2"
88 : "=a"(prev)
89 : "r"(new), "m"(*__xg(ptr)), "0"(old)
90 : "memory");
91 return prev;
92 }
93 return old;
94}
95 108
96/* 109#define __cmpxchg_local(ptr, old, new, size) \
97 * Always use locked operations when touching memory shared with a 110 __raw_cmpxchg((ptr), (old), (new), (size), "")
98 * hypervisor, since the system may be SMP even if the guest kernel
99 * isn't.
100 */
101static inline unsigned long __sync_cmpxchg(volatile void *ptr,
102 unsigned long old,
103 unsigned long new, int size)
104{
105 unsigned long prev;
106 switch (size) {
107 case 1:
108 asm volatile("lock; cmpxchgb %b1,%2"
109 : "=a"(prev)
110 : "q"(new), "m"(*__xg(ptr)), "0"(old)
111 : "memory");
112 return prev;
113 case 2:
114 asm volatile("lock; cmpxchgw %w1,%2"
115 : "=a"(prev)
116 : "r"(new), "m"(*__xg(ptr)), "0"(old)
117 : "memory");
118 return prev;
119 case 4:
120 asm volatile("lock; cmpxchgl %1,%2"
121 : "=a"(prev)
122 : "r"(new), "m"(*__xg(ptr)), "0"(old)
123 : "memory");
124 return prev;
125 }
126 return old;
127}
128 111
129static inline unsigned long __cmpxchg_local(volatile void *ptr, 112#define cmpxchg(ptr, old, new) \
130 unsigned long old, 113 __cmpxchg((ptr), (old), (new), sizeof(*ptr))
131 unsigned long new, int size) 114
132{ 115#define sync_cmpxchg(ptr, old, new) \
133 unsigned long prev; 116 __sync_cmpxchg((ptr), (old), (new), sizeof(*ptr))
134 switch (size) { 117
135 case 1: 118#define cmpxchg_local(ptr, old, new) \
136 asm volatile("cmpxchgb %b1,%2" 119 __cmpxchg_local((ptr), (old), (new), sizeof(*ptr))
137 : "=a"(prev)
138 : "q"(new), "m"(*__xg(ptr)), "0"(old)
139 : "memory");
140 return prev;
141 case 2:
142 asm volatile("cmpxchgw %w1,%2"
143 : "=a"(prev)
144 : "r"(new), "m"(*__xg(ptr)), "0"(old)
145 : "memory");
146 return prev;
147 case 4:
148 asm volatile("cmpxchgl %k1,%2"
149 : "=a"(prev)
150 : "r"(new), "m"(*__xg(ptr)), "0"(old)
151 : "memory");
152 return prev;
153 case 8:
154 asm volatile("cmpxchgq %1,%2"
155 : "=a"(prev)
156 : "r"(new), "m"(*__xg(ptr)), "0"(old)
157 : "memory");
158 return prev;
159 }
160 return old;
161}
162 120
163#define cmpxchg(ptr, o, n) \
164 ((__typeof__(*(ptr)))__cmpxchg((ptr), (unsigned long)(o), \
165 (unsigned long)(n), sizeof(*(ptr))))
166#define cmpxchg64(ptr, o, n) \ 121#define cmpxchg64(ptr, o, n) \
167({ \ 122({ \
168 BUILD_BUG_ON(sizeof(*(ptr)) != 8); \ 123 BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
169 cmpxchg((ptr), (o), (n)); \ 124 cmpxchg((ptr), (o), (n)); \
170}) 125})
171#define cmpxchg_local(ptr, o, n) \ 126
172 ((__typeof__(*(ptr)))__cmpxchg_local((ptr), (unsigned long)(o), \
173 (unsigned long)(n), \
174 sizeof(*(ptr))))
175#define sync_cmpxchg(ptr, o, n) \
176 ((__typeof__(*(ptr)))__sync_cmpxchg((ptr), (unsigned long)(o), \
177 (unsigned long)(n), \
178 sizeof(*(ptr))))
179#define cmpxchg64_local(ptr, o, n) \ 127#define cmpxchg64_local(ptr, o, n) \
180({ \ 128({ \
181 BUILD_BUG_ON(sizeof(*(ptr)) != 8); \ 129 BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h
index 9cfc88b97742..613700f27a4a 100644
--- a/arch/x86/include/asm/cpufeature.h
+++ b/arch/x86/include/asm/cpufeature.h
@@ -248,6 +248,7 @@ extern const char * const x86_power_flags[32];
248#define cpu_has_x2apic boot_cpu_has(X86_FEATURE_X2APIC) 248#define cpu_has_x2apic boot_cpu_has(X86_FEATURE_X2APIC)
249#define cpu_has_xsave boot_cpu_has(X86_FEATURE_XSAVE) 249#define cpu_has_xsave boot_cpu_has(X86_FEATURE_XSAVE)
250#define cpu_has_hypervisor boot_cpu_has(X86_FEATURE_HYPERVISOR) 250#define cpu_has_hypervisor boot_cpu_has(X86_FEATURE_HYPERVISOR)
251#define cpu_has_pclmulqdq boot_cpu_has(X86_FEATURE_PCLMULQDQ)
251 252
252#if defined(CONFIG_X86_INVLPG) || defined(CONFIG_X86_64) 253#if defined(CONFIG_X86_INVLPG) || defined(CONFIG_X86_64)
253# define cpu_has_invlpg 1 254# define cpu_has_invlpg 1
diff --git a/arch/x86/include/asm/debugreg.h b/arch/x86/include/asm/debugreg.h
index 3ea6f37be9e2..8240f76b531e 100644
--- a/arch/x86/include/asm/debugreg.h
+++ b/arch/x86/include/asm/debugreg.h
@@ -18,6 +18,7 @@
18#define DR_TRAP1 (0x2) /* db1 */ 18#define DR_TRAP1 (0x2) /* db1 */
19#define DR_TRAP2 (0x4) /* db2 */ 19#define DR_TRAP2 (0x4) /* db2 */
20#define DR_TRAP3 (0x8) /* db3 */ 20#define DR_TRAP3 (0x8) /* db3 */
21#define DR_TRAP_BITS (DR_TRAP0|DR_TRAP1|DR_TRAP2|DR_TRAP3)
21 22
22#define DR_STEP (0x4000) /* single-step */ 23#define DR_STEP (0x4000) /* single-step */
23#define DR_SWITCH (0x8000) /* task switch */ 24#define DR_SWITCH (0x8000) /* task switch */
@@ -49,6 +50,8 @@
49 50
50#define DR_LOCAL_ENABLE_SHIFT 0 /* Extra shift to the local enable bit */ 51#define DR_LOCAL_ENABLE_SHIFT 0 /* Extra shift to the local enable bit */
51#define DR_GLOBAL_ENABLE_SHIFT 1 /* Extra shift to the global enable bit */ 52#define DR_GLOBAL_ENABLE_SHIFT 1 /* Extra shift to the global enable bit */
53#define DR_LOCAL_ENABLE (0x1) /* Local enable for reg 0 */
54#define DR_GLOBAL_ENABLE (0x2) /* Global enable for reg 0 */
52#define DR_ENABLE_SIZE 2 /* 2 enable bits per register */ 55#define DR_ENABLE_SIZE 2 /* 2 enable bits per register */
53 56
54#define DR_LOCAL_ENABLE_MASK (0x55) /* Set local bits for all 4 regs */ 57#define DR_LOCAL_ENABLE_MASK (0x55) /* Set local bits for all 4 regs */
@@ -67,4 +70,34 @@
67#define DR_LOCAL_SLOWDOWN (0x100) /* Local slow the pipeline */ 70#define DR_LOCAL_SLOWDOWN (0x100) /* Local slow the pipeline */
68#define DR_GLOBAL_SLOWDOWN (0x200) /* Global slow the pipeline */ 71#define DR_GLOBAL_SLOWDOWN (0x200) /* Global slow the pipeline */
69 72
73/*
74 * HW breakpoint additions
75 */
76#ifdef __KERNEL__
77
78DECLARE_PER_CPU(unsigned long, cpu_dr7);
79
80static inline void hw_breakpoint_disable(void)
81{
82 /* Zero the control register for HW Breakpoint */
83 set_debugreg(0UL, 7);
84
85 /* Zero-out the individual HW breakpoint address registers */
86 set_debugreg(0UL, 0);
87 set_debugreg(0UL, 1);
88 set_debugreg(0UL, 2);
89 set_debugreg(0UL, 3);
90}
91
92static inline int hw_breakpoint_active(void)
93{
94 return __get_cpu_var(cpu_dr7) & DR_GLOBAL_ENABLE_MASK;
95}
96
97extern void aout_dump_debugregs(struct user *dump);
98
99extern void hw_breakpoint_restore(void);
100
101#endif /* __KERNEL__ */
102
70#endif /* _ASM_X86_DEBUGREG_H */ 103#endif /* _ASM_X86_DEBUGREG_H */
diff --git a/arch/x86/include/asm/device.h b/arch/x86/include/asm/device.h
index cee34e9ca45b..029f230ab637 100644
--- a/arch/x86/include/asm/device.h
+++ b/arch/x86/include/asm/device.h
@@ -8,7 +8,7 @@ struct dev_archdata {
8#ifdef CONFIG_X86_64 8#ifdef CONFIG_X86_64
9struct dma_map_ops *dma_ops; 9struct dma_map_ops *dma_ops;
10#endif 10#endif
11#ifdef CONFIG_DMAR 11#if defined(CONFIG_DMAR) || defined(CONFIG_AMD_IOMMU)
12 void *iommu; /* hook for IOMMU specific extension */ 12 void *iommu; /* hook for IOMMU specific extension */
13#endif 13#endif
14}; 14};
diff --git a/arch/x86/include/asm/dma-mapping.h b/arch/x86/include/asm/dma-mapping.h
index 6a25d5d42836..0f6c02f3b7d4 100644
--- a/arch/x86/include/asm/dma-mapping.h
+++ b/arch/x86/include/asm/dma-mapping.h
@@ -20,7 +20,8 @@
20# define ISA_DMA_BIT_MASK DMA_BIT_MASK(32) 20# define ISA_DMA_BIT_MASK DMA_BIT_MASK(32)
21#endif 21#endif
22 22
23extern dma_addr_t bad_dma_address; 23#define DMA_ERROR_CODE 0
24
24extern int iommu_merge; 25extern int iommu_merge;
25extern struct device x86_dma_fallback_dev; 26extern struct device x86_dma_fallback_dev;
26extern int panic_on_overflow; 27extern int panic_on_overflow;
@@ -48,7 +49,7 @@ static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
48 if (ops->mapping_error) 49 if (ops->mapping_error)
49 return ops->mapping_error(dev, dma_addr); 50 return ops->mapping_error(dev, dma_addr);
50 51
51 return (dma_addr == bad_dma_address); 52 return (dma_addr == DMA_ERROR_CODE);
52} 53}
53 54
54#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) 55#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
diff --git a/arch/x86/include/asm/e820.h b/arch/x86/include/asm/e820.h
index 40b4e614fe71..761249e396fe 100644
--- a/arch/x86/include/asm/e820.h
+++ b/arch/x86/include/asm/e820.h
@@ -61,6 +61,12 @@ struct e820map {
61 struct e820entry map[E820_X_MAX]; 61 struct e820entry map[E820_X_MAX];
62}; 62};
63 63
64#define ISA_START_ADDRESS 0xa0000
65#define ISA_END_ADDRESS 0x100000
66
67#define BIOS_BEGIN 0x000a0000
68#define BIOS_END 0x00100000
69
64#ifdef __KERNEL__ 70#ifdef __KERNEL__
65/* see comment in arch/x86/kernel/e820.c */ 71/* see comment in arch/x86/kernel/e820.c */
66extern struct e820map e820; 72extern struct e820map e820;
@@ -126,15 +132,18 @@ extern void e820_reserve_resources(void);
126extern void e820_reserve_resources_late(void); 132extern void e820_reserve_resources_late(void);
127extern void setup_memory_map(void); 133extern void setup_memory_map(void);
128extern char *default_machine_specific_memory_setup(void); 134extern char *default_machine_specific_memory_setup(void);
129#endif /* __KERNEL__ */
130#endif /* __ASSEMBLY__ */
131 135
132#define ISA_START_ADDRESS 0xa0000 136/*
133#define ISA_END_ADDRESS 0x100000 137 * Returns true iff the specified range [s,e) is completely contained inside
134#define is_ISA_range(s, e) ((s) >= ISA_START_ADDRESS && (e) < ISA_END_ADDRESS) 138 * the ISA region.
139 */
140static inline bool is_ISA_range(u64 s, u64 e)
141{
142 return s >= ISA_START_ADDRESS && e <= ISA_END_ADDRESS;
143}
135 144
136#define BIOS_BEGIN 0x000a0000 145#endif /* __KERNEL__ */
137#define BIOS_END 0x00100000 146#endif /* __ASSEMBLY__ */
138 147
139#ifdef __KERNEL__ 148#ifdef __KERNEL__
140#include <linux/ioport.h> 149#include <linux/ioport.h>
diff --git a/arch/x86/include/asm/elf.h b/arch/x86/include/asm/elf.h
index 456a304b8172..8a024babe5e6 100644
--- a/arch/x86/include/asm/elf.h
+++ b/arch/x86/include/asm/elf.h
@@ -157,19 +157,6 @@ do { \
157 157
158#define compat_elf_check_arch(x) elf_check_arch_ia32(x) 158#define compat_elf_check_arch(x) elf_check_arch_ia32(x)
159 159
160static inline void start_ia32_thread(struct pt_regs *regs, u32 ip, u32 sp)
161{
162 loadsegment(fs, 0);
163 loadsegment(ds, __USER32_DS);
164 loadsegment(es, __USER32_DS);
165 load_gs_index(0);
166 regs->ip = ip;
167 regs->sp = sp;
168 regs->flags = X86_EFLAGS_IF;
169 regs->cs = __USER32_CS;
170 regs->ss = __USER32_DS;
171}
172
173static inline void elf_common_init(struct thread_struct *t, 160static inline void elf_common_init(struct thread_struct *t,
174 struct pt_regs *regs, const u16 ds) 161 struct pt_regs *regs, const u16 ds)
175{ 162{
@@ -191,11 +178,8 @@ do { \
191#define COMPAT_ELF_PLAT_INIT(regs, load_addr) \ 178#define COMPAT_ELF_PLAT_INIT(regs, load_addr) \
192 elf_common_init(&current->thread, regs, __USER_DS) 179 elf_common_init(&current->thread, regs, __USER_DS)
193 180
194#define compat_start_thread(regs, ip, sp) \ 181void start_thread_ia32(struct pt_regs *regs, u32 new_ip, u32 new_sp);
195do { \ 182#define compat_start_thread start_thread_ia32
196 start_ia32_thread(regs, ip, sp); \
197 set_fs(USER_DS); \
198} while (0)
199 183
200#define COMPAT_SET_PERSONALITY(ex) \ 184#define COMPAT_SET_PERSONALITY(ex) \
201do { \ 185do { \
diff --git a/arch/x86/include/asm/entry_arch.h b/arch/x86/include/asm/entry_arch.h
index f5693c81a1db..8e8ec663a98f 100644
--- a/arch/x86/include/asm/entry_arch.h
+++ b/arch/x86/include/asm/entry_arch.h
@@ -34,7 +34,7 @@ BUILD_INTERRUPT3(invalidate_interrupt7,INVALIDATE_TLB_VECTOR_START+7,
34 smp_invalidate_interrupt) 34 smp_invalidate_interrupt)
35#endif 35#endif
36 36
37BUILD_INTERRUPT(generic_interrupt, GENERIC_INTERRUPT_VECTOR) 37BUILD_INTERRUPT(x86_platform_ipi, X86_PLATFORM_IPI_VECTOR)
38 38
39/* 39/*
40 * every pentium local APIC has two 'local interrupts', with a 40 * every pentium local APIC has two 'local interrupts', with a
diff --git a/arch/x86/include/asm/gart.h b/arch/x86/include/asm/gart.h
index 6cfdafa409d8..4ac5b0f33fc1 100644
--- a/arch/x86/include/asm/gart.h
+++ b/arch/x86/include/asm/gart.h
@@ -35,8 +35,7 @@ extern int gart_iommu_aperture_allowed;
35extern int gart_iommu_aperture_disabled; 35extern int gart_iommu_aperture_disabled;
36 36
37extern void early_gart_iommu_check(void); 37extern void early_gart_iommu_check(void);
38extern void gart_iommu_init(void); 38extern int gart_iommu_init(void);
39extern void gart_iommu_shutdown(void);
40extern void __init gart_parse_options(char *); 39extern void __init gart_parse_options(char *);
41extern void gart_iommu_hole_init(void); 40extern void gart_iommu_hole_init(void);
42 41
@@ -48,12 +47,6 @@ extern void gart_iommu_hole_init(void);
48static inline void early_gart_iommu_check(void) 47static inline void early_gart_iommu_check(void)
49{ 48{
50} 49}
51static inline void gart_iommu_init(void)
52{
53}
54static inline void gart_iommu_shutdown(void)
55{
56}
57static inline void gart_parse_options(char *options) 50static inline void gart_parse_options(char *options)
58{ 51{
59} 52}
diff --git a/arch/x86/include/asm/hardirq.h b/arch/x86/include/asm/hardirq.h
index 82e3e8f01043..0f8576427cfe 100644
--- a/arch/x86/include/asm/hardirq.h
+++ b/arch/x86/include/asm/hardirq.h
@@ -12,7 +12,7 @@ typedef struct {
12 unsigned int apic_timer_irqs; /* arch dependent */ 12 unsigned int apic_timer_irqs; /* arch dependent */
13 unsigned int irq_spurious_count; 13 unsigned int irq_spurious_count;
14#endif 14#endif
15 unsigned int generic_irqs; /* arch dependent */ 15 unsigned int x86_platform_ipis; /* arch dependent */
16 unsigned int apic_perf_irqs; 16 unsigned int apic_perf_irqs;
17 unsigned int apic_pending_irqs; 17 unsigned int apic_pending_irqs;
18#ifdef CONFIG_SMP 18#ifdef CONFIG_SMP
@@ -20,11 +20,11 @@ typedef struct {
20 unsigned int irq_call_count; 20 unsigned int irq_call_count;
21 unsigned int irq_tlb_count; 21 unsigned int irq_tlb_count;
22#endif 22#endif
23#ifdef CONFIG_X86_MCE 23#ifdef CONFIG_X86_THERMAL_VECTOR
24 unsigned int irq_thermal_count; 24 unsigned int irq_thermal_count;
25# ifdef CONFIG_X86_MCE_THRESHOLD 25#endif
26#ifdef CONFIG_X86_MCE_THRESHOLD
26 unsigned int irq_threshold_count; 27 unsigned int irq_threshold_count;
27# endif
28#endif 28#endif
29} ____cacheline_aligned irq_cpustat_t; 29} ____cacheline_aligned irq_cpustat_t;
30 30
diff --git a/arch/x86/include/asm/hpet.h b/arch/x86/include/asm/hpet.h
index 1c22cb05ad6a..5d89fd2a3690 100644
--- a/arch/x86/include/asm/hpet.h
+++ b/arch/x86/include/asm/hpet.h
@@ -65,11 +65,12 @@
65/* hpet memory map physical address */ 65/* hpet memory map physical address */
66extern unsigned long hpet_address; 66extern unsigned long hpet_address;
67extern unsigned long force_hpet_address; 67extern unsigned long force_hpet_address;
68extern u8 hpet_blockid;
68extern int hpet_force_user; 69extern int hpet_force_user;
69extern int is_hpet_enabled(void); 70extern int is_hpet_enabled(void);
70extern int hpet_enable(void); 71extern int hpet_enable(void);
71extern void hpet_disable(void); 72extern void hpet_disable(void);
72extern unsigned long hpet_readl(unsigned long a); 73extern unsigned int hpet_readl(unsigned int a);
73extern void force_hpet_resume(void); 74extern void force_hpet_resume(void);
74 75
75extern void hpet_msi_unmask(unsigned int irq); 76extern void hpet_msi_unmask(unsigned int irq);
@@ -78,9 +79,9 @@ extern void hpet_msi_write(unsigned int irq, struct msi_msg *msg);
78extern void hpet_msi_read(unsigned int irq, struct msi_msg *msg); 79extern void hpet_msi_read(unsigned int irq, struct msi_msg *msg);
79 80
80#ifdef CONFIG_PCI_MSI 81#ifdef CONFIG_PCI_MSI
81extern int arch_setup_hpet_msi(unsigned int irq); 82extern int arch_setup_hpet_msi(unsigned int irq, unsigned int id);
82#else 83#else
83static inline int arch_setup_hpet_msi(unsigned int irq) 84static inline int arch_setup_hpet_msi(unsigned int irq, unsigned int id)
84{ 85{
85 return -EINVAL; 86 return -EINVAL;
86} 87}
diff --git a/arch/x86/include/asm/hw_breakpoint.h b/arch/x86/include/asm/hw_breakpoint.h
new file mode 100644
index 000000000000..0675a7c4c20e
--- /dev/null
+++ b/arch/x86/include/asm/hw_breakpoint.h
@@ -0,0 +1,73 @@
1#ifndef _I386_HW_BREAKPOINT_H
2#define _I386_HW_BREAKPOINT_H
3
4#ifdef __KERNEL__
5#define __ARCH_HW_BREAKPOINT_H
6
7/*
8 * The name should probably be something dealt in
9 * a higher level. While dealing with the user
10 * (display/resolving)
11 */
12struct arch_hw_breakpoint {
13 char *name; /* Contains name of the symbol to set bkpt */
14 unsigned long address;
15 u8 len;
16 u8 type;
17};
18
19#include <linux/kdebug.h>
20#include <linux/percpu.h>
21#include <linux/list.h>
22
23/* Available HW breakpoint length encodings */
24#define X86_BREAKPOINT_LEN_1 0x40
25#define X86_BREAKPOINT_LEN_2 0x44
26#define X86_BREAKPOINT_LEN_4 0x4c
27#define X86_BREAKPOINT_LEN_EXECUTE 0x40
28
29#ifdef CONFIG_X86_64
30#define X86_BREAKPOINT_LEN_8 0x48
31#endif
32
33/* Available HW breakpoint type encodings */
34
35/* trigger on instruction execute */
36#define X86_BREAKPOINT_EXECUTE 0x80
37/* trigger on memory write */
38#define X86_BREAKPOINT_WRITE 0x81
39/* trigger on memory read or write */
40#define X86_BREAKPOINT_RW 0x83
41
42/* Total number of available HW breakpoint registers */
43#define HBP_NUM 4
44
45struct perf_event;
46struct pmu;
47
48extern int arch_check_va_in_userspace(unsigned long va, u8 hbp_len);
49extern int arch_validate_hwbkpt_settings(struct perf_event *bp,
50 struct task_struct *tsk);
51extern int hw_breakpoint_exceptions_notify(struct notifier_block *unused,
52 unsigned long val, void *data);
53
54
55int arch_install_hw_breakpoint(struct perf_event *bp);
56void arch_uninstall_hw_breakpoint(struct perf_event *bp);
57void hw_breakpoint_pmu_read(struct perf_event *bp);
58void hw_breakpoint_pmu_unthrottle(struct perf_event *bp);
59
60extern void
61arch_fill_perf_breakpoint(struct perf_event *bp);
62
63unsigned long encode_dr7(int drnum, unsigned int len, unsigned int type);
64int decode_dr7(unsigned long dr7, int bpnum, unsigned *len, unsigned *type);
65
66extern int arch_bp_generic_fields(int x86_len, int x86_type,
67 int *gen_len, int *gen_type);
68
69extern struct pmu perf_ops_bp;
70
71#endif /* __KERNEL__ */
72#endif /* _I386_HW_BREAKPOINT_H */
73
diff --git a/arch/x86/include/asm/hw_irq.h b/arch/x86/include/asm/hw_irq.h
index ba180d93b08c..08c48a81841f 100644
--- a/arch/x86/include/asm/hw_irq.h
+++ b/arch/x86/include/asm/hw_irq.h
@@ -27,7 +27,7 @@
27 27
28/* Interrupt handlers registered during init_IRQ */ 28/* Interrupt handlers registered during init_IRQ */
29extern void apic_timer_interrupt(void); 29extern void apic_timer_interrupt(void);
30extern void generic_interrupt(void); 30extern void x86_platform_ipi(void);
31extern void error_interrupt(void); 31extern void error_interrupt(void);
32extern void perf_pending_interrupt(void); 32extern void perf_pending_interrupt(void);
33 33
@@ -79,14 +79,32 @@ static inline void set_io_apic_irq_attr(struct io_apic_irq_attr *irq_attr,
79 int ioapic, int ioapic_pin, 79 int ioapic, int ioapic_pin,
80 int trigger, int polarity) 80 int trigger, int polarity)
81{ 81{
82 irq_attr->ioapic = ioapic; 82 irq_attr->ioapic = ioapic;
83 irq_attr->ioapic_pin = ioapic_pin; 83 irq_attr->ioapic_pin = ioapic_pin;
84 irq_attr->trigger = trigger; 84 irq_attr->trigger = trigger;
85 irq_attr->polarity = polarity; 85 irq_attr->polarity = polarity;
86} 86}
87 87
88extern int IO_APIC_get_PCI_irq_vector(int bus, int devfn, int pin, 88/*
89 struct io_apic_irq_attr *irq_attr); 89 * This is performance-critical, we want to do it O(1)
90 *
91 * Most irqs are mapped 1:1 with pins.
92 */
93struct irq_cfg {
94 struct irq_pin_list *irq_2_pin;
95 cpumask_var_t domain;
96 cpumask_var_t old_domain;
97 u8 vector;
98 u8 move_in_progress : 1;
99};
100
101extern struct irq_cfg *irq_cfg(unsigned int);
102extern int assign_irq_vector(int, struct irq_cfg *, const struct cpumask *);
103extern void send_cleanup_vector(struct irq_cfg *);
104
105struct irq_desc;
106extern unsigned int set_desc_affinity(struct irq_desc *, const struct cpumask *);
107extern int IO_APIC_get_PCI_irq_vector(int bus, int devfn, int pin, struct io_apic_irq_attr *irq_attr);
90extern void setup_ioapic_dest(void); 108extern void setup_ioapic_dest(void);
91 109
92extern void enable_IO_APIC(void); 110extern void enable_IO_APIC(void);
@@ -101,7 +119,7 @@ extern void eisa_set_level_irq(unsigned int irq);
101/* SMP */ 119/* SMP */
102extern void smp_apic_timer_interrupt(struct pt_regs *); 120extern void smp_apic_timer_interrupt(struct pt_regs *);
103extern void smp_spurious_interrupt(struct pt_regs *); 121extern void smp_spurious_interrupt(struct pt_regs *);
104extern void smp_generic_interrupt(struct pt_regs *); 122extern void smp_x86_platform_ipi(struct pt_regs *);
105extern void smp_error_interrupt(struct pt_regs *); 123extern void smp_error_interrupt(struct pt_regs *);
106#ifdef CONFIG_X86_IO_APIC 124#ifdef CONFIG_X86_IO_APIC
107extern asmlinkage void smp_irq_move_cleanup_interrupt(void); 125extern asmlinkage void smp_irq_move_cleanup_interrupt(void);
diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h
index 0b20bbb758f2..ebfb8a9e11f7 100644
--- a/arch/x86/include/asm/i387.h
+++ b/arch/x86/include/asm/i387.h
@@ -10,6 +10,8 @@
10#ifndef _ASM_X86_I387_H 10#ifndef _ASM_X86_I387_H
11#define _ASM_X86_I387_H 11#define _ASM_X86_I387_H
12 12
13#ifndef __ASSEMBLY__
14
13#include <linux/sched.h> 15#include <linux/sched.h>
14#include <linux/kernel_stat.h> 16#include <linux/kernel_stat.h>
15#include <linux/regset.h> 17#include <linux/regset.h>
@@ -411,4 +413,9 @@ static inline unsigned short get_fpu_mxcsr(struct task_struct *tsk)
411 } 413 }
412} 414}
413 415
416#endif /* __ASSEMBLY__ */
417
418#define PSHUFB_XMM5_XMM0 .byte 0x66, 0x0f, 0x38, 0x00, 0xc5
419#define PSHUFB_XMM5_XMM6 .byte 0x66, 0x0f, 0x38, 0x00, 0xf5
420
414#endif /* _ASM_X86_I387_H */ 421#endif /* _ASM_X86_I387_H */
diff --git a/arch/x86/include/asm/inat.h b/arch/x86/include/asm/inat.h
new file mode 100644
index 000000000000..205b063e3e32
--- /dev/null
+++ b/arch/x86/include/asm/inat.h
@@ -0,0 +1,220 @@
1#ifndef _ASM_X86_INAT_H
2#define _ASM_X86_INAT_H
3/*
4 * x86 instruction attributes
5 *
6 * Written by Masami Hiramatsu <mhiramat@redhat.com>
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 as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 *
22 */
23#include <asm/inat_types.h>
24
25/*
26 * Internal bits. Don't use bitmasks directly, because these bits are
27 * unstable. You should use checking functions.
28 */
29
30#define INAT_OPCODE_TABLE_SIZE 256
31#define INAT_GROUP_TABLE_SIZE 8
32
33/* Legacy last prefixes */
34#define INAT_PFX_OPNDSZ 1 /* 0x66 */ /* LPFX1 */
35#define INAT_PFX_REPE 2 /* 0xF3 */ /* LPFX2 */
36#define INAT_PFX_REPNE 3 /* 0xF2 */ /* LPFX3 */
37/* Other Legacy prefixes */
38#define INAT_PFX_LOCK 4 /* 0xF0 */
39#define INAT_PFX_CS 5 /* 0x2E */
40#define INAT_PFX_DS 6 /* 0x3E */
41#define INAT_PFX_ES 7 /* 0x26 */
42#define INAT_PFX_FS 8 /* 0x64 */
43#define INAT_PFX_GS 9 /* 0x65 */
44#define INAT_PFX_SS 10 /* 0x36 */
45#define INAT_PFX_ADDRSZ 11 /* 0x67 */
46/* x86-64 REX prefix */
47#define INAT_PFX_REX 12 /* 0x4X */
48/* AVX VEX prefixes */
49#define INAT_PFX_VEX2 13 /* 2-bytes VEX prefix */
50#define INAT_PFX_VEX3 14 /* 3-bytes VEX prefix */
51
52#define INAT_LSTPFX_MAX 3
53#define INAT_LGCPFX_MAX 11
54
55/* Immediate size */
56#define INAT_IMM_BYTE 1
57#define INAT_IMM_WORD 2
58#define INAT_IMM_DWORD 3
59#define INAT_IMM_QWORD 4
60#define INAT_IMM_PTR 5
61#define INAT_IMM_VWORD32 6
62#define INAT_IMM_VWORD 7
63
64/* Legacy prefix */
65#define INAT_PFX_OFFS 0
66#define INAT_PFX_BITS 4
67#define INAT_PFX_MAX ((1 << INAT_PFX_BITS) - 1)
68#define INAT_PFX_MASK (INAT_PFX_MAX << INAT_PFX_OFFS)
69/* Escape opcodes */
70#define INAT_ESC_OFFS (INAT_PFX_OFFS + INAT_PFX_BITS)
71#define INAT_ESC_BITS 2
72#define INAT_ESC_MAX ((1 << INAT_ESC_BITS) - 1)
73#define INAT_ESC_MASK (INAT_ESC_MAX << INAT_ESC_OFFS)
74/* Group opcodes (1-16) */
75#define INAT_GRP_OFFS (INAT_ESC_OFFS + INAT_ESC_BITS)
76#define INAT_GRP_BITS 5
77#define INAT_GRP_MAX ((1 << INAT_GRP_BITS) - 1)
78#define INAT_GRP_MASK (INAT_GRP_MAX << INAT_GRP_OFFS)
79/* Immediates */
80#define INAT_IMM_OFFS (INAT_GRP_OFFS + INAT_GRP_BITS)
81#define INAT_IMM_BITS 3
82#define INAT_IMM_MASK (((1 << INAT_IMM_BITS) - 1) << INAT_IMM_OFFS)
83/* Flags */
84#define INAT_FLAG_OFFS (INAT_IMM_OFFS + INAT_IMM_BITS)
85#define INAT_MODRM (1 << (INAT_FLAG_OFFS))
86#define INAT_FORCE64 (1 << (INAT_FLAG_OFFS + 1))
87#define INAT_SCNDIMM (1 << (INAT_FLAG_OFFS + 2))
88#define INAT_MOFFSET (1 << (INAT_FLAG_OFFS + 3))
89#define INAT_VARIANT (1 << (INAT_FLAG_OFFS + 4))
90#define INAT_VEXOK (1 << (INAT_FLAG_OFFS + 5))
91#define INAT_VEXONLY (1 << (INAT_FLAG_OFFS + 6))
92/* Attribute making macros for attribute tables */
93#define INAT_MAKE_PREFIX(pfx) (pfx << INAT_PFX_OFFS)
94#define INAT_MAKE_ESCAPE(esc) (esc << INAT_ESC_OFFS)
95#define INAT_MAKE_GROUP(grp) ((grp << INAT_GRP_OFFS) | INAT_MODRM)
96#define INAT_MAKE_IMM(imm) (imm << INAT_IMM_OFFS)
97
98/* Attribute search APIs */
99extern insn_attr_t inat_get_opcode_attribute(insn_byte_t opcode);
100extern insn_attr_t inat_get_escape_attribute(insn_byte_t opcode,
101 insn_byte_t last_pfx,
102 insn_attr_t esc_attr);
103extern insn_attr_t inat_get_group_attribute(insn_byte_t modrm,
104 insn_byte_t last_pfx,
105 insn_attr_t esc_attr);
106extern insn_attr_t inat_get_avx_attribute(insn_byte_t opcode,
107 insn_byte_t vex_m,
108 insn_byte_t vex_pp);
109
110/* Attribute checking functions */
111static inline int inat_is_legacy_prefix(insn_attr_t attr)
112{
113 attr &= INAT_PFX_MASK;
114 return attr && attr <= INAT_LGCPFX_MAX;
115}
116
117static inline int inat_is_address_size_prefix(insn_attr_t attr)
118{
119 return (attr & INAT_PFX_MASK) == INAT_PFX_ADDRSZ;
120}
121
122static inline int inat_is_operand_size_prefix(insn_attr_t attr)
123{
124 return (attr & INAT_PFX_MASK) == INAT_PFX_OPNDSZ;
125}
126
127static inline int inat_is_rex_prefix(insn_attr_t attr)
128{
129 return (attr & INAT_PFX_MASK) == INAT_PFX_REX;
130}
131
132static inline int inat_last_prefix_id(insn_attr_t attr)
133{
134 if ((attr & INAT_PFX_MASK) > INAT_LSTPFX_MAX)
135 return 0;
136 else
137 return attr & INAT_PFX_MASK;
138}
139
140static inline int inat_is_vex_prefix(insn_attr_t attr)
141{
142 attr &= INAT_PFX_MASK;
143 return attr == INAT_PFX_VEX2 || attr == INAT_PFX_VEX3;
144}
145
146static inline int inat_is_vex3_prefix(insn_attr_t attr)
147{
148 return (attr & INAT_PFX_MASK) == INAT_PFX_VEX3;
149}
150
151static inline int inat_is_escape(insn_attr_t attr)
152{
153 return attr & INAT_ESC_MASK;
154}
155
156static inline int inat_escape_id(insn_attr_t attr)
157{
158 return (attr & INAT_ESC_MASK) >> INAT_ESC_OFFS;
159}
160
161static inline int inat_is_group(insn_attr_t attr)
162{
163 return attr & INAT_GRP_MASK;
164}
165
166static inline int inat_group_id(insn_attr_t attr)
167{
168 return (attr & INAT_GRP_MASK) >> INAT_GRP_OFFS;
169}
170
171static inline int inat_group_common_attribute(insn_attr_t attr)
172{
173 return attr & ~INAT_GRP_MASK;
174}
175
176static inline int inat_has_immediate(insn_attr_t attr)
177{
178 return attr & INAT_IMM_MASK;
179}
180
181static inline int inat_immediate_size(insn_attr_t attr)
182{
183 return (attr & INAT_IMM_MASK) >> INAT_IMM_OFFS;
184}
185
186static inline int inat_has_modrm(insn_attr_t attr)
187{
188 return attr & INAT_MODRM;
189}
190
191static inline int inat_is_force64(insn_attr_t attr)
192{
193 return attr & INAT_FORCE64;
194}
195
196static inline int inat_has_second_immediate(insn_attr_t attr)
197{
198 return attr & INAT_SCNDIMM;
199}
200
201static inline int inat_has_moffset(insn_attr_t attr)
202{
203 return attr & INAT_MOFFSET;
204}
205
206static inline int inat_has_variant(insn_attr_t attr)
207{
208 return attr & INAT_VARIANT;
209}
210
211static inline int inat_accept_vex(insn_attr_t attr)
212{
213 return attr & INAT_VEXOK;
214}
215
216static inline int inat_must_vex(insn_attr_t attr)
217{
218 return attr & INAT_VEXONLY;
219}
220#endif
diff --git a/arch/x86/include/asm/inat_types.h b/arch/x86/include/asm/inat_types.h
new file mode 100644
index 000000000000..cb3c20ce39cf
--- /dev/null
+++ b/arch/x86/include/asm/inat_types.h
@@ -0,0 +1,29 @@
1#ifndef _ASM_X86_INAT_TYPES_H
2#define _ASM_X86_INAT_TYPES_H
3/*
4 * x86 instruction attributes
5 *
6 * Written by Masami Hiramatsu <mhiramat@redhat.com>
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 as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 *
22 */
23
24/* Instruction attributes */
25typedef unsigned int insn_attr_t;
26typedef unsigned char insn_byte_t;
27typedef signed int insn_value_t;
28
29#endif
diff --git a/arch/x86/include/asm/insn.h b/arch/x86/include/asm/insn.h
new file mode 100644
index 000000000000..96c2e0ad04ca
--- /dev/null
+++ b/arch/x86/include/asm/insn.h
@@ -0,0 +1,184 @@
1#ifndef _ASM_X86_INSN_H
2#define _ASM_X86_INSN_H
3/*
4 * x86 instruction analysis
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 as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 *
20 * Copyright (C) IBM Corporation, 2009
21 */
22
23/* insn_attr_t is defined in inat.h */
24#include <asm/inat.h>
25
26struct insn_field {
27 union {
28 insn_value_t value;
29 insn_byte_t bytes[4];
30 };
31 /* !0 if we've run insn_get_xxx() for this field */
32 unsigned char got;
33 unsigned char nbytes;
34};
35
36struct insn {
37 struct insn_field prefixes; /*
38 * Prefixes
39 * prefixes.bytes[3]: last prefix
40 */
41 struct insn_field rex_prefix; /* REX prefix */
42 struct insn_field vex_prefix; /* VEX prefix */
43 struct insn_field opcode; /*
44 * opcode.bytes[0]: opcode1
45 * opcode.bytes[1]: opcode2
46 * opcode.bytes[2]: opcode3
47 */
48 struct insn_field modrm;
49 struct insn_field sib;
50 struct insn_field displacement;
51 union {
52 struct insn_field immediate;
53 struct insn_field moffset1; /* for 64bit MOV */
54 struct insn_field immediate1; /* for 64bit imm or off16/32 */
55 };
56 union {
57 struct insn_field moffset2; /* for 64bit MOV */
58 struct insn_field immediate2; /* for 64bit imm or seg16 */
59 };
60
61 insn_attr_t attr;
62 unsigned char opnd_bytes;
63 unsigned char addr_bytes;
64 unsigned char length;
65 unsigned char x86_64;
66
67 const insn_byte_t *kaddr; /* kernel address of insn to analyze */
68 const insn_byte_t *next_byte;
69};
70
71#define X86_MODRM_MOD(modrm) (((modrm) & 0xc0) >> 6)
72#define X86_MODRM_REG(modrm) (((modrm) & 0x38) >> 3)
73#define X86_MODRM_RM(modrm) ((modrm) & 0x07)
74
75#define X86_SIB_SCALE(sib) (((sib) & 0xc0) >> 6)
76#define X86_SIB_INDEX(sib) (((sib) & 0x38) >> 3)
77#define X86_SIB_BASE(sib) ((sib) & 0x07)
78
79#define X86_REX_W(rex) ((rex) & 8)
80#define X86_REX_R(rex) ((rex) & 4)
81#define X86_REX_X(rex) ((rex) & 2)
82#define X86_REX_B(rex) ((rex) & 1)
83
84/* VEX bit flags */
85#define X86_VEX_W(vex) ((vex) & 0x80) /* VEX3 Byte2 */
86#define X86_VEX_R(vex) ((vex) & 0x80) /* VEX2/3 Byte1 */
87#define X86_VEX_X(vex) ((vex) & 0x40) /* VEX3 Byte1 */
88#define X86_VEX_B(vex) ((vex) & 0x20) /* VEX3 Byte1 */
89#define X86_VEX_L(vex) ((vex) & 0x04) /* VEX3 Byte2, VEX2 Byte1 */
90/* VEX bit fields */
91#define X86_VEX3_M(vex) ((vex) & 0x1f) /* VEX3 Byte1 */
92#define X86_VEX2_M 1 /* VEX2.M always 1 */
93#define X86_VEX_V(vex) (((vex) & 0x78) >> 3) /* VEX3 Byte2, VEX2 Byte1 */
94#define X86_VEX_P(vex) ((vex) & 0x03) /* VEX3 Byte2, VEX2 Byte1 */
95#define X86_VEX_M_MAX 0x1f /* VEX3.M Maximum value */
96
97/* The last prefix is needed for two-byte and three-byte opcodes */
98static inline insn_byte_t insn_last_prefix(struct insn *insn)
99{
100 return insn->prefixes.bytes[3];
101}
102
103extern void insn_init(struct insn *insn, const void *kaddr, int x86_64);
104extern void insn_get_prefixes(struct insn *insn);
105extern void insn_get_opcode(struct insn *insn);
106extern void insn_get_modrm(struct insn *insn);
107extern void insn_get_sib(struct insn *insn);
108extern void insn_get_displacement(struct insn *insn);
109extern void insn_get_immediate(struct insn *insn);
110extern void insn_get_length(struct insn *insn);
111
112/* Attribute will be determined after getting ModRM (for opcode groups) */
113static inline void insn_get_attribute(struct insn *insn)
114{
115 insn_get_modrm(insn);
116}
117
118/* Instruction uses RIP-relative addressing */
119extern int insn_rip_relative(struct insn *insn);
120
121/* Init insn for kernel text */
122static inline void kernel_insn_init(struct insn *insn, const void *kaddr)
123{
124#ifdef CONFIG_X86_64
125 insn_init(insn, kaddr, 1);
126#else /* CONFIG_X86_32 */
127 insn_init(insn, kaddr, 0);
128#endif
129}
130
131static inline int insn_is_avx(struct insn *insn)
132{
133 if (!insn->prefixes.got)
134 insn_get_prefixes(insn);
135 return (insn->vex_prefix.value != 0);
136}
137
138static inline insn_byte_t insn_vex_m_bits(struct insn *insn)
139{
140 if (insn->vex_prefix.nbytes == 2) /* 2 bytes VEX */
141 return X86_VEX2_M;
142 else
143 return X86_VEX3_M(insn->vex_prefix.bytes[1]);
144}
145
146static inline insn_byte_t insn_vex_p_bits(struct insn *insn)
147{
148 if (insn->vex_prefix.nbytes == 2) /* 2 bytes VEX */
149 return X86_VEX_P(insn->vex_prefix.bytes[1]);
150 else
151 return X86_VEX_P(insn->vex_prefix.bytes[2]);
152}
153
154/* Offset of each field from kaddr */
155static inline int insn_offset_rex_prefix(struct insn *insn)
156{
157 return insn->prefixes.nbytes;
158}
159static inline int insn_offset_vex_prefix(struct insn *insn)
160{
161 return insn_offset_rex_prefix(insn) + insn->rex_prefix.nbytes;
162}
163static inline int insn_offset_opcode(struct insn *insn)
164{
165 return insn_offset_vex_prefix(insn) + insn->vex_prefix.nbytes;
166}
167static inline int insn_offset_modrm(struct insn *insn)
168{
169 return insn_offset_opcode(insn) + insn->opcode.nbytes;
170}
171static inline int insn_offset_sib(struct insn *insn)
172{
173 return insn_offset_modrm(insn) + insn->modrm.nbytes;
174}
175static inline int insn_offset_displacement(struct insn *insn)
176{
177 return insn_offset_sib(insn) + insn->sib.nbytes;
178}
179static inline int insn_offset_immediate(struct insn *insn)
180{
181 return insn_offset_displacement(insn) + insn->displacement.nbytes;
182}
183
184#endif /* _ASM_X86_INSN_H */
diff --git a/arch/x86/include/asm/inst.h b/arch/x86/include/asm/inst.h
new file mode 100644
index 000000000000..14cf526091f9
--- /dev/null
+++ b/arch/x86/include/asm/inst.h
@@ -0,0 +1,150 @@
1/*
2 * Generate .byte code for some instructions not supported by old
3 * binutils.
4 */
5#ifndef X86_ASM_INST_H
6#define X86_ASM_INST_H
7
8#ifdef __ASSEMBLY__
9
10 .macro XMM_NUM opd xmm
11 .ifc \xmm,%xmm0
12 \opd = 0
13 .endif
14 .ifc \xmm,%xmm1
15 \opd = 1
16 .endif
17 .ifc \xmm,%xmm2
18 \opd = 2
19 .endif
20 .ifc \xmm,%xmm3
21 \opd = 3
22 .endif
23 .ifc \xmm,%xmm4
24 \opd = 4
25 .endif
26 .ifc \xmm,%xmm5
27 \opd = 5
28 .endif
29 .ifc \xmm,%xmm6
30 \opd = 6
31 .endif
32 .ifc \xmm,%xmm7
33 \opd = 7
34 .endif
35 .ifc \xmm,%xmm8
36 \opd = 8
37 .endif
38 .ifc \xmm,%xmm9
39 \opd = 9
40 .endif
41 .ifc \xmm,%xmm10
42 \opd = 10
43 .endif
44 .ifc \xmm,%xmm11
45 \opd = 11
46 .endif
47 .ifc \xmm,%xmm12
48 \opd = 12
49 .endif
50 .ifc \xmm,%xmm13
51 \opd = 13
52 .endif
53 .ifc \xmm,%xmm14
54 \opd = 14
55 .endif
56 .ifc \xmm,%xmm15
57 \opd = 15
58 .endif
59 .endm
60
61 .macro PFX_OPD_SIZE
62 .byte 0x66
63 .endm
64
65 .macro PFX_REX opd1 opd2
66 .if (\opd1 | \opd2) & 8
67 .byte 0x40 | ((\opd1 & 8) >> 3) | ((\opd2 & 8) >> 1)
68 .endif
69 .endm
70
71 .macro MODRM mod opd1 opd2
72 .byte \mod | (\opd1 & 7) | ((\opd2 & 7) << 3)
73 .endm
74
75 .macro PSHUFB_XMM xmm1 xmm2
76 XMM_NUM pshufb_opd1 \xmm1
77 XMM_NUM pshufb_opd2 \xmm2
78 PFX_OPD_SIZE
79 PFX_REX pshufb_opd1 pshufb_opd2
80 .byte 0x0f, 0x38, 0x00
81 MODRM 0xc0 pshufb_opd1 pshufb_opd2
82 .endm
83
84 .macro PCLMULQDQ imm8 xmm1 xmm2
85 XMM_NUM clmul_opd1 \xmm1
86 XMM_NUM clmul_opd2 \xmm2
87 PFX_OPD_SIZE
88 PFX_REX clmul_opd1 clmul_opd2
89 .byte 0x0f, 0x3a, 0x44
90 MODRM 0xc0 clmul_opd1 clmul_opd2
91 .byte \imm8
92 .endm
93
94 .macro AESKEYGENASSIST rcon xmm1 xmm2
95 XMM_NUM aeskeygen_opd1 \xmm1
96 XMM_NUM aeskeygen_opd2 \xmm2
97 PFX_OPD_SIZE
98 PFX_REX aeskeygen_opd1 aeskeygen_opd2
99 .byte 0x0f, 0x3a, 0xdf
100 MODRM 0xc0 aeskeygen_opd1 aeskeygen_opd2
101 .byte \rcon
102 .endm
103
104 .macro AESIMC xmm1 xmm2
105 XMM_NUM aesimc_opd1 \xmm1
106 XMM_NUM aesimc_opd2 \xmm2
107 PFX_OPD_SIZE
108 PFX_REX aesimc_opd1 aesimc_opd2
109 .byte 0x0f, 0x38, 0xdb
110 MODRM 0xc0 aesimc_opd1 aesimc_opd2
111 .endm
112
113 .macro AESENC xmm1 xmm2
114 XMM_NUM aesenc_opd1 \xmm1
115 XMM_NUM aesenc_opd2 \xmm2
116 PFX_OPD_SIZE
117 PFX_REX aesenc_opd1 aesenc_opd2
118 .byte 0x0f, 0x38, 0xdc
119 MODRM 0xc0 aesenc_opd1 aesenc_opd2
120 .endm
121
122 .macro AESENCLAST xmm1 xmm2
123 XMM_NUM aesenclast_opd1 \xmm1
124 XMM_NUM aesenclast_opd2 \xmm2
125 PFX_OPD_SIZE
126 PFX_REX aesenclast_opd1 aesenclast_opd2
127 .byte 0x0f, 0x38, 0xdd
128 MODRM 0xc0 aesenclast_opd1 aesenclast_opd2
129 .endm
130
131 .macro AESDEC xmm1 xmm2
132 XMM_NUM aesdec_opd1 \xmm1
133 XMM_NUM aesdec_opd2 \xmm2
134 PFX_OPD_SIZE
135 PFX_REX aesdec_opd1 aesdec_opd2
136 .byte 0x0f, 0x38, 0xde
137 MODRM 0xc0 aesdec_opd1 aesdec_opd2
138 .endm
139
140 .macro AESDECLAST xmm1 xmm2
141 XMM_NUM aesdeclast_opd1 \xmm1
142 XMM_NUM aesdeclast_opd2 \xmm2
143 PFX_OPD_SIZE
144 PFX_REX aesdeclast_opd1 aesdeclast_opd2
145 .byte 0x0f, 0x38, 0xdf
146 MODRM 0xc0 aesdeclast_opd1 aesdeclast_opd2
147 .endm
148#endif
149
150#endif
diff --git a/arch/x86/include/asm/iommu.h b/arch/x86/include/asm/iommu.h
index fd6d21bbee6c..345c99cef152 100644
--- a/arch/x86/include/asm/iommu.h
+++ b/arch/x86/include/asm/iommu.h
@@ -1,8 +1,6 @@
1#ifndef _ASM_X86_IOMMU_H 1#ifndef _ASM_X86_IOMMU_H
2#define _ASM_X86_IOMMU_H 2#define _ASM_X86_IOMMU_H
3 3
4extern void pci_iommu_shutdown(void);
5extern void no_iommu_init(void);
6extern struct dma_map_ops nommu_dma_ops; 4extern struct dma_map_ops nommu_dma_ops;
7extern int force_iommu, no_iommu; 5extern int force_iommu, no_iommu;
8extern int iommu_detected; 6extern int iommu_detected;
diff --git a/arch/x86/include/asm/irq.h b/arch/x86/include/asm/irq.h
index ddda6cbed6f4..5458380b6ef8 100644
--- a/arch/x86/include/asm/irq.h
+++ b/arch/x86/include/asm/irq.h
@@ -34,9 +34,10 @@ static inline int irq_canonicalize(int irq)
34#ifdef CONFIG_HOTPLUG_CPU 34#ifdef CONFIG_HOTPLUG_CPU
35#include <linux/cpumask.h> 35#include <linux/cpumask.h>
36extern void fixup_irqs(void); 36extern void fixup_irqs(void);
37extern void irq_force_complete_move(int);
37#endif 38#endif
38 39
39extern void (*generic_interrupt_extension)(void); 40extern void (*x86_platform_ipi_callback)(void);
40extern void native_init_IRQ(void); 41extern void native_init_IRQ(void);
41extern bool handle_irq(unsigned irq, struct pt_regs *regs); 42extern bool handle_irq(unsigned irq, struct pt_regs *regs);
42 43
diff --git a/arch/x86/include/asm/irq_vectors.h b/arch/x86/include/asm/irq_vectors.h
index 5b21f0ec3df2..6a635bd39867 100644
--- a/arch/x86/include/asm/irq_vectors.h
+++ b/arch/x86/include/asm/irq_vectors.h
@@ -106,7 +106,7 @@
106/* 106/*
107 * Generic system vector for platform specific use 107 * Generic system vector for platform specific use
108 */ 108 */
109#define GENERIC_INTERRUPT_VECTOR 0xed 109#define X86_PLATFORM_IPI_VECTOR 0xed
110 110
111/* 111/*
112 * Performance monitoring pending work vector: 112 * Performance monitoring pending work vector:
diff --git a/arch/x86/include/asm/k8.h b/arch/x86/include/asm/k8.h
index c2d1f3b58e5f..f70e60071fe8 100644
--- a/arch/x86/include/asm/k8.h
+++ b/arch/x86/include/asm/k8.h
@@ -4,13 +4,16 @@
4#include <linux/pci.h> 4#include <linux/pci.h>
5 5
6extern struct pci_device_id k8_nb_ids[]; 6extern struct pci_device_id k8_nb_ids[];
7struct bootnode;
7 8
8extern int early_is_k8_nb(u32 value); 9extern int early_is_k8_nb(u32 value);
9extern struct pci_dev **k8_northbridges; 10extern struct pci_dev **k8_northbridges;
10extern int num_k8_northbridges; 11extern int num_k8_northbridges;
11extern int cache_k8_northbridges(void); 12extern int cache_k8_northbridges(void);
12extern void k8_flush_garts(void); 13extern void k8_flush_garts(void);
13extern int k8_scan_nodes(unsigned long start, unsigned long end); 14extern int k8_get_nodes(struct bootnode *nodes);
15extern int k8_numa_init(unsigned long start_pfn, unsigned long end_pfn);
16extern int k8_scan_nodes(void);
14 17
15#ifdef CONFIG_K8_NB 18#ifdef CONFIG_K8_NB
16static inline struct pci_dev *node_to_k8_nb_misc(int node) 19static inline struct pci_dev *node_to_k8_nb_misc(int node)
diff --git a/arch/x86/include/asm/kvm.h b/arch/x86/include/asm/kvm.h
index 4a5fe914dc59..950df434763f 100644
--- a/arch/x86/include/asm/kvm.h
+++ b/arch/x86/include/asm/kvm.h
@@ -19,6 +19,8 @@
19#define __KVM_HAVE_MSIX 19#define __KVM_HAVE_MSIX
20#define __KVM_HAVE_MCE 20#define __KVM_HAVE_MCE
21#define __KVM_HAVE_PIT_STATE2 21#define __KVM_HAVE_PIT_STATE2
22#define __KVM_HAVE_XEN_HVM
23#define __KVM_HAVE_VCPU_EVENTS
22 24
23/* Architectural interrupt line count. */ 25/* Architectural interrupt line count. */
24#define KVM_NR_INTERRUPTS 256 26#define KVM_NR_INTERRUPTS 256
@@ -79,6 +81,7 @@ struct kvm_ioapic_state {
79#define KVM_IRQCHIP_PIC_MASTER 0 81#define KVM_IRQCHIP_PIC_MASTER 0
80#define KVM_IRQCHIP_PIC_SLAVE 1 82#define KVM_IRQCHIP_PIC_SLAVE 1
81#define KVM_IRQCHIP_IOAPIC 2 83#define KVM_IRQCHIP_IOAPIC 2
84#define KVM_NR_IRQCHIPS 3
82 85
83/* for KVM_GET_REGS and KVM_SET_REGS */ 86/* for KVM_GET_REGS and KVM_SET_REGS */
84struct kvm_regs { 87struct kvm_regs {
@@ -250,4 +253,31 @@ struct kvm_reinject_control {
250 __u8 pit_reinject; 253 __u8 pit_reinject;
251 __u8 reserved[31]; 254 __u8 reserved[31];
252}; 255};
256
257/* for KVM_GET/SET_VCPU_EVENTS */
258struct kvm_vcpu_events {
259 struct {
260 __u8 injected;
261 __u8 nr;
262 __u8 has_error_code;
263 __u8 pad;
264 __u32 error_code;
265 } exception;
266 struct {
267 __u8 injected;
268 __u8 nr;
269 __u8 soft;
270 __u8 pad;
271 } interrupt;
272 struct {
273 __u8 injected;
274 __u8 pending;
275 __u8 masked;
276 __u8 pad;
277 } nmi;
278 __u32 sipi_vector;
279 __u32 flags;
280 __u32 reserved[10];
281};
282
253#endif /* _ASM_X86_KVM_H */ 283#endif /* _ASM_X86_KVM_H */
diff --git a/arch/x86/include/asm/kvm_emulate.h b/arch/x86/include/asm/kvm_emulate.h
index b7ed2c423116..7c18e1230f54 100644
--- a/arch/x86/include/asm/kvm_emulate.h
+++ b/arch/x86/include/asm/kvm_emulate.h
@@ -129,7 +129,7 @@ struct decode_cache {
129 u8 seg_override; 129 u8 seg_override;
130 unsigned int d; 130 unsigned int d;
131 unsigned long regs[NR_VCPU_REGS]; 131 unsigned long regs[NR_VCPU_REGS];
132 unsigned long eip; 132 unsigned long eip, eip_orig;
133 /* modrm */ 133 /* modrm */
134 u8 modrm; 134 u8 modrm;
135 u8 modrm_mod; 135 u8 modrm_mod;
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index d83892226f73..4f865e8b8540 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -354,7 +354,6 @@ struct kvm_vcpu_arch {
354 unsigned int time_offset; 354 unsigned int time_offset;
355 struct page *time_page; 355 struct page *time_page;
356 356
357 bool singlestep; /* guest is single stepped by KVM */
358 bool nmi_pending; 357 bool nmi_pending;
359 bool nmi_injected; 358 bool nmi_injected;
360 359
@@ -371,6 +370,10 @@ struct kvm_vcpu_arch {
371 u64 mcg_status; 370 u64 mcg_status;
372 u64 mcg_ctl; 371 u64 mcg_ctl;
373 u64 *mce_banks; 372 u64 *mce_banks;
373
374 /* used for guest single stepping over the given code position */
375 u16 singlestep_cs;
376 unsigned long singlestep_rip;
374}; 377};
375 378
376struct kvm_mem_alias { 379struct kvm_mem_alias {
@@ -397,7 +400,6 @@ struct kvm_arch{
397 struct kvm_pic *vpic; 400 struct kvm_pic *vpic;
398 struct kvm_ioapic *vioapic; 401 struct kvm_ioapic *vioapic;
399 struct kvm_pit *vpit; 402 struct kvm_pit *vpit;
400 struct hlist_head irq_ack_notifier_list;
401 int vapics_in_nmi_mode; 403 int vapics_in_nmi_mode;
402 404
403 unsigned int tss_addr; 405 unsigned int tss_addr;
@@ -410,8 +412,10 @@ struct kvm_arch{
410 gpa_t ept_identity_map_addr; 412 gpa_t ept_identity_map_addr;
411 413
412 unsigned long irq_sources_bitmap; 414 unsigned long irq_sources_bitmap;
413 unsigned long irq_states[KVM_IOAPIC_NUM_PINS];
414 u64 vm_init_tsc; 415 u64 vm_init_tsc;
416 s64 kvmclock_offset;
417
418 struct kvm_xen_hvm_config xen_hvm_config;
415}; 419};
416 420
417struct kvm_vm_stat { 421struct kvm_vm_stat {
@@ -461,7 +465,7 @@ struct descriptor_table {
461struct kvm_x86_ops { 465struct kvm_x86_ops {
462 int (*cpu_has_kvm_support)(void); /* __init */ 466 int (*cpu_has_kvm_support)(void); /* __init */
463 int (*disabled_by_bios)(void); /* __init */ 467 int (*disabled_by_bios)(void); /* __init */
464 void (*hardware_enable)(void *dummy); /* __init */ 468 int (*hardware_enable)(void *dummy);
465 void (*hardware_disable)(void *dummy); 469 void (*hardware_disable)(void *dummy);
466 void (*check_processor_compatibility)(void *rtn); 470 void (*check_processor_compatibility)(void *rtn);
467 int (*hardware_setup)(void); /* __init */ 471 int (*hardware_setup)(void); /* __init */
@@ -477,8 +481,8 @@ struct kvm_x86_ops {
477 void (*vcpu_load)(struct kvm_vcpu *vcpu, int cpu); 481 void (*vcpu_load)(struct kvm_vcpu *vcpu, int cpu);
478 void (*vcpu_put)(struct kvm_vcpu *vcpu); 482 void (*vcpu_put)(struct kvm_vcpu *vcpu);
479 483
480 int (*set_guest_debug)(struct kvm_vcpu *vcpu, 484 void (*set_guest_debug)(struct kvm_vcpu *vcpu,
481 struct kvm_guest_debug *dbg); 485 struct kvm_guest_debug *dbg);
482 int (*get_msr)(struct kvm_vcpu *vcpu, u32 msr_index, u64 *pdata); 486 int (*get_msr)(struct kvm_vcpu *vcpu, u32 msr_index, u64 *pdata);
483 int (*set_msr)(struct kvm_vcpu *vcpu, u32 msr_index, u64 data); 487 int (*set_msr)(struct kvm_vcpu *vcpu, u32 msr_index, u64 data);
484 u64 (*get_segment_base)(struct kvm_vcpu *vcpu, int seg); 488 u64 (*get_segment_base)(struct kvm_vcpu *vcpu, int seg);
@@ -506,8 +510,8 @@ struct kvm_x86_ops {
506 510
507 void (*tlb_flush)(struct kvm_vcpu *vcpu); 511 void (*tlb_flush)(struct kvm_vcpu *vcpu);
508 512
509 void (*run)(struct kvm_vcpu *vcpu, struct kvm_run *run); 513 void (*run)(struct kvm_vcpu *vcpu);
510 int (*handle_exit)(struct kvm_run *run, struct kvm_vcpu *vcpu); 514 int (*handle_exit)(struct kvm_vcpu *vcpu);
511 void (*skip_emulated_instruction)(struct kvm_vcpu *vcpu); 515 void (*skip_emulated_instruction)(struct kvm_vcpu *vcpu);
512 void (*set_interrupt_shadow)(struct kvm_vcpu *vcpu, int mask); 516 void (*set_interrupt_shadow)(struct kvm_vcpu *vcpu, int mask);
513 u32 (*get_interrupt_shadow)(struct kvm_vcpu *vcpu, int mask); 517 u32 (*get_interrupt_shadow)(struct kvm_vcpu *vcpu, int mask);
@@ -519,6 +523,8 @@ struct kvm_x86_ops {
519 bool has_error_code, u32 error_code); 523 bool has_error_code, u32 error_code);
520 int (*interrupt_allowed)(struct kvm_vcpu *vcpu); 524 int (*interrupt_allowed)(struct kvm_vcpu *vcpu);
521 int (*nmi_allowed)(struct kvm_vcpu *vcpu); 525 int (*nmi_allowed)(struct kvm_vcpu *vcpu);
526 bool (*get_nmi_mask)(struct kvm_vcpu *vcpu);
527 void (*set_nmi_mask)(struct kvm_vcpu *vcpu, bool masked);
522 void (*enable_nmi_window)(struct kvm_vcpu *vcpu); 528 void (*enable_nmi_window)(struct kvm_vcpu *vcpu);
523 void (*enable_irq_window)(struct kvm_vcpu *vcpu); 529 void (*enable_irq_window)(struct kvm_vcpu *vcpu);
524 void (*update_cr8_intercept)(struct kvm_vcpu *vcpu, int tpr, int irr); 530 void (*update_cr8_intercept)(struct kvm_vcpu *vcpu, int tpr, int irr);
@@ -568,7 +574,7 @@ enum emulation_result {
568#define EMULTYPE_NO_DECODE (1 << 0) 574#define EMULTYPE_NO_DECODE (1 << 0)
569#define EMULTYPE_TRAP_UD (1 << 1) 575#define EMULTYPE_TRAP_UD (1 << 1)
570#define EMULTYPE_SKIP (1 << 2) 576#define EMULTYPE_SKIP (1 << 2)
571int emulate_instruction(struct kvm_vcpu *vcpu, struct kvm_run *run, 577int emulate_instruction(struct kvm_vcpu *vcpu,
572 unsigned long cr2, u16 error_code, int emulation_type); 578 unsigned long cr2, u16 error_code, int emulation_type);
573void kvm_report_emulation_failure(struct kvm_vcpu *cvpu, const char *context); 579void kvm_report_emulation_failure(struct kvm_vcpu *cvpu, const char *context);
574void realmode_lgdt(struct kvm_vcpu *vcpu, u16 size, unsigned long address); 580void realmode_lgdt(struct kvm_vcpu *vcpu, u16 size, unsigned long address);
@@ -585,9 +591,9 @@ int kvm_set_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 data);
585 591
586struct x86_emulate_ctxt; 592struct x86_emulate_ctxt;
587 593
588int kvm_emulate_pio(struct kvm_vcpu *vcpu, struct kvm_run *run, int in, 594int kvm_emulate_pio(struct kvm_vcpu *vcpu, int in,
589 int size, unsigned port); 595 int size, unsigned port);
590int kvm_emulate_pio_string(struct kvm_vcpu *vcpu, struct kvm_run *run, int in, 596int kvm_emulate_pio_string(struct kvm_vcpu *vcpu, int in,
591 int size, unsigned long count, int down, 597 int size, unsigned long count, int down,
592 gva_t address, int rep, unsigned port); 598 gva_t address, int rep, unsigned port);
593void kvm_emulate_cpuid(struct kvm_vcpu *vcpu); 599void kvm_emulate_cpuid(struct kvm_vcpu *vcpu);
@@ -616,6 +622,9 @@ void kvm_get_cs_db_l_bits(struct kvm_vcpu *vcpu, int *db, int *l);
616int kvm_get_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 *pdata); 622int kvm_get_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 *pdata);
617int kvm_set_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 data); 623int kvm_set_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 data);
618 624
625unsigned long kvm_get_rflags(struct kvm_vcpu *vcpu);
626void kvm_set_rflags(struct kvm_vcpu *vcpu, unsigned long rflags);
627
619void kvm_queue_exception(struct kvm_vcpu *vcpu, unsigned nr); 628void kvm_queue_exception(struct kvm_vcpu *vcpu, unsigned nr);
620void kvm_queue_exception_e(struct kvm_vcpu *vcpu, unsigned nr, u32 error_code); 629void kvm_queue_exception_e(struct kvm_vcpu *vcpu, unsigned nr, u32 error_code);
621void kvm_inject_page_fault(struct kvm_vcpu *vcpu, unsigned long cr2, 630void kvm_inject_page_fault(struct kvm_vcpu *vcpu, unsigned long cr2,
@@ -802,4 +811,7 @@ int kvm_cpu_has_interrupt(struct kvm_vcpu *vcpu);
802int kvm_arch_interrupt_allowed(struct kvm_vcpu *vcpu); 811int kvm_arch_interrupt_allowed(struct kvm_vcpu *vcpu);
803int kvm_cpu_get_interrupt(struct kvm_vcpu *v); 812int kvm_cpu_get_interrupt(struct kvm_vcpu *v);
804 813
814void kvm_define_shared_msr(unsigned index, u32 msr);
815void kvm_set_shared_msr(unsigned index, u64 val, u64 mask);
816
805#endif /* _ASM_X86_KVM_HOST_H */ 817#endif /* _ASM_X86_KVM_HOST_H */
diff --git a/arch/x86/include/asm/mce.h b/arch/x86/include/asm/mce.h
index f1363b72364f..858baa061cfc 100644
--- a/arch/x86/include/asm/mce.h
+++ b/arch/x86/include/asm/mce.h
@@ -108,6 +108,8 @@ struct mce_log {
108#define K8_MCE_THRESHOLD_BANK_5 (MCE_THRESHOLD_BASE + 5 * 9) 108#define K8_MCE_THRESHOLD_BANK_5 (MCE_THRESHOLD_BASE + 5 * 9)
109#define K8_MCE_THRESHOLD_DRAM_ECC (MCE_THRESHOLD_BANK_4 + 0) 109#define K8_MCE_THRESHOLD_DRAM_ECC (MCE_THRESHOLD_BANK_4 + 0)
110 110
111extern struct atomic_notifier_head x86_mce_decoder_chain;
112
111#ifdef __KERNEL__ 113#ifdef __KERNEL__
112 114
113#include <linux/percpu.h> 115#include <linux/percpu.h>
@@ -118,9 +120,11 @@ extern int mce_disabled;
118extern int mce_p5_enabled; 120extern int mce_p5_enabled;
119 121
120#ifdef CONFIG_X86_MCE 122#ifdef CONFIG_X86_MCE
121void mcheck_init(struct cpuinfo_x86 *c); 123int mcheck_init(void);
124void mcheck_cpu_init(struct cpuinfo_x86 *c);
122#else 125#else
123static inline void mcheck_init(struct cpuinfo_x86 *c) {} 126static inline int mcheck_init(void) { return 0; }
127static inline void mcheck_cpu_init(struct cpuinfo_x86 *c) {}
124#endif 128#endif
125 129
126#ifdef CONFIG_X86_ANCIENT_MCE 130#ifdef CONFIG_X86_ANCIENT_MCE
@@ -214,5 +218,11 @@ void intel_init_thermal(struct cpuinfo_x86 *c);
214 218
215void mce_log_therm_throt_event(__u64 status); 219void mce_log_therm_throt_event(__u64 status);
216 220
221#ifdef CONFIG_X86_THERMAL_VECTOR
222extern void mcheck_intel_therm_init(void);
223#else
224static inline void mcheck_intel_therm_init(void) { }
225#endif
226
217#endif /* __KERNEL__ */ 227#endif /* __KERNEL__ */
218#endif /* _ASM_X86_MCE_H */ 228#endif /* _ASM_X86_MCE_H */
diff --git a/arch/x86/include/asm/microcode.h b/arch/x86/include/asm/microcode.h
index ef51b501e22a..c24ca9a56458 100644
--- a/arch/x86/include/asm/microcode.h
+++ b/arch/x86/include/asm/microcode.h
@@ -12,6 +12,8 @@ struct device;
12enum ucode_state { UCODE_ERROR, UCODE_OK, UCODE_NFOUND }; 12enum ucode_state { UCODE_ERROR, UCODE_OK, UCODE_NFOUND };
13 13
14struct microcode_ops { 14struct microcode_ops {
15 void (*init)(struct device *device);
16 void (*fini)(void);
15 enum ucode_state (*request_microcode_user) (int cpu, 17 enum ucode_state (*request_microcode_user) (int cpu,
16 const void __user *buf, size_t size); 18 const void __user *buf, size_t size);
17 19
diff --git a/arch/x86/include/asm/mpspec.h b/arch/x86/include/asm/mpspec.h
index 79c94500c0bb..d8bf23a88d05 100644
--- a/arch/x86/include/asm/mpspec.h
+++ b/arch/x86/include/asm/mpspec.h
@@ -71,12 +71,7 @@ static inline void early_get_smp_config(void)
71 71
72static inline void find_smp_config(void) 72static inline void find_smp_config(void)
73{ 73{
74 x86_init.mpparse.find_smp_config(1); 74 x86_init.mpparse.find_smp_config();
75}
76
77static inline void early_find_smp_config(void)
78{
79 x86_init.mpparse.find_smp_config(0);
80} 75}
81 76
82#ifdef CONFIG_X86_MPPARSE 77#ifdef CONFIG_X86_MPPARSE
@@ -89,7 +84,7 @@ extern void default_mpc_oem_bus_info(struct mpc_bus *m, char *str);
89# else 84# else
90# define default_mpc_oem_bus_info NULL 85# define default_mpc_oem_bus_info NULL
91# endif 86# endif
92extern void default_find_smp_config(unsigned int reserve); 87extern void default_find_smp_config(void);
93extern void default_get_smp_config(unsigned int early); 88extern void default_get_smp_config(unsigned int early);
94#else 89#else
95static inline void early_reserve_e820_mpc_new(void) { } 90static inline void early_reserve_e820_mpc_new(void) { }
@@ -97,7 +92,7 @@ static inline void early_reserve_e820_mpc_new(void) { }
97#define default_mpc_apic_id NULL 92#define default_mpc_apic_id NULL
98#define default_smp_read_mpc_oem NULL 93#define default_smp_read_mpc_oem NULL
99#define default_mpc_oem_bus_info NULL 94#define default_mpc_oem_bus_info NULL
100#define default_find_smp_config x86_init_uint_noop 95#define default_find_smp_config x86_init_noop
101#define default_get_smp_config x86_init_uint_noop 96#define default_get_smp_config x86_init_uint_noop
102#endif 97#endif
103 98
@@ -163,14 +158,16 @@ typedef struct physid_mask physid_mask_t;
163#define physids_shift_left(d, s, n) \ 158#define physids_shift_left(d, s, n) \
164 bitmap_shift_left((d).mask, (s).mask, n, MAX_APICS) 159 bitmap_shift_left((d).mask, (s).mask, n, MAX_APICS)
165 160
166#define physids_coerce(map) ((map).mask[0]) 161static inline unsigned long physids_coerce(physid_mask_t *map)
162{
163 return map->mask[0];
164}
167 165
168#define physids_promote(physids) \ 166static inline void physids_promote(unsigned long physids, physid_mask_t *map)
169 ({ \ 167{
170 physid_mask_t __physid_mask = PHYSID_MASK_NONE; \ 168 physids_clear(*map);
171 __physid_mask.mask[0] = physids; \ 169 map->mask[0] = physids;
172 __physid_mask; \ 170}
173 })
174 171
175/* Note: will create very large stack frames if physid_mask_t is big */ 172/* Note: will create very large stack frames if physid_mask_t is big */
176#define physid_mask_of_physid(physid) \ 173#define physid_mask_of_physid(physid) \
diff --git a/arch/x86/include/asm/msr.h b/arch/x86/include/asm/msr.h
index 7e2b6ba962ff..5bef931f8b14 100644
--- a/arch/x86/include/asm/msr.h
+++ b/arch/x86/include/asm/msr.h
@@ -247,8 +247,8 @@ do { \
247#ifdef CONFIG_SMP 247#ifdef CONFIG_SMP
248int rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h); 248int rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h);
249int wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h); 249int wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h);
250void rdmsr_on_cpus(const cpumask_t *mask, u32 msr_no, struct msr *msrs); 250void rdmsr_on_cpus(const struct cpumask *mask, u32 msr_no, struct msr *msrs);
251void wrmsr_on_cpus(const cpumask_t *mask, u32 msr_no, struct msr *msrs); 251void wrmsr_on_cpus(const struct cpumask *mask, u32 msr_no, struct msr *msrs);
252int rdmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h); 252int rdmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h);
253int wrmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h); 253int wrmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h);
254int rdmsr_safe_regs_on_cpu(unsigned int cpu, u32 regs[8]); 254int rdmsr_safe_regs_on_cpu(unsigned int cpu, u32 regs[8]);
@@ -264,12 +264,12 @@ static inline int wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h)
264 wrmsr(msr_no, l, h); 264 wrmsr(msr_no, l, h);
265 return 0; 265 return 0;
266} 266}
267static inline void rdmsr_on_cpus(const cpumask_t *m, u32 msr_no, 267static inline void rdmsr_on_cpus(const struct cpumask *m, u32 msr_no,
268 struct msr *msrs) 268 struct msr *msrs)
269{ 269{
270 rdmsr_on_cpu(0, msr_no, &(msrs[0].l), &(msrs[0].h)); 270 rdmsr_on_cpu(0, msr_no, &(msrs[0].l), &(msrs[0].h));
271} 271}
272static inline void wrmsr_on_cpus(const cpumask_t *m, u32 msr_no, 272static inline void wrmsr_on_cpus(const struct cpumask *m, u32 msr_no,
273 struct msr *msrs) 273 struct msr *msrs)
274{ 274{
275 wrmsr_on_cpu(0, msr_no, msrs[0].l, msrs[0].h); 275 wrmsr_on_cpu(0, msr_no, msrs[0].l, msrs[0].h);
diff --git a/arch/x86/include/asm/page_types.h b/arch/x86/include/asm/page_types.h
index 6473f5ccff85..642fe34b36a2 100644
--- a/arch/x86/include/asm/page_types.h
+++ b/arch/x86/include/asm/page_types.h
@@ -49,7 +49,8 @@ extern unsigned long max_pfn_mapped;
49extern unsigned long init_memory_mapping(unsigned long start, 49extern unsigned long init_memory_mapping(unsigned long start,
50 unsigned long end); 50 unsigned long end);
51 51
52extern void initmem_init(unsigned long start_pfn, unsigned long end_pfn); 52extern void initmem_init(unsigned long start_pfn, unsigned long end_pfn,
53 int acpi, int k8);
53extern void free_initmem(void); 54extern void free_initmem(void);
54 55
55#endif /* !__ASSEMBLY__ */ 56#endif /* !__ASSEMBLY__ */
diff --git a/arch/x86/include/asm/perf_event.h b/arch/x86/include/asm/perf_event.h
index ad7ce3fd5065..8d9f8548a870 100644
--- a/arch/x86/include/asm/perf_event.h
+++ b/arch/x86/include/asm/perf_event.h
@@ -28,9 +28,20 @@
28 */ 28 */
29#define ARCH_PERFMON_EVENT_MASK 0xffff 29#define ARCH_PERFMON_EVENT_MASK 0xffff
30 30
31/*
32 * filter mask to validate fixed counter events.
33 * the following filters disqualify for fixed counters:
34 * - inv
35 * - edge
36 * - cnt-mask
37 * The other filters are supported by fixed counters.
38 * The any-thread option is supported starting with v3.
39 */
40#define ARCH_PERFMON_EVENT_FILTER_MASK 0xff840000
41
31#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_SEL 0x3c 42#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_SEL 0x3c
32#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_UMASK (0x00 << 8) 43#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_UMASK (0x00 << 8)
33#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_INDEX 0 44#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_INDEX 0
34#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_PRESENT \ 45#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_PRESENT \
35 (1 << (ARCH_PERFMON_UNHALTED_CORE_CYCLES_INDEX)) 46 (1 << (ARCH_PERFMON_UNHALTED_CORE_CYCLES_INDEX))
36 47
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
index af6fd360ab35..a34c785c5a63 100644
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
@@ -16,6 +16,8 @@
16 16
17#ifndef __ASSEMBLY__ 17#ifndef __ASSEMBLY__
18 18
19#include <asm/x86_init.h>
20
19/* 21/*
20 * ZERO_PAGE is a global shared page that is always zero: used 22 * ZERO_PAGE is a global shared page that is always zero: used
21 * for zero-mapped memory areas etc.. 23 * for zero-mapped memory areas etc..
@@ -270,9 +272,9 @@ static inline int is_new_memtype_allowed(u64 paddr, unsigned long size,
270 unsigned long new_flags) 272 unsigned long new_flags)
271{ 273{
272 /* 274 /*
273 * PAT type is always WB for ISA. So no need to check. 275 * PAT type is always WB for untracked ranges, so no need to check.
274 */ 276 */
275 if (is_ISA_range(paddr, paddr + size - 1)) 277 if (x86_platform.is_untracked_pat_range(paddr, paddr + size))
276 return 1; 278 return 1;
277 279
278 /* 280 /*
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
index c9786480f0fe..6f8ec1c37e0a 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
@@ -30,6 +30,7 @@ struct mm_struct;
30#include <linux/math64.h> 30#include <linux/math64.h>
31#include <linux/init.h> 31#include <linux/init.h>
32 32
33#define HBP_NUM 4
33/* 34/*
34 * Default implementation of macro that returns current 35 * Default implementation of macro that returns current
35 * instruction pointer ("program counter"). 36 * instruction pointer ("program counter").
@@ -422,6 +423,8 @@ extern unsigned int xstate_size;
422extern void free_thread_xstate(struct task_struct *); 423extern void free_thread_xstate(struct task_struct *);
423extern struct kmem_cache *task_xstate_cachep; 424extern struct kmem_cache *task_xstate_cachep;
424 425
426struct perf_event;
427
425struct thread_struct { 428struct thread_struct {
426 /* Cached TLS descriptors: */ 429 /* Cached TLS descriptors: */
427 struct desc_struct tls_array[GDT_ENTRY_TLS_ENTRIES]; 430 struct desc_struct tls_array[GDT_ENTRY_TLS_ENTRIES];
@@ -443,13 +446,10 @@ struct thread_struct {
443 unsigned long fs; 446 unsigned long fs;
444#endif 447#endif
445 unsigned long gs; 448 unsigned long gs;
446 /* Hardware debugging registers: */ 449 /* Save middle states of ptrace breakpoints */
447 unsigned long debugreg0; 450 struct perf_event *ptrace_bps[HBP_NUM];
448 unsigned long debugreg1; 451 /* Debug status used for traps, single steps, etc... */
449 unsigned long debugreg2; 452 unsigned long debugreg6;
450 unsigned long debugreg3;
451 unsigned long debugreg6;
452 unsigned long debugreg7;
453 /* Fault info: */ 453 /* Fault info: */
454 unsigned long cr2; 454 unsigned long cr2;
455 unsigned long trap_no; 455 unsigned long trap_no;
diff --git a/arch/x86/include/asm/proto.h b/arch/x86/include/asm/proto.h
index 621f56d73121..4009f6534f52 100644
--- a/arch/x86/include/asm/proto.h
+++ b/arch/x86/include/asm/proto.h
@@ -5,18 +5,19 @@
5 5
6/* misc architecture specific prototypes */ 6/* misc architecture specific prototypes */
7 7
8extern void early_idt_handler(void); 8void early_idt_handler(void);
9 9
10extern void system_call(void); 10void system_call(void);
11extern void syscall_init(void); 11void syscall_init(void);
12 12
13extern void ia32_syscall(void); 13void ia32_syscall(void);
14extern void ia32_cstar_target(void); 14void ia32_cstar_target(void);
15extern void ia32_sysenter_target(void); 15void ia32_sysenter_target(void);
16 16
17extern void syscall32_cpu_init(void); 17void syscall32_cpu_init(void);
18 18
19extern void check_efer(void); 19void x86_configure_nx(void);
20void x86_report_nx(void);
20 21
21extern int reboot_force; 22extern int reboot_force;
22 23
diff --git a/arch/x86/include/asm/ptrace.h b/arch/x86/include/asm/ptrace.h
index 0f0d908349aa..3d11fd0f44c5 100644
--- a/arch/x86/include/asm/ptrace.h
+++ b/arch/x86/include/asm/ptrace.h
@@ -7,6 +7,7 @@
7 7
8#ifdef __KERNEL__ 8#ifdef __KERNEL__
9#include <asm/segment.h> 9#include <asm/segment.h>
10#include <asm/page_types.h>
10#endif 11#endif
11 12
12#ifndef __ASSEMBLY__ 13#ifndef __ASSEMBLY__
@@ -216,6 +217,67 @@ static inline unsigned long user_stack_pointer(struct pt_regs *regs)
216 return regs->sp; 217 return regs->sp;
217} 218}
218 219
220/* Query offset/name of register from its name/offset */
221extern int regs_query_register_offset(const char *name);
222extern const char *regs_query_register_name(unsigned int offset);
223#define MAX_REG_OFFSET (offsetof(struct pt_regs, ss))
224
225/**
226 * regs_get_register() - get register value from its offset
227 * @regs: pt_regs from which register value is gotten.
228 * @offset: offset number of the register.
229 *
230 * regs_get_register returns the value of a register. The @offset is the
231 * offset of the register in struct pt_regs address which specified by @regs.
232 * If @offset is bigger than MAX_REG_OFFSET, this returns 0.
233 */
234static inline unsigned long regs_get_register(struct pt_regs *regs,
235 unsigned int offset)
236{
237 if (unlikely(offset > MAX_REG_OFFSET))
238 return 0;
239 return *(unsigned long *)((unsigned long)regs + offset);
240}
241
242/**
243 * regs_within_kernel_stack() - check the address in the stack
244 * @regs: pt_regs which contains kernel stack pointer.
245 * @addr: address which is checked.
246 *
247 * regs_within_kernel_stack() checks @addr is within the kernel stack page(s).
248 * If @addr is within the kernel stack, it returns true. If not, returns false.
249 */
250static inline int regs_within_kernel_stack(struct pt_regs *regs,
251 unsigned long addr)
252{
253 return ((addr & ~(THREAD_SIZE - 1)) ==
254 (kernel_stack_pointer(regs) & ~(THREAD_SIZE - 1)));
255}
256
257/**
258 * regs_get_kernel_stack_nth() - get Nth entry of the stack
259 * @regs: pt_regs which contains kernel stack pointer.
260 * @n: stack entry number.
261 *
262 * regs_get_kernel_stack_nth() returns @n th entry of the kernel stack which
263 * is specified by @regs. If the @n th entry is NOT in the kernel stack,
264 * this returns 0.
265 */
266static inline unsigned long regs_get_kernel_stack_nth(struct pt_regs *regs,
267 unsigned int n)
268{
269 unsigned long *addr = (unsigned long *)kernel_stack_pointer(regs);
270 addr += n;
271 if (regs_within_kernel_stack(regs, (unsigned long)addr))
272 return *addr;
273 else
274 return 0;
275}
276
277/* Get Nth argument at function call */
278extern unsigned long regs_get_argument_nth(struct pt_regs *regs,
279 unsigned int n);
280
219/* 281/*
220 * These are defined as per linux/ptrace.h, which see. 282 * These are defined as per linux/ptrace.h, which see.
221 */ 283 */
diff --git a/arch/x86/include/asm/sections.h b/arch/x86/include/asm/sections.h
index 1b7ee5d673c2..0a5242428659 100644
--- a/arch/x86/include/asm/sections.h
+++ b/arch/x86/include/asm/sections.h
@@ -2,7 +2,13 @@
2#define _ASM_X86_SECTIONS_H 2#define _ASM_X86_SECTIONS_H
3 3
4#include <asm-generic/sections.h> 4#include <asm-generic/sections.h>
5#include <asm/uaccess.h>
5 6
6extern char __brk_base[], __brk_limit[]; 7extern char __brk_base[], __brk_limit[];
8extern struct exception_table_entry __stop___ex_table[];
9
10#if defined(CONFIG_X86_64) && defined(CONFIG_DEBUG_RODATA)
11extern char __end_rodata_hpage_align[];
12#endif
7 13
8#endif /* _ASM_X86_SECTIONS_H */ 14#endif /* _ASM_X86_SECTIONS_H */
diff --git a/arch/x86/include/asm/string_32.h b/arch/x86/include/asm/string_32.h
index ae907e617181..3d3e8353ee5c 100644
--- a/arch/x86/include/asm/string_32.h
+++ b/arch/x86/include/asm/string_32.h
@@ -177,10 +177,15 @@ static inline void *__memcpy3d(void *to, const void *from, size_t len)
177 */ 177 */
178 178
179#ifndef CONFIG_KMEMCHECK 179#ifndef CONFIG_KMEMCHECK
180
181#if (__GNUC__ >= 4)
182#define memcpy(t, f, n) __builtin_memcpy(t, f, n)
183#else
180#define memcpy(t, f, n) \ 184#define memcpy(t, f, n) \
181 (__builtin_constant_p((n)) \ 185 (__builtin_constant_p((n)) \
182 ? __constant_memcpy((t), (f), (n)) \ 186 ? __constant_memcpy((t), (f), (n)) \
183 : __memcpy((t), (f), (n))) 187 : __memcpy((t), (f), (n)))
188#endif
184#else 189#else
185/* 190/*
186 * kmemcheck becomes very happy if we use the REP instructions unconditionally, 191 * kmemcheck becomes very happy if we use the REP instructions unconditionally,
@@ -316,11 +321,15 @@ void *__constant_c_and_count_memset(void *s, unsigned long pattern,
316 : __memset_generic((s), (c), (count))) 321 : __memset_generic((s), (c), (count)))
317 322
318#define __HAVE_ARCH_MEMSET 323#define __HAVE_ARCH_MEMSET
324#if (__GNUC__ >= 4)
325#define memset(s, c, count) __builtin_memset(s, c, count)
326#else
319#define memset(s, c, count) \ 327#define memset(s, c, count) \
320 (__builtin_constant_p(c) \ 328 (__builtin_constant_p(c) \
321 ? __constant_c_x_memset((s), (0x01010101UL * (unsigned char)(c)), \ 329 ? __constant_c_x_memset((s), (0x01010101UL * (unsigned char)(c)), \
322 (count)) \ 330 (count)) \
323 : __memset((s), (c), (count))) 331 : __memset((s), (c), (count)))
332#endif
324 333
325/* 334/*
326 * find the first occurrence of byte 'c', or 1 past the area if none 335 * find the first occurrence of byte 'c', or 1 past the area if none
diff --git a/arch/x86/include/asm/svm.h b/arch/x86/include/asm/svm.h
index 85574b7c1bc1..1fecb7e61130 100644
--- a/arch/x86/include/asm/svm.h
+++ b/arch/x86/include/asm/svm.h
@@ -57,7 +57,8 @@ struct __attribute__ ((__packed__)) vmcb_control_area {
57 u16 intercept_dr_write; 57 u16 intercept_dr_write;
58 u32 intercept_exceptions; 58 u32 intercept_exceptions;
59 u64 intercept; 59 u64 intercept;
60 u8 reserved_1[44]; 60 u8 reserved_1[42];
61 u16 pause_filter_count;
61 u64 iopm_base_pa; 62 u64 iopm_base_pa;
62 u64 msrpm_base_pa; 63 u64 msrpm_base_pa;
63 u64 tsc_offset; 64 u64 tsc_offset;
diff --git a/arch/x86/include/asm/swiotlb.h b/arch/x86/include/asm/swiotlb.h
index b9e4e20174fb..87ffcb12a1b8 100644
--- a/arch/x86/include/asm/swiotlb.h
+++ b/arch/x86/include/asm/swiotlb.h
@@ -3,17 +3,14 @@
3 3
4#include <linux/swiotlb.h> 4#include <linux/swiotlb.h>
5 5
6/* SWIOTLB interface */
7
8extern int swiotlb_force;
9
10#ifdef CONFIG_SWIOTLB 6#ifdef CONFIG_SWIOTLB
11extern int swiotlb; 7extern int swiotlb;
12extern void pci_swiotlb_init(void); 8extern int pci_swiotlb_init(void);
13#else 9#else
14#define swiotlb 0 10#define swiotlb 0
15static inline void pci_swiotlb_init(void) 11static inline int pci_swiotlb_init(void)
16{ 12{
13 return 0;
17} 14}
18#endif 15#endif
19 16
diff --git a/arch/x86/include/asm/sys_ia32.h b/arch/x86/include/asm/sys_ia32.h
index 72a6dcd1299b..9af9decb38c3 100644
--- a/arch/x86/include/asm/sys_ia32.h
+++ b/arch/x86/include/asm/sys_ia32.h
@@ -51,11 +51,6 @@ asmlinkage long sys32_sched_rr_get_interval(compat_pid_t,
51asmlinkage long sys32_rt_sigpending(compat_sigset_t __user *, compat_size_t); 51asmlinkage long sys32_rt_sigpending(compat_sigset_t __user *, compat_size_t);
52asmlinkage long sys32_rt_sigqueueinfo(int, int, compat_siginfo_t __user *); 52asmlinkage long sys32_rt_sigqueueinfo(int, int, compat_siginfo_t __user *);
53 53
54#ifdef CONFIG_SYSCTL_SYSCALL
55struct sysctl_ia32;
56asmlinkage long sys32_sysctl(struct sysctl_ia32 __user *);
57#endif
58
59asmlinkage long sys32_pread(unsigned int, char __user *, u32, u32, u32); 54asmlinkage long sys32_pread(unsigned int, char __user *, u32, u32, u32);
60asmlinkage long sys32_pwrite(unsigned int, char __user *, u32, u32, u32); 55asmlinkage long sys32_pwrite(unsigned int, char __user *, u32, u32, u32);
61 56
diff --git a/arch/x86/include/asm/system.h b/arch/x86/include/asm/system.h
index f08f97374892..022a84386de8 100644
--- a/arch/x86/include/asm/system.h
+++ b/arch/x86/include/asm/system.h
@@ -128,8 +128,6 @@ do { \
128 "movq %%rsp,%P[threadrsp](%[prev])\n\t" /* save RSP */ \ 128 "movq %%rsp,%P[threadrsp](%[prev])\n\t" /* save RSP */ \
129 "movq %P[threadrsp](%[next]),%%rsp\n\t" /* restore RSP */ \ 129 "movq %P[threadrsp](%[next]),%%rsp\n\t" /* restore RSP */ \
130 "call __switch_to\n\t" \ 130 "call __switch_to\n\t" \
131 ".globl thread_return\n" \
132 "thread_return:\n\t" \
133 "movq "__percpu_arg([current_task])",%%rsi\n\t" \ 131 "movq "__percpu_arg([current_task])",%%rsi\n\t" \
134 __switch_canary \ 132 __switch_canary \
135 "movq %P[thread_info](%%rsi),%%r8\n\t" \ 133 "movq %P[thread_info](%%rsi),%%r8\n\t" \
@@ -157,19 +155,22 @@ extern void native_load_gs_index(unsigned);
157 * Load a segment. Fall back on loading the zero 155 * Load a segment. Fall back on loading the zero
158 * segment if something goes wrong.. 156 * segment if something goes wrong..
159 */ 157 */
160#define loadsegment(seg, value) \ 158#define loadsegment(seg, value) \
161 asm volatile("\n" \ 159do { \
162 "1:\t" \ 160 unsigned short __val = (value); \
163 "movl %k0,%%" #seg "\n" \ 161 \
164 "2:\n" \ 162 asm volatile(" \n" \
165 ".section .fixup,\"ax\"\n" \ 163 "1: movl %k0,%%" #seg " \n" \
166 "3:\t" \ 164 \
167 "movl %k1, %%" #seg "\n\t" \ 165 ".section .fixup,\"ax\" \n" \
168 "jmp 2b\n" \ 166 "2: xorl %k0,%k0 \n" \
169 ".previous\n" \ 167 " jmp 1b \n" \
170 _ASM_EXTABLE(1b,3b) \ 168 ".previous \n" \
171 : :"r" (value), "r" (0) : "memory") 169 \
172 170 _ASM_EXTABLE(1b, 2b) \
171 \
172 : "+r" (__val) : : "memory"); \
173} while (0)
173 174
174/* 175/*
175 * Save a segment register away 176 * Save a segment register away
diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h
index d27d0a2fec4c..375c917c37d2 100644
--- a/arch/x86/include/asm/thread_info.h
+++ b/arch/x86/include/asm/thread_info.h
@@ -83,6 +83,7 @@ struct thread_info {
83#define TIF_SYSCALL_AUDIT 7 /* syscall auditing active */ 83#define TIF_SYSCALL_AUDIT 7 /* syscall auditing active */
84#define TIF_SECCOMP 8 /* secure computing */ 84#define TIF_SECCOMP 8 /* secure computing */
85#define TIF_MCE_NOTIFY 10 /* notify userspace of an MCE */ 85#define TIF_MCE_NOTIFY 10 /* notify userspace of an MCE */
86#define TIF_USER_RETURN_NOTIFY 11 /* notify kernel of userspace return */
86#define TIF_NOTSC 16 /* TSC is not accessible in userland */ 87#define TIF_NOTSC 16 /* TSC is not accessible in userland */
87#define TIF_IA32 17 /* 32bit process */ 88#define TIF_IA32 17 /* 32bit process */
88#define TIF_FORK 18 /* ret_from_fork */ 89#define TIF_FORK 18 /* ret_from_fork */
@@ -107,6 +108,7 @@ struct thread_info {
107#define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT) 108#define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT)
108#define _TIF_SECCOMP (1 << TIF_SECCOMP) 109#define _TIF_SECCOMP (1 << TIF_SECCOMP)
109#define _TIF_MCE_NOTIFY (1 << TIF_MCE_NOTIFY) 110#define _TIF_MCE_NOTIFY (1 << TIF_MCE_NOTIFY)
111#define _TIF_USER_RETURN_NOTIFY (1 << TIF_USER_RETURN_NOTIFY)
110#define _TIF_NOTSC (1 << TIF_NOTSC) 112#define _TIF_NOTSC (1 << TIF_NOTSC)
111#define _TIF_IA32 (1 << TIF_IA32) 113#define _TIF_IA32 (1 << TIF_IA32)
112#define _TIF_FORK (1 << TIF_FORK) 114#define _TIF_FORK (1 << TIF_FORK)
@@ -142,13 +144,14 @@ struct thread_info {
142 144
143/* Only used for 64 bit */ 145/* Only used for 64 bit */
144#define _TIF_DO_NOTIFY_MASK \ 146#define _TIF_DO_NOTIFY_MASK \
145 (_TIF_SIGPENDING|_TIF_MCE_NOTIFY|_TIF_NOTIFY_RESUME) 147 (_TIF_SIGPENDING | _TIF_MCE_NOTIFY | _TIF_NOTIFY_RESUME | \
148 _TIF_USER_RETURN_NOTIFY)
146 149
147/* flags to check in __switch_to() */ 150/* flags to check in __switch_to() */
148#define _TIF_WORK_CTXSW \ 151#define _TIF_WORK_CTXSW \
149 (_TIF_IO_BITMAP|_TIF_DEBUGCTLMSR|_TIF_DS_AREA_MSR|_TIF_NOTSC) 152 (_TIF_IO_BITMAP|_TIF_DEBUGCTLMSR|_TIF_DS_AREA_MSR|_TIF_NOTSC)
150 153
151#define _TIF_WORK_CTXSW_PREV _TIF_WORK_CTXSW 154#define _TIF_WORK_CTXSW_PREV (_TIF_WORK_CTXSW|_TIF_USER_RETURN_NOTIFY)
152#define _TIF_WORK_CTXSW_NEXT (_TIF_WORK_CTXSW|_TIF_DEBUG) 155#define _TIF_WORK_CTXSW_NEXT (_TIF_WORK_CTXSW|_TIF_DEBUG)
153 156
154#define PREEMPT_ACTIVE 0x10000000 157#define PREEMPT_ACTIVE 0x10000000
diff --git a/arch/x86/include/asm/uaccess.h b/arch/x86/include/asm/uaccess.h
index d2c6c930b491..abd3e0ea762a 100644
--- a/arch/x86/include/asm/uaccess.h
+++ b/arch/x86/include/asm/uaccess.h
@@ -570,7 +570,6 @@ extern struct movsl_mask {
570#ifdef CONFIG_X86_32 570#ifdef CONFIG_X86_32
571# include "uaccess_32.h" 571# include "uaccess_32.h"
572#else 572#else
573# define ARCH_HAS_SEARCH_EXTABLE
574# include "uaccess_64.h" 573# include "uaccess_64.h"
575#endif 574#endif
576 575
diff --git a/arch/x86/include/asm/uaccess_32.h b/arch/x86/include/asm/uaccess_32.h
index 632fb44b4cb5..0c9825e97f36 100644
--- a/arch/x86/include/asm/uaccess_32.h
+++ b/arch/x86/include/asm/uaccess_32.h
@@ -187,9 +187,34 @@ __copy_from_user_inatomic_nocache(void *to, const void __user *from,
187 187
188unsigned long __must_check copy_to_user(void __user *to, 188unsigned long __must_check copy_to_user(void __user *to,
189 const void *from, unsigned long n); 189 const void *from, unsigned long n);
190unsigned long __must_check copy_from_user(void *to, 190unsigned long __must_check _copy_from_user(void *to,
191 const void __user *from, 191 const void __user *from,
192 unsigned long n); 192 unsigned long n);
193
194
195extern void copy_from_user_overflow(void)
196#ifdef CONFIG_DEBUG_STRICT_USER_COPY_CHECKS
197 __compiletime_error("copy_from_user() buffer size is not provably correct")
198#else
199 __compiletime_warning("copy_from_user() buffer size is not provably correct")
200#endif
201;
202
203static inline unsigned long __must_check copy_from_user(void *to,
204 const void __user *from,
205 unsigned long n)
206{
207 int sz = __compiletime_object_size(to);
208 int ret = -EFAULT;
209
210 if (likely(sz == -1 || sz >= n))
211 ret = _copy_from_user(to, from, n);
212 else
213 copy_from_user_overflow();
214
215 return ret;
216}
217
193long __must_check strncpy_from_user(char *dst, const char __user *src, 218long __must_check strncpy_from_user(char *dst, const char __user *src,
194 long count); 219 long count);
195long __must_check __strncpy_from_user(char *dst, 220long __must_check __strncpy_from_user(char *dst,
diff --git a/arch/x86/include/asm/uaccess_64.h b/arch/x86/include/asm/uaccess_64.h
index db24b215fc50..46324c6a4f6e 100644
--- a/arch/x86/include/asm/uaccess_64.h
+++ b/arch/x86/include/asm/uaccess_64.h
@@ -19,12 +19,37 @@ __must_check unsigned long
19copy_user_generic(void *to, const void *from, unsigned len); 19copy_user_generic(void *to, const void *from, unsigned len);
20 20
21__must_check unsigned long 21__must_check unsigned long
22copy_to_user(void __user *to, const void *from, unsigned len); 22_copy_to_user(void __user *to, const void *from, unsigned len);
23__must_check unsigned long 23__must_check unsigned long
24copy_from_user(void *to, const void __user *from, unsigned len); 24_copy_from_user(void *to, const void __user *from, unsigned len);
25__must_check unsigned long 25__must_check unsigned long
26copy_in_user(void __user *to, const void __user *from, unsigned len); 26copy_in_user(void __user *to, const void __user *from, unsigned len);
27 27
28static inline unsigned long __must_check copy_from_user(void *to,
29 const void __user *from,
30 unsigned long n)
31{
32 int sz = __compiletime_object_size(to);
33 int ret = -EFAULT;
34
35 might_fault();
36 if (likely(sz == -1 || sz >= n))
37 ret = _copy_from_user(to, from, n);
38#ifdef CONFIG_DEBUG_VM
39 else
40 WARN(1, "Buffer overflow detected!\n");
41#endif
42 return ret;
43}
44
45static __always_inline __must_check
46int copy_to_user(void __user *dst, const void *src, unsigned size)
47{
48 might_fault();
49
50 return _copy_to_user(dst, src, size);
51}
52
28static __always_inline __must_check 53static __always_inline __must_check
29int __copy_from_user(void *dst, const void __user *src, unsigned size) 54int __copy_from_user(void *dst, const void __user *src, unsigned size)
30{ 55{
@@ -176,8 +201,11 @@ __must_check long strlen_user(const char __user *str);
176__must_check unsigned long clear_user(void __user *mem, unsigned long len); 201__must_check unsigned long clear_user(void __user *mem, unsigned long len);
177__must_check unsigned long __clear_user(void __user *mem, unsigned long len); 202__must_check unsigned long __clear_user(void __user *mem, unsigned long len);
178 203
179__must_check long __copy_from_user_inatomic(void *dst, const void __user *src, 204static __must_check __always_inline int
180 unsigned size); 205__copy_from_user_inatomic(void *dst, const void __user *src, unsigned size)
206{
207 return copy_user_generic(dst, (__force const void *)src, size);
208}
181 209
182static __must_check __always_inline int 210static __must_check __always_inline int
183__copy_to_user_inatomic(void __user *dst, const void *src, unsigned size) 211__copy_to_user_inatomic(void __user *dst, const void *src, unsigned size)
diff --git a/arch/x86/include/asm/unistd_32.h b/arch/x86/include/asm/unistd_32.h
index 6fb3c209a7e3..3baf379fa840 100644
--- a/arch/x86/include/asm/unistd_32.h
+++ b/arch/x86/include/asm/unistd_32.h
@@ -342,10 +342,11 @@
342#define __NR_pwritev 334 342#define __NR_pwritev 334
343#define __NR_rt_tgsigqueueinfo 335 343#define __NR_rt_tgsigqueueinfo 335
344#define __NR_perf_event_open 336 344#define __NR_perf_event_open 336
345#define __NR_recvmmsg 337
345 346
346#ifdef __KERNEL__ 347#ifdef __KERNEL__
347 348
348#define NR_syscalls 337 349#define NR_syscalls 338
349 350
350#define __ARCH_WANT_IPC_PARSE_VERSION 351#define __ARCH_WANT_IPC_PARSE_VERSION
351#define __ARCH_WANT_OLD_READDIR 352#define __ARCH_WANT_OLD_READDIR
diff --git a/arch/x86/include/asm/unistd_64.h b/arch/x86/include/asm/unistd_64.h
index 8d3ad0adbc68..4843f7ba754a 100644
--- a/arch/x86/include/asm/unistd_64.h
+++ b/arch/x86/include/asm/unistd_64.h
@@ -661,6 +661,8 @@ __SYSCALL(__NR_pwritev, sys_pwritev)
661__SYSCALL(__NR_rt_tgsigqueueinfo, sys_rt_tgsigqueueinfo) 661__SYSCALL(__NR_rt_tgsigqueueinfo, sys_rt_tgsigqueueinfo)
662#define __NR_perf_event_open 298 662#define __NR_perf_event_open 298
663__SYSCALL(__NR_perf_event_open, sys_perf_event_open) 663__SYSCALL(__NR_perf_event_open, sys_perf_event_open)
664#define __NR_recvmmsg 299
665__SYSCALL(__NR_recvmmsg, sys_recvmmsg)
664 666
665#ifndef __NO_STUBS 667#ifndef __NO_STUBS
666#define __ARCH_WANT_OLD_READDIR 668#define __ARCH_WANT_OLD_READDIR
diff --git a/arch/x86/include/asm/uv/uv_irq.h b/arch/x86/include/asm/uv/uv_irq.h
index 9613c8c0b647..d6b17c760622 100644
--- a/arch/x86/include/asm/uv/uv_irq.h
+++ b/arch/x86/include/asm/uv/uv_irq.h
@@ -25,12 +25,14 @@ struct uv_IO_APIC_route_entry {
25 dest : 32; 25 dest : 32;
26}; 26};
27 27
28extern struct irq_chip uv_irq_chip; 28enum {
29 29 UV_AFFINITY_ALL,
30extern int arch_enable_uv_irq(char *, unsigned int, int, int, unsigned long); 30 UV_AFFINITY_NODE,
31extern void arch_disable_uv_irq(int, unsigned long); 31 UV_AFFINITY_CPU
32};
32 33
33extern int uv_setup_irq(char *, int, int, unsigned long); 34extern int uv_irq_2_mmr_info(int, unsigned long *, int *);
34extern void uv_teardown_irq(unsigned int, int, unsigned long); 35extern int uv_setup_irq(char *, int, int, unsigned long, int);
36extern void uv_teardown_irq(unsigned int);
35 37
36#endif /* _ASM_X86_UV_UV_IRQ_H */ 38#endif /* _ASM_X86_UV_UV_IRQ_H */
diff --git a/arch/x86/include/asm/vmx.h b/arch/x86/include/asm/vmx.h
index 272514c2d456..2b4945419a84 100644
--- a/arch/x86/include/asm/vmx.h
+++ b/arch/x86/include/asm/vmx.h
@@ -56,6 +56,7 @@
56#define SECONDARY_EXEC_ENABLE_VPID 0x00000020 56#define SECONDARY_EXEC_ENABLE_VPID 0x00000020
57#define SECONDARY_EXEC_WBINVD_EXITING 0x00000040 57#define SECONDARY_EXEC_WBINVD_EXITING 0x00000040
58#define SECONDARY_EXEC_UNRESTRICTED_GUEST 0x00000080 58#define SECONDARY_EXEC_UNRESTRICTED_GUEST 0x00000080
59#define SECONDARY_EXEC_PAUSE_LOOP_EXITING 0x00000400
59 60
60 61
61#define PIN_BASED_EXT_INTR_MASK 0x00000001 62#define PIN_BASED_EXT_INTR_MASK 0x00000001
@@ -144,6 +145,8 @@ enum vmcs_field {
144 VM_ENTRY_INSTRUCTION_LEN = 0x0000401a, 145 VM_ENTRY_INSTRUCTION_LEN = 0x0000401a,
145 TPR_THRESHOLD = 0x0000401c, 146 TPR_THRESHOLD = 0x0000401c,
146 SECONDARY_VM_EXEC_CONTROL = 0x0000401e, 147 SECONDARY_VM_EXEC_CONTROL = 0x0000401e,
148 PLE_GAP = 0x00004020,
149 PLE_WINDOW = 0x00004022,
147 VM_INSTRUCTION_ERROR = 0x00004400, 150 VM_INSTRUCTION_ERROR = 0x00004400,
148 VM_EXIT_REASON = 0x00004402, 151 VM_EXIT_REASON = 0x00004402,
149 VM_EXIT_INTR_INFO = 0x00004404, 152 VM_EXIT_INTR_INFO = 0x00004404,
@@ -248,6 +251,7 @@ enum vmcs_field {
248#define EXIT_REASON_MSR_READ 31 251#define EXIT_REASON_MSR_READ 31
249#define EXIT_REASON_MSR_WRITE 32 252#define EXIT_REASON_MSR_WRITE 32
250#define EXIT_REASON_MWAIT_INSTRUCTION 36 253#define EXIT_REASON_MWAIT_INSTRUCTION 36
254#define EXIT_REASON_PAUSE_INSTRUCTION 40
251#define EXIT_REASON_MCE_DURING_VMENTRY 41 255#define EXIT_REASON_MCE_DURING_VMENTRY 41
252#define EXIT_REASON_TPR_BELOW_THRESHOLD 43 256#define EXIT_REASON_TPR_BELOW_THRESHOLD 43
253#define EXIT_REASON_APIC_ACCESS 44 257#define EXIT_REASON_APIC_ACCESS 44
diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h
index 2c756fd4ab0e..ea0e8ea15e15 100644
--- a/arch/x86/include/asm/x86_init.h
+++ b/arch/x86/include/asm/x86_init.h
@@ -26,7 +26,7 @@ struct x86_init_mpparse {
26 void (*smp_read_mpc_oem)(struct mpc_table *mpc); 26 void (*smp_read_mpc_oem)(struct mpc_table *mpc);
27 void (*mpc_oem_pci_bus)(struct mpc_bus *m); 27 void (*mpc_oem_pci_bus)(struct mpc_bus *m);
28 void (*mpc_oem_bus_info)(struct mpc_bus *m, char *name); 28 void (*mpc_oem_bus_info)(struct mpc_bus *m, char *name);
29 void (*find_smp_config)(unsigned int reserve); 29 void (*find_smp_config)(void);
30 void (*get_smp_config)(unsigned int early); 30 void (*get_smp_config)(unsigned int early);
31}; 31};
32 32
@@ -91,6 +91,14 @@ struct x86_init_timers {
91}; 91};
92 92
93/** 93/**
94 * struct x86_init_iommu - platform specific iommu setup
95 * @iommu_init: platform specific iommu setup
96 */
97struct x86_init_iommu {
98 int (*iommu_init)(void);
99};
100
101/**
94 * struct x86_init_ops - functions for platform specific setup 102 * struct x86_init_ops - functions for platform specific setup
95 * 103 *
96 */ 104 */
@@ -101,6 +109,7 @@ struct x86_init_ops {
101 struct x86_init_oem oem; 109 struct x86_init_oem oem;
102 struct x86_init_paging paging; 110 struct x86_init_paging paging;
103 struct x86_init_timers timers; 111 struct x86_init_timers timers;
112 struct x86_init_iommu iommu;
104}; 113};
105 114
106/** 115/**
@@ -116,11 +125,14 @@ struct x86_cpuinit_ops {
116 * @calibrate_tsc: calibrate TSC 125 * @calibrate_tsc: calibrate TSC
117 * @get_wallclock: get time from HW clock like RTC etc. 126 * @get_wallclock: get time from HW clock like RTC etc.
118 * @set_wallclock: set time back to HW clock 127 * @set_wallclock: set time back to HW clock
128 * @is_untracked_pat_range exclude from PAT logic
119 */ 129 */
120struct x86_platform_ops { 130struct x86_platform_ops {
121 unsigned long (*calibrate_tsc)(void); 131 unsigned long (*calibrate_tsc)(void);
122 unsigned long (*get_wallclock)(void); 132 unsigned long (*get_wallclock)(void);
123 int (*set_wallclock)(unsigned long nowtime); 133 int (*set_wallclock)(unsigned long nowtime);
134 void (*iommu_shutdown)(void);
135 bool (*is_untracked_pat_range)(u64 start, u64 end);
124}; 136};
125 137
126extern struct x86_init_ops x86_init; 138extern struct x86_init_ops x86_init;
diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile
index d8e5d0cdd678..4f2e66e29ecc 100644
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
@@ -40,7 +40,7 @@ obj-$(CONFIG_X86_64) += sys_x86_64.o x8664_ksyms_64.o
40obj-$(CONFIG_X86_64) += syscall_64.o vsyscall_64.o 40obj-$(CONFIG_X86_64) += syscall_64.o vsyscall_64.o
41obj-y += bootflag.o e820.o 41obj-y += bootflag.o e820.o
42obj-y += pci-dma.o quirks.o i8237.o topology.o kdebugfs.o 42obj-y += pci-dma.o quirks.o i8237.o topology.o kdebugfs.o
43obj-y += alternative.o i8253.o pci-nommu.o 43obj-y += alternative.o i8253.o pci-nommu.o hw_breakpoint.o
44obj-y += tsc.o io_delay.o rtc.o 44obj-y += tsc.o io_delay.o rtc.o
45 45
46obj-$(CONFIG_X86_TRAMPOLINE) += trampoline.o 46obj-$(CONFIG_X86_TRAMPOLINE) += trampoline.o
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index 67e929b89875..87eee07da21f 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -624,6 +624,7 @@ static int __init acpi_parse_hpet(struct acpi_table_header *table)
624 } 624 }
625 625
626 hpet_address = hpet_tbl->address.address; 626 hpet_address = hpet_tbl->address.address;
627 hpet_blockid = hpet_tbl->sequence;
627 628
628 /* 629 /*
629 * Some broken BIOSes advertise HPET at 0x0. We really do not 630 * Some broken BIOSes advertise HPET at 0x0. We really do not
diff --git a/arch/x86/kernel/acpi/processor.c b/arch/x86/kernel/acpi/processor.c
index d296f4a195c9..d85d1b2432ba 100644
--- a/arch/x86/kernel/acpi/processor.c
+++ b/arch/x86/kernel/acpi/processor.c
@@ -79,7 +79,8 @@ void arch_acpi_processor_init_pdc(struct acpi_processor *pr)
79 struct cpuinfo_x86 *c = &cpu_data(pr->id); 79 struct cpuinfo_x86 *c = &cpu_data(pr->id);
80 80
81 pr->pdc = NULL; 81 pr->pdc = NULL;
82 if (c->x86_vendor == X86_VENDOR_INTEL) 82 if (c->x86_vendor == X86_VENDOR_INTEL ||
83 c->x86_vendor == X86_VENDOR_CENTAUR)
83 init_intel_pdc(pr, c); 84 init_intel_pdc(pr, c);
84 85
85 return; 86 return;
diff --git a/arch/x86/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep.c
index ca93638ba430..82e508677b91 100644
--- a/arch/x86/kernel/acpi/sleep.c
+++ b/arch/x86/kernel/acpi/sleep.c
@@ -78,12 +78,9 @@ int acpi_save_state_mem(void)
78#ifndef CONFIG_64BIT 78#ifndef CONFIG_64BIT
79 store_gdt((struct desc_ptr *)&header->pmode_gdt); 79 store_gdt((struct desc_ptr *)&header->pmode_gdt);
80 80
81 header->pmode_efer_low = nx_enabled; 81 if (rdmsr_safe(MSR_EFER, &header->pmode_efer_low,
82 if (header->pmode_efer_low & 1) { 82 &header->pmode_efer_high))
83 /* This is strange, why not save efer, always? */ 83 header->pmode_efer_low = header->pmode_efer_high = 0;
84 rdmsr(MSR_EFER, header->pmode_efer_low,
85 header->pmode_efer_high);
86 }
87#endif /* !CONFIG_64BIT */ 84#endif /* !CONFIG_64BIT */
88 85
89 header->pmode_cr0 = read_cr0(); 86 header->pmode_cr0 = read_cr0();
@@ -119,29 +116,32 @@ void acpi_restore_state_mem(void)
119 116
120 117
121/** 118/**
122 * acpi_reserve_bootmem - do _very_ early ACPI initialisation 119 * acpi_reserve_wakeup_memory - do _very_ early ACPI initialisation
123 * 120 *
124 * We allocate a page from the first 1MB of memory for the wakeup 121 * We allocate a page from the first 1MB of memory for the wakeup
125 * routine for when we come back from a sleep state. The 122 * routine for when we come back from a sleep state. The
126 * runtime allocator allows specification of <16MB pages, but not 123 * runtime allocator allows specification of <16MB pages, but not
127 * <1MB pages. 124 * <1MB pages.
128 */ 125 */
129void __init acpi_reserve_bootmem(void) 126void __init acpi_reserve_wakeup_memory(void)
130{ 127{
128 unsigned long mem;
129
131 if ((&wakeup_code_end - &wakeup_code_start) > WAKEUP_SIZE) { 130 if ((&wakeup_code_end - &wakeup_code_start) > WAKEUP_SIZE) {
132 printk(KERN_ERR 131 printk(KERN_ERR
133 "ACPI: Wakeup code way too big, S3 disabled.\n"); 132 "ACPI: Wakeup code way too big, S3 disabled.\n");
134 return; 133 return;
135 } 134 }
136 135
137 acpi_realmode = (unsigned long)alloc_bootmem_low(WAKEUP_SIZE); 136 mem = find_e820_area(0, 1<<20, WAKEUP_SIZE, PAGE_SIZE);
138 137
139 if (!acpi_realmode) { 138 if (mem == -1L) {
140 printk(KERN_ERR "ACPI: Cannot allocate lowmem, S3 disabled.\n"); 139 printk(KERN_ERR "ACPI: Cannot allocate lowmem, S3 disabled.\n");
141 return; 140 return;
142 } 141 }
143 142 acpi_realmode = (unsigned long) phys_to_virt(mem);
144 acpi_wakeup_address = virt_to_phys((void *)acpi_realmode); 143 acpi_wakeup_address = mem;
144 reserve_early(mem, mem + WAKEUP_SIZE, "ACPI WAKEUP");
145} 145}
146 146
147 147
diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c
index 0285521e0a99..32fb09102a13 100644
--- a/arch/x86/kernel/amd_iommu.c
+++ b/arch/x86/kernel/amd_iommu.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2007-2008 Advanced Micro Devices, Inc. 2 * Copyright (C) 2007-2009 Advanced Micro Devices, Inc.
3 * Author: Joerg Roedel <joerg.roedel@amd.com> 3 * Author: Joerg Roedel <joerg.roedel@amd.com>
4 * Leo Duran <leo.duran@amd.com> 4 * Leo Duran <leo.duran@amd.com>
5 * 5 *
@@ -28,6 +28,7 @@
28#include <asm/proto.h> 28#include <asm/proto.h>
29#include <asm/iommu.h> 29#include <asm/iommu.h>
30#include <asm/gart.h> 30#include <asm/gart.h>
31#include <asm/amd_iommu_proto.h>
31#include <asm/amd_iommu_types.h> 32#include <asm/amd_iommu_types.h>
32#include <asm/amd_iommu.h> 33#include <asm/amd_iommu.h>
33 34
@@ -56,20 +57,115 @@ struct iommu_cmd {
56 u32 data[4]; 57 u32 data[4];
57}; 58};
58 59
59static int dma_ops_unity_map(struct dma_ops_domain *dma_dom,
60 struct unity_map_entry *e);
61static struct dma_ops_domain *find_protection_domain(u16 devid);
62static u64 *alloc_pte(struct protection_domain *domain,
63 unsigned long address, int end_lvl,
64 u64 **pte_page, gfp_t gfp);
65static void dma_ops_reserve_addresses(struct dma_ops_domain *dom,
66 unsigned long start_page,
67 unsigned int pages);
68static void reset_iommu_command_buffer(struct amd_iommu *iommu); 60static void reset_iommu_command_buffer(struct amd_iommu *iommu);
69static u64 *fetch_pte(struct protection_domain *domain,
70 unsigned long address, int map_size);
71static void update_domain(struct protection_domain *domain); 61static void update_domain(struct protection_domain *domain);
72 62
63/****************************************************************************
64 *
65 * Helper functions
66 *
67 ****************************************************************************/
68
69static inline u16 get_device_id(struct device *dev)
70{
71 struct pci_dev *pdev = to_pci_dev(dev);
72
73 return calc_devid(pdev->bus->number, pdev->devfn);
74}
75
76static struct iommu_dev_data *get_dev_data(struct device *dev)
77{
78 return dev->archdata.iommu;
79}
80
81/*
82 * In this function the list of preallocated protection domains is traversed to
83 * find the domain for a specific device
84 */
85static struct dma_ops_domain *find_protection_domain(u16 devid)
86{
87 struct dma_ops_domain *entry, *ret = NULL;
88 unsigned long flags;
89 u16 alias = amd_iommu_alias_table[devid];
90
91 if (list_empty(&iommu_pd_list))
92 return NULL;
93
94 spin_lock_irqsave(&iommu_pd_list_lock, flags);
95
96 list_for_each_entry(entry, &iommu_pd_list, list) {
97 if (entry->target_dev == devid ||
98 entry->target_dev == alias) {
99 ret = entry;
100 break;
101 }
102 }
103
104 spin_unlock_irqrestore(&iommu_pd_list_lock, flags);
105
106 return ret;
107}
108
109/*
110 * This function checks if the driver got a valid device from the caller to
111 * avoid dereferencing invalid pointers.
112 */
113static bool check_device(struct device *dev)
114{
115 u16 devid;
116
117 if (!dev || !dev->dma_mask)
118 return false;
119
120 /* No device or no PCI device */
121 if (!dev || dev->bus != &pci_bus_type)
122 return false;
123
124 devid = get_device_id(dev);
125
126 /* Out of our scope? */
127 if (devid > amd_iommu_last_bdf)
128 return false;
129
130 if (amd_iommu_rlookup_table[devid] == NULL)
131 return false;
132
133 return true;
134}
135
136static int iommu_init_device(struct device *dev)
137{
138 struct iommu_dev_data *dev_data;
139 struct pci_dev *pdev;
140 u16 devid, alias;
141
142 if (dev->archdata.iommu)
143 return 0;
144
145 dev_data = kzalloc(sizeof(*dev_data), GFP_KERNEL);
146 if (!dev_data)
147 return -ENOMEM;
148
149 dev_data->dev = dev;
150
151 devid = get_device_id(dev);
152 alias = amd_iommu_alias_table[devid];
153 pdev = pci_get_bus_and_slot(PCI_BUS(alias), alias & 0xff);
154 if (pdev)
155 dev_data->alias = &pdev->dev;
156
157 atomic_set(&dev_data->bind, 0);
158
159 dev->archdata.iommu = dev_data;
160
161
162 return 0;
163}
164
165static void iommu_uninit_device(struct device *dev)
166{
167 kfree(dev->archdata.iommu);
168}
73#ifdef CONFIG_AMD_IOMMU_STATS 169#ifdef CONFIG_AMD_IOMMU_STATS
74 170
75/* 171/*
@@ -90,7 +186,6 @@ DECLARE_STATS_COUNTER(alloced_io_mem);
90DECLARE_STATS_COUNTER(total_map_requests); 186DECLARE_STATS_COUNTER(total_map_requests);
91 187
92static struct dentry *stats_dir; 188static struct dentry *stats_dir;
93static struct dentry *de_isolate;
94static struct dentry *de_fflush; 189static struct dentry *de_fflush;
95 190
96static void amd_iommu_stats_add(struct __iommu_counter *cnt) 191static void amd_iommu_stats_add(struct __iommu_counter *cnt)
@@ -108,9 +203,6 @@ static void amd_iommu_stats_init(void)
108 if (stats_dir == NULL) 203 if (stats_dir == NULL)
109 return; 204 return;
110 205
111 de_isolate = debugfs_create_bool("isolation", 0444, stats_dir,
112 (u32 *)&amd_iommu_isolate);
113
114 de_fflush = debugfs_create_bool("fullflush", 0444, stats_dir, 206 de_fflush = debugfs_create_bool("fullflush", 0444, stats_dir,
115 (u32 *)&amd_iommu_unmap_flush); 207 (u32 *)&amd_iommu_unmap_flush);
116 208
@@ -130,12 +222,6 @@ static void amd_iommu_stats_init(void)
130 222
131#endif 223#endif
132 224
133/* returns !0 if the IOMMU is caching non-present entries in its TLB */
134static int iommu_has_npcache(struct amd_iommu *iommu)
135{
136 return iommu->cap & (1UL << IOMMU_CAP_NPCACHE);
137}
138
139/**************************************************************************** 225/****************************************************************************
140 * 226 *
141 * Interrupt handling functions 227 * Interrupt handling functions
@@ -199,6 +285,7 @@ static void iommu_print_event(struct amd_iommu *iommu, void *__evt)
199 break; 285 break;
200 case EVENT_TYPE_ILL_CMD: 286 case EVENT_TYPE_ILL_CMD:
201 printk("ILLEGAL_COMMAND_ERROR address=0x%016llx]\n", address); 287 printk("ILLEGAL_COMMAND_ERROR address=0x%016llx]\n", address);
288 iommu->reset_in_progress = true;
202 reset_iommu_command_buffer(iommu); 289 reset_iommu_command_buffer(iommu);
203 dump_command(address); 290 dump_command(address);
204 break; 291 break;
@@ -321,11 +408,8 @@ static void __iommu_wait_for_completion(struct amd_iommu *iommu)
321 status &= ~MMIO_STATUS_COM_WAIT_INT_MASK; 408 status &= ~MMIO_STATUS_COM_WAIT_INT_MASK;
322 writel(status, iommu->mmio_base + MMIO_STATUS_OFFSET); 409 writel(status, iommu->mmio_base + MMIO_STATUS_OFFSET);
323 410
324 if (unlikely(i == EXIT_LOOP_COUNT)) { 411 if (unlikely(i == EXIT_LOOP_COUNT))
325 spin_unlock(&iommu->lock); 412 iommu->reset_in_progress = true;
326 reset_iommu_command_buffer(iommu);
327 spin_lock(&iommu->lock);
328 }
329} 413}
330 414
331/* 415/*
@@ -372,26 +456,46 @@ static int iommu_completion_wait(struct amd_iommu *iommu)
372out: 456out:
373 spin_unlock_irqrestore(&iommu->lock, flags); 457 spin_unlock_irqrestore(&iommu->lock, flags);
374 458
459 if (iommu->reset_in_progress)
460 reset_iommu_command_buffer(iommu);
461
375 return 0; 462 return 0;
376} 463}
377 464
465static void iommu_flush_complete(struct protection_domain *domain)
466{
467 int i;
468
469 for (i = 0; i < amd_iommus_present; ++i) {
470 if (!domain->dev_iommu[i])
471 continue;
472
473 /*
474 * Devices of this domain are behind this IOMMU
475 * We need to wait for completion of all commands.
476 */
477 iommu_completion_wait(amd_iommus[i]);
478 }
479}
480
378/* 481/*
379 * Command send function for invalidating a device table entry 482 * Command send function for invalidating a device table entry
380 */ 483 */
381static int iommu_queue_inv_dev_entry(struct amd_iommu *iommu, u16 devid) 484static int iommu_flush_device(struct device *dev)
382{ 485{
486 struct amd_iommu *iommu;
383 struct iommu_cmd cmd; 487 struct iommu_cmd cmd;
384 int ret; 488 u16 devid;
385 489
386 BUG_ON(iommu == NULL); 490 devid = get_device_id(dev);
491 iommu = amd_iommu_rlookup_table[devid];
387 492
493 /* Build command */
388 memset(&cmd, 0, sizeof(cmd)); 494 memset(&cmd, 0, sizeof(cmd));
389 CMD_SET_TYPE(&cmd, CMD_INV_DEV_ENTRY); 495 CMD_SET_TYPE(&cmd, CMD_INV_DEV_ENTRY);
390 cmd.data[0] = devid; 496 cmd.data[0] = devid;
391 497
392 ret = iommu_queue_command(iommu, &cmd); 498 return iommu_queue_command(iommu, &cmd);
393
394 return ret;
395} 499}
396 500
397static void __iommu_build_inv_iommu_pages(struct iommu_cmd *cmd, u64 address, 501static void __iommu_build_inv_iommu_pages(struct iommu_cmd *cmd, u64 address,
@@ -430,11 +534,11 @@ static int iommu_queue_inv_iommu_pages(struct amd_iommu *iommu,
430 * It invalidates a single PTE if the range to flush is within a single 534 * It invalidates a single PTE if the range to flush is within a single
431 * page. Otherwise it flushes the whole TLB of the IOMMU. 535 * page. Otherwise it flushes the whole TLB of the IOMMU.
432 */ 536 */
433static int iommu_flush_pages(struct amd_iommu *iommu, u16 domid, 537static void __iommu_flush_pages(struct protection_domain *domain,
434 u64 address, size_t size) 538 u64 address, size_t size, int pde)
435{ 539{
436 int s = 0; 540 int s = 0, i;
437 unsigned pages = iommu_num_pages(address, size, PAGE_SIZE); 541 unsigned long pages = iommu_num_pages(address, size, PAGE_SIZE);
438 542
439 address &= PAGE_MASK; 543 address &= PAGE_MASK;
440 544
@@ -447,142 +551,212 @@ static int iommu_flush_pages(struct amd_iommu *iommu, u16 domid,
447 s = 1; 551 s = 1;
448 } 552 }
449 553
450 iommu_queue_inv_iommu_pages(iommu, address, domid, 0, s);
451 554
452 return 0; 555 for (i = 0; i < amd_iommus_present; ++i) {
556 if (!domain->dev_iommu[i])
557 continue;
558
559 /*
560 * Devices of this domain are behind this IOMMU
561 * We need a TLB flush
562 */
563 iommu_queue_inv_iommu_pages(amd_iommus[i], address,
564 domain->id, pde, s);
565 }
566
567 return;
453} 568}
454 569
455/* Flush the whole IO/TLB for a given protection domain */ 570static void iommu_flush_pages(struct protection_domain *domain,
456static void iommu_flush_tlb(struct amd_iommu *iommu, u16 domid) 571 u64 address, size_t size)
457{ 572{
458 u64 address = CMD_INV_IOMMU_ALL_PAGES_ADDRESS; 573 __iommu_flush_pages(domain, address, size, 0);
459 574}
460 INC_STATS_COUNTER(domain_flush_single);
461 575
462 iommu_queue_inv_iommu_pages(iommu, address, domid, 0, 1); 576/* Flush the whole IO/TLB for a given protection domain */
577static void iommu_flush_tlb(struct protection_domain *domain)
578{
579 __iommu_flush_pages(domain, 0, CMD_INV_IOMMU_ALL_PAGES_ADDRESS, 0);
463} 580}
464 581
465/* Flush the whole IO/TLB for a given protection domain - including PDE */ 582/* Flush the whole IO/TLB for a given protection domain - including PDE */
466static void iommu_flush_tlb_pde(struct amd_iommu *iommu, u16 domid) 583static void iommu_flush_tlb_pde(struct protection_domain *domain)
467{ 584{
468 u64 address = CMD_INV_IOMMU_ALL_PAGES_ADDRESS; 585 __iommu_flush_pages(domain, 0, CMD_INV_IOMMU_ALL_PAGES_ADDRESS, 1);
469
470 INC_STATS_COUNTER(domain_flush_single);
471
472 iommu_queue_inv_iommu_pages(iommu, address, domid, 1, 1);
473} 586}
474 587
588
475/* 589/*
476 * This function flushes one domain on one IOMMU 590 * This function flushes the DTEs for all devices in domain
477 */ 591 */
478static void flush_domain_on_iommu(struct amd_iommu *iommu, u16 domid) 592static void iommu_flush_domain_devices(struct protection_domain *domain)
479{ 593{
480 struct iommu_cmd cmd; 594 struct iommu_dev_data *dev_data;
481 unsigned long flags; 595 unsigned long flags;
482 596
483 __iommu_build_inv_iommu_pages(&cmd, CMD_INV_IOMMU_ALL_PAGES_ADDRESS, 597 spin_lock_irqsave(&domain->lock, flags);
484 domid, 1, 1);
485 598
486 spin_lock_irqsave(&iommu->lock, flags); 599 list_for_each_entry(dev_data, &domain->dev_list, list)
487 __iommu_queue_command(iommu, &cmd); 600 iommu_flush_device(dev_data->dev);
488 __iommu_completion_wait(iommu); 601
489 __iommu_wait_for_completion(iommu); 602 spin_unlock_irqrestore(&domain->lock, flags);
490 spin_unlock_irqrestore(&iommu->lock, flags);
491} 603}
492 604
493static void flush_all_domains_on_iommu(struct amd_iommu *iommu) 605static void iommu_flush_all_domain_devices(void)
494{ 606{
495 int i; 607 struct protection_domain *domain;
608 unsigned long flags;
496 609
497 for (i = 1; i < MAX_DOMAIN_ID; ++i) { 610 spin_lock_irqsave(&amd_iommu_pd_lock, flags);
498 if (!test_bit(i, amd_iommu_pd_alloc_bitmap)) 611
499 continue; 612 list_for_each_entry(domain, &amd_iommu_pd_list, list) {
500 flush_domain_on_iommu(iommu, i); 613 iommu_flush_domain_devices(domain);
614 iommu_flush_complete(domain);
501 } 615 }
502 616
617 spin_unlock_irqrestore(&amd_iommu_pd_lock, flags);
618}
619
620void amd_iommu_flush_all_devices(void)
621{
622 iommu_flush_all_domain_devices();
503} 623}
504 624
505/* 625/*
506 * This function is used to flush the IO/TLB for a given protection domain 626 * This function uses heavy locking and may disable irqs for some time. But
507 * on every IOMMU in the system 627 * this is no issue because it is only called during resume.
508 */ 628 */
509static void iommu_flush_domain(u16 domid) 629void amd_iommu_flush_all_domains(void)
510{ 630{
511 struct amd_iommu *iommu; 631 struct protection_domain *domain;
632 unsigned long flags;
512 633
513 INC_STATS_COUNTER(domain_flush_all); 634 spin_lock_irqsave(&amd_iommu_pd_lock, flags);
514 635
515 for_each_iommu(iommu) 636 list_for_each_entry(domain, &amd_iommu_pd_list, list) {
516 flush_domain_on_iommu(iommu, domid); 637 spin_lock(&domain->lock);
638 iommu_flush_tlb_pde(domain);
639 iommu_flush_complete(domain);
640 spin_unlock(&domain->lock);
641 }
642
643 spin_unlock_irqrestore(&amd_iommu_pd_lock, flags);
517} 644}
518 645
519void amd_iommu_flush_all_domains(void) 646static void reset_iommu_command_buffer(struct amd_iommu *iommu)
520{ 647{
521 struct amd_iommu *iommu; 648 pr_err("AMD-Vi: Resetting IOMMU command buffer\n");
522 649
523 for_each_iommu(iommu) 650 if (iommu->reset_in_progress)
524 flush_all_domains_on_iommu(iommu); 651 panic("AMD-Vi: ILLEGAL_COMMAND_ERROR while resetting command buffer\n");
652
653 amd_iommu_reset_cmd_buffer(iommu);
654 amd_iommu_flush_all_devices();
655 amd_iommu_flush_all_domains();
656
657 iommu->reset_in_progress = false;
525} 658}
526 659
527static void flush_all_devices_for_iommu(struct amd_iommu *iommu) 660/****************************************************************************
661 *
662 * The functions below are used the create the page table mappings for
663 * unity mapped regions.
664 *
665 ****************************************************************************/
666
667/*
668 * This function is used to add another level to an IO page table. Adding
669 * another level increases the size of the address space by 9 bits to a size up
670 * to 64 bits.
671 */
672static bool increase_address_space(struct protection_domain *domain,
673 gfp_t gfp)
528{ 674{
529 int i; 675 u64 *pte;
530 676
531 for (i = 0; i <= amd_iommu_last_bdf; ++i) { 677 if (domain->mode == PAGE_MODE_6_LEVEL)
532 if (iommu != amd_iommu_rlookup_table[i]) 678 /* address space already 64 bit large */
533 continue; 679 return false;
534 680
535 iommu_queue_inv_dev_entry(iommu, i); 681 pte = (void *)get_zeroed_page(gfp);
536 iommu_completion_wait(iommu); 682 if (!pte)
537 } 683 return false;
684
685 *pte = PM_LEVEL_PDE(domain->mode,
686 virt_to_phys(domain->pt_root));
687 domain->pt_root = pte;
688 domain->mode += 1;
689 domain->updated = true;
690
691 return true;
538} 692}
539 693
540static void flush_devices_by_domain(struct protection_domain *domain) 694static u64 *alloc_pte(struct protection_domain *domain,
695 unsigned long address,
696 int end_lvl,
697 u64 **pte_page,
698 gfp_t gfp)
541{ 699{
542 struct amd_iommu *iommu; 700 u64 *pte, *page;
543 int i; 701 int level;
544 702
545 for (i = 0; i <= amd_iommu_last_bdf; ++i) { 703 while (address > PM_LEVEL_SIZE(domain->mode))
546 if ((domain == NULL && amd_iommu_pd_table[i] == NULL) || 704 increase_address_space(domain, gfp);
547 (amd_iommu_pd_table[i] != domain))
548 continue;
549 705
550 iommu = amd_iommu_rlookup_table[i]; 706 level = domain->mode - 1;
551 if (!iommu) 707 pte = &domain->pt_root[PM_LEVEL_INDEX(level, address)];
552 continue;
553 708
554 iommu_queue_inv_dev_entry(iommu, i); 709 while (level > end_lvl) {
555 iommu_completion_wait(iommu); 710 if (!IOMMU_PTE_PRESENT(*pte)) {
711 page = (u64 *)get_zeroed_page(gfp);
712 if (!page)
713 return NULL;
714 *pte = PM_LEVEL_PDE(level, virt_to_phys(page));
715 }
716
717 level -= 1;
718
719 pte = IOMMU_PTE_PAGE(*pte);
720
721 if (pte_page && level == end_lvl)
722 *pte_page = pte;
723
724 pte = &pte[PM_LEVEL_INDEX(level, address)];
556 } 725 }
726
727 return pte;
557} 728}
558 729
559static void reset_iommu_command_buffer(struct amd_iommu *iommu) 730/*
731 * This function checks if there is a PTE for a given dma address. If
732 * there is one, it returns the pointer to it.
733 */
734static u64 *fetch_pte(struct protection_domain *domain,
735 unsigned long address, int map_size)
560{ 736{
561 pr_err("AMD-Vi: Resetting IOMMU command buffer\n"); 737 int level;
738 u64 *pte;
562 739
563 if (iommu->reset_in_progress) 740 level = domain->mode - 1;
564 panic("AMD-Vi: ILLEGAL_COMMAND_ERROR while resetting command buffer\n"); 741 pte = &domain->pt_root[PM_LEVEL_INDEX(level, address)];
565 742
566 iommu->reset_in_progress = true; 743 while (level > map_size) {
744 if (!IOMMU_PTE_PRESENT(*pte))
745 return NULL;
567 746
568 amd_iommu_reset_cmd_buffer(iommu); 747 level -= 1;
569 flush_all_devices_for_iommu(iommu);
570 flush_all_domains_on_iommu(iommu);
571 748
572 iommu->reset_in_progress = false; 749 pte = IOMMU_PTE_PAGE(*pte);
573} 750 pte = &pte[PM_LEVEL_INDEX(level, address)];
574 751
575void amd_iommu_flush_all_devices(void) 752 if ((PM_PTE_LEVEL(*pte) == 0) && level != map_size) {
576{ 753 pte = NULL;
577 flush_devices_by_domain(NULL); 754 break;
578} 755 }
756 }
579 757
580/**************************************************************************** 758 return pte;
581 * 759}
582 * The functions below are used the create the page table mappings for
583 * unity mapped regions.
584 *
585 ****************************************************************************/
586 760
587/* 761/*
588 * Generic mapping functions. It maps a physical address into a DMA 762 * Generic mapping functions. It maps a physical address into a DMA
@@ -654,28 +828,6 @@ static int iommu_for_unity_map(struct amd_iommu *iommu,
654} 828}
655 829
656/* 830/*
657 * Init the unity mappings for a specific IOMMU in the system
658 *
659 * Basically iterates over all unity mapping entries and applies them to
660 * the default domain DMA of that IOMMU if necessary.
661 */
662static int iommu_init_unity_mappings(struct amd_iommu *iommu)
663{
664 struct unity_map_entry *entry;
665 int ret;
666
667 list_for_each_entry(entry, &amd_iommu_unity_map, list) {
668 if (!iommu_for_unity_map(iommu, entry))
669 continue;
670 ret = dma_ops_unity_map(iommu->default_dom, entry);
671 if (ret)
672 return ret;
673 }
674
675 return 0;
676}
677
678/*
679 * This function actually applies the mapping to the page table of the 831 * This function actually applies the mapping to the page table of the
680 * dma_ops domain. 832 * dma_ops domain.
681 */ 833 */
@@ -704,6 +856,28 @@ static int dma_ops_unity_map(struct dma_ops_domain *dma_dom,
704} 856}
705 857
706/* 858/*
859 * Init the unity mappings for a specific IOMMU in the system
860 *
861 * Basically iterates over all unity mapping entries and applies them to
862 * the default domain DMA of that IOMMU if necessary.
863 */
864static int iommu_init_unity_mappings(struct amd_iommu *iommu)
865{
866 struct unity_map_entry *entry;
867 int ret;
868
869 list_for_each_entry(entry, &amd_iommu_unity_map, list) {
870 if (!iommu_for_unity_map(iommu, entry))
871 continue;
872 ret = dma_ops_unity_map(iommu->default_dom, entry);
873 if (ret)
874 return ret;
875 }
876
877 return 0;
878}
879
880/*
707 * Inits the unity mappings required for a specific device 881 * Inits the unity mappings required for a specific device
708 */ 882 */
709static int init_unity_mappings_for_device(struct dma_ops_domain *dma_dom, 883static int init_unity_mappings_for_device(struct dma_ops_domain *dma_dom,
@@ -740,34 +914,23 @@ static int init_unity_mappings_for_device(struct dma_ops_domain *dma_dom,
740 */ 914 */
741 915
742/* 916/*
743 * This function checks if there is a PTE for a given dma address. If 917 * Used to reserve address ranges in the aperture (e.g. for exclusion
744 * there is one, it returns the pointer to it. 918 * ranges.
745 */ 919 */
746static u64 *fetch_pte(struct protection_domain *domain, 920static void dma_ops_reserve_addresses(struct dma_ops_domain *dom,
747 unsigned long address, int map_size) 921 unsigned long start_page,
922 unsigned int pages)
748{ 923{
749 int level; 924 unsigned int i, last_page = dom->aperture_size >> PAGE_SHIFT;
750 u64 *pte;
751
752 level = domain->mode - 1;
753 pte = &domain->pt_root[PM_LEVEL_INDEX(level, address)];
754
755 while (level > map_size) {
756 if (!IOMMU_PTE_PRESENT(*pte))
757 return NULL;
758
759 level -= 1;
760 925
761 pte = IOMMU_PTE_PAGE(*pte); 926 if (start_page + pages > last_page)
762 pte = &pte[PM_LEVEL_INDEX(level, address)]; 927 pages = last_page - start_page;
763 928
764 if ((PM_PTE_LEVEL(*pte) == 0) && level != map_size) { 929 for (i = start_page; i < start_page + pages; ++i) {
765 pte = NULL; 930 int index = i / APERTURE_RANGE_PAGES;
766 break; 931 int page = i % APERTURE_RANGE_PAGES;
767 } 932 __set_bit(page, dom->aperture[index]->bitmap);
768 } 933 }
769
770 return pte;
771} 934}
772 935
773/* 936/*
@@ -775,11 +938,11 @@ static u64 *fetch_pte(struct protection_domain *domain,
775 * aperture in case of dma_ops domain allocation or address allocation 938 * aperture in case of dma_ops domain allocation or address allocation
776 * failure. 939 * failure.
777 */ 940 */
778static int alloc_new_range(struct amd_iommu *iommu, 941static int alloc_new_range(struct dma_ops_domain *dma_dom,
779 struct dma_ops_domain *dma_dom,
780 bool populate, gfp_t gfp) 942 bool populate, gfp_t gfp)
781{ 943{
782 int index = dma_dom->aperture_size >> APERTURE_RANGE_SHIFT; 944 int index = dma_dom->aperture_size >> APERTURE_RANGE_SHIFT;
945 struct amd_iommu *iommu;
783 int i; 946 int i;
784 947
785#ifdef CONFIG_IOMMU_STRESS 948#ifdef CONFIG_IOMMU_STRESS
@@ -819,14 +982,17 @@ static int alloc_new_range(struct amd_iommu *iommu,
819 dma_dom->aperture_size += APERTURE_RANGE_SIZE; 982 dma_dom->aperture_size += APERTURE_RANGE_SIZE;
820 983
821 /* Intialize the exclusion range if necessary */ 984 /* Intialize the exclusion range if necessary */
822 if (iommu->exclusion_start && 985 for_each_iommu(iommu) {
823 iommu->exclusion_start >= dma_dom->aperture[index]->offset && 986 if (iommu->exclusion_start &&
824 iommu->exclusion_start < dma_dom->aperture_size) { 987 iommu->exclusion_start >= dma_dom->aperture[index]->offset
825 unsigned long startpage = iommu->exclusion_start >> PAGE_SHIFT; 988 && iommu->exclusion_start < dma_dom->aperture_size) {
826 int pages = iommu_num_pages(iommu->exclusion_start, 989 unsigned long startpage;
827 iommu->exclusion_length, 990 int pages = iommu_num_pages(iommu->exclusion_start,
828 PAGE_SIZE); 991 iommu->exclusion_length,
829 dma_ops_reserve_addresses(dma_dom, startpage, pages); 992 PAGE_SIZE);
993 startpage = iommu->exclusion_start >> PAGE_SHIFT;
994 dma_ops_reserve_addresses(dma_dom, startpage, pages);
995 }
830 } 996 }
831 997
832 /* 998 /*
@@ -928,7 +1094,7 @@ static unsigned long dma_ops_alloc_addresses(struct device *dev,
928 } 1094 }
929 1095
930 if (unlikely(address == -1)) 1096 if (unlikely(address == -1))
931 address = bad_dma_address; 1097 address = DMA_ERROR_CODE;
932 1098
933 WARN_ON((address + (PAGE_SIZE*pages)) > dom->aperture_size); 1099 WARN_ON((address + (PAGE_SIZE*pages)) > dom->aperture_size);
934 1100
@@ -973,6 +1139,31 @@ static void dma_ops_free_addresses(struct dma_ops_domain *dom,
973 * 1139 *
974 ****************************************************************************/ 1140 ****************************************************************************/
975 1141
1142/*
1143 * This function adds a protection domain to the global protection domain list
1144 */
1145static void add_domain_to_list(struct protection_domain *domain)
1146{
1147 unsigned long flags;
1148
1149 spin_lock_irqsave(&amd_iommu_pd_lock, flags);
1150 list_add(&domain->list, &amd_iommu_pd_list);
1151 spin_unlock_irqrestore(&amd_iommu_pd_lock, flags);
1152}
1153
1154/*
1155 * This function removes a protection domain to the global
1156 * protection domain list
1157 */
1158static void del_domain_from_list(struct protection_domain *domain)
1159{
1160 unsigned long flags;
1161
1162 spin_lock_irqsave(&amd_iommu_pd_lock, flags);
1163 list_del(&domain->list);
1164 spin_unlock_irqrestore(&amd_iommu_pd_lock, flags);
1165}
1166
976static u16 domain_id_alloc(void) 1167static u16 domain_id_alloc(void)
977{ 1168{
978 unsigned long flags; 1169 unsigned long flags;
@@ -1000,26 +1191,6 @@ static void domain_id_free(int id)
1000 write_unlock_irqrestore(&amd_iommu_devtable_lock, flags); 1191 write_unlock_irqrestore(&amd_iommu_devtable_lock, flags);
1001} 1192}
1002 1193
1003/*
1004 * Used to reserve address ranges in the aperture (e.g. for exclusion
1005 * ranges.
1006 */
1007static void dma_ops_reserve_addresses(struct dma_ops_domain *dom,
1008 unsigned long start_page,
1009 unsigned int pages)
1010{
1011 unsigned int i, last_page = dom->aperture_size >> PAGE_SHIFT;
1012
1013 if (start_page + pages > last_page)
1014 pages = last_page - start_page;
1015
1016 for (i = start_page; i < start_page + pages; ++i) {
1017 int index = i / APERTURE_RANGE_PAGES;
1018 int page = i % APERTURE_RANGE_PAGES;
1019 __set_bit(page, dom->aperture[index]->bitmap);
1020 }
1021}
1022
1023static void free_pagetable(struct protection_domain *domain) 1194static void free_pagetable(struct protection_domain *domain)
1024{ 1195{
1025 int i, j; 1196 int i, j;
@@ -1061,6 +1232,8 @@ static void dma_ops_domain_free(struct dma_ops_domain *dom)
1061 if (!dom) 1232 if (!dom)
1062 return; 1233 return;
1063 1234
1235 del_domain_from_list(&dom->domain);
1236
1064 free_pagetable(&dom->domain); 1237 free_pagetable(&dom->domain);
1065 1238
1066 for (i = 0; i < APERTURE_MAX_RANGES; ++i) { 1239 for (i = 0; i < APERTURE_MAX_RANGES; ++i) {
@@ -1078,7 +1251,7 @@ static void dma_ops_domain_free(struct dma_ops_domain *dom)
1078 * It also intializes the page table and the address allocator data 1251 * It also intializes the page table and the address allocator data
1079 * structures required for the dma_ops interface 1252 * structures required for the dma_ops interface
1080 */ 1253 */
1081static struct dma_ops_domain *dma_ops_domain_alloc(struct amd_iommu *iommu) 1254static struct dma_ops_domain *dma_ops_domain_alloc(void)
1082{ 1255{
1083 struct dma_ops_domain *dma_dom; 1256 struct dma_ops_domain *dma_dom;
1084 1257
@@ -1091,6 +1264,7 @@ static struct dma_ops_domain *dma_ops_domain_alloc(struct amd_iommu *iommu)
1091 dma_dom->domain.id = domain_id_alloc(); 1264 dma_dom->domain.id = domain_id_alloc();
1092 if (dma_dom->domain.id == 0) 1265 if (dma_dom->domain.id == 0)
1093 goto free_dma_dom; 1266 goto free_dma_dom;
1267 INIT_LIST_HEAD(&dma_dom->domain.dev_list);
1094 dma_dom->domain.mode = PAGE_MODE_2_LEVEL; 1268 dma_dom->domain.mode = PAGE_MODE_2_LEVEL;
1095 dma_dom->domain.pt_root = (void *)get_zeroed_page(GFP_KERNEL); 1269 dma_dom->domain.pt_root = (void *)get_zeroed_page(GFP_KERNEL);
1096 dma_dom->domain.flags = PD_DMA_OPS_MASK; 1270 dma_dom->domain.flags = PD_DMA_OPS_MASK;
@@ -1101,7 +1275,9 @@ static struct dma_ops_domain *dma_ops_domain_alloc(struct amd_iommu *iommu)
1101 dma_dom->need_flush = false; 1275 dma_dom->need_flush = false;
1102 dma_dom->target_dev = 0xffff; 1276 dma_dom->target_dev = 0xffff;
1103 1277
1104 if (alloc_new_range(iommu, dma_dom, true, GFP_KERNEL)) 1278 add_domain_to_list(&dma_dom->domain);
1279
1280 if (alloc_new_range(dma_dom, true, GFP_KERNEL))
1105 goto free_dma_dom; 1281 goto free_dma_dom;
1106 1282
1107 /* 1283 /*
@@ -1129,22 +1305,6 @@ static bool dma_ops_domain(struct protection_domain *domain)
1129 return domain->flags & PD_DMA_OPS_MASK; 1305 return domain->flags & PD_DMA_OPS_MASK;
1130} 1306}
1131 1307
1132/*
1133 * Find out the protection domain structure for a given PCI device. This
1134 * will give us the pointer to the page table root for example.
1135 */
1136static struct protection_domain *domain_for_device(u16 devid)
1137{
1138 struct protection_domain *dom;
1139 unsigned long flags;
1140
1141 read_lock_irqsave(&amd_iommu_devtable_lock, flags);
1142 dom = amd_iommu_pd_table[devid];
1143 read_unlock_irqrestore(&amd_iommu_devtable_lock, flags);
1144
1145 return dom;
1146}
1147
1148static void set_dte_entry(u16 devid, struct protection_domain *domain) 1308static void set_dte_entry(u16 devid, struct protection_domain *domain)
1149{ 1309{
1150 u64 pte_root = virt_to_phys(domain->pt_root); 1310 u64 pte_root = virt_to_phys(domain->pt_root);
@@ -1156,42 +1316,123 @@ static void set_dte_entry(u16 devid, struct protection_domain *domain)
1156 amd_iommu_dev_table[devid].data[2] = domain->id; 1316 amd_iommu_dev_table[devid].data[2] = domain->id;
1157 amd_iommu_dev_table[devid].data[1] = upper_32_bits(pte_root); 1317 amd_iommu_dev_table[devid].data[1] = upper_32_bits(pte_root);
1158 amd_iommu_dev_table[devid].data[0] = lower_32_bits(pte_root); 1318 amd_iommu_dev_table[devid].data[0] = lower_32_bits(pte_root);
1319}
1320
1321static void clear_dte_entry(u16 devid)
1322{
1323 /* remove entry from the device table seen by the hardware */
1324 amd_iommu_dev_table[devid].data[0] = IOMMU_PTE_P | IOMMU_PTE_TV;
1325 amd_iommu_dev_table[devid].data[1] = 0;
1326 amd_iommu_dev_table[devid].data[2] = 0;
1159 1327
1160 amd_iommu_pd_table[devid] = domain; 1328 amd_iommu_apply_erratum_63(devid);
1329}
1330
1331static void do_attach(struct device *dev, struct protection_domain *domain)
1332{
1333 struct iommu_dev_data *dev_data;
1334 struct amd_iommu *iommu;
1335 u16 devid;
1336
1337 devid = get_device_id(dev);
1338 iommu = amd_iommu_rlookup_table[devid];
1339 dev_data = get_dev_data(dev);
1340
1341 /* Update data structures */
1342 dev_data->domain = domain;
1343 list_add(&dev_data->list, &domain->dev_list);
1344 set_dte_entry(devid, domain);
1345
1346 /* Do reference counting */
1347 domain->dev_iommu[iommu->index] += 1;
1348 domain->dev_cnt += 1;
1349
1350 /* Flush the DTE entry */
1351 iommu_flush_device(dev);
1352}
1353
1354static void do_detach(struct device *dev)
1355{
1356 struct iommu_dev_data *dev_data;
1357 struct amd_iommu *iommu;
1358 u16 devid;
1359
1360 devid = get_device_id(dev);
1361 iommu = amd_iommu_rlookup_table[devid];
1362 dev_data = get_dev_data(dev);
1363
1364 /* decrease reference counters */
1365 dev_data->domain->dev_iommu[iommu->index] -= 1;
1366 dev_data->domain->dev_cnt -= 1;
1367
1368 /* Update data structures */
1369 dev_data->domain = NULL;
1370 list_del(&dev_data->list);
1371 clear_dte_entry(devid);
1372
1373 /* Flush the DTE entry */
1374 iommu_flush_device(dev);
1161} 1375}
1162 1376
1163/* 1377/*
1164 * If a device is not yet associated with a domain, this function does 1378 * If a device is not yet associated with a domain, this function does
1165 * assigns it visible for the hardware 1379 * assigns it visible for the hardware
1166 */ 1380 */
1167static void __attach_device(struct amd_iommu *iommu, 1381static int __attach_device(struct device *dev,
1168 struct protection_domain *domain, 1382 struct protection_domain *domain)
1169 u16 devid)
1170{ 1383{
1384 struct iommu_dev_data *dev_data, *alias_data;
1385
1386 dev_data = get_dev_data(dev);
1387 alias_data = get_dev_data(dev_data->alias);
1388
1389 if (!alias_data)
1390 return -EINVAL;
1391
1171 /* lock domain */ 1392 /* lock domain */
1172 spin_lock(&domain->lock); 1393 spin_lock(&domain->lock);
1173 1394
1174 /* update DTE entry */ 1395 /* Some sanity checks */
1175 set_dte_entry(devid, domain); 1396 if (alias_data->domain != NULL &&
1397 alias_data->domain != domain)
1398 return -EBUSY;
1176 1399
1177 domain->dev_cnt += 1; 1400 if (dev_data->domain != NULL &&
1401 dev_data->domain != domain)
1402 return -EBUSY;
1403
1404 /* Do real assignment */
1405 if (dev_data->alias != dev) {
1406 alias_data = get_dev_data(dev_data->alias);
1407 if (alias_data->domain == NULL)
1408 do_attach(dev_data->alias, domain);
1409
1410 atomic_inc(&alias_data->bind);
1411 }
1412
1413 if (dev_data->domain == NULL)
1414 do_attach(dev, domain);
1415
1416 atomic_inc(&dev_data->bind);
1178 1417
1179 /* ready */ 1418 /* ready */
1180 spin_unlock(&domain->lock); 1419 spin_unlock(&domain->lock);
1420
1421 return 0;
1181} 1422}
1182 1423
1183/* 1424/*
1184 * If a device is not yet associated with a domain, this function does 1425 * If a device is not yet associated with a domain, this function does
1185 * assigns it visible for the hardware 1426 * assigns it visible for the hardware
1186 */ 1427 */
1187static void attach_device(struct amd_iommu *iommu, 1428static int attach_device(struct device *dev,
1188 struct protection_domain *domain, 1429 struct protection_domain *domain)
1189 u16 devid)
1190{ 1430{
1191 unsigned long flags; 1431 unsigned long flags;
1432 int ret;
1192 1433
1193 write_lock_irqsave(&amd_iommu_devtable_lock, flags); 1434 write_lock_irqsave(&amd_iommu_devtable_lock, flags);
1194 __attach_device(iommu, domain, devid); 1435 ret = __attach_device(dev, domain);
1195 write_unlock_irqrestore(&amd_iommu_devtable_lock, flags); 1436 write_unlock_irqrestore(&amd_iommu_devtable_lock, flags);
1196 1437
1197 /* 1438 /*
@@ -1199,98 +1440,125 @@ static void attach_device(struct amd_iommu *iommu,
1199 * left the caches in the IOMMU dirty. So we have to flush 1440 * left the caches in the IOMMU dirty. So we have to flush
1200 * here to evict all dirty stuff. 1441 * here to evict all dirty stuff.
1201 */ 1442 */
1202 iommu_queue_inv_dev_entry(iommu, devid); 1443 iommu_flush_tlb_pde(domain);
1203 iommu_flush_tlb_pde(iommu, domain->id); 1444
1445 return ret;
1204} 1446}
1205 1447
1206/* 1448/*
1207 * Removes a device from a protection domain (unlocked) 1449 * Removes a device from a protection domain (unlocked)
1208 */ 1450 */
1209static void __detach_device(struct protection_domain *domain, u16 devid) 1451static void __detach_device(struct device *dev)
1210{ 1452{
1453 struct iommu_dev_data *dev_data = get_dev_data(dev);
1454 struct iommu_dev_data *alias_data;
1455 unsigned long flags;
1211 1456
1212 /* lock domain */ 1457 BUG_ON(!dev_data->domain);
1213 spin_lock(&domain->lock);
1214
1215 /* remove domain from the lookup table */
1216 amd_iommu_pd_table[devid] = NULL;
1217 1458
1218 /* remove entry from the device table seen by the hardware */ 1459 spin_lock_irqsave(&dev_data->domain->lock, flags);
1219 amd_iommu_dev_table[devid].data[0] = IOMMU_PTE_P | IOMMU_PTE_TV;
1220 amd_iommu_dev_table[devid].data[1] = 0;
1221 amd_iommu_dev_table[devid].data[2] = 0;
1222 1460
1223 amd_iommu_apply_erratum_63(devid); 1461 if (dev_data->alias != dev) {
1462 alias_data = get_dev_data(dev_data->alias);
1463 if (atomic_dec_and_test(&alias_data->bind))
1464 do_detach(dev_data->alias);
1465 }
1224 1466
1225 /* decrease reference counter */ 1467 if (atomic_dec_and_test(&dev_data->bind))
1226 domain->dev_cnt -= 1; 1468 do_detach(dev);
1227 1469
1228 /* ready */ 1470 spin_unlock_irqrestore(&dev_data->domain->lock, flags);
1229 spin_unlock(&domain->lock);
1230 1471
1231 /* 1472 /*
1232 * If we run in passthrough mode the device must be assigned to the 1473 * If we run in passthrough mode the device must be assigned to the
1233 * passthrough domain if it is detached from any other domain 1474 * passthrough domain if it is detached from any other domain
1234 */ 1475 */
1235 if (iommu_pass_through) { 1476 if (iommu_pass_through && dev_data->domain == NULL)
1236 struct amd_iommu *iommu = amd_iommu_rlookup_table[devid]; 1477 __attach_device(dev, pt_domain);
1237 __attach_device(iommu, pt_domain, devid);
1238 }
1239} 1478}
1240 1479
1241/* 1480/*
1242 * Removes a device from a protection domain (with devtable_lock held) 1481 * Removes a device from a protection domain (with devtable_lock held)
1243 */ 1482 */
1244static void detach_device(struct protection_domain *domain, u16 devid) 1483static void detach_device(struct device *dev)
1245{ 1484{
1246 unsigned long flags; 1485 unsigned long flags;
1247 1486
1248 /* lock device table */ 1487 /* lock device table */
1249 write_lock_irqsave(&amd_iommu_devtable_lock, flags); 1488 write_lock_irqsave(&amd_iommu_devtable_lock, flags);
1250 __detach_device(domain, devid); 1489 __detach_device(dev);
1251 write_unlock_irqrestore(&amd_iommu_devtable_lock, flags); 1490 write_unlock_irqrestore(&amd_iommu_devtable_lock, flags);
1252} 1491}
1253 1492
1493/*
1494 * Find out the protection domain structure for a given PCI device. This
1495 * will give us the pointer to the page table root for example.
1496 */
1497static struct protection_domain *domain_for_device(struct device *dev)
1498{
1499 struct protection_domain *dom;
1500 struct iommu_dev_data *dev_data, *alias_data;
1501 unsigned long flags;
1502 u16 devid, alias;
1503
1504 devid = get_device_id(dev);
1505 alias = amd_iommu_alias_table[devid];
1506 dev_data = get_dev_data(dev);
1507 alias_data = get_dev_data(dev_data->alias);
1508 if (!alias_data)
1509 return NULL;
1510
1511 read_lock_irqsave(&amd_iommu_devtable_lock, flags);
1512 dom = dev_data->domain;
1513 if (dom == NULL &&
1514 alias_data->domain != NULL) {
1515 __attach_device(dev, alias_data->domain);
1516 dom = alias_data->domain;
1517 }
1518
1519 read_unlock_irqrestore(&amd_iommu_devtable_lock, flags);
1520
1521 return dom;
1522}
1523
1254static int device_change_notifier(struct notifier_block *nb, 1524static int device_change_notifier(struct notifier_block *nb,
1255 unsigned long action, void *data) 1525 unsigned long action, void *data)
1256{ 1526{
1257 struct device *dev = data; 1527 struct device *dev = data;
1258 struct pci_dev *pdev = to_pci_dev(dev); 1528 u16 devid;
1259 u16 devid = calc_devid(pdev->bus->number, pdev->devfn);
1260 struct protection_domain *domain; 1529 struct protection_domain *domain;
1261 struct dma_ops_domain *dma_domain; 1530 struct dma_ops_domain *dma_domain;
1262 struct amd_iommu *iommu; 1531 struct amd_iommu *iommu;
1263 unsigned long flags; 1532 unsigned long flags;
1264 1533
1265 if (devid > amd_iommu_last_bdf) 1534 if (!check_device(dev))
1266 goto out; 1535 return 0;
1267
1268 devid = amd_iommu_alias_table[devid];
1269
1270 iommu = amd_iommu_rlookup_table[devid];
1271 if (iommu == NULL)
1272 goto out;
1273
1274 domain = domain_for_device(devid);
1275 1536
1276 if (domain && !dma_ops_domain(domain)) 1537 devid = get_device_id(dev);
1277 WARN_ONCE(1, "AMD IOMMU WARNING: device %s already bound " 1538 iommu = amd_iommu_rlookup_table[devid];
1278 "to a non-dma-ops domain\n", dev_name(dev));
1279 1539
1280 switch (action) { 1540 switch (action) {
1281 case BUS_NOTIFY_UNBOUND_DRIVER: 1541 case BUS_NOTIFY_UNBOUND_DRIVER:
1542
1543 domain = domain_for_device(dev);
1544
1282 if (!domain) 1545 if (!domain)
1283 goto out; 1546 goto out;
1284 if (iommu_pass_through) 1547 if (iommu_pass_through)
1285 break; 1548 break;
1286 detach_device(domain, devid); 1549 detach_device(dev);
1287 break; 1550 break;
1288 case BUS_NOTIFY_ADD_DEVICE: 1551 case BUS_NOTIFY_ADD_DEVICE:
1552
1553 iommu_init_device(dev);
1554
1555 domain = domain_for_device(dev);
1556
1289 /* allocate a protection domain if a device is added */ 1557 /* allocate a protection domain if a device is added */
1290 dma_domain = find_protection_domain(devid); 1558 dma_domain = find_protection_domain(devid);
1291 if (dma_domain) 1559 if (dma_domain)
1292 goto out; 1560 goto out;
1293 dma_domain = dma_ops_domain_alloc(iommu); 1561 dma_domain = dma_ops_domain_alloc();
1294 if (!dma_domain) 1562 if (!dma_domain)
1295 goto out; 1563 goto out;
1296 dma_domain->target_dev = devid; 1564 dma_domain->target_dev = devid;
@@ -1300,11 +1568,15 @@ static int device_change_notifier(struct notifier_block *nb,
1300 spin_unlock_irqrestore(&iommu_pd_list_lock, flags); 1568 spin_unlock_irqrestore(&iommu_pd_list_lock, flags);
1301 1569
1302 break; 1570 break;
1571 case BUS_NOTIFY_DEL_DEVICE:
1572
1573 iommu_uninit_device(dev);
1574
1303 default: 1575 default:
1304 goto out; 1576 goto out;
1305 } 1577 }
1306 1578
1307 iommu_queue_inv_dev_entry(iommu, devid); 1579 iommu_flush_device(dev);
1308 iommu_completion_wait(iommu); 1580 iommu_completion_wait(iommu);
1309 1581
1310out: 1582out:
@@ -1322,106 +1594,46 @@ static struct notifier_block device_nb = {
1322 *****************************************************************************/ 1594 *****************************************************************************/
1323 1595
1324/* 1596/*
1325 * This function checks if the driver got a valid device from the caller to
1326 * avoid dereferencing invalid pointers.
1327 */
1328static bool check_device(struct device *dev)
1329{
1330 if (!dev || !dev->dma_mask)
1331 return false;
1332
1333 return true;
1334}
1335
1336/*
1337 * In this function the list of preallocated protection domains is traversed to
1338 * find the domain for a specific device
1339 */
1340static struct dma_ops_domain *find_protection_domain(u16 devid)
1341{
1342 struct dma_ops_domain *entry, *ret = NULL;
1343 unsigned long flags;
1344
1345 if (list_empty(&iommu_pd_list))
1346 return NULL;
1347
1348 spin_lock_irqsave(&iommu_pd_list_lock, flags);
1349
1350 list_for_each_entry(entry, &iommu_pd_list, list) {
1351 if (entry->target_dev == devid) {
1352 ret = entry;
1353 break;
1354 }
1355 }
1356
1357 spin_unlock_irqrestore(&iommu_pd_list_lock, flags);
1358
1359 return ret;
1360}
1361
1362/*
1363 * In the dma_ops path we only have the struct device. This function 1597 * In the dma_ops path we only have the struct device. This function
1364 * finds the corresponding IOMMU, the protection domain and the 1598 * finds the corresponding IOMMU, the protection domain and the
1365 * requestor id for a given device. 1599 * requestor id for a given device.
1366 * If the device is not yet associated with a domain this is also done 1600 * If the device is not yet associated with a domain this is also done
1367 * in this function. 1601 * in this function.
1368 */ 1602 */
1369static int get_device_resources(struct device *dev, 1603static struct protection_domain *get_domain(struct device *dev)
1370 struct amd_iommu **iommu,
1371 struct protection_domain **domain,
1372 u16 *bdf)
1373{ 1604{
1605 struct protection_domain *domain;
1374 struct dma_ops_domain *dma_dom; 1606 struct dma_ops_domain *dma_dom;
1375 struct pci_dev *pcidev; 1607 u16 devid = get_device_id(dev);
1376 u16 _bdf;
1377
1378 *iommu = NULL;
1379 *domain = NULL;
1380 *bdf = 0xffff;
1381
1382 if (dev->bus != &pci_bus_type)
1383 return 0;
1384 1608
1385 pcidev = to_pci_dev(dev); 1609 if (!check_device(dev))
1386 _bdf = calc_devid(pcidev->bus->number, pcidev->devfn); 1610 return ERR_PTR(-EINVAL);
1387 1611
1388 /* device not translated by any IOMMU in the system? */ 1612 domain = domain_for_device(dev);
1389 if (_bdf > amd_iommu_last_bdf) 1613 if (domain != NULL && !dma_ops_domain(domain))
1390 return 0; 1614 return ERR_PTR(-EBUSY);
1391 1615
1392 *bdf = amd_iommu_alias_table[_bdf]; 1616 if (domain != NULL)
1617 return domain;
1393 1618
1394 *iommu = amd_iommu_rlookup_table[*bdf]; 1619 /* Device not bount yet - bind it */
1395 if (*iommu == NULL) 1620 dma_dom = find_protection_domain(devid);
1396 return 0; 1621 if (!dma_dom)
1397 *domain = domain_for_device(*bdf); 1622 dma_dom = amd_iommu_rlookup_table[devid]->default_dom;
1398 if (*domain == NULL) { 1623 attach_device(dev, &dma_dom->domain);
1399 dma_dom = find_protection_domain(*bdf); 1624 DUMP_printk("Using protection domain %d for device %s\n",
1400 if (!dma_dom) 1625 dma_dom->domain.id, dev_name(dev));
1401 dma_dom = (*iommu)->default_dom;
1402 *domain = &dma_dom->domain;
1403 attach_device(*iommu, *domain, *bdf);
1404 DUMP_printk("Using protection domain %d for device %s\n",
1405 (*domain)->id, dev_name(dev));
1406 }
1407
1408 if (domain_for_device(_bdf) == NULL)
1409 attach_device(*iommu, *domain, _bdf);
1410 1626
1411 return 1; 1627 return &dma_dom->domain;
1412} 1628}
1413 1629
1414static void update_device_table(struct protection_domain *domain) 1630static void update_device_table(struct protection_domain *domain)
1415{ 1631{
1416 unsigned long flags; 1632 struct iommu_dev_data *dev_data;
1417 int i;
1418 1633
1419 for (i = 0; i <= amd_iommu_last_bdf; ++i) { 1634 list_for_each_entry(dev_data, &domain->dev_list, list) {
1420 if (amd_iommu_pd_table[i] != domain) 1635 u16 devid = get_device_id(dev_data->dev);
1421 continue; 1636 set_dte_entry(devid, domain);
1422 write_lock_irqsave(&amd_iommu_devtable_lock, flags);
1423 set_dte_entry(i, domain);
1424 write_unlock_irqrestore(&amd_iommu_devtable_lock, flags);
1425 } 1637 }
1426} 1638}
1427 1639
@@ -1431,76 +1643,13 @@ static void update_domain(struct protection_domain *domain)
1431 return; 1643 return;
1432 1644
1433 update_device_table(domain); 1645 update_device_table(domain);
1434 flush_devices_by_domain(domain); 1646 iommu_flush_domain_devices(domain);
1435 iommu_flush_domain(domain->id); 1647 iommu_flush_tlb_pde(domain);
1436 1648
1437 domain->updated = false; 1649 domain->updated = false;
1438} 1650}
1439 1651
1440/* 1652/*
1441 * This function is used to add another level to an IO page table. Adding
1442 * another level increases the size of the address space by 9 bits to a size up
1443 * to 64 bits.
1444 */
1445static bool increase_address_space(struct protection_domain *domain,
1446 gfp_t gfp)
1447{
1448 u64 *pte;
1449
1450 if (domain->mode == PAGE_MODE_6_LEVEL)
1451 /* address space already 64 bit large */
1452 return false;
1453
1454 pte = (void *)get_zeroed_page(gfp);
1455 if (!pte)
1456 return false;
1457
1458 *pte = PM_LEVEL_PDE(domain->mode,
1459 virt_to_phys(domain->pt_root));
1460 domain->pt_root = pte;
1461 domain->mode += 1;
1462 domain->updated = true;
1463
1464 return true;
1465}
1466
1467static u64 *alloc_pte(struct protection_domain *domain,
1468 unsigned long address,
1469 int end_lvl,
1470 u64 **pte_page,
1471 gfp_t gfp)
1472{
1473 u64 *pte, *page;
1474 int level;
1475
1476 while (address > PM_LEVEL_SIZE(domain->mode))
1477 increase_address_space(domain, gfp);
1478
1479 level = domain->mode - 1;
1480 pte = &domain->pt_root[PM_LEVEL_INDEX(level, address)];
1481
1482 while (level > end_lvl) {
1483 if (!IOMMU_PTE_PRESENT(*pte)) {
1484 page = (u64 *)get_zeroed_page(gfp);
1485 if (!page)
1486 return NULL;
1487 *pte = PM_LEVEL_PDE(level, virt_to_phys(page));
1488 }
1489
1490 level -= 1;
1491
1492 pte = IOMMU_PTE_PAGE(*pte);
1493
1494 if (pte_page && level == end_lvl)
1495 *pte_page = pte;
1496
1497 pte = &pte[PM_LEVEL_INDEX(level, address)];
1498 }
1499
1500 return pte;
1501}
1502
1503/*
1504 * This function fetches the PTE for a given address in the aperture 1653 * This function fetches the PTE for a given address in the aperture
1505 */ 1654 */
1506static u64* dma_ops_get_pte(struct dma_ops_domain *dom, 1655static u64* dma_ops_get_pte(struct dma_ops_domain *dom,
@@ -1530,8 +1679,7 @@ static u64* dma_ops_get_pte(struct dma_ops_domain *dom,
1530 * This is the generic map function. It maps one 4kb page at paddr to 1679 * This is the generic map function. It maps one 4kb page at paddr to
1531 * the given address in the DMA address space for the domain. 1680 * the given address in the DMA address space for the domain.
1532 */ 1681 */
1533static dma_addr_t dma_ops_domain_map(struct amd_iommu *iommu, 1682static dma_addr_t dma_ops_domain_map(struct dma_ops_domain *dom,
1534 struct dma_ops_domain *dom,
1535 unsigned long address, 1683 unsigned long address,
1536 phys_addr_t paddr, 1684 phys_addr_t paddr,
1537 int direction) 1685 int direction)
@@ -1544,7 +1692,7 @@ static dma_addr_t dma_ops_domain_map(struct amd_iommu *iommu,
1544 1692
1545 pte = dma_ops_get_pte(dom, address); 1693 pte = dma_ops_get_pte(dom, address);
1546 if (!pte) 1694 if (!pte)
1547 return bad_dma_address; 1695 return DMA_ERROR_CODE;
1548 1696
1549 __pte = paddr | IOMMU_PTE_P | IOMMU_PTE_FC; 1697 __pte = paddr | IOMMU_PTE_P | IOMMU_PTE_FC;
1550 1698
@@ -1565,8 +1713,7 @@ static dma_addr_t dma_ops_domain_map(struct amd_iommu *iommu,
1565/* 1713/*
1566 * The generic unmapping function for on page in the DMA address space. 1714 * The generic unmapping function for on page in the DMA address space.
1567 */ 1715 */
1568static void dma_ops_domain_unmap(struct amd_iommu *iommu, 1716static void dma_ops_domain_unmap(struct dma_ops_domain *dom,
1569 struct dma_ops_domain *dom,
1570 unsigned long address) 1717 unsigned long address)
1571{ 1718{
1572 struct aperture_range *aperture; 1719 struct aperture_range *aperture;
@@ -1597,7 +1744,6 @@ static void dma_ops_domain_unmap(struct amd_iommu *iommu,
1597 * Must be called with the domain lock held. 1744 * Must be called with the domain lock held.
1598 */ 1745 */
1599static dma_addr_t __map_single(struct device *dev, 1746static dma_addr_t __map_single(struct device *dev,
1600 struct amd_iommu *iommu,
1601 struct dma_ops_domain *dma_dom, 1747 struct dma_ops_domain *dma_dom,
1602 phys_addr_t paddr, 1748 phys_addr_t paddr,
1603 size_t size, 1749 size_t size,
@@ -1625,7 +1771,7 @@ static dma_addr_t __map_single(struct device *dev,
1625retry: 1771retry:
1626 address = dma_ops_alloc_addresses(dev, dma_dom, pages, align_mask, 1772 address = dma_ops_alloc_addresses(dev, dma_dom, pages, align_mask,
1627 dma_mask); 1773 dma_mask);
1628 if (unlikely(address == bad_dma_address)) { 1774 if (unlikely(address == DMA_ERROR_CODE)) {
1629 /* 1775 /*
1630 * setting next_address here will let the address 1776 * setting next_address here will let the address
1631 * allocator only scan the new allocated range in the 1777 * allocator only scan the new allocated range in the
@@ -1633,7 +1779,7 @@ retry:
1633 */ 1779 */
1634 dma_dom->next_address = dma_dom->aperture_size; 1780 dma_dom->next_address = dma_dom->aperture_size;
1635 1781
1636 if (alloc_new_range(iommu, dma_dom, false, GFP_ATOMIC)) 1782 if (alloc_new_range(dma_dom, false, GFP_ATOMIC))
1637 goto out; 1783 goto out;
1638 1784
1639 /* 1785 /*
@@ -1645,8 +1791,8 @@ retry:
1645 1791
1646 start = address; 1792 start = address;
1647 for (i = 0; i < pages; ++i) { 1793 for (i = 0; i < pages; ++i) {
1648 ret = dma_ops_domain_map(iommu, dma_dom, start, paddr, dir); 1794 ret = dma_ops_domain_map(dma_dom, start, paddr, dir);
1649 if (ret == bad_dma_address) 1795 if (ret == DMA_ERROR_CODE)
1650 goto out_unmap; 1796 goto out_unmap;
1651 1797
1652 paddr += PAGE_SIZE; 1798 paddr += PAGE_SIZE;
@@ -1657,10 +1803,10 @@ retry:
1657 ADD_STATS_COUNTER(alloced_io_mem, size); 1803 ADD_STATS_COUNTER(alloced_io_mem, size);
1658 1804
1659 if (unlikely(dma_dom->need_flush && !amd_iommu_unmap_flush)) { 1805 if (unlikely(dma_dom->need_flush && !amd_iommu_unmap_flush)) {
1660 iommu_flush_tlb(iommu, dma_dom->domain.id); 1806 iommu_flush_tlb(&dma_dom->domain);
1661 dma_dom->need_flush = false; 1807 dma_dom->need_flush = false;
1662 } else if (unlikely(iommu_has_npcache(iommu))) 1808 } else if (unlikely(amd_iommu_np_cache))
1663 iommu_flush_pages(iommu, dma_dom->domain.id, address, size); 1809 iommu_flush_pages(&dma_dom->domain, address, size);
1664 1810
1665out: 1811out:
1666 return address; 1812 return address;
@@ -1669,20 +1815,19 @@ out_unmap:
1669 1815
1670 for (--i; i >= 0; --i) { 1816 for (--i; i >= 0; --i) {
1671 start -= PAGE_SIZE; 1817 start -= PAGE_SIZE;
1672 dma_ops_domain_unmap(iommu, dma_dom, start); 1818 dma_ops_domain_unmap(dma_dom, start);
1673 } 1819 }
1674 1820
1675 dma_ops_free_addresses(dma_dom, address, pages); 1821 dma_ops_free_addresses(dma_dom, address, pages);
1676 1822
1677 return bad_dma_address; 1823 return DMA_ERROR_CODE;
1678} 1824}
1679 1825
1680/* 1826/*
1681 * Does the reverse of the __map_single function. Must be called with 1827 * Does the reverse of the __map_single function. Must be called with
1682 * the domain lock held too 1828 * the domain lock held too
1683 */ 1829 */
1684static void __unmap_single(struct amd_iommu *iommu, 1830static void __unmap_single(struct dma_ops_domain *dma_dom,
1685 struct dma_ops_domain *dma_dom,
1686 dma_addr_t dma_addr, 1831 dma_addr_t dma_addr,
1687 size_t size, 1832 size_t size,
1688 int dir) 1833 int dir)
@@ -1690,7 +1835,7 @@ static void __unmap_single(struct amd_iommu *iommu,
1690 dma_addr_t i, start; 1835 dma_addr_t i, start;
1691 unsigned int pages; 1836 unsigned int pages;
1692 1837
1693 if ((dma_addr == bad_dma_address) || 1838 if ((dma_addr == DMA_ERROR_CODE) ||
1694 (dma_addr + size > dma_dom->aperture_size)) 1839 (dma_addr + size > dma_dom->aperture_size))
1695 return; 1840 return;
1696 1841
@@ -1699,7 +1844,7 @@ static void __unmap_single(struct amd_iommu *iommu,
1699 start = dma_addr; 1844 start = dma_addr;
1700 1845
1701 for (i = 0; i < pages; ++i) { 1846 for (i = 0; i < pages; ++i) {
1702 dma_ops_domain_unmap(iommu, dma_dom, start); 1847 dma_ops_domain_unmap(dma_dom, start);
1703 start += PAGE_SIZE; 1848 start += PAGE_SIZE;
1704 } 1849 }
1705 1850
@@ -1708,7 +1853,7 @@ static void __unmap_single(struct amd_iommu *iommu,
1708 dma_ops_free_addresses(dma_dom, dma_addr, pages); 1853 dma_ops_free_addresses(dma_dom, dma_addr, pages);
1709 1854
1710 if (amd_iommu_unmap_flush || dma_dom->need_flush) { 1855 if (amd_iommu_unmap_flush || dma_dom->need_flush) {
1711 iommu_flush_pages(iommu, dma_dom->domain.id, dma_addr, size); 1856 iommu_flush_pages(&dma_dom->domain, dma_addr, size);
1712 dma_dom->need_flush = false; 1857 dma_dom->need_flush = false;
1713 } 1858 }
1714} 1859}
@@ -1722,36 +1867,29 @@ static dma_addr_t map_page(struct device *dev, struct page *page,
1722 struct dma_attrs *attrs) 1867 struct dma_attrs *attrs)
1723{ 1868{
1724 unsigned long flags; 1869 unsigned long flags;
1725 struct amd_iommu *iommu;
1726 struct protection_domain *domain; 1870 struct protection_domain *domain;
1727 u16 devid;
1728 dma_addr_t addr; 1871 dma_addr_t addr;
1729 u64 dma_mask; 1872 u64 dma_mask;
1730 phys_addr_t paddr = page_to_phys(page) + offset; 1873 phys_addr_t paddr = page_to_phys(page) + offset;
1731 1874
1732 INC_STATS_COUNTER(cnt_map_single); 1875 INC_STATS_COUNTER(cnt_map_single);
1733 1876
1734 if (!check_device(dev)) 1877 domain = get_domain(dev);
1735 return bad_dma_address; 1878 if (PTR_ERR(domain) == -EINVAL)
1736
1737 dma_mask = *dev->dma_mask;
1738
1739 get_device_resources(dev, &iommu, &domain, &devid);
1740
1741 if (iommu == NULL || domain == NULL)
1742 /* device not handled by any AMD IOMMU */
1743 return (dma_addr_t)paddr; 1879 return (dma_addr_t)paddr;
1880 else if (IS_ERR(domain))
1881 return DMA_ERROR_CODE;
1744 1882
1745 if (!dma_ops_domain(domain)) 1883 dma_mask = *dev->dma_mask;
1746 return bad_dma_address;
1747 1884
1748 spin_lock_irqsave(&domain->lock, flags); 1885 spin_lock_irqsave(&domain->lock, flags);
1749 addr = __map_single(dev, iommu, domain->priv, paddr, size, dir, false, 1886
1887 addr = __map_single(dev, domain->priv, paddr, size, dir, false,
1750 dma_mask); 1888 dma_mask);
1751 if (addr == bad_dma_address) 1889 if (addr == DMA_ERROR_CODE)
1752 goto out; 1890 goto out;
1753 1891
1754 iommu_completion_wait(iommu); 1892 iommu_flush_complete(domain);
1755 1893
1756out: 1894out:
1757 spin_unlock_irqrestore(&domain->lock, flags); 1895 spin_unlock_irqrestore(&domain->lock, flags);
@@ -1766,25 +1904,19 @@ static void unmap_page(struct device *dev, dma_addr_t dma_addr, size_t size,
1766 enum dma_data_direction dir, struct dma_attrs *attrs) 1904 enum dma_data_direction dir, struct dma_attrs *attrs)
1767{ 1905{
1768 unsigned long flags; 1906 unsigned long flags;
1769 struct amd_iommu *iommu;
1770 struct protection_domain *domain; 1907 struct protection_domain *domain;
1771 u16 devid;
1772 1908
1773 INC_STATS_COUNTER(cnt_unmap_single); 1909 INC_STATS_COUNTER(cnt_unmap_single);
1774 1910
1775 if (!check_device(dev) || 1911 domain = get_domain(dev);
1776 !get_device_resources(dev, &iommu, &domain, &devid)) 1912 if (IS_ERR(domain))
1777 /* device not handled by any AMD IOMMU */
1778 return;
1779
1780 if (!dma_ops_domain(domain))
1781 return; 1913 return;
1782 1914
1783 spin_lock_irqsave(&domain->lock, flags); 1915 spin_lock_irqsave(&domain->lock, flags);
1784 1916
1785 __unmap_single(iommu, domain->priv, dma_addr, size, dir); 1917 __unmap_single(domain->priv, dma_addr, size, dir);
1786 1918
1787 iommu_completion_wait(iommu); 1919 iommu_flush_complete(domain);
1788 1920
1789 spin_unlock_irqrestore(&domain->lock, flags); 1921 spin_unlock_irqrestore(&domain->lock, flags);
1790} 1922}
@@ -1816,9 +1948,7 @@ static int map_sg(struct device *dev, struct scatterlist *sglist,
1816 struct dma_attrs *attrs) 1948 struct dma_attrs *attrs)
1817{ 1949{
1818 unsigned long flags; 1950 unsigned long flags;
1819 struct amd_iommu *iommu;
1820 struct protection_domain *domain; 1951 struct protection_domain *domain;
1821 u16 devid;
1822 int i; 1952 int i;
1823 struct scatterlist *s; 1953 struct scatterlist *s;
1824 phys_addr_t paddr; 1954 phys_addr_t paddr;
@@ -1827,25 +1957,20 @@ static int map_sg(struct device *dev, struct scatterlist *sglist,
1827 1957
1828 INC_STATS_COUNTER(cnt_map_sg); 1958 INC_STATS_COUNTER(cnt_map_sg);
1829 1959
1830 if (!check_device(dev)) 1960 domain = get_domain(dev);
1961 if (PTR_ERR(domain) == -EINVAL)
1962 return map_sg_no_iommu(dev, sglist, nelems, dir);
1963 else if (IS_ERR(domain))
1831 return 0; 1964 return 0;
1832 1965
1833 dma_mask = *dev->dma_mask; 1966 dma_mask = *dev->dma_mask;
1834 1967
1835 get_device_resources(dev, &iommu, &domain, &devid);
1836
1837 if (!iommu || !domain)
1838 return map_sg_no_iommu(dev, sglist, nelems, dir);
1839
1840 if (!dma_ops_domain(domain))
1841 return 0;
1842
1843 spin_lock_irqsave(&domain->lock, flags); 1968 spin_lock_irqsave(&domain->lock, flags);
1844 1969
1845 for_each_sg(sglist, s, nelems, i) { 1970 for_each_sg(sglist, s, nelems, i) {
1846 paddr = sg_phys(s); 1971 paddr = sg_phys(s);
1847 1972
1848 s->dma_address = __map_single(dev, iommu, domain->priv, 1973 s->dma_address = __map_single(dev, domain->priv,
1849 paddr, s->length, dir, false, 1974 paddr, s->length, dir, false,
1850 dma_mask); 1975 dma_mask);
1851 1976
@@ -1856,7 +1981,7 @@ static int map_sg(struct device *dev, struct scatterlist *sglist,
1856 goto unmap; 1981 goto unmap;
1857 } 1982 }
1858 1983
1859 iommu_completion_wait(iommu); 1984 iommu_flush_complete(domain);
1860 1985
1861out: 1986out:
1862 spin_unlock_irqrestore(&domain->lock, flags); 1987 spin_unlock_irqrestore(&domain->lock, flags);
@@ -1865,7 +1990,7 @@ out:
1865unmap: 1990unmap:
1866 for_each_sg(sglist, s, mapped_elems, i) { 1991 for_each_sg(sglist, s, mapped_elems, i) {
1867 if (s->dma_address) 1992 if (s->dma_address)
1868 __unmap_single(iommu, domain->priv, s->dma_address, 1993 __unmap_single(domain->priv, s->dma_address,
1869 s->dma_length, dir); 1994 s->dma_length, dir);
1870 s->dma_address = s->dma_length = 0; 1995 s->dma_address = s->dma_length = 0;
1871 } 1996 }
@@ -1884,30 +2009,25 @@ static void unmap_sg(struct device *dev, struct scatterlist *sglist,
1884 struct dma_attrs *attrs) 2009 struct dma_attrs *attrs)
1885{ 2010{
1886 unsigned long flags; 2011 unsigned long flags;
1887 struct amd_iommu *iommu;
1888 struct protection_domain *domain; 2012 struct protection_domain *domain;
1889 struct scatterlist *s; 2013 struct scatterlist *s;
1890 u16 devid;
1891 int i; 2014 int i;
1892 2015
1893 INC_STATS_COUNTER(cnt_unmap_sg); 2016 INC_STATS_COUNTER(cnt_unmap_sg);
1894 2017
1895 if (!check_device(dev) || 2018 domain = get_domain(dev);
1896 !get_device_resources(dev, &iommu, &domain, &devid)) 2019 if (IS_ERR(domain))
1897 return;
1898
1899 if (!dma_ops_domain(domain))
1900 return; 2020 return;
1901 2021
1902 spin_lock_irqsave(&domain->lock, flags); 2022 spin_lock_irqsave(&domain->lock, flags);
1903 2023
1904 for_each_sg(sglist, s, nelems, i) { 2024 for_each_sg(sglist, s, nelems, i) {
1905 __unmap_single(iommu, domain->priv, s->dma_address, 2025 __unmap_single(domain->priv, s->dma_address,
1906 s->dma_length, dir); 2026 s->dma_length, dir);
1907 s->dma_address = s->dma_length = 0; 2027 s->dma_address = s->dma_length = 0;
1908 } 2028 }
1909 2029
1910 iommu_completion_wait(iommu); 2030 iommu_flush_complete(domain);
1911 2031
1912 spin_unlock_irqrestore(&domain->lock, flags); 2032 spin_unlock_irqrestore(&domain->lock, flags);
1913} 2033}
@@ -1920,49 +2040,44 @@ static void *alloc_coherent(struct device *dev, size_t size,
1920{ 2040{
1921 unsigned long flags; 2041 unsigned long flags;
1922 void *virt_addr; 2042 void *virt_addr;
1923 struct amd_iommu *iommu;
1924 struct protection_domain *domain; 2043 struct protection_domain *domain;
1925 u16 devid;
1926 phys_addr_t paddr; 2044 phys_addr_t paddr;
1927 u64 dma_mask = dev->coherent_dma_mask; 2045 u64 dma_mask = dev->coherent_dma_mask;
1928 2046
1929 INC_STATS_COUNTER(cnt_alloc_coherent); 2047 INC_STATS_COUNTER(cnt_alloc_coherent);
1930 2048
1931 if (!check_device(dev)) 2049 domain = get_domain(dev);
2050 if (PTR_ERR(domain) == -EINVAL) {
2051 virt_addr = (void *)__get_free_pages(flag, get_order(size));
2052 *dma_addr = __pa(virt_addr);
2053 return virt_addr;
2054 } else if (IS_ERR(domain))
1932 return NULL; 2055 return NULL;
1933 2056
1934 if (!get_device_resources(dev, &iommu, &domain, &devid)) 2057 dma_mask = dev->coherent_dma_mask;
1935 flag &= ~(__GFP_DMA | __GFP_HIGHMEM | __GFP_DMA32); 2058 flag &= ~(__GFP_DMA | __GFP_HIGHMEM | __GFP_DMA32);
2059 flag |= __GFP_ZERO;
1936 2060
1937 flag |= __GFP_ZERO;
1938 virt_addr = (void *)__get_free_pages(flag, get_order(size)); 2061 virt_addr = (void *)__get_free_pages(flag, get_order(size));
1939 if (!virt_addr) 2062 if (!virt_addr)
1940 return NULL; 2063 return NULL;
1941 2064
1942 paddr = virt_to_phys(virt_addr); 2065 paddr = virt_to_phys(virt_addr);
1943 2066
1944 if (!iommu || !domain) {
1945 *dma_addr = (dma_addr_t)paddr;
1946 return virt_addr;
1947 }
1948
1949 if (!dma_ops_domain(domain))
1950 goto out_free;
1951
1952 if (!dma_mask) 2067 if (!dma_mask)
1953 dma_mask = *dev->dma_mask; 2068 dma_mask = *dev->dma_mask;
1954 2069
1955 spin_lock_irqsave(&domain->lock, flags); 2070 spin_lock_irqsave(&domain->lock, flags);
1956 2071
1957 *dma_addr = __map_single(dev, iommu, domain->priv, paddr, 2072 *dma_addr = __map_single(dev, domain->priv, paddr,
1958 size, DMA_BIDIRECTIONAL, true, dma_mask); 2073 size, DMA_BIDIRECTIONAL, true, dma_mask);
1959 2074
1960 if (*dma_addr == bad_dma_address) { 2075 if (*dma_addr == DMA_ERROR_CODE) {
1961 spin_unlock_irqrestore(&domain->lock, flags); 2076 spin_unlock_irqrestore(&domain->lock, flags);
1962 goto out_free; 2077 goto out_free;
1963 } 2078 }
1964 2079
1965 iommu_completion_wait(iommu); 2080 iommu_flush_complete(domain);
1966 2081
1967 spin_unlock_irqrestore(&domain->lock, flags); 2082 spin_unlock_irqrestore(&domain->lock, flags);
1968 2083
@@ -1982,28 +2097,19 @@ static void free_coherent(struct device *dev, size_t size,
1982 void *virt_addr, dma_addr_t dma_addr) 2097 void *virt_addr, dma_addr_t dma_addr)
1983{ 2098{
1984 unsigned long flags; 2099 unsigned long flags;
1985 struct amd_iommu *iommu;
1986 struct protection_domain *domain; 2100 struct protection_domain *domain;
1987 u16 devid;
1988 2101
1989 INC_STATS_COUNTER(cnt_free_coherent); 2102 INC_STATS_COUNTER(cnt_free_coherent);
1990 2103
1991 if (!check_device(dev)) 2104 domain = get_domain(dev);
1992 return; 2105 if (IS_ERR(domain))
1993
1994 get_device_resources(dev, &iommu, &domain, &devid);
1995
1996 if (!iommu || !domain)
1997 goto free_mem;
1998
1999 if (!dma_ops_domain(domain))
2000 goto free_mem; 2106 goto free_mem;
2001 2107
2002 spin_lock_irqsave(&domain->lock, flags); 2108 spin_lock_irqsave(&domain->lock, flags);
2003 2109
2004 __unmap_single(iommu, domain->priv, dma_addr, size, DMA_BIDIRECTIONAL); 2110 __unmap_single(domain->priv, dma_addr, size, DMA_BIDIRECTIONAL);
2005 2111
2006 iommu_completion_wait(iommu); 2112 iommu_flush_complete(domain);
2007 2113
2008 spin_unlock_irqrestore(&domain->lock, flags); 2114 spin_unlock_irqrestore(&domain->lock, flags);
2009 2115
@@ -2017,22 +2123,7 @@ free_mem:
2017 */ 2123 */
2018static int amd_iommu_dma_supported(struct device *dev, u64 mask) 2124static int amd_iommu_dma_supported(struct device *dev, u64 mask)
2019{ 2125{
2020 u16 bdf; 2126 return check_device(dev);
2021 struct pci_dev *pcidev;
2022
2023 /* No device or no PCI device */
2024 if (!dev || dev->bus != &pci_bus_type)
2025 return 0;
2026
2027 pcidev = to_pci_dev(dev);
2028
2029 bdf = calc_devid(pcidev->bus->number, pcidev->devfn);
2030
2031 /* Out of our scope? */
2032 if (bdf > amd_iommu_last_bdf)
2033 return 0;
2034
2035 return 1;
2036} 2127}
2037 2128
2038/* 2129/*
@@ -2046,25 +2137,30 @@ static void prealloc_protection_domains(void)
2046{ 2137{
2047 struct pci_dev *dev = NULL; 2138 struct pci_dev *dev = NULL;
2048 struct dma_ops_domain *dma_dom; 2139 struct dma_ops_domain *dma_dom;
2049 struct amd_iommu *iommu;
2050 u16 devid; 2140 u16 devid;
2051 2141
2052 while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { 2142 while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
2053 devid = calc_devid(dev->bus->number, dev->devfn); 2143
2054 if (devid > amd_iommu_last_bdf) 2144 /* Do we handle this device? */
2055 continue; 2145 if (!check_device(&dev->dev))
2056 devid = amd_iommu_alias_table[devid];
2057 if (domain_for_device(devid))
2058 continue; 2146 continue;
2059 iommu = amd_iommu_rlookup_table[devid]; 2147
2060 if (!iommu) 2148 iommu_init_device(&dev->dev);
2149
2150 /* Is there already any domain for it? */
2151 if (domain_for_device(&dev->dev))
2061 continue; 2152 continue;
2062 dma_dom = dma_ops_domain_alloc(iommu); 2153
2154 devid = get_device_id(&dev->dev);
2155
2156 dma_dom = dma_ops_domain_alloc();
2063 if (!dma_dom) 2157 if (!dma_dom)
2064 continue; 2158 continue;
2065 init_unity_mappings_for_device(dma_dom, devid); 2159 init_unity_mappings_for_device(dma_dom, devid);
2066 dma_dom->target_dev = devid; 2160 dma_dom->target_dev = devid;
2067 2161
2162 attach_device(&dev->dev, &dma_dom->domain);
2163
2068 list_add_tail(&dma_dom->list, &iommu_pd_list); 2164 list_add_tail(&dma_dom->list, &iommu_pd_list);
2069 } 2165 }
2070} 2166}
@@ -2093,7 +2189,7 @@ int __init amd_iommu_init_dma_ops(void)
2093 * protection domain will be assigned to the default one. 2189 * protection domain will be assigned to the default one.
2094 */ 2190 */
2095 for_each_iommu(iommu) { 2191 for_each_iommu(iommu) {
2096 iommu->default_dom = dma_ops_domain_alloc(iommu); 2192 iommu->default_dom = dma_ops_domain_alloc();
2097 if (iommu->default_dom == NULL) 2193 if (iommu->default_dom == NULL)
2098 return -ENOMEM; 2194 return -ENOMEM;
2099 iommu->default_dom->domain.flags |= PD_DEFAULT_MASK; 2195 iommu->default_dom->domain.flags |= PD_DEFAULT_MASK;
@@ -2103,15 +2199,12 @@ int __init amd_iommu_init_dma_ops(void)
2103 } 2199 }
2104 2200
2105 /* 2201 /*
2106 * If device isolation is enabled, pre-allocate the protection 2202 * Pre-allocate the protection domains for each device.
2107 * domains for each device.
2108 */ 2203 */
2109 if (amd_iommu_isolate) 2204 prealloc_protection_domains();
2110 prealloc_protection_domains();
2111 2205
2112 iommu_detected = 1; 2206 iommu_detected = 1;
2113 force_iommu = 1; 2207 swiotlb = 0;
2114 bad_dma_address = 0;
2115#ifdef CONFIG_GART_IOMMU 2208#ifdef CONFIG_GART_IOMMU
2116 gart_iommu_aperture_disabled = 1; 2209 gart_iommu_aperture_disabled = 1;
2117 gart_iommu_aperture = 0; 2210 gart_iommu_aperture = 0;
@@ -2150,14 +2243,17 @@ free_domains:
2150 2243
2151static void cleanup_domain(struct protection_domain *domain) 2244static void cleanup_domain(struct protection_domain *domain)
2152{ 2245{
2246 struct iommu_dev_data *dev_data, *next;
2153 unsigned long flags; 2247 unsigned long flags;
2154 u16 devid;
2155 2248
2156 write_lock_irqsave(&amd_iommu_devtable_lock, flags); 2249 write_lock_irqsave(&amd_iommu_devtable_lock, flags);
2157 2250
2158 for (devid = 0; devid <= amd_iommu_last_bdf; ++devid) 2251 list_for_each_entry_safe(dev_data, next, &domain->dev_list, list) {
2159 if (amd_iommu_pd_table[devid] == domain) 2252 struct device *dev = dev_data->dev;
2160 __detach_device(domain, devid); 2253
2254 do_detach(dev);
2255 atomic_set(&dev_data->bind, 0);
2256 }
2161 2257
2162 write_unlock_irqrestore(&amd_iommu_devtable_lock, flags); 2258 write_unlock_irqrestore(&amd_iommu_devtable_lock, flags);
2163} 2259}
@@ -2167,6 +2263,8 @@ static void protection_domain_free(struct protection_domain *domain)
2167 if (!domain) 2263 if (!domain)
2168 return; 2264 return;
2169 2265
2266 del_domain_from_list(domain);
2267
2170 if (domain->id) 2268 if (domain->id)
2171 domain_id_free(domain->id); 2269 domain_id_free(domain->id);
2172 2270
@@ -2185,6 +2283,9 @@ static struct protection_domain *protection_domain_alloc(void)
2185 domain->id = domain_id_alloc(); 2283 domain->id = domain_id_alloc();
2186 if (!domain->id) 2284 if (!domain->id)
2187 goto out_err; 2285 goto out_err;
2286 INIT_LIST_HEAD(&domain->dev_list);
2287
2288 add_domain_to_list(domain);
2188 2289
2189 return domain; 2290 return domain;
2190 2291
@@ -2241,26 +2342,23 @@ static void amd_iommu_domain_destroy(struct iommu_domain *dom)
2241static void amd_iommu_detach_device(struct iommu_domain *dom, 2342static void amd_iommu_detach_device(struct iommu_domain *dom,
2242 struct device *dev) 2343 struct device *dev)
2243{ 2344{
2244 struct protection_domain *domain = dom->priv; 2345 struct iommu_dev_data *dev_data = dev->archdata.iommu;
2245 struct amd_iommu *iommu; 2346 struct amd_iommu *iommu;
2246 struct pci_dev *pdev;
2247 u16 devid; 2347 u16 devid;
2248 2348
2249 if (dev->bus != &pci_bus_type) 2349 if (!check_device(dev))
2250 return; 2350 return;
2251 2351
2252 pdev = to_pci_dev(dev); 2352 devid = get_device_id(dev);
2253
2254 devid = calc_devid(pdev->bus->number, pdev->devfn);
2255 2353
2256 if (devid > 0) 2354 if (dev_data->domain != NULL)
2257 detach_device(domain, devid); 2355 detach_device(dev);
2258 2356
2259 iommu = amd_iommu_rlookup_table[devid]; 2357 iommu = amd_iommu_rlookup_table[devid];
2260 if (!iommu) 2358 if (!iommu)
2261 return; 2359 return;
2262 2360
2263 iommu_queue_inv_dev_entry(iommu, devid); 2361 iommu_flush_device(dev);
2264 iommu_completion_wait(iommu); 2362 iommu_completion_wait(iommu);
2265} 2363}
2266 2364
@@ -2268,35 +2366,30 @@ static int amd_iommu_attach_device(struct iommu_domain *dom,
2268 struct device *dev) 2366 struct device *dev)
2269{ 2367{
2270 struct protection_domain *domain = dom->priv; 2368 struct protection_domain *domain = dom->priv;
2271 struct protection_domain *old_domain; 2369 struct iommu_dev_data *dev_data;
2272 struct amd_iommu *iommu; 2370 struct amd_iommu *iommu;
2273 struct pci_dev *pdev; 2371 int ret;
2274 u16 devid; 2372 u16 devid;
2275 2373
2276 if (dev->bus != &pci_bus_type) 2374 if (!check_device(dev))
2277 return -EINVAL; 2375 return -EINVAL;
2278 2376
2279 pdev = to_pci_dev(dev); 2377 dev_data = dev->archdata.iommu;
2280 2378
2281 devid = calc_devid(pdev->bus->number, pdev->devfn); 2379 devid = get_device_id(dev);
2282
2283 if (devid >= amd_iommu_last_bdf ||
2284 devid != amd_iommu_alias_table[devid])
2285 return -EINVAL;
2286 2380
2287 iommu = amd_iommu_rlookup_table[devid]; 2381 iommu = amd_iommu_rlookup_table[devid];
2288 if (!iommu) 2382 if (!iommu)
2289 return -EINVAL; 2383 return -EINVAL;
2290 2384
2291 old_domain = domain_for_device(devid); 2385 if (dev_data->domain)
2292 if (old_domain) 2386 detach_device(dev);
2293 detach_device(old_domain, devid);
2294 2387
2295 attach_device(iommu, domain, devid); 2388 ret = attach_device(dev, domain);
2296 2389
2297 iommu_completion_wait(iommu); 2390 iommu_completion_wait(iommu);
2298 2391
2299 return 0; 2392 return ret;
2300} 2393}
2301 2394
2302static int amd_iommu_map_range(struct iommu_domain *dom, 2395static int amd_iommu_map_range(struct iommu_domain *dom,
@@ -2342,7 +2435,7 @@ static void amd_iommu_unmap_range(struct iommu_domain *dom,
2342 iova += PAGE_SIZE; 2435 iova += PAGE_SIZE;
2343 } 2436 }
2344 2437
2345 iommu_flush_domain(domain->id); 2438 iommu_flush_tlb_pde(domain);
2346} 2439}
2347 2440
2348static phys_addr_t amd_iommu_iova_to_phys(struct iommu_domain *dom, 2441static phys_addr_t amd_iommu_iova_to_phys(struct iommu_domain *dom,
@@ -2393,8 +2486,9 @@ static struct iommu_ops amd_iommu_ops = {
2393 2486
2394int __init amd_iommu_init_passthrough(void) 2487int __init amd_iommu_init_passthrough(void)
2395{ 2488{
2489 struct amd_iommu *iommu;
2396 struct pci_dev *dev = NULL; 2490 struct pci_dev *dev = NULL;
2397 u16 devid, devid2; 2491 u16 devid;
2398 2492
2399 /* allocate passthroug domain */ 2493 /* allocate passthroug domain */
2400 pt_domain = protection_domain_alloc(); 2494 pt_domain = protection_domain_alloc();
@@ -2404,20 +2498,17 @@ int __init amd_iommu_init_passthrough(void)
2404 pt_domain->mode |= PAGE_MODE_NONE; 2498 pt_domain->mode |= PAGE_MODE_NONE;
2405 2499
2406 while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { 2500 while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
2407 struct amd_iommu *iommu;
2408 2501
2409 devid = calc_devid(dev->bus->number, dev->devfn); 2502 if (!check_device(&dev->dev))
2410 if (devid > amd_iommu_last_bdf)
2411 continue; 2503 continue;
2412 2504
2413 devid2 = amd_iommu_alias_table[devid]; 2505 devid = get_device_id(&dev->dev);
2414 2506
2415 iommu = amd_iommu_rlookup_table[devid2]; 2507 iommu = amd_iommu_rlookup_table[devid];
2416 if (!iommu) 2508 if (!iommu)
2417 continue; 2509 continue;
2418 2510
2419 __attach_device(iommu, pt_domain, devid); 2511 attach_device(&dev->dev, pt_domain);
2420 __attach_device(iommu, pt_domain, devid2);
2421 } 2512 }
2422 2513
2423 pr_info("AMD-Vi: Initialized for Passthrough Mode\n"); 2514 pr_info("AMD-Vi: Initialized for Passthrough Mode\n");
diff --git a/arch/x86/kernel/amd_iommu_init.c b/arch/x86/kernel/amd_iommu_init.c
index c20001e4f556..7ffc39965233 100644
--- a/arch/x86/kernel/amd_iommu_init.c
+++ b/arch/x86/kernel/amd_iommu_init.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2007-2008 Advanced Micro Devices, Inc. 2 * Copyright (C) 2007-2009 Advanced Micro Devices, Inc.
3 * Author: Joerg Roedel <joerg.roedel@amd.com> 3 * Author: Joerg Roedel <joerg.roedel@amd.com>
4 * Leo Duran <leo.duran@amd.com> 4 * Leo Duran <leo.duran@amd.com>
5 * 5 *
@@ -25,10 +25,12 @@
25#include <linux/interrupt.h> 25#include <linux/interrupt.h>
26#include <linux/msi.h> 26#include <linux/msi.h>
27#include <asm/pci-direct.h> 27#include <asm/pci-direct.h>
28#include <asm/amd_iommu_proto.h>
28#include <asm/amd_iommu_types.h> 29#include <asm/amd_iommu_types.h>
29#include <asm/amd_iommu.h> 30#include <asm/amd_iommu.h>
30#include <asm/iommu.h> 31#include <asm/iommu.h>
31#include <asm/gart.h> 32#include <asm/gart.h>
33#include <asm/x86_init.h>
32 34
33/* 35/*
34 * definitions for the ACPI scanning code 36 * definitions for the ACPI scanning code
@@ -123,18 +125,24 @@ u16 amd_iommu_last_bdf; /* largest PCI device id we have
123 to handle */ 125 to handle */
124LIST_HEAD(amd_iommu_unity_map); /* a list of required unity mappings 126LIST_HEAD(amd_iommu_unity_map); /* a list of required unity mappings
125 we find in ACPI */ 127 we find in ACPI */
126#ifdef CONFIG_IOMMU_STRESS
127bool amd_iommu_isolate = false;
128#else
129bool amd_iommu_isolate = true; /* if true, device isolation is
130 enabled */
131#endif
132
133bool amd_iommu_unmap_flush; /* if true, flush on every unmap */ 128bool amd_iommu_unmap_flush; /* if true, flush on every unmap */
134 129
135LIST_HEAD(amd_iommu_list); /* list of all AMD IOMMUs in the 130LIST_HEAD(amd_iommu_list); /* list of all AMD IOMMUs in the
136 system */ 131 system */
137 132
133/* Array to assign indices to IOMMUs*/
134struct amd_iommu *amd_iommus[MAX_IOMMUS];
135int amd_iommus_present;
136
137/* IOMMUs have a non-present cache? */
138bool amd_iommu_np_cache __read_mostly;
139
140/*
141 * List of protection domains - used during resume
142 */
143LIST_HEAD(amd_iommu_pd_list);
144spinlock_t amd_iommu_pd_lock;
145
138/* 146/*
139 * Pointer to the device table which is shared by all AMD IOMMUs 147 * Pointer to the device table which is shared by all AMD IOMMUs
140 * it is indexed by the PCI device id or the HT unit id and contains 148 * it is indexed by the PCI device id or the HT unit id and contains
@@ -157,12 +165,6 @@ u16 *amd_iommu_alias_table;
157struct amd_iommu **amd_iommu_rlookup_table; 165struct amd_iommu **amd_iommu_rlookup_table;
158 166
159/* 167/*
160 * The pd table (protection domain table) is used to find the protection domain
161 * data structure a device belongs to. Indexed with the PCI device id too.
162 */
163struct protection_domain **amd_iommu_pd_table;
164
165/*
166 * AMD IOMMU allows up to 2^16 differend protection domains. This is a bitmap 168 * AMD IOMMU allows up to 2^16 differend protection domains. This is a bitmap
167 * to know which ones are already in use. 169 * to know which ones are already in use.
168 */ 170 */
@@ -838,7 +840,18 @@ static void __init free_iommu_all(void)
838static int __init init_iommu_one(struct amd_iommu *iommu, struct ivhd_header *h) 840static int __init init_iommu_one(struct amd_iommu *iommu, struct ivhd_header *h)
839{ 841{
840 spin_lock_init(&iommu->lock); 842 spin_lock_init(&iommu->lock);
843
844 /* Add IOMMU to internal data structures */
841 list_add_tail(&iommu->list, &amd_iommu_list); 845 list_add_tail(&iommu->list, &amd_iommu_list);
846 iommu->index = amd_iommus_present++;
847
848 if (unlikely(iommu->index >= MAX_IOMMUS)) {
849 WARN(1, "AMD-Vi: System has more IOMMUs than supported by this driver\n");
850 return -ENOSYS;
851 }
852
853 /* Index is fine - add IOMMU to the array */
854 amd_iommus[iommu->index] = iommu;
842 855
843 /* 856 /*
844 * Copy data from ACPI table entry to the iommu struct 857 * Copy data from ACPI table entry to the iommu struct
@@ -868,6 +881,9 @@ static int __init init_iommu_one(struct amd_iommu *iommu, struct ivhd_header *h)
868 init_iommu_from_acpi(iommu, h); 881 init_iommu_from_acpi(iommu, h);
869 init_iommu_devices(iommu); 882 init_iommu_devices(iommu);
870 883
884 if (iommu->cap & (1UL << IOMMU_CAP_NPCACHE))
885 amd_iommu_np_cache = true;
886
871 return pci_enable_device(iommu->dev); 887 return pci_enable_device(iommu->dev);
872} 888}
873 889
@@ -925,7 +941,7 @@ static int __init init_iommu_all(struct acpi_table_header *table)
925 * 941 *
926 ****************************************************************************/ 942 ****************************************************************************/
927 943
928static int __init iommu_setup_msi(struct amd_iommu *iommu) 944static int iommu_setup_msi(struct amd_iommu *iommu)
929{ 945{
930 int r; 946 int r;
931 947
@@ -1176,19 +1192,10 @@ static struct sys_device device_amd_iommu = {
1176 * functions. Finally it prints some information about AMD IOMMUs and 1192 * functions. Finally it prints some information about AMD IOMMUs and
1177 * the driver state and enables the hardware. 1193 * the driver state and enables the hardware.
1178 */ 1194 */
1179int __init amd_iommu_init(void) 1195static int __init amd_iommu_init(void)
1180{ 1196{
1181 int i, ret = 0; 1197 int i, ret = 0;
1182 1198
1183
1184 if (no_iommu) {
1185 printk(KERN_INFO "AMD-Vi disabled by kernel command line\n");
1186 return 0;
1187 }
1188
1189 if (!amd_iommu_detected)
1190 return -ENODEV;
1191
1192 /* 1199 /*
1193 * First parse ACPI tables to find the largest Bus/Dev/Func 1200 * First parse ACPI tables to find the largest Bus/Dev/Func
1194 * we need to handle. Upon this information the shared data 1201 * we need to handle. Upon this information the shared data
@@ -1225,15 +1232,6 @@ int __init amd_iommu_init(void)
1225 if (amd_iommu_rlookup_table == NULL) 1232 if (amd_iommu_rlookup_table == NULL)
1226 goto free; 1233 goto free;
1227 1234
1228 /*
1229 * Protection Domain table - maps devices to protection domains
1230 * This table has the same size as the rlookup_table
1231 */
1232 amd_iommu_pd_table = (void *)__get_free_pages(GFP_KERNEL | __GFP_ZERO,
1233 get_order(rlookup_table_size));
1234 if (amd_iommu_pd_table == NULL)
1235 goto free;
1236
1237 amd_iommu_pd_alloc_bitmap = (void *)__get_free_pages( 1235 amd_iommu_pd_alloc_bitmap = (void *)__get_free_pages(
1238 GFP_KERNEL | __GFP_ZERO, 1236 GFP_KERNEL | __GFP_ZERO,
1239 get_order(MAX_DOMAIN_ID/8)); 1237 get_order(MAX_DOMAIN_ID/8));
@@ -1255,6 +1253,8 @@ int __init amd_iommu_init(void)
1255 */ 1253 */
1256 amd_iommu_pd_alloc_bitmap[0] = 1; 1254 amd_iommu_pd_alloc_bitmap[0] = 1;
1257 1255
1256 spin_lock_init(&amd_iommu_pd_lock);
1257
1258 /* 1258 /*
1259 * now the data structures are allocated and basically initialized 1259 * now the data structures are allocated and basically initialized
1260 * start the real acpi table scan 1260 * start the real acpi table scan
@@ -1286,17 +1286,12 @@ int __init amd_iommu_init(void)
1286 if (iommu_pass_through) 1286 if (iommu_pass_through)
1287 goto out; 1287 goto out;
1288 1288
1289 printk(KERN_INFO "AMD-Vi: device isolation ");
1290 if (amd_iommu_isolate)
1291 printk("enabled\n");
1292 else
1293 printk("disabled\n");
1294
1295 if (amd_iommu_unmap_flush) 1289 if (amd_iommu_unmap_flush)
1296 printk(KERN_INFO "AMD-Vi: IO/TLB flush on unmap enabled\n"); 1290 printk(KERN_INFO "AMD-Vi: IO/TLB flush on unmap enabled\n");
1297 else 1291 else
1298 printk(KERN_INFO "AMD-Vi: Lazy IO/TLB flushing enabled\n"); 1292 printk(KERN_INFO "AMD-Vi: Lazy IO/TLB flushing enabled\n");
1299 1293
1294 x86_platform.iommu_shutdown = disable_iommus;
1300out: 1295out:
1301 return ret; 1296 return ret;
1302 1297
@@ -1304,9 +1299,6 @@ free:
1304 free_pages((unsigned long)amd_iommu_pd_alloc_bitmap, 1299 free_pages((unsigned long)amd_iommu_pd_alloc_bitmap,
1305 get_order(MAX_DOMAIN_ID/8)); 1300 get_order(MAX_DOMAIN_ID/8));
1306 1301
1307 free_pages((unsigned long)amd_iommu_pd_table,
1308 get_order(rlookup_table_size));
1309
1310 free_pages((unsigned long)amd_iommu_rlookup_table, 1302 free_pages((unsigned long)amd_iommu_rlookup_table,
1311 get_order(rlookup_table_size)); 1303 get_order(rlookup_table_size));
1312 1304
@@ -1323,11 +1315,6 @@ free:
1323 goto out; 1315 goto out;
1324} 1316}
1325 1317
1326void amd_iommu_shutdown(void)
1327{
1328 disable_iommus();
1329}
1330
1331/**************************************************************************** 1318/****************************************************************************
1332 * 1319 *
1333 * Early detect code. This code runs at IOMMU detection time in the DMA 1320 * Early detect code. This code runs at IOMMU detection time in the DMA
@@ -1342,16 +1329,13 @@ static int __init early_amd_iommu_detect(struct acpi_table_header *table)
1342 1329
1343void __init amd_iommu_detect(void) 1330void __init amd_iommu_detect(void)
1344{ 1331{
1345 if (swiotlb || no_iommu || (iommu_detected && !gart_iommu_aperture)) 1332 if (no_iommu || (iommu_detected && !gart_iommu_aperture))
1346 return; 1333 return;
1347 1334
1348 if (acpi_table_parse("IVRS", early_amd_iommu_detect) == 0) { 1335 if (acpi_table_parse("IVRS", early_amd_iommu_detect) == 0) {
1349 iommu_detected = 1; 1336 iommu_detected = 1;
1350 amd_iommu_detected = 1; 1337 amd_iommu_detected = 1;
1351#ifdef CONFIG_GART_IOMMU 1338 x86_init.iommu.iommu_init = amd_iommu_init;
1352 gart_iommu_aperture_disabled = 1;
1353 gart_iommu_aperture = 0;
1354#endif
1355 } 1339 }
1356} 1340}
1357 1341
@@ -1372,10 +1356,6 @@ static int __init parse_amd_iommu_dump(char *str)
1372static int __init parse_amd_iommu_options(char *str) 1356static int __init parse_amd_iommu_options(char *str)
1373{ 1357{
1374 for (; *str; ++str) { 1358 for (; *str; ++str) {
1375 if (strncmp(str, "isolate", 7) == 0)
1376 amd_iommu_isolate = true;
1377 if (strncmp(str, "share", 5) == 0)
1378 amd_iommu_isolate = false;
1379 if (strncmp(str, "fullflush", 9) == 0) 1359 if (strncmp(str, "fullflush", 9) == 0)
1380 amd_iommu_unmap_flush = true; 1360 amd_iommu_unmap_flush = true;
1381 } 1361 }
diff --git a/arch/x86/kernel/aperture_64.c b/arch/x86/kernel/aperture_64.c
index 128111d8ffe0..e0dfb6856aa2 100644
--- a/arch/x86/kernel/aperture_64.c
+++ b/arch/x86/kernel/aperture_64.c
@@ -28,6 +28,7 @@
28#include <asm/pci-direct.h> 28#include <asm/pci-direct.h>
29#include <asm/dma.h> 29#include <asm/dma.h>
30#include <asm/k8.h> 30#include <asm/k8.h>
31#include <asm/x86_init.h>
31 32
32int gart_iommu_aperture; 33int gart_iommu_aperture;
33int gart_iommu_aperture_disabled __initdata; 34int gart_iommu_aperture_disabled __initdata;
@@ -400,6 +401,7 @@ void __init gart_iommu_hole_init(void)
400 401
401 iommu_detected = 1; 402 iommu_detected = 1;
402 gart_iommu_aperture = 1; 403 gart_iommu_aperture = 1;
404 x86_init.iommu.iommu_init = gart_iommu_init;
403 405
404 aper_order = (read_pci_config(bus, slot, 3, AMD64_GARTAPERTURECTL) >> 1) & 7; 406 aper_order = (read_pci_config(bus, slot, 3, AMD64_GARTAPERTURECTL) >> 1) & 7;
405 aper_size = (32 * 1024 * 1024) << aper_order; 407 aper_size = (32 * 1024 * 1024) << aper_order;
@@ -456,7 +458,7 @@ out:
456 458
457 if (aper_alloc) { 459 if (aper_alloc) {
458 /* Got the aperture from the AGP bridge */ 460 /* Got the aperture from the AGP bridge */
459 } else if (swiotlb && !valid_agp) { 461 } else if (!valid_agp) {
460 /* Do nothing */ 462 /* Do nothing */
461 } else if ((!no_iommu && max_pfn > MAX_DMA32_PFN) || 463 } else if ((!no_iommu && max_pfn > MAX_DMA32_PFN) ||
462 force_iommu || 464 force_iommu ||
diff --git a/arch/x86/kernel/apic/Makefile b/arch/x86/kernel/apic/Makefile
index da7b7b9f8bd8..565c1bfc507d 100644
--- a/arch/x86/kernel/apic/Makefile
+++ b/arch/x86/kernel/apic/Makefile
@@ -2,7 +2,7 @@
2# Makefile for local APIC drivers and for the IO-APIC code 2# Makefile for local APIC drivers and for the IO-APIC code
3# 3#
4 4
5obj-$(CONFIG_X86_LOCAL_APIC) += apic.o probe_$(BITS).o ipi.o nmi.o 5obj-$(CONFIG_X86_LOCAL_APIC) += apic.o apic_noop.o probe_$(BITS).o ipi.o nmi.o
6obj-$(CONFIG_X86_IO_APIC) += io_apic.o 6obj-$(CONFIG_X86_IO_APIC) += io_apic.o
7obj-$(CONFIG_SMP) += ipi.o 7obj-$(CONFIG_SMP) += ipi.o
8 8
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 894aa97f0717..efb2b9cd132c 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -241,28 +241,13 @@ static int modern_apic(void)
241} 241}
242 242
243/* 243/*
244 * bare function to substitute write operation 244 * right after this call apic become NOOP driven
245 * and it's _that_ fast :) 245 * so apic->write/read doesn't do anything
246 */
247static void native_apic_write_dummy(u32 reg, u32 v)
248{
249 WARN_ON_ONCE((cpu_has_apic || !disable_apic));
250}
251
252static u32 native_apic_read_dummy(u32 reg)
253{
254 WARN_ON_ONCE((cpu_has_apic && !disable_apic));
255 return 0;
256}
257
258/*
259 * right after this call apic->write/read doesn't do anything
260 * note that there is no restore operation it works one way
261 */ 246 */
262void apic_disable(void) 247void apic_disable(void)
263{ 248{
264 apic->read = native_apic_read_dummy; 249 pr_info("APIC: switched to apic NOOP\n");
265 apic->write = native_apic_write_dummy; 250 apic = &apic_noop;
266} 251}
267 252
268void native_apic_wait_icr_idle(void) 253void native_apic_wait_icr_idle(void)
@@ -459,7 +444,7 @@ static void lapic_timer_setup(enum clock_event_mode mode,
459 v = apic_read(APIC_LVTT); 444 v = apic_read(APIC_LVTT);
460 v |= (APIC_LVT_MASKED | LOCAL_TIMER_VECTOR); 445 v |= (APIC_LVT_MASKED | LOCAL_TIMER_VECTOR);
461 apic_write(APIC_LVTT, v); 446 apic_write(APIC_LVTT, v);
462 apic_write(APIC_TMICT, 0xffffffff); 447 apic_write(APIC_TMICT, 0);
463 break; 448 break;
464 case CLOCK_EVT_MODE_RESUME: 449 case CLOCK_EVT_MODE_RESUME:
465 /* Nothing to do here */ 450 /* Nothing to do here */
@@ -662,7 +647,7 @@ static int __init calibrate_APIC_clock(void)
662 calibration_result = (delta * APIC_DIVISOR) / LAPIC_CAL_LOOPS; 647 calibration_result = (delta * APIC_DIVISOR) / LAPIC_CAL_LOOPS;
663 648
664 apic_printk(APIC_VERBOSE, "..... delta %ld\n", delta); 649 apic_printk(APIC_VERBOSE, "..... delta %ld\n", delta);
665 apic_printk(APIC_VERBOSE, "..... mult: %ld\n", lapic_clockevent.mult); 650 apic_printk(APIC_VERBOSE, "..... mult: %u\n", lapic_clockevent.mult);
666 apic_printk(APIC_VERBOSE, "..... calibration result: %u\n", 651 apic_printk(APIC_VERBOSE, "..... calibration result: %u\n",
667 calibration_result); 652 calibration_result);
668 653
@@ -1392,14 +1377,11 @@ void __init enable_IR_x2apic(void)
1392 unsigned long flags; 1377 unsigned long flags;
1393 struct IO_APIC_route_entry **ioapic_entries = NULL; 1378 struct IO_APIC_route_entry **ioapic_entries = NULL;
1394 int ret, x2apic_enabled = 0; 1379 int ret, x2apic_enabled = 0;
1395 int dmar_table_init_ret = 0; 1380 int dmar_table_init_ret;
1396 1381
1397#ifdef CONFIG_INTR_REMAP
1398 dmar_table_init_ret = dmar_table_init(); 1382 dmar_table_init_ret = dmar_table_init();
1399 if (dmar_table_init_ret) 1383 if (dmar_table_init_ret && !x2apic_supported())
1400 pr_debug("dmar_table_init() failed with %d:\n", 1384 return;
1401 dmar_table_init_ret);
1402#endif
1403 1385
1404 ioapic_entries = alloc_ioapic_entries(); 1386 ioapic_entries = alloc_ioapic_entries();
1405 if (!ioapic_entries) { 1387 if (!ioapic_entries) {
diff --git a/arch/x86/kernel/apic/apic_noop.c b/arch/x86/kernel/apic/apic_noop.c
new file mode 100644
index 000000000000..d9acc3bee0f4
--- /dev/null
+++ b/arch/x86/kernel/apic/apic_noop.c
@@ -0,0 +1,200 @@
1/*
2 * NOOP APIC driver.
3 *
4 * Does almost nothing and should be substituted by a real apic driver via
5 * probe routine.
6 *
7 * Though in case if apic is disabled (for some reason) we try
8 * to not uglify the caller's code and allow to call (some) apic routines
9 * like self-ipi, etc...
10 */
11
12#include <linux/threads.h>
13#include <linux/cpumask.h>
14#include <linux/module.h>
15#include <linux/string.h>
16#include <linux/kernel.h>
17#include <linux/ctype.h>
18#include <linux/init.h>
19#include <linux/errno.h>
20#include <asm/fixmap.h>
21#include <asm/mpspec.h>
22#include <asm/apicdef.h>
23#include <asm/apic.h>
24#include <asm/setup.h>
25
26#include <linux/smp.h>
27#include <asm/ipi.h>
28
29#include <linux/interrupt.h>
30#include <asm/acpi.h>
31#include <asm/e820.h>
32
33static void noop_init_apic_ldr(void) { }
34static void noop_send_IPI_mask(const struct cpumask *cpumask, int vector) { }
35static void noop_send_IPI_mask_allbutself(const struct cpumask *cpumask, int vector) { }
36static void noop_send_IPI_allbutself(int vector) { }
37static void noop_send_IPI_all(int vector) { }
38static void noop_send_IPI_self(int vector) { }
39static void noop_apic_wait_icr_idle(void) { }
40static void noop_apic_icr_write(u32 low, u32 id) { }
41
42static int noop_wakeup_secondary_cpu(int apicid, unsigned long start_eip)
43{
44 return -1;
45}
46
47static u32 noop_safe_apic_wait_icr_idle(void)
48{
49 return 0;
50}
51
52static u64 noop_apic_icr_read(void)
53{
54 return 0;
55}
56
57static int noop_cpu_to_logical_apicid(int cpu)
58{
59 return 0;
60}
61
62static int noop_phys_pkg_id(int cpuid_apic, int index_msb)
63{
64 return 0;
65}
66
67static unsigned int noop_get_apic_id(unsigned long x)
68{
69 return 0;
70}
71
72static int noop_probe(void)
73{
74 /*
75 * NOOP apic should not ever be
76 * enabled via probe routine
77 */
78 return 0;
79}
80
81static int noop_apic_id_registered(void)
82{
83 /*
84 * if we would be really "pedantic"
85 * we should pass read_apic_id() here
86 * but since NOOP suppose APIC ID = 0
87 * lets save a few cycles
88 */
89 return physid_isset(0, phys_cpu_present_map);
90}
91
92static const struct cpumask *noop_target_cpus(void)
93{
94 /* only BSP here */
95 return cpumask_of(0);
96}
97
98static unsigned long noop_check_apicid_used(physid_mask_t *map, int apicid)
99{
100 return physid_isset(apicid, *map);
101}
102
103static unsigned long noop_check_apicid_present(int bit)
104{
105 return physid_isset(bit, phys_cpu_present_map);
106}
107
108static void noop_vector_allocation_domain(int cpu, struct cpumask *retmask)
109{
110 if (cpu != 0)
111 pr_warning("APIC: Vector allocated for non-BSP cpu\n");
112 cpumask_clear(retmask);
113 cpumask_set_cpu(cpu, retmask);
114}
115
116int noop_apicid_to_node(int logical_apicid)
117{
118 /* we're always on node 0 */
119 return 0;
120}
121
122static u32 noop_apic_read(u32 reg)
123{
124 WARN_ON_ONCE((cpu_has_apic && !disable_apic));
125 return 0;
126}
127
128static void noop_apic_write(u32 reg, u32 v)
129{
130 WARN_ON_ONCE((cpu_has_apic || !disable_apic));
131}
132
133struct apic apic_noop = {
134 .name = "noop",
135 .probe = noop_probe,
136 .acpi_madt_oem_check = NULL,
137
138 .apic_id_registered = noop_apic_id_registered,
139
140 .irq_delivery_mode = dest_LowestPrio,
141 /* logical delivery broadcast to all CPUs: */
142 .irq_dest_mode = 1,
143
144 .target_cpus = noop_target_cpus,
145 .disable_esr = 0,
146 .dest_logical = APIC_DEST_LOGICAL,
147 .check_apicid_used = noop_check_apicid_used,
148 .check_apicid_present = noop_check_apicid_present,
149
150 .vector_allocation_domain = noop_vector_allocation_domain,
151 .init_apic_ldr = noop_init_apic_ldr,
152
153 .ioapic_phys_id_map = default_ioapic_phys_id_map,
154 .setup_apic_routing = NULL,
155 .multi_timer_check = NULL,
156 .apicid_to_node = noop_apicid_to_node,
157
158 .cpu_to_logical_apicid = noop_cpu_to_logical_apicid,
159 .cpu_present_to_apicid = default_cpu_present_to_apicid,
160 .apicid_to_cpu_present = physid_set_mask_of_physid,
161
162 .setup_portio_remap = NULL,
163 .check_phys_apicid_present = default_check_phys_apicid_present,
164 .enable_apic_mode = NULL,
165
166 .phys_pkg_id = noop_phys_pkg_id,
167
168 .mps_oem_check = NULL,
169
170 .get_apic_id = noop_get_apic_id,
171 .set_apic_id = NULL,
172 .apic_id_mask = 0x0F << 24,
173
174 .cpu_mask_to_apicid = default_cpu_mask_to_apicid,
175 .cpu_mask_to_apicid_and = default_cpu_mask_to_apicid_and,
176
177 .send_IPI_mask = noop_send_IPI_mask,
178 .send_IPI_mask_allbutself = noop_send_IPI_mask_allbutself,
179 .send_IPI_allbutself = noop_send_IPI_allbutself,
180 .send_IPI_all = noop_send_IPI_all,
181 .send_IPI_self = noop_send_IPI_self,
182
183 .wakeup_secondary_cpu = noop_wakeup_secondary_cpu,
184
185 /* should be safe */
186 .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW,
187 .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH,
188
189 .wait_for_init_deassert = NULL,
190
191 .smp_callin_clear_local_apic = NULL,
192 .inquire_remote_apic = NULL,
193
194 .read = noop_apic_read,
195 .write = noop_apic_write,
196 .icr_read = noop_apic_icr_read,
197 .icr_write = noop_apic_icr_write,
198 .wait_icr_idle = noop_apic_wait_icr_idle,
199 .safe_wait_icr_idle = noop_safe_apic_wait_icr_idle,
200};
diff --git a/arch/x86/kernel/apic/bigsmp_32.c b/arch/x86/kernel/apic/bigsmp_32.c
index 77a06413b6b2..38dcecfa5818 100644
--- a/arch/x86/kernel/apic/bigsmp_32.c
+++ b/arch/x86/kernel/apic/bigsmp_32.c
@@ -35,7 +35,7 @@ static const struct cpumask *bigsmp_target_cpus(void)
35#endif 35#endif
36} 36}
37 37
38static unsigned long bigsmp_check_apicid_used(physid_mask_t bitmap, int apicid) 38static unsigned long bigsmp_check_apicid_used(physid_mask_t *map, int apicid)
39{ 39{
40 return 0; 40 return 0;
41} 41}
@@ -93,11 +93,6 @@ static int bigsmp_cpu_present_to_apicid(int mps_cpu)
93 return BAD_APICID; 93 return BAD_APICID;
94} 94}
95 95
96static physid_mask_t bigsmp_apicid_to_cpu_present(int phys_apicid)
97{
98 return physid_mask_of_physid(phys_apicid);
99}
100
101/* Mapping from cpu number to logical apicid */ 96/* Mapping from cpu number to logical apicid */
102static inline int bigsmp_cpu_to_logical_apicid(int cpu) 97static inline int bigsmp_cpu_to_logical_apicid(int cpu)
103{ 98{
@@ -106,10 +101,10 @@ static inline int bigsmp_cpu_to_logical_apicid(int cpu)
106 return cpu_physical_id(cpu); 101 return cpu_physical_id(cpu);
107} 102}
108 103
109static physid_mask_t bigsmp_ioapic_phys_id_map(physid_mask_t phys_map) 104static void bigsmp_ioapic_phys_id_map(physid_mask_t *phys_map, physid_mask_t *retmap)
110{ 105{
111 /* For clustered we don't have a good way to do this yet - hack */ 106 /* For clustered we don't have a good way to do this yet - hack */
112 return physids_promote(0xFFL); 107 physids_promote(0xFFL, retmap);
113} 108}
114 109
115static int bigsmp_check_phys_apicid_present(int phys_apicid) 110static int bigsmp_check_phys_apicid_present(int phys_apicid)
@@ -230,7 +225,7 @@ struct apic apic_bigsmp = {
230 .apicid_to_node = bigsmp_apicid_to_node, 225 .apicid_to_node = bigsmp_apicid_to_node,
231 .cpu_to_logical_apicid = bigsmp_cpu_to_logical_apicid, 226 .cpu_to_logical_apicid = bigsmp_cpu_to_logical_apicid,
232 .cpu_present_to_apicid = bigsmp_cpu_present_to_apicid, 227 .cpu_present_to_apicid = bigsmp_cpu_present_to_apicid,
233 .apicid_to_cpu_present = bigsmp_apicid_to_cpu_present, 228 .apicid_to_cpu_present = physid_set_mask_of_physid,
234 .setup_portio_remap = NULL, 229 .setup_portio_remap = NULL,
235 .check_phys_apicid_present = bigsmp_check_phys_apicid_present, 230 .check_phys_apicid_present = bigsmp_check_phys_apicid_present,
236 .enable_apic_mode = NULL, 231 .enable_apic_mode = NULL,
diff --git a/arch/x86/kernel/apic/es7000_32.c b/arch/x86/kernel/apic/es7000_32.c
index 89174f847b49..e85f8fb7f8e7 100644
--- a/arch/x86/kernel/apic/es7000_32.c
+++ b/arch/x86/kernel/apic/es7000_32.c
@@ -466,11 +466,11 @@ static const struct cpumask *es7000_target_cpus(void)
466 return cpumask_of(smp_processor_id()); 466 return cpumask_of(smp_processor_id());
467} 467}
468 468
469static unsigned long 469static unsigned long es7000_check_apicid_used(physid_mask_t *map, int apicid)
470es7000_check_apicid_used(physid_mask_t bitmap, int apicid)
471{ 470{
472 return 0; 471 return 0;
473} 472}
473
474static unsigned long es7000_check_apicid_present(int bit) 474static unsigned long es7000_check_apicid_present(int bit)
475{ 475{
476 return physid_isset(bit, phys_cpu_present_map); 476 return physid_isset(bit, phys_cpu_present_map);
@@ -539,14 +539,10 @@ static int es7000_cpu_present_to_apicid(int mps_cpu)
539 539
540static int cpu_id; 540static int cpu_id;
541 541
542static physid_mask_t es7000_apicid_to_cpu_present(int phys_apicid) 542static void es7000_apicid_to_cpu_present(int phys_apicid, physid_mask_t *retmap)
543{ 543{
544 physid_mask_t mask; 544 physid_set_mask_of_physid(cpu_id, retmap);
545
546 mask = physid_mask_of_physid(cpu_id);
547 ++cpu_id; 545 ++cpu_id;
548
549 return mask;
550} 546}
551 547
552/* Mapping from cpu number to logical apicid */ 548/* Mapping from cpu number to logical apicid */
@@ -561,10 +557,10 @@ static int es7000_cpu_to_logical_apicid(int cpu)
561#endif 557#endif
562} 558}
563 559
564static physid_mask_t es7000_ioapic_phys_id_map(physid_mask_t phys_map) 560static void es7000_ioapic_phys_id_map(physid_mask_t *phys_map, physid_mask_t *retmap)
565{ 561{
566 /* For clustered we don't have a good way to do this yet - hack */ 562 /* For clustered we don't have a good way to do this yet - hack */
567 return physids_promote(0xff); 563 physids_promote(0xFFL, retmap);
568} 564}
569 565
570static int es7000_check_phys_apicid_present(int cpu_physical_apicid) 566static int es7000_check_phys_apicid_present(int cpu_physical_apicid)
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index dc69f28489f5..d5d498fbee4b 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -60,8 +60,6 @@
60#include <asm/irq_remapping.h> 60#include <asm/irq_remapping.h>
61#include <asm/hpet.h> 61#include <asm/hpet.h>
62#include <asm/hw_irq.h> 62#include <asm/hw_irq.h>
63#include <asm/uv/uv_hub.h>
64#include <asm/uv/uv_irq.h>
65 63
66#include <asm/apic.h> 64#include <asm/apic.h>
67 65
@@ -140,20 +138,6 @@ static struct irq_pin_list *get_one_free_irq_2_pin(int node)
140 return pin; 138 return pin;
141} 139}
142 140
143/*
144 * This is performance-critical, we want to do it O(1)
145 *
146 * Most irqs are mapped 1:1 with pins.
147 */
148struct irq_cfg {
149 struct irq_pin_list *irq_2_pin;
150 cpumask_var_t domain;
151 cpumask_var_t old_domain;
152 unsigned move_cleanup_count;
153 u8 vector;
154 u8 move_in_progress : 1;
155};
156
157/* irq_cfg is indexed by the sum of all RTEs in all I/O APICs. */ 141/* irq_cfg is indexed by the sum of all RTEs in all I/O APICs. */
158#ifdef CONFIG_SPARSE_IRQ 142#ifdef CONFIG_SPARSE_IRQ
159static struct irq_cfg irq_cfgx[] = { 143static struct irq_cfg irq_cfgx[] = {
@@ -209,7 +193,7 @@ int __init arch_early_irq_init(void)
209} 193}
210 194
211#ifdef CONFIG_SPARSE_IRQ 195#ifdef CONFIG_SPARSE_IRQ
212static struct irq_cfg *irq_cfg(unsigned int irq) 196struct irq_cfg *irq_cfg(unsigned int irq)
213{ 197{
214 struct irq_cfg *cfg = NULL; 198 struct irq_cfg *cfg = NULL;
215 struct irq_desc *desc; 199 struct irq_desc *desc;
@@ -361,7 +345,7 @@ void arch_free_chip_data(struct irq_desc *old_desc, struct irq_desc *desc)
361/* end for move_irq_desc */ 345/* end for move_irq_desc */
362 346
363#else 347#else
364static struct irq_cfg *irq_cfg(unsigned int irq) 348struct irq_cfg *irq_cfg(unsigned int irq)
365{ 349{
366 return irq < nr_irqs ? irq_cfgx + irq : NULL; 350 return irq < nr_irqs ? irq_cfgx + irq : NULL;
367} 351}
@@ -555,23 +539,41 @@ static void __init replace_pin_at_irq_node(struct irq_cfg *cfg, int node,
555 add_pin_to_irq_node(cfg, node, newapic, newpin); 539 add_pin_to_irq_node(cfg, node, newapic, newpin);
556} 540}
557 541
542static void __io_apic_modify_irq(struct irq_pin_list *entry,
543 int mask_and, int mask_or,
544 void (*final)(struct irq_pin_list *entry))
545{
546 unsigned int reg, pin;
547
548 pin = entry->pin;
549 reg = io_apic_read(entry->apic, 0x10 + pin * 2);
550 reg &= mask_and;
551 reg |= mask_or;
552 io_apic_modify(entry->apic, 0x10 + pin * 2, reg);
553 if (final)
554 final(entry);
555}
556
558static void io_apic_modify_irq(struct irq_cfg *cfg, 557static void io_apic_modify_irq(struct irq_cfg *cfg,
559 int mask_and, int mask_or, 558 int mask_and, int mask_or,
560 void (*final)(struct irq_pin_list *entry)) 559 void (*final)(struct irq_pin_list *entry))
561{ 560{
562 int pin;
563 struct irq_pin_list *entry; 561 struct irq_pin_list *entry;
564 562
565 for_each_irq_pin(entry, cfg->irq_2_pin) { 563 for_each_irq_pin(entry, cfg->irq_2_pin)
566 unsigned int reg; 564 __io_apic_modify_irq(entry, mask_and, mask_or, final);
567 pin = entry->pin; 565}
568 reg = io_apic_read(entry->apic, 0x10 + pin * 2); 566
569 reg &= mask_and; 567static void __mask_and_edge_IO_APIC_irq(struct irq_pin_list *entry)
570 reg |= mask_or; 568{
571 io_apic_modify(entry->apic, 0x10 + pin * 2, reg); 569 __io_apic_modify_irq(entry, ~IO_APIC_REDIR_LEVEL_TRIGGER,
572 if (final) 570 IO_APIC_REDIR_MASKED, NULL);
573 final(entry); 571}
574 } 572
573static void __unmask_and_level_IO_APIC_irq(struct irq_pin_list *entry)
574{
575 __io_apic_modify_irq(entry, ~IO_APIC_REDIR_MASKED,
576 IO_APIC_REDIR_LEVEL_TRIGGER, NULL);
575} 577}
576 578
577static void __unmask_IO_APIC_irq(struct irq_cfg *cfg) 579static void __unmask_IO_APIC_irq(struct irq_cfg *cfg)
@@ -595,18 +597,6 @@ static void __mask_IO_APIC_irq(struct irq_cfg *cfg)
595 io_apic_modify_irq(cfg, ~0, IO_APIC_REDIR_MASKED, &io_apic_sync); 597 io_apic_modify_irq(cfg, ~0, IO_APIC_REDIR_MASKED, &io_apic_sync);
596} 598}
597 599
598static void __mask_and_edge_IO_APIC_irq(struct irq_cfg *cfg)
599{
600 io_apic_modify_irq(cfg, ~IO_APIC_REDIR_LEVEL_TRIGGER,
601 IO_APIC_REDIR_MASKED, NULL);
602}
603
604static void __unmask_and_level_IO_APIC_irq(struct irq_cfg *cfg)
605{
606 io_apic_modify_irq(cfg, ~IO_APIC_REDIR_MASKED,
607 IO_APIC_REDIR_LEVEL_TRIGGER, NULL);
608}
609
610static void mask_IO_APIC_irq_desc(struct irq_desc *desc) 600static void mask_IO_APIC_irq_desc(struct irq_desc *desc)
611{ 601{
612 struct irq_cfg *cfg = desc->chip_data; 602 struct irq_cfg *cfg = desc->chip_data;
@@ -1177,7 +1167,7 @@ __assign_irq_vector(int irq, struct irq_cfg *cfg, const struct cpumask *mask)
1177 int cpu, err; 1167 int cpu, err;
1178 cpumask_var_t tmp_mask; 1168 cpumask_var_t tmp_mask;
1179 1169
1180 if ((cfg->move_in_progress) || cfg->move_cleanup_count) 1170 if (cfg->move_in_progress)
1181 return -EBUSY; 1171 return -EBUSY;
1182 1172
1183 if (!alloc_cpumask_var(&tmp_mask, GFP_ATOMIC)) 1173 if (!alloc_cpumask_var(&tmp_mask, GFP_ATOMIC))
@@ -1237,8 +1227,7 @@ next:
1237 return err; 1227 return err;
1238} 1228}
1239 1229
1240static int 1230int assign_irq_vector(int irq, struct irq_cfg *cfg, const struct cpumask *mask)
1241assign_irq_vector(int irq, struct irq_cfg *cfg, const struct cpumask *mask)
1242{ 1231{
1243 int err; 1232 int err;
1244 unsigned long flags; 1233 unsigned long flags;
@@ -1599,9 +1588,6 @@ __apicdebuginit(void) print_IO_APIC(void)
1599 struct irq_desc *desc; 1588 struct irq_desc *desc;
1600 unsigned int irq; 1589 unsigned int irq;
1601 1590
1602 if (apic_verbosity == APIC_QUIET)
1603 return;
1604
1605 printk(KERN_DEBUG "number of MP IRQ sources: %d.\n", mp_irq_entries); 1591 printk(KERN_DEBUG "number of MP IRQ sources: %d.\n", mp_irq_entries);
1606 for (i = 0; i < nr_ioapics; i++) 1592 for (i = 0; i < nr_ioapics; i++)
1607 printk(KERN_DEBUG "number of IO-APIC #%d registers: %d.\n", 1593 printk(KERN_DEBUG "number of IO-APIC #%d registers: %d.\n",
@@ -1708,9 +1694,6 @@ __apicdebuginit(void) print_APIC_field(int base)
1708{ 1694{
1709 int i; 1695 int i;
1710 1696
1711 if (apic_verbosity == APIC_QUIET)
1712 return;
1713
1714 printk(KERN_DEBUG); 1697 printk(KERN_DEBUG);
1715 1698
1716 for (i = 0; i < 8; i++) 1699 for (i = 0; i < 8; i++)
@@ -1724,9 +1707,6 @@ __apicdebuginit(void) print_local_APIC(void *dummy)
1724 unsigned int i, v, ver, maxlvt; 1707 unsigned int i, v, ver, maxlvt;
1725 u64 icr; 1708 u64 icr;
1726 1709
1727 if (apic_verbosity == APIC_QUIET)
1728 return;
1729
1730 printk(KERN_DEBUG "printing local APIC contents on CPU#%d/%d:\n", 1710 printk(KERN_DEBUG "printing local APIC contents on CPU#%d/%d:\n",
1731 smp_processor_id(), hard_smp_processor_id()); 1711 smp_processor_id(), hard_smp_processor_id());
1732 v = apic_read(APIC_ID); 1712 v = apic_read(APIC_ID);
@@ -1824,13 +1804,19 @@ __apicdebuginit(void) print_local_APIC(void *dummy)
1824 printk("\n"); 1804 printk("\n");
1825} 1805}
1826 1806
1827__apicdebuginit(void) print_all_local_APICs(void) 1807__apicdebuginit(void) print_local_APICs(int maxcpu)
1828{ 1808{
1829 int cpu; 1809 int cpu;
1830 1810
1811 if (!maxcpu)
1812 return;
1813
1831 preempt_disable(); 1814 preempt_disable();
1832 for_each_online_cpu(cpu) 1815 for_each_online_cpu(cpu) {
1816 if (cpu >= maxcpu)
1817 break;
1833 smp_call_function_single(cpu, print_local_APIC, NULL, 1); 1818 smp_call_function_single(cpu, print_local_APIC, NULL, 1);
1819 }
1834 preempt_enable(); 1820 preempt_enable();
1835} 1821}
1836 1822
@@ -1839,7 +1825,7 @@ __apicdebuginit(void) print_PIC(void)
1839 unsigned int v; 1825 unsigned int v;
1840 unsigned long flags; 1826 unsigned long flags;
1841 1827
1842 if (apic_verbosity == APIC_QUIET || !nr_legacy_irqs) 1828 if (!nr_legacy_irqs)
1843 return; 1829 return;
1844 1830
1845 printk(KERN_DEBUG "\nprinting PIC contents\n"); 1831 printk(KERN_DEBUG "\nprinting PIC contents\n");
@@ -1866,21 +1852,41 @@ __apicdebuginit(void) print_PIC(void)
1866 printk(KERN_DEBUG "... PIC ELCR: %04x\n", v); 1852 printk(KERN_DEBUG "... PIC ELCR: %04x\n", v);
1867} 1853}
1868 1854
1869__apicdebuginit(int) print_all_ICs(void) 1855static int __initdata show_lapic = 1;
1856static __init int setup_show_lapic(char *arg)
1870{ 1857{
1858 int num = -1;
1859
1860 if (strcmp(arg, "all") == 0) {
1861 show_lapic = CONFIG_NR_CPUS;
1862 } else {
1863 get_option(&arg, &num);
1864 if (num >= 0)
1865 show_lapic = num;
1866 }
1867
1868 return 1;
1869}
1870__setup("show_lapic=", setup_show_lapic);
1871
1872__apicdebuginit(int) print_ICs(void)
1873{
1874 if (apic_verbosity == APIC_QUIET)
1875 return 0;
1876
1871 print_PIC(); 1877 print_PIC();
1872 1878
1873 /* don't print out if apic is not there */ 1879 /* don't print out if apic is not there */
1874 if (!cpu_has_apic && !apic_from_smp_config()) 1880 if (!cpu_has_apic && !apic_from_smp_config())
1875 return 0; 1881 return 0;
1876 1882
1877 print_all_local_APICs(); 1883 print_local_APICs(show_lapic);
1878 print_IO_APIC(); 1884 print_IO_APIC();
1879 1885
1880 return 0; 1886 return 0;
1881} 1887}
1882 1888
1883fs_initcall(print_all_ICs); 1889fs_initcall(print_ICs);
1884 1890
1885 1891
1886/* Where if anywhere is the i8259 connect in external int mode */ 1892/* Where if anywhere is the i8259 connect in external int mode */
@@ -2031,7 +2037,7 @@ void __init setup_ioapic_ids_from_mpc(void)
2031 * This is broken; anything with a real cpu count has to 2037 * This is broken; anything with a real cpu count has to
2032 * circumvent this idiocy regardless. 2038 * circumvent this idiocy regardless.
2033 */ 2039 */
2034 phys_id_present_map = apic->ioapic_phys_id_map(phys_cpu_present_map); 2040 apic->ioapic_phys_id_map(&phys_cpu_present_map, &phys_id_present_map);
2035 2041
2036 /* 2042 /*
2037 * Set the IOAPIC ID to the value stored in the MPC table. 2043 * Set the IOAPIC ID to the value stored in the MPC table.
@@ -2058,7 +2064,7 @@ void __init setup_ioapic_ids_from_mpc(void)
2058 * system must have a unique ID or we get lots of nice 2064 * system must have a unique ID or we get lots of nice
2059 * 'stuck on smp_invalidate_needed IPI wait' messages. 2065 * 'stuck on smp_invalidate_needed IPI wait' messages.
2060 */ 2066 */
2061 if (apic->check_apicid_used(phys_id_present_map, 2067 if (apic->check_apicid_used(&phys_id_present_map,
2062 mp_ioapics[apic_id].apicid)) { 2068 mp_ioapics[apic_id].apicid)) {
2063 printk(KERN_ERR "BIOS bug, IO-APIC#%d ID %d is already used!...\n", 2069 printk(KERN_ERR "BIOS bug, IO-APIC#%d ID %d is already used!...\n",
2064 apic_id, mp_ioapics[apic_id].apicid); 2070 apic_id, mp_ioapics[apic_id].apicid);
@@ -2073,7 +2079,7 @@ void __init setup_ioapic_ids_from_mpc(void)
2073 mp_ioapics[apic_id].apicid = i; 2079 mp_ioapics[apic_id].apicid = i;
2074 } else { 2080 } else {
2075 physid_mask_t tmp; 2081 physid_mask_t tmp;
2076 tmp = apic->apicid_to_cpu_present(mp_ioapics[apic_id].apicid); 2082 apic->apicid_to_cpu_present(mp_ioapics[apic_id].apicid, &tmp);
2077 apic_printk(APIC_VERBOSE, "Setting %d in the " 2083 apic_printk(APIC_VERBOSE, "Setting %d in the "
2078 "phys_id_present_map\n", 2084 "phys_id_present_map\n",
2079 mp_ioapics[apic_id].apicid); 2085 mp_ioapics[apic_id].apicid);
@@ -2228,20 +2234,16 @@ static int ioapic_retrigger_irq(unsigned int irq)
2228 */ 2234 */
2229 2235
2230#ifdef CONFIG_SMP 2236#ifdef CONFIG_SMP
2231static void send_cleanup_vector(struct irq_cfg *cfg) 2237void send_cleanup_vector(struct irq_cfg *cfg)
2232{ 2238{
2233 cpumask_var_t cleanup_mask; 2239 cpumask_var_t cleanup_mask;
2234 2240
2235 if (unlikely(!alloc_cpumask_var(&cleanup_mask, GFP_ATOMIC))) { 2241 if (unlikely(!alloc_cpumask_var(&cleanup_mask, GFP_ATOMIC))) {
2236 unsigned int i; 2242 unsigned int i;
2237 cfg->move_cleanup_count = 0;
2238 for_each_cpu_and(i, cfg->old_domain, cpu_online_mask)
2239 cfg->move_cleanup_count++;
2240 for_each_cpu_and(i, cfg->old_domain, cpu_online_mask) 2243 for_each_cpu_and(i, cfg->old_domain, cpu_online_mask)
2241 apic->send_IPI_mask(cpumask_of(i), IRQ_MOVE_CLEANUP_VECTOR); 2244 apic->send_IPI_mask(cpumask_of(i), IRQ_MOVE_CLEANUP_VECTOR);
2242 } else { 2245 } else {
2243 cpumask_and(cleanup_mask, cfg->old_domain, cpu_online_mask); 2246 cpumask_and(cleanup_mask, cfg->old_domain, cpu_online_mask);
2244 cfg->move_cleanup_count = cpumask_weight(cleanup_mask);
2245 apic->send_IPI_mask(cleanup_mask, IRQ_MOVE_CLEANUP_VECTOR); 2247 apic->send_IPI_mask(cleanup_mask, IRQ_MOVE_CLEANUP_VECTOR);
2246 free_cpumask_var(cleanup_mask); 2248 free_cpumask_var(cleanup_mask);
2247 } 2249 }
@@ -2272,15 +2274,12 @@ static void __target_IO_APIC_irq(unsigned int irq, unsigned int dest, struct irq
2272 } 2274 }
2273} 2275}
2274 2276
2275static int
2276assign_irq_vector(int irq, struct irq_cfg *cfg, const struct cpumask *mask);
2277
2278/* 2277/*
2279 * Either sets desc->affinity to a valid value, and returns 2278 * Either sets desc->affinity to a valid value, and returns
2280 * ->cpu_mask_to_apicid of that, or returns BAD_APICID and 2279 * ->cpu_mask_to_apicid of that, or returns BAD_APICID and
2281 * leaves desc->affinity untouched. 2280 * leaves desc->affinity untouched.
2282 */ 2281 */
2283static unsigned int 2282unsigned int
2284set_desc_affinity(struct irq_desc *desc, const struct cpumask *mask) 2283set_desc_affinity(struct irq_desc *desc, const struct cpumask *mask)
2285{ 2284{
2286 struct irq_cfg *cfg; 2285 struct irq_cfg *cfg;
@@ -2433,8 +2432,6 @@ asmlinkage void smp_irq_move_cleanup_interrupt(void)
2433 2432
2434 cfg = irq_cfg(irq); 2433 cfg = irq_cfg(irq);
2435 spin_lock(&desc->lock); 2434 spin_lock(&desc->lock);
2436 if (!cfg->move_cleanup_count)
2437 goto unlock;
2438 2435
2439 if (vector == cfg->vector && cpumask_test_cpu(me, cfg->domain)) 2436 if (vector == cfg->vector && cpumask_test_cpu(me, cfg->domain))
2440 goto unlock; 2437 goto unlock;
@@ -2452,7 +2449,6 @@ asmlinkage void smp_irq_move_cleanup_interrupt(void)
2452 goto unlock; 2449 goto unlock;
2453 } 2450 }
2454 __get_cpu_var(vector_irq)[vector] = -1; 2451 __get_cpu_var(vector_irq)[vector] = -1;
2455 cfg->move_cleanup_count--;
2456unlock: 2452unlock:
2457 spin_unlock(&desc->lock); 2453 spin_unlock(&desc->lock);
2458 } 2454 }
@@ -2460,21 +2456,33 @@ unlock:
2460 irq_exit(); 2456 irq_exit();
2461} 2457}
2462 2458
2463static void irq_complete_move(struct irq_desc **descp) 2459static void __irq_complete_move(struct irq_desc **descp, unsigned vector)
2464{ 2460{
2465 struct irq_desc *desc = *descp; 2461 struct irq_desc *desc = *descp;
2466 struct irq_cfg *cfg = desc->chip_data; 2462 struct irq_cfg *cfg = desc->chip_data;
2467 unsigned vector, me; 2463 unsigned me;
2468 2464
2469 if (likely(!cfg->move_in_progress)) 2465 if (likely(!cfg->move_in_progress))
2470 return; 2466 return;
2471 2467
2472 vector = ~get_irq_regs()->orig_ax;
2473 me = smp_processor_id(); 2468 me = smp_processor_id();
2474 2469
2475 if (vector == cfg->vector && cpumask_test_cpu(me, cfg->domain)) 2470 if (vector == cfg->vector && cpumask_test_cpu(me, cfg->domain))
2476 send_cleanup_vector(cfg); 2471 send_cleanup_vector(cfg);
2477} 2472}
2473
2474static void irq_complete_move(struct irq_desc **descp)
2475{
2476 __irq_complete_move(descp, ~get_irq_regs()->orig_ax);
2477}
2478
2479void irq_force_complete_move(int irq)
2480{
2481 struct irq_desc *desc = irq_to_desc(irq);
2482 struct irq_cfg *cfg = desc->chip_data;
2483
2484 __irq_complete_move(&desc, cfg->vector);
2485}
2478#else 2486#else
2479static inline void irq_complete_move(struct irq_desc **descp) {} 2487static inline void irq_complete_move(struct irq_desc **descp) {}
2480#endif 2488#endif
@@ -2490,6 +2498,59 @@ static void ack_apic_edge(unsigned int irq)
2490 2498
2491atomic_t irq_mis_count; 2499atomic_t irq_mis_count;
2492 2500
2501/*
2502 * IO-APIC versions below 0x20 don't support EOI register.
2503 * For the record, here is the information about various versions:
2504 * 0Xh 82489DX
2505 * 1Xh I/OAPIC or I/O(x)APIC which are not PCI 2.2 Compliant
2506 * 2Xh I/O(x)APIC which is PCI 2.2 Compliant
2507 * 30h-FFh Reserved
2508 *
2509 * Some of the Intel ICH Specs (ICH2 to ICH5) documents the io-apic
2510 * version as 0x2. This is an error with documentation and these ICH chips
2511 * use io-apic's of version 0x20.
2512 *
2513 * For IO-APIC's with EOI register, we use that to do an explicit EOI.
2514 * Otherwise, we simulate the EOI message manually by changing the trigger
2515 * mode to edge and then back to level, with RTE being masked during this.
2516*/
2517static void __eoi_ioapic_irq(unsigned int irq, struct irq_cfg *cfg)
2518{
2519 struct irq_pin_list *entry;
2520
2521 for_each_irq_pin(entry, cfg->irq_2_pin) {
2522 if (mp_ioapics[entry->apic].apicver >= 0x20) {
2523 /*
2524 * Intr-remapping uses pin number as the virtual vector
2525 * in the RTE. Actual vector is programmed in
2526 * intr-remapping table entry. Hence for the io-apic
2527 * EOI we use the pin number.
2528 */
2529 if (irq_remapped(irq))
2530 io_apic_eoi(entry->apic, entry->pin);
2531 else
2532 io_apic_eoi(entry->apic, cfg->vector);
2533 } else {
2534 __mask_and_edge_IO_APIC_irq(entry);
2535 __unmask_and_level_IO_APIC_irq(entry);
2536 }
2537 }
2538}
2539
2540static void eoi_ioapic_irq(struct irq_desc *desc)
2541{
2542 struct irq_cfg *cfg;
2543 unsigned long flags;
2544 unsigned int irq;
2545
2546 irq = desc->irq;
2547 cfg = desc->chip_data;
2548
2549 spin_lock_irqsave(&ioapic_lock, flags);
2550 __eoi_ioapic_irq(irq, cfg);
2551 spin_unlock_irqrestore(&ioapic_lock, flags);
2552}
2553
2493static void ack_apic_level(unsigned int irq) 2554static void ack_apic_level(unsigned int irq)
2494{ 2555{
2495 struct irq_desc *desc = irq_to_desc(irq); 2556 struct irq_desc *desc = irq_to_desc(irq);
@@ -2525,6 +2586,19 @@ static void ack_apic_level(unsigned int irq)
2525 * level-triggered interrupt. We mask the source for the time of the 2586 * level-triggered interrupt. We mask the source for the time of the
2526 * operation to prevent an edge-triggered interrupt escaping meanwhile. 2587 * operation to prevent an edge-triggered interrupt escaping meanwhile.
2527 * The idea is from Manfred Spraul. --macro 2588 * The idea is from Manfred Spraul. --macro
2589 *
2590 * Also in the case when cpu goes offline, fixup_irqs() will forward
2591 * any unhandled interrupt on the offlined cpu to the new cpu
2592 * destination that is handling the corresponding interrupt. This
2593 * interrupt forwarding is done via IPI's. Hence, in this case also
2594 * level-triggered io-apic interrupt will be seen as an edge
2595 * interrupt in the IRR. And we can't rely on the cpu's EOI
2596 * to be broadcasted to the IO-APIC's which will clear the remoteIRR
2597 * corresponding to the level-triggered interrupt. Hence on IO-APIC's
2598 * supporting EOI register, we do an explicit EOI to clear the
2599 * remote IRR and on IO-APIC's which don't have an EOI register,
2600 * we use the above logic (mask+edge followed by unmask+level) from
2601 * Manfred Spraul to clear the remote IRR.
2528 */ 2602 */
2529 cfg = desc->chip_data; 2603 cfg = desc->chip_data;
2530 i = cfg->vector; 2604 i = cfg->vector;
@@ -2536,6 +2610,19 @@ static void ack_apic_level(unsigned int irq)
2536 */ 2610 */
2537 ack_APIC_irq(); 2611 ack_APIC_irq();
2538 2612
2613 /*
2614 * Tail end of clearing remote IRR bit (either by delivering the EOI
2615 * message via io-apic EOI register write or simulating it using
2616 * mask+edge followed by unnask+level logic) manually when the
2617 * level triggered interrupt is seen as the edge triggered interrupt
2618 * at the cpu.
2619 */
2620 if (!(v & (1 << (i & 0x1f)))) {
2621 atomic_inc(&irq_mis_count);
2622
2623 eoi_ioapic_irq(desc);
2624 }
2625
2539 /* Now we can move and renable the irq */ 2626 /* Now we can move and renable the irq */
2540 if (unlikely(do_unmask_irq)) { 2627 if (unlikely(do_unmask_irq)) {
2541 /* Only migrate the irq if the ack has been received. 2628 /* Only migrate the irq if the ack has been received.
@@ -2569,41 +2656,9 @@ static void ack_apic_level(unsigned int irq)
2569 move_masked_irq(irq); 2656 move_masked_irq(irq);
2570 unmask_IO_APIC_irq_desc(desc); 2657 unmask_IO_APIC_irq_desc(desc);
2571 } 2658 }
2572
2573 /* Tail end of version 0x11 I/O APIC bug workaround */
2574 if (!(v & (1 << (i & 0x1f)))) {
2575 atomic_inc(&irq_mis_count);
2576 spin_lock(&ioapic_lock);
2577 __mask_and_edge_IO_APIC_irq(cfg);
2578 __unmask_and_level_IO_APIC_irq(cfg);
2579 spin_unlock(&ioapic_lock);
2580 }
2581} 2659}
2582 2660
2583#ifdef CONFIG_INTR_REMAP 2661#ifdef CONFIG_INTR_REMAP
2584static void __eoi_ioapic_irq(unsigned int irq, struct irq_cfg *cfg)
2585{
2586 struct irq_pin_list *entry;
2587
2588 for_each_irq_pin(entry, cfg->irq_2_pin)
2589 io_apic_eoi(entry->apic, entry->pin);
2590}
2591
2592static void
2593eoi_ioapic_irq(struct irq_desc *desc)
2594{
2595 struct irq_cfg *cfg;
2596 unsigned long flags;
2597 unsigned int irq;
2598
2599 irq = desc->irq;
2600 cfg = desc->chip_data;
2601
2602 spin_lock_irqsave(&ioapic_lock, flags);
2603 __eoi_ioapic_irq(irq, cfg);
2604 spin_unlock_irqrestore(&ioapic_lock, flags);
2605}
2606
2607static void ir_ack_apic_edge(unsigned int irq) 2662static void ir_ack_apic_edge(unsigned int irq)
2608{ 2663{
2609 ack_APIC_irq(); 2664 ack_APIC_irq();
@@ -3157,6 +3212,7 @@ unsigned int create_irq_nr(unsigned int irq_want, int node)
3157 continue; 3212 continue;
3158 3213
3159 desc_new = move_irq_desc(desc_new, node); 3214 desc_new = move_irq_desc(desc_new, node);
3215 cfg_new = desc_new->chip_data;
3160 3216
3161 if (__assign_irq_vector(new, cfg_new, apic->target_cpus()) == 0) 3217 if (__assign_irq_vector(new, cfg_new, apic->target_cpus()) == 0)
3162 irq = new; 3218 irq = new;
@@ -3211,7 +3267,8 @@ void destroy_irq(unsigned int irq)
3211 * MSI message composition 3267 * MSI message composition
3212 */ 3268 */
3213#ifdef CONFIG_PCI_MSI 3269#ifdef CONFIG_PCI_MSI
3214static int msi_compose_msg(struct pci_dev *pdev, unsigned int irq, struct msi_msg *msg) 3270static int msi_compose_msg(struct pci_dev *pdev, unsigned int irq,
3271 struct msi_msg *msg, u8 hpet_id)
3215{ 3272{
3216 struct irq_cfg *cfg; 3273 struct irq_cfg *cfg;
3217 int err; 3274 int err;
@@ -3245,7 +3302,10 @@ static int msi_compose_msg(struct pci_dev *pdev, unsigned int irq, struct msi_ms
3245 irte.dest_id = IRTE_DEST(dest); 3302 irte.dest_id = IRTE_DEST(dest);
3246 3303
3247 /* Set source-id of interrupt request */ 3304 /* Set source-id of interrupt request */
3248 set_msi_sid(&irte, pdev); 3305 if (pdev)
3306 set_msi_sid(&irte, pdev);
3307 else
3308 set_hpet_sid(&irte, hpet_id);
3249 3309
3250 modify_irte(irq, &irte); 3310 modify_irte(irq, &irte);
3251 3311
@@ -3410,7 +3470,7 @@ static int setup_msi_irq(struct pci_dev *dev, struct msi_desc *msidesc, int irq)
3410 int ret; 3470 int ret;
3411 struct msi_msg msg; 3471 struct msi_msg msg;
3412 3472
3413 ret = msi_compose_msg(dev, irq, &msg); 3473 ret = msi_compose_msg(dev, irq, &msg, -1);
3414 if (ret < 0) 3474 if (ret < 0)
3415 return ret; 3475 return ret;
3416 3476
@@ -3543,7 +3603,7 @@ int arch_setup_dmar_msi(unsigned int irq)
3543 int ret; 3603 int ret;
3544 struct msi_msg msg; 3604 struct msi_msg msg;
3545 3605
3546 ret = msi_compose_msg(NULL, irq, &msg); 3606 ret = msi_compose_msg(NULL, irq, &msg, -1);
3547 if (ret < 0) 3607 if (ret < 0)
3548 return ret; 3608 return ret;
3549 dmar_msi_write(irq, &msg); 3609 dmar_msi_write(irq, &msg);
@@ -3583,6 +3643,19 @@ static int hpet_msi_set_affinity(unsigned int irq, const struct cpumask *mask)
3583 3643
3584#endif /* CONFIG_SMP */ 3644#endif /* CONFIG_SMP */
3585 3645
3646static struct irq_chip ir_hpet_msi_type = {
3647 .name = "IR-HPET_MSI",
3648 .unmask = hpet_msi_unmask,
3649 .mask = hpet_msi_mask,
3650#ifdef CONFIG_INTR_REMAP
3651 .ack = ir_ack_apic_edge,
3652#ifdef CONFIG_SMP
3653 .set_affinity = ir_set_msi_irq_affinity,
3654#endif
3655#endif
3656 .retrigger = ioapic_retrigger_irq,
3657};
3658
3586static struct irq_chip hpet_msi_type = { 3659static struct irq_chip hpet_msi_type = {
3587 .name = "HPET_MSI", 3660 .name = "HPET_MSI",
3588 .unmask = hpet_msi_unmask, 3661 .unmask = hpet_msi_unmask,
@@ -3594,20 +3667,36 @@ static struct irq_chip hpet_msi_type = {
3594 .retrigger = ioapic_retrigger_irq, 3667 .retrigger = ioapic_retrigger_irq,
3595}; 3668};
3596 3669
3597int arch_setup_hpet_msi(unsigned int irq) 3670int arch_setup_hpet_msi(unsigned int irq, unsigned int id)
3598{ 3671{
3599 int ret; 3672 int ret;
3600 struct msi_msg msg; 3673 struct msi_msg msg;
3601 struct irq_desc *desc = irq_to_desc(irq); 3674 struct irq_desc *desc = irq_to_desc(irq);
3602 3675
3603 ret = msi_compose_msg(NULL, irq, &msg); 3676 if (intr_remapping_enabled) {
3677 struct intel_iommu *iommu = map_hpet_to_ir(id);
3678 int index;
3679
3680 if (!iommu)
3681 return -1;
3682
3683 index = alloc_irte(iommu, irq, 1);
3684 if (index < 0)
3685 return -1;
3686 }
3687
3688 ret = msi_compose_msg(NULL, irq, &msg, id);
3604 if (ret < 0) 3689 if (ret < 0)
3605 return ret; 3690 return ret;
3606 3691
3607 hpet_msi_write(irq, &msg); 3692 hpet_msi_write(irq, &msg);
3608 desc->status |= IRQ_MOVE_PCNTXT; 3693 desc->status |= IRQ_MOVE_PCNTXT;
3609 set_irq_chip_and_handler_name(irq, &hpet_msi_type, handle_edge_irq, 3694 if (irq_remapped(irq))
3610 "edge"); 3695 set_irq_chip_and_handler_name(irq, &ir_hpet_msi_type,
3696 handle_edge_irq, "edge");
3697 else
3698 set_irq_chip_and_handler_name(irq, &hpet_msi_type,
3699 handle_edge_irq, "edge");
3611 3700
3612 return 0; 3701 return 0;
3613} 3702}
@@ -3708,75 +3797,6 @@ int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev)
3708} 3797}
3709#endif /* CONFIG_HT_IRQ */ 3798#endif /* CONFIG_HT_IRQ */
3710 3799
3711#ifdef CONFIG_X86_UV
3712/*
3713 * Re-target the irq to the specified CPU and enable the specified MMR located
3714 * on the specified blade to allow the sending of MSIs to the specified CPU.
3715 */
3716int arch_enable_uv_irq(char *irq_name, unsigned int irq, int cpu, int mmr_blade,
3717 unsigned long mmr_offset)
3718{
3719 const struct cpumask *eligible_cpu = cpumask_of(cpu);
3720 struct irq_cfg *cfg;
3721 int mmr_pnode;
3722 unsigned long mmr_value;
3723 struct uv_IO_APIC_route_entry *entry;
3724 unsigned long flags;
3725 int err;
3726
3727 BUILD_BUG_ON(sizeof(struct uv_IO_APIC_route_entry) != sizeof(unsigned long));
3728
3729 cfg = irq_cfg(irq);
3730
3731 err = assign_irq_vector(irq, cfg, eligible_cpu);
3732 if (err != 0)
3733 return err;
3734
3735 spin_lock_irqsave(&vector_lock, flags);
3736 set_irq_chip_and_handler_name(irq, &uv_irq_chip, handle_percpu_irq,
3737 irq_name);
3738 spin_unlock_irqrestore(&vector_lock, flags);
3739
3740 mmr_value = 0;
3741 entry = (struct uv_IO_APIC_route_entry *)&mmr_value;
3742 entry->vector = cfg->vector;
3743 entry->delivery_mode = apic->irq_delivery_mode;
3744 entry->dest_mode = apic->irq_dest_mode;
3745 entry->polarity = 0;
3746 entry->trigger = 0;
3747 entry->mask = 0;
3748 entry->dest = apic->cpu_mask_to_apicid(eligible_cpu);
3749
3750 mmr_pnode = uv_blade_to_pnode(mmr_blade);
3751 uv_write_global_mmr64(mmr_pnode, mmr_offset, mmr_value);
3752
3753 if (cfg->move_in_progress)
3754 send_cleanup_vector(cfg);
3755
3756 return irq;
3757}
3758
3759/*
3760 * Disable the specified MMR located on the specified blade so that MSIs are
3761 * longer allowed to be sent.
3762 */
3763void arch_disable_uv_irq(int mmr_blade, unsigned long mmr_offset)
3764{
3765 unsigned long mmr_value;
3766 struct uv_IO_APIC_route_entry *entry;
3767 int mmr_pnode;
3768
3769 BUILD_BUG_ON(sizeof(struct uv_IO_APIC_route_entry) != sizeof(unsigned long));
3770
3771 mmr_value = 0;
3772 entry = (struct uv_IO_APIC_route_entry *)&mmr_value;
3773 entry->mask = 1;
3774
3775 mmr_pnode = uv_blade_to_pnode(mmr_blade);
3776 uv_write_global_mmr64(mmr_pnode, mmr_offset, mmr_value);
3777}
3778#endif /* CONFIG_X86_64 */
3779
3780int __init io_apic_get_redir_entries (int ioapic) 3800int __init io_apic_get_redir_entries (int ioapic)
3781{ 3801{
3782 union IO_APIC_reg_01 reg_01; 3802 union IO_APIC_reg_01 reg_01;
@@ -3944,7 +3964,7 @@ int __init io_apic_get_unique_id(int ioapic, int apic_id)
3944 */ 3964 */
3945 3965
3946 if (physids_empty(apic_id_map)) 3966 if (physids_empty(apic_id_map))
3947 apic_id_map = apic->ioapic_phys_id_map(phys_cpu_present_map); 3967 apic->ioapic_phys_id_map(&phys_cpu_present_map, &apic_id_map);
3948 3968
3949 spin_lock_irqsave(&ioapic_lock, flags); 3969 spin_lock_irqsave(&ioapic_lock, flags);
3950 reg_00.raw = io_apic_read(ioapic, 0); 3970 reg_00.raw = io_apic_read(ioapic, 0);
@@ -3960,10 +3980,10 @@ int __init io_apic_get_unique_id(int ioapic, int apic_id)
3960 * Every APIC in a system must have a unique ID or we get lots of nice 3980 * Every APIC in a system must have a unique ID or we get lots of nice
3961 * 'stuck on smp_invalidate_needed IPI wait' messages. 3981 * 'stuck on smp_invalidate_needed IPI wait' messages.
3962 */ 3982 */
3963 if (apic->check_apicid_used(apic_id_map, apic_id)) { 3983 if (apic->check_apicid_used(&apic_id_map, apic_id)) {
3964 3984
3965 for (i = 0; i < get_physical_broadcast(); i++) { 3985 for (i = 0; i < get_physical_broadcast(); i++) {
3966 if (!apic->check_apicid_used(apic_id_map, i)) 3986 if (!apic->check_apicid_used(&apic_id_map, i))
3967 break; 3987 break;
3968 } 3988 }
3969 3989
@@ -3976,7 +3996,7 @@ int __init io_apic_get_unique_id(int ioapic, int apic_id)
3976 apic_id = i; 3996 apic_id = i;
3977 } 3997 }
3978 3998
3979 tmp = apic->apicid_to_cpu_present(apic_id); 3999 apic->apicid_to_cpu_present(apic_id, &tmp);
3980 physids_or(apic_id_map, apic_id_map, tmp); 4000 physids_or(apic_id_map, apic_id_map, tmp);
3981 4001
3982 if (reg_00.bits.ID != apic_id) { 4002 if (reg_00.bits.ID != apic_id) {
@@ -4106,7 +4126,7 @@ static struct resource * __init ioapic_setup_resources(int nr_ioapics)
4106 for (i = 0; i < nr_ioapics; i++) { 4126 for (i = 0; i < nr_ioapics; i++) {
4107 res[i].name = mem; 4127 res[i].name = mem;
4108 res[i].flags = IORESOURCE_MEM | IORESOURCE_BUSY; 4128 res[i].flags = IORESOURCE_MEM | IORESOURCE_BUSY;
4109 sprintf(mem, "IOAPIC %u", i); 4129 snprintf(mem, IOAPIC_RESOURCE_NAME_SIZE, "IOAPIC %u", i);
4110 mem += IOAPIC_RESOURCE_NAME_SIZE; 4130 mem += IOAPIC_RESOURCE_NAME_SIZE;
4111 } 4131 }
4112 4132
@@ -4140,18 +4160,17 @@ void __init ioapic_init_mappings(void)
4140#ifdef CONFIG_X86_32 4160#ifdef CONFIG_X86_32
4141fake_ioapic_page: 4161fake_ioapic_page:
4142#endif 4162#endif
4143 ioapic_phys = (unsigned long) 4163 ioapic_phys = (unsigned long)alloc_bootmem_pages(PAGE_SIZE);
4144 alloc_bootmem_pages(PAGE_SIZE);
4145 ioapic_phys = __pa(ioapic_phys); 4164 ioapic_phys = __pa(ioapic_phys);
4146 } 4165 }
4147 set_fixmap_nocache(idx, ioapic_phys); 4166 set_fixmap_nocache(idx, ioapic_phys);
4148 apic_printk(APIC_VERBOSE, 4167 apic_printk(APIC_VERBOSE, "mapped IOAPIC to %08lx (%08lx)\n",
4149 "mapped IOAPIC to %08lx (%08lx)\n", 4168 __fix_to_virt(idx) + (ioapic_phys & ~PAGE_MASK),
4150 __fix_to_virt(idx), ioapic_phys); 4169 ioapic_phys);
4151 idx++; 4170 idx++;
4152 4171
4153 ioapic_res->start = ioapic_phys; 4172 ioapic_res->start = ioapic_phys;
4154 ioapic_res->end = ioapic_phys + (4 * 1024) - 1; 4173 ioapic_res->end = ioapic_phys + IO_APIC_SLOT_SIZE - 1;
4155 ioapic_res++; 4174 ioapic_res++;
4156 } 4175 }
4157} 4176}
diff --git a/arch/x86/kernel/apic/nmi.c b/arch/x86/kernel/apic/nmi.c
index 7ff61d6a188a..6389432a9dbf 100644
--- a/arch/x86/kernel/apic/nmi.c
+++ b/arch/x86/kernel/apic/nmi.c
@@ -39,7 +39,8 @@
39int unknown_nmi_panic; 39int unknown_nmi_panic;
40int nmi_watchdog_enabled; 40int nmi_watchdog_enabled;
41 41
42static cpumask_t backtrace_mask __read_mostly; 42/* For reliability, we're prepared to waste bits here. */
43static DECLARE_BITMAP(backtrace_mask, NR_CPUS) __read_mostly;
43 44
44/* nmi_active: 45/* nmi_active:
45 * >0: the lapic NMI watchdog is active, but can be disabled 46 * >0: the lapic NMI watchdog is active, but can be disabled
@@ -414,7 +415,7 @@ nmi_watchdog_tick(struct pt_regs *regs, unsigned reason)
414 } 415 }
415 416
416 /* We can be called before check_nmi_watchdog, hence NULL check. */ 417 /* We can be called before check_nmi_watchdog, hence NULL check. */
417 if (cpumask_test_cpu(cpu, &backtrace_mask)) { 418 if (cpumask_test_cpu(cpu, to_cpumask(backtrace_mask))) {
418 static DEFINE_SPINLOCK(lock); /* Serialise the printks */ 419 static DEFINE_SPINLOCK(lock); /* Serialise the printks */
419 420
420 spin_lock(&lock); 421 spin_lock(&lock);
@@ -422,7 +423,7 @@ nmi_watchdog_tick(struct pt_regs *regs, unsigned reason)
422 show_regs(regs); 423 show_regs(regs);
423 dump_stack(); 424 dump_stack();
424 spin_unlock(&lock); 425 spin_unlock(&lock);
425 cpumask_clear_cpu(cpu, &backtrace_mask); 426 cpumask_clear_cpu(cpu, to_cpumask(backtrace_mask));
426 427
427 rc = 1; 428 rc = 1;
428 } 429 }
@@ -558,14 +559,14 @@ void arch_trigger_all_cpu_backtrace(void)
558{ 559{
559 int i; 560 int i;
560 561
561 cpumask_copy(&backtrace_mask, cpu_online_mask); 562 cpumask_copy(to_cpumask(backtrace_mask), cpu_online_mask);
562 563
563 printk(KERN_INFO "sending NMI to all CPUs:\n"); 564 printk(KERN_INFO "sending NMI to all CPUs:\n");
564 apic->send_IPI_all(NMI_VECTOR); 565 apic->send_IPI_all(NMI_VECTOR);
565 566
566 /* Wait for up to 10 seconds for all CPUs to do the backtrace */ 567 /* Wait for up to 10 seconds for all CPUs to do the backtrace */
567 for (i = 0; i < 10 * 1000; i++) { 568 for (i = 0; i < 10 * 1000; i++) {
568 if (cpumask_empty(&backtrace_mask)) 569 if (cpumask_empty(to_cpumask(backtrace_mask)))
569 break; 570 break;
570 mdelay(1); 571 mdelay(1);
571 } 572 }
diff --git a/arch/x86/kernel/apic/numaq_32.c b/arch/x86/kernel/apic/numaq_32.c
index efa00e2b8505..98c4665f251c 100644
--- a/arch/x86/kernel/apic/numaq_32.c
+++ b/arch/x86/kernel/apic/numaq_32.c
@@ -264,11 +264,6 @@ static void __init smp_read_mpc_oem(struct mpc_table *mpc)
264static __init void early_check_numaq(void) 264static __init void early_check_numaq(void)
265{ 265{
266 /* 266 /*
267 * Find possible boot-time SMP configuration:
268 */
269 early_find_smp_config();
270
271 /*
272 * get boot-time SMP configuration: 267 * get boot-time SMP configuration:
273 */ 268 */
274 if (smp_found_config) 269 if (smp_found_config)
@@ -334,10 +329,9 @@ static inline const struct cpumask *numaq_target_cpus(void)
334 return cpu_all_mask; 329 return cpu_all_mask;
335} 330}
336 331
337static inline unsigned long 332static unsigned long numaq_check_apicid_used(physid_mask_t *map, int apicid)
338numaq_check_apicid_used(physid_mask_t bitmap, int apicid)
339{ 333{
340 return physid_isset(apicid, bitmap); 334 return physid_isset(apicid, *map);
341} 335}
342 336
343static inline unsigned long numaq_check_apicid_present(int bit) 337static inline unsigned long numaq_check_apicid_present(int bit)
@@ -371,10 +365,10 @@ static inline int numaq_multi_timer_check(int apic, int irq)
371 return apic != 0 && irq == 0; 365 return apic != 0 && irq == 0;
372} 366}
373 367
374static inline physid_mask_t numaq_ioapic_phys_id_map(physid_mask_t phys_map) 368static inline void numaq_ioapic_phys_id_map(physid_mask_t *phys_map, physid_mask_t *retmap)
375{ 369{
376 /* We don't have a good way to do this yet - hack */ 370 /* We don't have a good way to do this yet - hack */
377 return physids_promote(0xFUL); 371 return physids_promote(0xFUL, retmap);
378} 372}
379 373
380static inline int numaq_cpu_to_logical_apicid(int cpu) 374static inline int numaq_cpu_to_logical_apicid(int cpu)
@@ -402,12 +396,12 @@ static inline int numaq_apicid_to_node(int logical_apicid)
402 return logical_apicid >> 4; 396 return logical_apicid >> 4;
403} 397}
404 398
405static inline physid_mask_t numaq_apicid_to_cpu_present(int logical_apicid) 399static void numaq_apicid_to_cpu_present(int logical_apicid, physid_mask_t *retmap)
406{ 400{
407 int node = numaq_apicid_to_node(logical_apicid); 401 int node = numaq_apicid_to_node(logical_apicid);
408 int cpu = __ffs(logical_apicid & 0xf); 402 int cpu = __ffs(logical_apicid & 0xf);
409 403
410 return physid_mask_of_physid(cpu + 4*node); 404 physid_set_mask_of_physid(cpu + 4*node, retmap);
411} 405}
412 406
413/* Where the IO area was mapped on multiquad, always 0 otherwise */ 407/* Where the IO area was mapped on multiquad, always 0 otherwise */
diff --git a/arch/x86/kernel/apic/probe_32.c b/arch/x86/kernel/apic/probe_32.c
index 0c0182cc947d..1a6559f6768c 100644
--- a/arch/x86/kernel/apic/probe_32.c
+++ b/arch/x86/kernel/apic/probe_32.c
@@ -108,7 +108,7 @@ struct apic apic_default = {
108 .apicid_to_node = default_apicid_to_node, 108 .apicid_to_node = default_apicid_to_node,
109 .cpu_to_logical_apicid = default_cpu_to_logical_apicid, 109 .cpu_to_logical_apicid = default_cpu_to_logical_apicid,
110 .cpu_present_to_apicid = default_cpu_present_to_apicid, 110 .cpu_present_to_apicid = default_cpu_present_to_apicid,
111 .apicid_to_cpu_present = default_apicid_to_cpu_present, 111 .apicid_to_cpu_present = physid_set_mask_of_physid,
112 .setup_portio_remap = NULL, 112 .setup_portio_remap = NULL,
113 .check_phys_apicid_present = default_check_phys_apicid_present, 113 .check_phys_apicid_present = default_check_phys_apicid_present,
114 .enable_apic_mode = NULL, 114 .enable_apic_mode = NULL,
diff --git a/arch/x86/kernel/apic/summit_32.c b/arch/x86/kernel/apic/summit_32.c
index 645ecc4ff0be..9b419263d90d 100644
--- a/arch/x86/kernel/apic/summit_32.c
+++ b/arch/x86/kernel/apic/summit_32.c
@@ -183,7 +183,7 @@ static const struct cpumask *summit_target_cpus(void)
183 return cpumask_of(0); 183 return cpumask_of(0);
184} 184}
185 185
186static unsigned long summit_check_apicid_used(physid_mask_t bitmap, int apicid) 186static unsigned long summit_check_apicid_used(physid_mask_t *map, int apicid)
187{ 187{
188 return 0; 188 return 0;
189} 189}
@@ -261,15 +261,15 @@ static int summit_cpu_present_to_apicid(int mps_cpu)
261 return BAD_APICID; 261 return BAD_APICID;
262} 262}
263 263
264static physid_mask_t summit_ioapic_phys_id_map(physid_mask_t phys_id_map) 264static void summit_ioapic_phys_id_map(physid_mask_t *phys_id_map, physid_mask_t *retmap)
265{ 265{
266 /* For clustered we don't have a good way to do this yet - hack */ 266 /* For clustered we don't have a good way to do this yet - hack */
267 return physids_promote(0x0F); 267 physids_promote(0x0FL, retmap);
268} 268}
269 269
270static physid_mask_t summit_apicid_to_cpu_present(int apicid) 270static void summit_apicid_to_cpu_present(int apicid, physid_mask_t *retmap)
271{ 271{
272 return physid_mask_of_physid(0); 272 physid_set_mask_of_physid(0, retmap);
273} 273}
274 274
275static int summit_check_phys_apicid_present(int physical_apicid) 275static int summit_check_phys_apicid_present(int physical_apicid)
diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c
index 326c25477d3d..b684bb303cbf 100644
--- a/arch/x86/kernel/apic/x2apic_uv_x.c
+++ b/arch/x86/kernel/apic/x2apic_uv_x.c
@@ -30,10 +30,22 @@
30#include <asm/apic.h> 30#include <asm/apic.h>
31#include <asm/ipi.h> 31#include <asm/ipi.h>
32#include <asm/smp.h> 32#include <asm/smp.h>
33#include <asm/x86_init.h>
33 34
34DEFINE_PER_CPU(int, x2apic_extra_bits); 35DEFINE_PER_CPU(int, x2apic_extra_bits);
35 36
36static enum uv_system_type uv_system_type; 37static enum uv_system_type uv_system_type;
38static u64 gru_start_paddr, gru_end_paddr;
39
40static inline bool is_GRU_range(u64 start, u64 end)
41{
42 return start >= gru_start_paddr && end <= gru_end_paddr;
43}
44
45static bool uv_is_untracked_pat_range(u64 start, u64 end)
46{
47 return is_ISA_range(start, end) || is_GRU_range(start, end);
48}
37 49
38static int early_get_nodeid(void) 50static int early_get_nodeid(void)
39{ 51{
@@ -49,6 +61,7 @@ static int early_get_nodeid(void)
49static int __init uv_acpi_madt_oem_check(char *oem_id, char *oem_table_id) 61static int __init uv_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
50{ 62{
51 if (!strcmp(oem_id, "SGI")) { 63 if (!strcmp(oem_id, "SGI")) {
64 x86_platform.is_untracked_pat_range = uv_is_untracked_pat_range;
52 if (!strcmp(oem_table_id, "UVL")) 65 if (!strcmp(oem_table_id, "UVL"))
53 uv_system_type = UV_LEGACY_APIC; 66 uv_system_type = UV_LEGACY_APIC;
54 else if (!strcmp(oem_table_id, "UVX")) 67 else if (!strcmp(oem_table_id, "UVX"))
@@ -385,8 +398,12 @@ static __init void map_gru_high(int max_pnode)
385 int shift = UVH_RH_GAM_GRU_OVERLAY_CONFIG_MMR_BASE_SHFT; 398 int shift = UVH_RH_GAM_GRU_OVERLAY_CONFIG_MMR_BASE_SHFT;
386 399
387 gru.v = uv_read_local_mmr(UVH_RH_GAM_GRU_OVERLAY_CONFIG_MMR); 400 gru.v = uv_read_local_mmr(UVH_RH_GAM_GRU_OVERLAY_CONFIG_MMR);
388 if (gru.s.enable) 401 if (gru.s.enable) {
389 map_high("GRU", gru.s.base, shift, max_pnode, map_wb); 402 map_high("GRU", gru.s.base, shift, max_pnode, map_wb);
403 gru_start_paddr = ((u64)gru.s.base << shift);
404 gru_end_paddr = gru_start_paddr + (1UL << shift) * (max_pnode + 1);
405
406 }
390} 407}
391 408
392static __init void map_mmr_high(int max_pnode) 409static __init void map_mmr_high(int max_pnode)
@@ -409,6 +426,12 @@ static __init void map_mmioh_high(int max_pnode)
409 map_high("MMIOH", mmioh.s.base, shift, max_pnode, map_uc); 426 map_high("MMIOH", mmioh.s.base, shift, max_pnode, map_uc);
410} 427}
411 428
429static __init void map_low_mmrs(void)
430{
431 init_extra_mapping_uc(UV_GLOBAL_MMR32_BASE, UV_GLOBAL_MMR32_SIZE);
432 init_extra_mapping_uc(UV_LOCAL_MMR_BASE, UV_LOCAL_MMR_SIZE);
433}
434
412static __init void uv_rtc_init(void) 435static __init void uv_rtc_init(void)
413{ 436{
414 long status; 437 long status;
@@ -550,6 +573,8 @@ void __init uv_system_init(void)
550 unsigned long mmr_base, present, paddr; 573 unsigned long mmr_base, present, paddr;
551 unsigned short pnode_mask; 574 unsigned short pnode_mask;
552 575
576 map_low_mmrs();
577
553 m_n_config.v = uv_read_local_mmr(UVH_SI_ADDR_MAP_CONFIG); 578 m_n_config.v = uv_read_local_mmr(UVH_SI_ADDR_MAP_CONFIG);
554 m_val = m_n_config.s.m_skt; 579 m_val = m_n_config.s.m_skt;
555 n_val = m_n_config.s.n_skt; 580 n_val = m_n_config.s.n_skt;
diff --git a/arch/x86/kernel/apm_32.c b/arch/x86/kernel/apm_32.c
index 151ace69a5aa..b5b6b23bce53 100644
--- a/arch/x86/kernel/apm_32.c
+++ b/arch/x86/kernel/apm_32.c
@@ -204,7 +204,6 @@
204#include <linux/module.h> 204#include <linux/module.h>
205 205
206#include <linux/poll.h> 206#include <linux/poll.h>
207#include <linux/smp_lock.h>
208#include <linux/types.h> 207#include <linux/types.h>
209#include <linux/stddef.h> 208#include <linux/stddef.h>
210#include <linux/timer.h> 209#include <linux/timer.h>
@@ -403,6 +402,7 @@ static DECLARE_WAIT_QUEUE_HEAD(apm_waitqueue);
403static DECLARE_WAIT_QUEUE_HEAD(apm_suspend_waitqueue); 402static DECLARE_WAIT_QUEUE_HEAD(apm_suspend_waitqueue);
404static struct apm_user *user_list; 403static struct apm_user *user_list;
405static DEFINE_SPINLOCK(user_list_lock); 404static DEFINE_SPINLOCK(user_list_lock);
405static DEFINE_MUTEX(apm_mutex);
406 406
407/* 407/*
408 * Set up a segment that references the real mode segment 0x40 408 * Set up a segment that references the real mode segment 0x40
@@ -1531,7 +1531,7 @@ static long do_ioctl(struct file *filp, u_int cmd, u_long arg)
1531 return -EPERM; 1531 return -EPERM;
1532 switch (cmd) { 1532 switch (cmd) {
1533 case APM_IOC_STANDBY: 1533 case APM_IOC_STANDBY:
1534 lock_kernel(); 1534 mutex_lock(&apm_mutex);
1535 if (as->standbys_read > 0) { 1535 if (as->standbys_read > 0) {
1536 as->standbys_read--; 1536 as->standbys_read--;
1537 as->standbys_pending--; 1537 as->standbys_pending--;
@@ -1540,10 +1540,10 @@ static long do_ioctl(struct file *filp, u_int cmd, u_long arg)
1540 queue_event(APM_USER_STANDBY, as); 1540 queue_event(APM_USER_STANDBY, as);
1541 if (standbys_pending <= 0) 1541 if (standbys_pending <= 0)
1542 standby(); 1542 standby();
1543 unlock_kernel(); 1543 mutex_unlock(&apm_mutex);
1544 break; 1544 break;
1545 case APM_IOC_SUSPEND: 1545 case APM_IOC_SUSPEND:
1546 lock_kernel(); 1546 mutex_lock(&apm_mutex);
1547 if (as->suspends_read > 0) { 1547 if (as->suspends_read > 0) {
1548 as->suspends_read--; 1548 as->suspends_read--;
1549 as->suspends_pending--; 1549 as->suspends_pending--;
@@ -1552,13 +1552,14 @@ static long do_ioctl(struct file *filp, u_int cmd, u_long arg)
1552 queue_event(APM_USER_SUSPEND, as); 1552 queue_event(APM_USER_SUSPEND, as);
1553 if (suspends_pending <= 0) { 1553 if (suspends_pending <= 0) {
1554 ret = suspend(1); 1554 ret = suspend(1);
1555 mutex_unlock(&apm_mutex);
1555 } else { 1556 } else {
1556 as->suspend_wait = 1; 1557 as->suspend_wait = 1;
1558 mutex_unlock(&apm_mutex);
1557 wait_event_interruptible(apm_suspend_waitqueue, 1559 wait_event_interruptible(apm_suspend_waitqueue,
1558 as->suspend_wait == 0); 1560 as->suspend_wait == 0);
1559 ret = as->suspend_result; 1561 ret = as->suspend_result;
1560 } 1562 }
1561 unlock_kernel();
1562 return ret; 1563 return ret;
1563 default: 1564 default:
1564 return -ENOTTY; 1565 return -ENOTTY;
@@ -1608,12 +1609,10 @@ static int do_open(struct inode *inode, struct file *filp)
1608{ 1609{
1609 struct apm_user *as; 1610 struct apm_user *as;
1610 1611
1611 lock_kernel();
1612 as = kmalloc(sizeof(*as), GFP_KERNEL); 1612 as = kmalloc(sizeof(*as), GFP_KERNEL);
1613 if (as == NULL) { 1613 if (as == NULL) {
1614 printk(KERN_ERR "apm: cannot allocate struct of size %d bytes\n", 1614 printk(KERN_ERR "apm: cannot allocate struct of size %d bytes\n",
1615 sizeof(*as)); 1615 sizeof(*as));
1616 unlock_kernel();
1617 return -ENOMEM; 1616 return -ENOMEM;
1618 } 1617 }
1619 as->magic = APM_BIOS_MAGIC; 1618 as->magic = APM_BIOS_MAGIC;
@@ -1635,7 +1634,6 @@ static int do_open(struct inode *inode, struct file *filp)
1635 user_list = as; 1634 user_list = as;
1636 spin_unlock(&user_list_lock); 1635 spin_unlock(&user_list_lock);
1637 filp->private_data = as; 1636 filp->private_data = as;
1638 unlock_kernel();
1639 return 0; 1637 return 0;
1640} 1638}
1641 1639
diff --git a/arch/x86/kernel/cpu/Makefile b/arch/x86/kernel/cpu/Makefile
index 68537e957a9b..1d2cb383410e 100644
--- a/arch/x86/kernel/cpu/Makefile
+++ b/arch/x86/kernel/cpu/Makefile
@@ -5,6 +5,7 @@
5# Don't trace early stages of a secondary CPU boot 5# Don't trace early stages of a secondary CPU boot
6ifdef CONFIG_FUNCTION_TRACER 6ifdef CONFIG_FUNCTION_TRACER
7CFLAGS_REMOVE_common.o = -pg 7CFLAGS_REMOVE_common.o = -pg
8CFLAGS_REMOVE_perf_event.o = -pg
8endif 9endif
9 10
10# Make sure load_percpu_segment has no stackprotector 11# Make sure load_percpu_segment has no stackprotector
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index c910a716a71c..7128b3799cec 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -535,7 +535,7 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
535 } 535 }
536 } 536 }
537 537
538 display_cacheinfo(c); 538 cpu_detect_cache_sizes(c);
539 539
540 /* Multi core CPU? */ 540 /* Multi core CPU? */
541 if (c->extended_cpuid_level >= 0x80000008) { 541 if (c->extended_cpuid_level >= 0x80000008) {
diff --git a/arch/x86/kernel/cpu/centaur.c b/arch/x86/kernel/cpu/centaur.c
index c95e831bb095..e58d978e0758 100644
--- a/arch/x86/kernel/cpu/centaur.c
+++ b/arch/x86/kernel/cpu/centaur.c
@@ -294,7 +294,7 @@ static void __cpuinit init_c3(struct cpuinfo_x86 *c)
294 set_cpu_cap(c, X86_FEATURE_REP_GOOD); 294 set_cpu_cap(c, X86_FEATURE_REP_GOOD);
295 } 295 }
296 296
297 display_cacheinfo(c); 297 cpu_detect_cache_sizes(c);
298} 298}
299 299
300enum { 300enum {
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index cc25c2b4a567..c1afa990a6c8 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -61,7 +61,7 @@ void __init setup_cpu_local_masks(void)
61static void __cpuinit default_init(struct cpuinfo_x86 *c) 61static void __cpuinit default_init(struct cpuinfo_x86 *c)
62{ 62{
63#ifdef CONFIG_X86_64 63#ifdef CONFIG_X86_64
64 display_cacheinfo(c); 64 cpu_detect_cache_sizes(c);
65#else 65#else
66 /* Not much we can do here... */ 66 /* Not much we can do here... */
67 /* Check if at least it has cpuid */ 67 /* Check if at least it has cpuid */
@@ -383,7 +383,7 @@ static void __cpuinit get_model_name(struct cpuinfo_x86 *c)
383 } 383 }
384} 384}
385 385
386void __cpuinit display_cacheinfo(struct cpuinfo_x86 *c) 386void __cpuinit cpu_detect_cache_sizes(struct cpuinfo_x86 *c)
387{ 387{
388 unsigned int n, dummy, ebx, ecx, edx, l2size; 388 unsigned int n, dummy, ebx, ecx, edx, l2size;
389 389
@@ -391,8 +391,6 @@ void __cpuinit display_cacheinfo(struct cpuinfo_x86 *c)
391 391
392 if (n >= 0x80000005) { 392 if (n >= 0x80000005) {
393 cpuid(0x80000005, &dummy, &ebx, &ecx, &edx); 393 cpuid(0x80000005, &dummy, &ebx, &ecx, &edx);
394 printk(KERN_INFO "CPU: L1 I Cache: %dK (%d bytes/line), D cache %dK (%d bytes/line)\n",
395 edx>>24, edx&0xFF, ecx>>24, ecx&0xFF);
396 c->x86_cache_size = (ecx>>24) + (edx>>24); 394 c->x86_cache_size = (ecx>>24) + (edx>>24);
397#ifdef CONFIG_X86_64 395#ifdef CONFIG_X86_64
398 /* On K8 L1 TLB is inclusive, so don't count it */ 396 /* On K8 L1 TLB is inclusive, so don't count it */
@@ -422,9 +420,6 @@ void __cpuinit display_cacheinfo(struct cpuinfo_x86 *c)
422#endif 420#endif
423 421
424 c->x86_cache_size = l2size; 422 c->x86_cache_size = l2size;
425
426 printk(KERN_INFO "CPU: L2 Cache: %dK (%d bytes/line)\n",
427 l2size, ecx & 0xFF);
428} 423}
429 424
430void __cpuinit detect_ht(struct cpuinfo_x86 *c) 425void __cpuinit detect_ht(struct cpuinfo_x86 *c)
@@ -659,24 +654,31 @@ void __init early_cpu_init(void)
659 const struct cpu_dev *const *cdev; 654 const struct cpu_dev *const *cdev;
660 int count = 0; 655 int count = 0;
661 656
657#ifdef PROCESSOR_SELECT
662 printk(KERN_INFO "KERNEL supported cpus:\n"); 658 printk(KERN_INFO "KERNEL supported cpus:\n");
659#endif
660
663 for (cdev = __x86_cpu_dev_start; cdev < __x86_cpu_dev_end; cdev++) { 661 for (cdev = __x86_cpu_dev_start; cdev < __x86_cpu_dev_end; cdev++) {
664 const struct cpu_dev *cpudev = *cdev; 662 const struct cpu_dev *cpudev = *cdev;
665 unsigned int j;
666 663
667 if (count >= X86_VENDOR_NUM) 664 if (count >= X86_VENDOR_NUM)
668 break; 665 break;
669 cpu_devs[count] = cpudev; 666 cpu_devs[count] = cpudev;
670 count++; 667 count++;
671 668
672 for (j = 0; j < 2; j++) { 669#ifdef PROCESSOR_SELECT
673 if (!cpudev->c_ident[j]) 670 {
674 continue; 671 unsigned int j;
675 printk(KERN_INFO " %s %s\n", cpudev->c_vendor, 672
676 cpudev->c_ident[j]); 673 for (j = 0; j < 2; j++) {
674 if (!cpudev->c_ident[j])
675 continue;
676 printk(KERN_INFO " %s %s\n", cpudev->c_vendor,
677 cpudev->c_ident[j]);
678 }
677 } 679 }
680#endif
678 } 681 }
679
680 early_identify_cpu(&boot_cpu_data); 682 early_identify_cpu(&boot_cpu_data);
681} 683}
682 684
@@ -837,10 +839,8 @@ static void __cpuinit identify_cpu(struct cpuinfo_x86 *c)
837 boot_cpu_data.x86_capability[i] &= c->x86_capability[i]; 839 boot_cpu_data.x86_capability[i] &= c->x86_capability[i];
838 } 840 }
839 841
840#ifdef CONFIG_X86_MCE
841 /* Init Machine Check Exception if available. */ 842 /* Init Machine Check Exception if available. */
842 mcheck_init(c); 843 mcheck_cpu_init(c);
843#endif
844 844
845 select_idle_routine(c); 845 select_idle_routine(c);
846 846
@@ -1136,7 +1136,7 @@ void __cpuinit cpu_init(void)
1136 wrmsrl(MSR_KERNEL_GS_BASE, 0); 1136 wrmsrl(MSR_KERNEL_GS_BASE, 0);
1137 barrier(); 1137 barrier();
1138 1138
1139 check_efer(); 1139 x86_configure_nx();
1140 if (cpu != 0) 1140 if (cpu != 0)
1141 enable_x2apic(); 1141 enable_x2apic();
1142 1142
diff --git a/arch/x86/kernel/cpu/cpu.h b/arch/x86/kernel/cpu/cpu.h
index 6de9a908e400..3624e8a0f71b 100644
--- a/arch/x86/kernel/cpu/cpu.h
+++ b/arch/x86/kernel/cpu/cpu.h
@@ -32,6 +32,6 @@ struct cpu_dev {
32extern const struct cpu_dev *const __x86_cpu_dev_start[], 32extern const struct cpu_dev *const __x86_cpu_dev_start[],
33 *const __x86_cpu_dev_end[]; 33 *const __x86_cpu_dev_end[];
34 34
35extern void display_cacheinfo(struct cpuinfo_x86 *c); 35extern void cpu_detect_cache_sizes(struct cpuinfo_x86 *c);
36 36
37#endif 37#endif
diff --git a/arch/x86/kernel/cpu/cyrix.c b/arch/x86/kernel/cpu/cyrix.c
index 19807b89f058..4fbd384fb645 100644
--- a/arch/x86/kernel/cpu/cyrix.c
+++ b/arch/x86/kernel/cpu/cyrix.c
@@ -373,7 +373,7 @@ static void __cpuinit init_nsc(struct cpuinfo_x86 *c)
373 /* Handle the GX (Formally known as the GX2) */ 373 /* Handle the GX (Formally known as the GX2) */
374 374
375 if (c->x86 == 5 && c->x86_model == 5) 375 if (c->x86 == 5 && c->x86_model == 5)
376 display_cacheinfo(c); 376 cpu_detect_cache_sizes(c);
377 else 377 else
378 init_cyrix(c); 378 init_cyrix(c);
379} 379}
diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
index 40e1835b35e8..c900b73f9224 100644
--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
@@ -263,8 +263,12 @@ static void __cpuinit srat_detect_node(struct cpuinfo_x86 *c)
263 /* Don't do the funky fallback heuristics the AMD version employs 263 /* Don't do the funky fallback heuristics the AMD version employs
264 for now. */ 264 for now. */
265 node = apicid_to_node[apicid]; 265 node = apicid_to_node[apicid];
266 if (node == NUMA_NO_NODE || !node_online(node)) 266 if (node == NUMA_NO_NODE)
267 node = first_node(node_online_map); 267 node = first_node(node_online_map);
268 else if (!node_online(node)) {
269 /* reuse the value from init_cpu_to_node() */
270 node = cpu_to_node(cpu);
271 }
268 numa_set_node(cpu, node); 272 numa_set_node(cpu, node);
269 273
270 printk(KERN_INFO "CPU %d/0x%x -> Node %d\n", cpu, apicid, node); 274 printk(KERN_INFO "CPU %d/0x%x -> Node %d\n", cpu, apicid, node);
diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c
index 804c40e2bc3e..6c40f6b5b340 100644
--- a/arch/x86/kernel/cpu/intel_cacheinfo.c
+++ b/arch/x86/kernel/cpu/intel_cacheinfo.c
@@ -94,7 +94,7 @@ static const struct _cache_table __cpuinitconst cache_table[] =
94 { 0xd1, LVL_3, 1024 }, /* 4-way set assoc, 64 byte line size */ 94 { 0xd1, LVL_3, 1024 }, /* 4-way set assoc, 64 byte line size */
95 { 0xd2, LVL_3, 2048 }, /* 4-way set assoc, 64 byte line size */ 95 { 0xd2, LVL_3, 2048 }, /* 4-way set assoc, 64 byte line size */
96 { 0xd6, LVL_3, 1024 }, /* 8-way set assoc, 64 byte line size */ 96 { 0xd6, LVL_3, 1024 }, /* 8-way set assoc, 64 byte line size */
97 { 0xd7, LVL_3, 2038 }, /* 8-way set assoc, 64 byte line size */ 97 { 0xd7, LVL_3, 2048 }, /* 8-way set assoc, 64 byte line size */
98 { 0xd8, LVL_3, 4096 }, /* 12-way set assoc, 64 byte line size */ 98 { 0xd8, LVL_3, 4096 }, /* 12-way set assoc, 64 byte line size */
99 { 0xdc, LVL_3, 2048 }, /* 12-way set assoc, 64 byte line size */ 99 { 0xdc, LVL_3, 2048 }, /* 12-way set assoc, 64 byte line size */
100 { 0xdd, LVL_3, 4096 }, /* 12-way set assoc, 64 byte line size */ 100 { 0xdd, LVL_3, 4096 }, /* 12-way set assoc, 64 byte line size */
@@ -102,6 +102,9 @@ static const struct _cache_table __cpuinitconst cache_table[] =
102 { 0xe2, LVL_3, 2048 }, /* 16-way set assoc, 64 byte line size */ 102 { 0xe2, LVL_3, 2048 }, /* 16-way set assoc, 64 byte line size */
103 { 0xe3, LVL_3, 4096 }, /* 16-way set assoc, 64 byte line size */ 103 { 0xe3, LVL_3, 4096 }, /* 16-way set assoc, 64 byte line size */
104 { 0xe4, LVL_3, 8192 }, /* 16-way set assoc, 64 byte line size */ 104 { 0xe4, LVL_3, 8192 }, /* 16-way set assoc, 64 byte line size */
105 { 0xea, LVL_3, 12288 }, /* 24-way set assoc, 64 byte line size */
106 { 0xeb, LVL_3, 18432 }, /* 24-way set assoc, 64 byte line size */
107 { 0xec, LVL_3, 24576 }, /* 24-way set assoc, 64 byte line size */
105 { 0x00, 0, 0} 108 { 0x00, 0, 0}
106}; 109};
107 110
@@ -488,22 +491,6 @@ unsigned int __cpuinit init_intel_cacheinfo(struct cpuinfo_x86 *c)
488#endif 491#endif
489 } 492 }
490 493
491 if (trace)
492 printk(KERN_INFO "CPU: Trace cache: %dK uops", trace);
493 else if (l1i)
494 printk(KERN_INFO "CPU: L1 I cache: %dK", l1i);
495
496 if (l1d)
497 printk(KERN_CONT ", L1 D cache: %dK\n", l1d);
498 else
499 printk(KERN_CONT "\n");
500
501 if (l2)
502 printk(KERN_INFO "CPU: L2 cache: %dK\n", l2);
503
504 if (l3)
505 printk(KERN_INFO "CPU: L3 cache: %dK\n", l3);
506
507 c->x86_cache_size = l3 ? l3 : (l2 ? l2 : (l1i+l1d)); 494 c->x86_cache_size = l3 ? l3 : (l2 ? l2 : (l1i+l1d));
508 495
509 return l2; 496 return l2;
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index 721a77ca8115..d7ebf25d10ed 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -46,6 +46,9 @@
46 46
47#include "mce-internal.h" 47#include "mce-internal.h"
48 48
49#define CREATE_TRACE_POINTS
50#include <trace/events/mce.h>
51
49int mce_disabled __read_mostly; 52int mce_disabled __read_mostly;
50 53
51#define MISC_MCELOG_MINOR 227 54#define MISC_MCELOG_MINOR 227
@@ -85,18 +88,26 @@ static DECLARE_WAIT_QUEUE_HEAD(mce_wait);
85static DEFINE_PER_CPU(struct mce, mces_seen); 88static DEFINE_PER_CPU(struct mce, mces_seen);
86static int cpu_missing; 89static int cpu_missing;
87 90
88static void default_decode_mce(struct mce *m) 91/*
92 * CPU/chipset specific EDAC code can register a notifier call here to print
93 * MCE errors in a human-readable form.
94 */
95ATOMIC_NOTIFIER_HEAD(x86_mce_decoder_chain);
96EXPORT_SYMBOL_GPL(x86_mce_decoder_chain);
97
98static int default_decode_mce(struct notifier_block *nb, unsigned long val,
99 void *data)
89{ 100{
90 pr_emerg("No human readable MCE decoding support on this CPU type.\n"); 101 pr_emerg("No human readable MCE decoding support on this CPU type.\n");
91 pr_emerg("Run the message through 'mcelog --ascii' to decode.\n"); 102 pr_emerg("Run the message through 'mcelog --ascii' to decode.\n");
103
104 return NOTIFY_STOP;
92} 105}
93 106
94/* 107static struct notifier_block mce_dec_nb = {
95 * CPU/chipset specific EDAC code can register a callback here to print 108 .notifier_call = default_decode_mce,
96 * MCE errors in a human-readable form: 109 .priority = -1,
97 */ 110};
98void (*x86_mce_decode_callback)(struct mce *m) = default_decode_mce;
99EXPORT_SYMBOL(x86_mce_decode_callback);
100 111
101/* MCA banks polled by the period polling timer for corrected events */ 112/* MCA banks polled by the period polling timer for corrected events */
102DEFINE_PER_CPU(mce_banks_t, mce_poll_banks) = { 113DEFINE_PER_CPU(mce_banks_t, mce_poll_banks) = {
@@ -141,6 +152,9 @@ void mce_log(struct mce *mce)
141{ 152{
142 unsigned next, entry; 153 unsigned next, entry;
143 154
155 /* Emit the trace record: */
156 trace_mce_record(mce);
157
144 mce->finished = 0; 158 mce->finished = 0;
145 wmb(); 159 wmb();
146 for (;;) { 160 for (;;) {
@@ -204,9 +218,9 @@ static void print_mce(struct mce *m)
204 218
205 /* 219 /*
206 * Print out human-readable details about the MCE error, 220 * Print out human-readable details about the MCE error,
207 * (if the CPU has an implementation for that): 221 * (if the CPU has an implementation for that)
208 */ 222 */
209 x86_mce_decode_callback(m); 223 atomic_notifier_call_chain(&x86_mce_decoder_chain, 0, m);
210} 224}
211 225
212static void print_mce_head(void) 226static void print_mce_head(void)
@@ -1122,7 +1136,7 @@ static int check_interval = 5 * 60; /* 5 minutes */
1122static DEFINE_PER_CPU(int, mce_next_interval); /* in jiffies */ 1136static DEFINE_PER_CPU(int, mce_next_interval); /* in jiffies */
1123static DEFINE_PER_CPU(struct timer_list, mce_timer); 1137static DEFINE_PER_CPU(struct timer_list, mce_timer);
1124 1138
1125static void mcheck_timer(unsigned long data) 1139static void mce_start_timer(unsigned long data)
1126{ 1140{
1127 struct timer_list *t = &per_cpu(mce_timer, data); 1141 struct timer_list *t = &per_cpu(mce_timer, data);
1128 int *n; 1142 int *n;
@@ -1187,7 +1201,7 @@ int mce_notify_irq(void)
1187} 1201}
1188EXPORT_SYMBOL_GPL(mce_notify_irq); 1202EXPORT_SYMBOL_GPL(mce_notify_irq);
1189 1203
1190static int mce_banks_init(void) 1204static int __cpuinit __mcheck_cpu_mce_banks_init(void)
1191{ 1205{
1192 int i; 1206 int i;
1193 1207
@@ -1206,7 +1220,7 @@ static int mce_banks_init(void)
1206/* 1220/*
1207 * Initialize Machine Checks for a CPU. 1221 * Initialize Machine Checks for a CPU.
1208 */ 1222 */
1209static int __cpuinit mce_cap_init(void) 1223static int __cpuinit __mcheck_cpu_cap_init(void)
1210{ 1224{
1211 unsigned b; 1225 unsigned b;
1212 u64 cap; 1226 u64 cap;
@@ -1228,7 +1242,7 @@ static int __cpuinit mce_cap_init(void)
1228 WARN_ON(banks != 0 && b != banks); 1242 WARN_ON(banks != 0 && b != banks);
1229 banks = b; 1243 banks = b;
1230 if (!mce_banks) { 1244 if (!mce_banks) {
1231 int err = mce_banks_init(); 1245 int err = __mcheck_cpu_mce_banks_init();
1232 1246
1233 if (err) 1247 if (err)
1234 return err; 1248 return err;
@@ -1244,7 +1258,7 @@ static int __cpuinit mce_cap_init(void)
1244 return 0; 1258 return 0;
1245} 1259}
1246 1260
1247static void mce_init(void) 1261static void __mcheck_cpu_init_generic(void)
1248{ 1262{
1249 mce_banks_t all_banks; 1263 mce_banks_t all_banks;
1250 u64 cap; 1264 u64 cap;
@@ -1273,7 +1287,7 @@ static void mce_init(void)
1273} 1287}
1274 1288
1275/* Add per CPU specific workarounds here */ 1289/* Add per CPU specific workarounds here */
1276static int __cpuinit mce_cpu_quirks(struct cpuinfo_x86 *c) 1290static int __cpuinit __mcheck_cpu_apply_quirks(struct cpuinfo_x86 *c)
1277{ 1291{
1278 if (c->x86_vendor == X86_VENDOR_UNKNOWN) { 1292 if (c->x86_vendor == X86_VENDOR_UNKNOWN) {
1279 pr_info("MCE: unknown CPU type - not enabling MCE support.\n"); 1293 pr_info("MCE: unknown CPU type - not enabling MCE support.\n");
@@ -1341,7 +1355,7 @@ static int __cpuinit mce_cpu_quirks(struct cpuinfo_x86 *c)
1341 return 0; 1355 return 0;
1342} 1356}
1343 1357
1344static void __cpuinit mce_ancient_init(struct cpuinfo_x86 *c) 1358static void __cpuinit __mcheck_cpu_ancient_init(struct cpuinfo_x86 *c)
1345{ 1359{
1346 if (c->x86 != 5) 1360 if (c->x86 != 5)
1347 return; 1361 return;
@@ -1355,7 +1369,7 @@ static void __cpuinit mce_ancient_init(struct cpuinfo_x86 *c)
1355 } 1369 }
1356} 1370}
1357 1371
1358static void mce_cpu_features(struct cpuinfo_x86 *c) 1372static void __mcheck_cpu_init_vendor(struct cpuinfo_x86 *c)
1359{ 1373{
1360 switch (c->x86_vendor) { 1374 switch (c->x86_vendor) {
1361 case X86_VENDOR_INTEL: 1375 case X86_VENDOR_INTEL:
@@ -1369,7 +1383,7 @@ static void mce_cpu_features(struct cpuinfo_x86 *c)
1369 } 1383 }
1370} 1384}
1371 1385
1372static void mce_init_timer(void) 1386static void __mcheck_cpu_init_timer(void)
1373{ 1387{
1374 struct timer_list *t = &__get_cpu_var(mce_timer); 1388 struct timer_list *t = &__get_cpu_var(mce_timer);
1375 int *n = &__get_cpu_var(mce_next_interval); 1389 int *n = &__get_cpu_var(mce_next_interval);
@@ -1380,7 +1394,7 @@ static void mce_init_timer(void)
1380 *n = check_interval * HZ; 1394 *n = check_interval * HZ;
1381 if (!*n) 1395 if (!*n)
1382 return; 1396 return;
1383 setup_timer(t, mcheck_timer, smp_processor_id()); 1397 setup_timer(t, mce_start_timer, smp_processor_id());
1384 t->expires = round_jiffies(jiffies + *n); 1398 t->expires = round_jiffies(jiffies + *n);
1385 add_timer_on(t, smp_processor_id()); 1399 add_timer_on(t, smp_processor_id());
1386} 1400}
@@ -1400,27 +1414,28 @@ void (*machine_check_vector)(struct pt_regs *, long error_code) =
1400 * Called for each booted CPU to set up machine checks. 1414 * Called for each booted CPU to set up machine checks.
1401 * Must be called with preempt off: 1415 * Must be called with preempt off:
1402 */ 1416 */
1403void __cpuinit mcheck_init(struct cpuinfo_x86 *c) 1417void __cpuinit mcheck_cpu_init(struct cpuinfo_x86 *c)
1404{ 1418{
1405 if (mce_disabled) 1419 if (mce_disabled)
1406 return; 1420 return;
1407 1421
1408 mce_ancient_init(c); 1422 __mcheck_cpu_ancient_init(c);
1409 1423
1410 if (!mce_available(c)) 1424 if (!mce_available(c))
1411 return; 1425 return;
1412 1426
1413 if (mce_cap_init() < 0 || mce_cpu_quirks(c) < 0) { 1427 if (__mcheck_cpu_cap_init() < 0 || __mcheck_cpu_apply_quirks(c) < 0) {
1414 mce_disabled = 1; 1428 mce_disabled = 1;
1415 return; 1429 return;
1416 } 1430 }
1417 1431
1418 machine_check_vector = do_machine_check; 1432 machine_check_vector = do_machine_check;
1419 1433
1420 mce_init(); 1434 __mcheck_cpu_init_generic();
1421 mce_cpu_features(c); 1435 __mcheck_cpu_init_vendor(c);
1422 mce_init_timer(); 1436 __mcheck_cpu_init_timer();
1423 INIT_WORK(&__get_cpu_var(mce_work), mce_process_work); 1437 INIT_WORK(&__get_cpu_var(mce_work), mce_process_work);
1438
1424} 1439}
1425 1440
1426/* 1441/*
@@ -1640,6 +1655,15 @@ static int __init mcheck_enable(char *str)
1640} 1655}
1641__setup("mce", mcheck_enable); 1656__setup("mce", mcheck_enable);
1642 1657
1658int __init mcheck_init(void)
1659{
1660 atomic_notifier_chain_register(&x86_mce_decoder_chain, &mce_dec_nb);
1661
1662 mcheck_intel_therm_init();
1663
1664 return 0;
1665}
1666
1643/* 1667/*
1644 * Sysfs support 1668 * Sysfs support
1645 */ 1669 */
@@ -1648,7 +1672,7 @@ __setup("mce", mcheck_enable);
1648 * Disable machine checks on suspend and shutdown. We can't really handle 1672 * Disable machine checks on suspend and shutdown. We can't really handle
1649 * them later. 1673 * them later.
1650 */ 1674 */
1651static int mce_disable(void) 1675static int mce_disable_error_reporting(void)
1652{ 1676{
1653 int i; 1677 int i;
1654 1678
@@ -1663,12 +1687,12 @@ static int mce_disable(void)
1663 1687
1664static int mce_suspend(struct sys_device *dev, pm_message_t state) 1688static int mce_suspend(struct sys_device *dev, pm_message_t state)
1665{ 1689{
1666 return mce_disable(); 1690 return mce_disable_error_reporting();
1667} 1691}
1668 1692
1669static int mce_shutdown(struct sys_device *dev) 1693static int mce_shutdown(struct sys_device *dev)
1670{ 1694{
1671 return mce_disable(); 1695 return mce_disable_error_reporting();
1672} 1696}
1673 1697
1674/* 1698/*
@@ -1678,8 +1702,8 @@ static int mce_shutdown(struct sys_device *dev)
1678 */ 1702 */
1679static int mce_resume(struct sys_device *dev) 1703static int mce_resume(struct sys_device *dev)
1680{ 1704{
1681 mce_init(); 1705 __mcheck_cpu_init_generic();
1682 mce_cpu_features(&current_cpu_data); 1706 __mcheck_cpu_init_vendor(&current_cpu_data);
1683 1707
1684 return 0; 1708 return 0;
1685} 1709}
@@ -1689,8 +1713,8 @@ static void mce_cpu_restart(void *data)
1689 del_timer_sync(&__get_cpu_var(mce_timer)); 1713 del_timer_sync(&__get_cpu_var(mce_timer));
1690 if (!mce_available(&current_cpu_data)) 1714 if (!mce_available(&current_cpu_data))
1691 return; 1715 return;
1692 mce_init(); 1716 __mcheck_cpu_init_generic();
1693 mce_init_timer(); 1717 __mcheck_cpu_init_timer();
1694} 1718}
1695 1719
1696/* Reinit MCEs after user configuration changes */ 1720/* Reinit MCEs after user configuration changes */
@@ -1716,7 +1740,7 @@ static void mce_enable_ce(void *all)
1716 cmci_reenable(); 1740 cmci_reenable();
1717 cmci_recheck(); 1741 cmci_recheck();
1718 if (all) 1742 if (all)
1719 mce_init_timer(); 1743 __mcheck_cpu_init_timer();
1720} 1744}
1721 1745
1722static struct sysdev_class mce_sysclass = { 1746static struct sysdev_class mce_sysclass = {
@@ -1929,13 +1953,14 @@ static __cpuinit void mce_remove_device(unsigned int cpu)
1929} 1953}
1930 1954
1931/* Make sure there are no machine checks on offlined CPUs. */ 1955/* Make sure there are no machine checks on offlined CPUs. */
1932static void mce_disable_cpu(void *h) 1956static void __cpuinit mce_disable_cpu(void *h)
1933{ 1957{
1934 unsigned long action = *(unsigned long *)h; 1958 unsigned long action = *(unsigned long *)h;
1935 int i; 1959 int i;
1936 1960
1937 if (!mce_available(&current_cpu_data)) 1961 if (!mce_available(&current_cpu_data))
1938 return; 1962 return;
1963
1939 if (!(action & CPU_TASKS_FROZEN)) 1964 if (!(action & CPU_TASKS_FROZEN))
1940 cmci_clear(); 1965 cmci_clear();
1941 for (i = 0; i < banks; i++) { 1966 for (i = 0; i < banks; i++) {
@@ -1946,7 +1971,7 @@ static void mce_disable_cpu(void *h)
1946 } 1971 }
1947} 1972}
1948 1973
1949static void mce_reenable_cpu(void *h) 1974static void __cpuinit mce_reenable_cpu(void *h)
1950{ 1975{
1951 unsigned long action = *(unsigned long *)h; 1976 unsigned long action = *(unsigned long *)h;
1952 int i; 1977 int i;
@@ -1991,9 +2016,11 @@ mce_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
1991 break; 2016 break;
1992 case CPU_DOWN_FAILED: 2017 case CPU_DOWN_FAILED:
1993 case CPU_DOWN_FAILED_FROZEN: 2018 case CPU_DOWN_FAILED_FROZEN:
1994 t->expires = round_jiffies(jiffies + 2019 if (!mce_ignore_ce && check_interval) {
2020 t->expires = round_jiffies(jiffies +
1995 __get_cpu_var(mce_next_interval)); 2021 __get_cpu_var(mce_next_interval));
1996 add_timer_on(t, cpu); 2022 add_timer_on(t, cpu);
2023 }
1997 smp_call_function_single(cpu, mce_reenable_cpu, &action, 1); 2024 smp_call_function_single(cpu, mce_reenable_cpu, &action, 1);
1998 break; 2025 break;
1999 case CPU_POST_DEAD: 2026 case CPU_POST_DEAD:
@@ -2025,7 +2052,7 @@ static __init void mce_init_banks(void)
2025 } 2052 }
2026} 2053}
2027 2054
2028static __init int mce_init_device(void) 2055static __init int mcheck_init_device(void)
2029{ 2056{
2030 int err; 2057 int err;
2031 int i = 0; 2058 int i = 0;
@@ -2053,7 +2080,7 @@ static __init int mce_init_device(void)
2053 return err; 2080 return err;
2054} 2081}
2055 2082
2056device_initcall(mce_init_device); 2083device_initcall(mcheck_init_device);
2057 2084
2058/* 2085/*
2059 * Old style boot options parsing. Only for compatibility. 2086 * Old style boot options parsing. Only for compatibility.
@@ -2101,7 +2128,7 @@ static int fake_panic_set(void *data, u64 val)
2101DEFINE_SIMPLE_ATTRIBUTE(fake_panic_fops, fake_panic_get, 2128DEFINE_SIMPLE_ATTRIBUTE(fake_panic_fops, fake_panic_get,
2102 fake_panic_set, "%llu\n"); 2129 fake_panic_set, "%llu\n");
2103 2130
2104static int __init mce_debugfs_init(void) 2131static int __init mcheck_debugfs_init(void)
2105{ 2132{
2106 struct dentry *dmce, *ffake_panic; 2133 struct dentry *dmce, *ffake_panic;
2107 2134
@@ -2115,5 +2142,5 @@ static int __init mce_debugfs_init(void)
2115 2142
2116 return 0; 2143 return 0;
2117} 2144}
2118late_initcall(mce_debugfs_init); 2145late_initcall(mcheck_debugfs_init);
2119#endif 2146#endif
diff --git a/arch/x86/kernel/cpu/mcheck/therm_throt.c b/arch/x86/kernel/cpu/mcheck/therm_throt.c
index b3a1dba75330..4fef985fc221 100644
--- a/arch/x86/kernel/cpu/mcheck/therm_throt.c
+++ b/arch/x86/kernel/cpu/mcheck/therm_throt.c
@@ -49,6 +49,8 @@ static DEFINE_PER_CPU(struct thermal_state, thermal_state);
49 49
50static atomic_t therm_throt_en = ATOMIC_INIT(0); 50static atomic_t therm_throt_en = ATOMIC_INIT(0);
51 51
52static u32 lvtthmr_init __read_mostly;
53
52#ifdef CONFIG_SYSFS 54#ifdef CONFIG_SYSFS
53#define define_therm_throt_sysdev_one_ro(_name) \ 55#define define_therm_throt_sysdev_one_ro(_name) \
54 static SYSDEV_ATTR(_name, 0444, therm_throt_sysdev_show_##_name, NULL) 56 static SYSDEV_ATTR(_name, 0444, therm_throt_sysdev_show_##_name, NULL)
@@ -254,6 +256,18 @@ asmlinkage void smp_thermal_interrupt(struct pt_regs *regs)
254 ack_APIC_irq(); 256 ack_APIC_irq();
255} 257}
256 258
259void __init mcheck_intel_therm_init(void)
260{
261 /*
262 * This function is only called on boot CPU. Save the init thermal
263 * LVT value on BSP and use that value to restore APs' thermal LVT
264 * entry BIOS programmed later
265 */
266 if (cpu_has(&boot_cpu_data, X86_FEATURE_ACPI) &&
267 cpu_has(&boot_cpu_data, X86_FEATURE_ACC))
268 lvtthmr_init = apic_read(APIC_LVTTHMR);
269}
270
257void intel_init_thermal(struct cpuinfo_x86 *c) 271void intel_init_thermal(struct cpuinfo_x86 *c)
258{ 272{
259 unsigned int cpu = smp_processor_id(); 273 unsigned int cpu = smp_processor_id();
@@ -270,7 +284,20 @@ void intel_init_thermal(struct cpuinfo_x86 *c)
270 * since it might be delivered via SMI already: 284 * since it might be delivered via SMI already:
271 */ 285 */
272 rdmsr(MSR_IA32_MISC_ENABLE, l, h); 286 rdmsr(MSR_IA32_MISC_ENABLE, l, h);
273 h = apic_read(APIC_LVTTHMR); 287
288 /*
289 * The initial value of thermal LVT entries on all APs always reads
290 * 0x10000 because APs are woken up by BSP issuing INIT-SIPI-SIPI
291 * sequence to them and LVT registers are reset to 0s except for
292 * the mask bits which are set to 1s when APs receive INIT IPI.
293 * Always restore the value that BIOS has programmed on AP based on
294 * BSP's info we saved since BIOS is always setting the same value
295 * for all threads/cores
296 */
297 apic_write(APIC_LVTTHMR, lvtthmr_init);
298
299 h = lvtthmr_init;
300
274 if ((l & MSR_IA32_MISC_ENABLE_TM1) && (h & APIC_DM_SMI)) { 301 if ((l & MSR_IA32_MISC_ENABLE_TM1) && (h & APIC_DM_SMI)) {
275 printk(KERN_DEBUG 302 printk(KERN_DEBUG
276 "CPU%d: Thermal monitoring handled by SMI\n", cpu); 303 "CPU%d: Thermal monitoring handled by SMI\n", cpu);
diff --git a/arch/x86/kernel/cpu/mtrr/cleanup.c b/arch/x86/kernel/cpu/mtrr/cleanup.c
index 73c86db5acbe..09b1698e0466 100644
--- a/arch/x86/kernel/cpu/mtrr/cleanup.c
+++ b/arch/x86/kernel/cpu/mtrr/cleanup.c
@@ -170,6 +170,41 @@ static int __init cmp_range(const void *x1, const void *x2)
170 return start1 - start2; 170 return start1 - start2;
171} 171}
172 172
173static int __init clean_sort_range(struct res_range *range, int az)
174{
175 int i, j, k = az - 1, nr_range = 0;
176
177 for (i = 0; i < k; i++) {
178 if (range[i].end)
179 continue;
180 for (j = k; j > i; j--) {
181 if (range[j].end) {
182 k = j;
183 break;
184 }
185 }
186 if (j == i)
187 break;
188 range[i].start = range[k].start;
189 range[i].end = range[k].end;
190 range[k].start = 0;
191 range[k].end = 0;
192 k--;
193 }
194 /* count it */
195 for (i = 0; i < az; i++) {
196 if (!range[i].end) {
197 nr_range = i;
198 break;
199 }
200 }
201
202 /* sort them */
203 sort(range, nr_range, sizeof(struct res_range), cmp_range, NULL);
204
205 return nr_range;
206}
207
173#define BIOS_BUG_MSG KERN_WARNING \ 208#define BIOS_BUG_MSG KERN_WARNING \
174 "WARNING: BIOS bug: VAR MTRR %d contains strange UC entry under 1M, check with your system vendor!\n" 209 "WARNING: BIOS bug: VAR MTRR %d contains strange UC entry under 1M, check with your system vendor!\n"
175 210
@@ -223,22 +258,18 @@ x86_get_mtrr_mem_range(struct res_range *range, int nr_range,
223 subtract_range(range, extra_remove_base, 258 subtract_range(range, extra_remove_base,
224 extra_remove_base + extra_remove_size - 1); 259 extra_remove_base + extra_remove_size - 1);
225 260
226 /* get new range num */
227 nr_range = 0;
228 for (i = 0; i < RANGE_NUM; i++) {
229 if (!range[i].end)
230 continue;
231 nr_range++;
232 }
233 if (debug_print) { 261 if (debug_print) {
234 printk(KERN_DEBUG "After UC checking\n"); 262 printk(KERN_DEBUG "After UC checking\n");
235 for (i = 0; i < nr_range; i++) 263 for (i = 0; i < RANGE_NUM; i++) {
264 if (!range[i].end)
265 continue;
236 printk(KERN_DEBUG "MTRR MAP PFN: %016lx - %016lx\n", 266 printk(KERN_DEBUG "MTRR MAP PFN: %016lx - %016lx\n",
237 range[i].start, range[i].end + 1); 267 range[i].start, range[i].end + 1);
268 }
238 } 269 }
239 270
240 /* sort the ranges */ 271 /* sort the ranges */
241 sort(range, nr_range, sizeof(struct res_range), cmp_range, NULL); 272 nr_range = clean_sort_range(range, RANGE_NUM);
242 if (debug_print) { 273 if (debug_print) {
243 printk(KERN_DEBUG "After sorting\n"); 274 printk(KERN_DEBUG "After sorting\n");
244 for (i = 0; i < nr_range; i++) 275 for (i = 0; i < nr_range; i++)
@@ -689,8 +720,6 @@ static int __init mtrr_need_cleanup(void)
689 continue; 720 continue;
690 if (!size) 721 if (!size)
691 type = MTRR_NUM_TYPES; 722 type = MTRR_NUM_TYPES;
692 if (type == MTRR_TYPE_WRPROT)
693 type = MTRR_TYPE_UNCACHABLE;
694 num[type]++; 723 num[type]++;
695 } 724 }
696 725
diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c
index b5801c311846..c1bbed1021d9 100644
--- a/arch/x86/kernel/cpu/perf_event.c
+++ b/arch/x86/kernel/cpu/perf_event.c
@@ -77,6 +77,18 @@ struct cpu_hw_events {
77 struct debug_store *ds; 77 struct debug_store *ds;
78}; 78};
79 79
80struct event_constraint {
81 unsigned long idxmsk[BITS_TO_LONGS(X86_PMC_IDX_MAX)];
82 int code;
83};
84
85#define EVENT_CONSTRAINT(c, m) { .code = (c), .idxmsk[0] = (m) }
86#define EVENT_CONSTRAINT_END { .code = 0, .idxmsk[0] = 0 }
87
88#define for_each_event_constraint(e, c) \
89 for ((e) = (c); (e)->idxmsk[0]; (e)++)
90
91
80/* 92/*
81 * struct x86_pmu - generic x86 pmu 93 * struct x86_pmu - generic x86 pmu
82 */ 94 */
@@ -102,6 +114,8 @@ struct x86_pmu {
102 u64 intel_ctrl; 114 u64 intel_ctrl;
103 void (*enable_bts)(u64 config); 115 void (*enable_bts)(u64 config);
104 void (*disable_bts)(void); 116 void (*disable_bts)(void);
117 int (*get_event_idx)(struct cpu_hw_events *cpuc,
118 struct hw_perf_event *hwc);
105}; 119};
106 120
107static struct x86_pmu x86_pmu __read_mostly; 121static struct x86_pmu x86_pmu __read_mostly;
@@ -110,6 +124,8 @@ static DEFINE_PER_CPU(struct cpu_hw_events, cpu_hw_events) = {
110 .enabled = 1, 124 .enabled = 1,
111}; 125};
112 126
127static const struct event_constraint *event_constraints;
128
113/* 129/*
114 * Not sure about some of these 130 * Not sure about some of these
115 */ 131 */
@@ -155,6 +171,16 @@ static u64 p6_pmu_raw_event(u64 hw_event)
155 return hw_event & P6_EVNTSEL_MASK; 171 return hw_event & P6_EVNTSEL_MASK;
156} 172}
157 173
174static const struct event_constraint intel_p6_event_constraints[] =
175{
176 EVENT_CONSTRAINT(0xc1, 0x1), /* FLOPS */
177 EVENT_CONSTRAINT(0x10, 0x1), /* FP_COMP_OPS_EXE */
178 EVENT_CONSTRAINT(0x11, 0x1), /* FP_ASSIST */
179 EVENT_CONSTRAINT(0x12, 0x2), /* MUL */
180 EVENT_CONSTRAINT(0x13, 0x2), /* DIV */
181 EVENT_CONSTRAINT(0x14, 0x1), /* CYCLES_DIV_BUSY */
182 EVENT_CONSTRAINT_END
183};
158 184
159/* 185/*
160 * Intel PerfMon v3. Used on Core2 and later. 186 * Intel PerfMon v3. Used on Core2 and later.
@@ -170,6 +196,35 @@ static const u64 intel_perfmon_event_map[] =
170 [PERF_COUNT_HW_BUS_CYCLES] = 0x013c, 196 [PERF_COUNT_HW_BUS_CYCLES] = 0x013c,
171}; 197};
172 198
199static const struct event_constraint intel_core_event_constraints[] =
200{
201 EVENT_CONSTRAINT(0x10, 0x1), /* FP_COMP_OPS_EXE */
202 EVENT_CONSTRAINT(0x11, 0x2), /* FP_ASSIST */
203 EVENT_CONSTRAINT(0x12, 0x2), /* MUL */
204 EVENT_CONSTRAINT(0x13, 0x2), /* DIV */
205 EVENT_CONSTRAINT(0x14, 0x1), /* CYCLES_DIV_BUSY */
206 EVENT_CONSTRAINT(0x18, 0x1), /* IDLE_DURING_DIV */
207 EVENT_CONSTRAINT(0x19, 0x2), /* DELAYED_BYPASS */
208 EVENT_CONSTRAINT(0xa1, 0x1), /* RS_UOPS_DISPATCH_CYCLES */
209 EVENT_CONSTRAINT(0xcb, 0x1), /* MEM_LOAD_RETIRED */
210 EVENT_CONSTRAINT_END
211};
212
213static const struct event_constraint intel_nehalem_event_constraints[] =
214{
215 EVENT_CONSTRAINT(0x40, 0x3), /* L1D_CACHE_LD */
216 EVENT_CONSTRAINT(0x41, 0x3), /* L1D_CACHE_ST */
217 EVENT_CONSTRAINT(0x42, 0x3), /* L1D_CACHE_LOCK */
218 EVENT_CONSTRAINT(0x43, 0x3), /* L1D_ALL_REF */
219 EVENT_CONSTRAINT(0x4e, 0x3), /* L1D_PREFETCH */
220 EVENT_CONSTRAINT(0x4c, 0x3), /* LOAD_HIT_PRE */
221 EVENT_CONSTRAINT(0x51, 0x3), /* L1D */
222 EVENT_CONSTRAINT(0x52, 0x3), /* L1D_CACHE_PREFETCH_LOCK_FB_HIT */
223 EVENT_CONSTRAINT(0x53, 0x3), /* L1D_CACHE_LOCK_FB_HIT */
224 EVENT_CONSTRAINT(0xc5, 0x3), /* CACHE_LOCK_CYCLES */
225 EVENT_CONSTRAINT_END
226};
227
173static u64 intel_pmu_event_map(int hw_event) 228static u64 intel_pmu_event_map(int hw_event)
174{ 229{
175 return intel_perfmon_event_map[hw_event]; 230 return intel_perfmon_event_map[hw_event];
@@ -190,7 +245,7 @@ static u64 __read_mostly hw_cache_event_ids
190 [PERF_COUNT_HW_CACHE_OP_MAX] 245 [PERF_COUNT_HW_CACHE_OP_MAX]
191 [PERF_COUNT_HW_CACHE_RESULT_MAX]; 246 [PERF_COUNT_HW_CACHE_RESULT_MAX];
192 247
193static const u64 nehalem_hw_cache_event_ids 248static __initconst u64 nehalem_hw_cache_event_ids
194 [PERF_COUNT_HW_CACHE_MAX] 249 [PERF_COUNT_HW_CACHE_MAX]
195 [PERF_COUNT_HW_CACHE_OP_MAX] 250 [PERF_COUNT_HW_CACHE_OP_MAX]
196 [PERF_COUNT_HW_CACHE_RESULT_MAX] = 251 [PERF_COUNT_HW_CACHE_RESULT_MAX] =
@@ -281,7 +336,7 @@ static const u64 nehalem_hw_cache_event_ids
281 }, 336 },
282}; 337};
283 338
284static const u64 core2_hw_cache_event_ids 339static __initconst u64 core2_hw_cache_event_ids
285 [PERF_COUNT_HW_CACHE_MAX] 340 [PERF_COUNT_HW_CACHE_MAX]
286 [PERF_COUNT_HW_CACHE_OP_MAX] 341 [PERF_COUNT_HW_CACHE_OP_MAX]
287 [PERF_COUNT_HW_CACHE_RESULT_MAX] = 342 [PERF_COUNT_HW_CACHE_RESULT_MAX] =
@@ -372,7 +427,7 @@ static const u64 core2_hw_cache_event_ids
372 }, 427 },
373}; 428};
374 429
375static const u64 atom_hw_cache_event_ids 430static __initconst u64 atom_hw_cache_event_ids
376 [PERF_COUNT_HW_CACHE_MAX] 431 [PERF_COUNT_HW_CACHE_MAX]
377 [PERF_COUNT_HW_CACHE_OP_MAX] 432 [PERF_COUNT_HW_CACHE_OP_MAX]
378 [PERF_COUNT_HW_CACHE_RESULT_MAX] = 433 [PERF_COUNT_HW_CACHE_RESULT_MAX] =
@@ -469,7 +524,7 @@ static u64 intel_pmu_raw_event(u64 hw_event)
469#define CORE_EVNTSEL_UNIT_MASK 0x0000FF00ULL 524#define CORE_EVNTSEL_UNIT_MASK 0x0000FF00ULL
470#define CORE_EVNTSEL_EDGE_MASK 0x00040000ULL 525#define CORE_EVNTSEL_EDGE_MASK 0x00040000ULL
471#define CORE_EVNTSEL_INV_MASK 0x00800000ULL 526#define CORE_EVNTSEL_INV_MASK 0x00800000ULL
472#define CORE_EVNTSEL_REG_MASK 0xFF000000ULL 527#define CORE_EVNTSEL_REG_MASK 0xFF000000ULL
473 528
474#define CORE_EVNTSEL_MASK \ 529#define CORE_EVNTSEL_MASK \
475 (CORE_EVNTSEL_EVENT_MASK | \ 530 (CORE_EVNTSEL_EVENT_MASK | \
@@ -481,7 +536,7 @@ static u64 intel_pmu_raw_event(u64 hw_event)
481 return hw_event & CORE_EVNTSEL_MASK; 536 return hw_event & CORE_EVNTSEL_MASK;
482} 537}
483 538
484static const u64 amd_hw_cache_event_ids 539static __initconst u64 amd_hw_cache_event_ids
485 [PERF_COUNT_HW_CACHE_MAX] 540 [PERF_COUNT_HW_CACHE_MAX]
486 [PERF_COUNT_HW_CACHE_OP_MAX] 541 [PERF_COUNT_HW_CACHE_OP_MAX]
487 [PERF_COUNT_HW_CACHE_RESULT_MAX] = 542 [PERF_COUNT_HW_CACHE_RESULT_MAX] =
@@ -932,6 +987,8 @@ static int __hw_perf_event_init(struct perf_event *event)
932 */ 987 */
933 hwc->config = ARCH_PERFMON_EVENTSEL_INT; 988 hwc->config = ARCH_PERFMON_EVENTSEL_INT;
934 989
990 hwc->idx = -1;
991
935 /* 992 /*
936 * Count user and OS events unless requested not to. 993 * Count user and OS events unless requested not to.
937 */ 994 */
@@ -1334,8 +1391,7 @@ static void amd_pmu_enable_event(struct hw_perf_event *hwc, int idx)
1334 x86_pmu_enable_event(hwc, idx); 1391 x86_pmu_enable_event(hwc, idx);
1335} 1392}
1336 1393
1337static int 1394static int fixed_mode_idx(struct hw_perf_event *hwc)
1338fixed_mode_idx(struct perf_event *event, struct hw_perf_event *hwc)
1339{ 1395{
1340 unsigned int hw_event; 1396 unsigned int hw_event;
1341 1397
@@ -1349,6 +1405,12 @@ fixed_mode_idx(struct perf_event *event, struct hw_perf_event *hwc)
1349 if (!x86_pmu.num_events_fixed) 1405 if (!x86_pmu.num_events_fixed)
1350 return -1; 1406 return -1;
1351 1407
1408 /*
1409 * fixed counters do not take all possible filters
1410 */
1411 if (hwc->config & ARCH_PERFMON_EVENT_FILTER_MASK)
1412 return -1;
1413
1352 if (unlikely(hw_event == x86_pmu.event_map(PERF_COUNT_HW_INSTRUCTIONS))) 1414 if (unlikely(hw_event == x86_pmu.event_map(PERF_COUNT_HW_INSTRUCTIONS)))
1353 return X86_PMC_IDX_FIXED_INSTRUCTIONS; 1415 return X86_PMC_IDX_FIXED_INSTRUCTIONS;
1354 if (unlikely(hw_event == x86_pmu.event_map(PERF_COUNT_HW_CPU_CYCLES))) 1416 if (unlikely(hw_event == x86_pmu.event_map(PERF_COUNT_HW_CPU_CYCLES)))
@@ -1360,22 +1422,57 @@ fixed_mode_idx(struct perf_event *event, struct hw_perf_event *hwc)
1360} 1422}
1361 1423
1362/* 1424/*
1363 * Find a PMC slot for the freshly enabled / scheduled in event: 1425 * generic counter allocator: get next free counter
1364 */ 1426 */
1365static int x86_pmu_enable(struct perf_event *event) 1427static int
1428gen_get_event_idx(struct cpu_hw_events *cpuc, struct hw_perf_event *hwc)
1429{
1430 int idx;
1431
1432 idx = find_first_zero_bit(cpuc->used_mask, x86_pmu.num_events);
1433 return idx == x86_pmu.num_events ? -1 : idx;
1434}
1435
1436/*
1437 * intel-specific counter allocator: check event constraints
1438 */
1439static int
1440intel_get_event_idx(struct cpu_hw_events *cpuc, struct hw_perf_event *hwc)
1441{
1442 const struct event_constraint *event_constraint;
1443 int i, code;
1444
1445 if (!event_constraints)
1446 goto skip;
1447
1448 code = hwc->config & CORE_EVNTSEL_EVENT_MASK;
1449
1450 for_each_event_constraint(event_constraint, event_constraints) {
1451 if (code == event_constraint->code) {
1452 for_each_bit(i, event_constraint->idxmsk, X86_PMC_IDX_MAX) {
1453 if (!test_and_set_bit(i, cpuc->used_mask))
1454 return i;
1455 }
1456 return -1;
1457 }
1458 }
1459skip:
1460 return gen_get_event_idx(cpuc, hwc);
1461}
1462
1463static int
1464x86_schedule_event(struct cpu_hw_events *cpuc, struct hw_perf_event *hwc)
1366{ 1465{
1367 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
1368 struct hw_perf_event *hwc = &event->hw;
1369 int idx; 1466 int idx;
1370 1467
1371 idx = fixed_mode_idx(event, hwc); 1468 idx = fixed_mode_idx(hwc);
1372 if (idx == X86_PMC_IDX_FIXED_BTS) { 1469 if (idx == X86_PMC_IDX_FIXED_BTS) {
1373 /* BTS is already occupied. */ 1470 /* BTS is already occupied. */
1374 if (test_and_set_bit(idx, cpuc->used_mask)) 1471 if (test_and_set_bit(idx, cpuc->used_mask))
1375 return -EAGAIN; 1472 return -EAGAIN;
1376 1473
1377 hwc->config_base = 0; 1474 hwc->config_base = 0;
1378 hwc->event_base = 0; 1475 hwc->event_base = 0;
1379 hwc->idx = idx; 1476 hwc->idx = idx;
1380 } else if (idx >= 0) { 1477 } else if (idx >= 0) {
1381 /* 1478 /*
@@ -1396,20 +1493,35 @@ static int x86_pmu_enable(struct perf_event *event)
1396 } else { 1493 } else {
1397 idx = hwc->idx; 1494 idx = hwc->idx;
1398 /* Try to get the previous generic event again */ 1495 /* Try to get the previous generic event again */
1399 if (test_and_set_bit(idx, cpuc->used_mask)) { 1496 if (idx == -1 || test_and_set_bit(idx, cpuc->used_mask)) {
1400try_generic: 1497try_generic:
1401 idx = find_first_zero_bit(cpuc->used_mask, 1498 idx = x86_pmu.get_event_idx(cpuc, hwc);
1402 x86_pmu.num_events); 1499 if (idx == -1)
1403 if (idx == x86_pmu.num_events)
1404 return -EAGAIN; 1500 return -EAGAIN;
1405 1501
1406 set_bit(idx, cpuc->used_mask); 1502 set_bit(idx, cpuc->used_mask);
1407 hwc->idx = idx; 1503 hwc->idx = idx;
1408 } 1504 }
1409 hwc->config_base = x86_pmu.eventsel; 1505 hwc->config_base = x86_pmu.eventsel;
1410 hwc->event_base = x86_pmu.perfctr; 1506 hwc->event_base = x86_pmu.perfctr;
1411 } 1507 }
1412 1508
1509 return idx;
1510}
1511
1512/*
1513 * Find a PMC slot for the freshly enabled / scheduled in event:
1514 */
1515static int x86_pmu_enable(struct perf_event *event)
1516{
1517 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
1518 struct hw_perf_event *hwc = &event->hw;
1519 int idx;
1520
1521 idx = x86_schedule_event(cpuc, hwc);
1522 if (idx < 0)
1523 return idx;
1524
1413 perf_events_lapic_init(); 1525 perf_events_lapic_init();
1414 1526
1415 x86_pmu.disable(hwc, idx); 1527 x86_pmu.disable(hwc, idx);
@@ -1852,7 +1964,7 @@ static __read_mostly struct notifier_block perf_event_nmi_notifier = {
1852 .priority = 1 1964 .priority = 1
1853}; 1965};
1854 1966
1855static struct x86_pmu p6_pmu = { 1967static __initconst struct x86_pmu p6_pmu = {
1856 .name = "p6", 1968 .name = "p6",
1857 .handle_irq = p6_pmu_handle_irq, 1969 .handle_irq = p6_pmu_handle_irq,
1858 .disable_all = p6_pmu_disable_all, 1970 .disable_all = p6_pmu_disable_all,
@@ -1877,9 +1989,10 @@ static struct x86_pmu p6_pmu = {
1877 */ 1989 */
1878 .event_bits = 32, 1990 .event_bits = 32,
1879 .event_mask = (1ULL << 32) - 1, 1991 .event_mask = (1ULL << 32) - 1,
1992 .get_event_idx = intel_get_event_idx,
1880}; 1993};
1881 1994
1882static struct x86_pmu intel_pmu = { 1995static __initconst struct x86_pmu intel_pmu = {
1883 .name = "Intel", 1996 .name = "Intel",
1884 .handle_irq = intel_pmu_handle_irq, 1997 .handle_irq = intel_pmu_handle_irq,
1885 .disable_all = intel_pmu_disable_all, 1998 .disable_all = intel_pmu_disable_all,
@@ -1900,9 +2013,10 @@ static struct x86_pmu intel_pmu = {
1900 .max_period = (1ULL << 31) - 1, 2013 .max_period = (1ULL << 31) - 1,
1901 .enable_bts = intel_pmu_enable_bts, 2014 .enable_bts = intel_pmu_enable_bts,
1902 .disable_bts = intel_pmu_disable_bts, 2015 .disable_bts = intel_pmu_disable_bts,
2016 .get_event_idx = intel_get_event_idx,
1903}; 2017};
1904 2018
1905static struct x86_pmu amd_pmu = { 2019static __initconst struct x86_pmu amd_pmu = {
1906 .name = "AMD", 2020 .name = "AMD",
1907 .handle_irq = amd_pmu_handle_irq, 2021 .handle_irq = amd_pmu_handle_irq,
1908 .disable_all = amd_pmu_disable_all, 2022 .disable_all = amd_pmu_disable_all,
@@ -1920,9 +2034,10 @@ static struct x86_pmu amd_pmu = {
1920 .apic = 1, 2034 .apic = 1,
1921 /* use highest bit to detect overflow */ 2035 /* use highest bit to detect overflow */
1922 .max_period = (1ULL << 47) - 1, 2036 .max_period = (1ULL << 47) - 1,
2037 .get_event_idx = gen_get_event_idx,
1923}; 2038};
1924 2039
1925static int p6_pmu_init(void) 2040static __init int p6_pmu_init(void)
1926{ 2041{
1927 switch (boot_cpu_data.x86_model) { 2042 switch (boot_cpu_data.x86_model) {
1928 case 1: 2043 case 1:
@@ -1932,10 +2047,12 @@ static int p6_pmu_init(void)
1932 case 7: 2047 case 7:
1933 case 8: 2048 case 8:
1934 case 11: /* Pentium III */ 2049 case 11: /* Pentium III */
2050 event_constraints = intel_p6_event_constraints;
1935 break; 2051 break;
1936 case 9: 2052 case 9:
1937 case 13: 2053 case 13:
1938 /* Pentium M */ 2054 /* Pentium M */
2055 event_constraints = intel_p6_event_constraints;
1939 break; 2056 break;
1940 default: 2057 default:
1941 pr_cont("unsupported p6 CPU model %d ", 2058 pr_cont("unsupported p6 CPU model %d ",
@@ -1954,7 +2071,7 @@ static int p6_pmu_init(void)
1954 return 0; 2071 return 0;
1955} 2072}
1956 2073
1957static int intel_pmu_init(void) 2074static __init int intel_pmu_init(void)
1958{ 2075{
1959 union cpuid10_edx edx; 2076 union cpuid10_edx edx;
1960 union cpuid10_eax eax; 2077 union cpuid10_eax eax;
@@ -2007,12 +2124,14 @@ static int intel_pmu_init(void)
2007 sizeof(hw_cache_event_ids)); 2124 sizeof(hw_cache_event_ids));
2008 2125
2009 pr_cont("Core2 events, "); 2126 pr_cont("Core2 events, ");
2127 event_constraints = intel_core_event_constraints;
2010 break; 2128 break;
2011 default: 2129 default:
2012 case 26: 2130 case 26:
2013 memcpy(hw_cache_event_ids, nehalem_hw_cache_event_ids, 2131 memcpy(hw_cache_event_ids, nehalem_hw_cache_event_ids,
2014 sizeof(hw_cache_event_ids)); 2132 sizeof(hw_cache_event_ids));
2015 2133
2134 event_constraints = intel_nehalem_event_constraints;
2016 pr_cont("Nehalem/Corei7 events, "); 2135 pr_cont("Nehalem/Corei7 events, ");
2017 break; 2136 break;
2018 case 28: 2137 case 28:
@@ -2025,7 +2144,7 @@ static int intel_pmu_init(void)
2025 return 0; 2144 return 0;
2026} 2145}
2027 2146
2028static int amd_pmu_init(void) 2147static __init int amd_pmu_init(void)
2029{ 2148{
2030 /* Performance-monitoring supported from K7 and later: */ 2149 /* Performance-monitoring supported from K7 and later: */
2031 if (boot_cpu_data.x86 < 6) 2150 if (boot_cpu_data.x86 < 6)
@@ -2105,11 +2224,47 @@ static const struct pmu pmu = {
2105 .unthrottle = x86_pmu_unthrottle, 2224 .unthrottle = x86_pmu_unthrottle,
2106}; 2225};
2107 2226
2227static int
2228validate_event(struct cpu_hw_events *cpuc, struct perf_event *event)
2229{
2230 struct hw_perf_event fake_event = event->hw;
2231
2232 if (event->pmu && event->pmu != &pmu)
2233 return 0;
2234
2235 return x86_schedule_event(cpuc, &fake_event) >= 0;
2236}
2237
2238static int validate_group(struct perf_event *event)
2239{
2240 struct perf_event *sibling, *leader = event->group_leader;
2241 struct cpu_hw_events fake_pmu;
2242
2243 memset(&fake_pmu, 0, sizeof(fake_pmu));
2244
2245 if (!validate_event(&fake_pmu, leader))
2246 return -ENOSPC;
2247
2248 list_for_each_entry(sibling, &leader->sibling_list, group_entry) {
2249 if (!validate_event(&fake_pmu, sibling))
2250 return -ENOSPC;
2251 }
2252
2253 if (!validate_event(&fake_pmu, event))
2254 return -ENOSPC;
2255
2256 return 0;
2257}
2258
2108const struct pmu *hw_perf_event_init(struct perf_event *event) 2259const struct pmu *hw_perf_event_init(struct perf_event *event)
2109{ 2260{
2110 int err; 2261 int err;
2111 2262
2112 err = __hw_perf_event_init(event); 2263 err = __hw_perf_event_init(event);
2264 if (!err) {
2265 if (event->group_leader != event)
2266 err = validate_group(event);
2267 }
2113 if (err) { 2268 if (err) {
2114 if (event->destroy) 2269 if (event->destroy)
2115 event->destroy(event); 2270 event->destroy(event);
diff --git a/arch/x86/kernel/cpu/perfctr-watchdog.c b/arch/x86/kernel/cpu/perfctr-watchdog.c
index fab786f60ed6..898df9719afb 100644
--- a/arch/x86/kernel/cpu/perfctr-watchdog.c
+++ b/arch/x86/kernel/cpu/perfctr-watchdog.c
@@ -712,7 +712,7 @@ static void probe_nmi_watchdog(void)
712 switch (boot_cpu_data.x86_vendor) { 712 switch (boot_cpu_data.x86_vendor) {
713 case X86_VENDOR_AMD: 713 case X86_VENDOR_AMD:
714 if (boot_cpu_data.x86 != 6 && boot_cpu_data.x86 != 15 && 714 if (boot_cpu_data.x86 != 6 && boot_cpu_data.x86 != 15 &&
715 boot_cpu_data.x86 != 16) 715 boot_cpu_data.x86 != 16 && boot_cpu_data.x86 != 17)
716 return; 716 return;
717 wd_ops = &k7_wd_ops; 717 wd_ops = &k7_wd_ops;
718 break; 718 break;
diff --git a/arch/x86/kernel/cpu/transmeta.c b/arch/x86/kernel/cpu/transmeta.c
index bb62b3e5caad..28000743bbb0 100644
--- a/arch/x86/kernel/cpu/transmeta.c
+++ b/arch/x86/kernel/cpu/transmeta.c
@@ -26,7 +26,7 @@ static void __cpuinit init_transmeta(struct cpuinfo_x86 *c)
26 26
27 early_init_transmeta(c); 27 early_init_transmeta(c);
28 28
29 display_cacheinfo(c); 29 cpu_detect_cache_sizes(c);
30 30
31 /* Print CMS and CPU revision */ 31 /* Print CMS and CPU revision */
32 max = cpuid_eax(0x80860000); 32 max = cpuid_eax(0x80860000);
diff --git a/arch/x86/kernel/cpuid.c b/arch/x86/kernel/cpuid.c
index 6a52d4b36a30..7ef24a796992 100644
--- a/arch/x86/kernel/cpuid.c
+++ b/arch/x86/kernel/cpuid.c
@@ -116,21 +116,16 @@ static int cpuid_open(struct inode *inode, struct file *file)
116{ 116{
117 unsigned int cpu; 117 unsigned int cpu;
118 struct cpuinfo_x86 *c; 118 struct cpuinfo_x86 *c;
119 int ret = 0;
120
121 lock_kernel();
122 119
123 cpu = iminor(file->f_path.dentry->d_inode); 120 cpu = iminor(file->f_path.dentry->d_inode);
124 if (cpu >= nr_cpu_ids || !cpu_online(cpu)) { 121 if (cpu >= nr_cpu_ids || !cpu_online(cpu))
125 ret = -ENXIO; /* No such CPU */ 122 return -ENXIO; /* No such CPU */
126 goto out; 123
127 }
128 c = &cpu_data(cpu); 124 c = &cpu_data(cpu);
129 if (c->cpuid_level < 0) 125 if (c->cpuid_level < 0)
130 ret = -EIO; /* CPUID not supported */ 126 return -EIO; /* CPUID not supported */
131out: 127
132 unlock_kernel(); 128 return 0;
133 return ret;
134} 129}
135 130
136/* 131/*
diff --git a/arch/x86/kernel/crash.c b/arch/x86/kernel/crash.c
index 5e409dc298a4..a4849c10a77e 100644
--- a/arch/x86/kernel/crash.c
+++ b/arch/x86/kernel/crash.c
@@ -27,8 +27,7 @@
27#include <asm/cpu.h> 27#include <asm/cpu.h>
28#include <asm/reboot.h> 28#include <asm/reboot.h>
29#include <asm/virtext.h> 29#include <asm/virtext.h>
30#include <asm/iommu.h> 30#include <asm/x86_init.h>
31
32 31
33#if defined(CONFIG_SMP) && defined(CONFIG_X86_LOCAL_APIC) 32#if defined(CONFIG_SMP) && defined(CONFIG_X86_LOCAL_APIC)
34 33
@@ -106,7 +105,7 @@ void native_machine_crash_shutdown(struct pt_regs *regs)
106#endif 105#endif
107 106
108#ifdef CONFIG_X86_64 107#ifdef CONFIG_X86_64
109 pci_iommu_shutdown(); 108 x86_platform.iommu_shutdown();
110#endif 109#endif
111 110
112 crash_save_cpu(regs, safe_smp_processor_id()); 111 crash_save_cpu(regs, safe_smp_processor_id());
diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c
index 2d8a371d4339..b8ce165dde5d 100644
--- a/arch/x86/kernel/dumpstack.c
+++ b/arch/x86/kernel/dumpstack.c
@@ -268,11 +268,12 @@ int __kprobes __die(const char *str, struct pt_regs *regs, long err)
268 268
269 show_registers(regs); 269 show_registers(regs);
270#ifdef CONFIG_X86_32 270#ifdef CONFIG_X86_32
271 sp = (unsigned long) (&regs->sp); 271 if (user_mode_vm(regs)) {
272 savesegment(ss, ss);
273 if (user_mode(regs)) {
274 sp = regs->sp; 272 sp = regs->sp;
275 ss = regs->ss & 0xffff; 273 ss = regs->ss & 0xffff;
274 } else {
275 sp = kernel_stack_pointer(regs);
276 savesegment(ss, ss);
276 } 277 }
277 printk(KERN_EMERG "EIP: [<%08lx>] ", regs->ip); 278 printk(KERN_EMERG "EIP: [<%08lx>] ", regs->ip);
278 print_symbol("%s", regs->ip); 279 print_symbol("%s", regs->ip);
diff --git a/arch/x86/kernel/dumpstack_32.c b/arch/x86/kernel/dumpstack_32.c
index f7dd2a7c3bf4..e0ed4c7abb62 100644
--- a/arch/x86/kernel/dumpstack_32.c
+++ b/arch/x86/kernel/dumpstack_32.c
@@ -10,9 +10,9 @@
10#include <linux/module.h> 10#include <linux/module.h>
11#include <linux/ptrace.h> 11#include <linux/ptrace.h>
12#include <linux/kexec.h> 12#include <linux/kexec.h>
13#include <linux/sysfs.h>
13#include <linux/bug.h> 14#include <linux/bug.h>
14#include <linux/nmi.h> 15#include <linux/nmi.h>
15#include <linux/sysfs.h>
16 16
17#include <asm/stacktrace.h> 17#include <asm/stacktrace.h>
18 18
@@ -35,6 +35,7 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs,
35 35
36 if (!stack) { 36 if (!stack) {
37 unsigned long dummy; 37 unsigned long dummy;
38
38 stack = &dummy; 39 stack = &dummy;
39 if (task && task != current) 40 if (task && task != current)
40 stack = (unsigned long *)task->thread.sp; 41 stack = (unsigned long *)task->thread.sp;
@@ -57,8 +58,7 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs,
57 58
58 context = (struct thread_info *) 59 context = (struct thread_info *)
59 ((unsigned long)stack & (~(THREAD_SIZE - 1))); 60 ((unsigned long)stack & (~(THREAD_SIZE - 1)));
60 bp = print_context_stack(context, stack, bp, ops, 61 bp = print_context_stack(context, stack, bp, ops, data, NULL, &graph);
61 data, NULL, &graph);
62 62
63 stack = (unsigned long *)context->previous_esp; 63 stack = (unsigned long *)context->previous_esp;
64 if (!stack) 64 if (!stack)
@@ -72,7 +72,7 @@ EXPORT_SYMBOL(dump_trace);
72 72
73void 73void
74show_stack_log_lvl(struct task_struct *task, struct pt_regs *regs, 74show_stack_log_lvl(struct task_struct *task, struct pt_regs *regs,
75 unsigned long *sp, unsigned long bp, char *log_lvl) 75 unsigned long *sp, unsigned long bp, char *log_lvl)
76{ 76{
77 unsigned long *stack; 77 unsigned long *stack;
78 int i; 78 int i;
@@ -156,4 +156,3 @@ int is_valid_bugaddr(unsigned long ip)
156 156
157 return ud2 == 0x0b0f; 157 return ud2 == 0x0b0f;
158} 158}
159
diff --git a/arch/x86/kernel/dumpstack_64.c b/arch/x86/kernel/dumpstack_64.c
index a071e6be177e..8e740934bd1f 100644
--- a/arch/x86/kernel/dumpstack_64.c
+++ b/arch/x86/kernel/dumpstack_64.c
@@ -10,26 +10,28 @@
10#include <linux/module.h> 10#include <linux/module.h>
11#include <linux/ptrace.h> 11#include <linux/ptrace.h>
12#include <linux/kexec.h> 12#include <linux/kexec.h>
13#include <linux/sysfs.h>
13#include <linux/bug.h> 14#include <linux/bug.h>
14#include <linux/nmi.h> 15#include <linux/nmi.h>
15#include <linux/sysfs.h>
16 16
17#include <asm/stacktrace.h> 17#include <asm/stacktrace.h>
18 18
19#include "dumpstack.h" 19#include "dumpstack.h"
20 20
21#define N_EXCEPTION_STACKS_END \
22 (N_EXCEPTION_STACKS + DEBUG_STKSZ/EXCEPTION_STKSZ - 2)
21 23
22static char x86_stack_ids[][8] = { 24static char x86_stack_ids[][8] = {
23 [DEBUG_STACK - 1] = "#DB", 25 [ DEBUG_STACK-1 ] = "#DB",
24 [NMI_STACK - 1] = "NMI", 26 [ NMI_STACK-1 ] = "NMI",
25 [DOUBLEFAULT_STACK - 1] = "#DF", 27 [ DOUBLEFAULT_STACK-1 ] = "#DF",
26 [STACKFAULT_STACK - 1] = "#SS", 28 [ STACKFAULT_STACK-1 ] = "#SS",
27 [MCE_STACK - 1] = "#MC", 29 [ MCE_STACK-1 ] = "#MC",
28#if DEBUG_STKSZ > EXCEPTION_STKSZ 30#if DEBUG_STKSZ > EXCEPTION_STKSZ
29 [N_EXCEPTION_STACKS ... 31 [ N_EXCEPTION_STACKS ...
30 N_EXCEPTION_STACKS + DEBUG_STKSZ / EXCEPTION_STKSZ - 2] = "#DB[?]" 32 N_EXCEPTION_STACKS_END ] = "#DB[?]"
31#endif 33#endif
32 }; 34};
33 35
34int x86_is_stack_id(int id, char *name) 36int x86_is_stack_id(int id, char *name)
35{ 37{
@@ -37,7 +39,7 @@ int x86_is_stack_id(int id, char *name)
37} 39}
38 40
39static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack, 41static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack,
40 unsigned *usedp, char **idp) 42 unsigned *usedp, char **idp)
41{ 43{
42 unsigned k; 44 unsigned k;
43 45
@@ -202,21 +204,24 @@ EXPORT_SYMBOL(dump_trace);
202 204
203void 205void
204show_stack_log_lvl(struct task_struct *task, struct pt_regs *regs, 206show_stack_log_lvl(struct task_struct *task, struct pt_regs *regs,
205 unsigned long *sp, unsigned long bp, char *log_lvl) 207 unsigned long *sp, unsigned long bp, char *log_lvl)
206{ 208{
209 unsigned long *irq_stack_end;
210 unsigned long *irq_stack;
207 unsigned long *stack; 211 unsigned long *stack;
212 int cpu;
208 int i; 213 int i;
209 const int cpu = smp_processor_id(); 214
210 unsigned long *irq_stack_end = 215 preempt_disable();
211 (unsigned long *)(per_cpu(irq_stack_ptr, cpu)); 216 cpu = smp_processor_id();
212 unsigned long *irq_stack = 217
213 (unsigned long *)(per_cpu(irq_stack_ptr, cpu) - IRQ_STACK_SIZE); 218 irq_stack_end = (unsigned long *)(per_cpu(irq_stack_ptr, cpu));
219 irq_stack = (unsigned long *)(per_cpu(irq_stack_ptr, cpu) - IRQ_STACK_SIZE);
214 220
215 /* 221 /*
216 * debugging aid: "show_stack(NULL, NULL);" prints the 222 * Debugging aid: "show_stack(NULL, NULL);" prints the
217 * back trace for this cpu. 223 * back trace for this cpu:
218 */ 224 */
219
220 if (sp == NULL) { 225 if (sp == NULL) {
221 if (task) 226 if (task)
222 sp = (unsigned long *)task->thread.sp; 227 sp = (unsigned long *)task->thread.sp;
@@ -240,6 +245,8 @@ show_stack_log_lvl(struct task_struct *task, struct pt_regs *regs,
240 printk(" %016lx", *stack++); 245 printk(" %016lx", *stack++);
241 touch_nmi_watchdog(); 246 touch_nmi_watchdog();
242 } 247 }
248 preempt_enable();
249
243 printk("\n"); 250 printk("\n");
244 show_trace_log_lvl(task, regs, sp, bp, log_lvl); 251 show_trace_log_lvl(task, regs, sp, bp, log_lvl);
245} 252}
@@ -303,4 +310,3 @@ int is_valid_bugaddr(unsigned long ip)
303 310
304 return ud2 == 0x0b0f; 311 return ud2 == 0x0b0f;
305} 312}
306
diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S
index c097e7d607c6..50b9c220e121 100644
--- a/arch/x86/kernel/entry_32.S
+++ b/arch/x86/kernel/entry_32.S
@@ -334,6 +334,10 @@ ENTRY(ret_from_fork)
334END(ret_from_fork) 334END(ret_from_fork)
335 335
336/* 336/*
337 * Interrupt exit functions should be protected against kprobes
338 */
339 .pushsection .kprobes.text, "ax"
340/*
337 * Return to user mode is not as complex as all this looks, 341 * Return to user mode is not as complex as all this looks,
338 * but we want the default path for a system call return to 342 * but we want the default path for a system call return to
339 * go as quickly as possible which is why some of this is 343 * go as quickly as possible which is why some of this is
@@ -383,6 +387,10 @@ need_resched:
383END(resume_kernel) 387END(resume_kernel)
384#endif 388#endif
385 CFI_ENDPROC 389 CFI_ENDPROC
390/*
391 * End of kprobes section
392 */
393 .popsection
386 394
387/* SYSENTER_RETURN points to after the "sysenter" instruction in 395/* SYSENTER_RETURN points to after the "sysenter" instruction in
388 the vsyscall page. See vsyscall-sysentry.S, which defines the symbol. */ 396 the vsyscall page. See vsyscall-sysentry.S, which defines the symbol. */
@@ -513,6 +521,10 @@ sysexit_audit:
513 PTGS_TO_GS_EX 521 PTGS_TO_GS_EX
514ENDPROC(ia32_sysenter_target) 522ENDPROC(ia32_sysenter_target)
515 523
524/*
525 * syscall stub including irq exit should be protected against kprobes
526 */
527 .pushsection .kprobes.text, "ax"
516 # system call handler stub 528 # system call handler stub
517ENTRY(system_call) 529ENTRY(system_call)
518 RING0_INT_FRAME # can't unwind into user space anyway 530 RING0_INT_FRAME # can't unwind into user space anyway
@@ -705,6 +717,10 @@ syscall_badsys:
705 jmp resume_userspace 717 jmp resume_userspace
706END(syscall_badsys) 718END(syscall_badsys)
707 CFI_ENDPROC 719 CFI_ENDPROC
720/*
721 * End of kprobes section
722 */
723 .popsection
708 724
709/* 725/*
710 * System calls that need a pt_regs pointer. 726 * System calls that need a pt_regs pointer.
@@ -814,6 +830,10 @@ common_interrupt:
814ENDPROC(common_interrupt) 830ENDPROC(common_interrupt)
815 CFI_ENDPROC 831 CFI_ENDPROC
816 832
833/*
834 * Irq entries should be protected against kprobes
835 */
836 .pushsection .kprobes.text, "ax"
817#define BUILD_INTERRUPT3(name, nr, fn) \ 837#define BUILD_INTERRUPT3(name, nr, fn) \
818ENTRY(name) \ 838ENTRY(name) \
819 RING0_INT_FRAME; \ 839 RING0_INT_FRAME; \
@@ -980,6 +1000,10 @@ ENTRY(spurious_interrupt_bug)
980 jmp error_code 1000 jmp error_code
981 CFI_ENDPROC 1001 CFI_ENDPROC
982END(spurious_interrupt_bug) 1002END(spurious_interrupt_bug)
1003/*
1004 * End of kprobes section
1005 */
1006 .popsection
983 1007
984ENTRY(kernel_thread_helper) 1008ENTRY(kernel_thread_helper)
985 pushl $0 # fake return address for unwinder 1009 pushl $0 # fake return address for unwinder
@@ -1185,17 +1209,14 @@ END(ftrace_graph_caller)
1185 1209
1186.globl return_to_handler 1210.globl return_to_handler
1187return_to_handler: 1211return_to_handler:
1188 pushl $0
1189 pushl %eax 1212 pushl %eax
1190 pushl %ecx
1191 pushl %edx 1213 pushl %edx
1192 movl %ebp, %eax 1214 movl %ebp, %eax
1193 call ftrace_return_to_handler 1215 call ftrace_return_to_handler
1194 movl %eax, 0xc(%esp) 1216 movl %eax, %ecx
1195 popl %edx 1217 popl %edx
1196 popl %ecx
1197 popl %eax 1218 popl %eax
1198 ret 1219 jmp *%ecx
1199#endif 1220#endif
1200 1221
1201.section .rodata,"a" 1222.section .rodata,"a"
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index b5c061f8f358..63bca794c8f9 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -155,11 +155,11 @@ GLOBAL(return_to_handler)
155 155
156 call ftrace_return_to_handler 156 call ftrace_return_to_handler
157 157
158 movq %rax, 16(%rsp) 158 movq %rax, %rdi
159 movq 8(%rsp), %rdx 159 movq 8(%rsp), %rdx
160 movq (%rsp), %rax 160 movq (%rsp), %rax
161 addq $16, %rsp 161 addq $24, %rsp
162 retq 162 jmp *%rdi
163#endif 163#endif
164 164
165 165
@@ -803,6 +803,10 @@ END(interrupt)
803 call \func 803 call \func
804 .endm 804 .endm
805 805
806/*
807 * Interrupt entry/exit should be protected against kprobes
808 */
809 .pushsection .kprobes.text, "ax"
806 /* 810 /*
807 * The interrupt stubs push (~vector+0x80) onto the stack and 811 * The interrupt stubs push (~vector+0x80) onto the stack and
808 * then jump to common_interrupt. 812 * then jump to common_interrupt.
@@ -941,6 +945,10 @@ ENTRY(retint_kernel)
941 945
942 CFI_ENDPROC 946 CFI_ENDPROC
943END(common_interrupt) 947END(common_interrupt)
948/*
949 * End of kprobes section
950 */
951 .popsection
944 952
945/* 953/*
946 * APIC interrupts. 954 * APIC interrupts.
@@ -969,8 +977,8 @@ apicinterrupt UV_BAU_MESSAGE \
969#endif 977#endif
970apicinterrupt LOCAL_TIMER_VECTOR \ 978apicinterrupt LOCAL_TIMER_VECTOR \
971 apic_timer_interrupt smp_apic_timer_interrupt 979 apic_timer_interrupt smp_apic_timer_interrupt
972apicinterrupt GENERIC_INTERRUPT_VECTOR \ 980apicinterrupt X86_PLATFORM_IPI_VECTOR \
973 generic_interrupt smp_generic_interrupt 981 x86_platform_ipi smp_x86_platform_ipi
974 982
975#ifdef CONFIG_SMP 983#ifdef CONFIG_SMP
976apicinterrupt INVALIDATE_TLB_VECTOR_START+0 \ 984apicinterrupt INVALIDATE_TLB_VECTOR_START+0 \
@@ -1491,12 +1499,17 @@ error_kernelspace:
1491 leaq irq_return(%rip),%rcx 1499 leaq irq_return(%rip),%rcx
1492 cmpq %rcx,RIP+8(%rsp) 1500 cmpq %rcx,RIP+8(%rsp)
1493 je error_swapgs 1501 je error_swapgs
1494 movl %ecx,%ecx /* zero extend */ 1502 movl %ecx,%eax /* zero extend */
1495 cmpq %rcx,RIP+8(%rsp) 1503 cmpq %rax,RIP+8(%rsp)
1496 je error_swapgs 1504 je bstep_iret
1497 cmpq $gs_change,RIP+8(%rsp) 1505 cmpq $gs_change,RIP+8(%rsp)
1498 je error_swapgs 1506 je error_swapgs
1499 jmp error_sti 1507 jmp error_sti
1508
1509bstep_iret:
1510 /* Fix truncated RIP */
1511 movq %rcx,RIP+8(%rsp)
1512 jmp error_swapgs
1500END(error_entry) 1513END(error_entry)
1501 1514
1502 1515
diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c
index 9dbb527e1652..309689245431 100644
--- a/arch/x86/kernel/ftrace.c
+++ b/arch/x86/kernel/ftrace.c
@@ -9,6 +9,8 @@
9 * the dangers of modifying code on the run. 9 * the dangers of modifying code on the run.
10 */ 10 */
11 11
12#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
13
12#include <linux/spinlock.h> 14#include <linux/spinlock.h>
13#include <linux/hardirq.h> 15#include <linux/hardirq.h>
14#include <linux/uaccess.h> 16#include <linux/uaccess.h>
@@ -187,9 +189,26 @@ static void wait_for_nmi(void)
187 nmi_wait_count++; 189 nmi_wait_count++;
188} 190}
189 191
192static inline int
193within(unsigned long addr, unsigned long start, unsigned long end)
194{
195 return addr >= start && addr < end;
196}
197
190static int 198static int
191do_ftrace_mod_code(unsigned long ip, void *new_code) 199do_ftrace_mod_code(unsigned long ip, void *new_code)
192{ 200{
201 /*
202 * On x86_64, kernel text mappings are mapped read-only with
203 * CONFIG_DEBUG_RODATA. So we use the kernel identity mapping instead
204 * of the kernel text mapping to modify the kernel text.
205 *
206 * For 32bit kernels, these mappings are same and we can use
207 * kernel identity mapping to modify code.
208 */
209 if (within(ip, (unsigned long)_text, (unsigned long)_etext))
210 ip = (unsigned long)__va(__pa(ip));
211
193 mod_code_ip = (void *)ip; 212 mod_code_ip = (void *)ip;
194 mod_code_newcode = new_code; 213 mod_code_newcode = new_code;
195 214
@@ -336,15 +355,15 @@ int __init ftrace_dyn_arch_init(void *data)
336 355
337 switch (faulted) { 356 switch (faulted) {
338 case 0: 357 case 0:
339 pr_info("ftrace: converting mcount calls to 0f 1f 44 00 00\n"); 358 pr_info("converting mcount calls to 0f 1f 44 00 00\n");
340 memcpy(ftrace_nop, ftrace_test_p6nop, MCOUNT_INSN_SIZE); 359 memcpy(ftrace_nop, ftrace_test_p6nop, MCOUNT_INSN_SIZE);
341 break; 360 break;
342 case 1: 361 case 1:
343 pr_info("ftrace: converting mcount calls to 66 66 66 66 90\n"); 362 pr_info("converting mcount calls to 66 66 66 66 90\n");
344 memcpy(ftrace_nop, ftrace_test_nop5, MCOUNT_INSN_SIZE); 363 memcpy(ftrace_nop, ftrace_test_nop5, MCOUNT_INSN_SIZE);
345 break; 364 break;
346 case 2: 365 case 2:
347 pr_info("ftrace: converting mcount calls to jmp . + 5\n"); 366 pr_info("converting mcount calls to jmp . + 5\n");
348 memcpy(ftrace_nop, ftrace_test_jmp, MCOUNT_INSN_SIZE); 367 memcpy(ftrace_nop, ftrace_test_jmp, MCOUNT_INSN_SIZE);
349 break; 368 break;
350 } 369 }
@@ -468,82 +487,10 @@ void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr,
468 487
469#ifdef CONFIG_FTRACE_SYSCALLS 488#ifdef CONFIG_FTRACE_SYSCALLS
470 489
471extern unsigned long __start_syscalls_metadata[];
472extern unsigned long __stop_syscalls_metadata[];
473extern unsigned long *sys_call_table; 490extern unsigned long *sys_call_table;
474 491
475static struct syscall_metadata **syscalls_metadata; 492unsigned long __init arch_syscall_addr(int nr)
476
477static struct syscall_metadata *find_syscall_meta(unsigned long *syscall)
478{
479 struct syscall_metadata *start;
480 struct syscall_metadata *stop;
481 char str[KSYM_SYMBOL_LEN];
482
483
484 start = (struct syscall_metadata *)__start_syscalls_metadata;
485 stop = (struct syscall_metadata *)__stop_syscalls_metadata;
486 kallsyms_lookup((unsigned long) syscall, NULL, NULL, NULL, str);
487
488 for ( ; start < stop; start++) {
489 if (start->name && !strcmp(start->name, str))
490 return start;
491 }
492 return NULL;
493}
494
495struct syscall_metadata *syscall_nr_to_meta(int nr)
496{
497 if (!syscalls_metadata || nr >= NR_syscalls || nr < 0)
498 return NULL;
499
500 return syscalls_metadata[nr];
501}
502
503int syscall_name_to_nr(char *name)
504{
505 int i;
506
507 if (!syscalls_metadata)
508 return -1;
509
510 for (i = 0; i < NR_syscalls; i++) {
511 if (syscalls_metadata[i]) {
512 if (!strcmp(syscalls_metadata[i]->name, name))
513 return i;
514 }
515 }
516 return -1;
517}
518
519void set_syscall_enter_id(int num, int id)
520{
521 syscalls_metadata[num]->enter_id = id;
522}
523
524void set_syscall_exit_id(int num, int id)
525{ 493{
526 syscalls_metadata[num]->exit_id = id; 494 return (unsigned long)(&sys_call_table)[nr];
527}
528
529static int __init arch_init_ftrace_syscalls(void)
530{
531 int i;
532 struct syscall_metadata *meta;
533 unsigned long **psys_syscall_table = &sys_call_table;
534
535 syscalls_metadata = kzalloc(sizeof(*syscalls_metadata) *
536 NR_syscalls, GFP_KERNEL);
537 if (!syscalls_metadata) {
538 WARN_ON(1);
539 return -ENOMEM;
540 }
541
542 for (i = 0; i < NR_syscalls; i++) {
543 meta = find_syscall_meta(psys_syscall_table[i]);
544 syscalls_metadata[i] = meta;
545 }
546 return 0;
547} 495}
548arch_initcall(arch_init_ftrace_syscalls);
549#endif 496#endif
diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S
index 050c278481b1..7fd318bac59c 100644
--- a/arch/x86/kernel/head_32.S
+++ b/arch/x86/kernel/head_32.S
@@ -18,6 +18,8 @@
18#include <asm/asm-offsets.h> 18#include <asm/asm-offsets.h>
19#include <asm/setup.h> 19#include <asm/setup.h>
20#include <asm/processor-flags.h> 20#include <asm/processor-flags.h>
21#include <asm/msr-index.h>
22#include <asm/cpufeature.h>
21#include <asm/percpu.h> 23#include <asm/percpu.h>
22 24
23/* Physical address */ 25/* Physical address */
@@ -297,25 +299,27 @@ ENTRY(startup_32_smp)
297 orl %edx,%eax 299 orl %edx,%eax
298 movl %eax,%cr4 300 movl %eax,%cr4
299 301
300 btl $5, %eax # check if PAE is enabled 302 testb $X86_CR4_PAE, %al # check if PAE is enabled
301 jnc 6f 303 jz 6f
302 304
303 /* Check if extended functions are implemented */ 305 /* Check if extended functions are implemented */
304 movl $0x80000000, %eax 306 movl $0x80000000, %eax
305 cpuid 307 cpuid
306 cmpl $0x80000000, %eax 308 /* Value must be in the range 0x80000001 to 0x8000ffff */
307 jbe 6f 309 subl $0x80000001, %eax
310 cmpl $(0x8000ffff-0x80000001), %eax
311 ja 6f
308 mov $0x80000001, %eax 312 mov $0x80000001, %eax
309 cpuid 313 cpuid
310 /* Execute Disable bit supported? */ 314 /* Execute Disable bit supported? */
311 btl $20, %edx 315 btl $(X86_FEATURE_NX & 31), %edx
312 jnc 6f 316 jnc 6f
313 317
314 /* Setup EFER (Extended Feature Enable Register) */ 318 /* Setup EFER (Extended Feature Enable Register) */
315 movl $0xc0000080, %ecx 319 movl $MSR_EFER, %ecx
316 rdmsr 320 rdmsr
317 321
318 btsl $11, %eax 322 btsl $_EFER_NX, %eax
319 /* Make changes effective */ 323 /* Make changes effective */
320 wrmsr 324 wrmsr
321 325
diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S
index 780cd928fcd5..2d8b5035371c 100644
--- a/arch/x86/kernel/head_64.S
+++ b/arch/x86/kernel/head_64.S
@@ -212,8 +212,8 @@ ENTRY(secondary_startup_64)
212 */ 212 */
213 lgdt early_gdt_descr(%rip) 213 lgdt early_gdt_descr(%rip)
214 214
215 /* set up data segments. actually 0 would do too */ 215 /* set up data segments */
216 movl $__KERNEL_DS,%eax 216 xorl %eax,%eax
217 movl %eax,%ds 217 movl %eax,%ds
218 movl %eax,%ss 218 movl %eax,%ss
219 movl %eax,%es 219 movl %eax,%es
@@ -262,11 +262,11 @@ ENTRY(secondary_startup_64)
262 .quad x86_64_start_kernel 262 .quad x86_64_start_kernel
263 ENTRY(initial_gs) 263 ENTRY(initial_gs)
264 .quad INIT_PER_CPU_VAR(irq_stack_union) 264 .quad INIT_PER_CPU_VAR(irq_stack_union)
265 __FINITDATA
266 265
267 ENTRY(stack_start) 266 ENTRY(stack_start)
268 .quad init_thread_union+THREAD_SIZE-8 267 .quad init_thread_union+THREAD_SIZE-8
269 .word 0 268 .word 0
269 __FINITDATA
270 270
271bad_address: 271bad_address:
272 jmp bad_address 272 jmp bad_address
@@ -340,6 +340,7 @@ ENTRY(name)
340 i = i + 1 ; \ 340 i = i + 1 ; \
341 .endr 341 .endr
342 342
343 .data
343 /* 344 /*
344 * This default setting generates an ident mapping at address 0x100000 345 * This default setting generates an ident mapping at address 0x100000
345 * and a mapping for the kernel that precisely maps virtual address 346 * and a mapping for the kernel that precisely maps virtual address
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
index dedc2bddf7a5..ba6e65884603 100644
--- a/arch/x86/kernel/hpet.c
+++ b/arch/x86/kernel/hpet.c
@@ -33,6 +33,7 @@
33 * HPET address is set in acpi/boot.c, when an ACPI entry exists 33 * HPET address is set in acpi/boot.c, when an ACPI entry exists
34 */ 34 */
35unsigned long hpet_address; 35unsigned long hpet_address;
36u8 hpet_blockid; /* OS timer block num */
36#ifdef CONFIG_PCI_MSI 37#ifdef CONFIG_PCI_MSI
37static unsigned long hpet_num_timers; 38static unsigned long hpet_num_timers;
38#endif 39#endif
@@ -47,12 +48,12 @@ struct hpet_dev {
47 char name[10]; 48 char name[10];
48}; 49};
49 50
50unsigned long hpet_readl(unsigned long a) 51inline unsigned int hpet_readl(unsigned int a)
51{ 52{
52 return readl(hpet_virt_address + a); 53 return readl(hpet_virt_address + a);
53} 54}
54 55
55static inline void hpet_writel(unsigned long d, unsigned long a) 56static inline void hpet_writel(unsigned int d, unsigned int a)
56{ 57{
57 writel(d, hpet_virt_address + a); 58 writel(d, hpet_virt_address + a);
58} 59}
@@ -167,7 +168,7 @@ do { \
167 168
168static void hpet_reserve_msi_timers(struct hpet_data *hd); 169static void hpet_reserve_msi_timers(struct hpet_data *hd);
169 170
170static void hpet_reserve_platform_timers(unsigned long id) 171static void hpet_reserve_platform_timers(unsigned int id)
171{ 172{
172 struct hpet __iomem *hpet = hpet_virt_address; 173 struct hpet __iomem *hpet = hpet_virt_address;
173 struct hpet_timer __iomem *timer = &hpet->hpet_timers[2]; 174 struct hpet_timer __iomem *timer = &hpet->hpet_timers[2];
@@ -205,7 +206,7 @@ static void hpet_reserve_platform_timers(unsigned long id)
205 206
206} 207}
207#else 208#else
208static void hpet_reserve_platform_timers(unsigned long id) { } 209static void hpet_reserve_platform_timers(unsigned int id) { }
209#endif 210#endif
210 211
211/* 212/*
@@ -246,7 +247,7 @@ static void hpet_reset_counter(void)
246 247
247static void hpet_start_counter(void) 248static void hpet_start_counter(void)
248{ 249{
249 unsigned long cfg = hpet_readl(HPET_CFG); 250 unsigned int cfg = hpet_readl(HPET_CFG);
250 cfg |= HPET_CFG_ENABLE; 251 cfg |= HPET_CFG_ENABLE;
251 hpet_writel(cfg, HPET_CFG); 252 hpet_writel(cfg, HPET_CFG);
252} 253}
@@ -271,7 +272,7 @@ static void hpet_resume_counter(void)
271 272
272static void hpet_enable_legacy_int(void) 273static void hpet_enable_legacy_int(void)
273{ 274{
274 unsigned long cfg = hpet_readl(HPET_CFG); 275 unsigned int cfg = hpet_readl(HPET_CFG);
275 276
276 cfg |= HPET_CFG_LEGACY; 277 cfg |= HPET_CFG_LEGACY;
277 hpet_writel(cfg, HPET_CFG); 278 hpet_writel(cfg, HPET_CFG);
@@ -314,7 +315,7 @@ static int hpet_setup_msi_irq(unsigned int irq);
314static void hpet_set_mode(enum clock_event_mode mode, 315static void hpet_set_mode(enum clock_event_mode mode,
315 struct clock_event_device *evt, int timer) 316 struct clock_event_device *evt, int timer)
316{ 317{
317 unsigned long cfg, cmp, now; 318 unsigned int cfg, cmp, now;
318 uint64_t delta; 319 uint64_t delta;
319 320
320 switch (mode) { 321 switch (mode) {
@@ -323,7 +324,7 @@ static void hpet_set_mode(enum clock_event_mode mode,
323 delta = ((uint64_t)(NSEC_PER_SEC/HZ)) * evt->mult; 324 delta = ((uint64_t)(NSEC_PER_SEC/HZ)) * evt->mult;
324 delta >>= evt->shift; 325 delta >>= evt->shift;
325 now = hpet_readl(HPET_COUNTER); 326 now = hpet_readl(HPET_COUNTER);
326 cmp = now + (unsigned long) delta; 327 cmp = now + (unsigned int) delta;
327 cfg = hpet_readl(HPET_Tn_CFG(timer)); 328 cfg = hpet_readl(HPET_Tn_CFG(timer));
328 /* Make sure we use edge triggered interrupts */ 329 /* Make sure we use edge triggered interrupts */
329 cfg &= ~HPET_TN_LEVEL; 330 cfg &= ~HPET_TN_LEVEL;
@@ -339,7 +340,7 @@ static void hpet_set_mode(enum clock_event_mode mode,
339 * (See AMD-8111 HyperTransport I/O Hub Data Sheet, 340 * (See AMD-8111 HyperTransport I/O Hub Data Sheet,
340 * Publication # 24674) 341 * Publication # 24674)
341 */ 342 */
342 hpet_writel((unsigned long) delta, HPET_Tn_CMP(timer)); 343 hpet_writel((unsigned int) delta, HPET_Tn_CMP(timer));
343 hpet_start_counter(); 344 hpet_start_counter();
344 hpet_print_config(); 345 hpet_print_config();
345 break; 346 break;
@@ -383,13 +384,24 @@ static int hpet_next_event(unsigned long delta,
383 hpet_writel(cnt, HPET_Tn_CMP(timer)); 384 hpet_writel(cnt, HPET_Tn_CMP(timer));
384 385
385 /* 386 /*
386 * We need to read back the CMP register to make sure that 387 * We need to read back the CMP register on certain HPET
387 * what we wrote hit the chip before we compare it to the 388 * implementations (ATI chipsets) which seem to delay the
388 * counter. 389 * transfer of the compare register into the internal compare
390 * logic. With small deltas this might actually be too late as
391 * the counter could already be higher than the compare value
392 * at that point and we would wait for the next hpet interrupt
393 * forever. We found out that reading the CMP register back
394 * forces the transfer so we can rely on the comparison with
395 * the counter register below. If the read back from the
396 * compare register does not match the value we programmed
397 * then we might have a real hardware problem. We can not do
398 * much about it here, but at least alert the user/admin with
399 * a prominent warning.
389 */ 400 */
390 WARN_ON_ONCE((u32)hpet_readl(HPET_Tn_CMP(timer)) != cnt); 401 WARN_ONCE(hpet_readl(HPET_Tn_CMP(timer)) != cnt,
402 KERN_WARNING "hpet: compare register read back failed.\n");
391 403
392 return (s32)((u32)hpet_readl(HPET_COUNTER) - cnt) >= 0 ? -ETIME : 0; 404 return (s32)(hpet_readl(HPET_COUNTER) - cnt) >= 0 ? -ETIME : 0;
393} 405}
394 406
395static void hpet_legacy_set_mode(enum clock_event_mode mode, 407static void hpet_legacy_set_mode(enum clock_event_mode mode,
@@ -415,7 +427,7 @@ static struct hpet_dev *hpet_devs;
415void hpet_msi_unmask(unsigned int irq) 427void hpet_msi_unmask(unsigned int irq)
416{ 428{
417 struct hpet_dev *hdev = get_irq_data(irq); 429 struct hpet_dev *hdev = get_irq_data(irq);
418 unsigned long cfg; 430 unsigned int cfg;
419 431
420 /* unmask it */ 432 /* unmask it */
421 cfg = hpet_readl(HPET_Tn_CFG(hdev->num)); 433 cfg = hpet_readl(HPET_Tn_CFG(hdev->num));
@@ -425,7 +437,7 @@ void hpet_msi_unmask(unsigned int irq)
425 437
426void hpet_msi_mask(unsigned int irq) 438void hpet_msi_mask(unsigned int irq)
427{ 439{
428 unsigned long cfg; 440 unsigned int cfg;
429 struct hpet_dev *hdev = get_irq_data(irq); 441 struct hpet_dev *hdev = get_irq_data(irq);
430 442
431 /* mask it */ 443 /* mask it */
@@ -467,7 +479,7 @@ static int hpet_msi_next_event(unsigned long delta,
467 479
468static int hpet_setup_msi_irq(unsigned int irq) 480static int hpet_setup_msi_irq(unsigned int irq)
469{ 481{
470 if (arch_setup_hpet_msi(irq)) { 482 if (arch_setup_hpet_msi(irq, hpet_blockid)) {
471 destroy_irq(irq); 483 destroy_irq(irq);
472 return -EINVAL; 484 return -EINVAL;
473 } 485 }
@@ -584,6 +596,8 @@ static void hpet_msi_capability_lookup(unsigned int start_timer)
584 unsigned int num_timers_used = 0; 596 unsigned int num_timers_used = 0;
585 int i; 597 int i;
586 598
599 if (boot_cpu_has(X86_FEATURE_ARAT))
600 return;
587 id = hpet_readl(HPET_ID); 601 id = hpet_readl(HPET_ID);
588 602
589 num_timers = ((id & HPET_ID_NUMBER) >> HPET_ID_NUMBER_SHIFT); 603 num_timers = ((id & HPET_ID_NUMBER) >> HPET_ID_NUMBER_SHIFT);
@@ -598,7 +612,7 @@ static void hpet_msi_capability_lookup(unsigned int start_timer)
598 612
599 for (i = start_timer; i < num_timers - RESERVE_TIMERS; i++) { 613 for (i = start_timer; i < num_timers - RESERVE_TIMERS; i++) {
600 struct hpet_dev *hdev = &hpet_devs[num_timers_used]; 614 struct hpet_dev *hdev = &hpet_devs[num_timers_used];
601 unsigned long cfg = hpet_readl(HPET_Tn_CFG(i)); 615 unsigned int cfg = hpet_readl(HPET_Tn_CFG(i));
602 616
603 /* Only consider HPET timer with MSI support */ 617 /* Only consider HPET timer with MSI support */
604 if (!(cfg & HPET_TN_FSB_CAP)) 618 if (!(cfg & HPET_TN_FSB_CAP))
@@ -813,7 +827,7 @@ static int hpet_clocksource_register(void)
813 */ 827 */
814int __init hpet_enable(void) 828int __init hpet_enable(void)
815{ 829{
816 unsigned long id; 830 unsigned int id;
817 int i; 831 int i;
818 832
819 if (!is_hpet_capable()) 833 if (!is_hpet_capable())
@@ -872,10 +886,8 @@ int __init hpet_enable(void)
872 886
873 if (id & HPET_ID_LEGSUP) { 887 if (id & HPET_ID_LEGSUP) {
874 hpet_legacy_clockevent_register(); 888 hpet_legacy_clockevent_register();
875 hpet_msi_capability_lookup(2);
876 return 1; 889 return 1;
877 } 890 }
878 hpet_msi_capability_lookup(0);
879 return 0; 891 return 0;
880 892
881out_nohpet: 893out_nohpet:
@@ -908,9 +920,17 @@ static __init int hpet_late_init(void)
908 if (!hpet_virt_address) 920 if (!hpet_virt_address)
909 return -ENODEV; 921 return -ENODEV;
910 922
923 if (hpet_readl(HPET_ID) & HPET_ID_LEGSUP)
924 hpet_msi_capability_lookup(2);
925 else
926 hpet_msi_capability_lookup(0);
927
911 hpet_reserve_platform_timers(hpet_readl(HPET_ID)); 928 hpet_reserve_platform_timers(hpet_readl(HPET_ID));
912 hpet_print_config(); 929 hpet_print_config();
913 930
931 if (boot_cpu_has(X86_FEATURE_ARAT))
932 return 0;
933
914 for_each_online_cpu(cpu) { 934 for_each_online_cpu(cpu) {
915 hpet_cpuhp_notify(NULL, CPU_ONLINE, (void *)(long)cpu); 935 hpet_cpuhp_notify(NULL, CPU_ONLINE, (void *)(long)cpu);
916 } 936 }
@@ -925,7 +945,7 @@ fs_initcall(hpet_late_init);
925void hpet_disable(void) 945void hpet_disable(void)
926{ 946{
927 if (is_hpet_capable()) { 947 if (is_hpet_capable()) {
928 unsigned long cfg = hpet_readl(HPET_CFG); 948 unsigned int cfg = hpet_readl(HPET_CFG);
929 949
930 if (hpet_legacy_int_enabled) { 950 if (hpet_legacy_int_enabled) {
931 cfg &= ~HPET_CFG_LEGACY; 951 cfg &= ~HPET_CFG_LEGACY;
@@ -965,8 +985,8 @@ static int hpet_prev_update_sec;
965static struct rtc_time hpet_alarm_time; 985static struct rtc_time hpet_alarm_time;
966static unsigned long hpet_pie_count; 986static unsigned long hpet_pie_count;
967static u32 hpet_t1_cmp; 987static u32 hpet_t1_cmp;
968static unsigned long hpet_default_delta; 988static u32 hpet_default_delta;
969static unsigned long hpet_pie_delta; 989static u32 hpet_pie_delta;
970static unsigned long hpet_pie_limit; 990static unsigned long hpet_pie_limit;
971 991
972static rtc_irq_handler irq_handler; 992static rtc_irq_handler irq_handler;
@@ -1017,7 +1037,8 @@ EXPORT_SYMBOL_GPL(hpet_unregister_irq_handler);
1017 */ 1037 */
1018int hpet_rtc_timer_init(void) 1038int hpet_rtc_timer_init(void)
1019{ 1039{
1020 unsigned long cfg, cnt, delta, flags; 1040 unsigned int cfg, cnt, delta;
1041 unsigned long flags;
1021 1042
1022 if (!is_hpet_enabled()) 1043 if (!is_hpet_enabled())
1023 return 0; 1044 return 0;
@@ -1027,7 +1048,7 @@ int hpet_rtc_timer_init(void)
1027 1048
1028 clc = (uint64_t) hpet_clockevent.mult * NSEC_PER_SEC; 1049 clc = (uint64_t) hpet_clockevent.mult * NSEC_PER_SEC;
1029 clc >>= hpet_clockevent.shift + DEFAULT_RTC_SHIFT; 1050 clc >>= hpet_clockevent.shift + DEFAULT_RTC_SHIFT;
1030 hpet_default_delta = (unsigned long) clc; 1051 hpet_default_delta = clc;
1031 } 1052 }
1032 1053
1033 if (!(hpet_rtc_flags & RTC_PIE) || hpet_pie_limit) 1054 if (!(hpet_rtc_flags & RTC_PIE) || hpet_pie_limit)
@@ -1113,7 +1134,7 @@ int hpet_set_periodic_freq(unsigned long freq)
1113 clc = (uint64_t) hpet_clockevent.mult * NSEC_PER_SEC; 1134 clc = (uint64_t) hpet_clockevent.mult * NSEC_PER_SEC;
1114 do_div(clc, freq); 1135 do_div(clc, freq);
1115 clc >>= hpet_clockevent.shift; 1136 clc >>= hpet_clockevent.shift;
1116 hpet_pie_delta = (unsigned long) clc; 1137 hpet_pie_delta = clc;
1117 } 1138 }
1118 return 1; 1139 return 1;
1119} 1140}
@@ -1127,7 +1148,7 @@ EXPORT_SYMBOL_GPL(hpet_rtc_dropped_irq);
1127 1148
1128static void hpet_rtc_timer_reinit(void) 1149static void hpet_rtc_timer_reinit(void)
1129{ 1150{
1130 unsigned long cfg, delta; 1151 unsigned int cfg, delta;
1131 int lost_ints = -1; 1152 int lost_ints = -1;
1132 1153
1133 if (unlikely(!hpet_rtc_flags)) { 1154 if (unlikely(!hpet_rtc_flags)) {
diff --git a/arch/x86/kernel/hw_breakpoint.c b/arch/x86/kernel/hw_breakpoint.c
new file mode 100644
index 000000000000..d42f65ac4927
--- /dev/null
+++ b/arch/x86/kernel/hw_breakpoint.c
@@ -0,0 +1,555 @@
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
15 *
16 * Copyright (C) 2007 Alan Stern
17 * Copyright (C) 2009 IBM Corporation
18 * Copyright (C) 2009 Frederic Weisbecker <fweisbec@gmail.com>
19 *
20 * Authors: Alan Stern <stern@rowland.harvard.edu>
21 * K.Prasad <prasad@linux.vnet.ibm.com>
22 * Frederic Weisbecker <fweisbec@gmail.com>
23 */
24
25/*
26 * HW_breakpoint: a unified kernel/user-space hardware breakpoint facility,
27 * using the CPU's debug registers.
28 */
29
30#include <linux/perf_event.h>
31#include <linux/hw_breakpoint.h>
32#include <linux/irqflags.h>
33#include <linux/notifier.h>
34#include <linux/kallsyms.h>
35#include <linux/kprobes.h>
36#include <linux/percpu.h>
37#include <linux/kdebug.h>
38#include <linux/kernel.h>
39#include <linux/module.h>
40#include <linux/sched.h>
41#include <linux/init.h>
42#include <linux/smp.h>
43
44#include <asm/hw_breakpoint.h>
45#include <asm/processor.h>
46#include <asm/debugreg.h>
47
48/* Per cpu debug control register value */
49DEFINE_PER_CPU(unsigned long, cpu_dr7);
50EXPORT_PER_CPU_SYMBOL(cpu_dr7);
51
52/* Per cpu debug address registers values */
53static DEFINE_PER_CPU(unsigned long, cpu_debugreg[HBP_NUM]);
54
55/*
56 * Stores the breakpoints currently in use on each breakpoint address
57 * register for each cpus
58 */
59static DEFINE_PER_CPU(struct perf_event *, bp_per_reg[HBP_NUM]);
60
61
62static inline unsigned long
63__encode_dr7(int drnum, unsigned int len, unsigned int type)
64{
65 unsigned long bp_info;
66
67 bp_info = (len | type) & 0xf;
68 bp_info <<= (DR_CONTROL_SHIFT + drnum * DR_CONTROL_SIZE);
69 bp_info |= (DR_GLOBAL_ENABLE << (drnum * DR_ENABLE_SIZE));
70
71 return bp_info;
72}
73
74/*
75 * Encode the length, type, Exact, and Enable bits for a particular breakpoint
76 * as stored in debug register 7.
77 */
78unsigned long encode_dr7(int drnum, unsigned int len, unsigned int type)
79{
80 return __encode_dr7(drnum, len, type) | DR_GLOBAL_SLOWDOWN;
81}
82
83/*
84 * Decode the length and type bits for a particular breakpoint as
85 * stored in debug register 7. Return the "enabled" status.
86 */
87int decode_dr7(unsigned long dr7, int bpnum, unsigned *len, unsigned *type)
88{
89 int bp_info = dr7 >> (DR_CONTROL_SHIFT + bpnum * DR_CONTROL_SIZE);
90
91 *len = (bp_info & 0xc) | 0x40;
92 *type = (bp_info & 0x3) | 0x80;
93
94 return (dr7 >> (bpnum * DR_ENABLE_SIZE)) & 0x3;
95}
96
97/*
98 * Install a perf counter breakpoint.
99 *
100 * We seek a free debug address register and use it for this
101 * breakpoint. Eventually we enable it in the debug control register.
102 *
103 * Atomic: we hold the counter->ctx->lock and we only handle variables
104 * and registers local to this cpu.
105 */
106int arch_install_hw_breakpoint(struct perf_event *bp)
107{
108 struct arch_hw_breakpoint *info = counter_arch_bp(bp);
109 unsigned long *dr7;
110 int i;
111
112 for (i = 0; i < HBP_NUM; i++) {
113 struct perf_event **slot = &__get_cpu_var(bp_per_reg[i]);
114
115 if (!*slot) {
116 *slot = bp;
117 break;
118 }
119 }
120
121 if (WARN_ONCE(i == HBP_NUM, "Can't find any breakpoint slot"))
122 return -EBUSY;
123
124 set_debugreg(info->address, i);
125 __get_cpu_var(cpu_debugreg[i]) = info->address;
126
127 dr7 = &__get_cpu_var(cpu_dr7);
128 *dr7 |= encode_dr7(i, info->len, info->type);
129
130 set_debugreg(*dr7, 7);
131
132 return 0;
133}
134
135/*
136 * Uninstall the breakpoint contained in the given counter.
137 *
138 * First we search the debug address register it uses and then we disable
139 * it.
140 *
141 * Atomic: we hold the counter->ctx->lock and we only handle variables
142 * and registers local to this cpu.
143 */
144void arch_uninstall_hw_breakpoint(struct perf_event *bp)
145{
146 struct arch_hw_breakpoint *info = counter_arch_bp(bp);
147 unsigned long *dr7;
148 int i;
149
150 for (i = 0; i < HBP_NUM; i++) {
151 struct perf_event **slot = &__get_cpu_var(bp_per_reg[i]);
152
153 if (*slot == bp) {
154 *slot = NULL;
155 break;
156 }
157 }
158
159 if (WARN_ONCE(i == HBP_NUM, "Can't find any breakpoint slot"))
160 return;
161
162 dr7 = &__get_cpu_var(cpu_dr7);
163 *dr7 &= ~__encode_dr7(i, info->len, info->type);
164
165 set_debugreg(*dr7, 7);
166}
167
168static int get_hbp_len(u8 hbp_len)
169{
170 unsigned int len_in_bytes = 0;
171
172 switch (hbp_len) {
173 case X86_BREAKPOINT_LEN_1:
174 len_in_bytes = 1;
175 break;
176 case X86_BREAKPOINT_LEN_2:
177 len_in_bytes = 2;
178 break;
179 case X86_BREAKPOINT_LEN_4:
180 len_in_bytes = 4;
181 break;
182#ifdef CONFIG_X86_64
183 case X86_BREAKPOINT_LEN_8:
184 len_in_bytes = 8;
185 break;
186#endif
187 }
188 return len_in_bytes;
189}
190
191/*
192 * Check for virtual address in user space.
193 */
194int arch_check_va_in_userspace(unsigned long va, u8 hbp_len)
195{
196 unsigned int len;
197
198 len = get_hbp_len(hbp_len);
199
200 return (va <= TASK_SIZE - len);
201}
202
203/*
204 * Check for virtual address in kernel space.
205 */
206static int arch_check_va_in_kernelspace(unsigned long va, u8 hbp_len)
207{
208 unsigned int len;
209
210 len = get_hbp_len(hbp_len);
211
212 return (va >= TASK_SIZE) && ((va + len - 1) >= TASK_SIZE);
213}
214
215/*
216 * Store a breakpoint's encoded address, length, and type.
217 */
218static int arch_store_info(struct perf_event *bp)
219{
220 struct arch_hw_breakpoint *info = counter_arch_bp(bp);
221 /*
222 * For kernel-addresses, either the address or symbol name can be
223 * specified.
224 */
225 if (info->name)
226 info->address = (unsigned long)
227 kallsyms_lookup_name(info->name);
228 if (info->address)
229 return 0;
230
231 return -EINVAL;
232}
233
234int arch_bp_generic_fields(int x86_len, int x86_type,
235 int *gen_len, int *gen_type)
236{
237 /* Len */
238 switch (x86_len) {
239 case X86_BREAKPOINT_LEN_1:
240 *gen_len = HW_BREAKPOINT_LEN_1;
241 break;
242 case X86_BREAKPOINT_LEN_2:
243 *gen_len = HW_BREAKPOINT_LEN_2;
244 break;
245 case X86_BREAKPOINT_LEN_4:
246 *gen_len = HW_BREAKPOINT_LEN_4;
247 break;
248#ifdef CONFIG_X86_64
249 case X86_BREAKPOINT_LEN_8:
250 *gen_len = HW_BREAKPOINT_LEN_8;
251 break;
252#endif
253 default:
254 return -EINVAL;
255 }
256
257 /* Type */
258 switch (x86_type) {
259 case X86_BREAKPOINT_EXECUTE:
260 *gen_type = HW_BREAKPOINT_X;
261 break;
262 case X86_BREAKPOINT_WRITE:
263 *gen_type = HW_BREAKPOINT_W;
264 break;
265 case X86_BREAKPOINT_RW:
266 *gen_type = HW_BREAKPOINT_W | HW_BREAKPOINT_R;
267 break;
268 default:
269 return -EINVAL;
270 }
271
272 return 0;
273}
274
275
276static int arch_build_bp_info(struct perf_event *bp)
277{
278 struct arch_hw_breakpoint *info = counter_arch_bp(bp);
279
280 info->address = bp->attr.bp_addr;
281
282 /* Len */
283 switch (bp->attr.bp_len) {
284 case HW_BREAKPOINT_LEN_1:
285 info->len = X86_BREAKPOINT_LEN_1;
286 break;
287 case HW_BREAKPOINT_LEN_2:
288 info->len = X86_BREAKPOINT_LEN_2;
289 break;
290 case HW_BREAKPOINT_LEN_4:
291 info->len = X86_BREAKPOINT_LEN_4;
292 break;
293#ifdef CONFIG_X86_64
294 case HW_BREAKPOINT_LEN_8:
295 info->len = X86_BREAKPOINT_LEN_8;
296 break;
297#endif
298 default:
299 return -EINVAL;
300 }
301
302 /* Type */
303 switch (bp->attr.bp_type) {
304 case HW_BREAKPOINT_W:
305 info->type = X86_BREAKPOINT_WRITE;
306 break;
307 case HW_BREAKPOINT_W | HW_BREAKPOINT_R:
308 info->type = X86_BREAKPOINT_RW;
309 break;
310 case HW_BREAKPOINT_X:
311 info->type = X86_BREAKPOINT_EXECUTE;
312 break;
313 default:
314 return -EINVAL;
315 }
316
317 return 0;
318}
319/*
320 * Validate the arch-specific HW Breakpoint register settings
321 */
322int arch_validate_hwbkpt_settings(struct perf_event *bp,
323 struct task_struct *tsk)
324{
325 struct arch_hw_breakpoint *info = counter_arch_bp(bp);
326 unsigned int align;
327 int ret;
328
329
330 ret = arch_build_bp_info(bp);
331 if (ret)
332 return ret;
333
334 ret = -EINVAL;
335
336 if (info->type == X86_BREAKPOINT_EXECUTE)
337 /*
338 * Ptrace-refactoring code
339 * For now, we'll allow instruction breakpoint only for user-space
340 * addresses
341 */
342 if ((!arch_check_va_in_userspace(info->address, info->len)) &&
343 info->len != X86_BREAKPOINT_EXECUTE)
344 return ret;
345
346 switch (info->len) {
347 case X86_BREAKPOINT_LEN_1:
348 align = 0;
349 break;
350 case X86_BREAKPOINT_LEN_2:
351 align = 1;
352 break;
353 case X86_BREAKPOINT_LEN_4:
354 align = 3;
355 break;
356#ifdef CONFIG_X86_64
357 case X86_BREAKPOINT_LEN_8:
358 align = 7;
359 break;
360#endif
361 default:
362 return ret;
363 }
364
365 if (bp->callback)
366 ret = arch_store_info(bp);
367
368 if (ret < 0)
369 return ret;
370 /*
371 * Check that the low-order bits of the address are appropriate
372 * for the alignment implied by len.
373 */
374 if (info->address & align)
375 return -EINVAL;
376
377 /* Check that the virtual address is in the proper range */
378 if (tsk) {
379 if (!arch_check_va_in_userspace(info->address, info->len))
380 return -EFAULT;
381 } else {
382 if (!arch_check_va_in_kernelspace(info->address, info->len))
383 return -EFAULT;
384 }
385
386 return 0;
387}
388
389/*
390 * Dump the debug register contents to the user.
391 * We can't dump our per cpu values because it
392 * may contain cpu wide breakpoint, something that
393 * doesn't belong to the current task.
394 *
395 * TODO: include non-ptrace user breakpoints (perf)
396 */
397void aout_dump_debugregs(struct user *dump)
398{
399 int i;
400 int dr7 = 0;
401 struct perf_event *bp;
402 struct arch_hw_breakpoint *info;
403 struct thread_struct *thread = &current->thread;
404
405 for (i = 0; i < HBP_NUM; i++) {
406 bp = thread->ptrace_bps[i];
407
408 if (bp && !bp->attr.disabled) {
409 dump->u_debugreg[i] = bp->attr.bp_addr;
410 info = counter_arch_bp(bp);
411 dr7 |= encode_dr7(i, info->len, info->type);
412 } else {
413 dump->u_debugreg[i] = 0;
414 }
415 }
416
417 dump->u_debugreg[4] = 0;
418 dump->u_debugreg[5] = 0;
419 dump->u_debugreg[6] = current->thread.debugreg6;
420
421 dump->u_debugreg[7] = dr7;
422}
423EXPORT_SYMBOL_GPL(aout_dump_debugregs);
424
425/*
426 * Release the user breakpoints used by ptrace
427 */
428void flush_ptrace_hw_breakpoint(struct task_struct *tsk)
429{
430 int i;
431 struct thread_struct *t = &tsk->thread;
432
433 for (i = 0; i < HBP_NUM; i++) {
434 unregister_hw_breakpoint(t->ptrace_bps[i]);
435 t->ptrace_bps[i] = NULL;
436 }
437}
438
439void hw_breakpoint_restore(void)
440{
441 set_debugreg(__get_cpu_var(cpu_debugreg[0]), 0);
442 set_debugreg(__get_cpu_var(cpu_debugreg[1]), 1);
443 set_debugreg(__get_cpu_var(cpu_debugreg[2]), 2);
444 set_debugreg(__get_cpu_var(cpu_debugreg[3]), 3);
445 set_debugreg(current->thread.debugreg6, 6);
446 set_debugreg(__get_cpu_var(cpu_dr7), 7);
447}
448EXPORT_SYMBOL_GPL(hw_breakpoint_restore);
449
450/*
451 * Handle debug exception notifications.
452 *
453 * Return value is either NOTIFY_STOP or NOTIFY_DONE as explained below.
454 *
455 * NOTIFY_DONE returned if one of the following conditions is true.
456 * i) When the causative address is from user-space and the exception
457 * is a valid one, i.e. not triggered as a result of lazy debug register
458 * switching
459 * ii) When there are more bits than trap<n> set in DR6 register (such
460 * as BD, BS or BT) indicating that more than one debug condition is
461 * met and requires some more action in do_debug().
462 *
463 * NOTIFY_STOP returned for all other cases
464 *
465 */
466static int __kprobes hw_breakpoint_handler(struct die_args *args)
467{
468 int i, cpu, rc = NOTIFY_STOP;
469 struct perf_event *bp;
470 unsigned long dr7, dr6;
471 unsigned long *dr6_p;
472
473 /* The DR6 value is pointed by args->err */
474 dr6_p = (unsigned long *)ERR_PTR(args->err);
475 dr6 = *dr6_p;
476
477 /* Do an early return if no trap bits are set in DR6 */
478 if ((dr6 & DR_TRAP_BITS) == 0)
479 return NOTIFY_DONE;
480
481 get_debugreg(dr7, 7);
482 /* Disable breakpoints during exception handling */
483 set_debugreg(0UL, 7);
484 /*
485 * Assert that local interrupts are disabled
486 * Reset the DRn bits in the virtualized register value.
487 * The ptrace trigger routine will add in whatever is needed.
488 */
489 current->thread.debugreg6 &= ~DR_TRAP_BITS;
490 cpu = get_cpu();
491
492 /* Handle all the breakpoints that were triggered */
493 for (i = 0; i < HBP_NUM; ++i) {
494 if (likely(!(dr6 & (DR_TRAP0 << i))))
495 continue;
496
497 /*
498 * The counter may be concurrently released but that can only
499 * occur from a call_rcu() path. We can then safely fetch
500 * the breakpoint, use its callback, touch its counter
501 * while we are in an rcu_read_lock() path.
502 */
503 rcu_read_lock();
504
505 bp = per_cpu(bp_per_reg[i], cpu);
506 if (bp)
507 rc = NOTIFY_DONE;
508 /*
509 * Reset the 'i'th TRAP bit in dr6 to denote completion of
510 * exception handling
511 */
512 (*dr6_p) &= ~(DR_TRAP0 << i);
513 /*
514 * bp can be NULL due to lazy debug register switching
515 * or due to concurrent perf counter removing.
516 */
517 if (!bp) {
518 rcu_read_unlock();
519 break;
520 }
521
522 (bp->callback)(bp, args->regs);
523
524 rcu_read_unlock();
525 }
526 if (dr6 & (~DR_TRAP_BITS))
527 rc = NOTIFY_DONE;
528
529 set_debugreg(dr7, 7);
530 put_cpu();
531
532 return rc;
533}
534
535/*
536 * Handle debug exception notifications.
537 */
538int __kprobes hw_breakpoint_exceptions_notify(
539 struct notifier_block *unused, unsigned long val, void *data)
540{
541 if (val != DIE_DEBUG)
542 return NOTIFY_DONE;
543
544 return hw_breakpoint_handler(data);
545}
546
547void hw_breakpoint_pmu_read(struct perf_event *bp)
548{
549 /* TODO */
550}
551
552void hw_breakpoint_pmu_unthrottle(struct perf_event *bp)
553{
554 /* TODO */
555}
diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c
index 04bbd5278568..664bcb7384ac 100644
--- a/arch/x86/kernel/irq.c
+++ b/arch/x86/kernel/irq.c
@@ -18,7 +18,7 @@
18atomic_t irq_err_count; 18atomic_t irq_err_count;
19 19
20/* Function pointer for generic interrupt vector handling */ 20/* Function pointer for generic interrupt vector handling */
21void (*generic_interrupt_extension)(void) = NULL; 21void (*x86_platform_ipi_callback)(void) = NULL;
22 22
23/* 23/*
24 * 'what should we do if we get a hw irq event on an illegal vector'. 24 * 'what should we do if we get a hw irq event on an illegal vector'.
@@ -72,10 +72,10 @@ static int show_other_interrupts(struct seq_file *p, int prec)
72 seq_printf(p, "%10u ", irq_stats(j)->apic_pending_irqs); 72 seq_printf(p, "%10u ", irq_stats(j)->apic_pending_irqs);
73 seq_printf(p, " Performance pending work\n"); 73 seq_printf(p, " Performance pending work\n");
74#endif 74#endif
75 if (generic_interrupt_extension) { 75 if (x86_platform_ipi_callback) {
76 seq_printf(p, "%*s: ", prec, "PLT"); 76 seq_printf(p, "%*s: ", prec, "PLT");
77 for_each_online_cpu(j) 77 for_each_online_cpu(j)
78 seq_printf(p, "%10u ", irq_stats(j)->generic_irqs); 78 seq_printf(p, "%10u ", irq_stats(j)->x86_platform_ipis);
79 seq_printf(p, " Platform interrupts\n"); 79 seq_printf(p, " Platform interrupts\n");
80 } 80 }
81#ifdef CONFIG_SMP 81#ifdef CONFIG_SMP
@@ -92,17 +92,17 @@ static int show_other_interrupts(struct seq_file *p, int prec)
92 seq_printf(p, "%10u ", irq_stats(j)->irq_tlb_count); 92 seq_printf(p, "%10u ", irq_stats(j)->irq_tlb_count);
93 seq_printf(p, " TLB shootdowns\n"); 93 seq_printf(p, " TLB shootdowns\n");
94#endif 94#endif
95#ifdef CONFIG_X86_MCE 95#ifdef CONFIG_X86_THERMAL_VECTOR
96 seq_printf(p, "%*s: ", prec, "TRM"); 96 seq_printf(p, "%*s: ", prec, "TRM");
97 for_each_online_cpu(j) 97 for_each_online_cpu(j)
98 seq_printf(p, "%10u ", irq_stats(j)->irq_thermal_count); 98 seq_printf(p, "%10u ", irq_stats(j)->irq_thermal_count);
99 seq_printf(p, " Thermal event interrupts\n"); 99 seq_printf(p, " Thermal event interrupts\n");
100# ifdef CONFIG_X86_MCE_THRESHOLD 100#endif
101#ifdef CONFIG_X86_MCE_THRESHOLD
101 seq_printf(p, "%*s: ", prec, "THR"); 102 seq_printf(p, "%*s: ", prec, "THR");
102 for_each_online_cpu(j) 103 for_each_online_cpu(j)
103 seq_printf(p, "%10u ", irq_stats(j)->irq_threshold_count); 104 seq_printf(p, "%10u ", irq_stats(j)->irq_threshold_count);
104 seq_printf(p, " Threshold APIC interrupts\n"); 105 seq_printf(p, " Threshold APIC interrupts\n");
105# endif
106#endif 106#endif
107#ifdef CONFIG_X86_MCE 107#ifdef CONFIG_X86_MCE
108 seq_printf(p, "%*s: ", prec, "MCE"); 108 seq_printf(p, "%*s: ", prec, "MCE");
@@ -187,18 +187,18 @@ u64 arch_irq_stat_cpu(unsigned int cpu)
187 sum += irq_stats(cpu)->apic_perf_irqs; 187 sum += irq_stats(cpu)->apic_perf_irqs;
188 sum += irq_stats(cpu)->apic_pending_irqs; 188 sum += irq_stats(cpu)->apic_pending_irqs;
189#endif 189#endif
190 if (generic_interrupt_extension) 190 if (x86_platform_ipi_callback)
191 sum += irq_stats(cpu)->generic_irqs; 191 sum += irq_stats(cpu)->x86_platform_ipis;
192#ifdef CONFIG_SMP 192#ifdef CONFIG_SMP
193 sum += irq_stats(cpu)->irq_resched_count; 193 sum += irq_stats(cpu)->irq_resched_count;
194 sum += irq_stats(cpu)->irq_call_count; 194 sum += irq_stats(cpu)->irq_call_count;
195 sum += irq_stats(cpu)->irq_tlb_count; 195 sum += irq_stats(cpu)->irq_tlb_count;
196#endif 196#endif
197#ifdef CONFIG_X86_MCE 197#ifdef CONFIG_X86_THERMAL_VECTOR
198 sum += irq_stats(cpu)->irq_thermal_count; 198 sum += irq_stats(cpu)->irq_thermal_count;
199# ifdef CONFIG_X86_MCE_THRESHOLD 199#endif
200#ifdef CONFIG_X86_MCE_THRESHOLD
200 sum += irq_stats(cpu)->irq_threshold_count; 201 sum += irq_stats(cpu)->irq_threshold_count;
201# endif
202#endif 202#endif
203#ifdef CONFIG_X86_MCE 203#ifdef CONFIG_X86_MCE
204 sum += per_cpu(mce_exception_count, cpu); 204 sum += per_cpu(mce_exception_count, cpu);
@@ -251,9 +251,9 @@ unsigned int __irq_entry do_IRQ(struct pt_regs *regs)
251} 251}
252 252
253/* 253/*
254 * Handler for GENERIC_INTERRUPT_VECTOR. 254 * Handler for X86_PLATFORM_IPI_VECTOR.
255 */ 255 */
256void smp_generic_interrupt(struct pt_regs *regs) 256void smp_x86_platform_ipi(struct pt_regs *regs)
257{ 257{
258 struct pt_regs *old_regs = set_irq_regs(regs); 258 struct pt_regs *old_regs = set_irq_regs(regs);
259 259
@@ -263,10 +263,10 @@ void smp_generic_interrupt(struct pt_regs *regs)
263 263
264 irq_enter(); 264 irq_enter();
265 265
266 inc_irq_stat(generic_irqs); 266 inc_irq_stat(x86_platform_ipis);
267 267
268 if (generic_interrupt_extension) 268 if (x86_platform_ipi_callback)
269 generic_interrupt_extension(); 269 x86_platform_ipi_callback();
270 270
271 irq_exit(); 271 irq_exit();
272 272
@@ -274,3 +274,93 @@ void smp_generic_interrupt(struct pt_regs *regs)
274} 274}
275 275
276EXPORT_SYMBOL_GPL(vector_used_by_percpu_irq); 276EXPORT_SYMBOL_GPL(vector_used_by_percpu_irq);
277
278#ifdef CONFIG_HOTPLUG_CPU
279/* A cpu has been removed from cpu_online_mask. Reset irq affinities. */
280void fixup_irqs(void)
281{
282 unsigned int irq, vector;
283 static int warned;
284 struct irq_desc *desc;
285
286 for_each_irq_desc(irq, desc) {
287 int break_affinity = 0;
288 int set_affinity = 1;
289 const struct cpumask *affinity;
290
291 if (!desc)
292 continue;
293 if (irq == 2)
294 continue;
295
296 /* interrupt's are disabled at this point */
297 spin_lock(&desc->lock);
298
299 affinity = desc->affinity;
300 if (!irq_has_action(irq) ||
301 cpumask_equal(affinity, cpu_online_mask)) {
302 spin_unlock(&desc->lock);
303 continue;
304 }
305
306 /*
307 * Complete the irq move. This cpu is going down and for
308 * non intr-remapping case, we can't wait till this interrupt
309 * arrives at this cpu before completing the irq move.
310 */
311 irq_force_complete_move(irq);
312
313 if (cpumask_any_and(affinity, cpu_online_mask) >= nr_cpu_ids) {
314 break_affinity = 1;
315 affinity = cpu_all_mask;
316 }
317
318 if (!(desc->status & IRQ_MOVE_PCNTXT) && desc->chip->mask)
319 desc->chip->mask(irq);
320
321 if (desc->chip->set_affinity)
322 desc->chip->set_affinity(irq, affinity);
323 else if (!(warned++))
324 set_affinity = 0;
325
326 if (!(desc->status & IRQ_MOVE_PCNTXT) && desc->chip->unmask)
327 desc->chip->unmask(irq);
328
329 spin_unlock(&desc->lock);
330
331 if (break_affinity && set_affinity)
332 printk("Broke affinity for irq %i\n", irq);
333 else if (!set_affinity)
334 printk("Cannot set affinity for irq %i\n", irq);
335 }
336
337 /*
338 * We can remove mdelay() and then send spuriuous interrupts to
339 * new cpu targets for all the irqs that were handled previously by
340 * this cpu. While it works, I have seen spurious interrupt messages
341 * (nothing wrong but still...).
342 *
343 * So for now, retain mdelay(1) and check the IRR and then send those
344 * interrupts to new targets as this cpu is already offlined...
345 */
346 mdelay(1);
347
348 for (vector = FIRST_EXTERNAL_VECTOR; vector < NR_VECTORS; vector++) {
349 unsigned int irr;
350
351 if (__get_cpu_var(vector_irq)[vector] < 0)
352 continue;
353
354 irr = apic_read(APIC_IRR + (vector / 32 * 0x10));
355 if (irr & (1 << (vector % 32))) {
356 irq = __get_cpu_var(vector_irq)[vector];
357
358 desc = irq_to_desc(irq);
359 spin_lock(&desc->lock);
360 if (desc->chip->retrigger)
361 desc->chip->retrigger(irq);
362 spin_unlock(&desc->lock);
363 }
364 }
365}
366#endif
diff --git a/arch/x86/kernel/irq_32.c b/arch/x86/kernel/irq_32.c
index 7d35d0fe2329..10709f29d166 100644
--- a/arch/x86/kernel/irq_32.c
+++ b/arch/x86/kernel/irq_32.c
@@ -211,48 +211,3 @@ bool handle_irq(unsigned irq, struct pt_regs *regs)
211 211
212 return true; 212 return true;
213} 213}
214
215#ifdef CONFIG_HOTPLUG_CPU
216
217/* A cpu has been removed from cpu_online_mask. Reset irq affinities. */
218void fixup_irqs(void)
219{
220 unsigned int irq;
221 struct irq_desc *desc;
222
223 for_each_irq_desc(irq, desc) {
224 const struct cpumask *affinity;
225
226 if (!desc)
227 continue;
228 if (irq == 2)
229 continue;
230
231 affinity = desc->affinity;
232 if (cpumask_any_and(affinity, cpu_online_mask) >= nr_cpu_ids) {
233 printk("Breaking affinity for irq %i\n", irq);
234 affinity = cpu_all_mask;
235 }
236 if (desc->chip->set_affinity)
237 desc->chip->set_affinity(irq, affinity);
238 else if (desc->action)
239 printk_once("Cannot set affinity for irq %i\n", irq);
240 }
241
242#if 0
243 barrier();
244 /* Ingo Molnar says: "after the IO-APIC masks have been redirected
245 [note the nop - the interrupt-enable boundary on x86 is two
246 instructions from sti] - to flush out pending hardirqs and
247 IPIs. After this point nothing is supposed to reach this CPU." */
248 __asm__ __volatile__("sti; nop; cli");
249 barrier();
250#else
251 /* That doesn't seem sufficient. Give it 1ms. */
252 local_irq_enable();
253 mdelay(1);
254 local_irq_disable();
255#endif
256}
257#endif
258
diff --git a/arch/x86/kernel/irq_64.c b/arch/x86/kernel/irq_64.c
index 977d8b43a0dd..acf8fbf8fbda 100644
--- a/arch/x86/kernel/irq_64.c
+++ b/arch/x86/kernel/irq_64.c
@@ -62,64 +62,6 @@ bool handle_irq(unsigned irq, struct pt_regs *regs)
62 return true; 62 return true;
63} 63}
64 64
65#ifdef CONFIG_HOTPLUG_CPU
66/* A cpu has been removed from cpu_online_mask. Reset irq affinities. */
67void fixup_irqs(void)
68{
69 unsigned int irq;
70 static int warned;
71 struct irq_desc *desc;
72
73 for_each_irq_desc(irq, desc) {
74 int break_affinity = 0;
75 int set_affinity = 1;
76 const struct cpumask *affinity;
77
78 if (!desc)
79 continue;
80 if (irq == 2)
81 continue;
82
83 /* interrupt's are disabled at this point */
84 spin_lock(&desc->lock);
85
86 affinity = desc->affinity;
87 if (!irq_has_action(irq) ||
88 cpumask_equal(affinity, cpu_online_mask)) {
89 spin_unlock(&desc->lock);
90 continue;
91 }
92
93 if (cpumask_any_and(affinity, cpu_online_mask) >= nr_cpu_ids) {
94 break_affinity = 1;
95 affinity = cpu_all_mask;
96 }
97
98 if (desc->chip->mask)
99 desc->chip->mask(irq);
100
101 if (desc->chip->set_affinity)
102 desc->chip->set_affinity(irq, affinity);
103 else if (!(warned++))
104 set_affinity = 0;
105
106 if (desc->chip->unmask)
107 desc->chip->unmask(irq);
108
109 spin_unlock(&desc->lock);
110
111 if (break_affinity && set_affinity)
112 printk("Broke affinity for irq %i\n", irq);
113 else if (!set_affinity)
114 printk("Cannot set affinity for irq %i\n", irq);
115 }
116
117 /* That doesn't seem sufficient. Give it 1ms. */
118 local_irq_enable();
119 mdelay(1);
120 local_irq_disable();
121}
122#endif
123 65
124extern void call_softirq(void); 66extern void call_softirq(void);
125 67
diff --git a/arch/x86/kernel/irqinit.c b/arch/x86/kernel/irqinit.c
index 40f30773fb29..d5932226614f 100644
--- a/arch/x86/kernel/irqinit.c
+++ b/arch/x86/kernel/irqinit.c
@@ -200,8 +200,8 @@ static void __init apic_intr_init(void)
200 /* self generated IPI for local APIC timer */ 200 /* self generated IPI for local APIC timer */
201 alloc_intr_gate(LOCAL_TIMER_VECTOR, apic_timer_interrupt); 201 alloc_intr_gate(LOCAL_TIMER_VECTOR, apic_timer_interrupt);
202 202
203 /* generic IPI for platform specific use */ 203 /* IPI for X86 platform specific use */
204 alloc_intr_gate(GENERIC_INTERRUPT_VECTOR, generic_interrupt); 204 alloc_intr_gate(X86_PLATFORM_IPI_VECTOR, x86_platform_ipi);
205 205
206 /* IPI vectors for APIC spurious and error interrupts */ 206 /* IPI vectors for APIC spurious and error interrupts */
207 alloc_intr_gate(SPURIOUS_APIC_VECTOR, spurious_interrupt); 207 alloc_intr_gate(SPURIOUS_APIC_VECTOR, spurious_interrupt);
diff --git a/arch/x86/kernel/kgdb.c b/arch/x86/kernel/kgdb.c
index 8d82a77a3f3b..20a5b3689463 100644
--- a/arch/x86/kernel/kgdb.c
+++ b/arch/x86/kernel/kgdb.c
@@ -43,6 +43,7 @@
43#include <linux/smp.h> 43#include <linux/smp.h>
44#include <linux/nmi.h> 44#include <linux/nmi.h>
45 45
46#include <asm/debugreg.h>
46#include <asm/apicdef.h> 47#include <asm/apicdef.h>
47#include <asm/system.h> 48#include <asm/system.h>
48 49
@@ -88,7 +89,6 @@ void pt_regs_to_gdb_regs(unsigned long *gdb_regs, struct pt_regs *regs)
88 gdb_regs[GDB_SS] = __KERNEL_DS; 89 gdb_regs[GDB_SS] = __KERNEL_DS;
89 gdb_regs[GDB_FS] = 0xFFFF; 90 gdb_regs[GDB_FS] = 0xFFFF;
90 gdb_regs[GDB_GS] = 0xFFFF; 91 gdb_regs[GDB_GS] = 0xFFFF;
91 gdb_regs[GDB_SP] = (int)&regs->sp;
92#else 92#else
93 gdb_regs[GDB_R8] = regs->r8; 93 gdb_regs[GDB_R8] = regs->r8;
94 gdb_regs[GDB_R9] = regs->r9; 94 gdb_regs[GDB_R9] = regs->r9;
@@ -101,8 +101,8 @@ void pt_regs_to_gdb_regs(unsigned long *gdb_regs, struct pt_regs *regs)
101 gdb_regs32[GDB_PS] = regs->flags; 101 gdb_regs32[GDB_PS] = regs->flags;
102 gdb_regs32[GDB_CS] = regs->cs; 102 gdb_regs32[GDB_CS] = regs->cs;
103 gdb_regs32[GDB_SS] = regs->ss; 103 gdb_regs32[GDB_SS] = regs->ss;
104 gdb_regs[GDB_SP] = regs->sp;
105#endif 104#endif
105 gdb_regs[GDB_SP] = kernel_stack_pointer(regs);
106} 106}
107 107
108/** 108/**
@@ -434,6 +434,11 @@ single_step_cont(struct pt_regs *regs, struct die_args *args)
434 "resuming...\n"); 434 "resuming...\n");
435 kgdb_arch_handle_exception(args->trapnr, args->signr, 435 kgdb_arch_handle_exception(args->trapnr, args->signr,
436 args->err, "c", "", regs); 436 args->err, "c", "", regs);
437 /*
438 * Reset the BS bit in dr6 (pointed by args->err) to
439 * denote completion of processing
440 */
441 (*(unsigned long *)ERR_PTR(args->err)) &= ~DR_STEP;
437 442
438 return NOTIFY_STOP; 443 return NOTIFY_STOP;
439} 444}
diff --git a/arch/x86/kernel/kprobes.c b/arch/x86/kernel/kprobes.c
index 7b5169d2b000..1f3186ce213c 100644
--- a/arch/x86/kernel/kprobes.c
+++ b/arch/x86/kernel/kprobes.c
@@ -48,31 +48,22 @@
48#include <linux/preempt.h> 48#include <linux/preempt.h>
49#include <linux/module.h> 49#include <linux/module.h>
50#include <linux/kdebug.h> 50#include <linux/kdebug.h>
51#include <linux/kallsyms.h>
51 52
52#include <asm/cacheflush.h> 53#include <asm/cacheflush.h>
53#include <asm/desc.h> 54#include <asm/desc.h>
54#include <asm/pgtable.h> 55#include <asm/pgtable.h>
55#include <asm/uaccess.h> 56#include <asm/uaccess.h>
56#include <asm/alternative.h> 57#include <asm/alternative.h>
58#include <asm/insn.h>
59#include <asm/debugreg.h>
57 60
58void jprobe_return_end(void); 61void jprobe_return_end(void);
59 62
60DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL; 63DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL;
61DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); 64DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk);
62 65
63#ifdef CONFIG_X86_64 66#define stack_addr(regs) ((unsigned long *)kernel_stack_pointer(regs))
64#define stack_addr(regs) ((unsigned long *)regs->sp)
65#else
66/*
67 * "&regs->sp" looks wrong, but it's correct for x86_32. x86_32 CPUs
68 * don't save the ss and esp registers if the CPU is already in kernel
69 * mode when it traps. So for kprobes, regs->sp and regs->ss are not
70 * the [nonexistent] saved stack pointer and ss register, but rather
71 * the top 8 bytes of the pre-int3 stack. So &regs->sp happens to
72 * point to the top of the pre-int3 stack.
73 */
74#define stack_addr(regs) ((unsigned long *)&regs->sp)
75#endif
76 67
77#define W(row, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, ba, bb, bc, bd, be, bf)\ 68#define W(row, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, ba, bb, bc, bd, be, bf)\
78 (((b0##UL << 0x0)|(b1##UL << 0x1)|(b2##UL << 0x2)|(b3##UL << 0x3) | \ 69 (((b0##UL << 0x0)|(b1##UL << 0x1)|(b2##UL << 0x2)|(b3##UL << 0x3) | \
@@ -106,50 +97,6 @@ static const u32 twobyte_is_boostable[256 / 32] = {
106 /* ----------------------------------------------- */ 97 /* ----------------------------------------------- */
107 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */ 98 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
108}; 99};
109static const u32 onebyte_has_modrm[256 / 32] = {
110 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
111 /* ----------------------------------------------- */
112 W(0x00, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0) | /* 00 */
113 W(0x10, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0) , /* 10 */
114 W(0x20, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0) | /* 20 */
115 W(0x30, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0) , /* 30 */
116 W(0x40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) | /* 40 */
117 W(0x50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) , /* 50 */
118 W(0x60, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0) | /* 60 */
119 W(0x70, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) , /* 70 */
120 W(0x80, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1) | /* 80 */
121 W(0x90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) , /* 90 */
122 W(0xa0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) | /* a0 */
123 W(0xb0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) , /* b0 */
124 W(0xc0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0) | /* c0 */
125 W(0xd0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1) , /* d0 */
126 W(0xe0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) | /* e0 */
127 W(0xf0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1) /* f0 */
128 /* ----------------------------------------------- */
129 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
130};
131static const u32 twobyte_has_modrm[256 / 32] = {
132 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
133 /* ----------------------------------------------- */
134 W(0x00, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1) | /* 0f */
135 W(0x10, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0) , /* 1f */
136 W(0x20, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1) | /* 2f */
137 W(0x30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) , /* 3f */
138 W(0x40, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1) | /* 4f */
139 W(0x50, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1) , /* 5f */
140 W(0x60, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1) | /* 6f */
141 W(0x70, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1) , /* 7f */
142 W(0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) | /* 8f */
143 W(0x90, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1) , /* 9f */
144 W(0xa0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1) | /* af */
145 W(0xb0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1) , /* bf */
146 W(0xc0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0) | /* cf */
147 W(0xd0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1) , /* df */
148 W(0xe0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1) | /* ef */
149 W(0xf0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0) /* ff */
150 /* ----------------------------------------------- */
151 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
152};
153#undef W 100#undef W
154 101
155struct kretprobe_blackpoint kretprobe_blacklist[] = { 102struct kretprobe_blackpoint kretprobe_blacklist[] = {
@@ -244,6 +191,75 @@ retry:
244 } 191 }
245} 192}
246 193
194/* Recover the probed instruction at addr for further analysis. */
195static int recover_probed_instruction(kprobe_opcode_t *buf, unsigned long addr)
196{
197 struct kprobe *kp;
198 kp = get_kprobe((void *)addr);
199 if (!kp)
200 return -EINVAL;
201
202 /*
203 * Basically, kp->ainsn.insn has an original instruction.
204 * However, RIP-relative instruction can not do single-stepping
205 * at different place, fix_riprel() tweaks the displacement of
206 * that instruction. In that case, we can't recover the instruction
207 * from the kp->ainsn.insn.
208 *
209 * On the other hand, kp->opcode has a copy of the first byte of
210 * the probed instruction, which is overwritten by int3. And
211 * the instruction at kp->addr is not modified by kprobes except
212 * for the first byte, we can recover the original instruction
213 * from it and kp->opcode.
214 */
215 memcpy(buf, kp->addr, MAX_INSN_SIZE * sizeof(kprobe_opcode_t));
216 buf[0] = kp->opcode;
217 return 0;
218}
219
220/* Dummy buffers for kallsyms_lookup */
221static char __dummy_buf[KSYM_NAME_LEN];
222
223/* Check if paddr is at an instruction boundary */
224static int __kprobes can_probe(unsigned long paddr)
225{
226 int ret;
227 unsigned long addr, offset = 0;
228 struct insn insn;
229 kprobe_opcode_t buf[MAX_INSN_SIZE];
230
231 if (!kallsyms_lookup(paddr, NULL, &offset, NULL, __dummy_buf))
232 return 0;
233
234 /* Decode instructions */
235 addr = paddr - offset;
236 while (addr < paddr) {
237 kernel_insn_init(&insn, (void *)addr);
238 insn_get_opcode(&insn);
239
240 /*
241 * Check if the instruction has been modified by another
242 * kprobe, in which case we replace the breakpoint by the
243 * original instruction in our buffer.
244 */
245 if (insn.opcode.bytes[0] == BREAKPOINT_INSTRUCTION) {
246 ret = recover_probed_instruction(buf, addr);
247 if (ret)
248 /*
249 * Another debugging subsystem might insert
250 * this breakpoint. In that case, we can't
251 * recover it.
252 */
253 return 0;
254 kernel_insn_init(&insn, buf);
255 }
256 insn_get_length(&insn);
257 addr += insn.length;
258 }
259
260 return (addr == paddr);
261}
262
247/* 263/*
248 * Returns non-zero if opcode modifies the interrupt flag. 264 * Returns non-zero if opcode modifies the interrupt flag.
249 */ 265 */
@@ -277,68 +293,30 @@ static int __kprobes is_IF_modifier(kprobe_opcode_t *insn)
277static void __kprobes fix_riprel(struct kprobe *p) 293static void __kprobes fix_riprel(struct kprobe *p)
278{ 294{
279#ifdef CONFIG_X86_64 295#ifdef CONFIG_X86_64
280 u8 *insn = p->ainsn.insn; 296 struct insn insn;
281 s64 disp; 297 kernel_insn_init(&insn, p->ainsn.insn);
282 int need_modrm;
283
284 /* Skip legacy instruction prefixes. */
285 while (1) {
286 switch (*insn) {
287 case 0x66:
288 case 0x67:
289 case 0x2e:
290 case 0x3e:
291 case 0x26:
292 case 0x64:
293 case 0x65:
294 case 0x36:
295 case 0xf0:
296 case 0xf3:
297 case 0xf2:
298 ++insn;
299 continue;
300 }
301 break;
302 }
303 298
304 /* Skip REX instruction prefix. */ 299 if (insn_rip_relative(&insn)) {
305 if (is_REX_prefix(insn)) 300 s64 newdisp;
306 ++insn; 301 u8 *disp;
307 302 insn_get_displacement(&insn);
308 if (*insn == 0x0f) { 303 /*
309 /* Two-byte opcode. */ 304 * The copied instruction uses the %rip-relative addressing
310 ++insn; 305 * mode. Adjust the displacement for the difference between
311 need_modrm = test_bit(*insn, 306 * the original location of this instruction and the location
312 (unsigned long *)twobyte_has_modrm); 307 * of the copy that will actually be run. The tricky bit here
313 } else 308 * is making sure that the sign extension happens correctly in
314 /* One-byte opcode. */ 309 * this calculation, since we need a signed 32-bit result to
315 need_modrm = test_bit(*insn, 310 * be sign-extended to 64 bits when it's added to the %rip
316 (unsigned long *)onebyte_has_modrm); 311 * value and yield the same 64-bit result that the sign-
317 312 * extension of the original signed 32-bit displacement would
318 if (need_modrm) { 313 * have given.
319 u8 modrm = *++insn; 314 */
320 if ((modrm & 0xc7) == 0x05) { 315 newdisp = (u8 *) p->addr + (s64) insn.displacement.value -
321 /* %rip+disp32 addressing mode */ 316 (u8 *) p->ainsn.insn;
322 /* Displacement follows ModRM byte. */ 317 BUG_ON((s64) (s32) newdisp != newdisp); /* Sanity check. */
323 ++insn; 318 disp = (u8 *) p->ainsn.insn + insn_offset_displacement(&insn);
324 /* 319 *(s32 *) disp = (s32) newdisp;
325 * The copied instruction uses the %rip-relative
326 * addressing mode. Adjust the displacement for the
327 * difference between the original location of this
328 * instruction and the location of the copy that will
329 * actually be run. The tricky bit here is making sure
330 * that the sign extension happens correctly in this
331 * calculation, since we need a signed 32-bit result to
332 * be sign-extended to 64 bits when it's added to the
333 * %rip value and yield the same 64-bit result that the
334 * sign-extension of the original signed 32-bit
335 * displacement would have given.
336 */
337 disp = (u8 *) p->addr + *((s32 *) insn) -
338 (u8 *) p->ainsn.insn;
339 BUG_ON((s64) (s32) disp != disp); /* Sanity check. */
340 *(s32 *)insn = (s32) disp;
341 }
342 } 320 }
343#endif 321#endif
344} 322}
@@ -359,6 +337,8 @@ static void __kprobes arch_copy_kprobe(struct kprobe *p)
359 337
360int __kprobes arch_prepare_kprobe(struct kprobe *p) 338int __kprobes arch_prepare_kprobe(struct kprobe *p)
361{ 339{
340 if (!can_probe((unsigned long)p->addr))
341 return -EILSEQ;
362 /* insn: must be on special executable page on x86. */ 342 /* insn: must be on special executable page on x86. */
363 p->ainsn.insn = get_insn_slot(); 343 p->ainsn.insn = get_insn_slot();
364 if (!p->ainsn.insn) 344 if (!p->ainsn.insn)
@@ -472,17 +452,6 @@ static int __kprobes reenter_kprobe(struct kprobe *p, struct pt_regs *regs,
472{ 452{
473 switch (kcb->kprobe_status) { 453 switch (kcb->kprobe_status) {
474 case KPROBE_HIT_SSDONE: 454 case KPROBE_HIT_SSDONE:
475#ifdef CONFIG_X86_64
476 /* TODO: Provide re-entrancy from post_kprobes_handler() and
477 * avoid exception stack corruption while single-stepping on
478 * the instruction of the new probe.
479 */
480 arch_disarm_kprobe(p);
481 regs->ip = (unsigned long)p->addr;
482 reset_current_kprobe();
483 preempt_enable_no_resched();
484 break;
485#endif
486 case KPROBE_HIT_ACTIVE: 455 case KPROBE_HIT_ACTIVE:
487 save_previous_kprobe(kcb); 456 save_previous_kprobe(kcb);
488 set_current_kprobe(p, regs, kcb); 457 set_current_kprobe(p, regs, kcb);
@@ -491,18 +460,16 @@ static int __kprobes reenter_kprobe(struct kprobe *p, struct pt_regs *regs,
491 kcb->kprobe_status = KPROBE_REENTER; 460 kcb->kprobe_status = KPROBE_REENTER;
492 break; 461 break;
493 case KPROBE_HIT_SS: 462 case KPROBE_HIT_SS:
494 if (p == kprobe_running()) { 463 /* A probe has been hit in the codepath leading up to, or just
495 regs->flags &= ~X86_EFLAGS_TF; 464 * after, single-stepping of a probed instruction. This entire
496 regs->flags |= kcb->kprobe_saved_flags; 465 * codepath should strictly reside in .kprobes.text section.
497 return 0; 466 * Raise a BUG or we'll continue in an endless reentering loop
498 } else { 467 * and eventually a stack overflow.
499 /* A probe has been hit in the codepath leading up 468 */
500 * to, or just after, single-stepping of a probed 469 printk(KERN_WARNING "Unrecoverable kprobe detected at %p.\n",
501 * instruction. This entire codepath should strictly 470 p->addr);
502 * reside in .kprobes.text section. Raise a warning 471 dump_kprobe(p);
503 * to highlight this peculiar case. 472 BUG();
504 */
505 }
506 default: 473 default:
507 /* impossible cases */ 474 /* impossible cases */
508 WARN_ON(1); 475 WARN_ON(1);
@@ -967,8 +934,14 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self,
967 ret = NOTIFY_STOP; 934 ret = NOTIFY_STOP;
968 break; 935 break;
969 case DIE_DEBUG: 936 case DIE_DEBUG:
970 if (post_kprobe_handler(args->regs)) 937 if (post_kprobe_handler(args->regs)) {
938 /*
939 * Reset the BS bit in dr6 (pointed by args->err) to
940 * denote completion of processing
941 */
942 (*(unsigned long *)ERR_PTR(args->err)) &= ~DR_STEP;
971 ret = NOTIFY_STOP; 943 ret = NOTIFY_STOP;
944 }
972 break; 945 break;
973 case DIE_GPF: 946 case DIE_GPF:
974 /* 947 /*
diff --git a/arch/x86/kernel/machine_kexec_32.c b/arch/x86/kernel/machine_kexec_32.c
index c1c429d00130..a3fa43ba5d3b 100644
--- a/arch/x86/kernel/machine_kexec_32.c
+++ b/arch/x86/kernel/machine_kexec_32.c
@@ -25,6 +25,7 @@
25#include <asm/desc.h> 25#include <asm/desc.h>
26#include <asm/system.h> 26#include <asm/system.h>
27#include <asm/cacheflush.h> 27#include <asm/cacheflush.h>
28#include <asm/debugreg.h>
28 29
29static void set_idt(void *newidt, __u16 limit) 30static void set_idt(void *newidt, __u16 limit)
30{ 31{
@@ -157,8 +158,7 @@ int machine_kexec_prepare(struct kimage *image)
157{ 158{
158 int error; 159 int error;
159 160
160 if (nx_enabled) 161 set_pages_x(image->control_code_page, 1);
161 set_pages_x(image->control_code_page, 1);
162 error = machine_kexec_alloc_page_tables(image); 162 error = machine_kexec_alloc_page_tables(image);
163 if (error) 163 if (error)
164 return error; 164 return error;
@@ -172,8 +172,7 @@ int machine_kexec_prepare(struct kimage *image)
172 */ 172 */
173void machine_kexec_cleanup(struct kimage *image) 173void machine_kexec_cleanup(struct kimage *image)
174{ 174{
175 if (nx_enabled) 175 set_pages_nx(image->control_code_page, 1);
176 set_pages_nx(image->control_code_page, 1);
177 machine_kexec_free_page_tables(image); 176 machine_kexec_free_page_tables(image);
178} 177}
179 178
@@ -202,6 +201,7 @@ void machine_kexec(struct kimage *image)
202 201
203 /* Interrupts aren't acceptable while we reboot */ 202 /* Interrupts aren't acceptable while we reboot */
204 local_irq_disable(); 203 local_irq_disable();
204 hw_breakpoint_disable();
205 205
206 if (image->preserve_context) { 206 if (image->preserve_context) {
207#ifdef CONFIG_X86_IO_APIC 207#ifdef CONFIG_X86_IO_APIC
diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c
index 84c3bf209e98..4a8bb82248ae 100644
--- a/arch/x86/kernel/machine_kexec_64.c
+++ b/arch/x86/kernel/machine_kexec_64.c
@@ -18,6 +18,7 @@
18#include <asm/pgtable.h> 18#include <asm/pgtable.h>
19#include <asm/tlbflush.h> 19#include <asm/tlbflush.h>
20#include <asm/mmu_context.h> 20#include <asm/mmu_context.h>
21#include <asm/debugreg.h>
21 22
22static int init_one_level2_page(struct kimage *image, pgd_t *pgd, 23static int init_one_level2_page(struct kimage *image, pgd_t *pgd,
23 unsigned long addr) 24 unsigned long addr)
@@ -282,6 +283,7 @@ void machine_kexec(struct kimage *image)
282 283
283 /* Interrupts aren't acceptable while we reboot */ 284 /* Interrupts aren't acceptable while we reboot */
284 local_irq_disable(); 285 local_irq_disable();
286 hw_breakpoint_disable();
285 287
286 if (image->preserve_context) { 288 if (image->preserve_context) {
287#ifdef CONFIG_X86_IO_APIC 289#ifdef CONFIG_X86_IO_APIC
diff --git a/arch/x86/kernel/microcode_amd.c b/arch/x86/kernel/microcode_amd.c
index f4c538b681ca..63123d902103 100644
--- a/arch/x86/kernel/microcode_amd.c
+++ b/arch/x86/kernel/microcode_amd.c
@@ -33,6 +33,9 @@ MODULE_LICENSE("GPL v2");
33#define UCODE_EQUIV_CPU_TABLE_TYPE 0x00000000 33#define UCODE_EQUIV_CPU_TABLE_TYPE 0x00000000
34#define UCODE_UCODE_TYPE 0x00000001 34#define UCODE_UCODE_TYPE 0x00000001
35 35
36const struct firmware *firmware;
37static int supported_cpu;
38
36struct equiv_cpu_entry { 39struct equiv_cpu_entry {
37 u32 installed_cpu; 40 u32 installed_cpu;
38 u32 fixed_errata_mask; 41 u32 fixed_errata_mask;
@@ -71,17 +74,14 @@ static struct equiv_cpu_entry *equiv_cpu_table;
71 74
72static int collect_cpu_info_amd(int cpu, struct cpu_signature *csig) 75static int collect_cpu_info_amd(int cpu, struct cpu_signature *csig)
73{ 76{
74 struct cpuinfo_x86 *c = &cpu_data(cpu);
75 u32 dummy; 77 u32 dummy;
76 78
77 memset(csig, 0, sizeof(*csig)); 79 if (!supported_cpu)
78 if (c->x86_vendor != X86_VENDOR_AMD || c->x86 < 0x10) {
79 printk(KERN_WARNING "microcode: CPU%d: AMD CPU family 0x%x not "
80 "supported\n", cpu, c->x86);
81 return -1; 80 return -1;
82 } 81
82 memset(csig, 0, sizeof(*csig));
83 rdmsr(MSR_AMD64_PATCH_LEVEL, csig->rev, dummy); 83 rdmsr(MSR_AMD64_PATCH_LEVEL, csig->rev, dummy);
84 printk(KERN_INFO "microcode: CPU%d: patch_level=0x%x\n", cpu, csig->rev); 84 pr_info("microcode: CPU%d: patch_level=0x%x\n", cpu, csig->rev);
85 return 0; 85 return 0;
86} 86}
87 87
@@ -103,22 +103,15 @@ static int get_matching_microcode(int cpu, void *mc, int rev)
103 i++; 103 i++;
104 } 104 }
105 105
106 if (!equiv_cpu_id) { 106 if (!equiv_cpu_id)
107 printk(KERN_WARNING "microcode: CPU%d: cpu revision "
108 "not listed in equivalent cpu table\n", cpu);
109 return 0; 107 return 0;
110 }
111 108
112 if (mc_header->processor_rev_id != equiv_cpu_id) { 109 if (mc_header->processor_rev_id != equiv_cpu_id)
113 printk(KERN_ERR "microcode: CPU%d: patch mismatch "
114 "(processor_rev_id: %x, equiv_cpu_id: %x)\n",
115 cpu, mc_header->processor_rev_id, equiv_cpu_id);
116 return 0; 110 return 0;
117 }
118 111
119 /* ucode might be chipset specific -- currently we don't support this */ 112 /* ucode might be chipset specific -- currently we don't support this */
120 if (mc_header->nb_dev_id || mc_header->sb_dev_id) { 113 if (mc_header->nb_dev_id || mc_header->sb_dev_id) {
121 printk(KERN_ERR "microcode: CPU%d: loading of chipset " 114 pr_err(KERN_ERR "microcode: CPU%d: loading of chipset "
122 "specific code not yet supported\n", cpu); 115 "specific code not yet supported\n", cpu);
123 return 0; 116 return 0;
124 } 117 }
@@ -148,14 +141,12 @@ static int apply_microcode_amd(int cpu)
148 141
149 /* check current patch id and patch's id for match */ 142 /* check current patch id and patch's id for match */
150 if (rev != mc_amd->hdr.patch_id) { 143 if (rev != mc_amd->hdr.patch_id) {
151 printk(KERN_ERR "microcode: CPU%d: update failed " 144 pr_err("microcode: CPU%d: update failed "
152 "(for patch_level=0x%x)\n", cpu, mc_amd->hdr.patch_id); 145 "(for patch_level=0x%x)\n", cpu, mc_amd->hdr.patch_id);
153 return -1; 146 return -1;
154 } 147 }
155 148
156 printk(KERN_INFO "microcode: CPU%d: updated (new patch_level=0x%x)\n", 149 pr_info("microcode: CPU%d: updated (new patch_level=0x%x)\n", cpu, rev);
157 cpu, rev);
158
159 uci->cpu_sig.rev = rev; 150 uci->cpu_sig.rev = rev;
160 151
161 return 0; 152 return 0;
@@ -178,18 +169,15 @@ get_next_ucode(const u8 *buf, unsigned int size, unsigned int *mc_size)
178 return NULL; 169 return NULL;
179 170
180 if (section_hdr[0] != UCODE_UCODE_TYPE) { 171 if (section_hdr[0] != UCODE_UCODE_TYPE) {
181 printk(KERN_ERR "microcode: error: invalid type field in " 172 pr_err("microcode: error: invalid type field in "
182 "container file section header\n"); 173 "container file section header\n");
183 return NULL; 174 return NULL;
184 } 175 }
185 176
186 total_size = (unsigned long) (section_hdr[4] + (section_hdr[5] << 8)); 177 total_size = (unsigned long) (section_hdr[4] + (section_hdr[5] << 8));
187 178
188 printk(KERN_DEBUG "microcode: size %u, total_size %u\n",
189 size, total_size);
190
191 if (total_size > size || total_size > UCODE_MAX_SIZE) { 179 if (total_size > size || total_size > UCODE_MAX_SIZE) {
192 printk(KERN_ERR "microcode: error: size mismatch\n"); 180 pr_err("microcode: error: size mismatch\n");
193 return NULL; 181 return NULL;
194 } 182 }
195 183
@@ -218,15 +206,14 @@ static int install_equiv_cpu_table(const u8 *buf)
218 size = buf_pos[2]; 206 size = buf_pos[2];
219 207
220 if (buf_pos[1] != UCODE_EQUIV_CPU_TABLE_TYPE || !size) { 208 if (buf_pos[1] != UCODE_EQUIV_CPU_TABLE_TYPE || !size) {
221 printk(KERN_ERR "microcode: error: invalid type field in " 209 pr_err("microcode: error: invalid type field in "
222 "container file section header\n"); 210 "container file section header\n");
223 return 0; 211 return 0;
224 } 212 }
225 213
226 equiv_cpu_table = (struct equiv_cpu_entry *) vmalloc(size); 214 equiv_cpu_table = (struct equiv_cpu_entry *) vmalloc(size);
227 if (!equiv_cpu_table) { 215 if (!equiv_cpu_table) {
228 printk(KERN_ERR "microcode: failed to allocate " 216 pr_err("microcode: failed to allocate equivalent CPU table\n");
229 "equivalent CPU table\n");
230 return 0; 217 return 0;
231 } 218 }
232 219
@@ -259,8 +246,7 @@ generic_load_microcode(int cpu, const u8 *data, size_t size)
259 246
260 offset = install_equiv_cpu_table(ucode_ptr); 247 offset = install_equiv_cpu_table(ucode_ptr);
261 if (!offset) { 248 if (!offset) {
262 printk(KERN_ERR "microcode: failed to create " 249 pr_err("microcode: failed to create equivalent cpu table\n");
263 "equivalent cpu table\n");
264 return UCODE_ERROR; 250 return UCODE_ERROR;
265 } 251 }
266 252
@@ -308,33 +294,27 @@ generic_load_microcode(int cpu, const u8 *data, size_t size)
308 294
309static enum ucode_state request_microcode_fw(int cpu, struct device *device) 295static enum ucode_state request_microcode_fw(int cpu, struct device *device)
310{ 296{
311 const char *fw_name = "amd-ucode/microcode_amd.bin";
312 const struct firmware *firmware;
313 enum ucode_state ret; 297 enum ucode_state ret;
314 298
315 if (request_firmware(&firmware, fw_name, device)) { 299 if (firmware == NULL)
316 printk(KERN_ERR "microcode: failed to load file %s\n", fw_name);
317 return UCODE_NFOUND; 300 return UCODE_NFOUND;
318 }
319 301
320 if (*(u32 *)firmware->data != UCODE_MAGIC) { 302 if (*(u32 *)firmware->data != UCODE_MAGIC) {
321 printk(KERN_ERR "microcode: invalid UCODE_MAGIC (0x%08x)\n", 303 pr_err("microcode: invalid UCODE_MAGIC (0x%08x)\n",
322 *(u32 *)firmware->data); 304 *(u32 *)firmware->data);
323 return UCODE_ERROR; 305 return UCODE_ERROR;
324 } 306 }
325 307
326 ret = generic_load_microcode(cpu, firmware->data, firmware->size); 308 ret = generic_load_microcode(cpu, firmware->data, firmware->size);
327 309
328 release_firmware(firmware);
329
330 return ret; 310 return ret;
331} 311}
332 312
333static enum ucode_state 313static enum ucode_state
334request_microcode_user(int cpu, const void __user *buf, size_t size) 314request_microcode_user(int cpu, const void __user *buf, size_t size)
335{ 315{
336 printk(KERN_INFO "microcode: AMD microcode update via " 316 pr_info("microcode: AMD microcode update via "
337 "/dev/cpu/microcode not supported\n"); 317 "/dev/cpu/microcode not supported\n");
338 return UCODE_ERROR; 318 return UCODE_ERROR;
339} 319}
340 320
@@ -346,7 +326,32 @@ static void microcode_fini_cpu_amd(int cpu)
346 uci->mc = NULL; 326 uci->mc = NULL;
347} 327}
348 328
329void init_microcode_amd(struct device *device)
330{
331 const char *fw_name = "amd-ucode/microcode_amd.bin";
332 struct cpuinfo_x86 *c = &boot_cpu_data;
333
334 WARN_ON(c->x86_vendor != X86_VENDOR_AMD);
335
336 if (c->x86 < 0x10) {
337 pr_warning("microcode: AMD CPU family 0x%x not supported\n",
338 c->x86);
339 return;
340 }
341 supported_cpu = 1;
342
343 if (request_firmware(&firmware, fw_name, device))
344 pr_err("microcode: failed to load file %s\n", fw_name);
345}
346
347void fini_microcode_amd(void)
348{
349 release_firmware(firmware);
350}
351
349static struct microcode_ops microcode_amd_ops = { 352static struct microcode_ops microcode_amd_ops = {
353 .init = init_microcode_amd,
354 .fini = fini_microcode_amd,
350 .request_microcode_user = request_microcode_user, 355 .request_microcode_user = request_microcode_user,
351 .request_microcode_fw = request_microcode_fw, 356 .request_microcode_fw = request_microcode_fw,
352 .collect_cpu_info = collect_cpu_info_amd, 357 .collect_cpu_info = collect_cpu_info_amd,
diff --git a/arch/x86/kernel/microcode_core.c b/arch/x86/kernel/microcode_core.c
index 378e9a8f1bf8..e68aae397869 100644
--- a/arch/x86/kernel/microcode_core.c
+++ b/arch/x86/kernel/microcode_core.c
@@ -73,7 +73,6 @@
73#include <linux/platform_device.h> 73#include <linux/platform_device.h>
74#include <linux/miscdevice.h> 74#include <linux/miscdevice.h>
75#include <linux/capability.h> 75#include <linux/capability.h>
76#include <linux/smp_lock.h>
77#include <linux/kernel.h> 76#include <linux/kernel.h>
78#include <linux/module.h> 77#include <linux/module.h>
79#include <linux/mutex.h> 78#include <linux/mutex.h>
@@ -201,7 +200,6 @@ static int do_microcode_update(const void __user *buf, size_t size)
201 200
202static int microcode_open(struct inode *unused1, struct file *unused2) 201static int microcode_open(struct inode *unused1, struct file *unused2)
203{ 202{
204 cycle_kernel_lock();
205 return capable(CAP_SYS_RAWIO) ? 0 : -EPERM; 203 return capable(CAP_SYS_RAWIO) ? 0 : -EPERM;
206} 204}
207 205
@@ -393,7 +391,7 @@ static enum ucode_state microcode_update_cpu(int cpu)
393 struct ucode_cpu_info *uci = ucode_cpu_info + cpu; 391 struct ucode_cpu_info *uci = ucode_cpu_info + cpu;
394 enum ucode_state ustate; 392 enum ucode_state ustate;
395 393
396 if (uci->valid) 394 if (uci->valid && uci->mc)
397 ustate = microcode_resume_cpu(cpu); 395 ustate = microcode_resume_cpu(cpu);
398 else 396 else
399 ustate = microcode_init_cpu(cpu); 397 ustate = microcode_init_cpu(cpu);
@@ -520,6 +518,9 @@ static int __init microcode_init(void)
520 return PTR_ERR(microcode_pdev); 518 return PTR_ERR(microcode_pdev);
521 } 519 }
522 520
521 if (microcode_ops->init)
522 microcode_ops->init(&microcode_pdev->dev);
523
523 get_online_cpus(); 524 get_online_cpus();
524 mutex_lock(&microcode_mutex); 525 mutex_lock(&microcode_mutex);
525 526
@@ -563,6 +564,9 @@ static void __exit microcode_exit(void)
563 564
564 platform_device_unregister(microcode_pdev); 565 platform_device_unregister(microcode_pdev);
565 566
567 if (microcode_ops->fini)
568 microcode_ops->fini();
569
566 microcode_ops = NULL; 570 microcode_ops = NULL;
567 571
568 pr_info("Microcode Update Driver: v" MICROCODE_VERSION " removed.\n"); 572 pr_info("Microcode Update Driver: v" MICROCODE_VERSION " removed.\n");
diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c
index 5be95ef4ffec..35a57c963df9 100644
--- a/arch/x86/kernel/mpparse.c
+++ b/arch/x86/kernel/mpparse.c
@@ -667,36 +667,18 @@ void __init default_get_smp_config(unsigned int early)
667 */ 667 */
668} 668}
669 669
670static void __init smp_reserve_bootmem(struct mpf_intel *mpf) 670static void __init smp_reserve_memory(struct mpf_intel *mpf)
671{ 671{
672 unsigned long size = get_mpc_size(mpf->physptr); 672 unsigned long size = get_mpc_size(mpf->physptr);
673#ifdef CONFIG_X86_32
674 /*
675 * We cannot access to MPC table to compute table size yet,
676 * as only few megabytes from the bottom is mapped now.
677 * PC-9800's MPC table places on the very last of physical
678 * memory; so that simply reserving PAGE_SIZE from mpf->physptr
679 * yields BUG() in reserve_bootmem.
680 * also need to make sure physptr is below than max_low_pfn
681 * we don't need reserve the area above max_low_pfn
682 */
683 unsigned long end = max_low_pfn * PAGE_SIZE;
684 673
685 if (mpf->physptr < end) { 674 reserve_early(mpf->physptr, mpf->physptr+size, "MP-table mpc");
686 if (mpf->physptr + size > end)
687 size = end - mpf->physptr;
688 reserve_bootmem_generic(mpf->physptr, size, BOOTMEM_DEFAULT);
689 }
690#else
691 reserve_bootmem_generic(mpf->physptr, size, BOOTMEM_DEFAULT);
692#endif
693} 675}
694 676
695static int __init smp_scan_config(unsigned long base, unsigned long length, 677static int __init smp_scan_config(unsigned long base, unsigned long length)
696 unsigned reserve)
697{ 678{
698 unsigned int *bp = phys_to_virt(base); 679 unsigned int *bp = phys_to_virt(base);
699 struct mpf_intel *mpf; 680 struct mpf_intel *mpf;
681 unsigned long mem;
700 682
701 apic_printk(APIC_VERBOSE, "Scan SMP from %p for %ld bytes.\n", 683 apic_printk(APIC_VERBOSE, "Scan SMP from %p for %ld bytes.\n",
702 bp, length); 684 bp, length);
@@ -717,12 +699,10 @@ static int __init smp_scan_config(unsigned long base, unsigned long length,
717 printk(KERN_INFO "found SMP MP-table at [%p] %llx\n", 699 printk(KERN_INFO "found SMP MP-table at [%p] %llx\n",
718 mpf, (u64)virt_to_phys(mpf)); 700 mpf, (u64)virt_to_phys(mpf));
719 701
720 if (!reserve) 702 mem = virt_to_phys(mpf);
721 return 1; 703 reserve_early(mem, mem + sizeof(*mpf), "MP-table mpf");
722 reserve_bootmem_generic(virt_to_phys(mpf), sizeof(*mpf),
723 BOOTMEM_DEFAULT);
724 if (mpf->physptr) 704 if (mpf->physptr)
725 smp_reserve_bootmem(mpf); 705 smp_reserve_memory(mpf);
726 706
727 return 1; 707 return 1;
728 } 708 }
@@ -732,7 +712,7 @@ static int __init smp_scan_config(unsigned long base, unsigned long length,
732 return 0; 712 return 0;
733} 713}
734 714
735void __init default_find_smp_config(unsigned int reserve) 715void __init default_find_smp_config(void)
736{ 716{
737 unsigned int address; 717 unsigned int address;
738 718
@@ -744,9 +724,9 @@ void __init default_find_smp_config(unsigned int reserve)
744 * 2) Scan the top 1K of base RAM 724 * 2) Scan the top 1K of base RAM
745 * 3) Scan the 64K of bios 725 * 3) Scan the 64K of bios
746 */ 726 */
747 if (smp_scan_config(0x0, 0x400, reserve) || 727 if (smp_scan_config(0x0, 0x400) ||
748 smp_scan_config(639 * 0x400, 0x400, reserve) || 728 smp_scan_config(639 * 0x400, 0x400) ||
749 smp_scan_config(0xF0000, 0x10000, reserve)) 729 smp_scan_config(0xF0000, 0x10000))
750 return; 730 return;
751 /* 731 /*
752 * If it is an SMP machine we should know now, unless the 732 * If it is an SMP machine we should know now, unless the
@@ -767,7 +747,7 @@ void __init default_find_smp_config(unsigned int reserve)
767 747
768 address = get_bios_ebda(); 748 address = get_bios_ebda();
769 if (address) 749 if (address)
770 smp_scan_config(address, 0x400, reserve); 750 smp_scan_config(address, 0x400);
771} 751}
772 752
773#ifdef CONFIG_X86_IO_APIC 753#ifdef CONFIG_X86_IO_APIC
diff --git a/arch/x86/kernel/msr.c b/arch/x86/kernel/msr.c
index 6a3cefc7dda1..553449951b84 100644
--- a/arch/x86/kernel/msr.c
+++ b/arch/x86/kernel/msr.c
@@ -174,21 +174,17 @@ static int msr_open(struct inode *inode, struct file *file)
174{ 174{
175 unsigned int cpu = iminor(file->f_path.dentry->d_inode); 175 unsigned int cpu = iminor(file->f_path.dentry->d_inode);
176 struct cpuinfo_x86 *c = &cpu_data(cpu); 176 struct cpuinfo_x86 *c = &cpu_data(cpu);
177 int ret = 0;
178 177
179 lock_kernel();
180 cpu = iminor(file->f_path.dentry->d_inode); 178 cpu = iminor(file->f_path.dentry->d_inode);
181 179
182 if (cpu >= nr_cpu_ids || !cpu_online(cpu)) { 180 if (cpu >= nr_cpu_ids || !cpu_online(cpu))
183 ret = -ENXIO; /* No such CPU */ 181 return -ENXIO; /* No such CPU */
184 goto out; 182
185 }
186 c = &cpu_data(cpu); 183 c = &cpu_data(cpu);
187 if (!cpu_has(c, X86_FEATURE_MSR)) 184 if (!cpu_has(c, X86_FEATURE_MSR))
188 ret = -EIO; /* MSR not supported */ 185 return -EIO; /* MSR not supported */
189out: 186
190 unlock_kernel(); 187 return 0;
191 return ret;
192} 188}
193 189
194/* 190/*
diff --git a/arch/x86/kernel/pci-calgary_64.c b/arch/x86/kernel/pci-calgary_64.c
index 971a3bec47a8..c563e4c8ff39 100644
--- a/arch/x86/kernel/pci-calgary_64.c
+++ b/arch/x86/kernel/pci-calgary_64.c
@@ -46,6 +46,7 @@
46#include <asm/dma.h> 46#include <asm/dma.h>
47#include <asm/rio.h> 47#include <asm/rio.h>
48#include <asm/bios_ebda.h> 48#include <asm/bios_ebda.h>
49#include <asm/x86_init.h>
49 50
50#ifdef CONFIG_CALGARY_IOMMU_ENABLED_BY_DEFAULT 51#ifdef CONFIG_CALGARY_IOMMU_ENABLED_BY_DEFAULT
51int use_calgary __read_mostly = 1; 52int use_calgary __read_mostly = 1;
@@ -244,7 +245,7 @@ static unsigned long iommu_range_alloc(struct device *dev,
244 if (panic_on_overflow) 245 if (panic_on_overflow)
245 panic("Calgary: fix the allocator.\n"); 246 panic("Calgary: fix the allocator.\n");
246 else 247 else
247 return bad_dma_address; 248 return DMA_ERROR_CODE;
248 } 249 }
249 } 250 }
250 251
@@ -260,12 +261,15 @@ static dma_addr_t iommu_alloc(struct device *dev, struct iommu_table *tbl,
260 void *vaddr, unsigned int npages, int direction) 261 void *vaddr, unsigned int npages, int direction)
261{ 262{
262 unsigned long entry; 263 unsigned long entry;
263 dma_addr_t ret = bad_dma_address; 264 dma_addr_t ret;
264 265
265 entry = iommu_range_alloc(dev, tbl, npages); 266 entry = iommu_range_alloc(dev, tbl, npages);
266 267
267 if (unlikely(entry == bad_dma_address)) 268 if (unlikely(entry == DMA_ERROR_CODE)) {
268 goto error; 269 printk(KERN_WARNING "Calgary: failed to allocate %u pages in "
270 "iommu %p\n", npages, tbl);
271 return DMA_ERROR_CODE;
272 }
269 273
270 /* set the return dma address */ 274 /* set the return dma address */
271 ret = (entry << PAGE_SHIFT) | ((unsigned long)vaddr & ~PAGE_MASK); 275 ret = (entry << PAGE_SHIFT) | ((unsigned long)vaddr & ~PAGE_MASK);
@@ -273,13 +277,7 @@ static dma_addr_t iommu_alloc(struct device *dev, struct iommu_table *tbl,
273 /* put the TCEs in the HW table */ 277 /* put the TCEs in the HW table */
274 tce_build(tbl, entry, npages, (unsigned long)vaddr & PAGE_MASK, 278 tce_build(tbl, entry, npages, (unsigned long)vaddr & PAGE_MASK,
275 direction); 279 direction);
276
277 return ret; 280 return ret;
278
279error:
280 printk(KERN_WARNING "Calgary: failed to allocate %u pages in "
281 "iommu %p\n", npages, tbl);
282 return bad_dma_address;
283} 281}
284 282
285static void iommu_free(struct iommu_table *tbl, dma_addr_t dma_addr, 283static void iommu_free(struct iommu_table *tbl, dma_addr_t dma_addr,
@@ -290,8 +288,8 @@ static void iommu_free(struct iommu_table *tbl, dma_addr_t dma_addr,
290 unsigned long flags; 288 unsigned long flags;
291 289
292 /* were we called with bad_dma_address? */ 290 /* were we called with bad_dma_address? */
293 badend = bad_dma_address + (EMERGENCY_PAGES * PAGE_SIZE); 291 badend = DMA_ERROR_CODE + (EMERGENCY_PAGES * PAGE_SIZE);
294 if (unlikely((dma_addr >= bad_dma_address) && (dma_addr < badend))) { 292 if (unlikely((dma_addr >= DMA_ERROR_CODE) && (dma_addr < badend))) {
295 WARN(1, KERN_ERR "Calgary: driver tried unmapping bad DMA " 293 WARN(1, KERN_ERR "Calgary: driver tried unmapping bad DMA "
296 "address 0x%Lx\n", dma_addr); 294 "address 0x%Lx\n", dma_addr);
297 return; 295 return;
@@ -318,13 +316,15 @@ static inline struct iommu_table *find_iommu_table(struct device *dev)
318 316
319 pdev = to_pci_dev(dev); 317 pdev = to_pci_dev(dev);
320 318
319 /* search up the device tree for an iommu */
321 pbus = pdev->bus; 320 pbus = pdev->bus;
322 321 do {
323 /* is the device behind a bridge? Look for the root bus */ 322 tbl = pci_iommu(pbus);
324 while (pbus->parent) 323 if (tbl && tbl->it_busno == pbus->number)
324 break;
325 tbl = NULL;
325 pbus = pbus->parent; 326 pbus = pbus->parent;
326 327 } while (pbus);
327 tbl = pci_iommu(pbus);
328 328
329 BUG_ON(tbl && (tbl->it_busno != pbus->number)); 329 BUG_ON(tbl && (tbl->it_busno != pbus->number));
330 330
@@ -373,7 +373,7 @@ static int calgary_map_sg(struct device *dev, struct scatterlist *sg,
373 npages = iommu_num_pages(vaddr, s->length, PAGE_SIZE); 373 npages = iommu_num_pages(vaddr, s->length, PAGE_SIZE);
374 374
375 entry = iommu_range_alloc(dev, tbl, npages); 375 entry = iommu_range_alloc(dev, tbl, npages);
376 if (entry == bad_dma_address) { 376 if (entry == DMA_ERROR_CODE) {
377 /* makes sure unmap knows to stop */ 377 /* makes sure unmap knows to stop */
378 s->dma_length = 0; 378 s->dma_length = 0;
379 goto error; 379 goto error;
@@ -391,7 +391,7 @@ static int calgary_map_sg(struct device *dev, struct scatterlist *sg,
391error: 391error:
392 calgary_unmap_sg(dev, sg, nelems, dir, NULL); 392 calgary_unmap_sg(dev, sg, nelems, dir, NULL);
393 for_each_sg(sg, s, nelems, i) { 393 for_each_sg(sg, s, nelems, i) {
394 sg->dma_address = bad_dma_address; 394 sg->dma_address = DMA_ERROR_CODE;
395 sg->dma_length = 0; 395 sg->dma_length = 0;
396 } 396 }
397 return 0; 397 return 0;
@@ -446,7 +446,7 @@ static void* calgary_alloc_coherent(struct device *dev, size_t size,
446 446
447 /* set up tces to cover the allocated range */ 447 /* set up tces to cover the allocated range */
448 mapping = iommu_alloc(dev, tbl, ret, npages, DMA_BIDIRECTIONAL); 448 mapping = iommu_alloc(dev, tbl, ret, npages, DMA_BIDIRECTIONAL);
449 if (mapping == bad_dma_address) 449 if (mapping == DMA_ERROR_CODE)
450 goto free; 450 goto free;
451 *dma_handle = mapping; 451 *dma_handle = mapping;
452 return ret; 452 return ret;
@@ -727,7 +727,7 @@ static void __init calgary_reserve_regions(struct pci_dev *dev)
727 struct iommu_table *tbl = pci_iommu(dev->bus); 727 struct iommu_table *tbl = pci_iommu(dev->bus);
728 728
729 /* reserve EMERGENCY_PAGES from bad_dma_address and up */ 729 /* reserve EMERGENCY_PAGES from bad_dma_address and up */
730 iommu_range_reserve(tbl, bad_dma_address, EMERGENCY_PAGES); 730 iommu_range_reserve(tbl, DMA_ERROR_CODE, EMERGENCY_PAGES);
731 731
732 /* avoid the BIOS/VGA first 640KB-1MB region */ 732 /* avoid the BIOS/VGA first 640KB-1MB region */
733 /* for CalIOC2 - avoid the entire first MB */ 733 /* for CalIOC2 - avoid the entire first MB */
@@ -1344,6 +1344,23 @@ static void __init get_tce_space_from_tar(void)
1344 return; 1344 return;
1345} 1345}
1346 1346
1347static int __init calgary_iommu_init(void)
1348{
1349 int ret;
1350
1351 /* ok, we're trying to use Calgary - let's roll */
1352 printk(KERN_INFO "PCI-DMA: Using Calgary IOMMU\n");
1353
1354 ret = calgary_init();
1355 if (ret) {
1356 printk(KERN_ERR "PCI-DMA: Calgary init failed %d, "
1357 "falling back to no_iommu\n", ret);
1358 return ret;
1359 }
1360
1361 return 0;
1362}
1363
1347void __init detect_calgary(void) 1364void __init detect_calgary(void)
1348{ 1365{
1349 int bus; 1366 int bus;
@@ -1357,7 +1374,7 @@ void __init detect_calgary(void)
1357 * if the user specified iommu=off or iommu=soft or we found 1374 * if the user specified iommu=off or iommu=soft or we found
1358 * another HW IOMMU already, bail out. 1375 * another HW IOMMU already, bail out.
1359 */ 1376 */
1360 if (swiotlb || no_iommu || iommu_detected) 1377 if (no_iommu || iommu_detected)
1361 return; 1378 return;
1362 1379
1363 if (!use_calgary) 1380 if (!use_calgary)
@@ -1442,9 +1459,7 @@ void __init detect_calgary(void)
1442 printk(KERN_INFO "PCI-DMA: Calgary TCE table spec is %d\n", 1459 printk(KERN_INFO "PCI-DMA: Calgary TCE table spec is %d\n",
1443 specified_table_size); 1460 specified_table_size);
1444 1461
1445 /* swiotlb for devices that aren't behind the Calgary. */ 1462 x86_init.iommu.iommu_init = calgary_iommu_init;
1446 if (max_pfn > MAX_DMA32_PFN)
1447 swiotlb = 1;
1448 } 1463 }
1449 return; 1464 return;
1450 1465
@@ -1457,35 +1472,6 @@ cleanup:
1457 } 1472 }
1458} 1473}
1459 1474
1460int __init calgary_iommu_init(void)
1461{
1462 int ret;
1463
1464 if (no_iommu || (swiotlb && !calgary_detected))
1465 return -ENODEV;
1466
1467 if (!calgary_detected)
1468 return -ENODEV;
1469
1470 /* ok, we're trying to use Calgary - let's roll */
1471 printk(KERN_INFO "PCI-DMA: Using Calgary IOMMU\n");
1472
1473 ret = calgary_init();
1474 if (ret) {
1475 printk(KERN_ERR "PCI-DMA: Calgary init failed %d, "
1476 "falling back to no_iommu\n", ret);
1477 return ret;
1478 }
1479
1480 force_iommu = 1;
1481 bad_dma_address = 0x0;
1482 /* dma_ops is set to swiotlb or nommu */
1483 if (!dma_ops)
1484 dma_ops = &nommu_dma_ops;
1485
1486 return 0;
1487}
1488
1489static int __init calgary_parse_options(char *p) 1475static int __init calgary_parse_options(char *p)
1490{ 1476{
1491 unsigned int bridge; 1477 unsigned int bridge;
diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c
index a6e804d16c35..afcc58b69c7c 100644
--- a/arch/x86/kernel/pci-dma.c
+++ b/arch/x86/kernel/pci-dma.c
@@ -11,10 +11,11 @@
11#include <asm/gart.h> 11#include <asm/gart.h>
12#include <asm/calgary.h> 12#include <asm/calgary.h>
13#include <asm/amd_iommu.h> 13#include <asm/amd_iommu.h>
14#include <asm/x86_init.h>
14 15
15static int forbid_dac __read_mostly; 16static int forbid_dac __read_mostly;
16 17
17struct dma_map_ops *dma_ops; 18struct dma_map_ops *dma_ops = &nommu_dma_ops;
18EXPORT_SYMBOL(dma_ops); 19EXPORT_SYMBOL(dma_ops);
19 20
20static int iommu_sac_force __read_mostly; 21static int iommu_sac_force __read_mostly;
@@ -42,9 +43,6 @@ int iommu_detected __read_mostly = 0;
42 */ 43 */
43int iommu_pass_through __read_mostly; 44int iommu_pass_through __read_mostly;
44 45
45dma_addr_t bad_dma_address __read_mostly = 0;
46EXPORT_SYMBOL(bad_dma_address);
47
48/* Dummy device used for NULL arguments (normally ISA). */ 46/* Dummy device used for NULL arguments (normally ISA). */
49struct device x86_dma_fallback_dev = { 47struct device x86_dma_fallback_dev = {
50 .init_name = "fallback device", 48 .init_name = "fallback device",
@@ -126,20 +124,17 @@ void __init pci_iommu_alloc(void)
126 /* free the range so iommu could get some range less than 4G */ 124 /* free the range so iommu could get some range less than 4G */
127 dma32_free_bootmem(); 125 dma32_free_bootmem();
128#endif 126#endif
127 if (pci_swiotlb_init())
128 return;
129 129
130 /*
131 * The order of these functions is important for
132 * fall-back/fail-over reasons
133 */
134 gart_iommu_hole_init(); 130 gart_iommu_hole_init();
135 131
136 detect_calgary(); 132 detect_calgary();
137 133
138 detect_intel_iommu(); 134 detect_intel_iommu();
139 135
136 /* needs to be called after gart_iommu_hole_init */
140 amd_iommu_detect(); 137 amd_iommu_detect();
141
142 pci_swiotlb_init();
143} 138}
144 139
145void *dma_generic_alloc_coherent(struct device *dev, size_t size, 140void *dma_generic_alloc_coherent(struct device *dev, size_t size,
@@ -214,7 +209,7 @@ static __init int iommu_setup(char *p)
214 if (!strncmp(p, "allowdac", 8)) 209 if (!strncmp(p, "allowdac", 8))
215 forbid_dac = 0; 210 forbid_dac = 0;
216 if (!strncmp(p, "nodac", 5)) 211 if (!strncmp(p, "nodac", 5))
217 forbid_dac = -1; 212 forbid_dac = 1;
218 if (!strncmp(p, "usedac", 6)) { 213 if (!strncmp(p, "usedac", 6)) {
219 forbid_dac = -1; 214 forbid_dac = -1;
220 return 1; 215 return 1;
@@ -289,25 +284,17 @@ static int __init pci_iommu_init(void)
289#ifdef CONFIG_PCI 284#ifdef CONFIG_PCI
290 dma_debug_add_bus(&pci_bus_type); 285 dma_debug_add_bus(&pci_bus_type);
291#endif 286#endif
287 x86_init.iommu.iommu_init();
292 288
293 calgary_iommu_init(); 289 if (swiotlb) {
294 290 printk(KERN_INFO "PCI-DMA: "
295 intel_iommu_init(); 291 "Using software bounce buffering for IO (SWIOTLB)\n");
292 swiotlb_print_info();
293 } else
294 swiotlb_free();
296 295
297 amd_iommu_init();
298
299 gart_iommu_init();
300
301 no_iommu_init();
302 return 0; 296 return 0;
303} 297}
304
305void pci_iommu_shutdown(void)
306{
307 gart_iommu_shutdown();
308
309 amd_iommu_shutdown();
310}
311/* Must execute after PCI subsystem */ 298/* Must execute after PCI subsystem */
312rootfs_initcall(pci_iommu_init); 299rootfs_initcall(pci_iommu_init);
313 300
diff --git a/arch/x86/kernel/pci-gart_64.c b/arch/x86/kernel/pci-gart_64.c
index a7f1b64f86e0..e6a0d402f171 100644
--- a/arch/x86/kernel/pci-gart_64.c
+++ b/arch/x86/kernel/pci-gart_64.c
@@ -39,6 +39,7 @@
39#include <asm/swiotlb.h> 39#include <asm/swiotlb.h>
40#include <asm/dma.h> 40#include <asm/dma.h>
41#include <asm/k8.h> 41#include <asm/k8.h>
42#include <asm/x86_init.h>
42 43
43static unsigned long iommu_bus_base; /* GART remapping area (physical) */ 44static unsigned long iommu_bus_base; /* GART remapping area (physical) */
44static unsigned long iommu_size; /* size of remapping area bytes */ 45static unsigned long iommu_size; /* size of remapping area bytes */
@@ -46,6 +47,8 @@ static unsigned long iommu_pages; /* .. and in pages */
46 47
47static u32 *iommu_gatt_base; /* Remapping table */ 48static u32 *iommu_gatt_base; /* Remapping table */
48 49
50static dma_addr_t bad_dma_addr;
51
49/* 52/*
50 * If this is disabled the IOMMU will use an optimized flushing strategy 53 * If this is disabled the IOMMU will use an optimized flushing strategy
51 * of only flushing when an mapping is reused. With it true the GART is 54 * of only flushing when an mapping is reused. With it true the GART is
@@ -92,7 +95,7 @@ static unsigned long alloc_iommu(struct device *dev, int size,
92 95
93 base_index = ALIGN(iommu_bus_base & dma_get_seg_boundary(dev), 96 base_index = ALIGN(iommu_bus_base & dma_get_seg_boundary(dev),
94 PAGE_SIZE) >> PAGE_SHIFT; 97 PAGE_SIZE) >> PAGE_SHIFT;
95 boundary_size = ALIGN((unsigned long long)dma_get_seg_boundary(dev) + 1, 98 boundary_size = ALIGN((u64)dma_get_seg_boundary(dev) + 1,
96 PAGE_SIZE) >> PAGE_SHIFT; 99 PAGE_SIZE) >> PAGE_SHIFT;
97 100
98 spin_lock_irqsave(&iommu_bitmap_lock, flags); 101 spin_lock_irqsave(&iommu_bitmap_lock, flags);
@@ -216,7 +219,7 @@ static dma_addr_t dma_map_area(struct device *dev, dma_addr_t phys_mem,
216 if (panic_on_overflow) 219 if (panic_on_overflow)
217 panic("dma_map_area overflow %lu bytes\n", size); 220 panic("dma_map_area overflow %lu bytes\n", size);
218 iommu_full(dev, size, dir); 221 iommu_full(dev, size, dir);
219 return bad_dma_address; 222 return bad_dma_addr;
220 } 223 }
221 224
222 for (i = 0; i < npages; i++) { 225 for (i = 0; i < npages; i++) {
@@ -294,7 +297,7 @@ static int dma_map_sg_nonforce(struct device *dev, struct scatterlist *sg,
294 int i; 297 int i;
295 298
296#ifdef CONFIG_IOMMU_DEBUG 299#ifdef CONFIG_IOMMU_DEBUG
297 printk(KERN_DEBUG "dma_map_sg overflow\n"); 300 pr_debug("dma_map_sg overflow\n");
298#endif 301#endif
299 302
300 for_each_sg(sg, s, nents, i) { 303 for_each_sg(sg, s, nents, i) {
@@ -302,7 +305,7 @@ static int dma_map_sg_nonforce(struct device *dev, struct scatterlist *sg,
302 305
303 if (nonforced_iommu(dev, addr, s->length)) { 306 if (nonforced_iommu(dev, addr, s->length)) {
304 addr = dma_map_area(dev, addr, s->length, dir, 0); 307 addr = dma_map_area(dev, addr, s->length, dir, 0);
305 if (addr == bad_dma_address) { 308 if (addr == bad_dma_addr) {
306 if (i > 0) 309 if (i > 0)
307 gart_unmap_sg(dev, sg, i, dir, NULL); 310 gart_unmap_sg(dev, sg, i, dir, NULL);
308 nents = 0; 311 nents = 0;
@@ -389,12 +392,14 @@ static int gart_map_sg(struct device *dev, struct scatterlist *sg, int nents,
389 if (!dev) 392 if (!dev)
390 dev = &x86_dma_fallback_dev; 393 dev = &x86_dma_fallback_dev;
391 394
392 out = 0; 395 out = 0;
393 start = 0; 396 start = 0;
394 start_sg = sgmap = sg; 397 start_sg = sg;
395 seg_size = 0; 398 sgmap = sg;
396 max_seg_size = dma_get_max_seg_size(dev); 399 seg_size = 0;
397 ps = NULL; /* shut up gcc */ 400 max_seg_size = dma_get_max_seg_size(dev);
401 ps = NULL; /* shut up gcc */
402
398 for_each_sg(sg, s, nents, i) { 403 for_each_sg(sg, s, nents, i) {
399 dma_addr_t addr = sg_phys(s); 404 dma_addr_t addr = sg_phys(s);
400 405
@@ -417,11 +422,12 @@ static int gart_map_sg(struct device *dev, struct scatterlist *sg, int nents,
417 sgmap, pages, need) < 0) 422 sgmap, pages, need) < 0)
418 goto error; 423 goto error;
419 out++; 424 out++;
420 seg_size = 0; 425
421 sgmap = sg_next(sgmap); 426 seg_size = 0;
422 pages = 0; 427 sgmap = sg_next(sgmap);
423 start = i; 428 pages = 0;
424 start_sg = s; 429 start = i;
430 start_sg = s;
425 } 431 }
426 } 432 }
427 433
@@ -455,7 +461,7 @@ error:
455 461
456 iommu_full(dev, pages << PAGE_SHIFT, dir); 462 iommu_full(dev, pages << PAGE_SHIFT, dir);
457 for_each_sg(sg, s, nents, i) 463 for_each_sg(sg, s, nents, i)
458 s->dma_address = bad_dma_address; 464 s->dma_address = bad_dma_addr;
459 return 0; 465 return 0;
460} 466}
461 467
@@ -479,7 +485,7 @@ gart_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_addr,
479 DMA_BIDIRECTIONAL, align_mask); 485 DMA_BIDIRECTIONAL, align_mask);
480 486
481 flush_gart(); 487 flush_gart();
482 if (paddr != bad_dma_address) { 488 if (paddr != bad_dma_addr) {
483 *dma_addr = paddr; 489 *dma_addr = paddr;
484 return page_address(page); 490 return page_address(page);
485 } 491 }
@@ -499,6 +505,11 @@ gart_free_coherent(struct device *dev, size_t size, void *vaddr,
499 free_pages((unsigned long)vaddr, get_order(size)); 505 free_pages((unsigned long)vaddr, get_order(size));
500} 506}
501 507
508static int gart_mapping_error(struct device *dev, dma_addr_t dma_addr)
509{
510 return (dma_addr == bad_dma_addr);
511}
512
502static int no_agp; 513static int no_agp;
503 514
504static __init unsigned long check_iommu_size(unsigned long aper, u64 aper_size) 515static __init unsigned long check_iommu_size(unsigned long aper, u64 aper_size)
@@ -515,7 +526,7 @@ static __init unsigned long check_iommu_size(unsigned long aper, u64 aper_size)
515 iommu_size -= round_up(a, PMD_PAGE_SIZE) - a; 526 iommu_size -= round_up(a, PMD_PAGE_SIZE) - a;
516 527
517 if (iommu_size < 64*1024*1024) { 528 if (iommu_size < 64*1024*1024) {
518 printk(KERN_WARNING 529 pr_warning(
519 "PCI-DMA: Warning: Small IOMMU %luMB." 530 "PCI-DMA: Warning: Small IOMMU %luMB."
520 " Consider increasing the AGP aperture in BIOS\n", 531 " Consider increasing the AGP aperture in BIOS\n",
521 iommu_size >> 20); 532 iommu_size >> 20);
@@ -570,28 +581,32 @@ void set_up_gart_resume(u32 aper_order, u32 aper_alloc)
570 aperture_alloc = aper_alloc; 581 aperture_alloc = aper_alloc;
571} 582}
572 583
573static int gart_resume(struct sys_device *dev) 584static void gart_fixup_northbridges(struct sys_device *dev)
574{ 585{
575 printk(KERN_INFO "PCI-DMA: Resuming GART IOMMU\n"); 586 int i;
576 587
577 if (fix_up_north_bridges) { 588 if (!fix_up_north_bridges)
578 int i; 589 return;
579 590
580 printk(KERN_INFO "PCI-DMA: Restoring GART aperture settings\n"); 591 pr_info("PCI-DMA: Restoring GART aperture settings\n");
581 592
582 for (i = 0; i < num_k8_northbridges; i++) { 593 for (i = 0; i < num_k8_northbridges; i++) {
583 struct pci_dev *dev = k8_northbridges[i]; 594 struct pci_dev *dev = k8_northbridges[i];
584 595
585 /* 596 /*
586 * Don't enable translations just yet. That is the next 597 * Don't enable translations just yet. That is the next
587 * step. Restore the pre-suspend aperture settings. 598 * step. Restore the pre-suspend aperture settings.
588 */ 599 */
589 pci_write_config_dword(dev, AMD64_GARTAPERTURECTL, 600 pci_write_config_dword(dev, AMD64_GARTAPERTURECTL, aperture_order << 1);
590 aperture_order << 1); 601 pci_write_config_dword(dev, AMD64_GARTAPERTUREBASE, aperture_alloc >> 25);
591 pci_write_config_dword(dev, AMD64_GARTAPERTUREBASE,
592 aperture_alloc >> 25);
593 }
594 } 602 }
603}
604
605static int gart_resume(struct sys_device *dev)
606{
607 pr_info("PCI-DMA: Resuming GART IOMMU\n");
608
609 gart_fixup_northbridges(dev);
595 610
596 enable_gart_translations(); 611 enable_gart_translations();
597 612
@@ -604,15 +619,14 @@ static int gart_suspend(struct sys_device *dev, pm_message_t state)
604} 619}
605 620
606static struct sysdev_class gart_sysdev_class = { 621static struct sysdev_class gart_sysdev_class = {
607 .name = "gart", 622 .name = "gart",
608 .suspend = gart_suspend, 623 .suspend = gart_suspend,
609 .resume = gart_resume, 624 .resume = gart_resume,
610 625
611}; 626};
612 627
613static struct sys_device device_gart = { 628static struct sys_device device_gart = {
614 .id = 0, 629 .cls = &gart_sysdev_class,
615 .cls = &gart_sysdev_class,
616}; 630};
617 631
618/* 632/*
@@ -627,7 +641,8 @@ static __init int init_k8_gatt(struct agp_kern_info *info)
627 void *gatt; 641 void *gatt;
628 int i, error; 642 int i, error;
629 643
630 printk(KERN_INFO "PCI-DMA: Disabling AGP.\n"); 644 pr_info("PCI-DMA: Disabling AGP.\n");
645
631 aper_size = aper_base = info->aper_size = 0; 646 aper_size = aper_base = info->aper_size = 0;
632 dev = NULL; 647 dev = NULL;
633 for (i = 0; i < num_k8_northbridges; i++) { 648 for (i = 0; i < num_k8_northbridges; i++) {
@@ -645,6 +660,7 @@ static __init int init_k8_gatt(struct agp_kern_info *info)
645 } 660 }
646 if (!aper_base) 661 if (!aper_base)
647 goto nommu; 662 goto nommu;
663
648 info->aper_base = aper_base; 664 info->aper_base = aper_base;
649 info->aper_size = aper_size >> 20; 665 info->aper_size = aper_size >> 20;
650 666
@@ -667,14 +683,14 @@ static __init int init_k8_gatt(struct agp_kern_info *info)
667 683
668 flush_gart(); 684 flush_gart();
669 685
670 printk(KERN_INFO "PCI-DMA: aperture base @ %x size %u KB\n", 686 pr_info("PCI-DMA: aperture base @ %x size %u KB\n",
671 aper_base, aper_size>>10); 687 aper_base, aper_size>>10);
672 688
673 return 0; 689 return 0;
674 690
675 nommu: 691 nommu:
676 /* Should not happen anymore */ 692 /* Should not happen anymore */
677 printk(KERN_WARNING "PCI-DMA: More than 4GB of RAM and no IOMMU\n" 693 pr_warning("PCI-DMA: More than 4GB of RAM and no IOMMU\n"
678 "falling back to iommu=soft.\n"); 694 "falling back to iommu=soft.\n");
679 return -1; 695 return -1;
680} 696}
@@ -686,14 +702,15 @@ static struct dma_map_ops gart_dma_ops = {
686 .unmap_page = gart_unmap_page, 702 .unmap_page = gart_unmap_page,
687 .alloc_coherent = gart_alloc_coherent, 703 .alloc_coherent = gart_alloc_coherent,
688 .free_coherent = gart_free_coherent, 704 .free_coherent = gart_free_coherent,
705 .mapping_error = gart_mapping_error,
689}; 706};
690 707
691void gart_iommu_shutdown(void) 708static void gart_iommu_shutdown(void)
692{ 709{
693 struct pci_dev *dev; 710 struct pci_dev *dev;
694 int i; 711 int i;
695 712
696 if (no_agp && (dma_ops != &gart_dma_ops)) 713 if (no_agp)
697 return; 714 return;
698 715
699 for (i = 0; i < num_k8_northbridges; i++) { 716 for (i = 0; i < num_k8_northbridges; i++) {
@@ -708,7 +725,7 @@ void gart_iommu_shutdown(void)
708 } 725 }
709} 726}
710 727
711void __init gart_iommu_init(void) 728int __init gart_iommu_init(void)
712{ 729{
713 struct agp_kern_info info; 730 struct agp_kern_info info;
714 unsigned long iommu_start; 731 unsigned long iommu_start;
@@ -718,7 +735,7 @@ void __init gart_iommu_init(void)
718 long i; 735 long i;
719 736
720 if (cache_k8_northbridges() < 0 || num_k8_northbridges == 0) 737 if (cache_k8_northbridges() < 0 || num_k8_northbridges == 0)
721 return; 738 return 0;
722 739
723#ifndef CONFIG_AGP_AMD64 740#ifndef CONFIG_AGP_AMD64
724 no_agp = 1; 741 no_agp = 1;
@@ -730,35 +747,28 @@ void __init gart_iommu_init(void)
730 (agp_copy_info(agp_bridge, &info) < 0); 747 (agp_copy_info(agp_bridge, &info) < 0);
731#endif 748#endif
732 749
733 if (swiotlb)
734 return;
735
736 /* Did we detect a different HW IOMMU? */
737 if (iommu_detected && !gart_iommu_aperture)
738 return;
739
740 if (no_iommu || 750 if (no_iommu ||
741 (!force_iommu && max_pfn <= MAX_DMA32_PFN) || 751 (!force_iommu && max_pfn <= MAX_DMA32_PFN) ||
742 !gart_iommu_aperture || 752 !gart_iommu_aperture ||
743 (no_agp && init_k8_gatt(&info) < 0)) { 753 (no_agp && init_k8_gatt(&info) < 0)) {
744 if (max_pfn > MAX_DMA32_PFN) { 754 if (max_pfn > MAX_DMA32_PFN) {
745 printk(KERN_WARNING "More than 4GB of memory " 755 pr_warning("More than 4GB of memory but GART IOMMU not available.\n");
746 "but GART IOMMU not available.\n"); 756 pr_warning("falling back to iommu=soft.\n");
747 printk(KERN_WARNING "falling back to iommu=soft.\n");
748 } 757 }
749 return; 758 return 0;
750 } 759 }
751 760
752 /* need to map that range */ 761 /* need to map that range */
753 aper_size = info.aper_size << 20; 762 aper_size = info.aper_size << 20;
754 aper_base = info.aper_base; 763 aper_base = info.aper_base;
755 end_pfn = (aper_base>>PAGE_SHIFT) + (aper_size>>PAGE_SHIFT); 764 end_pfn = (aper_base>>PAGE_SHIFT) + (aper_size>>PAGE_SHIFT);
765
756 if (end_pfn > max_low_pfn_mapped) { 766 if (end_pfn > max_low_pfn_mapped) {
757 start_pfn = (aper_base>>PAGE_SHIFT); 767 start_pfn = (aper_base>>PAGE_SHIFT);
758 init_memory_mapping(start_pfn<<PAGE_SHIFT, end_pfn<<PAGE_SHIFT); 768 init_memory_mapping(start_pfn<<PAGE_SHIFT, end_pfn<<PAGE_SHIFT);
759 } 769 }
760 770
761 printk(KERN_INFO "PCI-DMA: using GART IOMMU.\n"); 771 pr_info("PCI-DMA: using GART IOMMU.\n");
762 iommu_size = check_iommu_size(info.aper_base, aper_size); 772 iommu_size = check_iommu_size(info.aper_base, aper_size);
763 iommu_pages = iommu_size >> PAGE_SHIFT; 773 iommu_pages = iommu_size >> PAGE_SHIFT;
764 774
@@ -773,8 +783,7 @@ void __init gart_iommu_init(void)
773 783
774 ret = dma_debug_resize_entries(iommu_pages); 784 ret = dma_debug_resize_entries(iommu_pages);
775 if (ret) 785 if (ret)
776 printk(KERN_DEBUG 786 pr_debug("PCI-DMA: Cannot trace all the entries\n");
777 "PCI-DMA: Cannot trace all the entries\n");
778 } 787 }
779#endif 788#endif
780 789
@@ -784,15 +793,14 @@ void __init gart_iommu_init(void)
784 */ 793 */
785 iommu_area_reserve(iommu_gart_bitmap, 0, EMERGENCY_PAGES); 794 iommu_area_reserve(iommu_gart_bitmap, 0, EMERGENCY_PAGES);
786 795
787 agp_memory_reserved = iommu_size; 796 pr_info("PCI-DMA: Reserving %luMB of IOMMU area in the AGP aperture\n",
788 printk(KERN_INFO
789 "PCI-DMA: Reserving %luMB of IOMMU area in the AGP aperture\n",
790 iommu_size >> 20); 797 iommu_size >> 20);
791 798
792 iommu_start = aper_size - iommu_size; 799 agp_memory_reserved = iommu_size;
793 iommu_bus_base = info.aper_base + iommu_start; 800 iommu_start = aper_size - iommu_size;
794 bad_dma_address = iommu_bus_base; 801 iommu_bus_base = info.aper_base + iommu_start;
795 iommu_gatt_base = agp_gatt_table + (iommu_start>>PAGE_SHIFT); 802 bad_dma_addr = iommu_bus_base;
803 iommu_gatt_base = agp_gatt_table + (iommu_start>>PAGE_SHIFT);
796 804
797 /* 805 /*
798 * Unmap the IOMMU part of the GART. The alias of the page is 806 * Unmap the IOMMU part of the GART. The alias of the page is
@@ -814,7 +822,7 @@ void __init gart_iommu_init(void)
814 * the pages as Not-Present: 822 * the pages as Not-Present:
815 */ 823 */
816 wbinvd(); 824 wbinvd();
817 825
818 /* 826 /*
819 * Now all caches are flushed and we can safely enable 827 * Now all caches are flushed and we can safely enable
820 * GART hardware. Doing it early leaves the possibility 828 * GART hardware. Doing it early leaves the possibility
@@ -838,6 +846,10 @@ void __init gart_iommu_init(void)
838 846
839 flush_gart(); 847 flush_gart();
840 dma_ops = &gart_dma_ops; 848 dma_ops = &gart_dma_ops;
849 x86_platform.iommu_shutdown = gart_iommu_shutdown;
850 swiotlb = 0;
851
852 return 0;
841} 853}
842 854
843void __init gart_parse_options(char *p) 855void __init gart_parse_options(char *p)
@@ -856,7 +868,7 @@ void __init gart_parse_options(char *p)
856#endif 868#endif
857 if (isdigit(*p) && get_option(&p, &arg)) 869 if (isdigit(*p) && get_option(&p, &arg))
858 iommu_size = arg; 870 iommu_size = arg;
859 if (!strncmp(p, "fullflush", 8)) 871 if (!strncmp(p, "fullflush", 9))
860 iommu_fullflush = 1; 872 iommu_fullflush = 1;
861 if (!strncmp(p, "nofullflush", 11)) 873 if (!strncmp(p, "nofullflush", 11))
862 iommu_fullflush = 0; 874 iommu_fullflush = 0;
diff --git a/arch/x86/kernel/pci-nommu.c b/arch/x86/kernel/pci-nommu.c
index a3933d4330cd..22be12b60a8f 100644
--- a/arch/x86/kernel/pci-nommu.c
+++ b/arch/x86/kernel/pci-nommu.c
@@ -33,7 +33,7 @@ static dma_addr_t nommu_map_page(struct device *dev, struct page *page,
33 dma_addr_t bus = page_to_phys(page) + offset; 33 dma_addr_t bus = page_to_phys(page) + offset;
34 WARN_ON(size == 0); 34 WARN_ON(size == 0);
35 if (!check_addr("map_single", dev, bus, size)) 35 if (!check_addr("map_single", dev, bus, size))
36 return bad_dma_address; 36 return DMA_ERROR_CODE;
37 flush_write_buffers(); 37 flush_write_buffers();
38 return bus; 38 return bus;
39} 39}
@@ -103,12 +103,3 @@ struct dma_map_ops nommu_dma_ops = {
103 .sync_sg_for_device = nommu_sync_sg_for_device, 103 .sync_sg_for_device = nommu_sync_sg_for_device,
104 .is_phys = 1, 104 .is_phys = 1,
105}; 105};
106
107void __init no_iommu_init(void)
108{
109 if (dma_ops)
110 return;
111
112 force_iommu = 0; /* no HW IOMMU */
113 dma_ops = &nommu_dma_ops;
114}
diff --git a/arch/x86/kernel/pci-swiotlb.c b/arch/x86/kernel/pci-swiotlb.c
index aaa6b7839f1e..e3c0a66b9e77 100644
--- a/arch/x86/kernel/pci-swiotlb.c
+++ b/arch/x86/kernel/pci-swiotlb.c
@@ -42,18 +42,28 @@ static struct dma_map_ops swiotlb_dma_ops = {
42 .dma_supported = NULL, 42 .dma_supported = NULL,
43}; 43};
44 44
45void __init pci_swiotlb_init(void) 45/*
46 * pci_swiotlb_init - initialize swiotlb if necessary
47 *
48 * This returns non-zero if we are forced to use swiotlb (by the boot
49 * option).
50 */
51int __init pci_swiotlb_init(void)
46{ 52{
53 int use_swiotlb = swiotlb | swiotlb_force;
54
47 /* don't initialize swiotlb if iommu=off (no_iommu=1) */ 55 /* don't initialize swiotlb if iommu=off (no_iommu=1) */
48#ifdef CONFIG_X86_64 56#ifdef CONFIG_X86_64
49 if ((!iommu_detected && !no_iommu && max_pfn > MAX_DMA32_PFN)) 57 if (!no_iommu && max_pfn > MAX_DMA32_PFN)
50 swiotlb = 1; 58 swiotlb = 1;
51#endif 59#endif
52 if (swiotlb_force) 60 if (swiotlb_force)
53 swiotlb = 1; 61 swiotlb = 1;
62
54 if (swiotlb) { 63 if (swiotlb) {
55 printk(KERN_INFO "PCI-DMA: Using software bounce buffering for IO (SWIOTLB)\n"); 64 swiotlb_init(0);
56 swiotlb_init();
57 dma_ops = &swiotlb_dma_ops; 65 dma_ops = &swiotlb_dma_ops;
58 } 66 }
67
68 return use_swiotlb;
59} 69}
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
index 5284cd2b5776..5e2ba634ea15 100644
--- a/arch/x86/kernel/process.c
+++ b/arch/x86/kernel/process.c
@@ -9,7 +9,9 @@
9#include <linux/pm.h> 9#include <linux/pm.h>
10#include <linux/clockchips.h> 10#include <linux/clockchips.h>
11#include <linux/random.h> 11#include <linux/random.h>
12#include <linux/user-return-notifier.h>
12#include <trace/events/power.h> 13#include <trace/events/power.h>
14#include <linux/hw_breakpoint.h>
13#include <asm/system.h> 15#include <asm/system.h>
14#include <asm/apic.h> 16#include <asm/apic.h>
15#include <asm/syscalls.h> 17#include <asm/syscalls.h>
@@ -17,6 +19,7 @@
17#include <asm/uaccess.h> 19#include <asm/uaccess.h>
18#include <asm/i387.h> 20#include <asm/i387.h>
19#include <asm/ds.h> 21#include <asm/ds.h>
22#include <asm/debugreg.h>
20 23
21unsigned long idle_halt; 24unsigned long idle_halt;
22EXPORT_SYMBOL(idle_halt); 25EXPORT_SYMBOL(idle_halt);
@@ -103,14 +106,7 @@ void flush_thread(void)
103 } 106 }
104#endif 107#endif
105 108
106 clear_tsk_thread_flag(tsk, TIF_DEBUG); 109 flush_ptrace_hw_breakpoint(tsk);
107
108 tsk->thread.debugreg0 = 0;
109 tsk->thread.debugreg1 = 0;
110 tsk->thread.debugreg2 = 0;
111 tsk->thread.debugreg3 = 0;
112 tsk->thread.debugreg6 = 0;
113 tsk->thread.debugreg7 = 0;
114 memset(tsk->thread.tls_array, 0, sizeof(tsk->thread.tls_array)); 110 memset(tsk->thread.tls_array, 0, sizeof(tsk->thread.tls_array));
115 /* 111 /*
116 * Forget coprocessor state.. 112 * Forget coprocessor state..
@@ -192,16 +188,6 @@ void __switch_to_xtra(struct task_struct *prev_p, struct task_struct *next_p,
192 else if (next->debugctlmsr != prev->debugctlmsr) 188 else if (next->debugctlmsr != prev->debugctlmsr)
193 update_debugctlmsr(next->debugctlmsr); 189 update_debugctlmsr(next->debugctlmsr);
194 190
195 if (test_tsk_thread_flag(next_p, TIF_DEBUG)) {
196 set_debugreg(next->debugreg0, 0);
197 set_debugreg(next->debugreg1, 1);
198 set_debugreg(next->debugreg2, 2);
199 set_debugreg(next->debugreg3, 3);
200 /* no 4 and 5 */
201 set_debugreg(next->debugreg6, 6);
202 set_debugreg(next->debugreg7, 7);
203 }
204
205 if (test_tsk_thread_flag(prev_p, TIF_NOTSC) ^ 191 if (test_tsk_thread_flag(prev_p, TIF_NOTSC) ^
206 test_tsk_thread_flag(next_p, TIF_NOTSC)) { 192 test_tsk_thread_flag(next_p, TIF_NOTSC)) {
207 /* prev and next are different */ 193 /* prev and next are different */
@@ -224,6 +210,7 @@ void __switch_to_xtra(struct task_struct *prev_p, struct task_struct *next_p,
224 */ 210 */
225 memset(tss->io_bitmap, 0xff, prev->io_bitmap_max); 211 memset(tss->io_bitmap, 0xff, prev->io_bitmap_max);
226 } 212 }
213 propagate_user_return_notify(prev_p, next_p);
227} 214}
228 215
229int sys_fork(struct pt_regs *regs) 216int sys_fork(struct pt_regs *regs)
diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
index 4cf79567cdab..075580b35682 100644
--- a/arch/x86/kernel/process_32.c
+++ b/arch/x86/kernel/process_32.c
@@ -58,6 +58,7 @@
58#include <asm/idle.h> 58#include <asm/idle.h>
59#include <asm/syscalls.h> 59#include <asm/syscalls.h>
60#include <asm/ds.h> 60#include <asm/ds.h>
61#include <asm/debugreg.h>
61 62
62asmlinkage void ret_from_fork(void) __asm__("ret_from_fork"); 63asmlinkage void ret_from_fork(void) __asm__("ret_from_fork");
63 64
@@ -134,7 +135,7 @@ void __show_regs(struct pt_regs *regs, int all)
134 ss = regs->ss & 0xffff; 135 ss = regs->ss & 0xffff;
135 gs = get_user_gs(regs); 136 gs = get_user_gs(regs);
136 } else { 137 } else {
137 sp = (unsigned long) (&regs->sp); 138 sp = kernel_stack_pointer(regs);
138 savesegment(ss, ss); 139 savesegment(ss, ss);
139 savesegment(gs, gs); 140 savesegment(gs, gs);
140 } 141 }
@@ -187,7 +188,7 @@ void __show_regs(struct pt_regs *regs, int all)
187 188
188void show_regs(struct pt_regs *regs) 189void show_regs(struct pt_regs *regs)
189{ 190{
190 __show_regs(regs, 1); 191 show_registers(regs);
191 show_trace(NULL, regs, &regs->sp, regs->bp); 192 show_trace(NULL, regs, &regs->sp, regs->bp);
192} 193}
193 194
@@ -259,7 +260,12 @@ int copy_thread(unsigned long clone_flags, unsigned long sp,
259 260
260 task_user_gs(p) = get_user_gs(regs); 261 task_user_gs(p) = get_user_gs(regs);
261 262
263 p->thread.io_bitmap_ptr = NULL;
262 tsk = current; 264 tsk = current;
265 err = -ENOMEM;
266
267 memset(p->thread.ptrace_bps, 0, sizeof(p->thread.ptrace_bps));
268
263 if (unlikely(test_tsk_thread_flag(tsk, TIF_IO_BITMAP))) { 269 if (unlikely(test_tsk_thread_flag(tsk, TIF_IO_BITMAP))) {
264 p->thread.io_bitmap_ptr = kmemdup(tsk->thread.io_bitmap_ptr, 270 p->thread.io_bitmap_ptr = kmemdup(tsk->thread.io_bitmap_ptr,
265 IO_BITMAP_BYTES, GFP_KERNEL); 271 IO_BITMAP_BYTES, GFP_KERNEL);
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index eb62cbcaa490..c95c8f4e790a 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -52,6 +52,7 @@
52#include <asm/idle.h> 52#include <asm/idle.h>
53#include <asm/syscalls.h> 53#include <asm/syscalls.h>
54#include <asm/ds.h> 54#include <asm/ds.h>
55#include <asm/debugreg.h>
55 56
56asmlinkage extern void ret_from_fork(void); 57asmlinkage extern void ret_from_fork(void);
57 58
@@ -226,8 +227,7 @@ void __show_regs(struct pt_regs *regs, int all)
226 227
227void show_regs(struct pt_regs *regs) 228void show_regs(struct pt_regs *regs)
228{ 229{
229 printk(KERN_INFO "CPU %d:", smp_processor_id()); 230 show_registers(regs);
230 __show_regs(regs, 1);
231 show_trace(NULL, regs, (void *)(regs + 1), regs->bp); 231 show_trace(NULL, regs, (void *)(regs + 1), regs->bp);
232} 232}
233 233
@@ -297,12 +297,16 @@ int copy_thread(unsigned long clone_flags, unsigned long sp,
297 297
298 p->thread.fs = me->thread.fs; 298 p->thread.fs = me->thread.fs;
299 p->thread.gs = me->thread.gs; 299 p->thread.gs = me->thread.gs;
300 p->thread.io_bitmap_ptr = NULL;
300 301
301 savesegment(gs, p->thread.gsindex); 302 savesegment(gs, p->thread.gsindex);
302 savesegment(fs, p->thread.fsindex); 303 savesegment(fs, p->thread.fsindex);
303 savesegment(es, p->thread.es); 304 savesegment(es, p->thread.es);
304 savesegment(ds, p->thread.ds); 305 savesegment(ds, p->thread.ds);
305 306
307 err = -ENOMEM;
308 memset(p->thread.ptrace_bps, 0, sizeof(p->thread.ptrace_bps));
309
306 if (unlikely(test_tsk_thread_flag(me, TIF_IO_BITMAP))) { 310 if (unlikely(test_tsk_thread_flag(me, TIF_IO_BITMAP))) {
307 p->thread.io_bitmap_ptr = kmalloc(IO_BITMAP_BYTES, GFP_KERNEL); 311 p->thread.io_bitmap_ptr = kmalloc(IO_BITMAP_BYTES, GFP_KERNEL);
308 if (!p->thread.io_bitmap_ptr) { 312 if (!p->thread.io_bitmap_ptr) {
@@ -341,29 +345,46 @@ out:
341 kfree(p->thread.io_bitmap_ptr); 345 kfree(p->thread.io_bitmap_ptr);
342 p->thread.io_bitmap_max = 0; 346 p->thread.io_bitmap_max = 0;
343 } 347 }
348
344 return err; 349 return err;
345} 350}
346 351
347void 352static void
348start_thread(struct pt_regs *regs, unsigned long new_ip, unsigned long new_sp) 353start_thread_common(struct pt_regs *regs, unsigned long new_ip,
354 unsigned long new_sp,
355 unsigned int _cs, unsigned int _ss, unsigned int _ds)
349{ 356{
350 loadsegment(fs, 0); 357 loadsegment(fs, 0);
351 loadsegment(es, 0); 358 loadsegment(es, _ds);
352 loadsegment(ds, 0); 359 loadsegment(ds, _ds);
353 load_gs_index(0); 360 load_gs_index(0);
354 regs->ip = new_ip; 361 regs->ip = new_ip;
355 regs->sp = new_sp; 362 regs->sp = new_sp;
356 percpu_write(old_rsp, new_sp); 363 percpu_write(old_rsp, new_sp);
357 regs->cs = __USER_CS; 364 regs->cs = _cs;
358 regs->ss = __USER_DS; 365 regs->ss = _ss;
359 regs->flags = 0x200; 366 regs->flags = X86_EFLAGS_IF;
360 set_fs(USER_DS); 367 set_fs(USER_DS);
361 /* 368 /*
362 * Free the old FP and other extended state 369 * Free the old FP and other extended state
363 */ 370 */
364 free_thread_xstate(current); 371 free_thread_xstate(current);
365} 372}
366EXPORT_SYMBOL_GPL(start_thread); 373
374void
375start_thread(struct pt_regs *regs, unsigned long new_ip, unsigned long new_sp)
376{
377 start_thread_common(regs, new_ip, new_sp,
378 __USER_CS, __USER_DS, 0);
379}
380
381#ifdef CONFIG_IA32_EMULATION
382void start_thread_ia32(struct pt_regs *regs, u32 new_ip, u32 new_sp)
383{
384 start_thread_common(regs, new_ip, new_sp,
385 __USER32_CS, __USER32_DS, __USER32_DS);
386}
387#endif
367 388
368/* 389/*
369 * switch_to(x,y) should switch tasks from x to y. 390 * switch_to(x,y) should switch tasks from x to y.
@@ -495,6 +516,7 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
495 */ 516 */
496 if (preload_fpu) 517 if (preload_fpu)
497 __math_state_restore(); 518 __math_state_restore();
519
498 return prev_p; 520 return prev_p;
499} 521}
500 522
diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c
index 7b058a2dc66a..04d182a7cfdb 100644
--- a/arch/x86/kernel/ptrace.c
+++ b/arch/x86/kernel/ptrace.c
@@ -22,6 +22,8 @@
22#include <linux/seccomp.h> 22#include <linux/seccomp.h>
23#include <linux/signal.h> 23#include <linux/signal.h>
24#include <linux/workqueue.h> 24#include <linux/workqueue.h>
25#include <linux/perf_event.h>
26#include <linux/hw_breakpoint.h>
25 27
26#include <asm/uaccess.h> 28#include <asm/uaccess.h>
27#include <asm/pgtable.h> 29#include <asm/pgtable.h>
@@ -34,6 +36,7 @@
34#include <asm/prctl.h> 36#include <asm/prctl.h>
35#include <asm/proto.h> 37#include <asm/proto.h>
36#include <asm/ds.h> 38#include <asm/ds.h>
39#include <asm/hw_breakpoint.h>
37 40
38#include "tls.h" 41#include "tls.h"
39 42
@@ -49,6 +52,118 @@ enum x86_regset {
49 REGSET_IOPERM32, 52 REGSET_IOPERM32,
50}; 53};
51 54
55struct pt_regs_offset {
56 const char *name;
57 int offset;
58};
59
60#define REG_OFFSET_NAME(r) {.name = #r, .offset = offsetof(struct pt_regs, r)}
61#define REG_OFFSET_END {.name = NULL, .offset = 0}
62
63static const struct pt_regs_offset regoffset_table[] = {
64#ifdef CONFIG_X86_64
65 REG_OFFSET_NAME(r15),
66 REG_OFFSET_NAME(r14),
67 REG_OFFSET_NAME(r13),
68 REG_OFFSET_NAME(r12),
69 REG_OFFSET_NAME(r11),
70 REG_OFFSET_NAME(r10),
71 REG_OFFSET_NAME(r9),
72 REG_OFFSET_NAME(r8),
73#endif
74 REG_OFFSET_NAME(bx),
75 REG_OFFSET_NAME(cx),
76 REG_OFFSET_NAME(dx),
77 REG_OFFSET_NAME(si),
78 REG_OFFSET_NAME(di),
79 REG_OFFSET_NAME(bp),
80 REG_OFFSET_NAME(ax),
81#ifdef CONFIG_X86_32
82 REG_OFFSET_NAME(ds),
83 REG_OFFSET_NAME(es),
84 REG_OFFSET_NAME(fs),
85 REG_OFFSET_NAME(gs),
86#endif
87 REG_OFFSET_NAME(orig_ax),
88 REG_OFFSET_NAME(ip),
89 REG_OFFSET_NAME(cs),
90 REG_OFFSET_NAME(flags),
91 REG_OFFSET_NAME(sp),
92 REG_OFFSET_NAME(ss),
93 REG_OFFSET_END,
94};
95
96/**
97 * regs_query_register_offset() - query register offset from its name
98 * @name: the name of a register
99 *
100 * regs_query_register_offset() returns the offset of a register in struct
101 * pt_regs from its name. If the name is invalid, this returns -EINVAL;
102 */
103int regs_query_register_offset(const char *name)
104{
105 const struct pt_regs_offset *roff;
106 for (roff = regoffset_table; roff->name != NULL; roff++)
107 if (!strcmp(roff->name, name))
108 return roff->offset;
109 return -EINVAL;
110}
111
112/**
113 * regs_query_register_name() - query register name from its offset
114 * @offset: the offset of a register in struct pt_regs.
115 *
116 * regs_query_register_name() returns the name of a register from its
117 * offset in struct pt_regs. If the @offset is invalid, this returns NULL;
118 */
119const char *regs_query_register_name(unsigned int offset)
120{
121 const struct pt_regs_offset *roff;
122 for (roff = regoffset_table; roff->name != NULL; roff++)
123 if (roff->offset == offset)
124 return roff->name;
125 return NULL;
126}
127
128static const int arg_offs_table[] = {
129#ifdef CONFIG_X86_32
130 [0] = offsetof(struct pt_regs, ax),
131 [1] = offsetof(struct pt_regs, dx),
132 [2] = offsetof(struct pt_regs, cx)
133#else /* CONFIG_X86_64 */
134 [0] = offsetof(struct pt_regs, di),
135 [1] = offsetof(struct pt_regs, si),
136 [2] = offsetof(struct pt_regs, dx),
137 [3] = offsetof(struct pt_regs, cx),
138 [4] = offsetof(struct pt_regs, r8),
139 [5] = offsetof(struct pt_regs, r9)
140#endif
141};
142
143/**
144 * regs_get_argument_nth() - get Nth argument at function call
145 * @regs: pt_regs which contains registers at function entry.
146 * @n: argument number.
147 *
148 * regs_get_argument_nth() returns @n th argument of a function call.
149 * Since usually the kernel stack will be changed right after function entry,
150 * you must use this at function entry. If the @n th entry is NOT in the
151 * kernel stack or pt_regs, this returns 0.
152 */
153unsigned long regs_get_argument_nth(struct pt_regs *regs, unsigned int n)
154{
155 if (n < ARRAY_SIZE(arg_offs_table))
156 return *(unsigned long *)((char *)regs + arg_offs_table[n]);
157 else {
158 /*
159 * The typical case: arg n is on the stack.
160 * (Note: stack[0] = return address, so skip it)
161 */
162 n -= ARRAY_SIZE(arg_offs_table);
163 return regs_get_kernel_stack_nth(regs, 1 + n);
164 }
165}
166
52/* 167/*
53 * does not yet catch signals sent when the child dies. 168 * does not yet catch signals sent when the child dies.
54 * in exit.c or in signal.c. 169 * in exit.c or in signal.c.
@@ -137,11 +252,6 @@ static int set_segment_reg(struct task_struct *task,
137 return 0; 252 return 0;
138} 253}
139 254
140static unsigned long debugreg_addr_limit(struct task_struct *task)
141{
142 return TASK_SIZE - 3;
143}
144
145#else /* CONFIG_X86_64 */ 255#else /* CONFIG_X86_64 */
146 256
147#define FLAG_MASK (FLAG_MASK_32 | X86_EFLAGS_NT) 257#define FLAG_MASK (FLAG_MASK_32 | X86_EFLAGS_NT)
@@ -266,15 +376,6 @@ static int set_segment_reg(struct task_struct *task,
266 return 0; 376 return 0;
267} 377}
268 378
269static unsigned long debugreg_addr_limit(struct task_struct *task)
270{
271#ifdef CONFIG_IA32_EMULATION
272 if (test_tsk_thread_flag(task, TIF_IA32))
273 return IA32_PAGE_OFFSET - 3;
274#endif
275 return TASK_SIZE_MAX - 7;
276}
277
278#endif /* CONFIG_X86_32 */ 379#endif /* CONFIG_X86_32 */
279 380
280static unsigned long get_flags(struct task_struct *task) 381static unsigned long get_flags(struct task_struct *task)
@@ -454,99 +555,239 @@ static int genregs_set(struct task_struct *target,
454 return ret; 555 return ret;
455} 556}
456 557
558static void ptrace_triggered(struct perf_event *bp, void *data)
559{
560 int i;
561 struct thread_struct *thread = &(current->thread);
562
563 /*
564 * Store in the virtual DR6 register the fact that the breakpoint
565 * was hit so the thread's debugger will see it.
566 */
567 for (i = 0; i < HBP_NUM; i++) {
568 if (thread->ptrace_bps[i] == bp)
569 break;
570 }
571
572 thread->debugreg6 |= (DR_TRAP0 << i);
573}
574
457/* 575/*
458 * This function is trivial and will be inlined by the compiler. 576 * Walk through every ptrace breakpoints for this thread and
459 * Having it separates the implementation details of debug 577 * build the dr7 value on top of their attributes.
460 * registers from the interface details of ptrace. 578 *
461 */ 579 */
462static unsigned long ptrace_get_debugreg(struct task_struct *child, int n) 580static unsigned long ptrace_get_dr7(struct perf_event *bp[])
463{ 581{
464 switch (n) { 582 int i;
465 case 0: return child->thread.debugreg0; 583 int dr7 = 0;
466 case 1: return child->thread.debugreg1; 584 struct arch_hw_breakpoint *info;
467 case 2: return child->thread.debugreg2; 585
468 case 3: return child->thread.debugreg3; 586 for (i = 0; i < HBP_NUM; i++) {
469 case 6: return child->thread.debugreg6; 587 if (bp[i] && !bp[i]->attr.disabled) {
470 case 7: return child->thread.debugreg7; 588 info = counter_arch_bp(bp[i]);
589 dr7 |= encode_dr7(i, info->len, info->type);
590 }
471 } 591 }
472 return 0; 592
593 return dr7;
473} 594}
474 595
475static int ptrace_set_debugreg(struct task_struct *child, 596static struct perf_event *
476 int n, unsigned long data) 597ptrace_modify_breakpoint(struct perf_event *bp, int len, int type,
598 struct task_struct *tsk, int disabled)
477{ 599{
478 int i; 600 int err;
601 int gen_len, gen_type;
602 DEFINE_BREAKPOINT_ATTR(attr);
479 603
480 if (unlikely(n == 4 || n == 5)) 604 /*
481 return -EIO; 605 * We shoud have at least an inactive breakpoint at this
606 * slot. It means the user is writing dr7 without having
607 * written the address register first
608 */
609 if (!bp)
610 return ERR_PTR(-EINVAL);
482 611
483 if (n < 4 && unlikely(data >= debugreg_addr_limit(child))) 612 err = arch_bp_generic_fields(len, type, &gen_len, &gen_type);
484 return -EIO; 613 if (err)
614 return ERR_PTR(err);
485 615
486 switch (n) { 616 attr = bp->attr;
487 case 0: child->thread.debugreg0 = data; break; 617 attr.bp_len = gen_len;
488 case 1: child->thread.debugreg1 = data; break; 618 attr.bp_type = gen_type;
489 case 2: child->thread.debugreg2 = data; break; 619 attr.disabled = disabled;
490 case 3: child->thread.debugreg3 = data; break;
491 620
492 case 6: 621 return modify_user_hw_breakpoint(bp, &attr, bp->callback, tsk);
493 if ((data & ~0xffffffffUL) != 0) 622}
494 return -EIO; 623
495 child->thread.debugreg6 = data; 624/*
496 break; 625 * Handle ptrace writes to debug register 7.
626 */
627static int ptrace_write_dr7(struct task_struct *tsk, unsigned long data)
628{
629 struct thread_struct *thread = &(tsk->thread);
630 unsigned long old_dr7;
631 int i, orig_ret = 0, rc = 0;
632 int enabled, second_pass = 0;
633 unsigned len, type;
634 struct perf_event *bp;
635
636 data &= ~DR_CONTROL_RESERVED;
637 old_dr7 = ptrace_get_dr7(thread->ptrace_bps);
638restore:
639 /*
640 * Loop through all the hardware breakpoints, making the
641 * appropriate changes to each.
642 */
643 for (i = 0; i < HBP_NUM; i++) {
644 enabled = decode_dr7(data, i, &len, &type);
645 bp = thread->ptrace_bps[i];
646
647 if (!enabled) {
648 if (bp) {
649 /*
650 * Don't unregister the breakpoints right-away,
651 * unless all register_user_hw_breakpoint()
652 * requests have succeeded. This prevents
653 * any window of opportunity for debug
654 * register grabbing by other users.
655 */
656 if (!second_pass)
657 continue;
658
659 thread->ptrace_bps[i] = NULL;
660 bp = ptrace_modify_breakpoint(bp, len, type,
661 tsk, 1);
662 if (IS_ERR(bp)) {
663 rc = PTR_ERR(bp);
664 thread->ptrace_bps[i] = NULL;
665 break;
666 }
667 thread->ptrace_bps[i] = bp;
668 }
669 continue;
670 }
671
672 bp = ptrace_modify_breakpoint(bp, len, type, tsk, 0);
673
674 /* Incorrect bp, or we have a bug in bp API */
675 if (IS_ERR(bp)) {
676 rc = PTR_ERR(bp);
677 thread->ptrace_bps[i] = NULL;
678 break;
679 }
680 thread->ptrace_bps[i] = bp;
681 }
682 /*
683 * Make a second pass to free the remaining unused breakpoints
684 * or to restore the original breakpoints if an error occurred.
685 */
686 if (!second_pass) {
687 second_pass = 1;
688 if (rc < 0) {
689 orig_ret = rc;
690 data = old_dr7;
691 }
692 goto restore;
693 }
694 return ((orig_ret < 0) ? orig_ret : rc);
695}
696
697/*
698 * Handle PTRACE_PEEKUSR calls for the debug register area.
699 */
700static unsigned long ptrace_get_debugreg(struct task_struct *tsk, int n)
701{
702 struct thread_struct *thread = &(tsk->thread);
703 unsigned long val = 0;
497 704
498 case 7: 705 if (n < HBP_NUM) {
706 struct perf_event *bp;
707 bp = thread->ptrace_bps[n];
708 if (!bp)
709 return 0;
710 val = bp->hw.info.address;
711 } else if (n == 6) {
712 val = thread->debugreg6;
713 } else if (n == 7) {
714 val = ptrace_get_dr7(thread->ptrace_bps);
715 }
716 return val;
717}
718
719static int ptrace_set_breakpoint_addr(struct task_struct *tsk, int nr,
720 unsigned long addr)
721{
722 struct perf_event *bp;
723 struct thread_struct *t = &tsk->thread;
724 DEFINE_BREAKPOINT_ATTR(attr);
725
726 if (!t->ptrace_bps[nr]) {
499 /* 727 /*
500 * Sanity-check data. Take one half-byte at once with 728 * Put stub len and type to register (reserve) an inactive but
501 * check = (val >> (16 + 4*i)) & 0xf. It contains the 729 * correct bp
502 * R/Wi and LENi bits; bits 0 and 1 are R/Wi, and bits
503 * 2 and 3 are LENi. Given a list of invalid values,
504 * we do mask |= 1 << invalid_value, so that
505 * (mask >> check) & 1 is a correct test for invalid
506 * values.
507 *
508 * R/Wi contains the type of the breakpoint /
509 * watchpoint, LENi contains the length of the watched
510 * data in the watchpoint case.
511 *
512 * The invalid values are:
513 * - LENi == 0x10 (undefined), so mask |= 0x0f00. [32-bit]
514 * - R/Wi == 0x10 (break on I/O reads or writes), so
515 * mask |= 0x4444.
516 * - R/Wi == 0x00 && LENi != 0x00, so we have mask |=
517 * 0x1110.
518 *
519 * Finally, mask = 0x0f00 | 0x4444 | 0x1110 == 0x5f54.
520 *
521 * See the Intel Manual "System Programming Guide",
522 * 15.2.4
523 *
524 * Note that LENi == 0x10 is defined on x86_64 in long
525 * mode (i.e. even for 32-bit userspace software, but
526 * 64-bit kernel), so the x86_64 mask value is 0x5454.
527 * See the AMD manual no. 24593 (AMD64 System Programming)
528 */ 730 */
529#ifdef CONFIG_X86_32 731 attr.bp_addr = addr;
530#define DR7_MASK 0x5f54 732 attr.bp_len = HW_BREAKPOINT_LEN_1;
531#else 733 attr.bp_type = HW_BREAKPOINT_W;
532#define DR7_MASK 0x5554 734 attr.disabled = 1;
533#endif 735
534 data &= ~DR_CONTROL_RESERVED; 736 bp = register_user_hw_breakpoint(&attr, ptrace_triggered, tsk);
535 for (i = 0; i < 4; i++) 737 } else {
536 if ((DR7_MASK >> ((data >> (16 + 4*i)) & 0xf)) & 1) 738 bp = t->ptrace_bps[nr];
537 return -EIO; 739 t->ptrace_bps[nr] = NULL;
538 child->thread.debugreg7 = data; 740
539 if (data) 741 attr = bp->attr;
540 set_tsk_thread_flag(child, TIF_DEBUG); 742 attr.bp_addr = addr;
541 else 743 bp = modify_user_hw_breakpoint(bp, &attr, bp->callback, tsk);
542 clear_tsk_thread_flag(child, TIF_DEBUG);
543 break;
544 } 744 }
745 /*
746 * CHECKME: the previous code returned -EIO if the addr wasn't a
747 * valid task virtual addr. The new one will return -EINVAL in this
748 * case.
749 * -EINVAL may be what we want for in-kernel breakpoints users, but
750 * -EIO looks better for ptrace, since we refuse a register writing
751 * for the user. And anyway this is the previous behaviour.
752 */
753 if (IS_ERR(bp))
754 return PTR_ERR(bp);
755
756 t->ptrace_bps[nr] = bp;
545 757
546 return 0; 758 return 0;
547} 759}
548 760
549/* 761/*
762 * Handle PTRACE_POKEUSR calls for the debug register area.
763 */
764int ptrace_set_debugreg(struct task_struct *tsk, int n, unsigned long val)
765{
766 struct thread_struct *thread = &(tsk->thread);
767 int rc = 0;
768
769 /* There are no DR4 or DR5 registers */
770 if (n == 4 || n == 5)
771 return -EIO;
772
773 if (n == 6) {
774 thread->debugreg6 = val;
775 goto ret_path;
776 }
777 if (n < HBP_NUM) {
778 rc = ptrace_set_breakpoint_addr(tsk, n, val);
779 if (rc)
780 return rc;
781 }
782 /* All that's left is DR7 */
783 if (n == 7)
784 rc = ptrace_write_dr7(tsk, val);
785
786ret_path:
787 return rc;
788}
789
790/*
550 * These access the current or another (stopped) task's io permission 791 * These access the current or another (stopped) task's io permission
551 * bitmap for debugging or core dump. 792 * bitmap for debugging or core dump.
552 */ 793 */
diff --git a/arch/x86/kernel/quirks.c b/arch/x86/kernel/quirks.c
index 6c3b2c6fd772..18093d7498f0 100644
--- a/arch/x86/kernel/quirks.c
+++ b/arch/x86/kernel/quirks.c
@@ -499,6 +499,7 @@ static void __init quirk_amd_nb_node(struct pci_dev *dev)
499{ 499{
500 struct pci_dev *nb_ht; 500 struct pci_dev *nb_ht;
501 unsigned int devfn; 501 unsigned int devfn;
502 u32 node;
502 u32 val; 503 u32 val;
503 504
504 devfn = PCI_DEVFN(PCI_SLOT(dev->devfn), 0); 505 devfn = PCI_DEVFN(PCI_SLOT(dev->devfn), 0);
@@ -507,7 +508,13 @@ static void __init quirk_amd_nb_node(struct pci_dev *dev)
507 return; 508 return;
508 509
509 pci_read_config_dword(nb_ht, 0x60, &val); 510 pci_read_config_dword(nb_ht, 0x60, &val);
510 set_dev_node(&dev->dev, val & 7); 511 node = val & 7;
512 /*
513 * Some hardware may return an invalid node ID,
514 * so check it first:
515 */
516 if (node_online(node))
517 set_dev_node(&dev->dev, node);
511 pci_dev_put(nb_ht); 518 pci_dev_put(nb_ht);
512} 519}
513 520
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
index f93078746e00..2b97fc5b124e 100644
--- a/arch/x86/kernel/reboot.c
+++ b/arch/x86/kernel/reboot.c
@@ -23,7 +23,7 @@
23# include <linux/ctype.h> 23# include <linux/ctype.h>
24# include <linux/mc146818rtc.h> 24# include <linux/mc146818rtc.h>
25#else 25#else
26# include <asm/iommu.h> 26# include <asm/x86_init.h>
27#endif 27#endif
28 28
29/* 29/*
@@ -622,7 +622,7 @@ void native_machine_shutdown(void)
622#endif 622#endif
623 623
624#ifdef CONFIG_X86_64 624#ifdef CONFIG_X86_64
625 pci_iommu_shutdown(); 625 x86_platform.iommu_shutdown();
626#endif 626#endif
627} 627}
628 628
diff --git a/arch/x86/kernel/reboot_fixups_32.c b/arch/x86/kernel/reboot_fixups_32.c
index 61a837743fe5..201eab63b05f 100644
--- a/arch/x86/kernel/reboot_fixups_32.c
+++ b/arch/x86/kernel/reboot_fixups_32.c
@@ -80,6 +80,7 @@ void mach_reboot_fixups(void)
80 continue; 80 continue;
81 81
82 cur->reboot_fixup(dev); 82 cur->reboot_fixup(dev);
83 pci_dev_put(dev);
83 } 84 }
84} 85}
85 86
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 2a34f9c5be21..946a311a25c9 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -106,9 +106,11 @@
106#include <asm/percpu.h> 106#include <asm/percpu.h>
107#include <asm/topology.h> 107#include <asm/topology.h>
108#include <asm/apicdef.h> 108#include <asm/apicdef.h>
109#include <asm/k8.h>
109#ifdef CONFIG_X86_64 110#ifdef CONFIG_X86_64
110#include <asm/numa_64.h> 111#include <asm/numa_64.h>
111#endif 112#endif
113#include <asm/mce.h>
112 114
113/* 115/*
114 * end_pfn only includes RAM, while max_pfn_mapped includes all e820 entries. 116 * end_pfn only includes RAM, while max_pfn_mapped includes all e820 entries.
@@ -247,7 +249,7 @@ EXPORT_SYMBOL(edd);
247 * from boot_params into a safe place. 249 * from boot_params into a safe place.
248 * 250 *
249 */ 251 */
250static inline void copy_edd(void) 252static inline void __init copy_edd(void)
251{ 253{
252 memcpy(edd.mbr_signature, boot_params.edd_mbr_sig_buffer, 254 memcpy(edd.mbr_signature, boot_params.edd_mbr_sig_buffer,
253 sizeof(edd.mbr_signature)); 255 sizeof(edd.mbr_signature));
@@ -256,7 +258,7 @@ static inline void copy_edd(void)
256 edd.edd_info_nr = boot_params.eddbuf_entries; 258 edd.edd_info_nr = boot_params.eddbuf_entries;
257} 259}
258#else 260#else
259static inline void copy_edd(void) 261static inline void __init copy_edd(void)
260{ 262{
261} 263}
262#endif 264#endif
@@ -486,42 +488,11 @@ static void __init reserve_early_setup_data(void)
486 488
487#ifdef CONFIG_KEXEC 489#ifdef CONFIG_KEXEC
488 490
489/**
490 * Reserve @size bytes of crashkernel memory at any suitable offset.
491 *
492 * @size: Size of the crashkernel memory to reserve.
493 * Returns the base address on success, and -1ULL on failure.
494 */
495static
496unsigned long long __init find_and_reserve_crashkernel(unsigned long long size)
497{
498 const unsigned long long alignment = 16<<20; /* 16M */
499 unsigned long long start = 0LL;
500
501 while (1) {
502 int ret;
503
504 start = find_e820_area(start, ULONG_MAX, size, alignment);
505 if (start == -1ULL)
506 return start;
507
508 /* try to reserve it */
509 ret = reserve_bootmem_generic(start, size, BOOTMEM_EXCLUSIVE);
510 if (ret >= 0)
511 return start;
512
513 start += alignment;
514 }
515}
516
517static inline unsigned long long get_total_mem(void) 491static inline unsigned long long get_total_mem(void)
518{ 492{
519 unsigned long long total; 493 unsigned long long total;
520 494
521 total = max_low_pfn - min_low_pfn; 495 total = max_pfn - min_low_pfn;
522#ifdef CONFIG_HIGHMEM
523 total += highend_pfn - highstart_pfn;
524#endif
525 496
526 return total << PAGE_SHIFT; 497 return total << PAGE_SHIFT;
527} 498}
@@ -541,21 +512,25 @@ static void __init reserve_crashkernel(void)
541 512
542 /* 0 means: find the address automatically */ 513 /* 0 means: find the address automatically */
543 if (crash_base <= 0) { 514 if (crash_base <= 0) {
544 crash_base = find_and_reserve_crashkernel(crash_size); 515 const unsigned long long alignment = 16<<20; /* 16M */
516
517 crash_base = find_e820_area(alignment, ULONG_MAX, crash_size,
518 alignment);
545 if (crash_base == -1ULL) { 519 if (crash_base == -1ULL) {
546 pr_info("crashkernel reservation failed. " 520 pr_info("crashkernel reservation failed - No suitable area found.\n");
547 "No suitable area found.\n");
548 return; 521 return;
549 } 522 }
550 } else { 523 } else {
551 ret = reserve_bootmem_generic(crash_base, crash_size, 524 unsigned long long start;
552 BOOTMEM_EXCLUSIVE); 525
553 if (ret < 0) { 526 start = find_e820_area(crash_base, ULONG_MAX, crash_size,
554 pr_info("crashkernel reservation failed - " 527 1<<20);
555 "memory is in use\n"); 528 if (start != crash_base) {
529 pr_info("crashkernel reservation failed - memory is in use.\n");
556 return; 530 return;
557 } 531 }
558 } 532 }
533 reserve_early(crash_base, crash_base + crash_size, "CRASH KERNEL");
559 534
560 printk(KERN_INFO "Reserving %ldMB of memory at %ldMB " 535 printk(KERN_INFO "Reserving %ldMB of memory at %ldMB "
561 "for crashkernel (System RAM: %ldMB)\n", 536 "for crashkernel (System RAM: %ldMB)\n",
@@ -698,6 +673,9 @@ static struct dmi_system_id __initdata bad_bios_dmi_table[] = {
698 673
699void __init setup_arch(char **cmdline_p) 674void __init setup_arch(char **cmdline_p)
700{ 675{
676 int acpi = 0;
677 int k8 = 0;
678
701#ifdef CONFIG_X86_32 679#ifdef CONFIG_X86_32
702 memcpy(&boot_cpu_data, &new_cpu_data, sizeof(new_cpu_data)); 680 memcpy(&boot_cpu_data, &new_cpu_data, sizeof(new_cpu_data));
703 visws_early_detect(); 681 visws_early_detect();
@@ -790,21 +768,18 @@ void __init setup_arch(char **cmdline_p)
790 strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE); 768 strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE);
791 *cmdline_p = command_line; 769 *cmdline_p = command_line;
792 770
793#ifdef CONFIG_X86_64
794 /* 771 /*
795 * Must call this twice: Once just to detect whether hardware doesn't 772 * x86_configure_nx() is called before parse_early_param() to detect
796 * support NX (so that the early EHCI debug console setup can safely 773 * whether hardware doesn't support NX (so that the early EHCI debug
797 * call set_fixmap(), and then again after parsing early parameters to 774 * console setup can safely call set_fixmap()). It may then be called
798 * honor the respective command line option. 775 * again from within noexec_setup() during parsing early parameters
776 * to honor the respective command line option.
799 */ 777 */
800 check_efer(); 778 x86_configure_nx();
801#endif
802 779
803 parse_early_param(); 780 parse_early_param();
804 781
805#ifdef CONFIG_X86_64 782 x86_report_nx();
806 check_efer();
807#endif
808 783
809 /* Must be before kernel pagetables are setup */ 784 /* Must be before kernel pagetables are setup */
810 vmi_activate(); 785 vmi_activate();
@@ -900,6 +875,13 @@ void __init setup_arch(char **cmdline_p)
900 875
901 reserve_brk(); 876 reserve_brk();
902 877
878#ifdef CONFIG_ACPI_SLEEP
879 /*
880 * Reserve low memory region for sleep support.
881 * even before init_memory_mapping
882 */
883 acpi_reserve_wakeup_memory();
884#endif
903 init_gbpages(); 885 init_gbpages();
904 886
905 /* max_pfn_mapped is updated here */ 887 /* max_pfn_mapped is updated here */
@@ -926,6 +908,8 @@ void __init setup_arch(char **cmdline_p)
926 908
927 reserve_initrd(); 909 reserve_initrd();
928 910
911 reserve_crashkernel();
912
929 vsmp_init(); 913 vsmp_init();
930 914
931 io_delay_init(); 915 io_delay_init();
@@ -937,27 +921,24 @@ void __init setup_arch(char **cmdline_p)
937 921
938 early_acpi_boot_init(); 922 early_acpi_boot_init();
939 923
924 /*
925 * Find and reserve possible boot-time SMP configuration:
926 */
927 find_smp_config();
928
940#ifdef CONFIG_ACPI_NUMA 929#ifdef CONFIG_ACPI_NUMA
941 /* 930 /*
942 * Parse SRAT to discover nodes. 931 * Parse SRAT to discover nodes.
943 */ 932 */
944 acpi_numa_init(); 933 acpi = acpi_numa_init();
945#endif 934#endif
946 935
947 initmem_init(0, max_pfn); 936#ifdef CONFIG_K8_NUMA
948 937 if (!acpi)
949#ifdef CONFIG_ACPI_SLEEP 938 k8 = !k8_numa_init(0, max_pfn);
950 /*
951 * Reserve low memory region for sleep support.
952 */
953 acpi_reserve_bootmem();
954#endif 939#endif
955 /*
956 * Find and reserve possible boot-time SMP configuration:
957 */
958 find_smp_config();
959 940
960 reserve_crashkernel(); 941 initmem_init(0, max_pfn, acpi, k8);
961 942
962#ifdef CONFIG_X86_64 943#ifdef CONFIG_X86_64
963 /* 944 /*
@@ -1031,6 +1012,8 @@ void __init setup_arch(char **cmdline_p)
1031#endif 1012#endif
1032#endif 1013#endif
1033 x86_init.oem.banner(); 1014 x86_init.oem.banner();
1015
1016 mcheck_init();
1034} 1017}
1035 1018
1036#ifdef CONFIG_X86_32 1019#ifdef CONFIG_X86_32
diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c
index 6a44a76055ad..74fe6d86dc5d 100644
--- a/arch/x86/kernel/signal.c
+++ b/arch/x86/kernel/signal.c
@@ -19,6 +19,7 @@
19#include <linux/stddef.h> 19#include <linux/stddef.h>
20#include <linux/personality.h> 20#include <linux/personality.h>
21#include <linux/uaccess.h> 21#include <linux/uaccess.h>
22#include <linux/user-return-notifier.h>
22 23
23#include <asm/processor.h> 24#include <asm/processor.h>
24#include <asm/ucontext.h> 25#include <asm/ucontext.h>
@@ -799,15 +800,6 @@ static void do_signal(struct pt_regs *regs)
799 800
800 signr = get_signal_to_deliver(&info, &ka, regs, NULL); 801 signr = get_signal_to_deliver(&info, &ka, regs, NULL);
801 if (signr > 0) { 802 if (signr > 0) {
802 /*
803 * Re-enable any watchpoints before delivering the
804 * signal to user space. The processor register will
805 * have been cleared if the watchpoint triggered
806 * inside the kernel.
807 */
808 if (current->thread.debugreg7)
809 set_debugreg(current->thread.debugreg7, 7);
810
811 /* Whee! Actually deliver the signal. */ 803 /* Whee! Actually deliver the signal. */
812 if (handle_signal(signr, &info, &ka, oldset, regs) == 0) { 804 if (handle_signal(signr, &info, &ka, oldset, regs) == 0) {
813 /* 805 /*
@@ -872,6 +864,8 @@ do_notify_resume(struct pt_regs *regs, void *unused, __u32 thread_info_flags)
872 if (current->replacement_session_keyring) 864 if (current->replacement_session_keyring)
873 key_replace_session_keyring(); 865 key_replace_session_keyring();
874 } 866 }
867 if (thread_info_flags & _TIF_USER_RETURN_NOTIFY)
868 fire_user_return_notifiers();
875 869
876#ifdef CONFIG_X86_32 870#ifdef CONFIG_X86_32
877 clear_thread_flag(TIF_IRET); 871 clear_thread_flag(TIF_IRET);
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 565ebc65920e..324f2a44c221 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -1250,16 +1250,7 @@ static void __ref remove_cpu_from_maps(int cpu)
1250void cpu_disable_common(void) 1250void cpu_disable_common(void)
1251{ 1251{
1252 int cpu = smp_processor_id(); 1252 int cpu = smp_processor_id();
1253 /*
1254 * HACK:
1255 * Allow any queued timer interrupts to get serviced
1256 * This is only a temporary solution until we cleanup
1257 * fixup_irqs as we do for IA64.
1258 */
1259 local_irq_enable();
1260 mdelay(1);
1261 1253
1262 local_irq_disable();
1263 remove_siblinginfo(cpu); 1254 remove_siblinginfo(cpu);
1264 1255
1265 /* It's now safe to remove this processor from the online map */ 1256 /* It's now safe to remove this processor from the online map */
diff --git a/arch/x86/kernel/syscall_table_32.S b/arch/x86/kernel/syscall_table_32.S
index 0157cd26d7cc..70c2125d55b9 100644
--- a/arch/x86/kernel/syscall_table_32.S
+++ b/arch/x86/kernel/syscall_table_32.S
@@ -336,3 +336,4 @@ ENTRY(sys_call_table)
336 .long sys_pwritev 336 .long sys_pwritev
337 .long sys_rt_tgsigqueueinfo /* 335 */ 337 .long sys_rt_tgsigqueueinfo /* 335 */
338 .long sys_perf_event_open 338 .long sys_perf_event_open
339 .long sys_recvmmsg
diff --git a/arch/x86/kernel/tlb_uv.c b/arch/x86/kernel/tlb_uv.c
index 1740c85e24bb..364d015efebc 100644
--- a/arch/x86/kernel/tlb_uv.c
+++ b/arch/x86/kernel/tlb_uv.c
@@ -817,10 +817,8 @@ static int __init uv_init_blade(int blade)
817 */ 817 */
818 apicid = blade_to_first_apicid(blade); 818 apicid = blade_to_first_apicid(blade);
819 pa = uv_read_global_mmr64(pnode, UVH_BAU_DATA_CONFIG); 819 pa = uv_read_global_mmr64(pnode, UVH_BAU_DATA_CONFIG);
820 if ((pa & 0xff) != UV_BAU_MESSAGE) { 820 uv_write_global_mmr64(pnode, UVH_BAU_DATA_CONFIG,
821 uv_write_global_mmr64(pnode, UVH_BAU_DATA_CONFIG,
822 ((apicid << 32) | UV_BAU_MESSAGE)); 821 ((apicid << 32) | UV_BAU_MESSAGE));
823 }
824 return 0; 822 return 0;
825} 823}
826 824
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index 7e37dcee0cc3..33399176512a 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -529,77 +529,56 @@ asmlinkage __kprobes struct pt_regs *sync_regs(struct pt_regs *eregs)
529dotraplinkage void __kprobes do_debug(struct pt_regs *regs, long error_code) 529dotraplinkage void __kprobes do_debug(struct pt_regs *regs, long error_code)
530{ 530{
531 struct task_struct *tsk = current; 531 struct task_struct *tsk = current;
532 unsigned long condition; 532 unsigned long dr6;
533 int si_code; 533 int si_code;
534 534
535 get_debugreg(condition, 6); 535 get_debugreg(dr6, 6);
536 536
537 /* Catch kmemcheck conditions first of all! */ 537 /* Catch kmemcheck conditions first of all! */
538 if (condition & DR_STEP && kmemcheck_trap(regs)) 538 if ((dr6 & DR_STEP) && kmemcheck_trap(regs))
539 return; 539 return;
540 540
541 /* DR6 may or may not be cleared by the CPU */
542 set_debugreg(0, 6);
541 /* 543 /*
542 * The processor cleared BTF, so don't mark that we need it set. 544 * The processor cleared BTF, so don't mark that we need it set.
543 */ 545 */
544 clear_tsk_thread_flag(tsk, TIF_DEBUGCTLMSR); 546 clear_tsk_thread_flag(tsk, TIF_DEBUGCTLMSR);
545 tsk->thread.debugctlmsr = 0; 547 tsk->thread.debugctlmsr = 0;
546 548
547 if (notify_die(DIE_DEBUG, "debug", regs, condition, error_code, 549 /* Store the virtualized DR6 value */
548 SIGTRAP) == NOTIFY_STOP) 550 tsk->thread.debugreg6 = dr6;
551
552 if (notify_die(DIE_DEBUG, "debug", regs, PTR_ERR(&dr6), error_code,
553 SIGTRAP) == NOTIFY_STOP)
549 return; 554 return;
550 555
551 /* It's safe to allow irq's after DR6 has been saved */ 556 /* It's safe to allow irq's after DR6 has been saved */
552 preempt_conditional_sti(regs); 557 preempt_conditional_sti(regs);
553 558
554 /* Mask out spurious debug traps due to lazy DR7 setting */ 559 if (regs->flags & X86_VM_MASK) {
555 if (condition & (DR_TRAP0|DR_TRAP1|DR_TRAP2|DR_TRAP3)) { 560 handle_vm86_trap((struct kernel_vm86_regs *) regs,
556 if (!tsk->thread.debugreg7) 561 error_code, 1);
557 goto clear_dr7; 562 return;
558 } 563 }
559 564
560#ifdef CONFIG_X86_32
561 if (regs->flags & X86_VM_MASK)
562 goto debug_vm86;
563#endif
564
565 /* Save debug status register where ptrace can see it */
566 tsk->thread.debugreg6 = condition;
567
568 /* 565 /*
569 * Single-stepping through TF: make sure we ignore any events in 566 * Single-stepping through system calls: ignore any exceptions in
570 * kernel space (but re-enable TF when returning to user mode). 567 * kernel space, but re-enable TF when returning to user mode.
568 *
569 * We already checked v86 mode above, so we can check for kernel mode
570 * by just checking the CPL of CS.
571 */ 571 */
572 if (condition & DR_STEP) { 572 if ((dr6 & DR_STEP) && !user_mode(regs)) {
573 if (!user_mode(regs)) 573 tsk->thread.debugreg6 &= ~DR_STEP;
574 goto clear_TF_reenable; 574 set_tsk_thread_flag(tsk, TIF_SINGLESTEP);
575 regs->flags &= ~X86_EFLAGS_TF;
575 } 576 }
576 577 si_code = get_si_code(tsk->thread.debugreg6);
577 si_code = get_si_code(condition); 578 if (tsk->thread.debugreg6 & (DR_STEP | DR_TRAP_BITS))
578 /* Ok, finally something we can handle */ 579 send_sigtrap(tsk, regs, error_code, si_code);
579 send_sigtrap(tsk, regs, error_code, si_code);
580
581 /*
582 * Disable additional traps. They'll be re-enabled when
583 * the signal is delivered.
584 */
585clear_dr7:
586 set_debugreg(0, 7);
587 preempt_conditional_cli(regs); 580 preempt_conditional_cli(regs);
588 return;
589 581
590#ifdef CONFIG_X86_32
591debug_vm86:
592 /* reenable preemption: handle_vm86_trap() might sleep */
593 dec_preempt_count();
594 handle_vm86_trap((struct kernel_vm86_regs *) regs, error_code, 1);
595 conditional_cli(regs);
596 return;
597#endif
598
599clear_TF_reenable:
600 set_tsk_thread_flag(tsk, TIF_SINGLESTEP);
601 regs->flags &= ~X86_EFLAGS_TF;
602 preempt_conditional_cli(regs);
603 return; 582 return;
604} 583}
605 584
diff --git a/arch/x86/kernel/tsc_sync.c b/arch/x86/kernel/tsc_sync.c
index f37930954d15..eed156851f5d 100644
--- a/arch/x86/kernel/tsc_sync.c
+++ b/arch/x86/kernel/tsc_sync.c
@@ -114,13 +114,12 @@ void __cpuinit check_tsc_sync_source(int cpu)
114 return; 114 return;
115 115
116 if (boot_cpu_has(X86_FEATURE_TSC_RELIABLE)) { 116 if (boot_cpu_has(X86_FEATURE_TSC_RELIABLE)) {
117 printk_once(KERN_INFO "Skipping synchronization checks as TSC is reliable.\n"); 117 if (cpu == (nr_cpu_ids-1) || system_state != SYSTEM_BOOTING)
118 pr_info(
119 "Skipped synchronization checks as TSC is reliable.\n");
118 return; 120 return;
119 } 121 }
120 122
121 pr_info("checking TSC synchronization [CPU#%d -> CPU#%d]:",
122 smp_processor_id(), cpu);
123
124 /* 123 /*
125 * Reset it - in case this is a second bootup: 124 * Reset it - in case this is a second bootup:
126 */ 125 */
@@ -142,12 +141,14 @@ void __cpuinit check_tsc_sync_source(int cpu)
142 cpu_relax(); 141 cpu_relax();
143 142
144 if (nr_warps) { 143 if (nr_warps) {
145 printk("\n"); 144 pr_warning("TSC synchronization [CPU#%d -> CPU#%d]:\n",
145 smp_processor_id(), cpu);
146 pr_warning("Measured %Ld cycles TSC warp between CPUs, " 146 pr_warning("Measured %Ld cycles TSC warp between CPUs, "
147 "turning off TSC clock.\n", max_warp); 147 "turning off TSC clock.\n", max_warp);
148 mark_tsc_unstable("check_tsc_sync_source failed"); 148 mark_tsc_unstable("check_tsc_sync_source failed");
149 } else { 149 } else {
150 printk(" passed.\n"); 150 pr_debug("TSC synchronization [CPU#%d -> CPU#%d]: passed\n",
151 smp_processor_id(), cpu);
151 } 152 }
152 153
153 /* 154 /*
diff --git a/arch/x86/kernel/uv_irq.c b/arch/x86/kernel/uv_irq.c
index aeef529917e4..61d805df4c91 100644
--- a/arch/x86/kernel/uv_irq.c
+++ b/arch/x86/kernel/uv_irq.c
@@ -9,10 +9,25 @@
9 */ 9 */
10 10
11#include <linux/module.h> 11#include <linux/module.h>
12#include <linux/rbtree.h>
12#include <linux/irq.h> 13#include <linux/irq.h>
13 14
14#include <asm/apic.h> 15#include <asm/apic.h>
15#include <asm/uv/uv_irq.h> 16#include <asm/uv/uv_irq.h>
17#include <asm/uv/uv_hub.h>
18
19/* MMR offset and pnode of hub sourcing interrupts for a given irq */
20struct uv_irq_2_mmr_pnode{
21 struct rb_node list;
22 unsigned long offset;
23 int pnode;
24 int irq;
25};
26
27static spinlock_t uv_irq_lock;
28static struct rb_root uv_irq_root;
29
30static int uv_set_irq_affinity(unsigned int, const struct cpumask *);
16 31
17static void uv_noop(unsigned int irq) 32static void uv_noop(unsigned int irq)
18{ 33{
@@ -39,25 +54,214 @@ struct irq_chip uv_irq_chip = {
39 .unmask = uv_noop, 54 .unmask = uv_noop,
40 .eoi = uv_ack_apic, 55 .eoi = uv_ack_apic,
41 .end = uv_noop, 56 .end = uv_noop,
57 .set_affinity = uv_set_irq_affinity,
42}; 58};
43 59
44/* 60/*
61 * Add offset and pnode information of the hub sourcing interrupts to the
62 * rb tree for a specific irq.
63 */
64static int uv_set_irq_2_mmr_info(int irq, unsigned long offset, unsigned blade)
65{
66 struct rb_node **link = &uv_irq_root.rb_node;
67 struct rb_node *parent = NULL;
68 struct uv_irq_2_mmr_pnode *n;
69 struct uv_irq_2_mmr_pnode *e;
70 unsigned long irqflags;
71
72 n = kmalloc_node(sizeof(struct uv_irq_2_mmr_pnode), GFP_KERNEL,
73 uv_blade_to_memory_nid(blade));
74 if (!n)
75 return -ENOMEM;
76
77 n->irq = irq;
78 n->offset = offset;
79 n->pnode = uv_blade_to_pnode(blade);
80 spin_lock_irqsave(&uv_irq_lock, irqflags);
81 /* Find the right place in the rbtree: */
82 while (*link) {
83 parent = *link;
84 e = rb_entry(parent, struct uv_irq_2_mmr_pnode, list);
85
86 if (unlikely(irq == e->irq)) {
87 /* irq entry exists */
88 e->pnode = uv_blade_to_pnode(blade);
89 e->offset = offset;
90 spin_unlock_irqrestore(&uv_irq_lock, irqflags);
91 kfree(n);
92 return 0;
93 }
94
95 if (irq < e->irq)
96 link = &(*link)->rb_left;
97 else
98 link = &(*link)->rb_right;
99 }
100
101 /* Insert the node into the rbtree. */
102 rb_link_node(&n->list, parent, link);
103 rb_insert_color(&n->list, &uv_irq_root);
104
105 spin_unlock_irqrestore(&uv_irq_lock, irqflags);
106 return 0;
107}
108
109/* Retrieve offset and pnode information from the rb tree for a specific irq */
110int uv_irq_2_mmr_info(int irq, unsigned long *offset, int *pnode)
111{
112 struct uv_irq_2_mmr_pnode *e;
113 struct rb_node *n;
114 unsigned long irqflags;
115
116 spin_lock_irqsave(&uv_irq_lock, irqflags);
117 n = uv_irq_root.rb_node;
118 while (n) {
119 e = rb_entry(n, struct uv_irq_2_mmr_pnode, list);
120
121 if (e->irq == irq) {
122 *offset = e->offset;
123 *pnode = e->pnode;
124 spin_unlock_irqrestore(&uv_irq_lock, irqflags);
125 return 0;
126 }
127
128 if (irq < e->irq)
129 n = n->rb_left;
130 else
131 n = n->rb_right;
132 }
133 spin_unlock_irqrestore(&uv_irq_lock, irqflags);
134 return -1;
135}
136
137/*
138 * Re-target the irq to the specified CPU and enable the specified MMR located
139 * on the specified blade to allow the sending of MSIs to the specified CPU.
140 */
141static int
142arch_enable_uv_irq(char *irq_name, unsigned int irq, int cpu, int mmr_blade,
143 unsigned long mmr_offset, int restrict)
144{
145 const struct cpumask *eligible_cpu = cpumask_of(cpu);
146 struct irq_desc *desc = irq_to_desc(irq);
147 struct irq_cfg *cfg;
148 int mmr_pnode;
149 unsigned long mmr_value;
150 struct uv_IO_APIC_route_entry *entry;
151 int err;
152
153 BUILD_BUG_ON(sizeof(struct uv_IO_APIC_route_entry) !=
154 sizeof(unsigned long));
155
156 cfg = irq_cfg(irq);
157
158 err = assign_irq_vector(irq, cfg, eligible_cpu);
159 if (err != 0)
160 return err;
161
162 if (restrict == UV_AFFINITY_CPU)
163 desc->status |= IRQ_NO_BALANCING;
164 else
165 desc->status |= IRQ_MOVE_PCNTXT;
166
167 set_irq_chip_and_handler_name(irq, &uv_irq_chip, handle_percpu_irq,
168 irq_name);
169
170 mmr_value = 0;
171 entry = (struct uv_IO_APIC_route_entry *)&mmr_value;
172 entry->vector = cfg->vector;
173 entry->delivery_mode = apic->irq_delivery_mode;
174 entry->dest_mode = apic->irq_dest_mode;
175 entry->polarity = 0;
176 entry->trigger = 0;
177 entry->mask = 0;
178 entry->dest = apic->cpu_mask_to_apicid(eligible_cpu);
179
180 mmr_pnode = uv_blade_to_pnode(mmr_blade);
181 uv_write_global_mmr64(mmr_pnode, mmr_offset, mmr_value);
182
183 if (cfg->move_in_progress)
184 send_cleanup_vector(cfg);
185
186 return irq;
187}
188
189/*
190 * Disable the specified MMR located on the specified blade so that MSIs are
191 * longer allowed to be sent.
192 */
193static void arch_disable_uv_irq(int mmr_pnode, unsigned long mmr_offset)
194{
195 unsigned long mmr_value;
196 struct uv_IO_APIC_route_entry *entry;
197
198 BUILD_BUG_ON(sizeof(struct uv_IO_APIC_route_entry) !=
199 sizeof(unsigned long));
200
201 mmr_value = 0;
202 entry = (struct uv_IO_APIC_route_entry *)&mmr_value;
203 entry->mask = 1;
204
205 uv_write_global_mmr64(mmr_pnode, mmr_offset, mmr_value);
206}
207
208static int uv_set_irq_affinity(unsigned int irq, const struct cpumask *mask)
209{
210 struct irq_desc *desc = irq_to_desc(irq);
211 struct irq_cfg *cfg = desc->chip_data;
212 unsigned int dest;
213 unsigned long mmr_value;
214 struct uv_IO_APIC_route_entry *entry;
215 unsigned long mmr_offset;
216 unsigned mmr_pnode;
217
218 dest = set_desc_affinity(desc, mask);
219 if (dest == BAD_APICID)
220 return -1;
221
222 mmr_value = 0;
223 entry = (struct uv_IO_APIC_route_entry *)&mmr_value;
224
225 entry->vector = cfg->vector;
226 entry->delivery_mode = apic->irq_delivery_mode;
227 entry->dest_mode = apic->irq_dest_mode;
228 entry->polarity = 0;
229 entry->trigger = 0;
230 entry->mask = 0;
231 entry->dest = dest;
232
233 /* Get previously stored MMR and pnode of hub sourcing interrupts */
234 if (uv_irq_2_mmr_info(irq, &mmr_offset, &mmr_pnode))
235 return -1;
236
237 uv_write_global_mmr64(mmr_pnode, mmr_offset, mmr_value);
238
239 if (cfg->move_in_progress)
240 send_cleanup_vector(cfg);
241
242 return 0;
243}
244
245/*
45 * Set up a mapping of an available irq and vector, and enable the specified 246 * Set up a mapping of an available irq and vector, and enable the specified
46 * MMR that defines the MSI that is to be sent to the specified CPU when an 247 * MMR that defines the MSI that is to be sent to the specified CPU when an
47 * interrupt is raised. 248 * interrupt is raised.
48 */ 249 */
49int uv_setup_irq(char *irq_name, int cpu, int mmr_blade, 250int uv_setup_irq(char *irq_name, int cpu, int mmr_blade,
50 unsigned long mmr_offset) 251 unsigned long mmr_offset, int restrict)
51{ 252{
52 int irq; 253 int irq, ret;
53 int ret; 254
255 irq = create_irq_nr(NR_IRQS_LEGACY, uv_blade_to_memory_nid(mmr_blade));
54 256
55 irq = create_irq();
56 if (irq <= 0) 257 if (irq <= 0)
57 return -EBUSY; 258 return -EBUSY;
58 259
59 ret = arch_enable_uv_irq(irq_name, irq, cpu, mmr_blade, mmr_offset); 260 ret = arch_enable_uv_irq(irq_name, irq, cpu, mmr_blade, mmr_offset,
60 if (ret != irq) 261 restrict);
262 if (ret == irq)
263 uv_set_irq_2_mmr_info(irq, mmr_offset, mmr_blade);
264 else
61 destroy_irq(irq); 265 destroy_irq(irq);
62 266
63 return ret; 267 return ret;
@@ -71,9 +275,28 @@ EXPORT_SYMBOL_GPL(uv_setup_irq);
71 * 275 *
72 * Set mmr_blade and mmr_offset to what was passed in on uv_setup_irq(). 276 * Set mmr_blade and mmr_offset to what was passed in on uv_setup_irq().
73 */ 277 */
74void uv_teardown_irq(unsigned int irq, int mmr_blade, unsigned long mmr_offset) 278void uv_teardown_irq(unsigned int irq)
75{ 279{
76 arch_disable_uv_irq(mmr_blade, mmr_offset); 280 struct uv_irq_2_mmr_pnode *e;
281 struct rb_node *n;
282 unsigned long irqflags;
283
284 spin_lock_irqsave(&uv_irq_lock, irqflags);
285 n = uv_irq_root.rb_node;
286 while (n) {
287 e = rb_entry(n, struct uv_irq_2_mmr_pnode, list);
288 if (e->irq == irq) {
289 arch_disable_uv_irq(e->pnode, e->offset);
290 rb_erase(n, &uv_irq_root);
291 kfree(e);
292 break;
293 }
294 if (irq < e->irq)
295 n = n->rb_left;
296 else
297 n = n->rb_right;
298 }
299 spin_unlock_irqrestore(&uv_irq_lock, irqflags);
77 destroy_irq(irq); 300 destroy_irq(irq);
78} 301}
79EXPORT_SYMBOL_GPL(uv_teardown_irq); 302EXPORT_SYMBOL_GPL(uv_teardown_irq);
diff --git a/arch/x86/kernel/uv_time.c b/arch/x86/kernel/uv_time.c
index 583f11d5c480..3c84aa001c11 100644
--- a/arch/x86/kernel/uv_time.c
+++ b/arch/x86/kernel/uv_time.c
@@ -74,7 +74,7 @@ struct uv_rtc_timer_head {
74 */ 74 */
75static struct uv_rtc_timer_head **blade_info __read_mostly; 75static struct uv_rtc_timer_head **blade_info __read_mostly;
76 76
77static int uv_rtc_enable; 77static int uv_rtc_evt_enable;
78 78
79/* 79/*
80 * Hardware interface routines 80 * Hardware interface routines
@@ -90,7 +90,7 @@ static void uv_rtc_send_IPI(int cpu)
90 pnode = uv_apicid_to_pnode(apicid); 90 pnode = uv_apicid_to_pnode(apicid);
91 val = (1UL << UVH_IPI_INT_SEND_SHFT) | 91 val = (1UL << UVH_IPI_INT_SEND_SHFT) |
92 (apicid << UVH_IPI_INT_APIC_ID_SHFT) | 92 (apicid << UVH_IPI_INT_APIC_ID_SHFT) |
93 (GENERIC_INTERRUPT_VECTOR << UVH_IPI_INT_VECTOR_SHFT); 93 (X86_PLATFORM_IPI_VECTOR << UVH_IPI_INT_VECTOR_SHFT);
94 94
95 uv_write_global_mmr64(pnode, UVH_IPI_INT, val); 95 uv_write_global_mmr64(pnode, UVH_IPI_INT, val);
96} 96}
@@ -115,7 +115,7 @@ static int uv_setup_intr(int cpu, u64 expires)
115 uv_write_global_mmr64(pnode, UVH_EVENT_OCCURRED0_ALIAS, 115 uv_write_global_mmr64(pnode, UVH_EVENT_OCCURRED0_ALIAS,
116 UVH_EVENT_OCCURRED0_RTC1_MASK); 116 UVH_EVENT_OCCURRED0_RTC1_MASK);
117 117
118 val = (GENERIC_INTERRUPT_VECTOR << UVH_RTC1_INT_CONFIG_VECTOR_SHFT) | 118 val = (X86_PLATFORM_IPI_VECTOR << UVH_RTC1_INT_CONFIG_VECTOR_SHFT) |
119 ((u64)cpu_physical_id(cpu) << UVH_RTC1_INT_CONFIG_APIC_ID_SHFT); 119 ((u64)cpu_physical_id(cpu) << UVH_RTC1_INT_CONFIG_APIC_ID_SHFT);
120 120
121 /* Set configuration */ 121 /* Set configuration */
@@ -123,7 +123,10 @@ static int uv_setup_intr(int cpu, u64 expires)
123 /* Initialize comparator value */ 123 /* Initialize comparator value */
124 uv_write_global_mmr64(pnode, UVH_INT_CMPB, expires); 124 uv_write_global_mmr64(pnode, UVH_INT_CMPB, expires);
125 125
126 return (expires < uv_read_rtc(NULL) && !uv_intr_pending(pnode)); 126 if (uv_read_rtc(NULL) <= expires)
127 return 0;
128
129 return !uv_intr_pending(pnode);
127} 130}
128 131
129/* 132/*
@@ -223,6 +226,7 @@ static int uv_rtc_set_timer(int cpu, u64 expires)
223 226
224 next_cpu = head->next_cpu; 227 next_cpu = head->next_cpu;
225 *t = expires; 228 *t = expires;
229
226 /* Will this one be next to go off? */ 230 /* Will this one be next to go off? */
227 if (next_cpu < 0 || bcpu == next_cpu || 231 if (next_cpu < 0 || bcpu == next_cpu ||
228 expires < head->cpu[next_cpu].expires) { 232 expires < head->cpu[next_cpu].expires) {
@@ -231,7 +235,7 @@ static int uv_rtc_set_timer(int cpu, u64 expires)
231 *t = ULLONG_MAX; 235 *t = ULLONG_MAX;
232 uv_rtc_find_next_timer(head, pnode); 236 uv_rtc_find_next_timer(head, pnode);
233 spin_unlock_irqrestore(&head->lock, flags); 237 spin_unlock_irqrestore(&head->lock, flags);
234 return 1; 238 return -ETIME;
235 } 239 }
236 } 240 }
237 241
@@ -244,7 +248,7 @@ static int uv_rtc_set_timer(int cpu, u64 expires)
244 * 248 *
245 * Returns 1 if this timer was pending. 249 * Returns 1 if this timer was pending.
246 */ 250 */
247static int uv_rtc_unset_timer(int cpu) 251static int uv_rtc_unset_timer(int cpu, int force)
248{ 252{
249 int pnode = uv_cpu_to_pnode(cpu); 253 int pnode = uv_cpu_to_pnode(cpu);
250 int bid = uv_cpu_to_blade_id(cpu); 254 int bid = uv_cpu_to_blade_id(cpu);
@@ -256,14 +260,15 @@ static int uv_rtc_unset_timer(int cpu)
256 260
257 spin_lock_irqsave(&head->lock, flags); 261 spin_lock_irqsave(&head->lock, flags);
258 262
259 if (head->next_cpu == bcpu && uv_read_rtc(NULL) >= *t) 263 if ((head->next_cpu == bcpu && uv_read_rtc(NULL) >= *t) || force)
260 rc = 1; 264 rc = 1;
261 265
262 *t = ULLONG_MAX; 266 if (rc) {
263 267 *t = ULLONG_MAX;
264 /* Was the hardware setup for this timer? */ 268 /* Was the hardware setup for this timer? */
265 if (head->next_cpu == bcpu) 269 if (head->next_cpu == bcpu)
266 uv_rtc_find_next_timer(head, pnode); 270 uv_rtc_find_next_timer(head, pnode);
271 }
267 272
268 spin_unlock_irqrestore(&head->lock, flags); 273 spin_unlock_irqrestore(&head->lock, flags);
269 274
@@ -310,32 +315,32 @@ static void uv_rtc_timer_setup(enum clock_event_mode mode,
310 break; 315 break;
311 case CLOCK_EVT_MODE_UNUSED: 316 case CLOCK_EVT_MODE_UNUSED:
312 case CLOCK_EVT_MODE_SHUTDOWN: 317 case CLOCK_EVT_MODE_SHUTDOWN:
313 uv_rtc_unset_timer(ced_cpu); 318 uv_rtc_unset_timer(ced_cpu, 1);
314 break; 319 break;
315 } 320 }
316} 321}
317 322
318static void uv_rtc_interrupt(void) 323static void uv_rtc_interrupt(void)
319{ 324{
320 struct clock_event_device *ced = &__get_cpu_var(cpu_ced);
321 int cpu = smp_processor_id(); 325 int cpu = smp_processor_id();
326 struct clock_event_device *ced = &per_cpu(cpu_ced, cpu);
322 327
323 if (!ced || !ced->event_handler) 328 if (!ced || !ced->event_handler)
324 return; 329 return;
325 330
326 if (uv_rtc_unset_timer(cpu) != 1) 331 if (uv_rtc_unset_timer(cpu, 0) != 1)
327 return; 332 return;
328 333
329 ced->event_handler(ced); 334 ced->event_handler(ced);
330} 335}
331 336
332static int __init uv_enable_rtc(char *str) 337static int __init uv_enable_evt_rtc(char *str)
333{ 338{
334 uv_rtc_enable = 1; 339 uv_rtc_evt_enable = 1;
335 340
336 return 1; 341 return 1;
337} 342}
338__setup("uvrtc", uv_enable_rtc); 343__setup("uvrtcevt", uv_enable_evt_rtc);
339 344
340static __init void uv_rtc_register_clockevents(struct work_struct *dummy) 345static __init void uv_rtc_register_clockevents(struct work_struct *dummy)
341{ 346{
@@ -350,27 +355,32 @@ static __init int uv_rtc_setup_clock(void)
350{ 355{
351 int rc; 356 int rc;
352 357
353 if (!uv_rtc_enable || !is_uv_system() || generic_interrupt_extension) 358 if (!is_uv_system())
354 return -ENODEV; 359 return -ENODEV;
355 360
356 generic_interrupt_extension = uv_rtc_interrupt;
357
358 clocksource_uv.mult = clocksource_hz2mult(sn_rtc_cycles_per_second, 361 clocksource_uv.mult = clocksource_hz2mult(sn_rtc_cycles_per_second,
359 clocksource_uv.shift); 362 clocksource_uv.shift);
360 363
364 /* If single blade, prefer tsc */
365 if (uv_num_possible_blades() == 1)
366 clocksource_uv.rating = 250;
367
361 rc = clocksource_register(&clocksource_uv); 368 rc = clocksource_register(&clocksource_uv);
362 if (rc) { 369 if (rc)
363 generic_interrupt_extension = NULL; 370 printk(KERN_INFO "UV RTC clocksource failed rc %d\n", rc);
371 else
372 printk(KERN_INFO "UV RTC clocksource registered freq %lu MHz\n",
373 sn_rtc_cycles_per_second/(unsigned long)1E6);
374
375 if (rc || !uv_rtc_evt_enable || x86_platform_ipi_callback)
364 return rc; 376 return rc;
365 }
366 377
367 /* Setup and register clockevents */ 378 /* Setup and register clockevents */
368 rc = uv_rtc_allocate_timers(); 379 rc = uv_rtc_allocate_timers();
369 if (rc) { 380 if (rc)
370 clocksource_unregister(&clocksource_uv); 381 goto error;
371 generic_interrupt_extension = NULL; 382
372 return rc; 383 x86_platform_ipi_callback = uv_rtc_interrupt;
373 }
374 384
375 clock_event_device_uv.mult = div_sc(sn_rtc_cycles_per_second, 385 clock_event_device_uv.mult = div_sc(sn_rtc_cycles_per_second,
376 NSEC_PER_SEC, clock_event_device_uv.shift); 386 NSEC_PER_SEC, clock_event_device_uv.shift);
@@ -383,11 +393,19 @@ static __init int uv_rtc_setup_clock(void)
383 393
384 rc = schedule_on_each_cpu(uv_rtc_register_clockevents); 394 rc = schedule_on_each_cpu(uv_rtc_register_clockevents);
385 if (rc) { 395 if (rc) {
386 clocksource_unregister(&clocksource_uv); 396 x86_platform_ipi_callback = NULL;
387 generic_interrupt_extension = NULL;
388 uv_rtc_deallocate_timers(); 397 uv_rtc_deallocate_timers();
398 goto error;
389 } 399 }
390 400
401 printk(KERN_INFO "UV RTC clockevents registered\n");
402
403 return 0;
404
405error:
406 clocksource_unregister(&clocksource_uv);
407 printk(KERN_INFO "UV RTC clockevents failed rc %d\n", rc);
408
391 return rc; 409 return rc;
392} 410}
393arch_initcall(uv_rtc_setup_clock); 411arch_initcall(uv_rtc_setup_clock);
diff --git a/arch/x86/kernel/visws_quirks.c b/arch/x86/kernel/visws_quirks.c
index f068553a1b17..34a279a7471d 100644
--- a/arch/x86/kernel/visws_quirks.c
+++ b/arch/x86/kernel/visws_quirks.c
@@ -183,7 +183,7 @@ static void __init MP_processor_info(struct mpc_cpu *m)
183 return; 183 return;
184 } 184 }
185 185
186 apic_cpus = apic->apicid_to_cpu_present(m->apicid); 186 apic->apicid_to_cpu_present(m->apicid, &apic_cpus);
187 physids_or(phys_cpu_present_map, phys_cpu_present_map, apic_cpus); 187 physids_or(phys_cpu_present_map, phys_cpu_present_map, apic_cpus);
188 /* 188 /*
189 * Validate version 189 * Validate version
@@ -197,7 +197,7 @@ static void __init MP_processor_info(struct mpc_cpu *m)
197 apic_version[m->apicid] = ver; 197 apic_version[m->apicid] = ver;
198} 198}
199 199
200static void __init visws_find_smp_config(unsigned int reserve) 200static void __init visws_find_smp_config(void)
201{ 201{
202 struct mpc_cpu *mp = phys_to_virt(CO_CPU_TAB_PHYS); 202 struct mpc_cpu *mp = phys_to_virt(CO_CPU_TAB_PHYS);
203 unsigned short ncpus = readw(phys_to_virt(CO_CPU_NUM_PHYS)); 203 unsigned short ncpus = readw(phys_to_virt(CO_CPU_NUM_PHYS));
@@ -486,7 +486,7 @@ static void end_cobalt_irq(unsigned int irq)
486} 486}
487 487
488static struct irq_chip cobalt_irq_type = { 488static struct irq_chip cobalt_irq_type = {
489 .typename = "Cobalt-APIC", 489 .name = "Cobalt-APIC",
490 .startup = startup_cobalt_irq, 490 .startup = startup_cobalt_irq,
491 .shutdown = disable_cobalt_irq, 491 .shutdown = disable_cobalt_irq,
492 .enable = enable_cobalt_irq, 492 .enable = enable_cobalt_irq,
@@ -523,7 +523,7 @@ static void end_piix4_master_irq(unsigned int irq)
523} 523}
524 524
525static struct irq_chip piix4_master_irq_type = { 525static struct irq_chip piix4_master_irq_type = {
526 .typename = "PIIX4-master", 526 .name = "PIIX4-master",
527 .startup = startup_piix4_master_irq, 527 .startup = startup_piix4_master_irq,
528 .ack = ack_cobalt_irq, 528 .ack = ack_cobalt_irq,
529 .end = end_piix4_master_irq, 529 .end = end_piix4_master_irq,
@@ -531,7 +531,7 @@ static struct irq_chip piix4_master_irq_type = {
531 531
532 532
533static struct irq_chip piix4_virtual_irq_type = { 533static struct irq_chip piix4_virtual_irq_type = {
534 .typename = "PIIX4-virtual", 534 .name = "PIIX4-virtual",
535 .shutdown = disable_8259A_irq, 535 .shutdown = disable_8259A_irq,
536 .enable = enable_8259A_irq, 536 .enable = enable_8259A_irq,
537 .disable = disable_8259A_irq, 537 .disable = disable_8259A_irq,
diff --git a/arch/x86/kernel/vmiclock_32.c b/arch/x86/kernel/vmiclock_32.c
index 611b9e2360d3..74c92bb194df 100644
--- a/arch/x86/kernel/vmiclock_32.c
+++ b/arch/x86/kernel/vmiclock_32.c
@@ -226,7 +226,7 @@ static void __devinit vmi_time_init_clockevent(void)
226 evt->min_delta_ns = clockevent_delta2ns(1, evt); 226 evt->min_delta_ns = clockevent_delta2ns(1, evt);
227 evt->cpumask = cpumask_of(cpu); 227 evt->cpumask = cpumask_of(cpu);
228 228
229 printk(KERN_WARNING "vmi: registering clock event %s. mult=%lu shift=%u\n", 229 printk(KERN_WARNING "vmi: registering clock event %s. mult=%u shift=%u\n",
230 evt->name, evt->mult, evt->shift); 230 evt->name, evt->mult, evt->shift);
231 clockevents_register_device(evt); 231 clockevents_register_device(evt);
232} 232}
diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S
index 3c68fe2d46cf..f3f2104408d9 100644
--- a/arch/x86/kernel/vmlinux.lds.S
+++ b/arch/x86/kernel/vmlinux.lds.S
@@ -41,6 +41,32 @@ ENTRY(phys_startup_64)
41jiffies_64 = jiffies; 41jiffies_64 = jiffies;
42#endif 42#endif
43 43
44#if defined(CONFIG_X86_64) && defined(CONFIG_DEBUG_RODATA)
45/*
46 * On 64-bit, align RODATA to 2MB so that even with CONFIG_DEBUG_RODATA
47 * we retain large page mappings for boundaries spanning kernel text, rodata
48 * and data sections.
49 *
50 * However, kernel identity mappings will have different RWX permissions
51 * to the pages mapping to text and to the pages padding (which are freed) the
52 * text section. Hence kernel identity mappings will be broken to smaller
53 * pages. For 64-bit, kernel text and kernel identity mappings are different,
54 * so we can enable protection checks that come with CONFIG_DEBUG_RODATA,
55 * as well as retain 2MB large page mappings for kernel text.
56 */
57#define X64_ALIGN_DEBUG_RODATA_BEGIN . = ALIGN(HPAGE_SIZE);
58
59#define X64_ALIGN_DEBUG_RODATA_END \
60 . = ALIGN(HPAGE_SIZE); \
61 __end_rodata_hpage_align = .;
62
63#else
64
65#define X64_ALIGN_DEBUG_RODATA_BEGIN
66#define X64_ALIGN_DEBUG_RODATA_END
67
68#endif
69
44PHDRS { 70PHDRS {
45 text PT_LOAD FLAGS(5); /* R_E */ 71 text PT_LOAD FLAGS(5); /* R_E */
46 data PT_LOAD FLAGS(7); /* RWE */ 72 data PT_LOAD FLAGS(7); /* RWE */
@@ -90,7 +116,9 @@ SECTIONS
90 116
91 EXCEPTION_TABLE(16) :text = 0x9090 117 EXCEPTION_TABLE(16) :text = 0x9090
92 118
119 X64_ALIGN_DEBUG_RODATA_BEGIN
93 RO_DATA(PAGE_SIZE) 120 RO_DATA(PAGE_SIZE)
121 X64_ALIGN_DEBUG_RODATA_END
94 122
95 /* Data */ 123 /* Data */
96 .data : AT(ADDR(.data) - LOAD_OFFSET) { 124 .data : AT(ADDR(.data) - LOAD_OFFSET) {
@@ -107,13 +135,13 @@ SECTIONS
107 135
108 PAGE_ALIGNED_DATA(PAGE_SIZE) 136 PAGE_ALIGNED_DATA(PAGE_SIZE)
109 137
110 CACHELINE_ALIGNED_DATA(CONFIG_X86_L1_CACHE_BYTES) 138 CACHELINE_ALIGNED_DATA(L1_CACHE_BYTES)
111 139
112 DATA_DATA 140 DATA_DATA
113 CONSTRUCTORS 141 CONSTRUCTORS
114 142
115 /* rarely changed data like cpu maps */ 143 /* rarely changed data like cpu maps */
116 READ_MOSTLY_DATA(CONFIG_X86_INTERNODE_CACHE_BYTES) 144 READ_MOSTLY_DATA(INTERNODE_CACHE_BYTES)
117 145
118 /* End of data section */ 146 /* End of data section */
119 _edata = .; 147 _edata = .;
@@ -137,12 +165,12 @@ SECTIONS
137 *(.vsyscall_0) 165 *(.vsyscall_0)
138 } :user 166 } :user
139 167
140 . = ALIGN(CONFIG_X86_L1_CACHE_BYTES); 168 . = ALIGN(L1_CACHE_BYTES);
141 .vsyscall_fn : AT(VLOAD(.vsyscall_fn)) { 169 .vsyscall_fn : AT(VLOAD(.vsyscall_fn)) {
142 *(.vsyscall_fn) 170 *(.vsyscall_fn)
143 } 171 }
144 172
145 . = ALIGN(CONFIG_X86_L1_CACHE_BYTES); 173 . = ALIGN(L1_CACHE_BYTES);
146 .vsyscall_gtod_data : AT(VLOAD(.vsyscall_gtod_data)) { 174 .vsyscall_gtod_data : AT(VLOAD(.vsyscall_gtod_data)) {
147 *(.vsyscall_gtod_data) 175 *(.vsyscall_gtod_data)
148 } 176 }
@@ -166,7 +194,7 @@ SECTIONS
166 } 194 }
167 vgetcpu_mode = VVIRT(.vgetcpu_mode); 195 vgetcpu_mode = VVIRT(.vgetcpu_mode);
168 196
169 . = ALIGN(CONFIG_X86_L1_CACHE_BYTES); 197 . = ALIGN(L1_CACHE_BYTES);
170 .jiffies : AT(VLOAD(.jiffies)) { 198 .jiffies : AT(VLOAD(.jiffies)) {
171 *(.jiffies) 199 *(.jiffies)
172 } 200 }
diff --git a/arch/x86/kernel/vsyscall_64.c b/arch/x86/kernel/vsyscall_64.c
index 8cb4974ff599..9055e5872ff0 100644
--- a/arch/x86/kernel/vsyscall_64.c
+++ b/arch/x86/kernel/vsyscall_64.c
@@ -73,7 +73,8 @@ void update_vsyscall_tz(void)
73 write_sequnlock_irqrestore(&vsyscall_gtod_data.lock, flags); 73 write_sequnlock_irqrestore(&vsyscall_gtod_data.lock, flags);
74} 74}
75 75
76void update_vsyscall(struct timespec *wall_time, struct clocksource *clock) 76void update_vsyscall(struct timespec *wall_time, struct clocksource *clock,
77 u32 mult)
77{ 78{
78 unsigned long flags; 79 unsigned long flags;
79 80
@@ -82,7 +83,7 @@ void update_vsyscall(struct timespec *wall_time, struct clocksource *clock)
82 vsyscall_gtod_data.clock.vread = clock->vread; 83 vsyscall_gtod_data.clock.vread = clock->vread;
83 vsyscall_gtod_data.clock.cycle_last = clock->cycle_last; 84 vsyscall_gtod_data.clock.cycle_last = clock->cycle_last;
84 vsyscall_gtod_data.clock.mask = clock->mask; 85 vsyscall_gtod_data.clock.mask = clock->mask;
85 vsyscall_gtod_data.clock.mult = clock->mult; 86 vsyscall_gtod_data.clock.mult = mult;
86 vsyscall_gtod_data.clock.shift = clock->shift; 87 vsyscall_gtod_data.clock.shift = clock->shift;
87 vsyscall_gtod_data.wall_time_sec = wall_time->tv_sec; 88 vsyscall_gtod_data.wall_time_sec = wall_time->tv_sec;
88 vsyscall_gtod_data.wall_time_nsec = wall_time->tv_nsec; 89 vsyscall_gtod_data.wall_time_nsec = wall_time->tv_nsec;
@@ -237,7 +238,7 @@ static ctl_table kernel_table2[] = {
237}; 238};
238 239
239static ctl_table kernel_root_table2[] = { 240static ctl_table kernel_root_table2[] = {
240 { .ctl_name = CTL_KERN, .procname = "kernel", .mode = 0555, 241 { .procname = "kernel", .mode = 0555,
241 .child = kernel_table2 }, 242 .child = kernel_table2 },
242 {} 243 {}
243}; 244};
diff --git a/arch/x86/kernel/x8664_ksyms_64.c b/arch/x86/kernel/x8664_ksyms_64.c
index 3909e3ba5ce3..a1029769b6f2 100644
--- a/arch/x86/kernel/x8664_ksyms_64.c
+++ b/arch/x86/kernel/x8664_ksyms_64.c
@@ -30,9 +30,8 @@ EXPORT_SYMBOL(__put_user_8);
30 30
31EXPORT_SYMBOL(copy_user_generic); 31EXPORT_SYMBOL(copy_user_generic);
32EXPORT_SYMBOL(__copy_user_nocache); 32EXPORT_SYMBOL(__copy_user_nocache);
33EXPORT_SYMBOL(copy_from_user); 33EXPORT_SYMBOL(_copy_from_user);
34EXPORT_SYMBOL(copy_to_user); 34EXPORT_SYMBOL(_copy_to_user);
35EXPORT_SYMBOL(__copy_from_user_inatomic);
36 35
37EXPORT_SYMBOL(copy_page); 36EXPORT_SYMBOL(copy_page);
38EXPORT_SYMBOL(clear_page); 37EXPORT_SYMBOL(clear_page);
diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c
index 4449a4a2c2ed..ccd179dec36e 100644
--- a/arch/x86/kernel/x86_init.c
+++ b/arch/x86/kernel/x86_init.c
@@ -13,11 +13,15 @@
13#include <asm/e820.h> 13#include <asm/e820.h>
14#include <asm/time.h> 14#include <asm/time.h>
15#include <asm/irq.h> 15#include <asm/irq.h>
16#include <asm/pat.h>
16#include <asm/tsc.h> 17#include <asm/tsc.h>
18#include <asm/iommu.h>
17 19
18void __cpuinit x86_init_noop(void) { } 20void __cpuinit x86_init_noop(void) { }
19void __init x86_init_uint_noop(unsigned int unused) { } 21void __init x86_init_uint_noop(unsigned int unused) { }
20void __init x86_init_pgd_noop(pgd_t *unused) { } 22void __init x86_init_pgd_noop(pgd_t *unused) { }
23int __init iommu_init_noop(void) { return 0; }
24void iommu_shutdown_noop(void) { }
21 25
22/* 26/*
23 * The platform setup functions are preset with the default functions 27 * The platform setup functions are preset with the default functions
@@ -62,6 +66,10 @@ struct x86_init_ops x86_init __initdata = {
62 .tsc_pre_init = x86_init_noop, 66 .tsc_pre_init = x86_init_noop,
63 .timer_init = hpet_time_init, 67 .timer_init = hpet_time_init,
64 }, 68 },
69
70 .iommu = {
71 .iommu_init = iommu_init_noop,
72 },
65}; 73};
66 74
67struct x86_cpuinit_ops x86_cpuinit __cpuinitdata = { 75struct x86_cpuinit_ops x86_cpuinit __cpuinitdata = {
@@ -72,4 +80,6 @@ struct x86_platform_ops x86_platform = {
72 .calibrate_tsc = native_calibrate_tsc, 80 .calibrate_tsc = native_calibrate_tsc,
73 .get_wallclock = mach_get_cmos_time, 81 .get_wallclock = mach_get_cmos_time,
74 .set_wallclock = mach_set_rtc_mmss, 82 .set_wallclock = mach_set_rtc_mmss,
83 .iommu_shutdown = iommu_shutdown_noop,
84 .is_untracked_pat_range = is_ISA_range,
75}; 85};
diff --git a/arch/x86/kvm/Kconfig b/arch/x86/kvm/Kconfig
index b84e571f4175..4cd498332466 100644
--- a/arch/x86/kvm/Kconfig
+++ b/arch/x86/kvm/Kconfig
@@ -28,6 +28,7 @@ config KVM
28 select HAVE_KVM_IRQCHIP 28 select HAVE_KVM_IRQCHIP
29 select HAVE_KVM_EVENTFD 29 select HAVE_KVM_EVENTFD
30 select KVM_APIC_ARCHITECTURE 30 select KVM_APIC_ARCHITECTURE
31 select USER_RETURN_NOTIFIER
31 ---help--- 32 ---help---
32 Support hosting fully virtualized guest machines using hardware 33 Support hosting fully virtualized guest machines using hardware
33 virtualization extensions. You will need a fairly recent 34 virtualization extensions. You will need a fairly recent
diff --git a/arch/x86/kvm/Makefile b/arch/x86/kvm/Makefile
index 0e7fe78d0f74..31a7035c4bd9 100644
--- a/arch/x86/kvm/Makefile
+++ b/arch/x86/kvm/Makefile
@@ -6,7 +6,8 @@ CFLAGS_svm.o := -I.
6CFLAGS_vmx.o := -I. 6CFLAGS_vmx.o := -I.
7 7
8kvm-y += $(addprefix ../../../virt/kvm/, kvm_main.o ioapic.o \ 8kvm-y += $(addprefix ../../../virt/kvm/, kvm_main.o ioapic.o \
9 coalesced_mmio.o irq_comm.o eventfd.o) 9 coalesced_mmio.o irq_comm.o eventfd.o \
10 assigned-dev.o)
10kvm-$(CONFIG_IOMMU_API) += $(addprefix ../../../virt/kvm/, iommu.o) 11kvm-$(CONFIG_IOMMU_API) += $(addprefix ../../../virt/kvm/, iommu.o)
11 12
12kvm-y += x86.o mmu.o emulate.o i8259.o irq.o lapic.o \ 13kvm-y += x86.o mmu.o emulate.o i8259.o irq.o lapic.o \
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 1be5cd640e93..7e8faea4651e 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -75,6 +75,8 @@
75#define Group (1<<14) /* Bits 3:5 of modrm byte extend opcode */ 75#define Group (1<<14) /* Bits 3:5 of modrm byte extend opcode */
76#define GroupDual (1<<15) /* Alternate decoding of mod == 3 */ 76#define GroupDual (1<<15) /* Alternate decoding of mod == 3 */
77#define GroupMask 0xff /* Group number stored in bits 0:7 */ 77#define GroupMask 0xff /* Group number stored in bits 0:7 */
78/* Misc flags */
79#define No64 (1<<28)
78/* Source 2 operand type */ 80/* Source 2 operand type */
79#define Src2None (0<<29) 81#define Src2None (0<<29)
80#define Src2CL (1<<29) 82#define Src2CL (1<<29)
@@ -92,19 +94,23 @@ static u32 opcode_table[256] = {
92 /* 0x00 - 0x07 */ 94 /* 0x00 - 0x07 */
93 ByteOp | DstMem | SrcReg | ModRM, DstMem | SrcReg | ModRM, 95 ByteOp | DstMem | SrcReg | ModRM, DstMem | SrcReg | ModRM,
94 ByteOp | DstReg | SrcMem | ModRM, DstReg | SrcMem | ModRM, 96 ByteOp | DstReg | SrcMem | ModRM, DstReg | SrcMem | ModRM,
95 ByteOp | DstAcc | SrcImm, DstAcc | SrcImm, 0, 0, 97 ByteOp | DstAcc | SrcImm, DstAcc | SrcImm,
98 ImplicitOps | Stack | No64, ImplicitOps | Stack | No64,
96 /* 0x08 - 0x0F */ 99 /* 0x08 - 0x0F */
97 ByteOp | DstMem | SrcReg | ModRM, DstMem | SrcReg | ModRM, 100 ByteOp | DstMem | SrcReg | ModRM, DstMem | SrcReg | ModRM,
98 ByteOp | DstReg | SrcMem | ModRM, DstReg | SrcMem | ModRM, 101 ByteOp | DstReg | SrcMem | ModRM, DstReg | SrcMem | ModRM,
99 0, 0, 0, 0, 102 ByteOp | DstAcc | SrcImm, DstAcc | SrcImm,
103 ImplicitOps | Stack | No64, 0,
100 /* 0x10 - 0x17 */ 104 /* 0x10 - 0x17 */
101 ByteOp | DstMem | SrcReg | ModRM, DstMem | SrcReg | ModRM, 105 ByteOp | DstMem | SrcReg | ModRM, DstMem | SrcReg | ModRM,
102 ByteOp | DstReg | SrcMem | ModRM, DstReg | SrcMem | ModRM, 106 ByteOp | DstReg | SrcMem | ModRM, DstReg | SrcMem | ModRM,
103 ByteOp | DstAcc | SrcImm, DstAcc | SrcImm, 0, 0, 107 ByteOp | DstAcc | SrcImm, DstAcc | SrcImm,
108 ImplicitOps | Stack | No64, ImplicitOps | Stack | No64,
104 /* 0x18 - 0x1F */ 109 /* 0x18 - 0x1F */
105 ByteOp | DstMem | SrcReg | ModRM, DstMem | SrcReg | ModRM, 110 ByteOp | DstMem | SrcReg | ModRM, DstMem | SrcReg | ModRM,
106 ByteOp | DstReg | SrcMem | ModRM, DstReg | SrcMem | ModRM, 111 ByteOp | DstReg | SrcMem | ModRM, DstReg | SrcMem | ModRM,
107 ByteOp | DstAcc | SrcImm, DstAcc | SrcImm, 0, 0, 112 ByteOp | DstAcc | SrcImm, DstAcc | SrcImm,
113 ImplicitOps | Stack | No64, ImplicitOps | Stack | No64,
108 /* 0x20 - 0x27 */ 114 /* 0x20 - 0x27 */
109 ByteOp | DstMem | SrcReg | ModRM, DstMem | SrcReg | ModRM, 115 ByteOp | DstMem | SrcReg | ModRM, DstMem | SrcReg | ModRM,
110 ByteOp | DstReg | SrcMem | ModRM, DstReg | SrcMem | ModRM, 116 ByteOp | DstReg | SrcMem | ModRM, DstReg | SrcMem | ModRM,
@@ -133,7 +139,8 @@ static u32 opcode_table[256] = {
133 DstReg | Stack, DstReg | Stack, DstReg | Stack, DstReg | Stack, 139 DstReg | Stack, DstReg | Stack, DstReg | Stack, DstReg | Stack,
134 DstReg | Stack, DstReg | Stack, DstReg | Stack, DstReg | Stack, 140 DstReg | Stack, DstReg | Stack, DstReg | Stack, DstReg | Stack,
135 /* 0x60 - 0x67 */ 141 /* 0x60 - 0x67 */
136 0, 0, 0, DstReg | SrcMem32 | ModRM | Mov /* movsxd (x86/64) */ , 142 ImplicitOps | Stack | No64, ImplicitOps | Stack | No64,
143 0, DstReg | SrcMem32 | ModRM | Mov /* movsxd (x86/64) */ ,
137 0, 0, 0, 0, 144 0, 0, 0, 0,
138 /* 0x68 - 0x6F */ 145 /* 0x68 - 0x6F */
139 SrcImm | Mov | Stack, 0, SrcImmByte | Mov | Stack, 0, 146 SrcImm | Mov | Stack, 0, SrcImmByte | Mov | Stack, 0,
@@ -158,7 +165,7 @@ static u32 opcode_table[256] = {
158 /* 0x90 - 0x97 */ 165 /* 0x90 - 0x97 */
159 DstReg, DstReg, DstReg, DstReg, DstReg, DstReg, DstReg, DstReg, 166 DstReg, DstReg, DstReg, DstReg, DstReg, DstReg, DstReg, DstReg,
160 /* 0x98 - 0x9F */ 167 /* 0x98 - 0x9F */
161 0, 0, SrcImm | Src2Imm16, 0, 168 0, 0, SrcImm | Src2Imm16 | No64, 0,
162 ImplicitOps | Stack, ImplicitOps | Stack, 0, 0, 169 ImplicitOps | Stack, ImplicitOps | Stack, 0, 0,
163 /* 0xA0 - 0xA7 */ 170 /* 0xA0 - 0xA7 */
164 ByteOp | DstReg | SrcMem | Mov | MemAbs, DstReg | SrcMem | Mov | MemAbs, 171 ByteOp | DstReg | SrcMem | Mov | MemAbs, DstReg | SrcMem | Mov | MemAbs,
@@ -185,7 +192,7 @@ static u32 opcode_table[256] = {
185 ByteOp | DstMem | SrcImm | ModRM | Mov, DstMem | SrcImm | ModRM | Mov, 192 ByteOp | DstMem | SrcImm | ModRM | Mov, DstMem | SrcImm | ModRM | Mov,
186 /* 0xC8 - 0xCF */ 193 /* 0xC8 - 0xCF */
187 0, 0, 0, ImplicitOps | Stack, 194 0, 0, 0, ImplicitOps | Stack,
188 ImplicitOps, SrcImmByte, ImplicitOps, ImplicitOps, 195 ImplicitOps, SrcImmByte, ImplicitOps | No64, ImplicitOps,
189 /* 0xD0 - 0xD7 */ 196 /* 0xD0 - 0xD7 */
190 ByteOp | DstMem | SrcImplicit | ModRM, DstMem | SrcImplicit | ModRM, 197 ByteOp | DstMem | SrcImplicit | ModRM, DstMem | SrcImplicit | ModRM,
191 ByteOp | DstMem | SrcImplicit | ModRM, DstMem | SrcImplicit | ModRM, 198 ByteOp | DstMem | SrcImplicit | ModRM, DstMem | SrcImplicit | ModRM,
@@ -198,7 +205,7 @@ static u32 opcode_table[256] = {
198 ByteOp | SrcImmUByte, SrcImmUByte, 205 ByteOp | SrcImmUByte, SrcImmUByte,
199 /* 0xE8 - 0xEF */ 206 /* 0xE8 - 0xEF */
200 SrcImm | Stack, SrcImm | ImplicitOps, 207 SrcImm | Stack, SrcImm | ImplicitOps,
201 SrcImmU | Src2Imm16, SrcImmByte | ImplicitOps, 208 SrcImmU | Src2Imm16 | No64, SrcImmByte | ImplicitOps,
202 SrcNone | ByteOp | ImplicitOps, SrcNone | ImplicitOps, 209 SrcNone | ByteOp | ImplicitOps, SrcNone | ImplicitOps,
203 SrcNone | ByteOp | ImplicitOps, SrcNone | ImplicitOps, 210 SrcNone | ByteOp | ImplicitOps, SrcNone | ImplicitOps,
204 /* 0xF0 - 0xF7 */ 211 /* 0xF0 - 0xF7 */
@@ -244,11 +251,13 @@ static u32 twobyte_table[256] = {
244 /* 0x90 - 0x9F */ 251 /* 0x90 - 0x9F */
245 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 252 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
246 /* 0xA0 - 0xA7 */ 253 /* 0xA0 - 0xA7 */
247 0, 0, 0, DstMem | SrcReg | ModRM | BitOp, 254 ImplicitOps | Stack, ImplicitOps | Stack,
255 0, DstMem | SrcReg | ModRM | BitOp,
248 DstMem | SrcReg | Src2ImmByte | ModRM, 256 DstMem | SrcReg | Src2ImmByte | ModRM,
249 DstMem | SrcReg | Src2CL | ModRM, 0, 0, 257 DstMem | SrcReg | Src2CL | ModRM, 0, 0,
250 /* 0xA8 - 0xAF */ 258 /* 0xA8 - 0xAF */
251 0, 0, 0, DstMem | SrcReg | ModRM | BitOp, 259 ImplicitOps | Stack, ImplicitOps | Stack,
260 0, DstMem | SrcReg | ModRM | BitOp,
252 DstMem | SrcReg | Src2ImmByte | ModRM, 261 DstMem | SrcReg | Src2ImmByte | ModRM,
253 DstMem | SrcReg | Src2CL | ModRM, 262 DstMem | SrcReg | Src2CL | ModRM,
254 ModRM, 0, 263 ModRM, 0,
@@ -613,6 +622,9 @@ static int do_insn_fetch(struct x86_emulate_ctxt *ctxt,
613{ 622{
614 int rc = 0; 623 int rc = 0;
615 624
625 /* x86 instructions are limited to 15 bytes. */
626 if (eip + size - ctxt->decode.eip_orig > 15)
627 return X86EMUL_UNHANDLEABLE;
616 eip += ctxt->cs_base; 628 eip += ctxt->cs_base;
617 while (size--) { 629 while (size--) {
618 rc = do_fetch_insn_byte(ctxt, ops, eip++, dest++); 630 rc = do_fetch_insn_byte(ctxt, ops, eip++, dest++);
@@ -871,7 +883,7 @@ x86_decode_insn(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops)
871 /* Shadow copy of register state. Committed on successful emulation. */ 883 /* Shadow copy of register state. Committed on successful emulation. */
872 884
873 memset(c, 0, sizeof(struct decode_cache)); 885 memset(c, 0, sizeof(struct decode_cache));
874 c->eip = kvm_rip_read(ctxt->vcpu); 886 c->eip = c->eip_orig = kvm_rip_read(ctxt->vcpu);
875 ctxt->cs_base = seg_base(ctxt, VCPU_SREG_CS); 887 ctxt->cs_base = seg_base(ctxt, VCPU_SREG_CS);
876 memcpy(c->regs, ctxt->vcpu->arch.regs, sizeof c->regs); 888 memcpy(c->regs, ctxt->vcpu->arch.regs, sizeof c->regs);
877 889
@@ -962,6 +974,11 @@ done_prefixes:
962 } 974 }
963 } 975 }
964 976
977 if (mode == X86EMUL_MODE_PROT64 && (c->d & No64)) {
978 kvm_report_emulation_failure(ctxt->vcpu, "invalid x86/64 instruction");;
979 return -1;
980 }
981
965 if (c->d & Group) { 982 if (c->d & Group) {
966 group = c->d & GroupMask; 983 group = c->d & GroupMask;
967 c->modrm = insn_fetch(u8, 1, c->eip); 984 c->modrm = insn_fetch(u8, 1, c->eip);
@@ -1186,6 +1203,69 @@ static int emulate_pop(struct x86_emulate_ctxt *ctxt,
1186 return rc; 1203 return rc;
1187} 1204}
1188 1205
1206static void emulate_push_sreg(struct x86_emulate_ctxt *ctxt, int seg)
1207{
1208 struct decode_cache *c = &ctxt->decode;
1209 struct kvm_segment segment;
1210
1211 kvm_x86_ops->get_segment(ctxt->vcpu, &segment, seg);
1212
1213 c->src.val = segment.selector;
1214 emulate_push(ctxt);
1215}
1216
1217static int emulate_pop_sreg(struct x86_emulate_ctxt *ctxt,
1218 struct x86_emulate_ops *ops, int seg)
1219{
1220 struct decode_cache *c = &ctxt->decode;
1221 unsigned long selector;
1222 int rc;
1223
1224 rc = emulate_pop(ctxt, ops, &selector, c->op_bytes);
1225 if (rc != 0)
1226 return rc;
1227
1228 rc = kvm_load_segment_descriptor(ctxt->vcpu, (u16)selector, 1, seg);
1229 return rc;
1230}
1231
1232static void emulate_pusha(struct x86_emulate_ctxt *ctxt)
1233{
1234 struct decode_cache *c = &ctxt->decode;
1235 unsigned long old_esp = c->regs[VCPU_REGS_RSP];
1236 int reg = VCPU_REGS_RAX;
1237
1238 while (reg <= VCPU_REGS_RDI) {
1239 (reg == VCPU_REGS_RSP) ?
1240 (c->src.val = old_esp) : (c->src.val = c->regs[reg]);
1241
1242 emulate_push(ctxt);
1243 ++reg;
1244 }
1245}
1246
1247static int emulate_popa(struct x86_emulate_ctxt *ctxt,
1248 struct x86_emulate_ops *ops)
1249{
1250 struct decode_cache *c = &ctxt->decode;
1251 int rc = 0;
1252 int reg = VCPU_REGS_RDI;
1253
1254 while (reg >= VCPU_REGS_RAX) {
1255 if (reg == VCPU_REGS_RSP) {
1256 register_address_increment(c, &c->regs[VCPU_REGS_RSP],
1257 c->op_bytes);
1258 --reg;
1259 }
1260
1261 rc = emulate_pop(ctxt, ops, &c->regs[reg], c->op_bytes);
1262 if (rc != 0)
1263 break;
1264 --reg;
1265 }
1266 return rc;
1267}
1268
1189static inline int emulate_grp1a(struct x86_emulate_ctxt *ctxt, 1269static inline int emulate_grp1a(struct x86_emulate_ctxt *ctxt,
1190 struct x86_emulate_ops *ops) 1270 struct x86_emulate_ops *ops)
1191{ 1271{
@@ -1707,18 +1787,45 @@ special_insn:
1707 add: /* add */ 1787 add: /* add */
1708 emulate_2op_SrcV("add", c->src, c->dst, ctxt->eflags); 1788 emulate_2op_SrcV("add", c->src, c->dst, ctxt->eflags);
1709 break; 1789 break;
1790 case 0x06: /* push es */
1791 emulate_push_sreg(ctxt, VCPU_SREG_ES);
1792 break;
1793 case 0x07: /* pop es */
1794 rc = emulate_pop_sreg(ctxt, ops, VCPU_SREG_ES);
1795 if (rc != 0)
1796 goto done;
1797 break;
1710 case 0x08 ... 0x0d: 1798 case 0x08 ... 0x0d:
1711 or: /* or */ 1799 or: /* or */
1712 emulate_2op_SrcV("or", c->src, c->dst, ctxt->eflags); 1800 emulate_2op_SrcV("or", c->src, c->dst, ctxt->eflags);
1713 break; 1801 break;
1802 case 0x0e: /* push cs */
1803 emulate_push_sreg(ctxt, VCPU_SREG_CS);
1804 break;
1714 case 0x10 ... 0x15: 1805 case 0x10 ... 0x15:
1715 adc: /* adc */ 1806 adc: /* adc */
1716 emulate_2op_SrcV("adc", c->src, c->dst, ctxt->eflags); 1807 emulate_2op_SrcV("adc", c->src, c->dst, ctxt->eflags);
1717 break; 1808 break;
1809 case 0x16: /* push ss */
1810 emulate_push_sreg(ctxt, VCPU_SREG_SS);
1811 break;
1812 case 0x17: /* pop ss */
1813 rc = emulate_pop_sreg(ctxt, ops, VCPU_SREG_SS);
1814 if (rc != 0)
1815 goto done;
1816 break;
1718 case 0x18 ... 0x1d: 1817 case 0x18 ... 0x1d:
1719 sbb: /* sbb */ 1818 sbb: /* sbb */
1720 emulate_2op_SrcV("sbb", c->src, c->dst, ctxt->eflags); 1819 emulate_2op_SrcV("sbb", c->src, c->dst, ctxt->eflags);
1721 break; 1820 break;
1821 case 0x1e: /* push ds */
1822 emulate_push_sreg(ctxt, VCPU_SREG_DS);
1823 break;
1824 case 0x1f: /* pop ds */
1825 rc = emulate_pop_sreg(ctxt, ops, VCPU_SREG_DS);
1826 if (rc != 0)
1827 goto done;
1828 break;
1722 case 0x20 ... 0x25: 1829 case 0x20 ... 0x25:
1723 and: /* and */ 1830 and: /* and */
1724 emulate_2op_SrcV("and", c->src, c->dst, ctxt->eflags); 1831 emulate_2op_SrcV("and", c->src, c->dst, ctxt->eflags);
@@ -1750,6 +1857,14 @@ special_insn:
1750 if (rc != 0) 1857 if (rc != 0)
1751 goto done; 1858 goto done;
1752 break; 1859 break;
1860 case 0x60: /* pusha */
1861 emulate_pusha(ctxt);
1862 break;
1863 case 0x61: /* popa */
1864 rc = emulate_popa(ctxt, ops);
1865 if (rc != 0)
1866 goto done;
1867 break;
1753 case 0x63: /* movsxd */ 1868 case 0x63: /* movsxd */
1754 if (ctxt->mode != X86EMUL_MODE_PROT64) 1869 if (ctxt->mode != X86EMUL_MODE_PROT64)
1755 goto cannot_emulate; 1870 goto cannot_emulate;
@@ -1761,7 +1876,7 @@ special_insn:
1761 break; 1876 break;
1762 case 0x6c: /* insb */ 1877 case 0x6c: /* insb */
1763 case 0x6d: /* insw/insd */ 1878 case 0x6d: /* insw/insd */
1764 if (kvm_emulate_pio_string(ctxt->vcpu, NULL, 1879 if (kvm_emulate_pio_string(ctxt->vcpu,
1765 1, 1880 1,
1766 (c->d & ByteOp) ? 1 : c->op_bytes, 1881 (c->d & ByteOp) ? 1 : c->op_bytes,
1767 c->rep_prefix ? 1882 c->rep_prefix ?
@@ -1777,7 +1892,7 @@ special_insn:
1777 return 0; 1892 return 0;
1778 case 0x6e: /* outsb */ 1893 case 0x6e: /* outsb */
1779 case 0x6f: /* outsw/outsd */ 1894 case 0x6f: /* outsw/outsd */
1780 if (kvm_emulate_pio_string(ctxt->vcpu, NULL, 1895 if (kvm_emulate_pio_string(ctxt->vcpu,
1781 0, 1896 0,
1782 (c->d & ByteOp) ? 1 : c->op_bytes, 1897 (c->d & ByteOp) ? 1 : c->op_bytes,
1783 c->rep_prefix ? 1898 c->rep_prefix ?
@@ -2070,7 +2185,7 @@ special_insn:
2070 case 0xef: /* out (e/r)ax,dx */ 2185 case 0xef: /* out (e/r)ax,dx */
2071 port = c->regs[VCPU_REGS_RDX]; 2186 port = c->regs[VCPU_REGS_RDX];
2072 io_dir_in = 0; 2187 io_dir_in = 0;
2073 do_io: if (kvm_emulate_pio(ctxt->vcpu, NULL, io_dir_in, 2188 do_io: if (kvm_emulate_pio(ctxt->vcpu, io_dir_in,
2074 (c->d & ByteOp) ? 1 : c->op_bytes, 2189 (c->d & ByteOp) ? 1 : c->op_bytes,
2075 port) != 0) { 2190 port) != 0) {
2076 c->eip = saved_eip; 2191 c->eip = saved_eip;
@@ -2297,6 +2412,14 @@ twobyte_insn:
2297 jmp_rel(c, c->src.val); 2412 jmp_rel(c, c->src.val);
2298 c->dst.type = OP_NONE; 2413 c->dst.type = OP_NONE;
2299 break; 2414 break;
2415 case 0xa0: /* push fs */
2416 emulate_push_sreg(ctxt, VCPU_SREG_FS);
2417 break;
2418 case 0xa1: /* pop fs */
2419 rc = emulate_pop_sreg(ctxt, ops, VCPU_SREG_FS);
2420 if (rc != 0)
2421 goto done;
2422 break;
2300 case 0xa3: 2423 case 0xa3:
2301 bt: /* bt */ 2424 bt: /* bt */
2302 c->dst.type = OP_NONE; 2425 c->dst.type = OP_NONE;
@@ -2308,6 +2431,14 @@ twobyte_insn:
2308 case 0xa5: /* shld cl, r, r/m */ 2431 case 0xa5: /* shld cl, r, r/m */
2309 emulate_2op_cl("shld", c->src2, c->src, c->dst, ctxt->eflags); 2432 emulate_2op_cl("shld", c->src2, c->src, c->dst, ctxt->eflags);
2310 break; 2433 break;
2434 case 0xa8: /* push gs */
2435 emulate_push_sreg(ctxt, VCPU_SREG_GS);
2436 break;
2437 case 0xa9: /* pop gs */
2438 rc = emulate_pop_sreg(ctxt, ops, VCPU_SREG_GS);
2439 if (rc != 0)
2440 goto done;
2441 break;
2311 case 0xab: 2442 case 0xab:
2312 bts: /* bts */ 2443 bts: /* bts */
2313 /* only subword offset */ 2444 /* only subword offset */
diff --git a/arch/x86/kvm/i8254.c b/arch/x86/kvm/i8254.c
index 144e7f60b5e2..fab7440c9bb2 100644
--- a/arch/x86/kvm/i8254.c
+++ b/arch/x86/kvm/i8254.c
@@ -688,10 +688,8 @@ static void __inject_pit_timer_intr(struct kvm *kvm)
688 struct kvm_vcpu *vcpu; 688 struct kvm_vcpu *vcpu;
689 int i; 689 int i;
690 690
691 mutex_lock(&kvm->irq_lock);
692 kvm_set_irq(kvm, kvm->arch.vpit->irq_source_id, 0, 1); 691 kvm_set_irq(kvm, kvm->arch.vpit->irq_source_id, 0, 1);
693 kvm_set_irq(kvm, kvm->arch.vpit->irq_source_id, 0, 0); 692 kvm_set_irq(kvm, kvm->arch.vpit->irq_source_id, 0, 0);
694 mutex_unlock(&kvm->irq_lock);
695 693
696 /* 694 /*
697 * Provides NMI watchdog support via Virtual Wire mode. 695 * Provides NMI watchdog support via Virtual Wire mode.
diff --git a/arch/x86/kvm/i8259.c b/arch/x86/kvm/i8259.c
index 01f151682802..d057c0cbd245 100644
--- a/arch/x86/kvm/i8259.c
+++ b/arch/x86/kvm/i8259.c
@@ -38,7 +38,15 @@ static void pic_clear_isr(struct kvm_kpic_state *s, int irq)
38 s->isr_ack |= (1 << irq); 38 s->isr_ack |= (1 << irq);
39 if (s != &s->pics_state->pics[0]) 39 if (s != &s->pics_state->pics[0])
40 irq += 8; 40 irq += 8;
41 /*
42 * We are dropping lock while calling ack notifiers since ack
43 * notifier callbacks for assigned devices call into PIC recursively.
44 * Other interrupt may be delivered to PIC while lock is dropped but
45 * it should be safe since PIC state is already updated at this stage.
46 */
47 spin_unlock(&s->pics_state->lock);
41 kvm_notify_acked_irq(s->pics_state->kvm, SELECT_PIC(irq), irq); 48 kvm_notify_acked_irq(s->pics_state->kvm, SELECT_PIC(irq), irq);
49 spin_lock(&s->pics_state->lock);
42} 50}
43 51
44void kvm_pic_clear_isr_ack(struct kvm *kvm) 52void kvm_pic_clear_isr_ack(struct kvm *kvm)
@@ -176,16 +184,18 @@ int kvm_pic_set_irq(void *opaque, int irq, int level)
176static inline void pic_intack(struct kvm_kpic_state *s, int irq) 184static inline void pic_intack(struct kvm_kpic_state *s, int irq)
177{ 185{
178 s->isr |= 1 << irq; 186 s->isr |= 1 << irq;
179 if (s->auto_eoi) {
180 if (s->rotate_on_auto_eoi)
181 s->priority_add = (irq + 1) & 7;
182 pic_clear_isr(s, irq);
183 }
184 /* 187 /*
185 * We don't clear a level sensitive interrupt here 188 * We don't clear a level sensitive interrupt here
186 */ 189 */
187 if (!(s->elcr & (1 << irq))) 190 if (!(s->elcr & (1 << irq)))
188 s->irr &= ~(1 << irq); 191 s->irr &= ~(1 << irq);
192
193 if (s->auto_eoi) {
194 if (s->rotate_on_auto_eoi)
195 s->priority_add = (irq + 1) & 7;
196 pic_clear_isr(s, irq);
197 }
198
189} 199}
190 200
191int kvm_pic_read_irq(struct kvm *kvm) 201int kvm_pic_read_irq(struct kvm *kvm)
@@ -225,22 +235,11 @@ int kvm_pic_read_irq(struct kvm *kvm)
225 235
226void kvm_pic_reset(struct kvm_kpic_state *s) 236void kvm_pic_reset(struct kvm_kpic_state *s)
227{ 237{
228 int irq, irqbase, n; 238 int irq;
229 struct kvm *kvm = s->pics_state->irq_request_opaque; 239 struct kvm *kvm = s->pics_state->irq_request_opaque;
230 struct kvm_vcpu *vcpu0 = kvm->bsp_vcpu; 240 struct kvm_vcpu *vcpu0 = kvm->bsp_vcpu;
241 u8 irr = s->irr, isr = s->imr;
231 242
232 if (s == &s->pics_state->pics[0])
233 irqbase = 0;
234 else
235 irqbase = 8;
236
237 for (irq = 0; irq < PIC_NUM_PINS/2; irq++) {
238 if (vcpu0 && kvm_apic_accept_pic_intr(vcpu0))
239 if (s->irr & (1 << irq) || s->isr & (1 << irq)) {
240 n = irq + irqbase;
241 kvm_notify_acked_irq(kvm, SELECT_PIC(n), n);
242 }
243 }
244 s->last_irr = 0; 243 s->last_irr = 0;
245 s->irr = 0; 244 s->irr = 0;
246 s->imr = 0; 245 s->imr = 0;
@@ -256,6 +255,13 @@ void kvm_pic_reset(struct kvm_kpic_state *s)
256 s->rotate_on_auto_eoi = 0; 255 s->rotate_on_auto_eoi = 0;
257 s->special_fully_nested_mode = 0; 256 s->special_fully_nested_mode = 0;
258 s->init4 = 0; 257 s->init4 = 0;
258
259 for (irq = 0; irq < PIC_NUM_PINS/2; irq++) {
260 if (vcpu0 && kvm_apic_accept_pic_intr(vcpu0))
261 if (irr & (1 << irq) || isr & (1 << irq)) {
262 pic_clear_isr(s, irq);
263 }
264 }
259} 265}
260 266
261static void pic_ioport_write(void *opaque, u32 addr, u32 val) 267static void pic_ioport_write(void *opaque, u32 addr, u32 val)
@@ -298,9 +304,9 @@ static void pic_ioport_write(void *opaque, u32 addr, u32 val)
298 priority = get_priority(s, s->isr); 304 priority = get_priority(s, s->isr);
299 if (priority != 8) { 305 if (priority != 8) {
300 irq = (priority + s->priority_add) & 7; 306 irq = (priority + s->priority_add) & 7;
301 pic_clear_isr(s, irq);
302 if (cmd == 5) 307 if (cmd == 5)
303 s->priority_add = (irq + 1) & 7; 308 s->priority_add = (irq + 1) & 7;
309 pic_clear_isr(s, irq);
304 pic_update_irq(s->pics_state); 310 pic_update_irq(s->pics_state);
305 } 311 }
306 break; 312 break;
diff --git a/arch/x86/kvm/irq.h b/arch/x86/kvm/irq.h
index 7d6058a2fd38..be399e207d57 100644
--- a/arch/x86/kvm/irq.h
+++ b/arch/x86/kvm/irq.h
@@ -71,6 +71,7 @@ struct kvm_pic {
71 int output; /* intr from master PIC */ 71 int output; /* intr from master PIC */
72 struct kvm_io_device dev; 72 struct kvm_io_device dev;
73 void (*ack_notifier)(void *opaque, int irq); 73 void (*ack_notifier)(void *opaque, int irq);
74 unsigned long irq_states[16];
74}; 75};
75 76
76struct kvm_pic *kvm_create_pic(struct kvm *kvm); 77struct kvm_pic *kvm_create_pic(struct kvm *kvm);
@@ -85,7 +86,11 @@ static inline struct kvm_pic *pic_irqchip(struct kvm *kvm)
85 86
86static inline int irqchip_in_kernel(struct kvm *kvm) 87static inline int irqchip_in_kernel(struct kvm *kvm)
87{ 88{
88 return pic_irqchip(kvm) != NULL; 89 int ret;
90
91 ret = (pic_irqchip(kvm) != NULL);
92 smp_rmb();
93 return ret;
89} 94}
90 95
91void kvm_pic_reset(struct kvm_kpic_state *s); 96void kvm_pic_reset(struct kvm_kpic_state *s);
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index 23c217692ea9..cd60c0bd1b32 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -32,7 +32,6 @@
32#include <asm/current.h> 32#include <asm/current.h>
33#include <asm/apicdef.h> 33#include <asm/apicdef.h>
34#include <asm/atomic.h> 34#include <asm/atomic.h>
35#include <asm/apicdef.h>
36#include "kvm_cache_regs.h" 35#include "kvm_cache_regs.h"
37#include "irq.h" 36#include "irq.h"
38#include "trace.h" 37#include "trace.h"
@@ -471,11 +470,8 @@ static void apic_set_eoi(struct kvm_lapic *apic)
471 trigger_mode = IOAPIC_LEVEL_TRIG; 470 trigger_mode = IOAPIC_LEVEL_TRIG;
472 else 471 else
473 trigger_mode = IOAPIC_EDGE_TRIG; 472 trigger_mode = IOAPIC_EDGE_TRIG;
474 if (!(apic_get_reg(apic, APIC_SPIV) & APIC_SPIV_DIRECTED_EOI)) { 473 if (!(apic_get_reg(apic, APIC_SPIV) & APIC_SPIV_DIRECTED_EOI))
475 mutex_lock(&apic->vcpu->kvm->irq_lock);
476 kvm_ioapic_update_eoi(apic->vcpu->kvm, vector, trigger_mode); 474 kvm_ioapic_update_eoi(apic->vcpu->kvm, vector, trigger_mode);
477 mutex_unlock(&apic->vcpu->kvm->irq_lock);
478 }
479} 475}
480 476
481static void apic_send_ipi(struct kvm_lapic *apic) 477static void apic_send_ipi(struct kvm_lapic *apic)
@@ -504,9 +500,7 @@ static void apic_send_ipi(struct kvm_lapic *apic)
504 irq.trig_mode, irq.level, irq.dest_mode, irq.delivery_mode, 500 irq.trig_mode, irq.level, irq.dest_mode, irq.delivery_mode,
505 irq.vector); 501 irq.vector);
506 502
507 mutex_lock(&apic->vcpu->kvm->irq_lock);
508 kvm_irq_delivery_to_apic(apic->vcpu->kvm, apic, &irq); 503 kvm_irq_delivery_to_apic(apic->vcpu->kvm, apic, &irq);
509 mutex_unlock(&apic->vcpu->kvm->irq_lock);
510} 504}
511 505
512static u32 apic_get_tmcct(struct kvm_lapic *apic) 506static u32 apic_get_tmcct(struct kvm_lapic *apic)
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 818b92ad82cf..4c3e5b2314cb 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -2789,7 +2789,7 @@ int kvm_mmu_page_fault(struct kvm_vcpu *vcpu, gva_t cr2, u32 error_code)
2789 if (r) 2789 if (r)
2790 goto out; 2790 goto out;
2791 2791
2792 er = emulate_instruction(vcpu, vcpu->run, cr2, error_code, 0); 2792 er = emulate_instruction(vcpu, cr2, error_code, 0);
2793 2793
2794 switch (er) { 2794 switch (er) {
2795 case EMULATE_DONE: 2795 case EMULATE_DONE:
@@ -2800,6 +2800,7 @@ int kvm_mmu_page_fault(struct kvm_vcpu *vcpu, gva_t cr2, u32 error_code)
2800 case EMULATE_FAIL: 2800 case EMULATE_FAIL:
2801 vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR; 2801 vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR;
2802 vcpu->run->internal.suberror = KVM_INTERNAL_ERROR_EMULATION; 2802 vcpu->run->internal.suberror = KVM_INTERNAL_ERROR_EMULATION;
2803 vcpu->run->internal.ndata = 0;
2803 return 0; 2804 return 0;
2804 default: 2805 default:
2805 BUG(); 2806 BUG();
diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h
index 72558f8ff3f5..a6017132fba8 100644
--- a/arch/x86/kvm/paging_tmpl.h
+++ b/arch/x86/kvm/paging_tmpl.h
@@ -467,7 +467,6 @@ static void FNAME(invlpg)(struct kvm_vcpu *vcpu, gva_t gva)
467 level = iterator.level; 467 level = iterator.level;
468 sptep = iterator.sptep; 468 sptep = iterator.sptep;
469 469
470 /* FIXME: properly handle invlpg on large guest pages */
471 if (level == PT_PAGE_TABLE_LEVEL || 470 if (level == PT_PAGE_TABLE_LEVEL ||
472 ((level == PT_DIRECTORY_LEVEL && is_large_pte(*sptep))) || 471 ((level == PT_DIRECTORY_LEVEL && is_large_pte(*sptep))) ||
473 ((level == PT_PDPE_LEVEL && is_large_pte(*sptep)))) { 472 ((level == PT_PDPE_LEVEL && is_large_pte(*sptep)))) {
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index c17404add91f..3de0b37ec038 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -46,6 +46,7 @@ MODULE_LICENSE("GPL");
46#define SVM_FEATURE_NPT (1 << 0) 46#define SVM_FEATURE_NPT (1 << 0)
47#define SVM_FEATURE_LBRV (1 << 1) 47#define SVM_FEATURE_LBRV (1 << 1)
48#define SVM_FEATURE_SVML (1 << 2) 48#define SVM_FEATURE_SVML (1 << 2)
49#define SVM_FEATURE_PAUSE_FILTER (1 << 10)
49 50
50#define NESTED_EXIT_HOST 0 /* Exit handled on host level */ 51#define NESTED_EXIT_HOST 0 /* Exit handled on host level */
51#define NESTED_EXIT_DONE 1 /* Exit caused nested vmexit */ 52#define NESTED_EXIT_DONE 1 /* Exit caused nested vmexit */
@@ -53,15 +54,6 @@ MODULE_LICENSE("GPL");
53 54
54#define DEBUGCTL_RESERVED_BITS (~(0x3fULL)) 55#define DEBUGCTL_RESERVED_BITS (~(0x3fULL))
55 56
56/* Turn on to get debugging output*/
57/* #define NESTED_DEBUG */
58
59#ifdef NESTED_DEBUG
60#define nsvm_printk(fmt, args...) printk(KERN_INFO fmt, ## args)
61#else
62#define nsvm_printk(fmt, args...) do {} while(0)
63#endif
64
65static const u32 host_save_user_msrs[] = { 57static const u32 host_save_user_msrs[] = {
66#ifdef CONFIG_X86_64 58#ifdef CONFIG_X86_64
67 MSR_STAR, MSR_LSTAR, MSR_CSTAR, MSR_SYSCALL_MASK, MSR_KERNEL_GS_BASE, 59 MSR_STAR, MSR_LSTAR, MSR_CSTAR, MSR_SYSCALL_MASK, MSR_KERNEL_GS_BASE,
@@ -85,6 +77,9 @@ struct nested_state {
85 /* gpa pointers to the real vectors */ 77 /* gpa pointers to the real vectors */
86 u64 vmcb_msrpm; 78 u64 vmcb_msrpm;
87 79
80 /* A VMEXIT is required but not yet emulated */
81 bool exit_required;
82
88 /* cache for intercepts of the guest */ 83 /* cache for intercepts of the guest */
89 u16 intercept_cr_read; 84 u16 intercept_cr_read;
90 u16 intercept_cr_write; 85 u16 intercept_cr_write;
@@ -112,6 +107,8 @@ struct vcpu_svm {
112 u32 *msrpm; 107 u32 *msrpm;
113 108
114 struct nested_state nested; 109 struct nested_state nested;
110
111 bool nmi_singlestep;
115}; 112};
116 113
117/* enable NPT for AMD64 and X86 with PAE */ 114/* enable NPT for AMD64 and X86 with PAE */
@@ -286,7 +283,7 @@ static void skip_emulated_instruction(struct kvm_vcpu *vcpu)
286 struct vcpu_svm *svm = to_svm(vcpu); 283 struct vcpu_svm *svm = to_svm(vcpu);
287 284
288 if (!svm->next_rip) { 285 if (!svm->next_rip) {
289 if (emulate_instruction(vcpu, vcpu->run, 0, 0, EMULTYPE_SKIP) != 286 if (emulate_instruction(vcpu, 0, 0, EMULTYPE_SKIP) !=
290 EMULATE_DONE) 287 EMULATE_DONE)
291 printk(KERN_DEBUG "%s: NOP\n", __func__); 288 printk(KERN_DEBUG "%s: NOP\n", __func__);
292 return; 289 return;
@@ -316,7 +313,7 @@ static void svm_hardware_disable(void *garbage)
316 cpu_svm_disable(); 313 cpu_svm_disable();
317} 314}
318 315
319static void svm_hardware_enable(void *garbage) 316static int svm_hardware_enable(void *garbage)
320{ 317{
321 318
322 struct svm_cpu_data *svm_data; 319 struct svm_cpu_data *svm_data;
@@ -325,16 +322,21 @@ static void svm_hardware_enable(void *garbage)
325 struct desc_struct *gdt; 322 struct desc_struct *gdt;
326 int me = raw_smp_processor_id(); 323 int me = raw_smp_processor_id();
327 324
325 rdmsrl(MSR_EFER, efer);
326 if (efer & EFER_SVME)
327 return -EBUSY;
328
328 if (!has_svm()) { 329 if (!has_svm()) {
329 printk(KERN_ERR "svm_cpu_init: err EOPNOTSUPP on %d\n", me); 330 printk(KERN_ERR "svm_hardware_enable: err EOPNOTSUPP on %d\n",
330 return; 331 me);
332 return -EINVAL;
331 } 333 }
332 svm_data = per_cpu(svm_data, me); 334 svm_data = per_cpu(svm_data, me);
333 335
334 if (!svm_data) { 336 if (!svm_data) {
335 printk(KERN_ERR "svm_cpu_init: svm_data is NULL on %d\n", 337 printk(KERN_ERR "svm_hardware_enable: svm_data is NULL on %d\n",
336 me); 338 me);
337 return; 339 return -EINVAL;
338 } 340 }
339 341
340 svm_data->asid_generation = 1; 342 svm_data->asid_generation = 1;
@@ -345,11 +347,12 @@ static void svm_hardware_enable(void *garbage)
345 gdt = (struct desc_struct *)gdt_descr.base; 347 gdt = (struct desc_struct *)gdt_descr.base;
346 svm_data->tss_desc = (struct kvm_ldttss_desc *)(gdt + GDT_ENTRY_TSS); 348 svm_data->tss_desc = (struct kvm_ldttss_desc *)(gdt + GDT_ENTRY_TSS);
347 349
348 rdmsrl(MSR_EFER, efer);
349 wrmsrl(MSR_EFER, efer | EFER_SVME); 350 wrmsrl(MSR_EFER, efer | EFER_SVME);
350 351
351 wrmsrl(MSR_VM_HSAVE_PA, 352 wrmsrl(MSR_VM_HSAVE_PA,
352 page_to_pfn(svm_data->save_area) << PAGE_SHIFT); 353 page_to_pfn(svm_data->save_area) << PAGE_SHIFT);
354
355 return 0;
353} 356}
354 357
355static void svm_cpu_uninit(int cpu) 358static void svm_cpu_uninit(int cpu)
@@ -476,7 +479,7 @@ static __init int svm_hardware_setup(void)
476 kvm_enable_efer_bits(EFER_SVME); 479 kvm_enable_efer_bits(EFER_SVME);
477 } 480 }
478 481
479 for_each_online_cpu(cpu) { 482 for_each_possible_cpu(cpu) {
480 r = svm_cpu_init(cpu); 483 r = svm_cpu_init(cpu);
481 if (r) 484 if (r)
482 goto err; 485 goto err;
@@ -510,7 +513,7 @@ static __exit void svm_hardware_unsetup(void)
510{ 513{
511 int cpu; 514 int cpu;
512 515
513 for_each_online_cpu(cpu) 516 for_each_possible_cpu(cpu)
514 svm_cpu_uninit(cpu); 517 svm_cpu_uninit(cpu);
515 518
516 __free_pages(pfn_to_page(iopm_base >> PAGE_SHIFT), IOPM_ALLOC_ORDER); 519 __free_pages(pfn_to_page(iopm_base >> PAGE_SHIFT), IOPM_ALLOC_ORDER);
@@ -625,11 +628,12 @@ static void init_vmcb(struct vcpu_svm *svm)
625 save->rip = 0x0000fff0; 628 save->rip = 0x0000fff0;
626 svm->vcpu.arch.regs[VCPU_REGS_RIP] = save->rip; 629 svm->vcpu.arch.regs[VCPU_REGS_RIP] = save->rip;
627 630
628 /* 631 /* This is the guest-visible cr0 value.
629 * cr0 val on cpu init should be 0x60000010, we enable cpu 632 * svm_set_cr0() sets PG and WP and clears NW and CD on save->cr0.
630 * cache by default. the orderly way is to enable cache in bios.
631 */ 633 */
632 save->cr0 = 0x00000010 | X86_CR0_PG | X86_CR0_WP; 634 svm->vcpu.arch.cr0 = X86_CR0_NW | X86_CR0_CD | X86_CR0_ET;
635 kvm_set_cr0(&svm->vcpu, svm->vcpu.arch.cr0);
636
633 save->cr4 = X86_CR4_PAE; 637 save->cr4 = X86_CR4_PAE;
634 /* rdx = ?? */ 638 /* rdx = ?? */
635 639
@@ -644,8 +648,6 @@ static void init_vmcb(struct vcpu_svm *svm)
644 control->intercept_cr_write &= ~(INTERCEPT_CR0_MASK| 648 control->intercept_cr_write &= ~(INTERCEPT_CR0_MASK|
645 INTERCEPT_CR3_MASK); 649 INTERCEPT_CR3_MASK);
646 save->g_pat = 0x0007040600070406ULL; 650 save->g_pat = 0x0007040600070406ULL;
647 /* enable caching because the QEMU Bios doesn't enable it */
648 save->cr0 = X86_CR0_ET;
649 save->cr3 = 0; 651 save->cr3 = 0;
650 save->cr4 = 0; 652 save->cr4 = 0;
651 } 653 }
@@ -654,6 +656,11 @@ static void init_vmcb(struct vcpu_svm *svm)
654 svm->nested.vmcb = 0; 656 svm->nested.vmcb = 0;
655 svm->vcpu.arch.hflags = 0; 657 svm->vcpu.arch.hflags = 0;
656 658
659 if (svm_has(SVM_FEATURE_PAUSE_FILTER)) {
660 control->pause_filter_count = 3000;
661 control->intercept |= (1ULL << INTERCEPT_PAUSE);
662 }
663
657 enable_gif(svm); 664 enable_gif(svm);
658} 665}
659 666
@@ -758,14 +765,13 @@ static void svm_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
758 int i; 765 int i;
759 766
760 if (unlikely(cpu != vcpu->cpu)) { 767 if (unlikely(cpu != vcpu->cpu)) {
761 u64 tsc_this, delta; 768 u64 delta;
762 769
763 /* 770 /*
764 * Make sure that the guest sees a monotonically 771 * Make sure that the guest sees a monotonically
765 * increasing TSC. 772 * increasing TSC.
766 */ 773 */
767 rdtscll(tsc_this); 774 delta = vcpu->arch.host_tsc - native_read_tsc();
768 delta = vcpu->arch.host_tsc - tsc_this;
769 svm->vmcb->control.tsc_offset += delta; 775 svm->vmcb->control.tsc_offset += delta;
770 if (is_nested(svm)) 776 if (is_nested(svm))
771 svm->nested.hsave->control.tsc_offset += delta; 777 svm->nested.hsave->control.tsc_offset += delta;
@@ -787,7 +793,7 @@ static void svm_vcpu_put(struct kvm_vcpu *vcpu)
787 for (i = 0; i < NR_HOST_SAVE_USER_MSRS; i++) 793 for (i = 0; i < NR_HOST_SAVE_USER_MSRS; i++)
788 wrmsrl(host_save_user_msrs[i], svm->host_user_msrs[i]); 794 wrmsrl(host_save_user_msrs[i], svm->host_user_msrs[i]);
789 795
790 rdtscll(vcpu->arch.host_tsc); 796 vcpu->arch.host_tsc = native_read_tsc();
791} 797}
792 798
793static unsigned long svm_get_rflags(struct kvm_vcpu *vcpu) 799static unsigned long svm_get_rflags(struct kvm_vcpu *vcpu)
@@ -1045,7 +1051,7 @@ static void update_db_intercept(struct kvm_vcpu *vcpu)
1045 svm->vmcb->control.intercept_exceptions &= 1051 svm->vmcb->control.intercept_exceptions &=
1046 ~((1 << DB_VECTOR) | (1 << BP_VECTOR)); 1052 ~((1 << DB_VECTOR) | (1 << BP_VECTOR));
1047 1053
1048 if (vcpu->arch.singlestep) 1054 if (svm->nmi_singlestep)
1049 svm->vmcb->control.intercept_exceptions |= (1 << DB_VECTOR); 1055 svm->vmcb->control.intercept_exceptions |= (1 << DB_VECTOR);
1050 1056
1051 if (vcpu->guest_debug & KVM_GUESTDBG_ENABLE) { 1057 if (vcpu->guest_debug & KVM_GUESTDBG_ENABLE) {
@@ -1060,26 +1066,16 @@ static void update_db_intercept(struct kvm_vcpu *vcpu)
1060 vcpu->guest_debug = 0; 1066 vcpu->guest_debug = 0;
1061} 1067}
1062 1068
1063static int svm_guest_debug(struct kvm_vcpu *vcpu, struct kvm_guest_debug *dbg) 1069static void svm_guest_debug(struct kvm_vcpu *vcpu, struct kvm_guest_debug *dbg)
1064{ 1070{
1065 int old_debug = vcpu->guest_debug;
1066 struct vcpu_svm *svm = to_svm(vcpu); 1071 struct vcpu_svm *svm = to_svm(vcpu);
1067 1072
1068 vcpu->guest_debug = dbg->control;
1069
1070 update_db_intercept(vcpu);
1071
1072 if (vcpu->guest_debug & KVM_GUESTDBG_USE_HW_BP) 1073 if (vcpu->guest_debug & KVM_GUESTDBG_USE_HW_BP)
1073 svm->vmcb->save.dr7 = dbg->arch.debugreg[7]; 1074 svm->vmcb->save.dr7 = dbg->arch.debugreg[7];
1074 else 1075 else
1075 svm->vmcb->save.dr7 = vcpu->arch.dr7; 1076 svm->vmcb->save.dr7 = vcpu->arch.dr7;
1076 1077
1077 if (vcpu->guest_debug & KVM_GUESTDBG_SINGLESTEP) 1078 update_db_intercept(vcpu);
1078 svm->vmcb->save.rflags |= X86_EFLAGS_TF | X86_EFLAGS_RF;
1079 else if (old_debug & KVM_GUESTDBG_SINGLESTEP)
1080 svm->vmcb->save.rflags &= ~(X86_EFLAGS_TF | X86_EFLAGS_RF);
1081
1082 return 0;
1083} 1079}
1084 1080
1085static void load_host_msrs(struct kvm_vcpu *vcpu) 1081static void load_host_msrs(struct kvm_vcpu *vcpu)
@@ -1180,7 +1176,7 @@ static void svm_set_dr(struct kvm_vcpu *vcpu, int dr, unsigned long value,
1180 } 1176 }
1181} 1177}
1182 1178
1183static int pf_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run) 1179static int pf_interception(struct vcpu_svm *svm)
1184{ 1180{
1185 u64 fault_address; 1181 u64 fault_address;
1186 u32 error_code; 1182 u32 error_code;
@@ -1194,17 +1190,19 @@ static int pf_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run)
1194 return kvm_mmu_page_fault(&svm->vcpu, fault_address, error_code); 1190 return kvm_mmu_page_fault(&svm->vcpu, fault_address, error_code);
1195} 1191}
1196 1192
1197static int db_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run) 1193static int db_interception(struct vcpu_svm *svm)
1198{ 1194{
1195 struct kvm_run *kvm_run = svm->vcpu.run;
1196
1199 if (!(svm->vcpu.guest_debug & 1197 if (!(svm->vcpu.guest_debug &
1200 (KVM_GUESTDBG_SINGLESTEP | KVM_GUESTDBG_USE_HW_BP)) && 1198 (KVM_GUESTDBG_SINGLESTEP | KVM_GUESTDBG_USE_HW_BP)) &&
1201 !svm->vcpu.arch.singlestep) { 1199 !svm->nmi_singlestep) {
1202 kvm_queue_exception(&svm->vcpu, DB_VECTOR); 1200 kvm_queue_exception(&svm->vcpu, DB_VECTOR);
1203 return 1; 1201 return 1;
1204 } 1202 }
1205 1203
1206 if (svm->vcpu.arch.singlestep) { 1204 if (svm->nmi_singlestep) {
1207 svm->vcpu.arch.singlestep = false; 1205 svm->nmi_singlestep = false;
1208 if (!(svm->vcpu.guest_debug & KVM_GUESTDBG_SINGLESTEP)) 1206 if (!(svm->vcpu.guest_debug & KVM_GUESTDBG_SINGLESTEP))
1209 svm->vmcb->save.rflags &= 1207 svm->vmcb->save.rflags &=
1210 ~(X86_EFLAGS_TF | X86_EFLAGS_RF); 1208 ~(X86_EFLAGS_TF | X86_EFLAGS_RF);
@@ -1223,25 +1221,27 @@ static int db_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run)
1223 return 1; 1221 return 1;
1224} 1222}
1225 1223
1226static int bp_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run) 1224static int bp_interception(struct vcpu_svm *svm)
1227{ 1225{
1226 struct kvm_run *kvm_run = svm->vcpu.run;
1227
1228 kvm_run->exit_reason = KVM_EXIT_DEBUG; 1228 kvm_run->exit_reason = KVM_EXIT_DEBUG;
1229 kvm_run->debug.arch.pc = svm->vmcb->save.cs.base + svm->vmcb->save.rip; 1229 kvm_run->debug.arch.pc = svm->vmcb->save.cs.base + svm->vmcb->save.rip;
1230 kvm_run->debug.arch.exception = BP_VECTOR; 1230 kvm_run->debug.arch.exception = BP_VECTOR;
1231 return 0; 1231 return 0;
1232} 1232}
1233 1233
1234static int ud_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run) 1234static int ud_interception(struct vcpu_svm *svm)
1235{ 1235{
1236 int er; 1236 int er;
1237 1237
1238 er = emulate_instruction(&svm->vcpu, kvm_run, 0, 0, EMULTYPE_TRAP_UD); 1238 er = emulate_instruction(&svm->vcpu, 0, 0, EMULTYPE_TRAP_UD);
1239 if (er != EMULATE_DONE) 1239 if (er != EMULATE_DONE)
1240 kvm_queue_exception(&svm->vcpu, UD_VECTOR); 1240 kvm_queue_exception(&svm->vcpu, UD_VECTOR);
1241 return 1; 1241 return 1;
1242} 1242}
1243 1243
1244static int nm_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run) 1244static int nm_interception(struct vcpu_svm *svm)
1245{ 1245{
1246 svm->vmcb->control.intercept_exceptions &= ~(1 << NM_VECTOR); 1246 svm->vmcb->control.intercept_exceptions &= ~(1 << NM_VECTOR);
1247 if (!(svm->vcpu.arch.cr0 & X86_CR0_TS)) 1247 if (!(svm->vcpu.arch.cr0 & X86_CR0_TS))
@@ -1251,7 +1251,7 @@ static int nm_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run)
1251 return 1; 1251 return 1;
1252} 1252}
1253 1253
1254static int mc_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run) 1254static int mc_interception(struct vcpu_svm *svm)
1255{ 1255{
1256 /* 1256 /*
1257 * On an #MC intercept the MCE handler is not called automatically in 1257 * On an #MC intercept the MCE handler is not called automatically in
@@ -1264,8 +1264,10 @@ static int mc_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run)
1264 return 1; 1264 return 1;
1265} 1265}
1266 1266
1267static int shutdown_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run) 1267static int shutdown_interception(struct vcpu_svm *svm)
1268{ 1268{
1269 struct kvm_run *kvm_run = svm->vcpu.run;
1270
1269 /* 1271 /*
1270 * VMCB is undefined after a SHUTDOWN intercept 1272 * VMCB is undefined after a SHUTDOWN intercept
1271 * so reinitialize it. 1273 * so reinitialize it.
@@ -1277,7 +1279,7 @@ static int shutdown_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run)
1277 return 0; 1279 return 0;
1278} 1280}
1279 1281
1280static int io_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run) 1282static int io_interception(struct vcpu_svm *svm)
1281{ 1283{
1282 u32 io_info = svm->vmcb->control.exit_info_1; /* address size bug? */ 1284 u32 io_info = svm->vmcb->control.exit_info_1; /* address size bug? */
1283 int size, in, string; 1285 int size, in, string;
@@ -1291,7 +1293,7 @@ static int io_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run)
1291 1293
1292 if (string) { 1294 if (string) {
1293 if (emulate_instruction(&svm->vcpu, 1295 if (emulate_instruction(&svm->vcpu,
1294 kvm_run, 0, 0, 0) == EMULATE_DO_MMIO) 1296 0, 0, 0) == EMULATE_DO_MMIO)
1295 return 0; 1297 return 0;
1296 return 1; 1298 return 1;
1297 } 1299 }
@@ -1301,33 +1303,33 @@ static int io_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run)
1301 size = (io_info & SVM_IOIO_SIZE_MASK) >> SVM_IOIO_SIZE_SHIFT; 1303 size = (io_info & SVM_IOIO_SIZE_MASK) >> SVM_IOIO_SIZE_SHIFT;
1302 1304
1303 skip_emulated_instruction(&svm->vcpu); 1305 skip_emulated_instruction(&svm->vcpu);
1304 return kvm_emulate_pio(&svm->vcpu, kvm_run, in, size, port); 1306 return kvm_emulate_pio(&svm->vcpu, in, size, port);
1305} 1307}
1306 1308
1307static int nmi_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run) 1309static int nmi_interception(struct vcpu_svm *svm)
1308{ 1310{
1309 return 1; 1311 return 1;
1310} 1312}
1311 1313
1312static int intr_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run) 1314static int intr_interception(struct vcpu_svm *svm)
1313{ 1315{
1314 ++svm->vcpu.stat.irq_exits; 1316 ++svm->vcpu.stat.irq_exits;
1315 return 1; 1317 return 1;
1316} 1318}
1317 1319
1318static int nop_on_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run) 1320static int nop_on_interception(struct vcpu_svm *svm)
1319{ 1321{
1320 return 1; 1322 return 1;
1321} 1323}
1322 1324
1323static int halt_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run) 1325static int halt_interception(struct vcpu_svm *svm)
1324{ 1326{
1325 svm->next_rip = kvm_rip_read(&svm->vcpu) + 1; 1327 svm->next_rip = kvm_rip_read(&svm->vcpu) + 1;
1326 skip_emulated_instruction(&svm->vcpu); 1328 skip_emulated_instruction(&svm->vcpu);
1327 return kvm_emulate_halt(&svm->vcpu); 1329 return kvm_emulate_halt(&svm->vcpu);
1328} 1330}
1329 1331
1330static int vmmcall_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run) 1332static int vmmcall_interception(struct vcpu_svm *svm)
1331{ 1333{
1332 svm->next_rip = kvm_rip_read(&svm->vcpu) + 3; 1334 svm->next_rip = kvm_rip_read(&svm->vcpu) + 3;
1333 skip_emulated_instruction(&svm->vcpu); 1335 skip_emulated_instruction(&svm->vcpu);
@@ -1378,8 +1380,15 @@ static inline int nested_svm_intr(struct vcpu_svm *svm)
1378 1380
1379 svm->vmcb->control.exit_code = SVM_EXIT_INTR; 1381 svm->vmcb->control.exit_code = SVM_EXIT_INTR;
1380 1382
1381 if (nested_svm_exit_handled(svm)) { 1383 if (svm->nested.intercept & 1ULL) {
1382 nsvm_printk("VMexit -> INTR\n"); 1384 /*
1385 * The #vmexit can't be emulated here directly because this
1386 * code path runs with irqs and preemtion disabled. A
1387 * #vmexit emulation might sleep. Only signal request for
1388 * the #vmexit here.
1389 */
1390 svm->nested.exit_required = true;
1391 trace_kvm_nested_intr_vmexit(svm->vmcb->save.rip);
1383 return 1; 1392 return 1;
1384 } 1393 }
1385 1394
@@ -1390,10 +1399,7 @@ static void *nested_svm_map(struct vcpu_svm *svm, u64 gpa, enum km_type idx)
1390{ 1399{
1391 struct page *page; 1400 struct page *page;
1392 1401
1393 down_read(&current->mm->mmap_sem);
1394 page = gfn_to_page(svm->vcpu.kvm, gpa >> PAGE_SHIFT); 1402 page = gfn_to_page(svm->vcpu.kvm, gpa >> PAGE_SHIFT);
1395 up_read(&current->mm->mmap_sem);
1396
1397 if (is_error_page(page)) 1403 if (is_error_page(page))
1398 goto error; 1404 goto error;
1399 1405
@@ -1532,14 +1538,12 @@ static int nested_svm_exit_handled(struct vcpu_svm *svm)
1532 } 1538 }
1533 default: { 1539 default: {
1534 u64 exit_bits = 1ULL << (exit_code - SVM_EXIT_INTR); 1540 u64 exit_bits = 1ULL << (exit_code - SVM_EXIT_INTR);
1535 nsvm_printk("exit code: 0x%x\n", exit_code);
1536 if (svm->nested.intercept & exit_bits) 1541 if (svm->nested.intercept & exit_bits)
1537 vmexit = NESTED_EXIT_DONE; 1542 vmexit = NESTED_EXIT_DONE;
1538 } 1543 }
1539 } 1544 }
1540 1545
1541 if (vmexit == NESTED_EXIT_DONE) { 1546 if (vmexit == NESTED_EXIT_DONE) {
1542 nsvm_printk("#VMEXIT reason=%04x\n", exit_code);
1543 nested_svm_vmexit(svm); 1547 nested_svm_vmexit(svm);
1544 } 1548 }
1545 1549
@@ -1584,6 +1588,12 @@ static int nested_svm_vmexit(struct vcpu_svm *svm)
1584 struct vmcb *hsave = svm->nested.hsave; 1588 struct vmcb *hsave = svm->nested.hsave;
1585 struct vmcb *vmcb = svm->vmcb; 1589 struct vmcb *vmcb = svm->vmcb;
1586 1590
1591 trace_kvm_nested_vmexit_inject(vmcb->control.exit_code,
1592 vmcb->control.exit_info_1,
1593 vmcb->control.exit_info_2,
1594 vmcb->control.exit_int_info,
1595 vmcb->control.exit_int_info_err);
1596
1587 nested_vmcb = nested_svm_map(svm, svm->nested.vmcb, KM_USER0); 1597 nested_vmcb = nested_svm_map(svm, svm->nested.vmcb, KM_USER0);
1588 if (!nested_vmcb) 1598 if (!nested_vmcb)
1589 return 1; 1599 return 1;
@@ -1617,6 +1627,22 @@ static int nested_svm_vmexit(struct vcpu_svm *svm)
1617 nested_vmcb->control.exit_info_2 = vmcb->control.exit_info_2; 1627 nested_vmcb->control.exit_info_2 = vmcb->control.exit_info_2;
1618 nested_vmcb->control.exit_int_info = vmcb->control.exit_int_info; 1628 nested_vmcb->control.exit_int_info = vmcb->control.exit_int_info;
1619 nested_vmcb->control.exit_int_info_err = vmcb->control.exit_int_info_err; 1629 nested_vmcb->control.exit_int_info_err = vmcb->control.exit_int_info_err;
1630
1631 /*
1632 * If we emulate a VMRUN/#VMEXIT in the same host #vmexit cycle we have
1633 * to make sure that we do not lose injected events. So check event_inj
1634 * here and copy it to exit_int_info if it is valid.
1635 * Exit_int_info and event_inj can't be both valid because the case
1636 * below only happens on a VMRUN instruction intercept which has
1637 * no valid exit_int_info set.
1638 */
1639 if (vmcb->control.event_inj & SVM_EVTINJ_VALID) {
1640 struct vmcb_control_area *nc = &nested_vmcb->control;
1641
1642 nc->exit_int_info = vmcb->control.event_inj;
1643 nc->exit_int_info_err = vmcb->control.event_inj_err;
1644 }
1645
1620 nested_vmcb->control.tlb_ctl = 0; 1646 nested_vmcb->control.tlb_ctl = 0;
1621 nested_vmcb->control.event_inj = 0; 1647 nested_vmcb->control.event_inj = 0;
1622 nested_vmcb->control.event_inj_err = 0; 1648 nested_vmcb->control.event_inj_err = 0;
@@ -1628,10 +1654,6 @@ static int nested_svm_vmexit(struct vcpu_svm *svm)
1628 /* Restore the original control entries */ 1654 /* Restore the original control entries */
1629 copy_vmcb_control_area(vmcb, hsave); 1655 copy_vmcb_control_area(vmcb, hsave);
1630 1656
1631 /* Kill any pending exceptions */
1632 if (svm->vcpu.arch.exception.pending == true)
1633 nsvm_printk("WARNING: Pending Exception\n");
1634
1635 kvm_clear_exception_queue(&svm->vcpu); 1657 kvm_clear_exception_queue(&svm->vcpu);
1636 kvm_clear_interrupt_queue(&svm->vcpu); 1658 kvm_clear_interrupt_queue(&svm->vcpu);
1637 1659
@@ -1702,6 +1724,12 @@ static bool nested_svm_vmrun(struct vcpu_svm *svm)
1702 /* nested_vmcb is our indicator if nested SVM is activated */ 1724 /* nested_vmcb is our indicator if nested SVM is activated */
1703 svm->nested.vmcb = svm->vmcb->save.rax; 1725 svm->nested.vmcb = svm->vmcb->save.rax;
1704 1726
1727 trace_kvm_nested_vmrun(svm->vmcb->save.rip - 3, svm->nested.vmcb,
1728 nested_vmcb->save.rip,
1729 nested_vmcb->control.int_ctl,
1730 nested_vmcb->control.event_inj,
1731 nested_vmcb->control.nested_ctl);
1732
1705 /* Clear internal status */ 1733 /* Clear internal status */
1706 kvm_clear_exception_queue(&svm->vcpu); 1734 kvm_clear_exception_queue(&svm->vcpu);
1707 kvm_clear_interrupt_queue(&svm->vcpu); 1735 kvm_clear_interrupt_queue(&svm->vcpu);
@@ -1789,28 +1817,15 @@ static bool nested_svm_vmrun(struct vcpu_svm *svm)
1789 svm->nested.intercept = nested_vmcb->control.intercept; 1817 svm->nested.intercept = nested_vmcb->control.intercept;
1790 1818
1791 force_new_asid(&svm->vcpu); 1819 force_new_asid(&svm->vcpu);
1792 svm->vmcb->control.exit_int_info = nested_vmcb->control.exit_int_info;
1793 svm->vmcb->control.exit_int_info_err = nested_vmcb->control.exit_int_info_err;
1794 svm->vmcb->control.int_ctl = nested_vmcb->control.int_ctl | V_INTR_MASKING_MASK; 1820 svm->vmcb->control.int_ctl = nested_vmcb->control.int_ctl | V_INTR_MASKING_MASK;
1795 if (nested_vmcb->control.int_ctl & V_IRQ_MASK) {
1796 nsvm_printk("nSVM Injecting Interrupt: 0x%x\n",
1797 nested_vmcb->control.int_ctl);
1798 }
1799 if (nested_vmcb->control.int_ctl & V_INTR_MASKING_MASK) 1821 if (nested_vmcb->control.int_ctl & V_INTR_MASKING_MASK)
1800 svm->vcpu.arch.hflags |= HF_VINTR_MASK; 1822 svm->vcpu.arch.hflags |= HF_VINTR_MASK;
1801 else 1823 else
1802 svm->vcpu.arch.hflags &= ~HF_VINTR_MASK; 1824 svm->vcpu.arch.hflags &= ~HF_VINTR_MASK;
1803 1825
1804 nsvm_printk("nSVM exit_int_info: 0x%x | int_state: 0x%x\n",
1805 nested_vmcb->control.exit_int_info,
1806 nested_vmcb->control.int_state);
1807
1808 svm->vmcb->control.int_vector = nested_vmcb->control.int_vector; 1826 svm->vmcb->control.int_vector = nested_vmcb->control.int_vector;
1809 svm->vmcb->control.int_state = nested_vmcb->control.int_state; 1827 svm->vmcb->control.int_state = nested_vmcb->control.int_state;
1810 svm->vmcb->control.tsc_offset += nested_vmcb->control.tsc_offset; 1828 svm->vmcb->control.tsc_offset += nested_vmcb->control.tsc_offset;
1811 if (nested_vmcb->control.event_inj & SVM_EVTINJ_VALID)
1812 nsvm_printk("Injecting Event: 0x%x\n",
1813 nested_vmcb->control.event_inj);
1814 svm->vmcb->control.event_inj = nested_vmcb->control.event_inj; 1829 svm->vmcb->control.event_inj = nested_vmcb->control.event_inj;
1815 svm->vmcb->control.event_inj_err = nested_vmcb->control.event_inj_err; 1830 svm->vmcb->control.event_inj_err = nested_vmcb->control.event_inj_err;
1816 1831
@@ -1837,7 +1852,7 @@ static void nested_svm_vmloadsave(struct vmcb *from_vmcb, struct vmcb *to_vmcb)
1837 to_vmcb->save.sysenter_eip = from_vmcb->save.sysenter_eip; 1852 to_vmcb->save.sysenter_eip = from_vmcb->save.sysenter_eip;
1838} 1853}
1839 1854
1840static int vmload_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run) 1855static int vmload_interception(struct vcpu_svm *svm)
1841{ 1856{
1842 struct vmcb *nested_vmcb; 1857 struct vmcb *nested_vmcb;
1843 1858
@@ -1857,7 +1872,7 @@ static int vmload_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run)
1857 return 1; 1872 return 1;
1858} 1873}
1859 1874
1860static int vmsave_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run) 1875static int vmsave_interception(struct vcpu_svm *svm)
1861{ 1876{
1862 struct vmcb *nested_vmcb; 1877 struct vmcb *nested_vmcb;
1863 1878
@@ -1877,10 +1892,8 @@ static int vmsave_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run)
1877 return 1; 1892 return 1;
1878} 1893}
1879 1894
1880static int vmrun_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run) 1895static int vmrun_interception(struct vcpu_svm *svm)
1881{ 1896{
1882 nsvm_printk("VMrun\n");
1883
1884 if (nested_svm_check_permissions(svm)) 1897 if (nested_svm_check_permissions(svm))
1885 return 1; 1898 return 1;
1886 1899
@@ -1907,7 +1920,7 @@ failed:
1907 return 1; 1920 return 1;
1908} 1921}
1909 1922
1910static int stgi_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run) 1923static int stgi_interception(struct vcpu_svm *svm)
1911{ 1924{
1912 if (nested_svm_check_permissions(svm)) 1925 if (nested_svm_check_permissions(svm))
1913 return 1; 1926 return 1;
@@ -1920,7 +1933,7 @@ static int stgi_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run)
1920 return 1; 1933 return 1;
1921} 1934}
1922 1935
1923static int clgi_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run) 1936static int clgi_interception(struct vcpu_svm *svm)
1924{ 1937{
1925 if (nested_svm_check_permissions(svm)) 1938 if (nested_svm_check_permissions(svm))
1926 return 1; 1939 return 1;
@@ -1937,10 +1950,12 @@ static int clgi_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run)
1937 return 1; 1950 return 1;
1938} 1951}
1939 1952
1940static int invlpga_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run) 1953static int invlpga_interception(struct vcpu_svm *svm)
1941{ 1954{
1942 struct kvm_vcpu *vcpu = &svm->vcpu; 1955 struct kvm_vcpu *vcpu = &svm->vcpu;
1943 nsvm_printk("INVLPGA\n"); 1956
1957 trace_kvm_invlpga(svm->vmcb->save.rip, vcpu->arch.regs[VCPU_REGS_RCX],
1958 vcpu->arch.regs[VCPU_REGS_RAX]);
1944 1959
1945 /* Let's treat INVLPGA the same as INVLPG (can be optimized!) */ 1960 /* Let's treat INVLPGA the same as INVLPG (can be optimized!) */
1946 kvm_mmu_invlpg(vcpu, vcpu->arch.regs[VCPU_REGS_RAX]); 1961 kvm_mmu_invlpg(vcpu, vcpu->arch.regs[VCPU_REGS_RAX]);
@@ -1950,15 +1965,21 @@ static int invlpga_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run)
1950 return 1; 1965 return 1;
1951} 1966}
1952 1967
1953static int invalid_op_interception(struct vcpu_svm *svm, 1968static int skinit_interception(struct vcpu_svm *svm)
1954 struct kvm_run *kvm_run)
1955{ 1969{
1970 trace_kvm_skinit(svm->vmcb->save.rip, svm->vcpu.arch.regs[VCPU_REGS_RAX]);
1971
1956 kvm_queue_exception(&svm->vcpu, UD_VECTOR); 1972 kvm_queue_exception(&svm->vcpu, UD_VECTOR);
1957 return 1; 1973 return 1;
1958} 1974}
1959 1975
1960static int task_switch_interception(struct vcpu_svm *svm, 1976static int invalid_op_interception(struct vcpu_svm *svm)
1961 struct kvm_run *kvm_run) 1977{
1978 kvm_queue_exception(&svm->vcpu, UD_VECTOR);
1979 return 1;
1980}
1981
1982static int task_switch_interception(struct vcpu_svm *svm)
1962{ 1983{
1963 u16 tss_selector; 1984 u16 tss_selector;
1964 int reason; 1985 int reason;
@@ -2008,14 +2029,14 @@ static int task_switch_interception(struct vcpu_svm *svm,
2008 return kvm_task_switch(&svm->vcpu, tss_selector, reason); 2029 return kvm_task_switch(&svm->vcpu, tss_selector, reason);
2009} 2030}
2010 2031
2011static int cpuid_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run) 2032static int cpuid_interception(struct vcpu_svm *svm)
2012{ 2033{
2013 svm->next_rip = kvm_rip_read(&svm->vcpu) + 2; 2034 svm->next_rip = kvm_rip_read(&svm->vcpu) + 2;
2014 kvm_emulate_cpuid(&svm->vcpu); 2035 kvm_emulate_cpuid(&svm->vcpu);
2015 return 1; 2036 return 1;
2016} 2037}
2017 2038
2018static int iret_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run) 2039static int iret_interception(struct vcpu_svm *svm)
2019{ 2040{
2020 ++svm->vcpu.stat.nmi_window_exits; 2041 ++svm->vcpu.stat.nmi_window_exits;
2021 svm->vmcb->control.intercept &= ~(1UL << INTERCEPT_IRET); 2042 svm->vmcb->control.intercept &= ~(1UL << INTERCEPT_IRET);
@@ -2023,26 +2044,27 @@ static int iret_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run)
2023 return 1; 2044 return 1;
2024} 2045}
2025 2046
2026static int invlpg_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run) 2047static int invlpg_interception(struct vcpu_svm *svm)
2027{ 2048{
2028 if (emulate_instruction(&svm->vcpu, kvm_run, 0, 0, 0) != EMULATE_DONE) 2049 if (emulate_instruction(&svm->vcpu, 0, 0, 0) != EMULATE_DONE)
2029 pr_unimpl(&svm->vcpu, "%s: failed\n", __func__); 2050 pr_unimpl(&svm->vcpu, "%s: failed\n", __func__);
2030 return 1; 2051 return 1;
2031} 2052}
2032 2053
2033static int emulate_on_interception(struct vcpu_svm *svm, 2054static int emulate_on_interception(struct vcpu_svm *svm)
2034 struct kvm_run *kvm_run)
2035{ 2055{
2036 if (emulate_instruction(&svm->vcpu, NULL, 0, 0, 0) != EMULATE_DONE) 2056 if (emulate_instruction(&svm->vcpu, 0, 0, 0) != EMULATE_DONE)
2037 pr_unimpl(&svm->vcpu, "%s: failed\n", __func__); 2057 pr_unimpl(&svm->vcpu, "%s: failed\n", __func__);
2038 return 1; 2058 return 1;
2039} 2059}
2040 2060
2041static int cr8_write_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run) 2061static int cr8_write_interception(struct vcpu_svm *svm)
2042{ 2062{
2063 struct kvm_run *kvm_run = svm->vcpu.run;
2064
2043 u8 cr8_prev = kvm_get_cr8(&svm->vcpu); 2065 u8 cr8_prev = kvm_get_cr8(&svm->vcpu);
2044 /* instruction emulation calls kvm_set_cr8() */ 2066 /* instruction emulation calls kvm_set_cr8() */
2045 emulate_instruction(&svm->vcpu, NULL, 0, 0, 0); 2067 emulate_instruction(&svm->vcpu, 0, 0, 0);
2046 if (irqchip_in_kernel(svm->vcpu.kvm)) { 2068 if (irqchip_in_kernel(svm->vcpu.kvm)) {
2047 svm->vmcb->control.intercept_cr_write &= ~INTERCEPT_CR8_MASK; 2069 svm->vmcb->control.intercept_cr_write &= ~INTERCEPT_CR8_MASK;
2048 return 1; 2070 return 1;
@@ -2128,7 +2150,7 @@ static int svm_get_msr(struct kvm_vcpu *vcpu, unsigned ecx, u64 *data)
2128 return 0; 2150 return 0;
2129} 2151}
2130 2152
2131static int rdmsr_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run) 2153static int rdmsr_interception(struct vcpu_svm *svm)
2132{ 2154{
2133 u32 ecx = svm->vcpu.arch.regs[VCPU_REGS_RCX]; 2155 u32 ecx = svm->vcpu.arch.regs[VCPU_REGS_RCX];
2134 u64 data; 2156 u64 data;
@@ -2221,7 +2243,7 @@ static int svm_set_msr(struct kvm_vcpu *vcpu, unsigned ecx, u64 data)
2221 return 0; 2243 return 0;
2222} 2244}
2223 2245
2224static int wrmsr_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run) 2246static int wrmsr_interception(struct vcpu_svm *svm)
2225{ 2247{
2226 u32 ecx = svm->vcpu.arch.regs[VCPU_REGS_RCX]; 2248 u32 ecx = svm->vcpu.arch.regs[VCPU_REGS_RCX];
2227 u64 data = (svm->vcpu.arch.regs[VCPU_REGS_RAX] & -1u) 2249 u64 data = (svm->vcpu.arch.regs[VCPU_REGS_RAX] & -1u)
@@ -2237,17 +2259,18 @@ static int wrmsr_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run)
2237 return 1; 2259 return 1;
2238} 2260}
2239 2261
2240static int msr_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run) 2262static int msr_interception(struct vcpu_svm *svm)
2241{ 2263{
2242 if (svm->vmcb->control.exit_info_1) 2264 if (svm->vmcb->control.exit_info_1)
2243 return wrmsr_interception(svm, kvm_run); 2265 return wrmsr_interception(svm);
2244 else 2266 else
2245 return rdmsr_interception(svm, kvm_run); 2267 return rdmsr_interception(svm);
2246} 2268}
2247 2269
2248static int interrupt_window_interception(struct vcpu_svm *svm, 2270static int interrupt_window_interception(struct vcpu_svm *svm)
2249 struct kvm_run *kvm_run)
2250{ 2271{
2272 struct kvm_run *kvm_run = svm->vcpu.run;
2273
2251 svm_clear_vintr(svm); 2274 svm_clear_vintr(svm);
2252 svm->vmcb->control.int_ctl &= ~V_IRQ_MASK; 2275 svm->vmcb->control.int_ctl &= ~V_IRQ_MASK;
2253 /* 2276 /*
@@ -2265,8 +2288,13 @@ static int interrupt_window_interception(struct vcpu_svm *svm,
2265 return 1; 2288 return 1;
2266} 2289}
2267 2290
2268static int (*svm_exit_handlers[])(struct vcpu_svm *svm, 2291static int pause_interception(struct vcpu_svm *svm)
2269 struct kvm_run *kvm_run) = { 2292{
2293 kvm_vcpu_on_spin(&(svm->vcpu));
2294 return 1;
2295}
2296
2297static int (*svm_exit_handlers[])(struct vcpu_svm *svm) = {
2270 [SVM_EXIT_READ_CR0] = emulate_on_interception, 2298 [SVM_EXIT_READ_CR0] = emulate_on_interception,
2271 [SVM_EXIT_READ_CR3] = emulate_on_interception, 2299 [SVM_EXIT_READ_CR3] = emulate_on_interception,
2272 [SVM_EXIT_READ_CR4] = emulate_on_interception, 2300 [SVM_EXIT_READ_CR4] = emulate_on_interception,
@@ -2301,6 +2329,7 @@ static int (*svm_exit_handlers[])(struct vcpu_svm *svm,
2301 [SVM_EXIT_CPUID] = cpuid_interception, 2329 [SVM_EXIT_CPUID] = cpuid_interception,
2302 [SVM_EXIT_IRET] = iret_interception, 2330 [SVM_EXIT_IRET] = iret_interception,
2303 [SVM_EXIT_INVD] = emulate_on_interception, 2331 [SVM_EXIT_INVD] = emulate_on_interception,
2332 [SVM_EXIT_PAUSE] = pause_interception,
2304 [SVM_EXIT_HLT] = halt_interception, 2333 [SVM_EXIT_HLT] = halt_interception,
2305 [SVM_EXIT_INVLPG] = invlpg_interception, 2334 [SVM_EXIT_INVLPG] = invlpg_interception,
2306 [SVM_EXIT_INVLPGA] = invlpga_interception, 2335 [SVM_EXIT_INVLPGA] = invlpga_interception,
@@ -2314,26 +2343,36 @@ static int (*svm_exit_handlers[])(struct vcpu_svm *svm,
2314 [SVM_EXIT_VMSAVE] = vmsave_interception, 2343 [SVM_EXIT_VMSAVE] = vmsave_interception,
2315 [SVM_EXIT_STGI] = stgi_interception, 2344 [SVM_EXIT_STGI] = stgi_interception,
2316 [SVM_EXIT_CLGI] = clgi_interception, 2345 [SVM_EXIT_CLGI] = clgi_interception,
2317 [SVM_EXIT_SKINIT] = invalid_op_interception, 2346 [SVM_EXIT_SKINIT] = skinit_interception,
2318 [SVM_EXIT_WBINVD] = emulate_on_interception, 2347 [SVM_EXIT_WBINVD] = emulate_on_interception,
2319 [SVM_EXIT_MONITOR] = invalid_op_interception, 2348 [SVM_EXIT_MONITOR] = invalid_op_interception,
2320 [SVM_EXIT_MWAIT] = invalid_op_interception, 2349 [SVM_EXIT_MWAIT] = invalid_op_interception,
2321 [SVM_EXIT_NPF] = pf_interception, 2350 [SVM_EXIT_NPF] = pf_interception,
2322}; 2351};
2323 2352
2324static int handle_exit(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu) 2353static int handle_exit(struct kvm_vcpu *vcpu)
2325{ 2354{
2326 struct vcpu_svm *svm = to_svm(vcpu); 2355 struct vcpu_svm *svm = to_svm(vcpu);
2356 struct kvm_run *kvm_run = vcpu->run;
2327 u32 exit_code = svm->vmcb->control.exit_code; 2357 u32 exit_code = svm->vmcb->control.exit_code;
2328 2358
2329 trace_kvm_exit(exit_code, svm->vmcb->save.rip); 2359 trace_kvm_exit(exit_code, svm->vmcb->save.rip);
2330 2360
2361 if (unlikely(svm->nested.exit_required)) {
2362 nested_svm_vmexit(svm);
2363 svm->nested.exit_required = false;
2364
2365 return 1;
2366 }
2367
2331 if (is_nested(svm)) { 2368 if (is_nested(svm)) {
2332 int vmexit; 2369 int vmexit;
2333 2370
2334 nsvm_printk("nested handle_exit: 0x%x | 0x%lx | 0x%lx | 0x%lx\n", 2371 trace_kvm_nested_vmexit(svm->vmcb->save.rip, exit_code,
2335 exit_code, svm->vmcb->control.exit_info_1, 2372 svm->vmcb->control.exit_info_1,
2336 svm->vmcb->control.exit_info_2, svm->vmcb->save.rip); 2373 svm->vmcb->control.exit_info_2,
2374 svm->vmcb->control.exit_int_info,
2375 svm->vmcb->control.exit_int_info_err);
2337 2376
2338 vmexit = nested_svm_exit_special(svm); 2377 vmexit = nested_svm_exit_special(svm);
2339 2378
@@ -2383,7 +2422,7 @@ static int handle_exit(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu)
2383 return 0; 2422 return 0;
2384 } 2423 }
2385 2424
2386 return svm_exit_handlers[exit_code](svm, kvm_run); 2425 return svm_exit_handlers[exit_code](svm);
2387} 2426}
2388 2427
2389static void reload_tss(struct kvm_vcpu *vcpu) 2428static void reload_tss(struct kvm_vcpu *vcpu)
@@ -2460,20 +2499,47 @@ static int svm_nmi_allowed(struct kvm_vcpu *vcpu)
2460 !(svm->vcpu.arch.hflags & HF_NMI_MASK); 2499 !(svm->vcpu.arch.hflags & HF_NMI_MASK);
2461} 2500}
2462 2501
2502static bool svm_get_nmi_mask(struct kvm_vcpu *vcpu)
2503{
2504 struct vcpu_svm *svm = to_svm(vcpu);
2505
2506 return !!(svm->vcpu.arch.hflags & HF_NMI_MASK);
2507}
2508
2509static void svm_set_nmi_mask(struct kvm_vcpu *vcpu, bool masked)
2510{
2511 struct vcpu_svm *svm = to_svm(vcpu);
2512
2513 if (masked) {
2514 svm->vcpu.arch.hflags |= HF_NMI_MASK;
2515 svm->vmcb->control.intercept |= (1UL << INTERCEPT_IRET);
2516 } else {
2517 svm->vcpu.arch.hflags &= ~HF_NMI_MASK;
2518 svm->vmcb->control.intercept &= ~(1UL << INTERCEPT_IRET);
2519 }
2520}
2521
2463static int svm_interrupt_allowed(struct kvm_vcpu *vcpu) 2522static int svm_interrupt_allowed(struct kvm_vcpu *vcpu)
2464{ 2523{
2465 struct vcpu_svm *svm = to_svm(vcpu); 2524 struct vcpu_svm *svm = to_svm(vcpu);
2466 struct vmcb *vmcb = svm->vmcb; 2525 struct vmcb *vmcb = svm->vmcb;
2467 return (vmcb->save.rflags & X86_EFLAGS_IF) && 2526 int ret;
2468 !(vmcb->control.int_state & SVM_INTERRUPT_SHADOW_MASK) && 2527
2469 gif_set(svm) && 2528 if (!gif_set(svm) ||
2470 !(is_nested(svm) && (svm->vcpu.arch.hflags & HF_VINTR_MASK)); 2529 (vmcb->control.int_state & SVM_INTERRUPT_SHADOW_MASK))
2530 return 0;
2531
2532 ret = !!(vmcb->save.rflags & X86_EFLAGS_IF);
2533
2534 if (is_nested(svm))
2535 return ret && !(svm->vcpu.arch.hflags & HF_VINTR_MASK);
2536
2537 return ret;
2471} 2538}
2472 2539
2473static void enable_irq_window(struct kvm_vcpu *vcpu) 2540static void enable_irq_window(struct kvm_vcpu *vcpu)
2474{ 2541{
2475 struct vcpu_svm *svm = to_svm(vcpu); 2542 struct vcpu_svm *svm = to_svm(vcpu);
2476 nsvm_printk("Trying to open IRQ window\n");
2477 2543
2478 nested_svm_intr(svm); 2544 nested_svm_intr(svm);
2479 2545
@@ -2498,7 +2564,7 @@ static void enable_nmi_window(struct kvm_vcpu *vcpu)
2498 /* Something prevents NMI from been injected. Single step over 2564 /* Something prevents NMI from been injected. Single step over
2499 possible problem (IRET or exception injection or interrupt 2565 possible problem (IRET or exception injection or interrupt
2500 shadow) */ 2566 shadow) */
2501 vcpu->arch.singlestep = true; 2567 svm->nmi_singlestep = true;
2502 svm->vmcb->save.rflags |= (X86_EFLAGS_TF | X86_EFLAGS_RF); 2568 svm->vmcb->save.rflags |= (X86_EFLAGS_TF | X86_EFLAGS_RF);
2503 update_db_intercept(vcpu); 2569 update_db_intercept(vcpu);
2504} 2570}
@@ -2588,13 +2654,20 @@ static void svm_complete_interrupts(struct vcpu_svm *svm)
2588#define R "e" 2654#define R "e"
2589#endif 2655#endif
2590 2656
2591static void svm_vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) 2657static void svm_vcpu_run(struct kvm_vcpu *vcpu)
2592{ 2658{
2593 struct vcpu_svm *svm = to_svm(vcpu); 2659 struct vcpu_svm *svm = to_svm(vcpu);
2594 u16 fs_selector; 2660 u16 fs_selector;
2595 u16 gs_selector; 2661 u16 gs_selector;
2596 u16 ldt_selector; 2662 u16 ldt_selector;
2597 2663
2664 /*
2665 * A vmexit emulation is required before the vcpu can be executed
2666 * again.
2667 */
2668 if (unlikely(svm->nested.exit_required))
2669 return;
2670
2598 svm->vmcb->save.rax = vcpu->arch.regs[VCPU_REGS_RAX]; 2671 svm->vmcb->save.rax = vcpu->arch.regs[VCPU_REGS_RAX];
2599 svm->vmcb->save.rsp = vcpu->arch.regs[VCPU_REGS_RSP]; 2672 svm->vmcb->save.rsp = vcpu->arch.regs[VCPU_REGS_RSP];
2600 svm->vmcb->save.rip = vcpu->arch.regs[VCPU_REGS_RIP]; 2673 svm->vmcb->save.rip = vcpu->arch.regs[VCPU_REGS_RIP];
@@ -2893,6 +2966,8 @@ static struct kvm_x86_ops svm_x86_ops = {
2893 .queue_exception = svm_queue_exception, 2966 .queue_exception = svm_queue_exception,
2894 .interrupt_allowed = svm_interrupt_allowed, 2967 .interrupt_allowed = svm_interrupt_allowed,
2895 .nmi_allowed = svm_nmi_allowed, 2968 .nmi_allowed = svm_nmi_allowed,
2969 .get_nmi_mask = svm_get_nmi_mask,
2970 .set_nmi_mask = svm_set_nmi_mask,
2896 .enable_nmi_window = enable_nmi_window, 2971 .enable_nmi_window = enable_nmi_window,
2897 .enable_irq_window = enable_irq_window, 2972 .enable_irq_window = enable_irq_window,
2898 .update_cr8_intercept = update_cr8_intercept, 2973 .update_cr8_intercept = update_cr8_intercept,
diff --git a/arch/x86/kvm/trace.h b/arch/x86/kvm/trace.h
index 0d480e77eacf..816e0449db0b 100644
--- a/arch/x86/kvm/trace.h
+++ b/arch/x86/kvm/trace.h
@@ -349,6 +349,171 @@ TRACE_EVENT(kvm_apic_accept_irq,
349 __entry->coalesced ? " (coalesced)" : "") 349 __entry->coalesced ? " (coalesced)" : "")
350); 350);
351 351
352/*
353 * Tracepoint for nested VMRUN
354 */
355TRACE_EVENT(kvm_nested_vmrun,
356 TP_PROTO(__u64 rip, __u64 vmcb, __u64 nested_rip, __u32 int_ctl,
357 __u32 event_inj, bool npt),
358 TP_ARGS(rip, vmcb, nested_rip, int_ctl, event_inj, npt),
359
360 TP_STRUCT__entry(
361 __field( __u64, rip )
362 __field( __u64, vmcb )
363 __field( __u64, nested_rip )
364 __field( __u32, int_ctl )
365 __field( __u32, event_inj )
366 __field( bool, npt )
367 ),
368
369 TP_fast_assign(
370 __entry->rip = rip;
371 __entry->vmcb = vmcb;
372 __entry->nested_rip = nested_rip;
373 __entry->int_ctl = int_ctl;
374 __entry->event_inj = event_inj;
375 __entry->npt = npt;
376 ),
377
378 TP_printk("rip: 0x%016llx vmcb: 0x%016llx nrip: 0x%016llx int_ctl: 0x%08x "
379 "event_inj: 0x%08x npt: %s\n",
380 __entry->rip, __entry->vmcb, __entry->nested_rip,
381 __entry->int_ctl, __entry->event_inj,
382 __entry->npt ? "on" : "off")
383);
384
385/*
386 * Tracepoint for #VMEXIT while nested
387 */
388TRACE_EVENT(kvm_nested_vmexit,
389 TP_PROTO(__u64 rip, __u32 exit_code,
390 __u64 exit_info1, __u64 exit_info2,
391 __u32 exit_int_info, __u32 exit_int_info_err),
392 TP_ARGS(rip, exit_code, exit_info1, exit_info2,
393 exit_int_info, exit_int_info_err),
394
395 TP_STRUCT__entry(
396 __field( __u64, rip )
397 __field( __u32, exit_code )
398 __field( __u64, exit_info1 )
399 __field( __u64, exit_info2 )
400 __field( __u32, exit_int_info )
401 __field( __u32, exit_int_info_err )
402 ),
403
404 TP_fast_assign(
405 __entry->rip = rip;
406 __entry->exit_code = exit_code;
407 __entry->exit_info1 = exit_info1;
408 __entry->exit_info2 = exit_info2;
409 __entry->exit_int_info = exit_int_info;
410 __entry->exit_int_info_err = exit_int_info_err;
411 ),
412 TP_printk("rip: 0x%016llx reason: %s ext_inf1: 0x%016llx "
413 "ext_inf2: 0x%016llx ext_int: 0x%08x ext_int_err: 0x%08x\n",
414 __entry->rip,
415 ftrace_print_symbols_seq(p, __entry->exit_code,
416 kvm_x86_ops->exit_reasons_str),
417 __entry->exit_info1, __entry->exit_info2,
418 __entry->exit_int_info, __entry->exit_int_info_err)
419);
420
421/*
422 * Tracepoint for #VMEXIT reinjected to the guest
423 */
424TRACE_EVENT(kvm_nested_vmexit_inject,
425 TP_PROTO(__u32 exit_code,
426 __u64 exit_info1, __u64 exit_info2,
427 __u32 exit_int_info, __u32 exit_int_info_err),
428 TP_ARGS(exit_code, exit_info1, exit_info2,
429 exit_int_info, exit_int_info_err),
430
431 TP_STRUCT__entry(
432 __field( __u32, exit_code )
433 __field( __u64, exit_info1 )
434 __field( __u64, exit_info2 )
435 __field( __u32, exit_int_info )
436 __field( __u32, exit_int_info_err )
437 ),
438
439 TP_fast_assign(
440 __entry->exit_code = exit_code;
441 __entry->exit_info1 = exit_info1;
442 __entry->exit_info2 = exit_info2;
443 __entry->exit_int_info = exit_int_info;
444 __entry->exit_int_info_err = exit_int_info_err;
445 ),
446
447 TP_printk("reason: %s ext_inf1: 0x%016llx "
448 "ext_inf2: 0x%016llx ext_int: 0x%08x ext_int_err: 0x%08x\n",
449 ftrace_print_symbols_seq(p, __entry->exit_code,
450 kvm_x86_ops->exit_reasons_str),
451 __entry->exit_info1, __entry->exit_info2,
452 __entry->exit_int_info, __entry->exit_int_info_err)
453);
454
455/*
456 * Tracepoint for nested #vmexit because of interrupt pending
457 */
458TRACE_EVENT(kvm_nested_intr_vmexit,
459 TP_PROTO(__u64 rip),
460 TP_ARGS(rip),
461
462 TP_STRUCT__entry(
463 __field( __u64, rip )
464 ),
465
466 TP_fast_assign(
467 __entry->rip = rip
468 ),
469
470 TP_printk("rip: 0x%016llx\n", __entry->rip)
471);
472
473/*
474 * Tracepoint for nested #vmexit because of interrupt pending
475 */
476TRACE_EVENT(kvm_invlpga,
477 TP_PROTO(__u64 rip, int asid, u64 address),
478 TP_ARGS(rip, asid, address),
479
480 TP_STRUCT__entry(
481 __field( __u64, rip )
482 __field( int, asid )
483 __field( __u64, address )
484 ),
485
486 TP_fast_assign(
487 __entry->rip = rip;
488 __entry->asid = asid;
489 __entry->address = address;
490 ),
491
492 TP_printk("rip: 0x%016llx asid: %d address: 0x%016llx\n",
493 __entry->rip, __entry->asid, __entry->address)
494);
495
496/*
497 * Tracepoint for nested #vmexit because of interrupt pending
498 */
499TRACE_EVENT(kvm_skinit,
500 TP_PROTO(__u64 rip, __u32 slb),
501 TP_ARGS(rip, slb),
502
503 TP_STRUCT__entry(
504 __field( __u64, rip )
505 __field( __u32, slb )
506 ),
507
508 TP_fast_assign(
509 __entry->rip = rip;
510 __entry->slb = slb;
511 ),
512
513 TP_printk("rip: 0x%016llx slb: 0x%08x\n",
514 __entry->rip, __entry->slb)
515);
516
352#endif /* _TRACE_KVM_H */ 517#endif /* _TRACE_KVM_H */
353 518
354/* This part must be outside protection */ 519/* This part must be outside protection */
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index ed53b42caba1..d4918d6fc924 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -61,12 +61,37 @@ module_param_named(unrestricted_guest,
61static int __read_mostly emulate_invalid_guest_state = 0; 61static int __read_mostly emulate_invalid_guest_state = 0;
62module_param(emulate_invalid_guest_state, bool, S_IRUGO); 62module_param(emulate_invalid_guest_state, bool, S_IRUGO);
63 63
64/*
65 * These 2 parameters are used to config the controls for Pause-Loop Exiting:
66 * ple_gap: upper bound on the amount of time between two successive
67 * executions of PAUSE in a loop. Also indicate if ple enabled.
68 * According to test, this time is usually small than 41 cycles.
69 * ple_window: upper bound on the amount of time a guest is allowed to execute
70 * in a PAUSE loop. Tests indicate that most spinlocks are held for
71 * less than 2^12 cycles
72 * Time is measured based on a counter that runs at the same rate as the TSC,
73 * refer SDM volume 3b section 21.6.13 & 22.1.3.
74 */
75#define KVM_VMX_DEFAULT_PLE_GAP 41
76#define KVM_VMX_DEFAULT_PLE_WINDOW 4096
77static int ple_gap = KVM_VMX_DEFAULT_PLE_GAP;
78module_param(ple_gap, int, S_IRUGO);
79
80static int ple_window = KVM_VMX_DEFAULT_PLE_WINDOW;
81module_param(ple_window, int, S_IRUGO);
82
64struct vmcs { 83struct vmcs {
65 u32 revision_id; 84 u32 revision_id;
66 u32 abort; 85 u32 abort;
67 char data[0]; 86 char data[0];
68}; 87};
69 88
89struct shared_msr_entry {
90 unsigned index;
91 u64 data;
92 u64 mask;
93};
94
70struct vcpu_vmx { 95struct vcpu_vmx {
71 struct kvm_vcpu vcpu; 96 struct kvm_vcpu vcpu;
72 struct list_head local_vcpus_link; 97 struct list_head local_vcpus_link;
@@ -74,13 +99,12 @@ struct vcpu_vmx {
74 int launched; 99 int launched;
75 u8 fail; 100 u8 fail;
76 u32 idt_vectoring_info; 101 u32 idt_vectoring_info;
77 struct kvm_msr_entry *guest_msrs; 102 struct shared_msr_entry *guest_msrs;
78 struct kvm_msr_entry *host_msrs;
79 int nmsrs; 103 int nmsrs;
80 int save_nmsrs; 104 int save_nmsrs;
81 int msr_offset_efer;
82#ifdef CONFIG_X86_64 105#ifdef CONFIG_X86_64
83 int msr_offset_kernel_gs_base; 106 u64 msr_host_kernel_gs_base;
107 u64 msr_guest_kernel_gs_base;
84#endif 108#endif
85 struct vmcs *vmcs; 109 struct vmcs *vmcs;
86 struct { 110 struct {
@@ -88,7 +112,6 @@ struct vcpu_vmx {
88 u16 fs_sel, gs_sel, ldt_sel; 112 u16 fs_sel, gs_sel, ldt_sel;
89 int gs_ldt_reload_needed; 113 int gs_ldt_reload_needed;
90 int fs_reload_needed; 114 int fs_reload_needed;
91 int guest_efer_loaded;
92 } host_state; 115 } host_state;
93 struct { 116 struct {
94 int vm86_active; 117 int vm86_active;
@@ -107,7 +130,6 @@ struct vcpu_vmx {
107 } rmode; 130 } rmode;
108 int vpid; 131 int vpid;
109 bool emulation_required; 132 bool emulation_required;
110 enum emulation_result invalid_state_emulation_result;
111 133
112 /* Support for vnmi-less CPUs */ 134 /* Support for vnmi-less CPUs */
113 int soft_vnmi_blocked; 135 int soft_vnmi_blocked;
@@ -176,6 +198,8 @@ static struct kvm_vmx_segment_field {
176 VMX_SEGMENT_FIELD(LDTR), 198 VMX_SEGMENT_FIELD(LDTR),
177}; 199};
178 200
201static u64 host_efer;
202
179static void ept_save_pdptrs(struct kvm_vcpu *vcpu); 203static void ept_save_pdptrs(struct kvm_vcpu *vcpu);
180 204
181/* 205/*
@@ -184,28 +208,12 @@ static void ept_save_pdptrs(struct kvm_vcpu *vcpu);
184 */ 208 */
185static const u32 vmx_msr_index[] = { 209static const u32 vmx_msr_index[] = {
186#ifdef CONFIG_X86_64 210#ifdef CONFIG_X86_64
187 MSR_SYSCALL_MASK, MSR_LSTAR, MSR_CSTAR, MSR_KERNEL_GS_BASE, 211 MSR_SYSCALL_MASK, MSR_LSTAR, MSR_CSTAR,
188#endif 212#endif
189 MSR_EFER, MSR_K6_STAR, 213 MSR_EFER, MSR_K6_STAR,
190}; 214};
191#define NR_VMX_MSR ARRAY_SIZE(vmx_msr_index) 215#define NR_VMX_MSR ARRAY_SIZE(vmx_msr_index)
192 216
193static void load_msrs(struct kvm_msr_entry *e, int n)
194{
195 int i;
196
197 for (i = 0; i < n; ++i)
198 wrmsrl(e[i].index, e[i].data);
199}
200
201static void save_msrs(struct kvm_msr_entry *e, int n)
202{
203 int i;
204
205 for (i = 0; i < n; ++i)
206 rdmsrl(e[i].index, e[i].data);
207}
208
209static inline int is_page_fault(u32 intr_info) 217static inline int is_page_fault(u32 intr_info)
210{ 218{
211 return (intr_info & (INTR_INFO_INTR_TYPE_MASK | INTR_INFO_VECTOR_MASK | 219 return (intr_info & (INTR_INFO_INTR_TYPE_MASK | INTR_INFO_VECTOR_MASK |
@@ -320,6 +328,12 @@ static inline int cpu_has_vmx_unrestricted_guest(void)
320 SECONDARY_EXEC_UNRESTRICTED_GUEST; 328 SECONDARY_EXEC_UNRESTRICTED_GUEST;
321} 329}
322 330
331static inline int cpu_has_vmx_ple(void)
332{
333 return vmcs_config.cpu_based_2nd_exec_ctrl &
334 SECONDARY_EXEC_PAUSE_LOOP_EXITING;
335}
336
323static inline int vm_need_virtualize_apic_accesses(struct kvm *kvm) 337static inline int vm_need_virtualize_apic_accesses(struct kvm *kvm)
324{ 338{
325 return flexpriority_enabled && 339 return flexpriority_enabled &&
@@ -348,7 +362,7 @@ static int __find_msr_index(struct vcpu_vmx *vmx, u32 msr)
348 int i; 362 int i;
349 363
350 for (i = 0; i < vmx->nmsrs; ++i) 364 for (i = 0; i < vmx->nmsrs; ++i)
351 if (vmx->guest_msrs[i].index == msr) 365 if (vmx_msr_index[vmx->guest_msrs[i].index] == msr)
352 return i; 366 return i;
353 return -1; 367 return -1;
354} 368}
@@ -379,7 +393,7 @@ static inline void __invept(int ext, u64 eptp, gpa_t gpa)
379 : : "a" (&operand), "c" (ext) : "cc", "memory"); 393 : : "a" (&operand), "c" (ext) : "cc", "memory");
380} 394}
381 395
382static struct kvm_msr_entry *find_msr_entry(struct vcpu_vmx *vmx, u32 msr) 396static struct shared_msr_entry *find_msr_entry(struct vcpu_vmx *vmx, u32 msr)
383{ 397{
384 int i; 398 int i;
385 399
@@ -570,17 +584,12 @@ static void reload_tss(void)
570 load_TR_desc(); 584 load_TR_desc();
571} 585}
572 586
573static void load_transition_efer(struct vcpu_vmx *vmx) 587static bool update_transition_efer(struct vcpu_vmx *vmx, int efer_offset)
574{ 588{
575 int efer_offset = vmx->msr_offset_efer;
576 u64 host_efer;
577 u64 guest_efer; 589 u64 guest_efer;
578 u64 ignore_bits; 590 u64 ignore_bits;
579 591
580 if (efer_offset < 0) 592 guest_efer = vmx->vcpu.arch.shadow_efer;
581 return;
582 host_efer = vmx->host_msrs[efer_offset].data;
583 guest_efer = vmx->guest_msrs[efer_offset].data;
584 593
585 /* 594 /*
586 * NX is emulated; LMA and LME handled by hardware; SCE meaninless 595 * NX is emulated; LMA and LME handled by hardware; SCE meaninless
@@ -593,27 +602,17 @@ static void load_transition_efer(struct vcpu_vmx *vmx)
593 if (guest_efer & EFER_LMA) 602 if (guest_efer & EFER_LMA)
594 ignore_bits &= ~(u64)EFER_SCE; 603 ignore_bits &= ~(u64)EFER_SCE;
595#endif 604#endif
596 if ((guest_efer & ~ignore_bits) == (host_efer & ~ignore_bits))
597 return;
598
599 vmx->host_state.guest_efer_loaded = 1;
600 guest_efer &= ~ignore_bits; 605 guest_efer &= ~ignore_bits;
601 guest_efer |= host_efer & ignore_bits; 606 guest_efer |= host_efer & ignore_bits;
602 wrmsrl(MSR_EFER, guest_efer); 607 vmx->guest_msrs[efer_offset].data = guest_efer;
603 vmx->vcpu.stat.efer_reload++; 608 vmx->guest_msrs[efer_offset].mask = ~ignore_bits;
604} 609 return true;
605
606static void reload_host_efer(struct vcpu_vmx *vmx)
607{
608 if (vmx->host_state.guest_efer_loaded) {
609 vmx->host_state.guest_efer_loaded = 0;
610 load_msrs(vmx->host_msrs + vmx->msr_offset_efer, 1);
611 }
612} 610}
613 611
614static void vmx_save_host_state(struct kvm_vcpu *vcpu) 612static void vmx_save_host_state(struct kvm_vcpu *vcpu)
615{ 613{
616 struct vcpu_vmx *vmx = to_vmx(vcpu); 614 struct vcpu_vmx *vmx = to_vmx(vcpu);
615 int i;
617 616
618 if (vmx->host_state.loaded) 617 if (vmx->host_state.loaded)
619 return; 618 return;
@@ -650,13 +649,15 @@ static void vmx_save_host_state(struct kvm_vcpu *vcpu)
650#endif 649#endif
651 650
652#ifdef CONFIG_X86_64 651#ifdef CONFIG_X86_64
653 if (is_long_mode(&vmx->vcpu)) 652 if (is_long_mode(&vmx->vcpu)) {
654 save_msrs(vmx->host_msrs + 653 rdmsrl(MSR_KERNEL_GS_BASE, vmx->msr_host_kernel_gs_base);
655 vmx->msr_offset_kernel_gs_base, 1); 654 wrmsrl(MSR_KERNEL_GS_BASE, vmx->msr_guest_kernel_gs_base);
656 655 }
657#endif 656#endif
658 load_msrs(vmx->guest_msrs, vmx->save_nmsrs); 657 for (i = 0; i < vmx->save_nmsrs; ++i)
659 load_transition_efer(vmx); 658 kvm_set_shared_msr(vmx->guest_msrs[i].index,
659 vmx->guest_msrs[i].data,
660 vmx->guest_msrs[i].mask);
660} 661}
661 662
662static void __vmx_load_host_state(struct vcpu_vmx *vmx) 663static void __vmx_load_host_state(struct vcpu_vmx *vmx)
@@ -684,9 +685,12 @@ static void __vmx_load_host_state(struct vcpu_vmx *vmx)
684 local_irq_restore(flags); 685 local_irq_restore(flags);
685 } 686 }
686 reload_tss(); 687 reload_tss();
687 save_msrs(vmx->guest_msrs, vmx->save_nmsrs); 688#ifdef CONFIG_X86_64
688 load_msrs(vmx->host_msrs, vmx->save_nmsrs); 689 if (is_long_mode(&vmx->vcpu)) {
689 reload_host_efer(vmx); 690 rdmsrl(MSR_KERNEL_GS_BASE, vmx->msr_guest_kernel_gs_base);
691 wrmsrl(MSR_KERNEL_GS_BASE, vmx->msr_host_kernel_gs_base);
692 }
693#endif
690} 694}
691 695
692static void vmx_load_host_state(struct vcpu_vmx *vmx) 696static void vmx_load_host_state(struct vcpu_vmx *vmx)
@@ -877,19 +881,14 @@ static void vmx_queue_exception(struct kvm_vcpu *vcpu, unsigned nr,
877/* 881/*
878 * Swap MSR entry in host/guest MSR entry array. 882 * Swap MSR entry in host/guest MSR entry array.
879 */ 883 */
880#ifdef CONFIG_X86_64
881static void move_msr_up(struct vcpu_vmx *vmx, int from, int to) 884static void move_msr_up(struct vcpu_vmx *vmx, int from, int to)
882{ 885{
883 struct kvm_msr_entry tmp; 886 struct shared_msr_entry tmp;
884 887
885 tmp = vmx->guest_msrs[to]; 888 tmp = vmx->guest_msrs[to];
886 vmx->guest_msrs[to] = vmx->guest_msrs[from]; 889 vmx->guest_msrs[to] = vmx->guest_msrs[from];
887 vmx->guest_msrs[from] = tmp; 890 vmx->guest_msrs[from] = tmp;
888 tmp = vmx->host_msrs[to];
889 vmx->host_msrs[to] = vmx->host_msrs[from];
890 vmx->host_msrs[from] = tmp;
891} 891}
892#endif
893 892
894/* 893/*
895 * Set up the vmcs to automatically save and restore system 894 * Set up the vmcs to automatically save and restore system
@@ -898,15 +897,13 @@ static void move_msr_up(struct vcpu_vmx *vmx, int from, int to)
898 */ 897 */
899static void setup_msrs(struct vcpu_vmx *vmx) 898static void setup_msrs(struct vcpu_vmx *vmx)
900{ 899{
901 int save_nmsrs; 900 int save_nmsrs, index;
902 unsigned long *msr_bitmap; 901 unsigned long *msr_bitmap;
903 902
904 vmx_load_host_state(vmx); 903 vmx_load_host_state(vmx);
905 save_nmsrs = 0; 904 save_nmsrs = 0;
906#ifdef CONFIG_X86_64 905#ifdef CONFIG_X86_64
907 if (is_long_mode(&vmx->vcpu)) { 906 if (is_long_mode(&vmx->vcpu)) {
908 int index;
909
910 index = __find_msr_index(vmx, MSR_SYSCALL_MASK); 907 index = __find_msr_index(vmx, MSR_SYSCALL_MASK);
911 if (index >= 0) 908 if (index >= 0)
912 move_msr_up(vmx, index, save_nmsrs++); 909 move_msr_up(vmx, index, save_nmsrs++);
@@ -916,9 +913,6 @@ static void setup_msrs(struct vcpu_vmx *vmx)
916 index = __find_msr_index(vmx, MSR_CSTAR); 913 index = __find_msr_index(vmx, MSR_CSTAR);
917 if (index >= 0) 914 if (index >= 0)
918 move_msr_up(vmx, index, save_nmsrs++); 915 move_msr_up(vmx, index, save_nmsrs++);
919 index = __find_msr_index(vmx, MSR_KERNEL_GS_BASE);
920 if (index >= 0)
921 move_msr_up(vmx, index, save_nmsrs++);
922 /* 916 /*
923 * MSR_K6_STAR is only needed on long mode guests, and only 917 * MSR_K6_STAR is only needed on long mode guests, and only
924 * if efer.sce is enabled. 918 * if efer.sce is enabled.
@@ -928,13 +922,11 @@ static void setup_msrs(struct vcpu_vmx *vmx)
928 move_msr_up(vmx, index, save_nmsrs++); 922 move_msr_up(vmx, index, save_nmsrs++);
929 } 923 }
930#endif 924#endif
931 vmx->save_nmsrs = save_nmsrs; 925 index = __find_msr_index(vmx, MSR_EFER);
926 if (index >= 0 && update_transition_efer(vmx, index))
927 move_msr_up(vmx, index, save_nmsrs++);
932 928
933#ifdef CONFIG_X86_64 929 vmx->save_nmsrs = save_nmsrs;
934 vmx->msr_offset_kernel_gs_base =
935 __find_msr_index(vmx, MSR_KERNEL_GS_BASE);
936#endif
937 vmx->msr_offset_efer = __find_msr_index(vmx, MSR_EFER);
938 930
939 if (cpu_has_vmx_msr_bitmap()) { 931 if (cpu_has_vmx_msr_bitmap()) {
940 if (is_long_mode(&vmx->vcpu)) 932 if (is_long_mode(&vmx->vcpu))
@@ -976,7 +968,7 @@ static void guest_write_tsc(u64 guest_tsc, u64 host_tsc)
976static int vmx_get_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 *pdata) 968static int vmx_get_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 *pdata)
977{ 969{
978 u64 data; 970 u64 data;
979 struct kvm_msr_entry *msr; 971 struct shared_msr_entry *msr;
980 972
981 if (!pdata) { 973 if (!pdata) {
982 printk(KERN_ERR "BUG: get_msr called with NULL pdata\n"); 974 printk(KERN_ERR "BUG: get_msr called with NULL pdata\n");
@@ -991,9 +983,13 @@ static int vmx_get_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 *pdata)
991 case MSR_GS_BASE: 983 case MSR_GS_BASE:
992 data = vmcs_readl(GUEST_GS_BASE); 984 data = vmcs_readl(GUEST_GS_BASE);
993 break; 985 break;
986 case MSR_KERNEL_GS_BASE:
987 vmx_load_host_state(to_vmx(vcpu));
988 data = to_vmx(vcpu)->msr_guest_kernel_gs_base;
989 break;
990#endif
994 case MSR_EFER: 991 case MSR_EFER:
995 return kvm_get_msr_common(vcpu, msr_index, pdata); 992 return kvm_get_msr_common(vcpu, msr_index, pdata);
996#endif
997 case MSR_IA32_TSC: 993 case MSR_IA32_TSC:
998 data = guest_read_tsc(); 994 data = guest_read_tsc();
999 break; 995 break;
@@ -1007,6 +1003,7 @@ static int vmx_get_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 *pdata)
1007 data = vmcs_readl(GUEST_SYSENTER_ESP); 1003 data = vmcs_readl(GUEST_SYSENTER_ESP);
1008 break; 1004 break;
1009 default: 1005 default:
1006 vmx_load_host_state(to_vmx(vcpu));
1010 msr = find_msr_entry(to_vmx(vcpu), msr_index); 1007 msr = find_msr_entry(to_vmx(vcpu), msr_index);
1011 if (msr) { 1008 if (msr) {
1012 vmx_load_host_state(to_vmx(vcpu)); 1009 vmx_load_host_state(to_vmx(vcpu));
@@ -1028,7 +1025,7 @@ static int vmx_get_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 *pdata)
1028static int vmx_set_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 data) 1025static int vmx_set_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 data)
1029{ 1026{
1030 struct vcpu_vmx *vmx = to_vmx(vcpu); 1027 struct vcpu_vmx *vmx = to_vmx(vcpu);
1031 struct kvm_msr_entry *msr; 1028 struct shared_msr_entry *msr;
1032 u64 host_tsc; 1029 u64 host_tsc;
1033 int ret = 0; 1030 int ret = 0;
1034 1031
@@ -1044,6 +1041,10 @@ static int vmx_set_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 data)
1044 case MSR_GS_BASE: 1041 case MSR_GS_BASE:
1045 vmcs_writel(GUEST_GS_BASE, data); 1042 vmcs_writel(GUEST_GS_BASE, data);
1046 break; 1043 break;
1044 case MSR_KERNEL_GS_BASE:
1045 vmx_load_host_state(vmx);
1046 vmx->msr_guest_kernel_gs_base = data;
1047 break;
1047#endif 1048#endif
1048 case MSR_IA32_SYSENTER_CS: 1049 case MSR_IA32_SYSENTER_CS:
1049 vmcs_write32(GUEST_SYSENTER_CS, data); 1050 vmcs_write32(GUEST_SYSENTER_CS, data);
@@ -1097,30 +1098,14 @@ static void vmx_cache_reg(struct kvm_vcpu *vcpu, enum kvm_reg reg)
1097 } 1098 }
1098} 1099}
1099 1100
1100static int set_guest_debug(struct kvm_vcpu *vcpu, struct kvm_guest_debug *dbg) 1101static void set_guest_debug(struct kvm_vcpu *vcpu, struct kvm_guest_debug *dbg)
1101{ 1102{
1102 int old_debug = vcpu->guest_debug;
1103 unsigned long flags;
1104
1105 vcpu->guest_debug = dbg->control;
1106 if (!(vcpu->guest_debug & KVM_GUESTDBG_ENABLE))
1107 vcpu->guest_debug = 0;
1108
1109 if (vcpu->guest_debug & KVM_GUESTDBG_USE_HW_BP) 1103 if (vcpu->guest_debug & KVM_GUESTDBG_USE_HW_BP)
1110 vmcs_writel(GUEST_DR7, dbg->arch.debugreg[7]); 1104 vmcs_writel(GUEST_DR7, dbg->arch.debugreg[7]);
1111 else 1105 else
1112 vmcs_writel(GUEST_DR7, vcpu->arch.dr7); 1106 vmcs_writel(GUEST_DR7, vcpu->arch.dr7);
1113 1107
1114 flags = vmcs_readl(GUEST_RFLAGS);
1115 if (vcpu->guest_debug & KVM_GUESTDBG_SINGLESTEP)
1116 flags |= X86_EFLAGS_TF | X86_EFLAGS_RF;
1117 else if (old_debug & KVM_GUESTDBG_SINGLESTEP)
1118 flags &= ~(X86_EFLAGS_TF | X86_EFLAGS_RF);
1119 vmcs_writel(GUEST_RFLAGS, flags);
1120
1121 update_exception_bitmap(vcpu); 1108 update_exception_bitmap(vcpu);
1122
1123 return 0;
1124} 1109}
1125 1110
1126static __init int cpu_has_kvm_support(void) 1111static __init int cpu_has_kvm_support(void)
@@ -1139,12 +1124,15 @@ static __init int vmx_disabled_by_bios(void)
1139 /* locked but not enabled */ 1124 /* locked but not enabled */
1140} 1125}
1141 1126
1142static void hardware_enable(void *garbage) 1127static int hardware_enable(void *garbage)
1143{ 1128{
1144 int cpu = raw_smp_processor_id(); 1129 int cpu = raw_smp_processor_id();
1145 u64 phys_addr = __pa(per_cpu(vmxarea, cpu)); 1130 u64 phys_addr = __pa(per_cpu(vmxarea, cpu));
1146 u64 old; 1131 u64 old;
1147 1132
1133 if (read_cr4() & X86_CR4_VMXE)
1134 return -EBUSY;
1135
1148 INIT_LIST_HEAD(&per_cpu(vcpus_on_cpu, cpu)); 1136 INIT_LIST_HEAD(&per_cpu(vcpus_on_cpu, cpu));
1149 rdmsrl(MSR_IA32_FEATURE_CONTROL, old); 1137 rdmsrl(MSR_IA32_FEATURE_CONTROL, old);
1150 if ((old & (FEATURE_CONTROL_LOCKED | 1138 if ((old & (FEATURE_CONTROL_LOCKED |
@@ -1159,6 +1147,10 @@ static void hardware_enable(void *garbage)
1159 asm volatile (ASM_VMX_VMXON_RAX 1147 asm volatile (ASM_VMX_VMXON_RAX
1160 : : "a"(&phys_addr), "m"(phys_addr) 1148 : : "a"(&phys_addr), "m"(phys_addr)
1161 : "memory", "cc"); 1149 : "memory", "cc");
1150
1151 ept_sync_global();
1152
1153 return 0;
1162} 1154}
1163 1155
1164static void vmclear_local_vcpus(void) 1156static void vmclear_local_vcpus(void)
@@ -1250,7 +1242,8 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf)
1250 SECONDARY_EXEC_WBINVD_EXITING | 1242 SECONDARY_EXEC_WBINVD_EXITING |
1251 SECONDARY_EXEC_ENABLE_VPID | 1243 SECONDARY_EXEC_ENABLE_VPID |
1252 SECONDARY_EXEC_ENABLE_EPT | 1244 SECONDARY_EXEC_ENABLE_EPT |
1253 SECONDARY_EXEC_UNRESTRICTED_GUEST; 1245 SECONDARY_EXEC_UNRESTRICTED_GUEST |
1246 SECONDARY_EXEC_PAUSE_LOOP_EXITING;
1254 if (adjust_vmx_controls(min2, opt2, 1247 if (adjust_vmx_controls(min2, opt2,
1255 MSR_IA32_VMX_PROCBASED_CTLS2, 1248 MSR_IA32_VMX_PROCBASED_CTLS2,
1256 &_cpu_based_2nd_exec_control) < 0) 1249 &_cpu_based_2nd_exec_control) < 0)
@@ -1344,15 +1337,17 @@ static void free_kvm_area(void)
1344{ 1337{
1345 int cpu; 1338 int cpu;
1346 1339
1347 for_each_online_cpu(cpu) 1340 for_each_possible_cpu(cpu) {
1348 free_vmcs(per_cpu(vmxarea, cpu)); 1341 free_vmcs(per_cpu(vmxarea, cpu));
1342 per_cpu(vmxarea, cpu) = NULL;
1343 }
1349} 1344}
1350 1345
1351static __init int alloc_kvm_area(void) 1346static __init int alloc_kvm_area(void)
1352{ 1347{
1353 int cpu; 1348 int cpu;
1354 1349
1355 for_each_online_cpu(cpu) { 1350 for_each_possible_cpu(cpu) {
1356 struct vmcs *vmcs; 1351 struct vmcs *vmcs;
1357 1352
1358 vmcs = alloc_vmcs_cpu(cpu); 1353 vmcs = alloc_vmcs_cpu(cpu);
@@ -1394,6 +1389,9 @@ static __init int hardware_setup(void)
1394 if (enable_ept && !cpu_has_vmx_ept_2m_page()) 1389 if (enable_ept && !cpu_has_vmx_ept_2m_page())
1395 kvm_disable_largepages(); 1390 kvm_disable_largepages();
1396 1391
1392 if (!cpu_has_vmx_ple())
1393 ple_gap = 0;
1394
1397 return alloc_kvm_area(); 1395 return alloc_kvm_area();
1398} 1396}
1399 1397
@@ -1536,8 +1534,16 @@ continue_rmode:
1536static void vmx_set_efer(struct kvm_vcpu *vcpu, u64 efer) 1534static void vmx_set_efer(struct kvm_vcpu *vcpu, u64 efer)
1537{ 1535{
1538 struct vcpu_vmx *vmx = to_vmx(vcpu); 1536 struct vcpu_vmx *vmx = to_vmx(vcpu);
1539 struct kvm_msr_entry *msr = find_msr_entry(vmx, MSR_EFER); 1537 struct shared_msr_entry *msr = find_msr_entry(vmx, MSR_EFER);
1538
1539 if (!msr)
1540 return;
1540 1541
1542 /*
1543 * Force kernel_gs_base reloading before EFER changes, as control
1544 * of this msr depends on is_long_mode().
1545 */
1546 vmx_load_host_state(to_vmx(vcpu));
1541 vcpu->arch.shadow_efer = efer; 1547 vcpu->arch.shadow_efer = efer;
1542 if (!msr) 1548 if (!msr)
1543 return; 1549 return;
@@ -1727,6 +1733,7 @@ static void vmx_set_cr3(struct kvm_vcpu *vcpu, unsigned long cr3)
1727 vmcs_write64(EPT_POINTER, eptp); 1733 vmcs_write64(EPT_POINTER, eptp);
1728 guest_cr3 = is_paging(vcpu) ? vcpu->arch.cr3 : 1734 guest_cr3 = is_paging(vcpu) ? vcpu->arch.cr3 :
1729 vcpu->kvm->arch.ept_identity_map_addr; 1735 vcpu->kvm->arch.ept_identity_map_addr;
1736 ept_load_pdptrs(vcpu);
1730 } 1737 }
1731 1738
1732 vmx_flush_tlb(vcpu); 1739 vmx_flush_tlb(vcpu);
@@ -2302,13 +2309,22 @@ static int vmx_vcpu_setup(struct vcpu_vmx *vmx)
2302 ~SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES; 2309 ~SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES;
2303 if (vmx->vpid == 0) 2310 if (vmx->vpid == 0)
2304 exec_control &= ~SECONDARY_EXEC_ENABLE_VPID; 2311 exec_control &= ~SECONDARY_EXEC_ENABLE_VPID;
2305 if (!enable_ept) 2312 if (!enable_ept) {
2306 exec_control &= ~SECONDARY_EXEC_ENABLE_EPT; 2313 exec_control &= ~SECONDARY_EXEC_ENABLE_EPT;
2314 enable_unrestricted_guest = 0;
2315 }
2307 if (!enable_unrestricted_guest) 2316 if (!enable_unrestricted_guest)
2308 exec_control &= ~SECONDARY_EXEC_UNRESTRICTED_GUEST; 2317 exec_control &= ~SECONDARY_EXEC_UNRESTRICTED_GUEST;
2318 if (!ple_gap)
2319 exec_control &= ~SECONDARY_EXEC_PAUSE_LOOP_EXITING;
2309 vmcs_write32(SECONDARY_VM_EXEC_CONTROL, exec_control); 2320 vmcs_write32(SECONDARY_VM_EXEC_CONTROL, exec_control);
2310 } 2321 }
2311 2322
2323 if (ple_gap) {
2324 vmcs_write32(PLE_GAP, ple_gap);
2325 vmcs_write32(PLE_WINDOW, ple_window);
2326 }
2327
2312 vmcs_write32(PAGE_FAULT_ERROR_CODE_MASK, !!bypass_guest_pf); 2328 vmcs_write32(PAGE_FAULT_ERROR_CODE_MASK, !!bypass_guest_pf);
2313 vmcs_write32(PAGE_FAULT_ERROR_CODE_MATCH, !!bypass_guest_pf); 2329 vmcs_write32(PAGE_FAULT_ERROR_CODE_MATCH, !!bypass_guest_pf);
2314 vmcs_write32(CR3_TARGET_COUNT, 0); /* 22.2.1 */ 2330 vmcs_write32(CR3_TARGET_COUNT, 0); /* 22.2.1 */
@@ -2376,10 +2392,9 @@ static int vmx_vcpu_setup(struct vcpu_vmx *vmx)
2376 if (wrmsr_safe(index, data_low, data_high) < 0) 2392 if (wrmsr_safe(index, data_low, data_high) < 0)
2377 continue; 2393 continue;
2378 data = data_low | ((u64)data_high << 32); 2394 data = data_low | ((u64)data_high << 32);
2379 vmx->host_msrs[j].index = index; 2395 vmx->guest_msrs[j].index = i;
2380 vmx->host_msrs[j].reserved = 0; 2396 vmx->guest_msrs[j].data = 0;
2381 vmx->host_msrs[j].data = data; 2397 vmx->guest_msrs[j].mask = -1ull;
2382 vmx->guest_msrs[j] = vmx->host_msrs[j];
2383 ++vmx->nmsrs; 2398 ++vmx->nmsrs;
2384 } 2399 }
2385 2400
@@ -2510,7 +2525,7 @@ static int vmx_vcpu_reset(struct kvm_vcpu *vcpu)
2510 if (vmx->vpid != 0) 2525 if (vmx->vpid != 0)
2511 vmcs_write16(VIRTUAL_PROCESSOR_ID, vmx->vpid); 2526 vmcs_write16(VIRTUAL_PROCESSOR_ID, vmx->vpid);
2512 2527
2513 vmx->vcpu.arch.cr0 = 0x60000010; 2528 vmx->vcpu.arch.cr0 = X86_CR0_NW | X86_CR0_CD | X86_CR0_ET;
2514 vmx_set_cr0(&vmx->vcpu, vmx->vcpu.arch.cr0); /* enter rmode */ 2529 vmx_set_cr0(&vmx->vcpu, vmx->vcpu.arch.cr0); /* enter rmode */
2515 vmx_set_cr4(&vmx->vcpu, 0); 2530 vmx_set_cr4(&vmx->vcpu, 0);
2516 vmx_set_efer(&vmx->vcpu, 0); 2531 vmx_set_efer(&vmx->vcpu, 0);
@@ -2627,6 +2642,34 @@ static int vmx_nmi_allowed(struct kvm_vcpu *vcpu)
2627 GUEST_INTR_STATE_NMI)); 2642 GUEST_INTR_STATE_NMI));
2628} 2643}
2629 2644
2645static bool vmx_get_nmi_mask(struct kvm_vcpu *vcpu)
2646{
2647 if (!cpu_has_virtual_nmis())
2648 return to_vmx(vcpu)->soft_vnmi_blocked;
2649 else
2650 return !!(vmcs_read32(GUEST_INTERRUPTIBILITY_INFO) &
2651 GUEST_INTR_STATE_NMI);
2652}
2653
2654static void vmx_set_nmi_mask(struct kvm_vcpu *vcpu, bool masked)
2655{
2656 struct vcpu_vmx *vmx = to_vmx(vcpu);
2657
2658 if (!cpu_has_virtual_nmis()) {
2659 if (vmx->soft_vnmi_blocked != masked) {
2660 vmx->soft_vnmi_blocked = masked;
2661 vmx->vnmi_blocked_time = 0;
2662 }
2663 } else {
2664 if (masked)
2665 vmcs_set_bits(GUEST_INTERRUPTIBILITY_INFO,
2666 GUEST_INTR_STATE_NMI);
2667 else
2668 vmcs_clear_bits(GUEST_INTERRUPTIBILITY_INFO,
2669 GUEST_INTR_STATE_NMI);
2670 }
2671}
2672
2630static int vmx_interrupt_allowed(struct kvm_vcpu *vcpu) 2673static int vmx_interrupt_allowed(struct kvm_vcpu *vcpu)
2631{ 2674{
2632 return (vmcs_readl(GUEST_RFLAGS) & X86_EFLAGS_IF) && 2675 return (vmcs_readl(GUEST_RFLAGS) & X86_EFLAGS_IF) &&
@@ -2659,7 +2702,7 @@ static int handle_rmode_exception(struct kvm_vcpu *vcpu,
2659 * Cause the #SS fault with 0 error code in VM86 mode. 2702 * Cause the #SS fault with 0 error code in VM86 mode.
2660 */ 2703 */
2661 if (((vec == GP_VECTOR) || (vec == SS_VECTOR)) && err_code == 0) 2704 if (((vec == GP_VECTOR) || (vec == SS_VECTOR)) && err_code == 0)
2662 if (emulate_instruction(vcpu, NULL, 0, 0, 0) == EMULATE_DONE) 2705 if (emulate_instruction(vcpu, 0, 0, 0) == EMULATE_DONE)
2663 return 1; 2706 return 1;
2664 /* 2707 /*
2665 * Forward all other exceptions that are valid in real mode. 2708 * Forward all other exceptions that are valid in real mode.
@@ -2710,15 +2753,16 @@ static void kvm_machine_check(void)
2710#endif 2753#endif
2711} 2754}
2712 2755
2713static int handle_machine_check(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) 2756static int handle_machine_check(struct kvm_vcpu *vcpu)
2714{ 2757{
2715 /* already handled by vcpu_run */ 2758 /* already handled by vcpu_run */
2716 return 1; 2759 return 1;
2717} 2760}
2718 2761
2719static int handle_exception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) 2762static int handle_exception(struct kvm_vcpu *vcpu)
2720{ 2763{
2721 struct vcpu_vmx *vmx = to_vmx(vcpu); 2764 struct vcpu_vmx *vmx = to_vmx(vcpu);
2765 struct kvm_run *kvm_run = vcpu->run;
2722 u32 intr_info, ex_no, error_code; 2766 u32 intr_info, ex_no, error_code;
2723 unsigned long cr2, rip, dr6; 2767 unsigned long cr2, rip, dr6;
2724 u32 vect_info; 2768 u32 vect_info;
@@ -2728,12 +2772,17 @@ static int handle_exception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
2728 intr_info = vmcs_read32(VM_EXIT_INTR_INFO); 2772 intr_info = vmcs_read32(VM_EXIT_INTR_INFO);
2729 2773
2730 if (is_machine_check(intr_info)) 2774 if (is_machine_check(intr_info))
2731 return handle_machine_check(vcpu, kvm_run); 2775 return handle_machine_check(vcpu);
2732 2776
2733 if ((vect_info & VECTORING_INFO_VALID_MASK) && 2777 if ((vect_info & VECTORING_INFO_VALID_MASK) &&
2734 !is_page_fault(intr_info)) 2778 !is_page_fault(intr_info)) {
2735 printk(KERN_ERR "%s: unexpected, vectoring info 0x%x " 2779 vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR;
2736 "intr info 0x%x\n", __func__, vect_info, intr_info); 2780 vcpu->run->internal.suberror = KVM_INTERNAL_ERROR_SIMUL_EX;
2781 vcpu->run->internal.ndata = 2;
2782 vcpu->run->internal.data[0] = vect_info;
2783 vcpu->run->internal.data[1] = intr_info;
2784 return 0;
2785 }
2737 2786
2738 if ((intr_info & INTR_INFO_INTR_TYPE_MASK) == INTR_TYPE_NMI_INTR) 2787 if ((intr_info & INTR_INFO_INTR_TYPE_MASK) == INTR_TYPE_NMI_INTR)
2739 return 1; /* already handled by vmx_vcpu_run() */ 2788 return 1; /* already handled by vmx_vcpu_run() */
@@ -2744,7 +2793,7 @@ static int handle_exception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
2744 } 2793 }
2745 2794
2746 if (is_invalid_opcode(intr_info)) { 2795 if (is_invalid_opcode(intr_info)) {
2747 er = emulate_instruction(vcpu, kvm_run, 0, 0, EMULTYPE_TRAP_UD); 2796 er = emulate_instruction(vcpu, 0, 0, EMULTYPE_TRAP_UD);
2748 if (er != EMULATE_DONE) 2797 if (er != EMULATE_DONE)
2749 kvm_queue_exception(vcpu, UD_VECTOR); 2798 kvm_queue_exception(vcpu, UD_VECTOR);
2750 return 1; 2799 return 1;
@@ -2803,20 +2852,19 @@ static int handle_exception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
2803 return 0; 2852 return 0;
2804} 2853}
2805 2854
2806static int handle_external_interrupt(struct kvm_vcpu *vcpu, 2855static int handle_external_interrupt(struct kvm_vcpu *vcpu)
2807 struct kvm_run *kvm_run)
2808{ 2856{
2809 ++vcpu->stat.irq_exits; 2857 ++vcpu->stat.irq_exits;
2810 return 1; 2858 return 1;
2811} 2859}
2812 2860
2813static int handle_triple_fault(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) 2861static int handle_triple_fault(struct kvm_vcpu *vcpu)
2814{ 2862{
2815 kvm_run->exit_reason = KVM_EXIT_SHUTDOWN; 2863 vcpu->run->exit_reason = KVM_EXIT_SHUTDOWN;
2816 return 0; 2864 return 0;
2817} 2865}
2818 2866
2819static int handle_io(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) 2867static int handle_io(struct kvm_vcpu *vcpu)
2820{ 2868{
2821 unsigned long exit_qualification; 2869 unsigned long exit_qualification;
2822 int size, in, string; 2870 int size, in, string;
@@ -2827,8 +2875,7 @@ static int handle_io(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
2827 string = (exit_qualification & 16) != 0; 2875 string = (exit_qualification & 16) != 0;
2828 2876
2829 if (string) { 2877 if (string) {
2830 if (emulate_instruction(vcpu, 2878 if (emulate_instruction(vcpu, 0, 0, 0) == EMULATE_DO_MMIO)
2831 kvm_run, 0, 0, 0) == EMULATE_DO_MMIO)
2832 return 0; 2879 return 0;
2833 return 1; 2880 return 1;
2834 } 2881 }
@@ -2838,7 +2885,7 @@ static int handle_io(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
2838 port = exit_qualification >> 16; 2885 port = exit_qualification >> 16;
2839 2886
2840 skip_emulated_instruction(vcpu); 2887 skip_emulated_instruction(vcpu);
2841 return kvm_emulate_pio(vcpu, kvm_run, in, size, port); 2888 return kvm_emulate_pio(vcpu, in, size, port);
2842} 2889}
2843 2890
2844static void 2891static void
@@ -2852,7 +2899,7 @@ vmx_patch_hypercall(struct kvm_vcpu *vcpu, unsigned char *hypercall)
2852 hypercall[2] = 0xc1; 2899 hypercall[2] = 0xc1;
2853} 2900}
2854 2901
2855static int handle_cr(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) 2902static int handle_cr(struct kvm_vcpu *vcpu)
2856{ 2903{
2857 unsigned long exit_qualification, val; 2904 unsigned long exit_qualification, val;
2858 int cr; 2905 int cr;
@@ -2887,7 +2934,7 @@ static int handle_cr(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
2887 return 1; 2934 return 1;
2888 if (cr8_prev <= cr8) 2935 if (cr8_prev <= cr8)
2889 return 1; 2936 return 1;
2890 kvm_run->exit_reason = KVM_EXIT_SET_TPR; 2937 vcpu->run->exit_reason = KVM_EXIT_SET_TPR;
2891 return 0; 2938 return 0;
2892 } 2939 }
2893 }; 2940 };
@@ -2922,13 +2969,13 @@ static int handle_cr(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
2922 default: 2969 default:
2923 break; 2970 break;
2924 } 2971 }
2925 kvm_run->exit_reason = 0; 2972 vcpu->run->exit_reason = 0;
2926 pr_unimpl(vcpu, "unhandled control register: op %d cr %d\n", 2973 pr_unimpl(vcpu, "unhandled control register: op %d cr %d\n",
2927 (int)(exit_qualification >> 4) & 3, cr); 2974 (int)(exit_qualification >> 4) & 3, cr);
2928 return 0; 2975 return 0;
2929} 2976}
2930 2977
2931static int handle_dr(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) 2978static int handle_dr(struct kvm_vcpu *vcpu)
2932{ 2979{
2933 unsigned long exit_qualification; 2980 unsigned long exit_qualification;
2934 unsigned long val; 2981 unsigned long val;
@@ -2944,13 +2991,13 @@ static int handle_dr(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
2944 * guest debugging itself. 2991 * guest debugging itself.
2945 */ 2992 */
2946 if (vcpu->guest_debug & KVM_GUESTDBG_USE_HW_BP) { 2993 if (vcpu->guest_debug & KVM_GUESTDBG_USE_HW_BP) {
2947 kvm_run->debug.arch.dr6 = vcpu->arch.dr6; 2994 vcpu->run->debug.arch.dr6 = vcpu->arch.dr6;
2948 kvm_run->debug.arch.dr7 = dr; 2995 vcpu->run->debug.arch.dr7 = dr;
2949 kvm_run->debug.arch.pc = 2996 vcpu->run->debug.arch.pc =
2950 vmcs_readl(GUEST_CS_BASE) + 2997 vmcs_readl(GUEST_CS_BASE) +
2951 vmcs_readl(GUEST_RIP); 2998 vmcs_readl(GUEST_RIP);
2952 kvm_run->debug.arch.exception = DB_VECTOR; 2999 vcpu->run->debug.arch.exception = DB_VECTOR;
2953 kvm_run->exit_reason = KVM_EXIT_DEBUG; 3000 vcpu->run->exit_reason = KVM_EXIT_DEBUG;
2954 return 0; 3001 return 0;
2955 } else { 3002 } else {
2956 vcpu->arch.dr7 &= ~DR7_GD; 3003 vcpu->arch.dr7 &= ~DR7_GD;
@@ -3016,13 +3063,13 @@ static int handle_dr(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
3016 return 1; 3063 return 1;
3017} 3064}
3018 3065
3019static int handle_cpuid(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) 3066static int handle_cpuid(struct kvm_vcpu *vcpu)
3020{ 3067{
3021 kvm_emulate_cpuid(vcpu); 3068 kvm_emulate_cpuid(vcpu);
3022 return 1; 3069 return 1;
3023} 3070}
3024 3071
3025static int handle_rdmsr(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) 3072static int handle_rdmsr(struct kvm_vcpu *vcpu)
3026{ 3073{
3027 u32 ecx = vcpu->arch.regs[VCPU_REGS_RCX]; 3074 u32 ecx = vcpu->arch.regs[VCPU_REGS_RCX];
3028 u64 data; 3075 u64 data;
@@ -3041,7 +3088,7 @@ static int handle_rdmsr(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
3041 return 1; 3088 return 1;
3042} 3089}
3043 3090
3044static int handle_wrmsr(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) 3091static int handle_wrmsr(struct kvm_vcpu *vcpu)
3045{ 3092{
3046 u32 ecx = vcpu->arch.regs[VCPU_REGS_RCX]; 3093 u32 ecx = vcpu->arch.regs[VCPU_REGS_RCX];
3047 u64 data = (vcpu->arch.regs[VCPU_REGS_RAX] & -1u) 3094 u64 data = (vcpu->arch.regs[VCPU_REGS_RAX] & -1u)
@@ -3058,14 +3105,12 @@ static int handle_wrmsr(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
3058 return 1; 3105 return 1;
3059} 3106}
3060 3107
3061static int handle_tpr_below_threshold(struct kvm_vcpu *vcpu, 3108static int handle_tpr_below_threshold(struct kvm_vcpu *vcpu)
3062 struct kvm_run *kvm_run)
3063{ 3109{
3064 return 1; 3110 return 1;
3065} 3111}
3066 3112
3067static int handle_interrupt_window(struct kvm_vcpu *vcpu, 3113static int handle_interrupt_window(struct kvm_vcpu *vcpu)
3068 struct kvm_run *kvm_run)
3069{ 3114{
3070 u32 cpu_based_vm_exec_control; 3115 u32 cpu_based_vm_exec_control;
3071 3116
@@ -3081,34 +3126,34 @@ static int handle_interrupt_window(struct kvm_vcpu *vcpu,
3081 * possible 3126 * possible
3082 */ 3127 */
3083 if (!irqchip_in_kernel(vcpu->kvm) && 3128 if (!irqchip_in_kernel(vcpu->kvm) &&
3084 kvm_run->request_interrupt_window && 3129 vcpu->run->request_interrupt_window &&
3085 !kvm_cpu_has_interrupt(vcpu)) { 3130 !kvm_cpu_has_interrupt(vcpu)) {
3086 kvm_run->exit_reason = KVM_EXIT_IRQ_WINDOW_OPEN; 3131 vcpu->run->exit_reason = KVM_EXIT_IRQ_WINDOW_OPEN;
3087 return 0; 3132 return 0;
3088 } 3133 }
3089 return 1; 3134 return 1;
3090} 3135}
3091 3136
3092static int handle_halt(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) 3137static int handle_halt(struct kvm_vcpu *vcpu)
3093{ 3138{
3094 skip_emulated_instruction(vcpu); 3139 skip_emulated_instruction(vcpu);
3095 return kvm_emulate_halt(vcpu); 3140 return kvm_emulate_halt(vcpu);
3096} 3141}
3097 3142
3098static int handle_vmcall(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) 3143static int handle_vmcall(struct kvm_vcpu *vcpu)
3099{ 3144{
3100 skip_emulated_instruction(vcpu); 3145 skip_emulated_instruction(vcpu);
3101 kvm_emulate_hypercall(vcpu); 3146 kvm_emulate_hypercall(vcpu);
3102 return 1; 3147 return 1;
3103} 3148}
3104 3149
3105static int handle_vmx_insn(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) 3150static int handle_vmx_insn(struct kvm_vcpu *vcpu)
3106{ 3151{
3107 kvm_queue_exception(vcpu, UD_VECTOR); 3152 kvm_queue_exception(vcpu, UD_VECTOR);
3108 return 1; 3153 return 1;
3109} 3154}
3110 3155
3111static int handle_invlpg(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) 3156static int handle_invlpg(struct kvm_vcpu *vcpu)
3112{ 3157{
3113 unsigned long exit_qualification = vmcs_readl(EXIT_QUALIFICATION); 3158 unsigned long exit_qualification = vmcs_readl(EXIT_QUALIFICATION);
3114 3159
@@ -3117,14 +3162,14 @@ static int handle_invlpg(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
3117 return 1; 3162 return 1;
3118} 3163}
3119 3164
3120static int handle_wbinvd(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) 3165static int handle_wbinvd(struct kvm_vcpu *vcpu)
3121{ 3166{
3122 skip_emulated_instruction(vcpu); 3167 skip_emulated_instruction(vcpu);
3123 /* TODO: Add support for VT-d/pass-through device */ 3168 /* TODO: Add support for VT-d/pass-through device */
3124 return 1; 3169 return 1;
3125} 3170}
3126 3171
3127static int handle_apic_access(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) 3172static int handle_apic_access(struct kvm_vcpu *vcpu)
3128{ 3173{
3129 unsigned long exit_qualification; 3174 unsigned long exit_qualification;
3130 enum emulation_result er; 3175 enum emulation_result er;
@@ -3133,7 +3178,7 @@ static int handle_apic_access(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
3133 exit_qualification = vmcs_readl(EXIT_QUALIFICATION); 3178 exit_qualification = vmcs_readl(EXIT_QUALIFICATION);
3134 offset = exit_qualification & 0xffful; 3179 offset = exit_qualification & 0xffful;
3135 3180
3136 er = emulate_instruction(vcpu, kvm_run, 0, 0, 0); 3181 er = emulate_instruction(vcpu, 0, 0, 0);
3137 3182
3138 if (er != EMULATE_DONE) { 3183 if (er != EMULATE_DONE) {
3139 printk(KERN_ERR 3184 printk(KERN_ERR
@@ -3144,7 +3189,7 @@ static int handle_apic_access(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
3144 return 1; 3189 return 1;
3145} 3190}
3146 3191
3147static int handle_task_switch(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) 3192static int handle_task_switch(struct kvm_vcpu *vcpu)
3148{ 3193{
3149 struct vcpu_vmx *vmx = to_vmx(vcpu); 3194 struct vcpu_vmx *vmx = to_vmx(vcpu);
3150 unsigned long exit_qualification; 3195 unsigned long exit_qualification;
@@ -3198,7 +3243,7 @@ static int handle_task_switch(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
3198 return 1; 3243 return 1;
3199} 3244}
3200 3245
3201static int handle_ept_violation(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) 3246static int handle_ept_violation(struct kvm_vcpu *vcpu)
3202{ 3247{
3203 unsigned long exit_qualification; 3248 unsigned long exit_qualification;
3204 gpa_t gpa; 3249 gpa_t gpa;
@@ -3219,8 +3264,8 @@ static int handle_ept_violation(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
3219 vmcs_readl(GUEST_LINEAR_ADDRESS)); 3264 vmcs_readl(GUEST_LINEAR_ADDRESS));
3220 printk(KERN_ERR "EPT: Exit qualification is 0x%lx\n", 3265 printk(KERN_ERR "EPT: Exit qualification is 0x%lx\n",
3221 (long unsigned int)exit_qualification); 3266 (long unsigned int)exit_qualification);
3222 kvm_run->exit_reason = KVM_EXIT_UNKNOWN; 3267 vcpu->run->exit_reason = KVM_EXIT_UNKNOWN;
3223 kvm_run->hw.hardware_exit_reason = EXIT_REASON_EPT_VIOLATION; 3268 vcpu->run->hw.hardware_exit_reason = EXIT_REASON_EPT_VIOLATION;
3224 return 0; 3269 return 0;
3225 } 3270 }
3226 3271
@@ -3290,7 +3335,7 @@ static void ept_misconfig_inspect_spte(struct kvm_vcpu *vcpu, u64 spte,
3290 } 3335 }
3291} 3336}
3292 3337
3293static int handle_ept_misconfig(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) 3338static int handle_ept_misconfig(struct kvm_vcpu *vcpu)
3294{ 3339{
3295 u64 sptes[4]; 3340 u64 sptes[4];
3296 int nr_sptes, i; 3341 int nr_sptes, i;
@@ -3306,13 +3351,13 @@ static int handle_ept_misconfig(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
3306 for (i = PT64_ROOT_LEVEL; i > PT64_ROOT_LEVEL - nr_sptes; --i) 3351 for (i = PT64_ROOT_LEVEL; i > PT64_ROOT_LEVEL - nr_sptes; --i)
3307 ept_misconfig_inspect_spte(vcpu, sptes[i-1], i); 3352 ept_misconfig_inspect_spte(vcpu, sptes[i-1], i);
3308 3353
3309 kvm_run->exit_reason = KVM_EXIT_UNKNOWN; 3354 vcpu->run->exit_reason = KVM_EXIT_UNKNOWN;
3310 kvm_run->hw.hardware_exit_reason = EXIT_REASON_EPT_MISCONFIG; 3355 vcpu->run->hw.hardware_exit_reason = EXIT_REASON_EPT_MISCONFIG;
3311 3356
3312 return 0; 3357 return 0;
3313} 3358}
3314 3359
3315static int handle_nmi_window(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) 3360static int handle_nmi_window(struct kvm_vcpu *vcpu)
3316{ 3361{
3317 u32 cpu_based_vm_exec_control; 3362 u32 cpu_based_vm_exec_control;
3318 3363
@@ -3325,36 +3370,50 @@ static int handle_nmi_window(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
3325 return 1; 3370 return 1;
3326} 3371}
3327 3372
3328static void handle_invalid_guest_state(struct kvm_vcpu *vcpu, 3373static int handle_invalid_guest_state(struct kvm_vcpu *vcpu)
3329 struct kvm_run *kvm_run)
3330{ 3374{
3331 struct vcpu_vmx *vmx = to_vmx(vcpu); 3375 struct vcpu_vmx *vmx = to_vmx(vcpu);
3332 enum emulation_result err = EMULATE_DONE; 3376 enum emulation_result err = EMULATE_DONE;
3333 3377 int ret = 1;
3334 local_irq_enable();
3335 preempt_enable();
3336 3378
3337 while (!guest_state_valid(vcpu)) { 3379 while (!guest_state_valid(vcpu)) {
3338 err = emulate_instruction(vcpu, kvm_run, 0, 0, 0); 3380 err = emulate_instruction(vcpu, 0, 0, 0);
3339 3381
3340 if (err == EMULATE_DO_MMIO) 3382 if (err == EMULATE_DO_MMIO) {
3341 break; 3383 ret = 0;
3384 goto out;
3385 }
3342 3386
3343 if (err != EMULATE_DONE) { 3387 if (err != EMULATE_DONE) {
3344 kvm_report_emulation_failure(vcpu, "emulation failure"); 3388 kvm_report_emulation_failure(vcpu, "emulation failure");
3345 break; 3389 vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR;
3390 vcpu->run->internal.suberror = KVM_INTERNAL_ERROR_EMULATION;
3391 vcpu->run->internal.ndata = 0;
3392 ret = 0;
3393 goto out;
3346 } 3394 }
3347 3395
3348 if (signal_pending(current)) 3396 if (signal_pending(current))
3349 break; 3397 goto out;
3350 if (need_resched()) 3398 if (need_resched())
3351 schedule(); 3399 schedule();
3352 } 3400 }
3353 3401
3354 preempt_disable(); 3402 vmx->emulation_required = 0;
3355 local_irq_disable(); 3403out:
3404 return ret;
3405}
3356 3406
3357 vmx->invalid_state_emulation_result = err; 3407/*
3408 * Indicate a busy-waiting vcpu in spinlock. We do not enable the PAUSE
3409 * exiting, so only get here on cpu with PAUSE-Loop-Exiting.
3410 */
3411static int handle_pause(struct kvm_vcpu *vcpu)
3412{
3413 skip_emulated_instruction(vcpu);
3414 kvm_vcpu_on_spin(vcpu);
3415
3416 return 1;
3358} 3417}
3359 3418
3360/* 3419/*
@@ -3362,8 +3421,7 @@ static void handle_invalid_guest_state(struct kvm_vcpu *vcpu,
3362 * may resume. Otherwise they set the kvm_run parameter to indicate what needs 3421 * may resume. Otherwise they set the kvm_run parameter to indicate what needs
3363 * to be done to userspace and return 0. 3422 * to be done to userspace and return 0.
3364 */ 3423 */
3365static int (*kvm_vmx_exit_handlers[])(struct kvm_vcpu *vcpu, 3424static int (*kvm_vmx_exit_handlers[])(struct kvm_vcpu *vcpu) = {
3366 struct kvm_run *kvm_run) = {
3367 [EXIT_REASON_EXCEPTION_NMI] = handle_exception, 3425 [EXIT_REASON_EXCEPTION_NMI] = handle_exception,
3368 [EXIT_REASON_EXTERNAL_INTERRUPT] = handle_external_interrupt, 3426 [EXIT_REASON_EXTERNAL_INTERRUPT] = handle_external_interrupt,
3369 [EXIT_REASON_TRIPLE_FAULT] = handle_triple_fault, 3427 [EXIT_REASON_TRIPLE_FAULT] = handle_triple_fault,
@@ -3394,6 +3452,7 @@ static int (*kvm_vmx_exit_handlers[])(struct kvm_vcpu *vcpu,
3394 [EXIT_REASON_MCE_DURING_VMENTRY] = handle_machine_check, 3452 [EXIT_REASON_MCE_DURING_VMENTRY] = handle_machine_check,
3395 [EXIT_REASON_EPT_VIOLATION] = handle_ept_violation, 3453 [EXIT_REASON_EPT_VIOLATION] = handle_ept_violation,
3396 [EXIT_REASON_EPT_MISCONFIG] = handle_ept_misconfig, 3454 [EXIT_REASON_EPT_MISCONFIG] = handle_ept_misconfig,
3455 [EXIT_REASON_PAUSE_INSTRUCTION] = handle_pause,
3397}; 3456};
3398 3457
3399static const int kvm_vmx_max_exit_handlers = 3458static const int kvm_vmx_max_exit_handlers =
@@ -3403,7 +3462,7 @@ static const int kvm_vmx_max_exit_handlers =
3403 * The guest has exited. See if we can fix it or if we need userspace 3462 * The guest has exited. See if we can fix it or if we need userspace
3404 * assistance. 3463 * assistance.
3405 */ 3464 */
3406static int vmx_handle_exit(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu) 3465static int vmx_handle_exit(struct kvm_vcpu *vcpu)
3407{ 3466{
3408 struct vcpu_vmx *vmx = to_vmx(vcpu); 3467 struct vcpu_vmx *vmx = to_vmx(vcpu);
3409 u32 exit_reason = vmx->exit_reason; 3468 u32 exit_reason = vmx->exit_reason;
@@ -3411,13 +3470,9 @@ static int vmx_handle_exit(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu)
3411 3470
3412 trace_kvm_exit(exit_reason, kvm_rip_read(vcpu)); 3471 trace_kvm_exit(exit_reason, kvm_rip_read(vcpu));
3413 3472
3414 /* If we need to emulate an MMIO from handle_invalid_guest_state 3473 /* If guest state is invalid, start emulating */
3415 * we just return 0 */ 3474 if (vmx->emulation_required && emulate_invalid_guest_state)
3416 if (vmx->emulation_required && emulate_invalid_guest_state) { 3475 return handle_invalid_guest_state(vcpu);
3417 if (guest_state_valid(vcpu))
3418 vmx->emulation_required = 0;
3419 return vmx->invalid_state_emulation_result != EMULATE_DO_MMIO;
3420 }
3421 3476
3422 /* Access CR3 don't cause VMExit in paging mode, so we need 3477 /* Access CR3 don't cause VMExit in paging mode, so we need
3423 * to sync with guest real CR3. */ 3478 * to sync with guest real CR3. */
@@ -3425,8 +3480,8 @@ static int vmx_handle_exit(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu)
3425 vcpu->arch.cr3 = vmcs_readl(GUEST_CR3); 3480 vcpu->arch.cr3 = vmcs_readl(GUEST_CR3);
3426 3481
3427 if (unlikely(vmx->fail)) { 3482 if (unlikely(vmx->fail)) {
3428 kvm_run->exit_reason = KVM_EXIT_FAIL_ENTRY; 3483 vcpu->run->exit_reason = KVM_EXIT_FAIL_ENTRY;
3429 kvm_run->fail_entry.hardware_entry_failure_reason 3484 vcpu->run->fail_entry.hardware_entry_failure_reason
3430 = vmcs_read32(VM_INSTRUCTION_ERROR); 3485 = vmcs_read32(VM_INSTRUCTION_ERROR);
3431 return 0; 3486 return 0;
3432 } 3487 }
@@ -3459,10 +3514,10 @@ static int vmx_handle_exit(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu)
3459 3514
3460 if (exit_reason < kvm_vmx_max_exit_handlers 3515 if (exit_reason < kvm_vmx_max_exit_handlers
3461 && kvm_vmx_exit_handlers[exit_reason]) 3516 && kvm_vmx_exit_handlers[exit_reason])
3462 return kvm_vmx_exit_handlers[exit_reason](vcpu, kvm_run); 3517 return kvm_vmx_exit_handlers[exit_reason](vcpu);
3463 else { 3518 else {
3464 kvm_run->exit_reason = KVM_EXIT_UNKNOWN; 3519 vcpu->run->exit_reason = KVM_EXIT_UNKNOWN;
3465 kvm_run->hw.hardware_exit_reason = exit_reason; 3520 vcpu->run->hw.hardware_exit_reason = exit_reason;
3466 } 3521 }
3467 return 0; 3522 return 0;
3468} 3523}
@@ -3600,23 +3655,18 @@ static void fixup_rmode_irq(struct vcpu_vmx *vmx)
3600#define Q "l" 3655#define Q "l"
3601#endif 3656#endif
3602 3657
3603static void vmx_vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) 3658static void vmx_vcpu_run(struct kvm_vcpu *vcpu)
3604{ 3659{
3605 struct vcpu_vmx *vmx = to_vmx(vcpu); 3660 struct vcpu_vmx *vmx = to_vmx(vcpu);
3606 3661
3607 if (enable_ept && is_paging(vcpu)) {
3608 vmcs_writel(GUEST_CR3, vcpu->arch.cr3);
3609 ept_load_pdptrs(vcpu);
3610 }
3611 /* Record the guest's net vcpu time for enforced NMI injections. */ 3662 /* Record the guest's net vcpu time for enforced NMI injections. */
3612 if (unlikely(!cpu_has_virtual_nmis() && vmx->soft_vnmi_blocked)) 3663 if (unlikely(!cpu_has_virtual_nmis() && vmx->soft_vnmi_blocked))
3613 vmx->entry_time = ktime_get(); 3664 vmx->entry_time = ktime_get();
3614 3665
3615 /* Handle invalid guest state instead of entering VMX */ 3666 /* Don't enter VMX if guest state is invalid, let the exit handler
3616 if (vmx->emulation_required && emulate_invalid_guest_state) { 3667 start emulation until we arrive back to a valid state */
3617 handle_invalid_guest_state(vcpu, kvm_run); 3668 if (vmx->emulation_required && emulate_invalid_guest_state)
3618 return; 3669 return;
3619 }
3620 3670
3621 if (test_bit(VCPU_REGS_RSP, (unsigned long *)&vcpu->arch.regs_dirty)) 3671 if (test_bit(VCPU_REGS_RSP, (unsigned long *)&vcpu->arch.regs_dirty))
3622 vmcs_writel(GUEST_RSP, vcpu->arch.regs[VCPU_REGS_RSP]); 3672 vmcs_writel(GUEST_RSP, vcpu->arch.regs[VCPU_REGS_RSP]);
@@ -3775,7 +3825,6 @@ static void vmx_free_vcpu(struct kvm_vcpu *vcpu)
3775 __clear_bit(vmx->vpid, vmx_vpid_bitmap); 3825 __clear_bit(vmx->vpid, vmx_vpid_bitmap);
3776 spin_unlock(&vmx_vpid_lock); 3826 spin_unlock(&vmx_vpid_lock);
3777 vmx_free_vmcs(vcpu); 3827 vmx_free_vmcs(vcpu);
3778 kfree(vmx->host_msrs);
3779 kfree(vmx->guest_msrs); 3828 kfree(vmx->guest_msrs);
3780 kvm_vcpu_uninit(vcpu); 3829 kvm_vcpu_uninit(vcpu);
3781 kmem_cache_free(kvm_vcpu_cache, vmx); 3830 kmem_cache_free(kvm_vcpu_cache, vmx);
@@ -3802,10 +3851,6 @@ static struct kvm_vcpu *vmx_create_vcpu(struct kvm *kvm, unsigned int id)
3802 goto uninit_vcpu; 3851 goto uninit_vcpu;
3803 } 3852 }
3804 3853
3805 vmx->host_msrs = kmalloc(PAGE_SIZE, GFP_KERNEL);
3806 if (!vmx->host_msrs)
3807 goto free_guest_msrs;
3808
3809 vmx->vmcs = alloc_vmcs(); 3854 vmx->vmcs = alloc_vmcs();
3810 if (!vmx->vmcs) 3855 if (!vmx->vmcs)
3811 goto free_msrs; 3856 goto free_msrs;
@@ -3836,8 +3881,6 @@ static struct kvm_vcpu *vmx_create_vcpu(struct kvm *kvm, unsigned int id)
3836free_vmcs: 3881free_vmcs:
3837 free_vmcs(vmx->vmcs); 3882 free_vmcs(vmx->vmcs);
3838free_msrs: 3883free_msrs:
3839 kfree(vmx->host_msrs);
3840free_guest_msrs:
3841 kfree(vmx->guest_msrs); 3884 kfree(vmx->guest_msrs);
3842uninit_vcpu: 3885uninit_vcpu:
3843 kvm_vcpu_uninit(&vmx->vcpu); 3886 kvm_vcpu_uninit(&vmx->vcpu);
@@ -3973,6 +4016,8 @@ static struct kvm_x86_ops vmx_x86_ops = {
3973 .queue_exception = vmx_queue_exception, 4016 .queue_exception = vmx_queue_exception,
3974 .interrupt_allowed = vmx_interrupt_allowed, 4017 .interrupt_allowed = vmx_interrupt_allowed,
3975 .nmi_allowed = vmx_nmi_allowed, 4018 .nmi_allowed = vmx_nmi_allowed,
4019 .get_nmi_mask = vmx_get_nmi_mask,
4020 .set_nmi_mask = vmx_set_nmi_mask,
3976 .enable_nmi_window = enable_nmi_window, 4021 .enable_nmi_window = enable_nmi_window,
3977 .enable_irq_window = enable_irq_window, 4022 .enable_irq_window = enable_irq_window,
3978 .update_cr8_intercept = update_cr8_intercept, 4023 .update_cr8_intercept = update_cr8_intercept,
@@ -3987,7 +4032,12 @@ static struct kvm_x86_ops vmx_x86_ops = {
3987 4032
3988static int __init vmx_init(void) 4033static int __init vmx_init(void)
3989{ 4034{
3990 int r; 4035 int r, i;
4036
4037 rdmsrl_safe(MSR_EFER, &host_efer);
4038
4039 for (i = 0; i < NR_VMX_MSR; ++i)
4040 kvm_define_shared_msr(i, vmx_msr_index[i]);
3991 4041
3992 vmx_io_bitmap_a = (unsigned long *)__get_free_page(GFP_KERNEL); 4042 vmx_io_bitmap_a = (unsigned long *)__get_free_page(GFP_KERNEL);
3993 if (!vmx_io_bitmap_a) 4043 if (!vmx_io_bitmap_a)
@@ -4049,8 +4099,6 @@ static int __init vmx_init(void)
4049 if (bypass_guest_pf) 4099 if (bypass_guest_pf)
4050 kvm_mmu_set_nonpresent_ptes(~0xffeull, 0ull); 4100 kvm_mmu_set_nonpresent_ptes(~0xffeull, 0ull);
4051 4101
4052 ept_sync_global();
4053
4054 return 0; 4102 return 0;
4055 4103
4056out3: 4104out3:
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index ae07d261527c..9d068966fb2a 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -37,11 +37,13 @@
37#include <linux/iommu.h> 37#include <linux/iommu.h>
38#include <linux/intel-iommu.h> 38#include <linux/intel-iommu.h>
39#include <linux/cpufreq.h> 39#include <linux/cpufreq.h>
40#include <linux/user-return-notifier.h>
40#include <trace/events/kvm.h> 41#include <trace/events/kvm.h>
41#undef TRACE_INCLUDE_FILE 42#undef TRACE_INCLUDE_FILE
42#define CREATE_TRACE_POINTS 43#define CREATE_TRACE_POINTS
43#include "trace.h" 44#include "trace.h"
44 45
46#include <asm/debugreg.h>
45#include <asm/uaccess.h> 47#include <asm/uaccess.h>
46#include <asm/msr.h> 48#include <asm/msr.h>
47#include <asm/desc.h> 49#include <asm/desc.h>
@@ -87,6 +89,25 @@ EXPORT_SYMBOL_GPL(kvm_x86_ops);
87int ignore_msrs = 0; 89int ignore_msrs = 0;
88module_param_named(ignore_msrs, ignore_msrs, bool, S_IRUGO | S_IWUSR); 90module_param_named(ignore_msrs, ignore_msrs, bool, S_IRUGO | S_IWUSR);
89 91
92#define KVM_NR_SHARED_MSRS 16
93
94struct kvm_shared_msrs_global {
95 int nr;
96 struct kvm_shared_msr {
97 u32 msr;
98 u64 value;
99 } msrs[KVM_NR_SHARED_MSRS];
100};
101
102struct kvm_shared_msrs {
103 struct user_return_notifier urn;
104 bool registered;
105 u64 current_value[KVM_NR_SHARED_MSRS];
106};
107
108static struct kvm_shared_msrs_global __read_mostly shared_msrs_global;
109static DEFINE_PER_CPU(struct kvm_shared_msrs, shared_msrs);
110
90struct kvm_stats_debugfs_item debugfs_entries[] = { 111struct kvm_stats_debugfs_item debugfs_entries[] = {
91 { "pf_fixed", VCPU_STAT(pf_fixed) }, 112 { "pf_fixed", VCPU_STAT(pf_fixed) },
92 { "pf_guest", VCPU_STAT(pf_guest) }, 113 { "pf_guest", VCPU_STAT(pf_guest) },
@@ -123,6 +144,72 @@ struct kvm_stats_debugfs_item debugfs_entries[] = {
123 { NULL } 144 { NULL }
124}; 145};
125 146
147static void kvm_on_user_return(struct user_return_notifier *urn)
148{
149 unsigned slot;
150 struct kvm_shared_msr *global;
151 struct kvm_shared_msrs *locals
152 = container_of(urn, struct kvm_shared_msrs, urn);
153
154 for (slot = 0; slot < shared_msrs_global.nr; ++slot) {
155 global = &shared_msrs_global.msrs[slot];
156 if (global->value != locals->current_value[slot]) {
157 wrmsrl(global->msr, global->value);
158 locals->current_value[slot] = global->value;
159 }
160 }
161 locals->registered = false;
162 user_return_notifier_unregister(urn);
163}
164
165void kvm_define_shared_msr(unsigned slot, u32 msr)
166{
167 int cpu;
168 u64 value;
169
170 if (slot >= shared_msrs_global.nr)
171 shared_msrs_global.nr = slot + 1;
172 shared_msrs_global.msrs[slot].msr = msr;
173 rdmsrl_safe(msr, &value);
174 shared_msrs_global.msrs[slot].value = value;
175 for_each_online_cpu(cpu)
176 per_cpu(shared_msrs, cpu).current_value[slot] = value;
177}
178EXPORT_SYMBOL_GPL(kvm_define_shared_msr);
179
180static void kvm_shared_msr_cpu_online(void)
181{
182 unsigned i;
183 struct kvm_shared_msrs *locals = &__get_cpu_var(shared_msrs);
184
185 for (i = 0; i < shared_msrs_global.nr; ++i)
186 locals->current_value[i] = shared_msrs_global.msrs[i].value;
187}
188
189void kvm_set_shared_msr(unsigned slot, u64 value, u64 mask)
190{
191 struct kvm_shared_msrs *smsr = &__get_cpu_var(shared_msrs);
192
193 if (((value ^ smsr->current_value[slot]) & mask) == 0)
194 return;
195 smsr->current_value[slot] = value;
196 wrmsrl(shared_msrs_global.msrs[slot].msr, value);
197 if (!smsr->registered) {
198 smsr->urn.on_user_return = kvm_on_user_return;
199 user_return_notifier_register(&smsr->urn);
200 smsr->registered = true;
201 }
202}
203EXPORT_SYMBOL_GPL(kvm_set_shared_msr);
204
205static void drop_user_return_notifiers(void *ignore)
206{
207 struct kvm_shared_msrs *smsr = &__get_cpu_var(shared_msrs);
208
209 if (smsr->registered)
210 kvm_on_user_return(&smsr->urn);
211}
212
126unsigned long segment_base(u16 selector) 213unsigned long segment_base(u16 selector)
127{ 214{
128 struct descriptor_table gdt; 215 struct descriptor_table gdt;
@@ -484,16 +571,19 @@ static inline u32 bit(int bitno)
484 * and KVM_SET_MSRS, and KVM_GET_MSR_INDEX_LIST. 571 * and KVM_SET_MSRS, and KVM_GET_MSR_INDEX_LIST.
485 * 572 *
486 * This list is modified at module load time to reflect the 573 * This list is modified at module load time to reflect the
487 * capabilities of the host cpu. 574 * capabilities of the host cpu. This capabilities test skips MSRs that are
575 * kvm-specific. Those are put in the beginning of the list.
488 */ 576 */
577
578#define KVM_SAVE_MSRS_BEGIN 2
489static u32 msrs_to_save[] = { 579static u32 msrs_to_save[] = {
580 MSR_KVM_SYSTEM_TIME, MSR_KVM_WALL_CLOCK,
490 MSR_IA32_SYSENTER_CS, MSR_IA32_SYSENTER_ESP, MSR_IA32_SYSENTER_EIP, 581 MSR_IA32_SYSENTER_CS, MSR_IA32_SYSENTER_ESP, MSR_IA32_SYSENTER_EIP,
491 MSR_K6_STAR, 582 MSR_K6_STAR,
492#ifdef CONFIG_X86_64 583#ifdef CONFIG_X86_64
493 MSR_CSTAR, MSR_KERNEL_GS_BASE, MSR_SYSCALL_MASK, MSR_LSTAR, 584 MSR_CSTAR, MSR_KERNEL_GS_BASE, MSR_SYSCALL_MASK, MSR_LSTAR,
494#endif 585#endif
495 MSR_IA32_TSC, MSR_KVM_SYSTEM_TIME, MSR_KVM_WALL_CLOCK, 586 MSR_IA32_TSC, MSR_IA32_PERF_STATUS, MSR_IA32_CR_PAT, MSR_VM_HSAVE_PA
496 MSR_IA32_PERF_STATUS, MSR_IA32_CR_PAT, MSR_VM_HSAVE_PA
497}; 587};
498 588
499static unsigned num_msrs_to_save; 589static unsigned num_msrs_to_save;
@@ -677,7 +767,8 @@ static void kvm_write_guest_time(struct kvm_vcpu *v)
677 /* With all the info we got, fill in the values */ 767 /* With all the info we got, fill in the values */
678 768
679 vcpu->hv_clock.system_time = ts.tv_nsec + 769 vcpu->hv_clock.system_time = ts.tv_nsec +
680 (NSEC_PER_SEC * (u64)ts.tv_sec); 770 (NSEC_PER_SEC * (u64)ts.tv_sec) + v->kvm->arch.kvmclock_offset;
771
681 /* 772 /*
682 * The interface expects us to write an even number signaling that the 773 * The interface expects us to write an even number signaling that the
683 * update is finished. Since the guest won't see the intermediate 774 * update is finished. Since the guest won't see the intermediate
@@ -835,6 +926,38 @@ static int set_msr_mce(struct kvm_vcpu *vcpu, u32 msr, u64 data)
835 return 0; 926 return 0;
836} 927}
837 928
929static int xen_hvm_config(struct kvm_vcpu *vcpu, u64 data)
930{
931 struct kvm *kvm = vcpu->kvm;
932 int lm = is_long_mode(vcpu);
933 u8 *blob_addr = lm ? (u8 *)(long)kvm->arch.xen_hvm_config.blob_addr_64
934 : (u8 *)(long)kvm->arch.xen_hvm_config.blob_addr_32;
935 u8 blob_size = lm ? kvm->arch.xen_hvm_config.blob_size_64
936 : kvm->arch.xen_hvm_config.blob_size_32;
937 u32 page_num = data & ~PAGE_MASK;
938 u64 page_addr = data & PAGE_MASK;
939 u8 *page;
940 int r;
941
942 r = -E2BIG;
943 if (page_num >= blob_size)
944 goto out;
945 r = -ENOMEM;
946 page = kzalloc(PAGE_SIZE, GFP_KERNEL);
947 if (!page)
948 goto out;
949 r = -EFAULT;
950 if (copy_from_user(page, blob_addr + (page_num * PAGE_SIZE), PAGE_SIZE))
951 goto out_free;
952 if (kvm_write_guest(kvm, page_addr, page, PAGE_SIZE))
953 goto out_free;
954 r = 0;
955out_free:
956 kfree(page);
957out:
958 return r;
959}
960
838int kvm_set_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 data) 961int kvm_set_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 data)
839{ 962{
840 switch (msr) { 963 switch (msr) {
@@ -950,6 +1073,8 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 data)
950 "0x%x data 0x%llx\n", msr, data); 1073 "0x%x data 0x%llx\n", msr, data);
951 break; 1074 break;
952 default: 1075 default:
1076 if (msr && (msr == vcpu->kvm->arch.xen_hvm_config.msr))
1077 return xen_hvm_config(vcpu, data);
953 if (!ignore_msrs) { 1078 if (!ignore_msrs) {
954 pr_unimpl(vcpu, "unhandled wrmsr: 0x%x data %llx\n", 1079 pr_unimpl(vcpu, "unhandled wrmsr: 0x%x data %llx\n",
955 msr, data); 1080 msr, data);
@@ -1224,6 +1349,9 @@ int kvm_dev_ioctl_check_extension(long ext)
1224 case KVM_CAP_PIT2: 1349 case KVM_CAP_PIT2:
1225 case KVM_CAP_PIT_STATE2: 1350 case KVM_CAP_PIT_STATE2:
1226 case KVM_CAP_SET_IDENTITY_MAP_ADDR: 1351 case KVM_CAP_SET_IDENTITY_MAP_ADDR:
1352 case KVM_CAP_XEN_HVM:
1353 case KVM_CAP_ADJUST_CLOCK:
1354 case KVM_CAP_VCPU_EVENTS:
1227 r = 1; 1355 r = 1;
1228 break; 1356 break;
1229 case KVM_CAP_COALESCED_MMIO: 1357 case KVM_CAP_COALESCED_MMIO:
@@ -1238,8 +1366,8 @@ int kvm_dev_ioctl_check_extension(long ext)
1238 case KVM_CAP_NR_MEMSLOTS: 1366 case KVM_CAP_NR_MEMSLOTS:
1239 r = KVM_MEMORY_SLOTS; 1367 r = KVM_MEMORY_SLOTS;
1240 break; 1368 break;
1241 case KVM_CAP_PV_MMU: 1369 case KVM_CAP_PV_MMU: /* obsolete */
1242 r = !tdp_enabled; 1370 r = 0;
1243 break; 1371 break;
1244 case KVM_CAP_IOMMU: 1372 case KVM_CAP_IOMMU:
1245 r = iommu_found(); 1373 r = iommu_found();
@@ -1326,6 +1454,12 @@ out:
1326void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu) 1454void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
1327{ 1455{
1328 kvm_x86_ops->vcpu_load(vcpu, cpu); 1456 kvm_x86_ops->vcpu_load(vcpu, cpu);
1457 if (unlikely(per_cpu(cpu_tsc_khz, cpu) == 0)) {
1458 unsigned long khz = cpufreq_quick_get(cpu);
1459 if (!khz)
1460 khz = tsc_khz;
1461 per_cpu(cpu_tsc_khz, cpu) = khz;
1462 }
1329 kvm_request_guest_time_update(vcpu); 1463 kvm_request_guest_time_update(vcpu);
1330} 1464}
1331 1465
@@ -1759,6 +1893,61 @@ static int kvm_vcpu_ioctl_x86_set_mce(struct kvm_vcpu *vcpu,
1759 return 0; 1893 return 0;
1760} 1894}
1761 1895
1896static void kvm_vcpu_ioctl_x86_get_vcpu_events(struct kvm_vcpu *vcpu,
1897 struct kvm_vcpu_events *events)
1898{
1899 vcpu_load(vcpu);
1900
1901 events->exception.injected = vcpu->arch.exception.pending;
1902 events->exception.nr = vcpu->arch.exception.nr;
1903 events->exception.has_error_code = vcpu->arch.exception.has_error_code;
1904 events->exception.error_code = vcpu->arch.exception.error_code;
1905
1906 events->interrupt.injected = vcpu->arch.interrupt.pending;
1907 events->interrupt.nr = vcpu->arch.interrupt.nr;
1908 events->interrupt.soft = vcpu->arch.interrupt.soft;
1909
1910 events->nmi.injected = vcpu->arch.nmi_injected;
1911 events->nmi.pending = vcpu->arch.nmi_pending;
1912 events->nmi.masked = kvm_x86_ops->get_nmi_mask(vcpu);
1913
1914 events->sipi_vector = vcpu->arch.sipi_vector;
1915
1916 events->flags = 0;
1917
1918 vcpu_put(vcpu);
1919}
1920
1921static int kvm_vcpu_ioctl_x86_set_vcpu_events(struct kvm_vcpu *vcpu,
1922 struct kvm_vcpu_events *events)
1923{
1924 if (events->flags)
1925 return -EINVAL;
1926
1927 vcpu_load(vcpu);
1928
1929 vcpu->arch.exception.pending = events->exception.injected;
1930 vcpu->arch.exception.nr = events->exception.nr;
1931 vcpu->arch.exception.has_error_code = events->exception.has_error_code;
1932 vcpu->arch.exception.error_code = events->exception.error_code;
1933
1934 vcpu->arch.interrupt.pending = events->interrupt.injected;
1935 vcpu->arch.interrupt.nr = events->interrupt.nr;
1936 vcpu->arch.interrupt.soft = events->interrupt.soft;
1937 if (vcpu->arch.interrupt.pending && irqchip_in_kernel(vcpu->kvm))
1938 kvm_pic_clear_isr_ack(vcpu->kvm);
1939
1940 vcpu->arch.nmi_injected = events->nmi.injected;
1941 vcpu->arch.nmi_pending = events->nmi.pending;
1942 kvm_x86_ops->set_nmi_mask(vcpu, events->nmi.masked);
1943
1944 vcpu->arch.sipi_vector = events->sipi_vector;
1945
1946 vcpu_put(vcpu);
1947
1948 return 0;
1949}
1950
1762long kvm_arch_vcpu_ioctl(struct file *filp, 1951long kvm_arch_vcpu_ioctl(struct file *filp,
1763 unsigned int ioctl, unsigned long arg) 1952 unsigned int ioctl, unsigned long arg)
1764{ 1953{
@@ -1769,6 +1958,9 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
1769 1958
1770 switch (ioctl) { 1959 switch (ioctl) {
1771 case KVM_GET_LAPIC: { 1960 case KVM_GET_LAPIC: {
1961 r = -EINVAL;
1962 if (!vcpu->arch.apic)
1963 goto out;
1772 lapic = kzalloc(sizeof(struct kvm_lapic_state), GFP_KERNEL); 1964 lapic = kzalloc(sizeof(struct kvm_lapic_state), GFP_KERNEL);
1773 1965
1774 r = -ENOMEM; 1966 r = -ENOMEM;
@@ -1784,6 +1976,9 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
1784 break; 1976 break;
1785 } 1977 }
1786 case KVM_SET_LAPIC: { 1978 case KVM_SET_LAPIC: {
1979 r = -EINVAL;
1980 if (!vcpu->arch.apic)
1981 goto out;
1787 lapic = kmalloc(sizeof(struct kvm_lapic_state), GFP_KERNEL); 1982 lapic = kmalloc(sizeof(struct kvm_lapic_state), GFP_KERNEL);
1788 r = -ENOMEM; 1983 r = -ENOMEM;
1789 if (!lapic) 1984 if (!lapic)
@@ -1910,6 +2105,27 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
1910 r = kvm_vcpu_ioctl_x86_set_mce(vcpu, &mce); 2105 r = kvm_vcpu_ioctl_x86_set_mce(vcpu, &mce);
1911 break; 2106 break;
1912 } 2107 }
2108 case KVM_GET_VCPU_EVENTS: {
2109 struct kvm_vcpu_events events;
2110
2111 kvm_vcpu_ioctl_x86_get_vcpu_events(vcpu, &events);
2112
2113 r = -EFAULT;
2114 if (copy_to_user(argp, &events, sizeof(struct kvm_vcpu_events)))
2115 break;
2116 r = 0;
2117 break;
2118 }
2119 case KVM_SET_VCPU_EVENTS: {
2120 struct kvm_vcpu_events events;
2121
2122 r = -EFAULT;
2123 if (copy_from_user(&events, argp, sizeof(struct kvm_vcpu_events)))
2124 break;
2125
2126 r = kvm_vcpu_ioctl_x86_set_vcpu_events(vcpu, &events);
2127 break;
2128 }
1913 default: 2129 default:
1914 r = -EINVAL; 2130 r = -EINVAL;
1915 } 2131 }
@@ -2038,9 +2254,7 @@ static int kvm_vm_ioctl_get_irqchip(struct kvm *kvm, struct kvm_irqchip *chip)
2038 sizeof(struct kvm_pic_state)); 2254 sizeof(struct kvm_pic_state));
2039 break; 2255 break;
2040 case KVM_IRQCHIP_IOAPIC: 2256 case KVM_IRQCHIP_IOAPIC:
2041 memcpy(&chip->chip.ioapic, 2257 r = kvm_get_ioapic(kvm, &chip->chip.ioapic);
2042 ioapic_irqchip(kvm),
2043 sizeof(struct kvm_ioapic_state));
2044 break; 2258 break;
2045 default: 2259 default:
2046 r = -EINVAL; 2260 r = -EINVAL;
@@ -2070,11 +2284,7 @@ static int kvm_vm_ioctl_set_irqchip(struct kvm *kvm, struct kvm_irqchip *chip)
2070 spin_unlock(&pic_irqchip(kvm)->lock); 2284 spin_unlock(&pic_irqchip(kvm)->lock);
2071 break; 2285 break;
2072 case KVM_IRQCHIP_IOAPIC: 2286 case KVM_IRQCHIP_IOAPIC:
2073 mutex_lock(&kvm->irq_lock); 2287 r = kvm_set_ioapic(kvm, &chip->chip.ioapic);
2074 memcpy(ioapic_irqchip(kvm),
2075 &chip->chip.ioapic,
2076 sizeof(struct kvm_ioapic_state));
2077 mutex_unlock(&kvm->irq_lock);
2078 break; 2288 break;
2079 default: 2289 default:
2080 r = -EINVAL; 2290 r = -EINVAL;
@@ -2182,7 +2392,7 @@ long kvm_arch_vm_ioctl(struct file *filp,
2182{ 2392{
2183 struct kvm *kvm = filp->private_data; 2393 struct kvm *kvm = filp->private_data;
2184 void __user *argp = (void __user *)arg; 2394 void __user *argp = (void __user *)arg;
2185 int r = -EINVAL; 2395 int r = -ENOTTY;
2186 /* 2396 /*
2187 * This union makes it completely explicit to gcc-3.x 2397 * This union makes it completely explicit to gcc-3.x
2188 * that these two variables' stack usage should be 2398 * that these two variables' stack usage should be
@@ -2244,25 +2454,39 @@ long kvm_arch_vm_ioctl(struct file *filp,
2244 if (r) 2454 if (r)
2245 goto out; 2455 goto out;
2246 break; 2456 break;
2247 case KVM_CREATE_IRQCHIP: 2457 case KVM_CREATE_IRQCHIP: {
2458 struct kvm_pic *vpic;
2459
2460 mutex_lock(&kvm->lock);
2461 r = -EEXIST;
2462 if (kvm->arch.vpic)
2463 goto create_irqchip_unlock;
2248 r = -ENOMEM; 2464 r = -ENOMEM;
2249 kvm->arch.vpic = kvm_create_pic(kvm); 2465 vpic = kvm_create_pic(kvm);
2250 if (kvm->arch.vpic) { 2466 if (vpic) {
2251 r = kvm_ioapic_init(kvm); 2467 r = kvm_ioapic_init(kvm);
2252 if (r) { 2468 if (r) {
2253 kfree(kvm->arch.vpic); 2469 kfree(vpic);
2254 kvm->arch.vpic = NULL; 2470 goto create_irqchip_unlock;
2255 goto out;
2256 } 2471 }
2257 } else 2472 } else
2258 goto out; 2473 goto create_irqchip_unlock;
2474 smp_wmb();
2475 kvm->arch.vpic = vpic;
2476 smp_wmb();
2259 r = kvm_setup_default_irq_routing(kvm); 2477 r = kvm_setup_default_irq_routing(kvm);
2260 if (r) { 2478 if (r) {
2479 mutex_lock(&kvm->irq_lock);
2261 kfree(kvm->arch.vpic); 2480 kfree(kvm->arch.vpic);
2262 kfree(kvm->arch.vioapic); 2481 kfree(kvm->arch.vioapic);
2263 goto out; 2482 kvm->arch.vpic = NULL;
2483 kvm->arch.vioapic = NULL;
2484 mutex_unlock(&kvm->irq_lock);
2264 } 2485 }
2486 create_irqchip_unlock:
2487 mutex_unlock(&kvm->lock);
2265 break; 2488 break;
2489 }
2266 case KVM_CREATE_PIT: 2490 case KVM_CREATE_PIT:
2267 u.pit_config.flags = KVM_PIT_SPEAKER_DUMMY; 2491 u.pit_config.flags = KVM_PIT_SPEAKER_DUMMY;
2268 goto create_pit; 2492 goto create_pit;
@@ -2292,10 +2516,8 @@ long kvm_arch_vm_ioctl(struct file *filp,
2292 goto out; 2516 goto out;
2293 if (irqchip_in_kernel(kvm)) { 2517 if (irqchip_in_kernel(kvm)) {
2294 __s32 status; 2518 __s32 status;
2295 mutex_lock(&kvm->irq_lock);
2296 status = kvm_set_irq(kvm, KVM_USERSPACE_IRQ_SOURCE_ID, 2519 status = kvm_set_irq(kvm, KVM_USERSPACE_IRQ_SOURCE_ID,
2297 irq_event.irq, irq_event.level); 2520 irq_event.irq, irq_event.level);
2298 mutex_unlock(&kvm->irq_lock);
2299 if (ioctl == KVM_IRQ_LINE_STATUS) { 2521 if (ioctl == KVM_IRQ_LINE_STATUS) {
2300 irq_event.status = status; 2522 irq_event.status = status;
2301 if (copy_to_user(argp, &irq_event, 2523 if (copy_to_user(argp, &irq_event,
@@ -2421,6 +2643,55 @@ long kvm_arch_vm_ioctl(struct file *filp,
2421 r = 0; 2643 r = 0;
2422 break; 2644 break;
2423 } 2645 }
2646 case KVM_XEN_HVM_CONFIG: {
2647 r = -EFAULT;
2648 if (copy_from_user(&kvm->arch.xen_hvm_config, argp,
2649 sizeof(struct kvm_xen_hvm_config)))
2650 goto out;
2651 r = -EINVAL;
2652 if (kvm->arch.xen_hvm_config.flags)
2653 goto out;
2654 r = 0;
2655 break;
2656 }
2657 case KVM_SET_CLOCK: {
2658 struct timespec now;
2659 struct kvm_clock_data user_ns;
2660 u64 now_ns;
2661 s64 delta;
2662
2663 r = -EFAULT;
2664 if (copy_from_user(&user_ns, argp, sizeof(user_ns)))
2665 goto out;
2666
2667 r = -EINVAL;
2668 if (user_ns.flags)
2669 goto out;
2670
2671 r = 0;
2672 ktime_get_ts(&now);
2673 now_ns = timespec_to_ns(&now);
2674 delta = user_ns.clock - now_ns;
2675 kvm->arch.kvmclock_offset = delta;
2676 break;
2677 }
2678 case KVM_GET_CLOCK: {
2679 struct timespec now;
2680 struct kvm_clock_data user_ns;
2681 u64 now_ns;
2682
2683 ktime_get_ts(&now);
2684 now_ns = timespec_to_ns(&now);
2685 user_ns.clock = kvm->arch.kvmclock_offset + now_ns;
2686 user_ns.flags = 0;
2687
2688 r = -EFAULT;
2689 if (copy_to_user(argp, &user_ns, sizeof(user_ns)))
2690 goto out;
2691 r = 0;
2692 break;
2693 }
2694
2424 default: 2695 default:
2425 ; 2696 ;
2426 } 2697 }
@@ -2433,7 +2704,8 @@ static void kvm_init_msr_list(void)
2433 u32 dummy[2]; 2704 u32 dummy[2];
2434 unsigned i, j; 2705 unsigned i, j;
2435 2706
2436 for (i = j = 0; i < ARRAY_SIZE(msrs_to_save); i++) { 2707 /* skip the first msrs in the list. KVM-specific */
2708 for (i = j = KVM_SAVE_MSRS_BEGIN; i < ARRAY_SIZE(msrs_to_save); i++) {
2437 if (rdmsr_safe(msrs_to_save[i], &dummy[0], &dummy[1]) < 0) 2709 if (rdmsr_safe(msrs_to_save[i], &dummy[0], &dummy[1]) < 0)
2438 continue; 2710 continue;
2439 if (j < i) 2711 if (j < i)
@@ -2757,13 +3029,13 @@ static void cache_all_regs(struct kvm_vcpu *vcpu)
2757} 3029}
2758 3030
2759int emulate_instruction(struct kvm_vcpu *vcpu, 3031int emulate_instruction(struct kvm_vcpu *vcpu,
2760 struct kvm_run *run,
2761 unsigned long cr2, 3032 unsigned long cr2,
2762 u16 error_code, 3033 u16 error_code,
2763 int emulation_type) 3034 int emulation_type)
2764{ 3035{
2765 int r, shadow_mask; 3036 int r, shadow_mask;
2766 struct decode_cache *c; 3037 struct decode_cache *c;
3038 struct kvm_run *run = vcpu->run;
2767 3039
2768 kvm_clear_exception_queue(vcpu); 3040 kvm_clear_exception_queue(vcpu);
2769 vcpu->arch.mmio_fault_cr2 = cr2; 3041 vcpu->arch.mmio_fault_cr2 = cr2;
@@ -2783,7 +3055,7 @@ int emulate_instruction(struct kvm_vcpu *vcpu,
2783 kvm_x86_ops->get_cs_db_l_bits(vcpu, &cs_db, &cs_l); 3055 kvm_x86_ops->get_cs_db_l_bits(vcpu, &cs_db, &cs_l);
2784 3056
2785 vcpu->arch.emulate_ctxt.vcpu = vcpu; 3057 vcpu->arch.emulate_ctxt.vcpu = vcpu;
2786 vcpu->arch.emulate_ctxt.eflags = kvm_x86_ops->get_rflags(vcpu); 3058 vcpu->arch.emulate_ctxt.eflags = kvm_get_rflags(vcpu);
2787 vcpu->arch.emulate_ctxt.mode = 3059 vcpu->arch.emulate_ctxt.mode =
2788 (vcpu->arch.emulate_ctxt.eflags & X86_EFLAGS_VM) 3060 (vcpu->arch.emulate_ctxt.eflags & X86_EFLAGS_VM)
2789 ? X86EMUL_MODE_REAL : cs_l 3061 ? X86EMUL_MODE_REAL : cs_l
@@ -2861,7 +3133,7 @@ int emulate_instruction(struct kvm_vcpu *vcpu,
2861 return EMULATE_DO_MMIO; 3133 return EMULATE_DO_MMIO;
2862 } 3134 }
2863 3135
2864 kvm_x86_ops->set_rflags(vcpu, vcpu->arch.emulate_ctxt.eflags); 3136 kvm_set_rflags(vcpu, vcpu->arch.emulate_ctxt.eflags);
2865 3137
2866 if (vcpu->mmio_is_write) { 3138 if (vcpu->mmio_is_write) {
2867 vcpu->mmio_needed = 0; 3139 vcpu->mmio_needed = 0;
@@ -2969,8 +3241,7 @@ static int pio_string_write(struct kvm_vcpu *vcpu)
2969 return r; 3241 return r;
2970} 3242}
2971 3243
2972int kvm_emulate_pio(struct kvm_vcpu *vcpu, struct kvm_run *run, int in, 3244int kvm_emulate_pio(struct kvm_vcpu *vcpu, int in, int size, unsigned port)
2973 int size, unsigned port)
2974{ 3245{
2975 unsigned long val; 3246 unsigned long val;
2976 3247
@@ -2999,7 +3270,7 @@ int kvm_emulate_pio(struct kvm_vcpu *vcpu, struct kvm_run *run, int in,
2999} 3270}
3000EXPORT_SYMBOL_GPL(kvm_emulate_pio); 3271EXPORT_SYMBOL_GPL(kvm_emulate_pio);
3001 3272
3002int kvm_emulate_pio_string(struct kvm_vcpu *vcpu, struct kvm_run *run, int in, 3273int kvm_emulate_pio_string(struct kvm_vcpu *vcpu, int in,
3003 int size, unsigned long count, int down, 3274 int size, unsigned long count, int down,
3004 gva_t address, int rep, unsigned port) 3275 gva_t address, int rep, unsigned port)
3005{ 3276{
@@ -3072,9 +3343,6 @@ static void bounce_off(void *info)
3072 /* nothing */ 3343 /* nothing */
3073} 3344}
3074 3345
3075static unsigned int ref_freq;
3076static unsigned long tsc_khz_ref;
3077
3078static int kvmclock_cpufreq_notifier(struct notifier_block *nb, unsigned long val, 3346static int kvmclock_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
3079 void *data) 3347 void *data)
3080{ 3348{
@@ -3083,14 +3351,11 @@ static int kvmclock_cpufreq_notifier(struct notifier_block *nb, unsigned long va
3083 struct kvm_vcpu *vcpu; 3351 struct kvm_vcpu *vcpu;
3084 int i, send_ipi = 0; 3352 int i, send_ipi = 0;
3085 3353
3086 if (!ref_freq)
3087 ref_freq = freq->old;
3088
3089 if (val == CPUFREQ_PRECHANGE && freq->old > freq->new) 3354 if (val == CPUFREQ_PRECHANGE && freq->old > freq->new)
3090 return 0; 3355 return 0;
3091 if (val == CPUFREQ_POSTCHANGE && freq->old < freq->new) 3356 if (val == CPUFREQ_POSTCHANGE && freq->old < freq->new)
3092 return 0; 3357 return 0;
3093 per_cpu(cpu_tsc_khz, freq->cpu) = cpufreq_scale(tsc_khz_ref, ref_freq, freq->new); 3358 per_cpu(cpu_tsc_khz, freq->cpu) = freq->new;
3094 3359
3095 spin_lock(&kvm_lock); 3360 spin_lock(&kvm_lock);
3096 list_for_each_entry(kvm, &vm_list, vm_list) { 3361 list_for_each_entry(kvm, &vm_list, vm_list) {
@@ -3127,9 +3392,28 @@ static struct notifier_block kvmclock_cpufreq_notifier_block = {
3127 .notifier_call = kvmclock_cpufreq_notifier 3392 .notifier_call = kvmclock_cpufreq_notifier
3128}; 3393};
3129 3394
3395static void kvm_timer_init(void)
3396{
3397 int cpu;
3398
3399 if (!boot_cpu_has(X86_FEATURE_CONSTANT_TSC)) {
3400 cpufreq_register_notifier(&kvmclock_cpufreq_notifier_block,
3401 CPUFREQ_TRANSITION_NOTIFIER);
3402 for_each_online_cpu(cpu) {
3403 unsigned long khz = cpufreq_get(cpu);
3404 if (!khz)
3405 khz = tsc_khz;
3406 per_cpu(cpu_tsc_khz, cpu) = khz;
3407 }
3408 } else {
3409 for_each_possible_cpu(cpu)
3410 per_cpu(cpu_tsc_khz, cpu) = tsc_khz;
3411 }
3412}
3413
3130int kvm_arch_init(void *opaque) 3414int kvm_arch_init(void *opaque)
3131{ 3415{
3132 int r, cpu; 3416 int r;
3133 struct kvm_x86_ops *ops = (struct kvm_x86_ops *)opaque; 3417 struct kvm_x86_ops *ops = (struct kvm_x86_ops *)opaque;
3134 3418
3135 if (kvm_x86_ops) { 3419 if (kvm_x86_ops) {
@@ -3161,13 +3445,7 @@ int kvm_arch_init(void *opaque)
3161 kvm_mmu_set_mask_ptes(PT_USER_MASK, PT_ACCESSED_MASK, 3445 kvm_mmu_set_mask_ptes(PT_USER_MASK, PT_ACCESSED_MASK,
3162 PT_DIRTY_MASK, PT64_NX_MASK, 0); 3446 PT_DIRTY_MASK, PT64_NX_MASK, 0);
3163 3447
3164 for_each_possible_cpu(cpu) 3448 kvm_timer_init();
3165 per_cpu(cpu_tsc_khz, cpu) = tsc_khz;
3166 if (!boot_cpu_has(X86_FEATURE_CONSTANT_TSC)) {
3167 tsc_khz_ref = tsc_khz;
3168 cpufreq_register_notifier(&kvmclock_cpufreq_notifier_block,
3169 CPUFREQ_TRANSITION_NOTIFIER);
3170 }
3171 3449
3172 return 0; 3450 return 0;
3173 3451
@@ -3295,7 +3573,7 @@ void realmode_lmsw(struct kvm_vcpu *vcpu, unsigned long msw,
3295 unsigned long *rflags) 3573 unsigned long *rflags)
3296{ 3574{
3297 kvm_lmsw(vcpu, msw); 3575 kvm_lmsw(vcpu, msw);
3298 *rflags = kvm_x86_ops->get_rflags(vcpu); 3576 *rflags = kvm_get_rflags(vcpu);
3299} 3577}
3300 3578
3301unsigned long realmode_get_cr(struct kvm_vcpu *vcpu, int cr) 3579unsigned long realmode_get_cr(struct kvm_vcpu *vcpu, int cr)
@@ -3333,7 +3611,7 @@ void realmode_set_cr(struct kvm_vcpu *vcpu, int cr, unsigned long val,
3333 switch (cr) { 3611 switch (cr) {
3334 case 0: 3612 case 0:
3335 kvm_set_cr0(vcpu, mk_cr_64(vcpu->arch.cr0, val)); 3613 kvm_set_cr0(vcpu, mk_cr_64(vcpu->arch.cr0, val));
3336 *rflags = kvm_x86_ops->get_rflags(vcpu); 3614 *rflags = kvm_get_rflags(vcpu);
3337 break; 3615 break;
3338 case 2: 3616 case 2:
3339 vcpu->arch.cr2 = val; 3617 vcpu->arch.cr2 = val;
@@ -3453,18 +3731,18 @@ EXPORT_SYMBOL_GPL(kvm_emulate_cpuid);
3453 * 3731 *
3454 * No need to exit to userspace if we already have an interrupt queued. 3732 * No need to exit to userspace if we already have an interrupt queued.
3455 */ 3733 */
3456static int dm_request_for_irq_injection(struct kvm_vcpu *vcpu, 3734static int dm_request_for_irq_injection(struct kvm_vcpu *vcpu)
3457 struct kvm_run *kvm_run)
3458{ 3735{
3459 return (!irqchip_in_kernel(vcpu->kvm) && !kvm_cpu_has_interrupt(vcpu) && 3736 return (!irqchip_in_kernel(vcpu->kvm) && !kvm_cpu_has_interrupt(vcpu) &&
3460 kvm_run->request_interrupt_window && 3737 vcpu->run->request_interrupt_window &&
3461 kvm_arch_interrupt_allowed(vcpu)); 3738 kvm_arch_interrupt_allowed(vcpu));
3462} 3739}
3463 3740
3464static void post_kvm_run_save(struct kvm_vcpu *vcpu, 3741static void post_kvm_run_save(struct kvm_vcpu *vcpu)
3465 struct kvm_run *kvm_run)
3466{ 3742{
3467 kvm_run->if_flag = (kvm_x86_ops->get_rflags(vcpu) & X86_EFLAGS_IF) != 0; 3743 struct kvm_run *kvm_run = vcpu->run;
3744
3745 kvm_run->if_flag = (kvm_get_rflags(vcpu) & X86_EFLAGS_IF) != 0;
3468 kvm_run->cr8 = kvm_get_cr8(vcpu); 3746 kvm_run->cr8 = kvm_get_cr8(vcpu);
3469 kvm_run->apic_base = kvm_get_apic_base(vcpu); 3747 kvm_run->apic_base = kvm_get_apic_base(vcpu);
3470 if (irqchip_in_kernel(vcpu->kvm)) 3748 if (irqchip_in_kernel(vcpu->kvm))
@@ -3525,7 +3803,7 @@ static void update_cr8_intercept(struct kvm_vcpu *vcpu)
3525 kvm_x86_ops->update_cr8_intercept(vcpu, tpr, max_irr); 3803 kvm_x86_ops->update_cr8_intercept(vcpu, tpr, max_irr);
3526} 3804}
3527 3805
3528static void inject_pending_event(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) 3806static void inject_pending_event(struct kvm_vcpu *vcpu)
3529{ 3807{
3530 /* try to reinject previous events if any */ 3808 /* try to reinject previous events if any */
3531 if (vcpu->arch.exception.pending) { 3809 if (vcpu->arch.exception.pending) {
@@ -3561,11 +3839,11 @@ static void inject_pending_event(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
3561 } 3839 }
3562} 3840}
3563 3841
3564static int vcpu_enter_guest(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) 3842static int vcpu_enter_guest(struct kvm_vcpu *vcpu)
3565{ 3843{
3566 int r; 3844 int r;
3567 bool req_int_win = !irqchip_in_kernel(vcpu->kvm) && 3845 bool req_int_win = !irqchip_in_kernel(vcpu->kvm) &&
3568 kvm_run->request_interrupt_window; 3846 vcpu->run->request_interrupt_window;
3569 3847
3570 if (vcpu->requests) 3848 if (vcpu->requests)
3571 if (test_and_clear_bit(KVM_REQ_MMU_RELOAD, &vcpu->requests)) 3849 if (test_and_clear_bit(KVM_REQ_MMU_RELOAD, &vcpu->requests))
@@ -3586,12 +3864,12 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
3586 kvm_x86_ops->tlb_flush(vcpu); 3864 kvm_x86_ops->tlb_flush(vcpu);
3587 if (test_and_clear_bit(KVM_REQ_REPORT_TPR_ACCESS, 3865 if (test_and_clear_bit(KVM_REQ_REPORT_TPR_ACCESS,
3588 &vcpu->requests)) { 3866 &vcpu->requests)) {
3589 kvm_run->exit_reason = KVM_EXIT_TPR_ACCESS; 3867 vcpu->run->exit_reason = KVM_EXIT_TPR_ACCESS;
3590 r = 0; 3868 r = 0;
3591 goto out; 3869 goto out;
3592 } 3870 }
3593 if (test_and_clear_bit(KVM_REQ_TRIPLE_FAULT, &vcpu->requests)) { 3871 if (test_and_clear_bit(KVM_REQ_TRIPLE_FAULT, &vcpu->requests)) {
3594 kvm_run->exit_reason = KVM_EXIT_SHUTDOWN; 3872 vcpu->run->exit_reason = KVM_EXIT_SHUTDOWN;
3595 r = 0; 3873 r = 0;
3596 goto out; 3874 goto out;
3597 } 3875 }
@@ -3615,7 +3893,7 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
3615 goto out; 3893 goto out;
3616 } 3894 }
3617 3895
3618 inject_pending_event(vcpu, kvm_run); 3896 inject_pending_event(vcpu);
3619 3897
3620 /* enable NMI/IRQ window open exits if needed */ 3898 /* enable NMI/IRQ window open exits if needed */
3621 if (vcpu->arch.nmi_pending) 3899 if (vcpu->arch.nmi_pending)
@@ -3641,16 +3919,17 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
3641 } 3919 }
3642 3920
3643 trace_kvm_entry(vcpu->vcpu_id); 3921 trace_kvm_entry(vcpu->vcpu_id);
3644 kvm_x86_ops->run(vcpu, kvm_run); 3922 kvm_x86_ops->run(vcpu);
3645 3923
3646 if (unlikely(vcpu->arch.switch_db_regs || test_thread_flag(TIF_DEBUG))) { 3924 /*
3647 set_debugreg(current->thread.debugreg0, 0); 3925 * If the guest has used debug registers, at least dr7
3648 set_debugreg(current->thread.debugreg1, 1); 3926 * will be disabled while returning to the host.
3649 set_debugreg(current->thread.debugreg2, 2); 3927 * If we don't have active breakpoints in the host, we don't
3650 set_debugreg(current->thread.debugreg3, 3); 3928 * care about the messed up debug address registers. But if
3651 set_debugreg(current->thread.debugreg6, 6); 3929 * we have some of them active, restore the old state.
3652 set_debugreg(current->thread.debugreg7, 7); 3930 */
3653 } 3931 if (hw_breakpoint_active())
3932 hw_breakpoint_restore();
3654 3933
3655 set_bit(KVM_REQ_KICK, &vcpu->requests); 3934 set_bit(KVM_REQ_KICK, &vcpu->requests);
3656 local_irq_enable(); 3935 local_irq_enable();
@@ -3682,13 +3961,13 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
3682 3961
3683 kvm_lapic_sync_from_vapic(vcpu); 3962 kvm_lapic_sync_from_vapic(vcpu);
3684 3963
3685 r = kvm_x86_ops->handle_exit(kvm_run, vcpu); 3964 r = kvm_x86_ops->handle_exit(vcpu);
3686out: 3965out:
3687 return r; 3966 return r;
3688} 3967}
3689 3968
3690 3969
3691static int __vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) 3970static int __vcpu_run(struct kvm_vcpu *vcpu)
3692{ 3971{
3693 int r; 3972 int r;
3694 3973
@@ -3708,7 +3987,7 @@ static int __vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
3708 r = 1; 3987 r = 1;
3709 while (r > 0) { 3988 while (r > 0) {
3710 if (vcpu->arch.mp_state == KVM_MP_STATE_RUNNABLE) 3989 if (vcpu->arch.mp_state == KVM_MP_STATE_RUNNABLE)
3711 r = vcpu_enter_guest(vcpu, kvm_run); 3990 r = vcpu_enter_guest(vcpu);
3712 else { 3991 else {
3713 up_read(&vcpu->kvm->slots_lock); 3992 up_read(&vcpu->kvm->slots_lock);
3714 kvm_vcpu_block(vcpu); 3993 kvm_vcpu_block(vcpu);
@@ -3736,14 +4015,14 @@ static int __vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
3736 if (kvm_cpu_has_pending_timer(vcpu)) 4015 if (kvm_cpu_has_pending_timer(vcpu))
3737 kvm_inject_pending_timer_irqs(vcpu); 4016 kvm_inject_pending_timer_irqs(vcpu);
3738 4017
3739 if (dm_request_for_irq_injection(vcpu, kvm_run)) { 4018 if (dm_request_for_irq_injection(vcpu)) {
3740 r = -EINTR; 4019 r = -EINTR;
3741 kvm_run->exit_reason = KVM_EXIT_INTR; 4020 vcpu->run->exit_reason = KVM_EXIT_INTR;
3742 ++vcpu->stat.request_irq_exits; 4021 ++vcpu->stat.request_irq_exits;
3743 } 4022 }
3744 if (signal_pending(current)) { 4023 if (signal_pending(current)) {
3745 r = -EINTR; 4024 r = -EINTR;
3746 kvm_run->exit_reason = KVM_EXIT_INTR; 4025 vcpu->run->exit_reason = KVM_EXIT_INTR;
3747 ++vcpu->stat.signal_exits; 4026 ++vcpu->stat.signal_exits;
3748 } 4027 }
3749 if (need_resched()) { 4028 if (need_resched()) {
@@ -3754,7 +4033,7 @@ static int __vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
3754 } 4033 }
3755 4034
3756 up_read(&vcpu->kvm->slots_lock); 4035 up_read(&vcpu->kvm->slots_lock);
3757 post_kvm_run_save(vcpu, kvm_run); 4036 post_kvm_run_save(vcpu);
3758 4037
3759 vapic_exit(vcpu); 4038 vapic_exit(vcpu);
3760 4039
@@ -3787,15 +4066,13 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
3787 if (r) 4066 if (r)
3788 goto out; 4067 goto out;
3789 } 4068 }
3790#if CONFIG_HAS_IOMEM
3791 if (vcpu->mmio_needed) { 4069 if (vcpu->mmio_needed) {
3792 memcpy(vcpu->mmio_data, kvm_run->mmio.data, 8); 4070 memcpy(vcpu->mmio_data, kvm_run->mmio.data, 8);
3793 vcpu->mmio_read_completed = 1; 4071 vcpu->mmio_read_completed = 1;
3794 vcpu->mmio_needed = 0; 4072 vcpu->mmio_needed = 0;
3795 4073
3796 down_read(&vcpu->kvm->slots_lock); 4074 down_read(&vcpu->kvm->slots_lock);
3797 r = emulate_instruction(vcpu, kvm_run, 4075 r = emulate_instruction(vcpu, vcpu->arch.mmio_fault_cr2, 0,
3798 vcpu->arch.mmio_fault_cr2, 0,
3799 EMULTYPE_NO_DECODE); 4076 EMULTYPE_NO_DECODE);
3800 up_read(&vcpu->kvm->slots_lock); 4077 up_read(&vcpu->kvm->slots_lock);
3801 if (r == EMULATE_DO_MMIO) { 4078 if (r == EMULATE_DO_MMIO) {
@@ -3806,12 +4083,11 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
3806 goto out; 4083 goto out;
3807 } 4084 }
3808 } 4085 }
3809#endif
3810 if (kvm_run->exit_reason == KVM_EXIT_HYPERCALL) 4086 if (kvm_run->exit_reason == KVM_EXIT_HYPERCALL)
3811 kvm_register_write(vcpu, VCPU_REGS_RAX, 4087 kvm_register_write(vcpu, VCPU_REGS_RAX,
3812 kvm_run->hypercall.ret); 4088 kvm_run->hypercall.ret);
3813 4089
3814 r = __vcpu_run(vcpu, kvm_run); 4090 r = __vcpu_run(vcpu);
3815 4091
3816out: 4092out:
3817 if (vcpu->sigset_active) 4093 if (vcpu->sigset_active)
@@ -3845,13 +4121,7 @@ int kvm_arch_vcpu_ioctl_get_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)
3845#endif 4121#endif
3846 4122
3847 regs->rip = kvm_rip_read(vcpu); 4123 regs->rip = kvm_rip_read(vcpu);
3848 regs->rflags = kvm_x86_ops->get_rflags(vcpu); 4124 regs->rflags = kvm_get_rflags(vcpu);
3849
3850 /*
3851 * Don't leak debug flags in case they were set for guest debugging
3852 */
3853 if (vcpu->guest_debug & KVM_GUESTDBG_SINGLESTEP)
3854 regs->rflags &= ~(X86_EFLAGS_TF | X86_EFLAGS_RF);
3855 4125
3856 vcpu_put(vcpu); 4126 vcpu_put(vcpu);
3857 4127
@@ -3879,12 +4149,10 @@ int kvm_arch_vcpu_ioctl_set_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)
3879 kvm_register_write(vcpu, VCPU_REGS_R13, regs->r13); 4149 kvm_register_write(vcpu, VCPU_REGS_R13, regs->r13);
3880 kvm_register_write(vcpu, VCPU_REGS_R14, regs->r14); 4150 kvm_register_write(vcpu, VCPU_REGS_R14, regs->r14);
3881 kvm_register_write(vcpu, VCPU_REGS_R15, regs->r15); 4151 kvm_register_write(vcpu, VCPU_REGS_R15, regs->r15);
3882
3883#endif 4152#endif
3884 4153
3885 kvm_rip_write(vcpu, regs->rip); 4154 kvm_rip_write(vcpu, regs->rip);
3886 kvm_x86_ops->set_rflags(vcpu, regs->rflags); 4155 kvm_set_rflags(vcpu, regs->rflags);
3887
3888 4156
3889 vcpu->arch.exception.pending = false; 4157 vcpu->arch.exception.pending = false;
3890 4158
@@ -4103,7 +4371,7 @@ static int is_vm86_segment(struct kvm_vcpu *vcpu, int seg)
4103{ 4371{
4104 return (seg != VCPU_SREG_LDTR) && 4372 return (seg != VCPU_SREG_LDTR) &&
4105 (seg != VCPU_SREG_TR) && 4373 (seg != VCPU_SREG_TR) &&
4106 (kvm_x86_ops->get_rflags(vcpu) & X86_EFLAGS_VM); 4374 (kvm_get_rflags(vcpu) & X86_EFLAGS_VM);
4107} 4375}
4108 4376
4109int kvm_load_segment_descriptor(struct kvm_vcpu *vcpu, u16 selector, 4377int kvm_load_segment_descriptor(struct kvm_vcpu *vcpu, u16 selector,
@@ -4131,7 +4399,7 @@ static void save_state_to_tss32(struct kvm_vcpu *vcpu,
4131{ 4399{
4132 tss->cr3 = vcpu->arch.cr3; 4400 tss->cr3 = vcpu->arch.cr3;
4133 tss->eip = kvm_rip_read(vcpu); 4401 tss->eip = kvm_rip_read(vcpu);
4134 tss->eflags = kvm_x86_ops->get_rflags(vcpu); 4402 tss->eflags = kvm_get_rflags(vcpu);
4135 tss->eax = kvm_register_read(vcpu, VCPU_REGS_RAX); 4403 tss->eax = kvm_register_read(vcpu, VCPU_REGS_RAX);
4136 tss->ecx = kvm_register_read(vcpu, VCPU_REGS_RCX); 4404 tss->ecx = kvm_register_read(vcpu, VCPU_REGS_RCX);
4137 tss->edx = kvm_register_read(vcpu, VCPU_REGS_RDX); 4405 tss->edx = kvm_register_read(vcpu, VCPU_REGS_RDX);
@@ -4155,7 +4423,7 @@ static int load_state_from_tss32(struct kvm_vcpu *vcpu,
4155 kvm_set_cr3(vcpu, tss->cr3); 4423 kvm_set_cr3(vcpu, tss->cr3);
4156 4424
4157 kvm_rip_write(vcpu, tss->eip); 4425 kvm_rip_write(vcpu, tss->eip);
4158 kvm_x86_ops->set_rflags(vcpu, tss->eflags | 2); 4426 kvm_set_rflags(vcpu, tss->eflags | 2);
4159 4427
4160 kvm_register_write(vcpu, VCPU_REGS_RAX, tss->eax); 4428 kvm_register_write(vcpu, VCPU_REGS_RAX, tss->eax);
4161 kvm_register_write(vcpu, VCPU_REGS_RCX, tss->ecx); 4429 kvm_register_write(vcpu, VCPU_REGS_RCX, tss->ecx);
@@ -4193,7 +4461,7 @@ static void save_state_to_tss16(struct kvm_vcpu *vcpu,
4193 struct tss_segment_16 *tss) 4461 struct tss_segment_16 *tss)
4194{ 4462{
4195 tss->ip = kvm_rip_read(vcpu); 4463 tss->ip = kvm_rip_read(vcpu);
4196 tss->flag = kvm_x86_ops->get_rflags(vcpu); 4464 tss->flag = kvm_get_rflags(vcpu);
4197 tss->ax = kvm_register_read(vcpu, VCPU_REGS_RAX); 4465 tss->ax = kvm_register_read(vcpu, VCPU_REGS_RAX);
4198 tss->cx = kvm_register_read(vcpu, VCPU_REGS_RCX); 4466 tss->cx = kvm_register_read(vcpu, VCPU_REGS_RCX);
4199 tss->dx = kvm_register_read(vcpu, VCPU_REGS_RDX); 4467 tss->dx = kvm_register_read(vcpu, VCPU_REGS_RDX);
@@ -4208,14 +4476,13 @@ static void save_state_to_tss16(struct kvm_vcpu *vcpu,
4208 tss->ss = get_segment_selector(vcpu, VCPU_SREG_SS); 4476 tss->ss = get_segment_selector(vcpu, VCPU_SREG_SS);
4209 tss->ds = get_segment_selector(vcpu, VCPU_SREG_DS); 4477 tss->ds = get_segment_selector(vcpu, VCPU_SREG_DS);
4210 tss->ldt = get_segment_selector(vcpu, VCPU_SREG_LDTR); 4478 tss->ldt = get_segment_selector(vcpu, VCPU_SREG_LDTR);
4211 tss->prev_task_link = get_segment_selector(vcpu, VCPU_SREG_TR);
4212} 4479}
4213 4480
4214static int load_state_from_tss16(struct kvm_vcpu *vcpu, 4481static int load_state_from_tss16(struct kvm_vcpu *vcpu,
4215 struct tss_segment_16 *tss) 4482 struct tss_segment_16 *tss)
4216{ 4483{
4217 kvm_rip_write(vcpu, tss->ip); 4484 kvm_rip_write(vcpu, tss->ip);
4218 kvm_x86_ops->set_rflags(vcpu, tss->flag | 2); 4485 kvm_set_rflags(vcpu, tss->flag | 2);
4219 kvm_register_write(vcpu, VCPU_REGS_RAX, tss->ax); 4486 kvm_register_write(vcpu, VCPU_REGS_RAX, tss->ax);
4220 kvm_register_write(vcpu, VCPU_REGS_RCX, tss->cx); 4487 kvm_register_write(vcpu, VCPU_REGS_RCX, tss->cx);
4221 kvm_register_write(vcpu, VCPU_REGS_RDX, tss->dx); 4488 kvm_register_write(vcpu, VCPU_REGS_RDX, tss->dx);
@@ -4361,8 +4628,8 @@ int kvm_task_switch(struct kvm_vcpu *vcpu, u16 tss_selector, int reason)
4361 } 4628 }
4362 4629
4363 if (reason == TASK_SWITCH_IRET) { 4630 if (reason == TASK_SWITCH_IRET) {
4364 u32 eflags = kvm_x86_ops->get_rflags(vcpu); 4631 u32 eflags = kvm_get_rflags(vcpu);
4365 kvm_x86_ops->set_rflags(vcpu, eflags & ~X86_EFLAGS_NT); 4632 kvm_set_rflags(vcpu, eflags & ~X86_EFLAGS_NT);
4366 } 4633 }
4367 4634
4368 /* set back link to prev task only if NT bit is set in eflags 4635 /* set back link to prev task only if NT bit is set in eflags
@@ -4370,11 +4637,6 @@ int kvm_task_switch(struct kvm_vcpu *vcpu, u16 tss_selector, int reason)
4370 if (reason != TASK_SWITCH_CALL && reason != TASK_SWITCH_GATE) 4637 if (reason != TASK_SWITCH_CALL && reason != TASK_SWITCH_GATE)
4371 old_tss_sel = 0xffff; 4638 old_tss_sel = 0xffff;
4372 4639
4373 /* set back link to prev task only if NT bit is set in eflags
4374 note that old_tss_sel is not used afetr this point */
4375 if (reason != TASK_SWITCH_CALL && reason != TASK_SWITCH_GATE)
4376 old_tss_sel = 0xffff;
4377
4378 if (nseg_desc.type & 8) 4640 if (nseg_desc.type & 8)
4379 ret = kvm_task_switch_32(vcpu, tss_selector, old_tss_sel, 4641 ret = kvm_task_switch_32(vcpu, tss_selector, old_tss_sel,
4380 old_tss_base, &nseg_desc); 4642 old_tss_base, &nseg_desc);
@@ -4383,8 +4645,8 @@ int kvm_task_switch(struct kvm_vcpu *vcpu, u16 tss_selector, int reason)
4383 old_tss_base, &nseg_desc); 4645 old_tss_base, &nseg_desc);
4384 4646
4385 if (reason == TASK_SWITCH_CALL || reason == TASK_SWITCH_GATE) { 4647 if (reason == TASK_SWITCH_CALL || reason == TASK_SWITCH_GATE) {
4386 u32 eflags = kvm_x86_ops->get_rflags(vcpu); 4648 u32 eflags = kvm_get_rflags(vcpu);
4387 kvm_x86_ops->set_rflags(vcpu, eflags | X86_EFLAGS_NT); 4649 kvm_set_rflags(vcpu, eflags | X86_EFLAGS_NT);
4388 } 4650 }
4389 4651
4390 if (reason != TASK_SWITCH_IRET) { 4652 if (reason != TASK_SWITCH_IRET) {
@@ -4436,8 +4698,10 @@ int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu,
4436 4698
4437 mmu_reset_needed |= vcpu->arch.cr4 != sregs->cr4; 4699 mmu_reset_needed |= vcpu->arch.cr4 != sregs->cr4;
4438 kvm_x86_ops->set_cr4(vcpu, sregs->cr4); 4700 kvm_x86_ops->set_cr4(vcpu, sregs->cr4);
4439 if (!is_long_mode(vcpu) && is_pae(vcpu)) 4701 if (!is_long_mode(vcpu) && is_pae(vcpu)) {
4440 load_pdptrs(vcpu, vcpu->arch.cr3); 4702 load_pdptrs(vcpu, vcpu->arch.cr3);
4703 mmu_reset_needed = 1;
4704 }
4441 4705
4442 if (mmu_reset_needed) 4706 if (mmu_reset_needed)
4443 kvm_mmu_reset_context(vcpu); 4707 kvm_mmu_reset_context(vcpu);
@@ -4478,12 +4742,32 @@ int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu,
4478int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu, 4742int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu,
4479 struct kvm_guest_debug *dbg) 4743 struct kvm_guest_debug *dbg)
4480{ 4744{
4745 unsigned long rflags;
4481 int i, r; 4746 int i, r;
4482 4747
4483 vcpu_load(vcpu); 4748 vcpu_load(vcpu);
4484 4749
4485 if ((dbg->control & (KVM_GUESTDBG_ENABLE | KVM_GUESTDBG_USE_HW_BP)) == 4750 if (dbg->control & (KVM_GUESTDBG_INJECT_DB | KVM_GUESTDBG_INJECT_BP)) {
4486 (KVM_GUESTDBG_ENABLE | KVM_GUESTDBG_USE_HW_BP)) { 4751 r = -EBUSY;
4752 if (vcpu->arch.exception.pending)
4753 goto unlock_out;
4754 if (dbg->control & KVM_GUESTDBG_INJECT_DB)
4755 kvm_queue_exception(vcpu, DB_VECTOR);
4756 else
4757 kvm_queue_exception(vcpu, BP_VECTOR);
4758 }
4759
4760 /*
4761 * Read rflags as long as potentially injected trace flags are still
4762 * filtered out.
4763 */
4764 rflags = kvm_get_rflags(vcpu);
4765
4766 vcpu->guest_debug = dbg->control;
4767 if (!(vcpu->guest_debug & KVM_GUESTDBG_ENABLE))
4768 vcpu->guest_debug = 0;
4769
4770 if (vcpu->guest_debug & KVM_GUESTDBG_USE_HW_BP) {
4487 for (i = 0; i < KVM_NR_DB_REGS; ++i) 4771 for (i = 0; i < KVM_NR_DB_REGS; ++i)
4488 vcpu->arch.eff_db[i] = dbg->arch.debugreg[i]; 4772 vcpu->arch.eff_db[i] = dbg->arch.debugreg[i];
4489 vcpu->arch.switch_db_regs = 4773 vcpu->arch.switch_db_regs =
@@ -4494,13 +4778,23 @@ int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu,
4494 vcpu->arch.switch_db_regs = (vcpu->arch.dr7 & DR7_BP_EN_MASK); 4778 vcpu->arch.switch_db_regs = (vcpu->arch.dr7 & DR7_BP_EN_MASK);
4495 } 4779 }
4496 4780
4497 r = kvm_x86_ops->set_guest_debug(vcpu, dbg); 4781 if (vcpu->guest_debug & KVM_GUESTDBG_SINGLESTEP) {
4782 vcpu->arch.singlestep_cs =
4783 get_segment_selector(vcpu, VCPU_SREG_CS);
4784 vcpu->arch.singlestep_rip = kvm_rip_read(vcpu);
4785 }
4786
4787 /*
4788 * Trigger an rflags update that will inject or remove the trace
4789 * flags.
4790 */
4791 kvm_set_rflags(vcpu, rflags);
4792
4793 kvm_x86_ops->set_guest_debug(vcpu, dbg);
4498 4794
4499 if (dbg->control & KVM_GUESTDBG_INJECT_DB) 4795 r = 0;
4500 kvm_queue_exception(vcpu, DB_VECTOR);
4501 else if (dbg->control & KVM_GUESTDBG_INJECT_BP)
4502 kvm_queue_exception(vcpu, BP_VECTOR);
4503 4796
4797unlock_out:
4504 vcpu_put(vcpu); 4798 vcpu_put(vcpu);
4505 4799
4506 return r; 4800 return r;
@@ -4701,14 +4995,26 @@ int kvm_arch_vcpu_reset(struct kvm_vcpu *vcpu)
4701 return kvm_x86_ops->vcpu_reset(vcpu); 4995 return kvm_x86_ops->vcpu_reset(vcpu);
4702} 4996}
4703 4997
4704void kvm_arch_hardware_enable(void *garbage) 4998int kvm_arch_hardware_enable(void *garbage)
4705{ 4999{
4706 kvm_x86_ops->hardware_enable(garbage); 5000 /*
5001 * Since this may be called from a hotplug notifcation,
5002 * we can't get the CPU frequency directly.
5003 */
5004 if (!boot_cpu_has(X86_FEATURE_CONSTANT_TSC)) {
5005 int cpu = raw_smp_processor_id();
5006 per_cpu(cpu_tsc_khz, cpu) = 0;
5007 }
5008
5009 kvm_shared_msr_cpu_online();
5010
5011 return kvm_x86_ops->hardware_enable(garbage);
4707} 5012}
4708 5013
4709void kvm_arch_hardware_disable(void *garbage) 5014void kvm_arch_hardware_disable(void *garbage)
4710{ 5015{
4711 kvm_x86_ops->hardware_disable(garbage); 5016 kvm_x86_ops->hardware_disable(garbage);
5017 drop_user_return_notifiers(garbage);
4712} 5018}
4713 5019
4714int kvm_arch_hardware_setup(void) 5020int kvm_arch_hardware_setup(void)
@@ -4946,8 +5252,36 @@ int kvm_arch_interrupt_allowed(struct kvm_vcpu *vcpu)
4946 return kvm_x86_ops->interrupt_allowed(vcpu); 5252 return kvm_x86_ops->interrupt_allowed(vcpu);
4947} 5253}
4948 5254
5255unsigned long kvm_get_rflags(struct kvm_vcpu *vcpu)
5256{
5257 unsigned long rflags;
5258
5259 rflags = kvm_x86_ops->get_rflags(vcpu);
5260 if (vcpu->guest_debug & KVM_GUESTDBG_SINGLESTEP)
5261 rflags &= ~(unsigned long)(X86_EFLAGS_TF | X86_EFLAGS_RF);
5262 return rflags;
5263}
5264EXPORT_SYMBOL_GPL(kvm_get_rflags);
5265
5266void kvm_set_rflags(struct kvm_vcpu *vcpu, unsigned long rflags)
5267{
5268 if (vcpu->guest_debug & KVM_GUESTDBG_SINGLESTEP &&
5269 vcpu->arch.singlestep_cs ==
5270 get_segment_selector(vcpu, VCPU_SREG_CS) &&
5271 vcpu->arch.singlestep_rip == kvm_rip_read(vcpu))
5272 rflags |= X86_EFLAGS_TF | X86_EFLAGS_RF;
5273 kvm_x86_ops->set_rflags(vcpu, rflags);
5274}
5275EXPORT_SYMBOL_GPL(kvm_set_rflags);
5276
4949EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_exit); 5277EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_exit);
4950EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_inj_virq); 5278EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_inj_virq);
4951EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_page_fault); 5279EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_page_fault);
4952EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_msr); 5280EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_msr);
4953EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_cr); 5281EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_cr);
5282EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_nested_vmrun);
5283EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_nested_vmexit);
5284EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_nested_vmexit_inject);
5285EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_nested_intr_vmexit);
5286EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_invlpga);
5287EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_skinit);
diff --git a/arch/x86/lib/.gitignore b/arch/x86/lib/.gitignore
new file mode 100644
index 000000000000..8df89f0a3fe6
--- /dev/null
+++ b/arch/x86/lib/.gitignore
@@ -0,0 +1 @@
inat-tables.c
diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile
index 85f5db95c60f..a2d6472895fb 100644
--- a/arch/x86/lib/Makefile
+++ b/arch/x86/lib/Makefile
@@ -2,12 +2,25 @@
2# Makefile for x86 specific library files. 2# Makefile for x86 specific library files.
3# 3#
4 4
5inat_tables_script = $(srctree)/arch/x86/tools/gen-insn-attr-x86.awk
6inat_tables_maps = $(srctree)/arch/x86/lib/x86-opcode-map.txt
7quiet_cmd_inat_tables = GEN $@
8 cmd_inat_tables = $(AWK) -f $(inat_tables_script) $(inat_tables_maps) > $@
9
10$(obj)/inat-tables.c: $(inat_tables_script) $(inat_tables_maps)
11 $(call cmd,inat_tables)
12
13$(obj)/inat.o: $(obj)/inat-tables.c
14
15clean-files := inat-tables.c
16
5obj-$(CONFIG_SMP) := msr.o 17obj-$(CONFIG_SMP) := msr.o
6 18
7lib-y := delay.o 19lib-y := delay.o
8lib-y += thunk_$(BITS).o 20lib-y += thunk_$(BITS).o
9lib-y += usercopy_$(BITS).o getuser.o putuser.o 21lib-y += usercopy_$(BITS).o getuser.o putuser.o
10lib-y += memcpy_$(BITS).o 22lib-y += memcpy_$(BITS).o
23lib-y += insn.o inat.o
11 24
12obj-y += msr-reg.o msr-reg-export.o 25obj-y += msr-reg.o msr-reg-export.o
13 26
diff --git a/arch/x86/lib/copy_user_64.S b/arch/x86/lib/copy_user_64.S
index 6ba0f7bb85ea..cf889d4e076a 100644
--- a/arch/x86/lib/copy_user_64.S
+++ b/arch/x86/lib/copy_user_64.S
@@ -65,7 +65,7 @@
65 .endm 65 .endm
66 66
67/* Standard copy_to_user with segment limit checking */ 67/* Standard copy_to_user with segment limit checking */
68ENTRY(copy_to_user) 68ENTRY(_copy_to_user)
69 CFI_STARTPROC 69 CFI_STARTPROC
70 GET_THREAD_INFO(%rax) 70 GET_THREAD_INFO(%rax)
71 movq %rdi,%rcx 71 movq %rdi,%rcx
@@ -75,10 +75,10 @@ ENTRY(copy_to_user)
75 jae bad_to_user 75 jae bad_to_user
76 ALTERNATIVE_JUMP X86_FEATURE_REP_GOOD,copy_user_generic_unrolled,copy_user_generic_string 76 ALTERNATIVE_JUMP X86_FEATURE_REP_GOOD,copy_user_generic_unrolled,copy_user_generic_string
77 CFI_ENDPROC 77 CFI_ENDPROC
78ENDPROC(copy_to_user) 78ENDPROC(_copy_to_user)
79 79
80/* Standard copy_from_user with segment limit checking */ 80/* Standard copy_from_user with segment limit checking */
81ENTRY(copy_from_user) 81ENTRY(_copy_from_user)
82 CFI_STARTPROC 82 CFI_STARTPROC
83 GET_THREAD_INFO(%rax) 83 GET_THREAD_INFO(%rax)
84 movq %rsi,%rcx 84 movq %rsi,%rcx
@@ -88,7 +88,7 @@ ENTRY(copy_from_user)
88 jae bad_from_user 88 jae bad_from_user
89 ALTERNATIVE_JUMP X86_FEATURE_REP_GOOD,copy_user_generic_unrolled,copy_user_generic_string 89 ALTERNATIVE_JUMP X86_FEATURE_REP_GOOD,copy_user_generic_unrolled,copy_user_generic_string
90 CFI_ENDPROC 90 CFI_ENDPROC
91ENDPROC(copy_from_user) 91ENDPROC(_copy_from_user)
92 92
93ENTRY(copy_user_generic) 93ENTRY(copy_user_generic)
94 CFI_STARTPROC 94 CFI_STARTPROC
@@ -96,12 +96,6 @@ ENTRY(copy_user_generic)
96 CFI_ENDPROC 96 CFI_ENDPROC
97ENDPROC(copy_user_generic) 97ENDPROC(copy_user_generic)
98 98
99ENTRY(__copy_from_user_inatomic)
100 CFI_STARTPROC
101 ALTERNATIVE_JUMP X86_FEATURE_REP_GOOD,copy_user_generic_unrolled,copy_user_generic_string
102 CFI_ENDPROC
103ENDPROC(__copy_from_user_inatomic)
104
105 .section .fixup,"ax" 99 .section .fixup,"ax"
106 /* must zero dest */ 100 /* must zero dest */
107ENTRY(bad_from_user) 101ENTRY(bad_from_user)
diff --git a/arch/x86/lib/inat.c b/arch/x86/lib/inat.c
new file mode 100644
index 000000000000..46fc4ee09fc4
--- /dev/null
+++ b/arch/x86/lib/inat.c
@@ -0,0 +1,90 @@
1/*
2 * x86 instruction attribute tables
3 *
4 * Written by Masami Hiramatsu <mhiramat@redhat.com>
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 as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 *
20 */
21#include <asm/insn.h>
22
23/* Attribute tables are generated from opcode map */
24#include "inat-tables.c"
25
26/* Attribute search APIs */
27insn_attr_t inat_get_opcode_attribute(insn_byte_t opcode)
28{
29 return inat_primary_table[opcode];
30}
31
32insn_attr_t inat_get_escape_attribute(insn_byte_t opcode, insn_byte_t last_pfx,
33 insn_attr_t esc_attr)
34{
35 const insn_attr_t *table;
36 insn_attr_t lpfx_attr;
37 int n, m = 0;
38
39 n = inat_escape_id(esc_attr);
40 if (last_pfx) {
41 lpfx_attr = inat_get_opcode_attribute(last_pfx);
42 m = inat_last_prefix_id(lpfx_attr);
43 }
44 table = inat_escape_tables[n][0];
45 if (!table)
46 return 0;
47 if (inat_has_variant(table[opcode]) && m) {
48 table = inat_escape_tables[n][m];
49 if (!table)
50 return 0;
51 }
52 return table[opcode];
53}
54
55insn_attr_t inat_get_group_attribute(insn_byte_t modrm, insn_byte_t last_pfx,
56 insn_attr_t grp_attr)
57{
58 const insn_attr_t *table;
59 insn_attr_t lpfx_attr;
60 int n, m = 0;
61
62 n = inat_group_id(grp_attr);
63 if (last_pfx) {
64 lpfx_attr = inat_get_opcode_attribute(last_pfx);
65 m = inat_last_prefix_id(lpfx_attr);
66 }
67 table = inat_group_tables[n][0];
68 if (!table)
69 return inat_group_common_attribute(grp_attr);
70 if (inat_has_variant(table[X86_MODRM_REG(modrm)]) && m) {
71 table = inat_group_tables[n][m];
72 if (!table)
73 return inat_group_common_attribute(grp_attr);
74 }
75 return table[X86_MODRM_REG(modrm)] |
76 inat_group_common_attribute(grp_attr);
77}
78
79insn_attr_t inat_get_avx_attribute(insn_byte_t opcode, insn_byte_t vex_m,
80 insn_byte_t vex_p)
81{
82 const insn_attr_t *table;
83 if (vex_m > X86_VEX_M_MAX || vex_p > INAT_LSTPFX_MAX)
84 return 0;
85 table = inat_avx_tables[vex_m][vex_p];
86 if (!table)
87 return 0;
88 return table[opcode];
89}
90
diff --git a/arch/x86/lib/insn.c b/arch/x86/lib/insn.c
new file mode 100644
index 000000000000..9f33b984d0ef
--- /dev/null
+++ b/arch/x86/lib/insn.c
@@ -0,0 +1,516 @@
1/*
2 * x86 instruction analysis
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 *
18 * Copyright (C) IBM Corporation, 2002, 2004, 2009
19 */
20
21#include <linux/string.h>
22#include <asm/inat.h>
23#include <asm/insn.h>
24
25#define get_next(t, insn) \
26 ({t r; r = *(t*)insn->next_byte; insn->next_byte += sizeof(t); r; })
27
28#define peek_next(t, insn) \
29 ({t r; r = *(t*)insn->next_byte; r; })
30
31#define peek_nbyte_next(t, insn, n) \
32 ({t r; r = *(t*)((insn)->next_byte + n); r; })
33
34/**
35 * insn_init() - initialize struct insn
36 * @insn: &struct insn to be initialized
37 * @kaddr: address (in kernel memory) of instruction (or copy thereof)
38 * @x86_64: !0 for 64-bit kernel or 64-bit app
39 */
40void insn_init(struct insn *insn, const void *kaddr, int x86_64)
41{
42 memset(insn, 0, sizeof(*insn));
43 insn->kaddr = kaddr;
44 insn->next_byte = kaddr;
45 insn->x86_64 = x86_64 ? 1 : 0;
46 insn->opnd_bytes = 4;
47 if (x86_64)
48 insn->addr_bytes = 8;
49 else
50 insn->addr_bytes = 4;
51}
52
53/**
54 * insn_get_prefixes - scan x86 instruction prefix bytes
55 * @insn: &struct insn containing instruction
56 *
57 * Populates the @insn->prefixes bitmap, and updates @insn->next_byte
58 * to point to the (first) opcode. No effect if @insn->prefixes.got
59 * is already set.
60 */
61void insn_get_prefixes(struct insn *insn)
62{
63 struct insn_field *prefixes = &insn->prefixes;
64 insn_attr_t attr;
65 insn_byte_t b, lb;
66 int i, nb;
67
68 if (prefixes->got)
69 return;
70
71 nb = 0;
72 lb = 0;
73 b = peek_next(insn_byte_t, insn);
74 attr = inat_get_opcode_attribute(b);
75 while (inat_is_legacy_prefix(attr)) {
76 /* Skip if same prefix */
77 for (i = 0; i < nb; i++)
78 if (prefixes->bytes[i] == b)
79 goto found;
80 if (nb == 4)
81 /* Invalid instruction */
82 break;
83 prefixes->bytes[nb++] = b;
84 if (inat_is_address_size_prefix(attr)) {
85 /* address size switches 2/4 or 4/8 */
86 if (insn->x86_64)
87 insn->addr_bytes ^= 12;
88 else
89 insn->addr_bytes ^= 6;
90 } else if (inat_is_operand_size_prefix(attr)) {
91 /* oprand size switches 2/4 */
92 insn->opnd_bytes ^= 6;
93 }
94found:
95 prefixes->nbytes++;
96 insn->next_byte++;
97 lb = b;
98 b = peek_next(insn_byte_t, insn);
99 attr = inat_get_opcode_attribute(b);
100 }
101 /* Set the last prefix */
102 if (lb && lb != insn->prefixes.bytes[3]) {
103 if (unlikely(insn->prefixes.bytes[3])) {
104 /* Swap the last prefix */
105 b = insn->prefixes.bytes[3];
106 for (i = 0; i < nb; i++)
107 if (prefixes->bytes[i] == lb)
108 prefixes->bytes[i] = b;
109 }
110 insn->prefixes.bytes[3] = lb;
111 }
112
113 /* Decode REX prefix */
114 if (insn->x86_64) {
115 b = peek_next(insn_byte_t, insn);
116 attr = inat_get_opcode_attribute(b);
117 if (inat_is_rex_prefix(attr)) {
118 insn->rex_prefix.value = b;
119 insn->rex_prefix.nbytes = 1;
120 insn->next_byte++;
121 if (X86_REX_W(b))
122 /* REX.W overrides opnd_size */
123 insn->opnd_bytes = 8;
124 }
125 }
126 insn->rex_prefix.got = 1;
127
128 /* Decode VEX prefix */
129 b = peek_next(insn_byte_t, insn);
130 attr = inat_get_opcode_attribute(b);
131 if (inat_is_vex_prefix(attr)) {
132 insn_byte_t b2 = peek_nbyte_next(insn_byte_t, insn, 1);
133 if (!insn->x86_64) {
134 /*
135 * In 32-bits mode, if the [7:6] bits (mod bits of
136 * ModRM) on the second byte are not 11b, it is
137 * LDS or LES.
138 */
139 if (X86_MODRM_MOD(b2) != 3)
140 goto vex_end;
141 }
142 insn->vex_prefix.bytes[0] = b;
143 insn->vex_prefix.bytes[1] = b2;
144 if (inat_is_vex3_prefix(attr)) {
145 b2 = peek_nbyte_next(insn_byte_t, insn, 2);
146 insn->vex_prefix.bytes[2] = b2;
147 insn->vex_prefix.nbytes = 3;
148 insn->next_byte += 3;
149 if (insn->x86_64 && X86_VEX_W(b2))
150 /* VEX.W overrides opnd_size */
151 insn->opnd_bytes = 8;
152 } else {
153 insn->vex_prefix.nbytes = 2;
154 insn->next_byte += 2;
155 }
156 }
157vex_end:
158 insn->vex_prefix.got = 1;
159
160 prefixes->got = 1;
161 return;
162}
163
164/**
165 * insn_get_opcode - collect opcode(s)
166 * @insn: &struct insn containing instruction
167 *
168 * Populates @insn->opcode, updates @insn->next_byte to point past the
169 * opcode byte(s), and set @insn->attr (except for groups).
170 * If necessary, first collects any preceding (prefix) bytes.
171 * Sets @insn->opcode.value = opcode1. No effect if @insn->opcode.got
172 * is already 1.
173 */
174void insn_get_opcode(struct insn *insn)
175{
176 struct insn_field *opcode = &insn->opcode;
177 insn_byte_t op, pfx;
178 if (opcode->got)
179 return;
180 if (!insn->prefixes.got)
181 insn_get_prefixes(insn);
182
183 /* Get first opcode */
184 op = get_next(insn_byte_t, insn);
185 opcode->bytes[0] = op;
186 opcode->nbytes = 1;
187
188 /* Check if there is VEX prefix or not */
189 if (insn_is_avx(insn)) {
190 insn_byte_t m, p;
191 m = insn_vex_m_bits(insn);
192 p = insn_vex_p_bits(insn);
193 insn->attr = inat_get_avx_attribute(op, m, p);
194 if (!inat_accept_vex(insn->attr))
195 insn->attr = 0; /* This instruction is bad */
196 goto end; /* VEX has only 1 byte for opcode */
197 }
198
199 insn->attr = inat_get_opcode_attribute(op);
200 while (inat_is_escape(insn->attr)) {
201 /* Get escaped opcode */
202 op = get_next(insn_byte_t, insn);
203 opcode->bytes[opcode->nbytes++] = op;
204 pfx = insn_last_prefix(insn);
205 insn->attr = inat_get_escape_attribute(op, pfx, insn->attr);
206 }
207 if (inat_must_vex(insn->attr))
208 insn->attr = 0; /* This instruction is bad */
209end:
210 opcode->got = 1;
211}
212
213/**
214 * insn_get_modrm - collect ModRM byte, if any
215 * @insn: &struct insn containing instruction
216 *
217 * Populates @insn->modrm and updates @insn->next_byte to point past the
218 * ModRM byte, if any. If necessary, first collects the preceding bytes
219 * (prefixes and opcode(s)). No effect if @insn->modrm.got is already 1.
220 */
221void insn_get_modrm(struct insn *insn)
222{
223 struct insn_field *modrm = &insn->modrm;
224 insn_byte_t pfx, mod;
225 if (modrm->got)
226 return;
227 if (!insn->opcode.got)
228 insn_get_opcode(insn);
229
230 if (inat_has_modrm(insn->attr)) {
231 mod = get_next(insn_byte_t, insn);
232 modrm->value = mod;
233 modrm->nbytes = 1;
234 if (inat_is_group(insn->attr)) {
235 pfx = insn_last_prefix(insn);
236 insn->attr = inat_get_group_attribute(mod, pfx,
237 insn->attr);
238 }
239 }
240
241 if (insn->x86_64 && inat_is_force64(insn->attr))
242 insn->opnd_bytes = 8;
243 modrm->got = 1;
244}
245
246
247/**
248 * insn_rip_relative() - Does instruction use RIP-relative addressing mode?
249 * @insn: &struct insn containing instruction
250 *
251 * If necessary, first collects the instruction up to and including the
252 * ModRM byte. No effect if @insn->x86_64 is 0.
253 */
254int insn_rip_relative(struct insn *insn)
255{
256 struct insn_field *modrm = &insn->modrm;
257
258 if (!insn->x86_64)
259 return 0;
260 if (!modrm->got)
261 insn_get_modrm(insn);
262 /*
263 * For rip-relative instructions, the mod field (top 2 bits)
264 * is zero and the r/m field (bottom 3 bits) is 0x5.
265 */
266 return (modrm->nbytes && (modrm->value & 0xc7) == 0x5);
267}
268
269/**
270 * insn_get_sib() - Get the SIB byte of instruction
271 * @insn: &struct insn containing instruction
272 *
273 * If necessary, first collects the instruction up to and including the
274 * ModRM byte.
275 */
276void insn_get_sib(struct insn *insn)
277{
278 insn_byte_t modrm;
279
280 if (insn->sib.got)
281 return;
282 if (!insn->modrm.got)
283 insn_get_modrm(insn);
284 if (insn->modrm.nbytes) {
285 modrm = (insn_byte_t)insn->modrm.value;
286 if (insn->addr_bytes != 2 &&
287 X86_MODRM_MOD(modrm) != 3 && X86_MODRM_RM(modrm) == 4) {
288 insn->sib.value = get_next(insn_byte_t, insn);
289 insn->sib.nbytes = 1;
290 }
291 }
292 insn->sib.got = 1;
293}
294
295
296/**
297 * insn_get_displacement() - Get the displacement of instruction
298 * @insn: &struct insn containing instruction
299 *
300 * If necessary, first collects the instruction up to and including the
301 * SIB byte.
302 * Displacement value is sign-expanded.
303 */
304void insn_get_displacement(struct insn *insn)
305{
306 insn_byte_t mod, rm, base;
307
308 if (insn->displacement.got)
309 return;
310 if (!insn->sib.got)
311 insn_get_sib(insn);
312 if (insn->modrm.nbytes) {
313 /*
314 * Interpreting the modrm byte:
315 * mod = 00 - no displacement fields (exceptions below)
316 * mod = 01 - 1-byte displacement field
317 * mod = 10 - displacement field is 4 bytes, or 2 bytes if
318 * address size = 2 (0x67 prefix in 32-bit mode)
319 * mod = 11 - no memory operand
320 *
321 * If address size = 2...
322 * mod = 00, r/m = 110 - displacement field is 2 bytes
323 *
324 * If address size != 2...
325 * mod != 11, r/m = 100 - SIB byte exists
326 * mod = 00, SIB base = 101 - displacement field is 4 bytes
327 * mod = 00, r/m = 101 - rip-relative addressing, displacement
328 * field is 4 bytes
329 */
330 mod = X86_MODRM_MOD(insn->modrm.value);
331 rm = X86_MODRM_RM(insn->modrm.value);
332 base = X86_SIB_BASE(insn->sib.value);
333 if (mod == 3)
334 goto out;
335 if (mod == 1) {
336 insn->displacement.value = get_next(char, insn);
337 insn->displacement.nbytes = 1;
338 } else if (insn->addr_bytes == 2) {
339 if ((mod == 0 && rm == 6) || mod == 2) {
340 insn->displacement.value =
341 get_next(short, insn);
342 insn->displacement.nbytes = 2;
343 }
344 } else {
345 if ((mod == 0 && rm == 5) || mod == 2 ||
346 (mod == 0 && base == 5)) {
347 insn->displacement.value = get_next(int, insn);
348 insn->displacement.nbytes = 4;
349 }
350 }
351 }
352out:
353 insn->displacement.got = 1;
354}
355
356/* Decode moffset16/32/64 */
357static void __get_moffset(struct insn *insn)
358{
359 switch (insn->addr_bytes) {
360 case 2:
361 insn->moffset1.value = get_next(short, insn);
362 insn->moffset1.nbytes = 2;
363 break;
364 case 4:
365 insn->moffset1.value = get_next(int, insn);
366 insn->moffset1.nbytes = 4;
367 break;
368 case 8:
369 insn->moffset1.value = get_next(int, insn);
370 insn->moffset1.nbytes = 4;
371 insn->moffset2.value = get_next(int, insn);
372 insn->moffset2.nbytes = 4;
373 break;
374 }
375 insn->moffset1.got = insn->moffset2.got = 1;
376}
377
378/* Decode imm v32(Iz) */
379static void __get_immv32(struct insn *insn)
380{
381 switch (insn->opnd_bytes) {
382 case 2:
383 insn->immediate.value = get_next(short, insn);
384 insn->immediate.nbytes = 2;
385 break;
386 case 4:
387 case 8:
388 insn->immediate.value = get_next(int, insn);
389 insn->immediate.nbytes = 4;
390 break;
391 }
392}
393
394/* Decode imm v64(Iv/Ov) */
395static void __get_immv(struct insn *insn)
396{
397 switch (insn->opnd_bytes) {
398 case 2:
399 insn->immediate1.value = get_next(short, insn);
400 insn->immediate1.nbytes = 2;
401 break;
402 case 4:
403 insn->immediate1.value = get_next(int, insn);
404 insn->immediate1.nbytes = 4;
405 break;
406 case 8:
407 insn->immediate1.value = get_next(int, insn);
408 insn->immediate1.nbytes = 4;
409 insn->immediate2.value = get_next(int, insn);
410 insn->immediate2.nbytes = 4;
411 break;
412 }
413 insn->immediate1.got = insn->immediate2.got = 1;
414}
415
416/* Decode ptr16:16/32(Ap) */
417static void __get_immptr(struct insn *insn)
418{
419 switch (insn->opnd_bytes) {
420 case 2:
421 insn->immediate1.value = get_next(short, insn);
422 insn->immediate1.nbytes = 2;
423 break;
424 case 4:
425 insn->immediate1.value = get_next(int, insn);
426 insn->immediate1.nbytes = 4;
427 break;
428 case 8:
429 /* ptr16:64 is not exist (no segment) */
430 return;
431 }
432 insn->immediate2.value = get_next(unsigned short, insn);
433 insn->immediate2.nbytes = 2;
434 insn->immediate1.got = insn->immediate2.got = 1;
435}
436
437/**
438 * insn_get_immediate() - Get the immediates of instruction
439 * @insn: &struct insn containing instruction
440 *
441 * If necessary, first collects the instruction up to and including the
442 * displacement bytes.
443 * Basically, most of immediates are sign-expanded. Unsigned-value can be
444 * get by bit masking with ((1 << (nbytes * 8)) - 1)
445 */
446void insn_get_immediate(struct insn *insn)
447{
448 if (insn->immediate.got)
449 return;
450 if (!insn->displacement.got)
451 insn_get_displacement(insn);
452
453 if (inat_has_moffset(insn->attr)) {
454 __get_moffset(insn);
455 goto done;
456 }
457
458 if (!inat_has_immediate(insn->attr))
459 /* no immediates */
460 goto done;
461
462 switch (inat_immediate_size(insn->attr)) {
463 case INAT_IMM_BYTE:
464 insn->immediate.value = get_next(char, insn);
465 insn->immediate.nbytes = 1;
466 break;
467 case INAT_IMM_WORD:
468 insn->immediate.value = get_next(short, insn);
469 insn->immediate.nbytes = 2;
470 break;
471 case INAT_IMM_DWORD:
472 insn->immediate.value = get_next(int, insn);
473 insn->immediate.nbytes = 4;
474 break;
475 case INAT_IMM_QWORD:
476 insn->immediate1.value = get_next(int, insn);
477 insn->immediate1.nbytes = 4;
478 insn->immediate2.value = get_next(int, insn);
479 insn->immediate2.nbytes = 4;
480 break;
481 case INAT_IMM_PTR:
482 __get_immptr(insn);
483 break;
484 case INAT_IMM_VWORD32:
485 __get_immv32(insn);
486 break;
487 case INAT_IMM_VWORD:
488 __get_immv(insn);
489 break;
490 default:
491 break;
492 }
493 if (inat_has_second_immediate(insn->attr)) {
494 insn->immediate2.value = get_next(char, insn);
495 insn->immediate2.nbytes = 1;
496 }
497done:
498 insn->immediate.got = 1;
499}
500
501/**
502 * insn_get_length() - Get the length of instruction
503 * @insn: &struct insn containing instruction
504 *
505 * If necessary, first collects the instruction up to and including the
506 * immediates bytes.
507 */
508void insn_get_length(struct insn *insn)
509{
510 if (insn->length)
511 return;
512 if (!insn->immediate.got)
513 insn_get_immediate(insn);
514 insn->length = (unsigned char)((unsigned long)insn->next_byte
515 - (unsigned long)insn->kaddr);
516}
diff --git a/arch/x86/lib/msr.c b/arch/x86/lib/msr.c
index 33a1e3ca22d8..41628b104b9e 100644
--- a/arch/x86/lib/msr.c
+++ b/arch/x86/lib/msr.c
@@ -71,14 +71,9 @@ int wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h)
71} 71}
72EXPORT_SYMBOL(wrmsr_on_cpu); 72EXPORT_SYMBOL(wrmsr_on_cpu);
73 73
74/* rdmsr on a bunch of CPUs 74static void __rwmsr_on_cpus(const struct cpumask *mask, u32 msr_no,
75 * 75 struct msr *msrs,
76 * @mask: which CPUs 76 void (*msr_func) (void *info))
77 * @msr_no: which MSR
78 * @msrs: array of MSR values
79 *
80 */
81void rdmsr_on_cpus(const cpumask_t *mask, u32 msr_no, struct msr *msrs)
82{ 77{
83 struct msr_info rv; 78 struct msr_info rv;
84 int this_cpu; 79 int this_cpu;
@@ -92,11 +87,23 @@ void rdmsr_on_cpus(const cpumask_t *mask, u32 msr_no, struct msr *msrs)
92 this_cpu = get_cpu(); 87 this_cpu = get_cpu();
93 88
94 if (cpumask_test_cpu(this_cpu, mask)) 89 if (cpumask_test_cpu(this_cpu, mask))
95 __rdmsr_on_cpu(&rv); 90 msr_func(&rv);
96 91
97 smp_call_function_many(mask, __rdmsr_on_cpu, &rv, 1); 92 smp_call_function_many(mask, msr_func, &rv, 1);
98 put_cpu(); 93 put_cpu();
99} 94}
95
96/* rdmsr on a bunch of CPUs
97 *
98 * @mask: which CPUs
99 * @msr_no: which MSR
100 * @msrs: array of MSR values
101 *
102 */
103void rdmsr_on_cpus(const struct cpumask *mask, u32 msr_no, struct msr *msrs)
104{
105 __rwmsr_on_cpus(mask, msr_no, msrs, __rdmsr_on_cpu);
106}
100EXPORT_SYMBOL(rdmsr_on_cpus); 107EXPORT_SYMBOL(rdmsr_on_cpus);
101 108
102/* 109/*
@@ -107,24 +114,9 @@ EXPORT_SYMBOL(rdmsr_on_cpus);
107 * @msrs: array of MSR values 114 * @msrs: array of MSR values
108 * 115 *
109 */ 116 */
110void wrmsr_on_cpus(const cpumask_t *mask, u32 msr_no, struct msr *msrs) 117void wrmsr_on_cpus(const struct cpumask *mask, u32 msr_no, struct msr *msrs)
111{ 118{
112 struct msr_info rv; 119 __rwmsr_on_cpus(mask, msr_no, msrs, __wrmsr_on_cpu);
113 int this_cpu;
114
115 memset(&rv, 0, sizeof(rv));
116
117 rv.off = cpumask_first(mask);
118 rv.msrs = msrs;
119 rv.msr_no = msr_no;
120
121 this_cpu = get_cpu();
122
123 if (cpumask_test_cpu(this_cpu, mask))
124 __wrmsr_on_cpu(&rv);
125
126 smp_call_function_many(mask, __wrmsr_on_cpu, &rv, 1);
127 put_cpu();
128} 120}
129EXPORT_SYMBOL(wrmsr_on_cpus); 121EXPORT_SYMBOL(wrmsr_on_cpus);
130 122
diff --git a/arch/x86/lib/usercopy_32.c b/arch/x86/lib/usercopy_32.c
index 1f118d462acc..e218d5df85ff 100644
--- a/arch/x86/lib/usercopy_32.c
+++ b/arch/x86/lib/usercopy_32.c
@@ -874,7 +874,7 @@ EXPORT_SYMBOL(copy_to_user);
874 * data to the requested size using zero bytes. 874 * data to the requested size using zero bytes.
875 */ 875 */
876unsigned long 876unsigned long
877copy_from_user(void *to, const void __user *from, unsigned long n) 877_copy_from_user(void *to, const void __user *from, unsigned long n)
878{ 878{
879 if (access_ok(VERIFY_READ, from, n)) 879 if (access_ok(VERIFY_READ, from, n))
880 n = __copy_from_user(to, from, n); 880 n = __copy_from_user(to, from, n);
@@ -882,4 +882,10 @@ copy_from_user(void *to, const void __user *from, unsigned long n)
882 memset(to, 0, n); 882 memset(to, 0, n);
883 return n; 883 return n;
884} 884}
885EXPORT_SYMBOL(copy_from_user); 885EXPORT_SYMBOL(_copy_from_user);
886
887void copy_from_user_overflow(void)
888{
889 WARN(1, "Buffer overflow detected!\n");
890}
891EXPORT_SYMBOL(copy_from_user_overflow);
diff --git a/arch/x86/lib/x86-opcode-map.txt b/arch/x86/lib/x86-opcode-map.txt
new file mode 100644
index 000000000000..a793da5e560e
--- /dev/null
+++ b/arch/x86/lib/x86-opcode-map.txt
@@ -0,0 +1,893 @@
1# x86 Opcode Maps
2#
3#<Opcode maps>
4# Table: table-name
5# Referrer: escaped-name
6# AVXcode: avx-code
7# opcode: mnemonic|GrpXXX [operand1[,operand2...]] [(extra1)[,(extra2)...] [| 2nd-mnemonic ...]
8# (or)
9# opcode: escape # escaped-name
10# EndTable
11#
12#<group maps>
13# GrpTable: GrpXXX
14# reg: mnemonic [operand1[,operand2...]] [(extra1)[,(extra2)...] [| 2nd-mnemonic ...]
15# EndTable
16#
17# AVX Superscripts
18# (VEX): this opcode can accept VEX prefix.
19# (oVEX): this opcode requires VEX prefix.
20# (o128): this opcode only supports 128bit VEX.
21# (o256): this opcode only supports 256bit VEX.
22#
23
24Table: one byte opcode
25Referrer:
26AVXcode:
27# 0x00 - 0x0f
2800: ADD Eb,Gb
2901: ADD Ev,Gv
3002: ADD Gb,Eb
3103: ADD Gv,Ev
3204: ADD AL,Ib
3305: ADD rAX,Iz
3406: PUSH ES (i64)
3507: POP ES (i64)
3608: OR Eb,Gb
3709: OR Ev,Gv
380a: OR Gb,Eb
390b: OR Gv,Ev
400c: OR AL,Ib
410d: OR rAX,Iz
420e: PUSH CS (i64)
430f: escape # 2-byte escape
44# 0x10 - 0x1f
4510: ADC Eb,Gb
4611: ADC Ev,Gv
4712: ADC Gb,Eb
4813: ADC Gv,Ev
4914: ADC AL,Ib
5015: ADC rAX,Iz
5116: PUSH SS (i64)
5217: POP SS (i64)
5318: SBB Eb,Gb
5419: SBB Ev,Gv
551a: SBB Gb,Eb
561b: SBB Gv,Ev
571c: SBB AL,Ib
581d: SBB rAX,Iz
591e: PUSH DS (i64)
601f: POP DS (i64)
61# 0x20 - 0x2f
6220: AND Eb,Gb
6321: AND Ev,Gv
6422: AND Gb,Eb
6523: AND Gv,Ev
6624: AND AL,Ib
6725: AND rAx,Iz
6826: SEG=ES (Prefix)
6927: DAA (i64)
7028: SUB Eb,Gb
7129: SUB Ev,Gv
722a: SUB Gb,Eb
732b: SUB Gv,Ev
742c: SUB AL,Ib
752d: SUB rAX,Iz
762e: SEG=CS (Prefix)
772f: DAS (i64)
78# 0x30 - 0x3f
7930: XOR Eb,Gb
8031: XOR Ev,Gv
8132: XOR Gb,Eb
8233: XOR Gv,Ev
8334: XOR AL,Ib
8435: XOR rAX,Iz
8536: SEG=SS (Prefix)
8637: AAA (i64)
8738: CMP Eb,Gb
8839: CMP Ev,Gv
893a: CMP Gb,Eb
903b: CMP Gv,Ev
913c: CMP AL,Ib
923d: CMP rAX,Iz
933e: SEG=DS (Prefix)
943f: AAS (i64)
95# 0x40 - 0x4f
9640: INC eAX (i64) | REX (o64)
9741: INC eCX (i64) | REX.B (o64)
9842: INC eDX (i64) | REX.X (o64)
9943: INC eBX (i64) | REX.XB (o64)
10044: INC eSP (i64) | REX.R (o64)
10145: INC eBP (i64) | REX.RB (o64)
10246: INC eSI (i64) | REX.RX (o64)
10347: INC eDI (i64) | REX.RXB (o64)
10448: DEC eAX (i64) | REX.W (o64)
10549: DEC eCX (i64) | REX.WB (o64)
1064a: DEC eDX (i64) | REX.WX (o64)
1074b: DEC eBX (i64) | REX.WXB (o64)
1084c: DEC eSP (i64) | REX.WR (o64)
1094d: DEC eBP (i64) | REX.WRB (o64)
1104e: DEC eSI (i64) | REX.WRX (o64)
1114f: DEC eDI (i64) | REX.WRXB (o64)
112# 0x50 - 0x5f
11350: PUSH rAX/r8 (d64)
11451: PUSH rCX/r9 (d64)
11552: PUSH rDX/r10 (d64)
11653: PUSH rBX/r11 (d64)
11754: PUSH rSP/r12 (d64)
11855: PUSH rBP/r13 (d64)
11956: PUSH rSI/r14 (d64)
12057: PUSH rDI/r15 (d64)
12158: POP rAX/r8 (d64)
12259: POP rCX/r9 (d64)
1235a: POP rDX/r10 (d64)
1245b: POP rBX/r11 (d64)
1255c: POP rSP/r12 (d64)
1265d: POP rBP/r13 (d64)
1275e: POP rSI/r14 (d64)
1285f: POP rDI/r15 (d64)
129# 0x60 - 0x6f
13060: PUSHA/PUSHAD (i64)
13161: POPA/POPAD (i64)
13262: BOUND Gv,Ma (i64)
13363: ARPL Ew,Gw (i64) | MOVSXD Gv,Ev (o64)
13464: SEG=FS (Prefix)
13565: SEG=GS (Prefix)
13666: Operand-Size (Prefix)
13767: Address-Size (Prefix)
13868: PUSH Iz (d64)
13969: IMUL Gv,Ev,Iz
1406a: PUSH Ib (d64)
1416b: IMUL Gv,Ev,Ib
1426c: INS/INSB Yb,DX
1436d: INS/INSW/INSD Yz,DX
1446e: OUTS/OUTSB DX,Xb
1456f: OUTS/OUTSW/OUTSD DX,Xz
146# 0x70 - 0x7f
14770: JO Jb
14871: JNO Jb
14972: JB/JNAE/JC Jb
15073: JNB/JAE/JNC Jb
15174: JZ/JE Jb
15275: JNZ/JNE Jb
15376: JBE/JNA Jb
15477: JNBE/JA Jb
15578: JS Jb
15679: JNS Jb
1577a: JP/JPE Jb
1587b: JNP/JPO Jb
1597c: JL/JNGE Jb
1607d: JNL/JGE Jb
1617e: JLE/JNG Jb
1627f: JNLE/JG Jb
163# 0x80 - 0x8f
16480: Grp1 Eb,Ib (1A)
16581: Grp1 Ev,Iz (1A)
16682: Grp1 Eb,Ib (1A),(i64)
16783: Grp1 Ev,Ib (1A)
16884: TEST Eb,Gb
16985: TEST Ev,Gv
17086: XCHG Eb,Gb
17187: XCHG Ev,Gv
17288: MOV Eb,Gb
17389: MOV Ev,Gv
1748a: MOV Gb,Eb
1758b: MOV Gv,Ev
1768c: MOV Ev,Sw
1778d: LEA Gv,M
1788e: MOV Sw,Ew
1798f: Grp1A (1A) | POP Ev (d64)
180# 0x90 - 0x9f
18190: NOP | PAUSE (F3) | XCHG r8,rAX
18291: XCHG rCX/r9,rAX
18392: XCHG rDX/r10,rAX
18493: XCHG rBX/r11,rAX
18594: XCHG rSP/r12,rAX
18695: XCHG rBP/r13,rAX
18796: XCHG rSI/r14,rAX
18897: XCHG rDI/r15,rAX
18998: CBW/CWDE/CDQE
19099: CWD/CDQ/CQO
1919a: CALLF Ap (i64)
1929b: FWAIT/WAIT
1939c: PUSHF/D/Q Fv (d64)
1949d: POPF/D/Q Fv (d64)
1959e: SAHF
1969f: LAHF
197# 0xa0 - 0xaf
198a0: MOV AL,Ob
199a1: MOV rAX,Ov
200a2: MOV Ob,AL
201a3: MOV Ov,rAX
202a4: MOVS/B Xb,Yb
203a5: MOVS/W/D/Q Xv,Yv
204a6: CMPS/B Xb,Yb
205a7: CMPS/W/D Xv,Yv
206a8: TEST AL,Ib
207a9: TEST rAX,Iz
208aa: STOS/B Yb,AL
209ab: STOS/W/D/Q Yv,rAX
210ac: LODS/B AL,Xb
211ad: LODS/W/D/Q rAX,Xv
212ae: SCAS/B AL,Yb
213af: SCAS/W/D/Q rAX,Xv
214# 0xb0 - 0xbf
215b0: MOV AL/R8L,Ib
216b1: MOV CL/R9L,Ib
217b2: MOV DL/R10L,Ib
218b3: MOV BL/R11L,Ib
219b4: MOV AH/R12L,Ib
220b5: MOV CH/R13L,Ib
221b6: MOV DH/R14L,Ib
222b7: MOV BH/R15L,Ib
223b8: MOV rAX/r8,Iv
224b9: MOV rCX/r9,Iv
225ba: MOV rDX/r10,Iv
226bb: MOV rBX/r11,Iv
227bc: MOV rSP/r12,Iv
228bd: MOV rBP/r13,Iv
229be: MOV rSI/r14,Iv
230bf: MOV rDI/r15,Iv
231# 0xc0 - 0xcf
232c0: Grp2 Eb,Ib (1A)
233c1: Grp2 Ev,Ib (1A)
234c2: RETN Iw (f64)
235c3: RETN
236c4: LES Gz,Mp (i64) | 3bytes-VEX (Prefix)
237c5: LDS Gz,Mp (i64) | 2bytes-VEX (Prefix)
238c6: Grp11 Eb,Ib (1A)
239c7: Grp11 Ev,Iz (1A)
240c8: ENTER Iw,Ib
241c9: LEAVE (d64)
242ca: RETF Iw
243cb: RETF
244cc: INT3
245cd: INT Ib
246ce: INTO (i64)
247cf: IRET/D/Q
248# 0xd0 - 0xdf
249d0: Grp2 Eb,1 (1A)
250d1: Grp2 Ev,1 (1A)
251d2: Grp2 Eb,CL (1A)
252d3: Grp2 Ev,CL (1A)
253d4: AAM Ib (i64)
254d5: AAD Ib (i64)
255d6:
256d7: XLAT/XLATB
257d8: ESC
258d9: ESC
259da: ESC
260db: ESC
261dc: ESC
262dd: ESC
263de: ESC
264df: ESC
265# 0xe0 - 0xef
266e0: LOOPNE/LOOPNZ Jb (f64)
267e1: LOOPE/LOOPZ Jb (f64)
268e2: LOOP Jb (f64)
269e3: JrCXZ Jb (f64)
270e4: IN AL,Ib
271e5: IN eAX,Ib
272e6: OUT Ib,AL
273e7: OUT Ib,eAX
274e8: CALL Jz (f64)
275e9: JMP-near Jz (f64)
276ea: JMP-far Ap (i64)
277eb: JMP-short Jb (f64)
278ec: IN AL,DX
279ed: IN eAX,DX
280ee: OUT DX,AL
281ef: OUT DX,eAX
282# 0xf0 - 0xff
283f0: LOCK (Prefix)
284f1:
285f2: REPNE (Prefix)
286f3: REP/REPE (Prefix)
287f4: HLT
288f5: CMC
289f6: Grp3_1 Eb (1A)
290f7: Grp3_2 Ev (1A)
291f8: CLC
292f9: STC
293fa: CLI
294fb: STI
295fc: CLD
296fd: STD
297fe: Grp4 (1A)
298ff: Grp5 (1A)
299EndTable
300
301Table: 2-byte opcode (0x0f)
302Referrer: 2-byte escape
303AVXcode: 1
304# 0x0f 0x00-0x0f
30500: Grp6 (1A)
30601: Grp7 (1A)
30702: LAR Gv,Ew
30803: LSL Gv,Ew
30904:
31005: SYSCALL (o64)
31106: CLTS
31207: SYSRET (o64)
31308: INVD
31409: WBINVD
3150a:
3160b: UD2 (1B)
3170c:
3180d: NOP Ev | GrpP
3190e: FEMMS
320# 3DNow! uses the last imm byte as opcode extension.
3210f: 3DNow! Pq,Qq,Ib
322# 0x0f 0x10-0x1f
32310: movups Vps,Wps (VEX) | movss Vss,Wss (F3),(VEX),(o128) | movupd Vpd,Wpd (66),(VEX) | movsd Vsd,Wsd (F2),(VEX),(o128)
32411: movups Wps,Vps (VEX) | movss Wss,Vss (F3),(VEX),(o128) | movupd Wpd,Vpd (66),(VEX) | movsd Wsd,Vsd (F2),(VEX),(o128)
32512: movlps Vq,Mq (VEX),(o128) | movlpd Vq,Mq (66),(VEX),(o128) | movhlps Vq,Uq (VEX),(o128) | movddup Vq,Wq (F2),(VEX) | movsldup Vq,Wq (F3),(VEX)
32613: mpvlps Mq,Vq (VEX),(o128) | movlpd Mq,Vq (66),(VEX),(o128)
32714: unpcklps Vps,Wq (VEX) | unpcklpd Vpd,Wq (66),(VEX)
32815: unpckhps Vps,Wq (VEX) | unpckhpd Vpd,Wq (66),(VEX)
32916: movhps Vq,Mq (VEX),(o128) | movhpd Vq,Mq (66),(VEX),(o128) | movlsps Vq,Uq (VEX),(o128) | movshdup Vq,Wq (F3),(VEX)
33017: movhps Mq,Vq (VEX),(o128) | movhpd Mq,Vq (66),(VEX),(o128)
33118: Grp16 (1A)
33219:
3331a:
3341b:
3351c:
3361d:
3371e:
3381f: NOP Ev
339# 0x0f 0x20-0x2f
34020: MOV Rd,Cd
34121: MOV Rd,Dd
34222: MOV Cd,Rd
34323: MOV Dd,Rd
34424:
34525:
34626:
34727:
34828: movaps Vps,Wps (VEX) | movapd Vpd,Wpd (66),(VEX)
34929: movaps Wps,Vps (VEX) | movapd Wpd,Vpd (66),(VEX)
3502a: cvtpi2ps Vps,Qpi | cvtsi2ss Vss,Ed/q (F3),(VEX),(o128) | cvtpi2pd Vpd,Qpi (66) | cvtsi2sd Vsd,Ed/q (F2),(VEX),(o128)
3512b: movntps Mps,Vps (VEX) | movntpd Mpd,Vpd (66),(VEX)
3522c: cvttps2pi Ppi,Wps | cvttss2si Gd/q,Wss (F3),(VEX),(o128) | cvttpd2pi Ppi,Wpd (66) | cvttsd2si Gd/q,Wsd (F2),(VEX),(o128)
3532d: cvtps2pi Ppi,Wps | cvtss2si Gd/q,Wss (F3),(VEX),(o128) | cvtpd2pi Qpi,Wpd (66) | cvtsd2si Gd/q,Wsd (F2),(VEX),(o128)
3542e: ucomiss Vss,Wss (VEX),(o128) | ucomisd Vsd,Wsd (66),(VEX),(o128)
3552f: comiss Vss,Wss (VEX),(o128) | comisd Vsd,Wsd (66),(VEX),(o128)
356# 0x0f 0x30-0x3f
35730: WRMSR
35831: RDTSC
35932: RDMSR
36033: RDPMC
36134: SYSENTER
36235: SYSEXIT
36336:
36437: GETSEC
36538: escape # 3-byte escape 1
36639:
3673a: escape # 3-byte escape 2
3683b:
3693c:
3703d:
3713e:
3723f:
373# 0x0f 0x40-0x4f
37440: CMOVO Gv,Ev
37541: CMOVNO Gv,Ev
37642: CMOVB/C/NAE Gv,Ev
37743: CMOVAE/NB/NC Gv,Ev
37844: CMOVE/Z Gv,Ev
37945: CMOVNE/NZ Gv,Ev
38046: CMOVBE/NA Gv,Ev
38147: CMOVA/NBE Gv,Ev
38248: CMOVS Gv,Ev
38349: CMOVNS Gv,Ev
3844a: CMOVP/PE Gv,Ev
3854b: CMOVNP/PO Gv,Ev
3864c: CMOVL/NGE Gv,Ev
3874d: CMOVNL/GE Gv,Ev
3884e: CMOVLE/NG Gv,Ev
3894f: CMOVNLE/G Gv,Ev
390# 0x0f 0x50-0x5f
39150: movmskps Gd/q,Ups (VEX) | movmskpd Gd/q,Upd (66),(VEX)
39251: sqrtps Vps,Wps (VEX) | sqrtss Vss,Wss (F3),(VEX),(o128) | sqrtpd Vpd,Wpd (66),(VEX) | sqrtsd Vsd,Wsd (F2),(VEX),(o128)
39352: rsqrtps Vps,Wps (VEX) | rsqrtss Vss,Wss (F3),(VEX),(o128)
39453: rcpps Vps,Wps (VEX) | rcpss Vss,Wss (F3),(VEX),(o128)
39554: andps Vps,Wps (VEX) | andpd Vpd,Wpd (66),(VEX)
39655: andnps Vps,Wps (VEX) | andnpd Vpd,Wpd (66),(VEX)
39756: orps Vps,Wps (VEX) | orpd Vpd,Wpd (66),(VEX)
39857: xorps Vps,Wps (VEX) | xorpd Vpd,Wpd (66),(VEX)
39958: addps Vps,Wps (VEX) | addss Vss,Wss (F3),(VEX),(o128) | addpd Vpd,Wpd (66),(VEX) | addsd Vsd,Wsd (F2),(VEX),(o128)
40059: mulps Vps,Wps (VEX) | mulss Vss,Wss (F3),(VEX),(o128) | mulpd Vpd,Wpd (66),(VEX) | mulsd Vsd,Wsd (F2),(VEX),(o128)
4015a: cvtps2pd Vpd,Wps (VEX) | cvtss2sd Vsd,Wss (F3),(VEX),(o128) | cvtpd2ps Vps,Wpd (66),(VEX) | cvtsd2ss Vsd,Wsd (F2),(VEX),(o128)
4025b: cvtdq2ps Vps,Wdq (VEX) | cvtps2dq Vdq,Wps (66),(VEX) | cvttps2dq Vdq,Wps (F3),(VEX)
4035c: subps Vps,Wps (VEX) | subss Vss,Wss (F3),(VEX),(o128) | subpd Vpd,Wpd (66),(VEX) | subsd Vsd,Wsd (F2),(VEX),(o128)
4045d: minps Vps,Wps (VEX) | minss Vss,Wss (F3),(VEX),(o128) | minpd Vpd,Wpd (66),(VEX) | minsd Vsd,Wsd (F2),(VEX),(o128)
4055e: divps Vps,Wps (VEX) | divss Vss,Wss (F3),(VEX),(o128) | divpd Vpd,Wpd (66),(VEX) | divsd Vsd,Wsd (F2),(VEX),(o128)
4065f: maxps Vps,Wps (VEX) | maxss Vss,Wss (F3),(VEX),(o128) | maxpd Vpd,Wpd (66),(VEX) | maxsd Vsd,Wsd (F2),(VEX),(o128)
407# 0x0f 0x60-0x6f
40860: punpcklbw Pq,Qd | punpcklbw Vdq,Wdq (66),(VEX),(o128)
40961: punpcklwd Pq,Qd | punpcklwd Vdq,Wdq (66),(VEX),(o128)
41062: punpckldq Pq,Qd | punpckldq Vdq,Wdq (66),(VEX),(o128)
41163: packsswb Pq,Qq | packsswb Vdq,Wdq (66),(VEX),(o128)
41264: pcmpgtb Pq,Qq | pcmpgtb Vdq,Wdq (66),(VEX),(o128)
41365: pcmpgtw Pq,Qq | pcmpgtw Vdq,Wdq (66),(VEX),(o128)
41466: pcmpgtd Pq,Qq | pcmpgtd Vdq,Wdq (66),(VEX),(o128)
41567: packuswb Pq,Qq | packuswb Vdq,Wdq (66),(VEX),(o128)
41668: punpckhbw Pq,Qd | punpckhbw Vdq,Wdq (66),(VEX),(o128)
41769: punpckhwd Pq,Qd | punpckhwd Vdq,Wdq (66),(VEX),(o128)
4186a: punpckhdq Pq,Qd | punpckhdq Vdq,Wdq (66),(VEX),(o128)
4196b: packssdw Pq,Qd | packssdw Vdq,Wdq (66),(VEX),(o128)
4206c: punpcklqdq Vdq,Wdq (66),(VEX),(o128)
4216d: punpckhqdq Vdq,Wdq (66),(VEX),(o128)
4226e: movd/q/ Pd,Ed/q | movd/q Vdq,Ed/q (66),(VEX),(o128)
4236f: movq Pq,Qq | movdqa Vdq,Wdq (66),(VEX) | movdqu Vdq,Wdq (F3),(VEX)
424# 0x0f 0x70-0x7f
42570: pshufw Pq,Qq,Ib | pshufd Vdq,Wdq,Ib (66),(VEX),(o128) | pshufhw Vdq,Wdq,Ib (F3),(VEX),(o128) | pshuflw VdqWdq,Ib (F2),(VEX),(o128)
42671: Grp12 (1A)
42772: Grp13 (1A)
42873: Grp14 (1A)
42974: pcmpeqb Pq,Qq | pcmpeqb Vdq,Wdq (66),(VEX),(o128)
43075: pcmpeqw Pq,Qq | pcmpeqw Vdq,Wdq (66),(VEX),(o128)
43176: pcmpeqd Pq,Qq | pcmpeqd Vdq,Wdq (66),(VEX),(o128)
43277: emms/vzeroupper/vzeroall (VEX)
43378: VMREAD Ed/q,Gd/q
43479: VMWRITE Gd/q,Ed/q
4357a:
4367b:
4377c: haddps Vps,Wps (F2),(VEX) | haddpd Vpd,Wpd (66),(VEX)
4387d: hsubps Vps,Wps (F2),(VEX) | hsubpd Vpd,Wpd (66),(VEX)
4397e: movd/q Ed/q,Pd | movd/q Ed/q,Vdq (66),(VEX),(o128) | movq Vq,Wq (F3),(VEX),(o128)
4407f: movq Qq,Pq | movdqa Wdq,Vdq (66),(VEX) | movdqu Wdq,Vdq (F3),(VEX)
441# 0x0f 0x80-0x8f
44280: JO Jz (f64)
44381: JNO Jz (f64)
44482: JB/JNAE/JC Jz (f64)
44583: JNB/JAE/JNC Jz (f64)
44684: JZ/JE Jz (f64)
44785: JNZ/JNE Jz (f64)
44886: JBE/JNA Jz (f64)
44987: JNBE/JA Jz (f64)
45088: JS Jz (f64)
45189: JNS Jz (f64)
4528a: JP/JPE Jz (f64)
4538b: JNP/JPO Jz (f64)
4548c: JL/JNGE Jz (f64)
4558d: JNL/JGE Jz (f64)
4568e: JLE/JNG Jz (f64)
4578f: JNLE/JG Jz (f64)
458# 0x0f 0x90-0x9f
45990: SETO Eb
46091: SETNO Eb
46192: SETB/C/NAE Eb
46293: SETAE/NB/NC Eb
46394: SETE/Z Eb
46495: SETNE/NZ Eb
46596: SETBE/NA Eb
46697: SETA/NBE Eb
46798: SETS Eb
46899: SETNS Eb
4699a: SETP/PE Eb
4709b: SETNP/PO Eb
4719c: SETL/NGE Eb
4729d: SETNL/GE Eb
4739e: SETLE/NG Eb
4749f: SETNLE/G Eb
475# 0x0f 0xa0-0xaf
476a0: PUSH FS (d64)
477a1: POP FS (d64)
478a2: CPUID
479a3: BT Ev,Gv
480a4: SHLD Ev,Gv,Ib
481a5: SHLD Ev,Gv,CL
482a6: GrpPDLK
483a7: GrpRNG
484a8: PUSH GS (d64)
485a9: POP GS (d64)
486aa: RSM
487ab: BTS Ev,Gv
488ac: SHRD Ev,Gv,Ib
489ad: SHRD Ev,Gv,CL
490ae: Grp15 (1A),(1C)
491af: IMUL Gv,Ev
492# 0x0f 0xb0-0xbf
493b0: CMPXCHG Eb,Gb
494b1: CMPXCHG Ev,Gv
495b2: LSS Gv,Mp
496b3: BTR Ev,Gv
497b4: LFS Gv,Mp
498b5: LGS Gv,Mp
499b6: MOVZX Gv,Eb
500b7: MOVZX Gv,Ew
501b8: JMPE | POPCNT Gv,Ev (F3)
502b9: Grp10 (1A)
503ba: Grp8 Ev,Ib (1A)
504bb: BTC Ev,Gv
505bc: BSF Gv,Ev
506bd: BSR Gv,Ev
507be: MOVSX Gv,Eb
508bf: MOVSX Gv,Ew
509# 0x0f 0xc0-0xcf
510c0: XADD Eb,Gb
511c1: XADD Ev,Gv
512c2: cmpps Vps,Wps,Ib (VEX) | cmpss Vss,Wss,Ib (F3),(VEX),(o128) | cmppd Vpd,Wpd,Ib (66),(VEX) | cmpsd Vsd,Wsd,Ib (F2),(VEX)
513c3: movnti Md/q,Gd/q
514c4: pinsrw Pq,Rd/q/Mw,Ib | pinsrw Vdq,Rd/q/Mw,Ib (66),(VEX),(o128)
515c5: pextrw Gd,Nq,Ib | pextrw Gd,Udq,Ib (66),(VEX),(o128)
516c6: shufps Vps,Wps,Ib (VEX) | shufpd Vpd,Wpd,Ib (66),(VEX)
517c7: Grp9 (1A)
518c8: BSWAP RAX/EAX/R8/R8D
519c9: BSWAP RCX/ECX/R9/R9D
520ca: BSWAP RDX/EDX/R10/R10D
521cb: BSWAP RBX/EBX/R11/R11D
522cc: BSWAP RSP/ESP/R12/R12D
523cd: BSWAP RBP/EBP/R13/R13D
524ce: BSWAP RSI/ESI/R14/R14D
525cf: BSWAP RDI/EDI/R15/R15D
526# 0x0f 0xd0-0xdf
527d0: addsubps Vps,Wps (F2),(VEX) | addsubpd Vpd,Wpd (66),(VEX)
528d1: psrlw Pq,Qq | psrlw Vdq,Wdq (66),(VEX),(o128)
529d2: psrld Pq,Qq | psrld Vdq,Wdq (66),(VEX),(o128)
530d3: psrlq Pq,Qq | psrlq Vdq,Wdq (66),(VEX),(o128)
531d4: paddq Pq,Qq | paddq Vdq,Wdq (66),(VEX),(o128)
532d5: pmullw Pq,Qq | pmullw Vdq,Wdq (66),(VEX),(o128)
533d6: movq Wq,Vq (66),(VEX),(o128) | movq2dq Vdq,Nq (F3) | movdq2q Pq,Uq (F2)
534d7: pmovmskb Gd,Nq | pmovmskb Gd,Udq (66),(VEX),(o128)
535d8: psubusb Pq,Qq | psubusb Vdq,Wdq (66),(VEX),(o128)
536d9: psubusw Pq,Qq | psubusw Vdq,Wdq (66),(VEX),(o128)
537da: pminub Pq,Qq | pminub Vdq,Wdq (66),(VEX),(o128)
538db: pand Pq,Qq | pand Vdq,Wdq (66),(VEX),(o128)
539dc: paddusb Pq,Qq | paddusb Vdq,Wdq (66),(VEX),(o128)
540dd: paddusw Pq,Qq | paddusw Vdq,Wdq (66),(VEX),(o128)
541de: pmaxub Pq,Qq | pmaxub Vdq,Wdq (66),(VEX),(o128)
542df: pandn Pq,Qq | pandn Vdq,Wdq (66),(VEX),(o128)
543# 0x0f 0xe0-0xef
544e0: pavgb Pq,Qq | pavgb Vdq,Wdq (66),(VEX),(o128)
545e1: psraw Pq,Qq | psraw Vdq,Wdq (66),(VEX),(o128)
546e2: psrad Pq,Qq | psrad Vdq,Wdq (66),(VEX),(o128)
547e3: pavgw Pq,Qq | pavgw Vdq,Wdq (66),(VEX),(o128)
548e4: pmulhuw Pq,Qq | pmulhuw Vdq,Wdq (66),(VEX),(o128)
549e5: pmulhw Pq,Qq | pmulhw Vdq,Wdq (66),(VEX),(o128)
550e6: cvtpd2dq Vdq,Wpd (F2),(VEX) | cvttpd2dq Vdq,Wpd (66),(VEX) | cvtdq2pd Vpd,Wdq (F3),(VEX)
551e7: movntq Mq,Pq | movntdq Mdq,Vdq (66),(VEX)
552e8: psubsb Pq,Qq | psubsb Vdq,Wdq (66),(VEX),(o128)
553e9: psubsw Pq,Qq | psubsw Vdq,Wdq (66),(VEX),(o128)
554ea: pminsw Pq,Qq | pminsw Vdq,Wdq (66),(VEX),(o128)
555eb: por Pq,Qq | por Vdq,Wdq (66),(VEX),(o128)
556ec: paddsb Pq,Qq | paddsb Vdq,Wdq (66),(VEX),(o128)
557ed: paddsw Pq,Qq | paddsw Vdq,Wdq (66),(VEX),(o128)
558ee: pmaxsw Pq,Qq | pmaxsw Vdq,Wdq (66),(VEX),(o128)
559ef: pxor Pq,Qq | pxor Vdq,Wdq (66),(VEX),(o128)
560# 0x0f 0xf0-0xff
561f0: lddqu Vdq,Mdq (F2),(VEX)
562f1: psllw Pq,Qq | psllw Vdq,Wdq (66),(VEX),(o128)
563f2: pslld Pq,Qq | pslld Vdq,Wdq (66),(VEX),(o128)
564f3: psllq Pq,Qq | psllq Vdq,Wdq (66),(VEX),(o128)
565f4: pmuludq Pq,Qq | pmuludq Vdq,Wdq (66),(VEX),(o128)
566f5: pmaddwd Pq,Qq | pmaddwd Vdq,Wdq (66),(VEX),(o128)
567f6: psadbw Pq,Qq | psadbw Vdq,Wdq (66),(VEX),(o128)
568f7: maskmovq Pq,Nq | maskmovdqu Vdq,Udq (66),(VEX),(o128)
569f8: psubb Pq,Qq | psubb Vdq,Wdq (66),(VEX),(o128)
570f9: psubw Pq,Qq | psubw Vdq,Wdq (66),(VEX),(o128)
571fa: psubd Pq,Qq | psubd Vdq,Wdq (66),(VEX),(o128)
572fb: psubq Pq,Qq | psubq Vdq,Wdq (66),(VEX),(o128)
573fc: paddb Pq,Qq | paddb Vdq,Wdq (66),(VEX),(o128)
574fd: paddw Pq,Qq | paddw Vdq,Wdq (66),(VEX),(o128)
575fe: paddd Pq,Qq | paddd Vdq,Wdq (66),(VEX),(o128)
576ff:
577EndTable
578
579Table: 3-byte opcode 1 (0x0f 0x38)
580Referrer: 3-byte escape 1
581AVXcode: 2
582# 0x0f 0x38 0x00-0x0f
58300: pshufb Pq,Qq | pshufb Vdq,Wdq (66),(VEX),(o128)
58401: phaddw Pq,Qq | phaddw Vdq,Wdq (66),(VEX),(o128)
58502: phaddd Pq,Qq | phaddd Vdq,Wdq (66),(VEX),(o128)
58603: phaddsw Pq,Qq | phaddsw Vdq,Wdq (66),(VEX),(o128)
58704: pmaddubsw Pq,Qq | pmaddubsw Vdq,Wdq (66),(VEX),(o128)
58805: phsubw Pq,Qq | phsubw Vdq,Wdq (66),(VEX),(o128)
58906: phsubd Pq,Qq | phsubd Vdq,Wdq (66),(VEX),(o128)
59007: phsubsw Pq,Qq | phsubsw Vdq,Wdq (66),(VEX),(o128)
59108: psignb Pq,Qq | psignb Vdq,Wdq (66),(VEX),(o128)
59209: psignw Pq,Qq | psignw Vdq,Wdq (66),(VEX),(o128)
5930a: psignd Pq,Qq | psignd Vdq,Wdq (66),(VEX),(o128)
5940b: pmulhrsw Pq,Qq | pmulhrsw Vdq,Wdq (66),(VEX),(o128)
5950c: Vpermilps /r (66),(oVEX)
5960d: Vpermilpd /r (66),(oVEX)
5970e: vtestps /r (66),(oVEX)
5980f: vtestpd /r (66),(oVEX)
599# 0x0f 0x38 0x10-0x1f
60010: pblendvb Vdq,Wdq (66)
60111:
60212:
60313:
60414: blendvps Vdq,Wdq (66)
60515: blendvpd Vdq,Wdq (66)
60616:
60717: ptest Vdq,Wdq (66),(VEX)
60818: vbroadcastss /r (66),(oVEX)
60919: vbroadcastsd /r (66),(oVEX),(o256)
6101a: vbroadcastf128 /r (66),(oVEX),(o256)
6111b:
6121c: pabsb Pq,Qq | pabsb Vdq,Wdq (66),(VEX),(o128)
6131d: pabsw Pq,Qq | pabsw Vdq,Wdq (66),(VEX),(o128)
6141e: pabsd Pq,Qq | pabsd Vdq,Wdq (66),(VEX),(o128)
6151f:
616# 0x0f 0x38 0x20-0x2f
61720: pmovsxbw Vdq,Udq/Mq (66),(VEX),(o128)
61821: pmovsxbd Vdq,Udq/Md (66),(VEX),(o128)
61922: pmovsxbq Vdq,Udq/Mw (66),(VEX),(o128)
62023: pmovsxwd Vdq,Udq/Mq (66),(VEX),(o128)
62124: pmovsxwq Vdq,Udq/Md (66),(VEX),(o128)
62225: pmovsxdq Vdq,Udq/Mq (66),(VEX),(o128)
62326:
62427:
62528: pmuldq Vdq,Wdq (66),(VEX),(o128)
62629: pcmpeqq Vdq,Wdq (66),(VEX),(o128)
6272a: movntdqa Vdq,Mdq (66),(VEX),(o128)
6282b: packusdw Vdq,Wdq (66),(VEX),(o128)
6292c: vmaskmovps(ld) /r (66),(oVEX)
6302d: vmaskmovpd(ld) /r (66),(oVEX)
6312e: vmaskmovps(st) /r (66),(oVEX)
6322f: vmaskmovpd(st) /r (66),(oVEX)
633# 0x0f 0x38 0x30-0x3f
63430: pmovzxbw Vdq,Udq/Mq (66),(VEX),(o128)
63531: pmovzxbd Vdq,Udq/Md (66),(VEX),(o128)
63632: pmovzxbq Vdq,Udq/Mw (66),(VEX),(o128)
63733: pmovzxwd Vdq,Udq/Mq (66),(VEX),(o128)
63834: pmovzxwq Vdq,Udq/Md (66),(VEX),(o128)
63935: pmovzxdq Vdq,Udq/Mq (66),(VEX),(o128)
64036:
64137: pcmpgtq Vdq,Wdq (66),(VEX),(o128)
64238: pminsb Vdq,Wdq (66),(VEX),(o128)
64339: pminsd Vdq,Wdq (66),(VEX),(o128)
6443a: pminuw Vdq,Wdq (66),(VEX),(o128)
6453b: pminud Vdq,Wdq (66),(VEX),(o128)
6463c: pmaxsb Vdq,Wdq (66),(VEX),(o128)
6473d: pmaxsd Vdq,Wdq (66),(VEX),(o128)
6483e: pmaxuw Vdq,Wdq (66),(VEX),(o128)
6493f: pmaxud Vdq,Wdq (66),(VEX),(o128)
650# 0x0f 0x38 0x40-0x8f
65140: pmulld Vdq,Wdq (66),(VEX),(o128)
65241: phminposuw Vdq,Wdq (66),(VEX),(o128)
65380: INVEPT Gd/q,Mdq (66)
65481: INVPID Gd/q,Mdq (66)
655# 0x0f 0x38 0x90-0xbf (FMA)
65696: vfmaddsub132pd/ps /r (66),(VEX)
65797: vfmsubadd132pd/ps /r (66),(VEX)
65898: vfmadd132pd/ps /r (66),(VEX)
65999: vfmadd132sd/ss /r (66),(VEX),(o128)
6609a: vfmsub132pd/ps /r (66),(VEX)
6619b: vfmsub132sd/ss /r (66),(VEX),(o128)
6629c: vfnmadd132pd/ps /r (66),(VEX)
6639d: vfnmadd132sd/ss /r (66),(VEX),(o128)
6649e: vfnmsub132pd/ps /r (66),(VEX)
6659f: vfnmsub132sd/ss /r (66),(VEX),(o128)
666a6: vfmaddsub213pd/ps /r (66),(VEX)
667a7: vfmsubadd213pd/ps /r (66),(VEX)
668a8: vfmadd213pd/ps /r (66),(VEX)
669a9: vfmadd213sd/ss /r (66),(VEX),(o128)
670aa: vfmsub213pd/ps /r (66),(VEX)
671ab: vfmsub213sd/ss /r (66),(VEX),(o128)
672ac: vfnmadd213pd/ps /r (66),(VEX)
673ad: vfnmadd213sd/ss /r (66),(VEX),(o128)
674ae: vfnmsub213pd/ps /r (66),(VEX)
675af: vfnmsub213sd/ss /r (66),(VEX),(o128)
676b6: vfmaddsub231pd/ps /r (66),(VEX)
677b7: vfmsubadd231pd/ps /r (66),(VEX)
678b8: vfmadd231pd/ps /r (66),(VEX)
679b9: vfmadd231sd/ss /r (66),(VEX),(o128)
680ba: vfmsub231pd/ps /r (66),(VEX)
681bb: vfmsub231sd/ss /r (66),(VEX),(o128)
682bc: vfnmadd231pd/ps /r (66),(VEX)
683bd: vfnmadd231sd/ss /r (66),(VEX),(o128)
684be: vfnmsub231pd/ps /r (66),(VEX)
685bf: vfnmsub231sd/ss /r (66),(VEX),(o128)
686# 0x0f 0x38 0xc0-0xff
687db: aesimc Vdq,Wdq (66),(VEX),(o128)
688dc: aesenc Vdq,Wdq (66),(VEX),(o128)
689dd: aesenclast Vdq,Wdq (66),(VEX),(o128)
690de: aesdec Vdq,Wdq (66),(VEX),(o128)
691df: aesdeclast Vdq,Wdq (66),(VEX),(o128)
692f0: MOVBE Gv,Mv | CRC32 Gd,Eb (F2)
693f1: MOVBE Mv,Gv | CRC32 Gd,Ev (F2)
694EndTable
695
696Table: 3-byte opcode 2 (0x0f 0x3a)
697Referrer: 3-byte escape 2
698AVXcode: 3
699# 0x0f 0x3a 0x00-0xff
70004: vpermilps /r,Ib (66),(oVEX)
70105: vpermilpd /r,Ib (66),(oVEX)
70206: vperm2f128 /r,Ib (66),(oVEX),(o256)
70308: roundps Vdq,Wdq,Ib (66),(VEX)
70409: roundpd Vdq,Wdq,Ib (66),(VEX)
7050a: roundss Vss,Wss,Ib (66),(VEX),(o128)
7060b: roundsd Vsd,Wsd,Ib (66),(VEX),(o128)
7070c: blendps Vdq,Wdq,Ib (66),(VEX)
7080d: blendpd Vdq,Wdq,Ib (66),(VEX)
7090e: pblendw Vdq,Wdq,Ib (66),(VEX),(o128)
7100f: palignr Pq,Qq,Ib | palignr Vdq,Wdq,Ib (66),(VEX),(o128)
71114: pextrb Rd/Mb,Vdq,Ib (66),(VEX),(o128)
71215: pextrw Rd/Mw,Vdq,Ib (66),(VEX),(o128)
71316: pextrd/pextrq Ed/q,Vdq,Ib (66),(VEX),(o128)
71417: extractps Ed,Vdq,Ib (66),(VEX),(o128)
71518: vinsertf128 /r,Ib (66),(oVEX),(o256)
71619: vextractf128 /r,Ib (66),(oVEX),(o256)
71720: pinsrb Vdq,Rd/q/Mb,Ib (66),(VEX),(o128)
71821: insertps Vdq,Udq/Md,Ib (66),(VEX),(o128)
71922: pinsrd/pinsrq Vdq,Ed/q,Ib (66),(VEX),(o128)
72040: dpps Vdq,Wdq,Ib (66),(VEX)
72141: dppd Vdq,Wdq,Ib (66),(VEX),(o128)
72242: mpsadbw Vdq,Wdq,Ib (66),(VEX),(o128)
72344: pclmulq Vdq,Wdq,Ib (66),(VEX),(o128)
7244a: vblendvps /r,Ib (66),(oVEX)
7254b: vblendvpd /r,Ib (66),(oVEX)
7264c: vpblendvb /r,Ib (66),(oVEX),(o128)
72760: pcmpestrm Vdq,Wdq,Ib (66),(VEX),(o128)
72861: pcmpestri Vdq,Wdq,Ib (66),(VEX),(o128)
72962: pcmpistrm Vdq,Wdq,Ib (66),(VEX),(o128)
73063: pcmpistri Vdq,Wdq,Ib (66),(VEX),(o128)
731df: aeskeygenassist Vdq,Wdq,Ib (66),(VEX),(o128)
732EndTable
733
734GrpTable: Grp1
7350: ADD
7361: OR
7372: ADC
7383: SBB
7394: AND
7405: SUB
7416: XOR
7427: CMP
743EndTable
744
745GrpTable: Grp1A
7460: POP
747EndTable
748
749GrpTable: Grp2
7500: ROL
7511: ROR
7522: RCL
7533: RCR
7544: SHL/SAL
7555: SHR
7566:
7577: SAR
758EndTable
759
760GrpTable: Grp3_1
7610: TEST Eb,Ib
7621:
7632: NOT Eb
7643: NEG Eb
7654: MUL AL,Eb
7665: IMUL AL,Eb
7676: DIV AL,Eb
7687: IDIV AL,Eb
769EndTable
770
771GrpTable: Grp3_2
7720: TEST Ev,Iz
7731:
7742: NOT Ev
7753: NEG Ev
7764: MUL rAX,Ev
7775: IMUL rAX,Ev
7786: DIV rAX,Ev
7797: IDIV rAX,Ev
780EndTable
781
782GrpTable: Grp4
7830: INC Eb
7841: DEC Eb
785EndTable
786
787GrpTable: Grp5
7880: INC Ev
7891: DEC Ev
7902: CALLN Ev (f64)
7913: CALLF Ep
7924: JMPN Ev (f64)
7935: JMPF Ep
7946: PUSH Ev (d64)
7957:
796EndTable
797
798GrpTable: Grp6
7990: SLDT Rv/Mw
8001: STR Rv/Mw
8012: LLDT Ew
8023: LTR Ew
8034: VERR Ew
8045: VERW Ew
805EndTable
806
807GrpTable: Grp7
8080: SGDT Ms | VMCALL (001),(11B) | VMLAUNCH (010),(11B) | VMRESUME (011),(11B) | VMXOFF (100),(11B)
8091: SIDT Ms | MONITOR (000),(11B) | MWAIT (001)
8102: LGDT Ms | XGETBV (000),(11B) | XSETBV (001),(11B)
8113: LIDT Ms
8124: SMSW Mw/Rv
8135:
8146: LMSW Ew
8157: INVLPG Mb | SWAPGS (o64),(000),(11B) | RDTSCP (001),(11B)
816EndTable
817
818GrpTable: Grp8
8194: BT
8205: BTS
8216: BTR
8227: BTC
823EndTable
824
825GrpTable: Grp9
8261: CMPXCHG8B/16B Mq/Mdq
8276: VMPTRLD Mq | VMCLEAR Mq (66) | VMXON Mq (F3)
8287: VMPTRST Mq
829EndTable
830
831GrpTable: Grp10
832EndTable
833
834GrpTable: Grp11
8350: MOV
836EndTable
837
838GrpTable: Grp12
8392: psrlw Nq,Ib (11B) | psrlw Udq,Ib (66),(11B),(VEX),(o128)
8404: psraw Nq,Ib (11B) | psraw Udq,Ib (66),(11B),(VEX),(o128)
8416: psllw Nq,Ib (11B) | psllw Udq,Ib (66),(11B),(VEX),(o128)
842EndTable
843
844GrpTable: Grp13
8452: psrld Nq,Ib (11B) | psrld Udq,Ib (66),(11B),(VEX),(o128)
8464: psrad Nq,Ib (11B) | psrad Udq,Ib (66),(11B),(VEX),(o128)
8476: pslld Nq,Ib (11B) | pslld Udq,Ib (66),(11B),(VEX),(o128)
848EndTable
849
850GrpTable: Grp14
8512: psrlq Nq,Ib (11B) | psrlq Udq,Ib (66),(11B),(VEX),(o128)
8523: psrldq Udq,Ib (66),(11B),(VEX),(o128)
8536: psllq Nq,Ib (11B) | psllq Udq,Ib (66),(11B),(VEX),(o128)
8547: pslldq Udq,Ib (66),(11B),(VEX),(o128)
855EndTable
856
857GrpTable: Grp15
8580: fxsave
8591: fxstor
8602: ldmxcsr (VEX)
8613: stmxcsr (VEX)
8624: XSAVE
8635: XRSTOR | lfence (11B)
8646: mfence (11B)
8657: clflush | sfence (11B)
866EndTable
867
868GrpTable: Grp16
8690: prefetch NTA
8701: prefetch T0
8712: prefetch T1
8723: prefetch T2
873EndTable
874
875# AMD's Prefetch Group
876GrpTable: GrpP
8770: PREFETCH
8781: PREFETCHW
879EndTable
880
881GrpTable: GrpPDLK
8820: MONTMUL
8831: XSHA1
8842: XSHA2
885EndTable
886
887GrpTable: GrpRNG
8880: xstore-rng
8891: xcrypt-ecb
8902: xcrypt-cbc
8914: xcrypt-cfb
8925: xcrypt-ofb
893EndTable
diff --git a/arch/x86/mm/extable.c b/arch/x86/mm/extable.c
index 61b41ca3b5a2..d0474ad2a6e5 100644
--- a/arch/x86/mm/extable.c
+++ b/arch/x86/mm/extable.c
@@ -35,34 +35,3 @@ int fixup_exception(struct pt_regs *regs)
35 35
36 return 0; 36 return 0;
37} 37}
38
39#ifdef CONFIG_X86_64
40/*
41 * Need to defined our own search_extable on X86_64 to work around
42 * a B stepping K8 bug.
43 */
44const struct exception_table_entry *
45search_extable(const struct exception_table_entry *first,
46 const struct exception_table_entry *last,
47 unsigned long value)
48{
49 /* B stepping K8 bug */
50 if ((value >> 32) == 0)
51 value |= 0xffffffffUL << 32;
52
53 while (first <= last) {
54 const struct exception_table_entry *mid;
55 long diff;
56
57 mid = (last - first) / 2 + first;
58 diff = mid->insn - value;
59 if (diff == 0)
60 return mid;
61 else if (diff < 0)
62 first = mid+1;
63 else
64 last = mid-1;
65 }
66 return NULL;
67}
68#endif
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index f4cee9028cf0..f62777940dfb 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -38,7 +38,8 @@ enum x86_pf_error_code {
38 * Returns 0 if mmiotrace is disabled, or if the fault is not 38 * Returns 0 if mmiotrace is disabled, or if the fault is not
39 * handled by mmiotrace: 39 * handled by mmiotrace:
40 */ 40 */
41static inline int kmmio_fault(struct pt_regs *regs, unsigned long addr) 41static inline int __kprobes
42kmmio_fault(struct pt_regs *regs, unsigned long addr)
42{ 43{
43 if (unlikely(is_kmmio_active())) 44 if (unlikely(is_kmmio_active()))
44 if (kmmio_handler(regs, addr) == 1) 45 if (kmmio_handler(regs, addr) == 1)
@@ -46,7 +47,7 @@ static inline int kmmio_fault(struct pt_regs *regs, unsigned long addr)
46 return 0; 47 return 0;
47} 48}
48 49
49static inline int notify_page_fault(struct pt_regs *regs) 50static inline int __kprobes notify_page_fault(struct pt_regs *regs)
50{ 51{
51 int ret = 0; 52 int ret = 0;
52 53
@@ -240,7 +241,7 @@ void vmalloc_sync_all(void)
240 * 241 *
241 * Handle a fault on the vmalloc or module mapping area 242 * Handle a fault on the vmalloc or module mapping area
242 */ 243 */
243static noinline int vmalloc_fault(unsigned long address) 244static noinline __kprobes int vmalloc_fault(unsigned long address)
244{ 245{
245 unsigned long pgd_paddr; 246 unsigned long pgd_paddr;
246 pmd_t *pmd_k; 247 pmd_t *pmd_k;
@@ -357,7 +358,7 @@ void vmalloc_sync_all(void)
357 * 358 *
358 * This assumes no large pages in there. 359 * This assumes no large pages in there.
359 */ 360 */
360static noinline int vmalloc_fault(unsigned long address) 361static noinline __kprobes int vmalloc_fault(unsigned long address)
361{ 362{
362 pgd_t *pgd, *pgd_ref; 363 pgd_t *pgd, *pgd_ref;
363 pud_t *pud, *pud_ref; 364 pud_t *pud, *pud_ref;
@@ -658,7 +659,7 @@ no_context(struct pt_regs *regs, unsigned long error_code,
658 show_fault_oops(regs, error_code, address); 659 show_fault_oops(regs, error_code, address);
659 660
660 stackend = end_of_stack(tsk); 661 stackend = end_of_stack(tsk);
661 if (*stackend != STACK_END_MAGIC) 662 if (tsk != &init_task && *stackend != STACK_END_MAGIC)
662 printk(KERN_ALERT "Thread overran stack, or stack corrupted\n"); 663 printk(KERN_ALERT "Thread overran stack, or stack corrupted\n");
663 664
664 tsk->thread.cr2 = address; 665 tsk->thread.cr2 = address;
@@ -860,7 +861,7 @@ static int spurious_fault_check(unsigned long error_code, pte_t *pte)
860 * There are no security implications to leaving a stale TLB when 861 * There are no security implications to leaving a stale TLB when
861 * increasing the permissions on a page. 862 * increasing the permissions on a page.
862 */ 863 */
863static noinline int 864static noinline __kprobes int
864spurious_fault(unsigned long error_code, unsigned long address) 865spurious_fault(unsigned long error_code, unsigned long address)
865{ 866{
866 pgd_t *pgd; 867 pgd_t *pgd;
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
index 73ffd5536f62..d406c5239019 100644
--- a/arch/x86/mm/init.c
+++ b/arch/x86/mm/init.c
@@ -146,10 +146,6 @@ unsigned long __init_refok init_memory_mapping(unsigned long start,
146 use_gbpages = direct_gbpages; 146 use_gbpages = direct_gbpages;
147#endif 147#endif
148 148
149 set_nx();
150 if (nx_enabled)
151 printk(KERN_INFO "NX (Execute Disable) protection: active\n");
152
153 /* Enable PSE if available */ 149 /* Enable PSE if available */
154 if (cpu_has_pse) 150 if (cpu_has_pse)
155 set_in_cr4(X86_CR4_PSE); 151 set_in_cr4(X86_CR4_PSE);
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c
index 30938c1d8d5d..c973f8e2a6cf 100644
--- a/arch/x86/mm/init_32.c
+++ b/arch/x86/mm/init_32.c
@@ -412,7 +412,7 @@ static void __init permanent_kmaps_init(pgd_t *pgd_base)
412 pkmap_page_table = pte; 412 pkmap_page_table = pte;
413} 413}
414 414
415static void __init add_one_highpage_init(struct page *page, int pfn) 415static void __init add_one_highpage_init(struct page *page)
416{ 416{
417 ClearPageReserved(page); 417 ClearPageReserved(page);
418 init_page_count(page); 418 init_page_count(page);
@@ -445,7 +445,7 @@ static int __init add_highpages_work_fn(unsigned long start_pfn,
445 if (!pfn_valid(node_pfn)) 445 if (!pfn_valid(node_pfn))
446 continue; 446 continue;
447 page = pfn_to_page(node_pfn); 447 page = pfn_to_page(node_pfn);
448 add_one_highpage_init(page, node_pfn); 448 add_one_highpage_init(page);
449 } 449 }
450 450
451 return 0; 451 return 0;
@@ -703,8 +703,8 @@ void __init find_low_pfn_range(void)
703} 703}
704 704
705#ifndef CONFIG_NEED_MULTIPLE_NODES 705#ifndef CONFIG_NEED_MULTIPLE_NODES
706void __init initmem_init(unsigned long start_pfn, 706void __init initmem_init(unsigned long start_pfn, unsigned long end_pfn,
707 unsigned long end_pfn) 707 int acpi, int k8)
708{ 708{
709#ifdef CONFIG_HIGHMEM 709#ifdef CONFIG_HIGHMEM
710 highstart_pfn = highend_pfn = max_pfn; 710 highstart_pfn = highend_pfn = max_pfn;
@@ -997,7 +997,7 @@ static noinline int do_test_wp_bit(void)
997const int rodata_test_data = 0xC3; 997const int rodata_test_data = 0xC3;
998EXPORT_SYMBOL_GPL(rodata_test_data); 998EXPORT_SYMBOL_GPL(rodata_test_data);
999 999
1000static int kernel_set_to_readonly; 1000int kernel_set_to_readonly __read_mostly;
1001 1001
1002void set_kernel_text_rw(void) 1002void set_kernel_text_rw(void)
1003{ 1003{
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 5a4398a6006b..5198b9bb34ef 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -568,7 +568,8 @@ kernel_physical_mapping_init(unsigned long start,
568} 568}
569 569
570#ifndef CONFIG_NUMA 570#ifndef CONFIG_NUMA
571void __init initmem_init(unsigned long start_pfn, unsigned long end_pfn) 571void __init initmem_init(unsigned long start_pfn, unsigned long end_pfn,
572 int acpi, int k8)
572{ 573{
573 unsigned long bootmap_size, bootmap; 574 unsigned long bootmap_size, bootmap;
574 575
@@ -694,12 +695,12 @@ void __init mem_init(void)
694const int rodata_test_data = 0xC3; 695const int rodata_test_data = 0xC3;
695EXPORT_SYMBOL_GPL(rodata_test_data); 696EXPORT_SYMBOL_GPL(rodata_test_data);
696 697
697static int kernel_set_to_readonly; 698int kernel_set_to_readonly;
698 699
699void set_kernel_text_rw(void) 700void set_kernel_text_rw(void)
700{ 701{
701 unsigned long start = PFN_ALIGN(_stext); 702 unsigned long start = PFN_ALIGN(_text);
702 unsigned long end = PFN_ALIGN(__start_rodata); 703 unsigned long end = PFN_ALIGN(__stop___ex_table);
703 704
704 if (!kernel_set_to_readonly) 705 if (!kernel_set_to_readonly)
705 return; 706 return;
@@ -707,13 +708,18 @@ void set_kernel_text_rw(void)
707 pr_debug("Set kernel text: %lx - %lx for read write\n", 708 pr_debug("Set kernel text: %lx - %lx for read write\n",
708 start, end); 709 start, end);
709 710
711 /*
712 * Make the kernel identity mapping for text RW. Kernel text
713 * mapping will always be RO. Refer to the comment in
714 * static_protections() in pageattr.c
715 */
710 set_memory_rw(start, (end - start) >> PAGE_SHIFT); 716 set_memory_rw(start, (end - start) >> PAGE_SHIFT);
711} 717}
712 718
713void set_kernel_text_ro(void) 719void set_kernel_text_ro(void)
714{ 720{
715 unsigned long start = PFN_ALIGN(_stext); 721 unsigned long start = PFN_ALIGN(_text);
716 unsigned long end = PFN_ALIGN(__start_rodata); 722 unsigned long end = PFN_ALIGN(__stop___ex_table);
717 723
718 if (!kernel_set_to_readonly) 724 if (!kernel_set_to_readonly)
719 return; 725 return;
@@ -721,14 +727,21 @@ void set_kernel_text_ro(void)
721 pr_debug("Set kernel text: %lx - %lx for read only\n", 727 pr_debug("Set kernel text: %lx - %lx for read only\n",
722 start, end); 728 start, end);
723 729
730 /*
731 * Set the kernel identity mapping for text RO.
732 */
724 set_memory_ro(start, (end - start) >> PAGE_SHIFT); 733 set_memory_ro(start, (end - start) >> PAGE_SHIFT);
725} 734}
726 735
727void mark_rodata_ro(void) 736void mark_rodata_ro(void)
728{ 737{
729 unsigned long start = PFN_ALIGN(_stext), end = PFN_ALIGN(__end_rodata); 738 unsigned long start = PFN_ALIGN(_text);
730 unsigned long rodata_start = 739 unsigned long rodata_start =
731 ((unsigned long)__start_rodata + PAGE_SIZE - 1) & PAGE_MASK; 740 ((unsigned long)__start_rodata + PAGE_SIZE - 1) & PAGE_MASK;
741 unsigned long end = (unsigned long) &__end_rodata_hpage_align;
742 unsigned long text_end = PAGE_ALIGN((unsigned long) &__stop___ex_table);
743 unsigned long rodata_end = PAGE_ALIGN((unsigned long) &__end_rodata);
744 unsigned long data_start = (unsigned long) &_sdata;
732 745
733 printk(KERN_INFO "Write protecting the kernel read-only data: %luk\n", 746 printk(KERN_INFO "Write protecting the kernel read-only data: %luk\n",
734 (end - start) >> 10); 747 (end - start) >> 10);
@@ -751,6 +764,14 @@ void mark_rodata_ro(void)
751 printk(KERN_INFO "Testing CPA: again\n"); 764 printk(KERN_INFO "Testing CPA: again\n");
752 set_memory_ro(start, (end-start) >> PAGE_SHIFT); 765 set_memory_ro(start, (end-start) >> PAGE_SHIFT);
753#endif 766#endif
767
768 free_init_pages("unused kernel memory",
769 (unsigned long) page_address(virt_to_page(text_end)),
770 (unsigned long)
771 page_address(virt_to_page(rodata_start)));
772 free_init_pages("unused kernel memory",
773 (unsigned long) page_address(virt_to_page(rodata_end)),
774 (unsigned long) page_address(virt_to_page(data_start)));
754} 775}
755 776
756#endif 777#endif
diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c
index 2feb9bdedaaf..c246d259822d 100644
--- a/arch/x86/mm/ioremap.c
+++ b/arch/x86/mm/ioremap.c
@@ -281,30 +281,6 @@ void __iomem *ioremap_cache(resource_size_t phys_addr, unsigned long size)
281} 281}
282EXPORT_SYMBOL(ioremap_cache); 282EXPORT_SYMBOL(ioremap_cache);
283 283
284static void __iomem *ioremap_default(resource_size_t phys_addr,
285 unsigned long size)
286{
287 unsigned long flags;
288 void __iomem *ret;
289 int err;
290
291 /*
292 * - WB for WB-able memory and no other conflicting mappings
293 * - UC_MINUS for non-WB-able memory with no other conflicting mappings
294 * - Inherit from confliting mappings otherwise
295 */
296 err = reserve_memtype(phys_addr, phys_addr + size,
297 _PAGE_CACHE_WB, &flags);
298 if (err < 0)
299 return NULL;
300
301 ret = __ioremap_caller(phys_addr, size, flags,
302 __builtin_return_address(0));
303
304 free_memtype(phys_addr, phys_addr + size);
305 return ret;
306}
307
308void __iomem *ioremap_prot(resource_size_t phys_addr, unsigned long size, 284void __iomem *ioremap_prot(resource_size_t phys_addr, unsigned long size,
309 unsigned long prot_val) 285 unsigned long prot_val)
310{ 286{
@@ -380,7 +356,7 @@ void *xlate_dev_mem_ptr(unsigned long phys)
380 if (page_is_ram(start >> PAGE_SHIFT)) 356 if (page_is_ram(start >> PAGE_SHIFT))
381 return __va(phys); 357 return __va(phys);
382 358
383 addr = (void __force *)ioremap_default(start, PAGE_SIZE); 359 addr = (void __force *)ioremap_cache(start, PAGE_SIZE);
384 if (addr) 360 if (addr)
385 addr = (void *)((unsigned long)addr | (phys & ~PAGE_MASK)); 361 addr = (void *)((unsigned long)addr | (phys & ~PAGE_MASK));
386 362
diff --git a/arch/x86/mm/k8topology_64.c b/arch/x86/mm/k8topology_64.c
index 268f8255280f..970ed579d4e4 100644
--- a/arch/x86/mm/k8topology_64.c
+++ b/arch/x86/mm/k8topology_64.c
@@ -24,6 +24,9 @@
24#include <asm/apic.h> 24#include <asm/apic.h>
25#include <asm/k8.h> 25#include <asm/k8.h>
26 26
27static struct bootnode __initdata nodes[8];
28static nodemask_t __initdata nodes_parsed = NODE_MASK_NONE;
29
27static __init int find_northbridge(void) 30static __init int find_northbridge(void)
28{ 31{
29 int num; 32 int num;
@@ -54,18 +57,6 @@ static __init void early_get_boot_cpu_id(void)
54 * need to get boot_cpu_id so can use that to create apicid_to_node 57 * need to get boot_cpu_id so can use that to create apicid_to_node
55 * in k8_scan_nodes() 58 * in k8_scan_nodes()
56 */ 59 */
57 /*
58 * Find possible boot-time SMP configuration:
59 */
60#ifdef CONFIG_X86_MPPARSE
61 early_find_smp_config();
62#endif
63#ifdef CONFIG_ACPI
64 /*
65 * Read APIC information from ACPI tables.
66 */
67 early_acpi_boot_init();
68#endif
69#ifdef CONFIG_X86_MPPARSE 60#ifdef CONFIG_X86_MPPARSE
70 /* 61 /*
71 * get boot-time SMP configuration: 62 * get boot-time SMP configuration:
@@ -76,12 +67,26 @@ static __init void early_get_boot_cpu_id(void)
76 early_init_lapic_mapping(); 67 early_init_lapic_mapping();
77} 68}
78 69
79int __init k8_scan_nodes(unsigned long start, unsigned long end) 70int __init k8_get_nodes(struct bootnode *physnodes)
80{ 71{
81 unsigned numnodes, cores, bits, apicid_base; 72 int i;
73 int ret = 0;
74
75 for_each_node_mask(i, nodes_parsed) {
76 physnodes[ret].start = nodes[i].start;
77 physnodes[ret].end = nodes[i].end;
78 ret++;
79 }
80 return ret;
81}
82
83int __init k8_numa_init(unsigned long start_pfn, unsigned long end_pfn)
84{
85 unsigned long start = PFN_PHYS(start_pfn);
86 unsigned long end = PFN_PHYS(end_pfn);
87 unsigned numnodes;
82 unsigned long prevbase; 88 unsigned long prevbase;
83 struct bootnode nodes[8]; 89 int i, nb, found = 0;
84 int i, j, nb, found = 0;
85 u32 nodeid, reg; 90 u32 nodeid, reg;
86 91
87 if (!early_pci_allowed()) 92 if (!early_pci_allowed())
@@ -91,16 +96,15 @@ int __init k8_scan_nodes(unsigned long start, unsigned long end)
91 if (nb < 0) 96 if (nb < 0)
92 return nb; 97 return nb;
93 98
94 printk(KERN_INFO "Scanning NUMA topology in Northbridge %d\n", nb); 99 pr_info("Scanning NUMA topology in Northbridge %d\n", nb);
95 100
96 reg = read_pci_config(0, nb, 0, 0x60); 101 reg = read_pci_config(0, nb, 0, 0x60);
97 numnodes = ((reg >> 4) & 0xF) + 1; 102 numnodes = ((reg >> 4) & 0xF) + 1;
98 if (numnodes <= 1) 103 if (numnodes <= 1)
99 return -1; 104 return -1;
100 105
101 printk(KERN_INFO "Number of nodes %d\n", numnodes); 106 pr_info("Number of physical nodes %d\n", numnodes);
102 107
103 memset(&nodes, 0, sizeof(nodes));
104 prevbase = 0; 108 prevbase = 0;
105 for (i = 0; i < 8; i++) { 109 for (i = 0; i < 8; i++) {
106 unsigned long base, limit; 110 unsigned long base, limit;
@@ -111,28 +115,28 @@ int __init k8_scan_nodes(unsigned long start, unsigned long end)
111 nodeid = limit & 7; 115 nodeid = limit & 7;
112 if ((base & 3) == 0) { 116 if ((base & 3) == 0) {
113 if (i < numnodes) 117 if (i < numnodes)
114 printk("Skipping disabled node %d\n", i); 118 pr_info("Skipping disabled node %d\n", i);
115 continue; 119 continue;
116 } 120 }
117 if (nodeid >= numnodes) { 121 if (nodeid >= numnodes) {
118 printk("Ignoring excess node %d (%lx:%lx)\n", nodeid, 122 pr_info("Ignoring excess node %d (%lx:%lx)\n", nodeid,
119 base, limit); 123 base, limit);
120 continue; 124 continue;
121 } 125 }
122 126
123 if (!limit) { 127 if (!limit) {
124 printk(KERN_INFO "Skipping node entry %d (base %lx)\n", 128 pr_info("Skipping node entry %d (base %lx)\n",
125 i, base); 129 i, base);
126 continue; 130 continue;
127 } 131 }
128 if ((base >> 8) & 3 || (limit >> 8) & 3) { 132 if ((base >> 8) & 3 || (limit >> 8) & 3) {
129 printk(KERN_ERR "Node %d using interleaving mode %lx/%lx\n", 133 pr_err("Node %d using interleaving mode %lx/%lx\n",
130 nodeid, (base>>8)&3, (limit>>8) & 3); 134 nodeid, (base >> 8) & 3, (limit >> 8) & 3);
131 return -1; 135 return -1;
132 } 136 }
133 if (node_isset(nodeid, node_possible_map)) { 137 if (node_isset(nodeid, nodes_parsed)) {
134 printk(KERN_INFO "Node %d already present. Skipping\n", 138 pr_info("Node %d already present, skipping\n",
135 nodeid); 139 nodeid);
136 continue; 140 continue;
137 } 141 }
138 142
@@ -141,8 +145,8 @@ int __init k8_scan_nodes(unsigned long start, unsigned long end)
141 limit |= (1<<24)-1; 145 limit |= (1<<24)-1;
142 limit++; 146 limit++;
143 147
144 if (limit > max_pfn << PAGE_SHIFT) 148 if (limit > end)
145 limit = max_pfn << PAGE_SHIFT; 149 limit = end;
146 if (limit <= base) 150 if (limit <= base)
147 continue; 151 continue;
148 152
@@ -154,24 +158,24 @@ int __init k8_scan_nodes(unsigned long start, unsigned long end)
154 if (limit > end) 158 if (limit > end)
155 limit = end; 159 limit = end;
156 if (limit == base) { 160 if (limit == base) {
157 printk(KERN_ERR "Empty node %d\n", nodeid); 161 pr_err("Empty node %d\n", nodeid);
158 continue; 162 continue;
159 } 163 }
160 if (limit < base) { 164 if (limit < base) {
161 printk(KERN_ERR "Node %d bogus settings %lx-%lx.\n", 165 pr_err("Node %d bogus settings %lx-%lx.\n",
162 nodeid, base, limit); 166 nodeid, base, limit);
163 continue; 167 continue;
164 } 168 }
165 169
166 /* Could sort here, but pun for now. Should not happen anyroads. */ 170 /* Could sort here, but pun for now. Should not happen anyroads. */
167 if (prevbase > base) { 171 if (prevbase > base) {
168 printk(KERN_ERR "Node map not sorted %lx,%lx\n", 172 pr_err("Node map not sorted %lx,%lx\n",
169 prevbase, base); 173 prevbase, base);
170 return -1; 174 return -1;
171 } 175 }
172 176
173 printk(KERN_INFO "Node %d MemBase %016lx Limit %016lx\n", 177 pr_info("Node %d MemBase %016lx Limit %016lx\n",
174 nodeid, base, limit); 178 nodeid, base, limit);
175 179
176 found++; 180 found++;
177 181
@@ -180,18 +184,29 @@ int __init k8_scan_nodes(unsigned long start, unsigned long end)
180 184
181 prevbase = base; 185 prevbase = base;
182 186
183 node_set(nodeid, node_possible_map); 187 node_set(nodeid, nodes_parsed);
184 } 188 }
185 189
186 if (!found) 190 if (!found)
187 return -1; 191 return -1;
192 return 0;
193}
194
195int __init k8_scan_nodes(void)
196{
197 unsigned int bits;
198 unsigned int cores;
199 unsigned int apicid_base;
200 int i;
188 201
202 BUG_ON(nodes_empty(nodes_parsed));
203 node_possible_map = nodes_parsed;
189 memnode_shift = compute_hash_shift(nodes, 8, NULL); 204 memnode_shift = compute_hash_shift(nodes, 8, NULL);
190 if (memnode_shift < 0) { 205 if (memnode_shift < 0) {
191 printk(KERN_ERR "No NUMA node hash function found. Contact maintainer\n"); 206 pr_err("No NUMA node hash function found. Contact maintainer\n");
192 return -1; 207 return -1;
193 } 208 }
194 printk(KERN_INFO "Using node hash shift of %d\n", memnode_shift); 209 pr_info("Using node hash shift of %d\n", memnode_shift);
195 210
196 /* use the coreid bits from early_identify_cpu */ 211 /* use the coreid bits from early_identify_cpu */
197 bits = boot_cpu_data.x86_coreid_bits; 212 bits = boot_cpu_data.x86_coreid_bits;
@@ -200,14 +215,12 @@ int __init k8_scan_nodes(unsigned long start, unsigned long end)
200 /* need to get boot_cpu_id early for system with apicid lifting */ 215 /* need to get boot_cpu_id early for system with apicid lifting */
201 early_get_boot_cpu_id(); 216 early_get_boot_cpu_id();
202 if (boot_cpu_physical_apicid > 0) { 217 if (boot_cpu_physical_apicid > 0) {
203 printk(KERN_INFO "BSP APIC ID: %02x\n", 218 pr_info("BSP APIC ID: %02x\n", boot_cpu_physical_apicid);
204 boot_cpu_physical_apicid);
205 apicid_base = boot_cpu_physical_apicid; 219 apicid_base = boot_cpu_physical_apicid;
206 } 220 }
207 221
208 for (i = 0; i < 8; i++) { 222 for_each_node_mask(i, node_possible_map) {
209 if (nodes[i].start == nodes[i].end) 223 int j;
210 continue;
211 224
212 e820_register_active_regions(i, 225 e820_register_active_regions(i,
213 nodes[i].start >> PAGE_SHIFT, 226 nodes[i].start >> PAGE_SHIFT,
diff --git a/arch/x86/mm/kmmio.c b/arch/x86/mm/kmmio.c
index 16ccbd77917f..11a4ad4d6253 100644
--- a/arch/x86/mm/kmmio.c
+++ b/arch/x86/mm/kmmio.c
@@ -540,8 +540,14 @@ kmmio_die_notifier(struct notifier_block *nb, unsigned long val, void *args)
540 struct die_args *arg = args; 540 struct die_args *arg = args;
541 541
542 if (val == DIE_DEBUG && (arg->err & DR_STEP)) 542 if (val == DIE_DEBUG && (arg->err & DR_STEP))
543 if (post_kmmio_handler(arg->err, arg->regs) == 1) 543 if (post_kmmio_handler(arg->err, arg->regs) == 1) {
544 /*
545 * Reset the BS bit in dr6 (pointed by args->err) to
546 * denote completion of processing
547 */
548 (*(unsigned long *)ERR_PTR(arg->err)) &= ~DR_STEP;
544 return NOTIFY_STOP; 549 return NOTIFY_STOP;
550 }
545 551
546 return NOTIFY_DONE; 552 return NOTIFY_DONE;
547} 553}
diff --git a/arch/x86/mm/numa_32.c b/arch/x86/mm/numa_32.c
index d2530062fe00..b20760ca7244 100644
--- a/arch/x86/mm/numa_32.c
+++ b/arch/x86/mm/numa_32.c
@@ -347,8 +347,8 @@ static void init_remap_allocator(int nid)
347 (ulong) node_remap_end_vaddr[nid]); 347 (ulong) node_remap_end_vaddr[nid]);
348} 348}
349 349
350void __init initmem_init(unsigned long start_pfn, 350void __init initmem_init(unsigned long start_pfn, unsigned long end_pfn,
351 unsigned long end_pfn) 351 int acpi, int k8)
352{ 352{
353 int nid; 353 int nid;
354 long kva_target_pfn; 354 long kva_target_pfn;
diff --git a/arch/x86/mm/numa_64.c b/arch/x86/mm/numa_64.c
index 459913beac71..83bbc70d11bb 100644
--- a/arch/x86/mm/numa_64.c
+++ b/arch/x86/mm/numa_64.c
@@ -239,8 +239,14 @@ setup_node_bootmem(int nodeid, unsigned long start, unsigned long end)
239 bootmap = early_node_mem(nodeid, bootmap_start, end, 239 bootmap = early_node_mem(nodeid, bootmap_start, end,
240 bootmap_pages<<PAGE_SHIFT, PAGE_SIZE); 240 bootmap_pages<<PAGE_SHIFT, PAGE_SIZE);
241 if (bootmap == NULL) { 241 if (bootmap == NULL) {
242 if (nodedata_phys < start || nodedata_phys >= end) 242 if (nodedata_phys < start || nodedata_phys >= end) {
243 free_bootmem(nodedata_phys, pgdat_size); 243 /*
244 * only need to free it if it is from other node
245 * bootmem
246 */
247 if (nid != nodeid)
248 free_bootmem(nodedata_phys, pgdat_size);
249 }
244 node_data[nodeid] = NULL; 250 node_data[nodeid] = NULL;
245 return; 251 return;
246 } 252 }
@@ -306,8 +312,71 @@ void __init numa_init_array(void)
306 312
307#ifdef CONFIG_NUMA_EMU 313#ifdef CONFIG_NUMA_EMU
308/* Numa emulation */ 314/* Numa emulation */
315static struct bootnode nodes[MAX_NUMNODES] __initdata;
316static struct bootnode physnodes[MAX_NUMNODES] __initdata;
309static char *cmdline __initdata; 317static char *cmdline __initdata;
310 318
319static int __init setup_physnodes(unsigned long start, unsigned long end,
320 int acpi, int k8)
321{
322 int nr_nodes = 0;
323 int ret = 0;
324 int i;
325
326#ifdef CONFIG_ACPI_NUMA
327 if (acpi)
328 nr_nodes = acpi_get_nodes(physnodes);
329#endif
330#ifdef CONFIG_K8_NUMA
331 if (k8)
332 nr_nodes = k8_get_nodes(physnodes);
333#endif
334 /*
335 * Basic sanity checking on the physical node map: there may be errors
336 * if the SRAT or K8 incorrectly reported the topology or the mem=
337 * kernel parameter is used.
338 */
339 for (i = 0; i < nr_nodes; i++) {
340 if (physnodes[i].start == physnodes[i].end)
341 continue;
342 if (physnodes[i].start > end) {
343 physnodes[i].end = physnodes[i].start;
344 continue;
345 }
346 if (physnodes[i].end < start) {
347 physnodes[i].start = physnodes[i].end;
348 continue;
349 }
350 if (physnodes[i].start < start)
351 physnodes[i].start = start;
352 if (physnodes[i].end > end)
353 physnodes[i].end = end;
354 }
355
356 /*
357 * Remove all nodes that have no memory or were truncated because of the
358 * limited address range.
359 */
360 for (i = 0; i < nr_nodes; i++) {
361 if (physnodes[i].start == physnodes[i].end)
362 continue;
363 physnodes[ret].start = physnodes[i].start;
364 physnodes[ret].end = physnodes[i].end;
365 ret++;
366 }
367
368 /*
369 * If no physical topology was detected, a single node is faked to cover
370 * the entire address space.
371 */
372 if (!ret) {
373 physnodes[ret].start = start;
374 physnodes[ret].end = end;
375 ret = 1;
376 }
377 return ret;
378}
379
311/* 380/*
312 * Setups up nid to range from addr to addr + size. If the end 381 * Setups up nid to range from addr to addr + size. If the end
313 * boundary is greater than max_addr, then max_addr is used instead. 382 * boundary is greater than max_addr, then max_addr is used instead.
@@ -315,11 +384,9 @@ static char *cmdline __initdata;
315 * allocation past addr and -1 otherwise. addr is adjusted to be at 384 * allocation past addr and -1 otherwise. addr is adjusted to be at
316 * the end of the node. 385 * the end of the node.
317 */ 386 */
318static int __init setup_node_range(int nid, struct bootnode *nodes, u64 *addr, 387static int __init setup_node_range(int nid, u64 *addr, u64 size, u64 max_addr)
319 u64 size, u64 max_addr)
320{ 388{
321 int ret = 0; 389 int ret = 0;
322
323 nodes[nid].start = *addr; 390 nodes[nid].start = *addr;
324 *addr += size; 391 *addr += size;
325 if (*addr >= max_addr) { 392 if (*addr >= max_addr) {
@@ -335,12 +402,111 @@ static int __init setup_node_range(int nid, struct bootnode *nodes, u64 *addr,
335} 402}
336 403
337/* 404/*
405 * Sets up nr_nodes fake nodes interleaved over physical nodes ranging from addr
406 * to max_addr. The return value is the number of nodes allocated.
407 */
408static int __init split_nodes_interleave(u64 addr, u64 max_addr,
409 int nr_phys_nodes, int nr_nodes)
410{
411 nodemask_t physnode_mask = NODE_MASK_NONE;
412 u64 size;
413 int big;
414 int ret = 0;
415 int i;
416
417 if (nr_nodes <= 0)
418 return -1;
419 if (nr_nodes > MAX_NUMNODES) {
420 pr_info("numa=fake=%d too large, reducing to %d\n",
421 nr_nodes, MAX_NUMNODES);
422 nr_nodes = MAX_NUMNODES;
423 }
424
425 size = (max_addr - addr - e820_hole_size(addr, max_addr)) / nr_nodes;
426 /*
427 * Calculate the number of big nodes that can be allocated as a result
428 * of consolidating the remainder.
429 */
430 big = ((size & ~FAKE_NODE_MIN_HASH_MASK) & nr_nodes) /
431 FAKE_NODE_MIN_SIZE;
432
433 size &= FAKE_NODE_MIN_HASH_MASK;
434 if (!size) {
435 pr_err("Not enough memory for each node. "
436 "NUMA emulation disabled.\n");
437 return -1;
438 }
439
440 for (i = 0; i < nr_phys_nodes; i++)
441 if (physnodes[i].start != physnodes[i].end)
442 node_set(i, physnode_mask);
443
444 /*
445 * Continue to fill physical nodes with fake nodes until there is no
446 * memory left on any of them.
447 */
448 while (nodes_weight(physnode_mask)) {
449 for_each_node_mask(i, physnode_mask) {
450 u64 end = physnodes[i].start + size;
451 u64 dma32_end = PFN_PHYS(MAX_DMA32_PFN);
452
453 if (ret < big)
454 end += FAKE_NODE_MIN_SIZE;
455
456 /*
457 * Continue to add memory to this fake node if its
458 * non-reserved memory is less than the per-node size.
459 */
460 while (end - physnodes[i].start -
461 e820_hole_size(physnodes[i].start, end) < size) {
462 end += FAKE_NODE_MIN_SIZE;
463 if (end > physnodes[i].end) {
464 end = physnodes[i].end;
465 break;
466 }
467 }
468
469 /*
470 * If there won't be at least FAKE_NODE_MIN_SIZE of
471 * non-reserved memory in ZONE_DMA32 for the next node,
472 * this one must extend to the boundary.
473 */
474 if (end < dma32_end && dma32_end - end -
475 e820_hole_size(end, dma32_end) < FAKE_NODE_MIN_SIZE)
476 end = dma32_end;
477
478 /*
479 * If there won't be enough non-reserved memory for the
480 * next node, this one must extend to the end of the
481 * physical node.
482 */
483 if (physnodes[i].end - end -
484 e820_hole_size(end, physnodes[i].end) < size)
485 end = physnodes[i].end;
486
487 /*
488 * Avoid allocating more nodes than requested, which can
489 * happen as a result of rounding down each node's size
490 * to FAKE_NODE_MIN_SIZE.
491 */
492 if (nodes_weight(physnode_mask) + ret >= nr_nodes)
493 end = physnodes[i].end;
494
495 if (setup_node_range(ret++, &physnodes[i].start,
496 end - physnodes[i].start,
497 physnodes[i].end) < 0)
498 node_clear(i, physnode_mask);
499 }
500 }
501 return ret;
502}
503
504/*
338 * Splits num_nodes nodes up equally starting at node_start. The return value 505 * Splits num_nodes nodes up equally starting at node_start. The return value
339 * is the number of nodes split up and addr is adjusted to be at the end of the 506 * is the number of nodes split up and addr is adjusted to be at the end of the
340 * last node allocated. 507 * last node allocated.
341 */ 508 */
342static int __init split_nodes_equally(struct bootnode *nodes, u64 *addr, 509static int __init split_nodes_equally(u64 *addr, u64 max_addr, int node_start,
343 u64 max_addr, int node_start,
344 int num_nodes) 510 int num_nodes)
345{ 511{
346 unsigned int big; 512 unsigned int big;
@@ -388,7 +554,7 @@ static int __init split_nodes_equally(struct bootnode *nodes, u64 *addr,
388 break; 554 break;
389 } 555 }
390 } 556 }
391 if (setup_node_range(i, nodes, addr, end - *addr, max_addr) < 0) 557 if (setup_node_range(i, addr, end - *addr, max_addr) < 0)
392 break; 558 break;
393 } 559 }
394 return i - node_start + 1; 560 return i - node_start + 1;
@@ -399,12 +565,12 @@ static int __init split_nodes_equally(struct bootnode *nodes, u64 *addr,
399 * always assigned to a final node and can be asymmetric. Returns the number of 565 * always assigned to a final node and can be asymmetric. Returns the number of
400 * nodes split. 566 * nodes split.
401 */ 567 */
402static int __init split_nodes_by_size(struct bootnode *nodes, u64 *addr, 568static int __init split_nodes_by_size(u64 *addr, u64 max_addr, int node_start,
403 u64 max_addr, int node_start, u64 size) 569 u64 size)
404{ 570{
405 int i = node_start; 571 int i = node_start;
406 size = (size << 20) & FAKE_NODE_MIN_HASH_MASK; 572 size = (size << 20) & FAKE_NODE_MIN_HASH_MASK;
407 while (!setup_node_range(i++, nodes, addr, size, max_addr)) 573 while (!setup_node_range(i++, addr, size, max_addr))
408 ; 574 ;
409 return i - node_start; 575 return i - node_start;
410} 576}
@@ -413,15 +579,15 @@ static int __init split_nodes_by_size(struct bootnode *nodes, u64 *addr,
413 * Sets up the system RAM area from start_pfn to last_pfn according to the 579 * Sets up the system RAM area from start_pfn to last_pfn according to the
414 * numa=fake command-line option. 580 * numa=fake command-line option.
415 */ 581 */
416static struct bootnode nodes[MAX_NUMNODES] __initdata; 582static int __init numa_emulation(unsigned long start_pfn,
417 583 unsigned long last_pfn, int acpi, int k8)
418static int __init numa_emulation(unsigned long start_pfn, unsigned long last_pfn)
419{ 584{
420 u64 size, addr = start_pfn << PAGE_SHIFT; 585 u64 size, addr = start_pfn << PAGE_SHIFT;
421 u64 max_addr = last_pfn << PAGE_SHIFT; 586 u64 max_addr = last_pfn << PAGE_SHIFT;
422 int num_nodes = 0, num = 0, coeff_flag, coeff = -1, i; 587 int num_nodes = 0, num = 0, coeff_flag, coeff = -1, i;
588 int num_phys_nodes;
423 589
424 memset(&nodes, 0, sizeof(nodes)); 590 num_phys_nodes = setup_physnodes(addr, max_addr, acpi, k8);
425 /* 591 /*
426 * If the numa=fake command-line is just a single number N, split the 592 * If the numa=fake command-line is just a single number N, split the
427 * system RAM into N fake nodes. 593 * system RAM into N fake nodes.
@@ -429,7 +595,8 @@ static int __init numa_emulation(unsigned long start_pfn, unsigned long last_pfn
429 if (!strchr(cmdline, '*') && !strchr(cmdline, ',')) { 595 if (!strchr(cmdline, '*') && !strchr(cmdline, ',')) {
430 long n = simple_strtol(cmdline, NULL, 0); 596 long n = simple_strtol(cmdline, NULL, 0);
431 597
432 num_nodes = split_nodes_equally(nodes, &addr, max_addr, 0, n); 598 num_nodes = split_nodes_interleave(addr, max_addr,
599 num_phys_nodes, n);
433 if (num_nodes < 0) 600 if (num_nodes < 0)
434 return num_nodes; 601 return num_nodes;
435 goto out; 602 goto out;
@@ -456,8 +623,8 @@ static int __init numa_emulation(unsigned long start_pfn, unsigned long last_pfn
456 size = ((u64)num << 20) & FAKE_NODE_MIN_HASH_MASK; 623 size = ((u64)num << 20) & FAKE_NODE_MIN_HASH_MASK;
457 if (size) 624 if (size)
458 for (i = 0; i < coeff; i++, num_nodes++) 625 for (i = 0; i < coeff; i++, num_nodes++)
459 if (setup_node_range(num_nodes, nodes, 626 if (setup_node_range(num_nodes, &addr,
460 &addr, size, max_addr) < 0) 627 size, max_addr) < 0)
461 goto done; 628 goto done;
462 if (!*cmdline) 629 if (!*cmdline)
463 break; 630 break;
@@ -473,7 +640,7 @@ done:
473 if (addr < max_addr) { 640 if (addr < max_addr) {
474 if (coeff_flag && coeff < 0) { 641 if (coeff_flag && coeff < 0) {
475 /* Split remaining nodes into num-sized chunks */ 642 /* Split remaining nodes into num-sized chunks */
476 num_nodes += split_nodes_by_size(nodes, &addr, max_addr, 643 num_nodes += split_nodes_by_size(&addr, max_addr,
477 num_nodes, num); 644 num_nodes, num);
478 goto out; 645 goto out;
479 } 646 }
@@ -482,7 +649,7 @@ done:
482 /* Split remaining nodes into coeff chunks */ 649 /* Split remaining nodes into coeff chunks */
483 if (coeff <= 0) 650 if (coeff <= 0)
484 break; 651 break;
485 num_nodes += split_nodes_equally(nodes, &addr, max_addr, 652 num_nodes += split_nodes_equally(&addr, max_addr,
486 num_nodes, coeff); 653 num_nodes, coeff);
487 break; 654 break;
488 case ',': 655 case ',':
@@ -490,8 +657,8 @@ done:
490 break; 657 break;
491 default: 658 default:
492 /* Give one final node */ 659 /* Give one final node */
493 setup_node_range(num_nodes, nodes, &addr, 660 setup_node_range(num_nodes, &addr, max_addr - addr,
494 max_addr - addr, max_addr); 661 max_addr);
495 num_nodes++; 662 num_nodes++;
496 } 663 }
497 } 664 }
@@ -505,14 +672,10 @@ out:
505 } 672 }
506 673
507 /* 674 /*
508 * We need to vacate all active ranges that may have been registered by 675 * We need to vacate all active ranges that may have been registered for
509 * SRAT and set acpi_numa to -1 so that srat_disabled() always returns 676 * the e820 memory map.
510 * true. NUMA emulation has succeeded so we will not scan ACPI nodes.
511 */ 677 */
512 remove_all_active_ranges(); 678 remove_all_active_ranges();
513#ifdef CONFIG_ACPI_NUMA
514 acpi_numa = -1;
515#endif
516 for_each_node_mask(i, node_possible_map) { 679 for_each_node_mask(i, node_possible_map) {
517 e820_register_active_regions(i, nodes[i].start >> PAGE_SHIFT, 680 e820_register_active_regions(i, nodes[i].start >> PAGE_SHIFT,
518 nodes[i].end >> PAGE_SHIFT); 681 nodes[i].end >> PAGE_SHIFT);
@@ -524,7 +687,8 @@ out:
524} 687}
525#endif /* CONFIG_NUMA_EMU */ 688#endif /* CONFIG_NUMA_EMU */
526 689
527void __init initmem_init(unsigned long start_pfn, unsigned long last_pfn) 690void __init initmem_init(unsigned long start_pfn, unsigned long last_pfn,
691 int acpi, int k8)
528{ 692{
529 int i; 693 int i;
530 694
@@ -532,23 +696,22 @@ void __init initmem_init(unsigned long start_pfn, unsigned long last_pfn)
532 nodes_clear(node_online_map); 696 nodes_clear(node_online_map);
533 697
534#ifdef CONFIG_NUMA_EMU 698#ifdef CONFIG_NUMA_EMU
535 if (cmdline && !numa_emulation(start_pfn, last_pfn)) 699 if (cmdline && !numa_emulation(start_pfn, last_pfn, acpi, k8))
536 return; 700 return;
537 nodes_clear(node_possible_map); 701 nodes_clear(node_possible_map);
538 nodes_clear(node_online_map); 702 nodes_clear(node_online_map);
539#endif 703#endif
540 704
541#ifdef CONFIG_ACPI_NUMA 705#ifdef CONFIG_ACPI_NUMA
542 if (!numa_off && !acpi_scan_nodes(start_pfn << PAGE_SHIFT, 706 if (!numa_off && acpi && !acpi_scan_nodes(start_pfn << PAGE_SHIFT,
543 last_pfn << PAGE_SHIFT)) 707 last_pfn << PAGE_SHIFT))
544 return; 708 return;
545 nodes_clear(node_possible_map); 709 nodes_clear(node_possible_map);
546 nodes_clear(node_online_map); 710 nodes_clear(node_online_map);
547#endif 711#endif
548 712
549#ifdef CONFIG_K8_NUMA 713#ifdef CONFIG_K8_NUMA
550 if (!numa_off && !k8_scan_nodes(start_pfn<<PAGE_SHIFT, 714 if (!numa_off && k8 && !k8_scan_nodes())
551 last_pfn<<PAGE_SHIFT))
552 return; 715 return;
553 nodes_clear(node_possible_map); 716 nodes_clear(node_possible_map);
554 nodes_clear(node_online_map); 717 nodes_clear(node_online_map);
@@ -601,6 +764,25 @@ static __init int numa_setup(char *opt)
601early_param("numa", numa_setup); 764early_param("numa", numa_setup);
602 765
603#ifdef CONFIG_NUMA 766#ifdef CONFIG_NUMA
767
768static __init int find_near_online_node(int node)
769{
770 int n, val;
771 int min_val = INT_MAX;
772 int best_node = -1;
773
774 for_each_online_node(n) {
775 val = node_distance(node, n);
776
777 if (val < min_val) {
778 min_val = val;
779 best_node = n;
780 }
781 }
782
783 return best_node;
784}
785
604/* 786/*
605 * Setup early cpu_to_node. 787 * Setup early cpu_to_node.
606 * 788 *
@@ -632,7 +814,7 @@ void __init init_cpu_to_node(void)
632 if (node == NUMA_NO_NODE) 814 if (node == NUMA_NO_NODE)
633 continue; 815 continue;
634 if (!node_online(node)) 816 if (!node_online(node))
635 continue; 817 node = find_near_online_node(node);
636 numa_set_node(cpu, node); 818 numa_set_node(cpu, node);
637 } 819 }
638} 820}
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
index dd38bfbefd1f..1d4eb93d333c 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -279,6 +279,22 @@ static inline pgprot_t static_protections(pgprot_t prot, unsigned long address,
279 __pa((unsigned long)__end_rodata) >> PAGE_SHIFT)) 279 __pa((unsigned long)__end_rodata) >> PAGE_SHIFT))
280 pgprot_val(forbidden) |= _PAGE_RW; 280 pgprot_val(forbidden) |= _PAGE_RW;
281 281
282#if defined(CONFIG_X86_64) && defined(CONFIG_DEBUG_RODATA)
283 /*
284 * Once the kernel maps the text as RO (kernel_set_to_readonly is set),
285 * kernel text mappings for the large page aligned text, rodata sections
286 * will be always read-only. For the kernel identity mappings covering
287 * the holes caused by this alignment can be anything that user asks.
288 *
289 * This will preserve the large page mappings for kernel text/data
290 * at no extra cost.
291 */
292 if (kernel_set_to_readonly &&
293 within(address, (unsigned long)_text,
294 (unsigned long)__end_rodata_hpage_align))
295 pgprot_val(forbidden) |= _PAGE_RW;
296#endif
297
282 prot = __pgprot(pgprot_val(prot) & ~pgprot_val(forbidden)); 298 prot = __pgprot(pgprot_val(prot) & ~pgprot_val(forbidden));
283 299
284 return prot; 300 return prot;
@@ -1069,12 +1085,18 @@ EXPORT_SYMBOL(set_memory_array_wb);
1069 1085
1070int set_memory_x(unsigned long addr, int numpages) 1086int set_memory_x(unsigned long addr, int numpages)
1071{ 1087{
1088 if (!(__supported_pte_mask & _PAGE_NX))
1089 return 0;
1090
1072 return change_page_attr_clear(&addr, numpages, __pgprot(_PAGE_NX), 0); 1091 return change_page_attr_clear(&addr, numpages, __pgprot(_PAGE_NX), 0);
1073} 1092}
1074EXPORT_SYMBOL(set_memory_x); 1093EXPORT_SYMBOL(set_memory_x);
1075 1094
1076int set_memory_nx(unsigned long addr, int numpages) 1095int set_memory_nx(unsigned long addr, int numpages)
1077{ 1096{
1097 if (!(__supported_pte_mask & _PAGE_NX))
1098 return 0;
1099
1078 return change_page_attr_set(&addr, numpages, __pgprot(_PAGE_NX), 0); 1100 return change_page_attr_set(&addr, numpages, __pgprot(_PAGE_NX), 0);
1079} 1101}
1080EXPORT_SYMBOL(set_memory_nx); 1102EXPORT_SYMBOL(set_memory_nx);
diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c
index e78cd0ec2bcf..66b55d6e69ed 100644
--- a/arch/x86/mm/pat.c
+++ b/arch/x86/mm/pat.c
@@ -20,6 +20,7 @@
20#include <asm/cacheflush.h> 20#include <asm/cacheflush.h>
21#include <asm/processor.h> 21#include <asm/processor.h>
22#include <asm/tlbflush.h> 22#include <asm/tlbflush.h>
23#include <asm/x86_init.h>
23#include <asm/pgtable.h> 24#include <asm/pgtable.h>
24#include <asm/fcntl.h> 25#include <asm/fcntl.h>
25#include <asm/e820.h> 26#include <asm/e820.h>
@@ -355,9 +356,6 @@ static int free_ram_pages_type(u64 start, u64 end)
355 * - _PAGE_CACHE_UC_MINUS 356 * - _PAGE_CACHE_UC_MINUS
356 * - _PAGE_CACHE_UC 357 * - _PAGE_CACHE_UC
357 * 358 *
358 * req_type will have a special case value '-1', when requester want to inherit
359 * the memory type from mtrr (if WB), existing PAT, defaulting to UC_MINUS.
360 *
361 * If new_type is NULL, function will return an error if it cannot reserve the 359 * If new_type is NULL, function will return an error if it cannot reserve the
362 * region with req_type. If new_type is non-NULL, function will return 360 * region with req_type. If new_type is non-NULL, function will return
363 * available type in new_type in case of no error. In case of any error 361 * available type in new_type in case of no error. In case of any error
@@ -377,9 +375,7 @@ int reserve_memtype(u64 start, u64 end, unsigned long req_type,
377 if (!pat_enabled) { 375 if (!pat_enabled) {
378 /* This is identical to page table setting without PAT */ 376 /* This is identical to page table setting without PAT */
379 if (new_type) { 377 if (new_type) {
380 if (req_type == -1) 378 if (req_type == _PAGE_CACHE_WC)
381 *new_type = _PAGE_CACHE_WB;
382 else if (req_type == _PAGE_CACHE_WC)
383 *new_type = _PAGE_CACHE_UC_MINUS; 379 *new_type = _PAGE_CACHE_UC_MINUS;
384 else 380 else
385 *new_type = req_type & _PAGE_CACHE_MASK; 381 *new_type = req_type & _PAGE_CACHE_MASK;
@@ -388,7 +384,7 @@ int reserve_memtype(u64 start, u64 end, unsigned long req_type,
388 } 384 }
389 385
390 /* Low ISA region is always mapped WB in page table. No need to track */ 386 /* Low ISA region is always mapped WB in page table. No need to track */
391 if (is_ISA_range(start, end - 1)) { 387 if (x86_platform.is_untracked_pat_range(start, end)) {
392 if (new_type) 388 if (new_type)
393 *new_type = _PAGE_CACHE_WB; 389 *new_type = _PAGE_CACHE_WB;
394 return 0; 390 return 0;
@@ -499,7 +495,7 @@ int free_memtype(u64 start, u64 end)
499 return 0; 495 return 0;
500 496
501 /* Low ISA region is always mapped WB. No need to track */ 497 /* Low ISA region is always mapped WB. No need to track */
502 if (is_ISA_range(start, end - 1)) 498 if (x86_platform.is_untracked_pat_range(start, end))
503 return 0; 499 return 0;
504 500
505 is_range_ram = pat_pagerange_is_ram(start, end); 501 is_range_ram = pat_pagerange_is_ram(start, end);
@@ -582,7 +578,7 @@ static unsigned long lookup_memtype(u64 paddr)
582 int rettype = _PAGE_CACHE_WB; 578 int rettype = _PAGE_CACHE_WB;
583 struct memtype *entry; 579 struct memtype *entry;
584 580
585 if (is_ISA_range(paddr, paddr + PAGE_SIZE - 1)) 581 if (x86_platform.is_untracked_pat_range(paddr, paddr + PAGE_SIZE))
586 return rettype; 582 return rettype;
587 583
588 if (pat_pagerange_is_ram(paddr, paddr + PAGE_SIZE)) { 584 if (pat_pagerange_is_ram(paddr, paddr + PAGE_SIZE)) {
@@ -1018,8 +1014,10 @@ static const struct file_operations memtype_fops = {
1018 1014
1019static int __init pat_memtype_list_init(void) 1015static int __init pat_memtype_list_init(void)
1020{ 1016{
1021 debugfs_create_file("pat_memtype_list", S_IRUSR, arch_debugfs_dir, 1017 if (pat_enabled) {
1022 NULL, &memtype_fops); 1018 debugfs_create_file("pat_memtype_list", S_IRUSR,
1019 arch_debugfs_dir, NULL, &memtype_fops);
1020 }
1023 return 0; 1021 return 0;
1024} 1022}
1025 1023
diff --git a/arch/x86/mm/setup_nx.c b/arch/x86/mm/setup_nx.c
index 513d8ed5d2ec..a3250aa34086 100644
--- a/arch/x86/mm/setup_nx.c
+++ b/arch/x86/mm/setup_nx.c
@@ -3,10 +3,8 @@
3#include <linux/init.h> 3#include <linux/init.h>
4 4
5#include <asm/pgtable.h> 5#include <asm/pgtable.h>
6#include <asm/proto.h>
6 7
7int nx_enabled;
8
9#if defined(CONFIG_X86_64) || defined(CONFIG_X86_PAE)
10static int disable_nx __cpuinitdata; 8static int disable_nx __cpuinitdata;
11 9
12/* 10/*
@@ -22,48 +20,41 @@ static int __init noexec_setup(char *str)
22 if (!str) 20 if (!str)
23 return -EINVAL; 21 return -EINVAL;
24 if (!strncmp(str, "on", 2)) { 22 if (!strncmp(str, "on", 2)) {
25 __supported_pte_mask |= _PAGE_NX;
26 disable_nx = 0; 23 disable_nx = 0;
27 } else if (!strncmp(str, "off", 3)) { 24 } else if (!strncmp(str, "off", 3)) {
28 disable_nx = 1; 25 disable_nx = 1;
29 __supported_pte_mask &= ~_PAGE_NX;
30 } 26 }
27 x86_configure_nx();
31 return 0; 28 return 0;
32} 29}
33early_param("noexec", noexec_setup); 30early_param("noexec", noexec_setup);
34#endif
35 31
36#ifdef CONFIG_X86_PAE 32void __cpuinit x86_configure_nx(void)
37void __init set_nx(void)
38{ 33{
39 unsigned int v[4], l, h; 34 if (cpu_has_nx && !disable_nx)
40 35 __supported_pte_mask |= _PAGE_NX;
41 if (cpu_has_pae && (cpuid_eax(0x80000000) > 0x80000001)) { 36 else
42 cpuid(0x80000001, &v[0], &v[1], &v[2], &v[3]); 37 __supported_pte_mask &= ~_PAGE_NX;
38}
43 39
44 if ((v[3] & (1 << 20)) && !disable_nx) { 40void __init x86_report_nx(void)
45 rdmsr(MSR_EFER, l, h); 41{
46 l |= EFER_NX; 42 if (!cpu_has_nx) {
47 wrmsr(MSR_EFER, l, h); 43 printk(KERN_NOTICE "Notice: NX (Execute Disable) protection "
48 nx_enabled = 1; 44 "missing in CPU or disabled in BIOS!\n");
49 __supported_pte_mask |= _PAGE_NX; 45 } else {
46#if defined(CONFIG_X86_64) || defined(CONFIG_X86_PAE)
47 if (disable_nx) {
48 printk(KERN_INFO "NX (Execute Disable) protection: "
49 "disabled by kernel command line option\n");
50 } else {
51 printk(KERN_INFO "NX (Execute Disable) protection: "
52 "active\n");
50 } 53 }
51 }
52}
53#else 54#else
54void set_nx(void) 55 /* 32bit non-PAE kernel, NX cannot be used */
55{ 56 printk(KERN_NOTICE "Notice: NX (Execute Disable) protection "
56} 57 "cannot be enabled: non-PAE kernel!\n");
57#endif 58#endif
58 59 }
59#ifdef CONFIG_X86_64
60void __cpuinit check_efer(void)
61{
62 unsigned long efer;
63
64 rdmsrl(MSR_EFER, efer);
65 if (!(efer & EFER_NX) || disable_nx)
66 __supported_pte_mask &= ~_PAGE_NX;
67} 60}
68#endif
69
diff --git a/arch/x86/mm/srat_64.c b/arch/x86/mm/srat_64.c
index dbb5381f7b3b..d89075489664 100644
--- a/arch/x86/mm/srat_64.c
+++ b/arch/x86/mm/srat_64.c
@@ -136,7 +136,7 @@ acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa)
136 apicid_to_node[apic_id] = node; 136 apicid_to_node[apic_id] = node;
137 node_set(node, cpu_nodes_parsed); 137 node_set(node, cpu_nodes_parsed);
138 acpi_numa = 1; 138 acpi_numa = 1;
139 printk(KERN_INFO "SRAT: PXM %u -> APIC %u -> Node %u\n", 139 printk(KERN_INFO "SRAT: PXM %u -> APIC 0x%04x -> Node %u\n",
140 pxm, apic_id, node); 140 pxm, apic_id, node);
141} 141}
142 142
@@ -170,7 +170,7 @@ acpi_numa_processor_affinity_init(struct acpi_srat_cpu_affinity *pa)
170 apicid_to_node[apic_id] = node; 170 apicid_to_node[apic_id] = node;
171 node_set(node, cpu_nodes_parsed); 171 node_set(node, cpu_nodes_parsed);
172 acpi_numa = 1; 172 acpi_numa = 1;
173 printk(KERN_INFO "SRAT: PXM %u -> APIC %u -> Node %u\n", 173 printk(KERN_INFO "SRAT: PXM %u -> APIC 0x%02x -> Node %u\n",
174 pxm, apic_id, node); 174 pxm, apic_id, node);
175} 175}
176 176
@@ -290,8 +290,6 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
290 290
291 printk(KERN_INFO "SRAT: Node %u PXM %u %lx-%lx\n", node, pxm, 291 printk(KERN_INFO "SRAT: Node %u PXM %u %lx-%lx\n", node, pxm,
292 start, end); 292 start, end);
293 e820_register_active_regions(node, start >> PAGE_SHIFT,
294 end >> PAGE_SHIFT);
295 293
296 if (ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE) { 294 if (ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE) {
297 update_nodes_add(node, start, end); 295 update_nodes_add(node, start, end);
@@ -338,6 +336,19 @@ static int __init nodes_cover_memory(const struct bootnode *nodes)
338 336
339void __init acpi_numa_arch_fixup(void) {} 337void __init acpi_numa_arch_fixup(void) {}
340 338
339int __init acpi_get_nodes(struct bootnode *physnodes)
340{
341 int i;
342 int ret = 0;
343
344 for_each_node_mask(i, nodes_parsed) {
345 physnodes[ret].start = nodes[i].start;
346 physnodes[ret].end = nodes[i].end;
347 ret++;
348 }
349 return ret;
350}
351
341/* Use the information discovered above to actually set up the nodes. */ 352/* Use the information discovered above to actually set up the nodes. */
342int __init acpi_scan_nodes(unsigned long start, unsigned long end) 353int __init acpi_scan_nodes(unsigned long start, unsigned long end)
343{ 354{
@@ -350,11 +361,6 @@ int __init acpi_scan_nodes(unsigned long start, unsigned long end)
350 for (i = 0; i < MAX_NUMNODES; i++) 361 for (i = 0; i < MAX_NUMNODES; i++)
351 cutoff_node(i, start, end); 362 cutoff_node(i, start, end);
352 363
353 if (!nodes_cover_memory(nodes)) {
354 bad_srat();
355 return -1;
356 }
357
358 memnode_shift = compute_hash_shift(node_memblk_range, num_node_memblks, 364 memnode_shift = compute_hash_shift(node_memblk_range, num_node_memblks,
359 memblk_nodeid); 365 memblk_nodeid);
360 if (memnode_shift < 0) { 366 if (memnode_shift < 0) {
@@ -364,6 +370,14 @@ int __init acpi_scan_nodes(unsigned long start, unsigned long end)
364 return -1; 370 return -1;
365 } 371 }
366 372
373 for_each_node_mask(i, nodes_parsed)
374 e820_register_active_regions(i, nodes[i].start >> PAGE_SHIFT,
375 nodes[i].end >> PAGE_SHIFT);
376 if (!nodes_cover_memory(nodes)) {
377 bad_srat();
378 return -1;
379 }
380
367 /* Account for nodes with cpus and no memory */ 381 /* Account for nodes with cpus and no memory */
368 nodes_or(node_possible_map, nodes_parsed, cpu_nodes_parsed); 382 nodes_or(node_possible_map, nodes_parsed, cpu_nodes_parsed);
369 383
@@ -454,7 +468,6 @@ void __init acpi_fake_nodes(const struct bootnode *fake_nodes, int num_nodes)
454 for (i = 0; i < num_nodes; i++) 468 for (i = 0; i < num_nodes; i++)
455 if (fake_nodes[i].start != fake_nodes[i].end) 469 if (fake_nodes[i].start != fake_nodes[i].end)
456 node_set(i, nodes_parsed); 470 node_set(i, nodes_parsed);
457 WARN_ON(!nodes_cover_memory(fake_nodes));
458} 471}
459 472
460static int null_slit_node_compare(int a, int b) 473static int null_slit_node_compare(int a, int b)
diff --git a/arch/x86/mm/testmmiotrace.c b/arch/x86/mm/testmmiotrace.c
index 427fd1b56df5..8565d944f7cf 100644
--- a/arch/x86/mm/testmmiotrace.c
+++ b/arch/x86/mm/testmmiotrace.c
@@ -1,12 +1,13 @@
1/* 1/*
2 * Written by Pekka Paalanen, 2008-2009 <pq@iki.fi> 2 * Written by Pekka Paalanen, 2008-2009 <pq@iki.fi>
3 */ 3 */
4
5#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
6
4#include <linux/module.h> 7#include <linux/module.h>
5#include <linux/io.h> 8#include <linux/io.h>
6#include <linux/mmiotrace.h> 9#include <linux/mmiotrace.h>
7 10
8#define MODULE_NAME "testmmiotrace"
9
10static unsigned long mmio_address; 11static unsigned long mmio_address;
11module_param(mmio_address, ulong, 0); 12module_param(mmio_address, ulong, 0);
12MODULE_PARM_DESC(mmio_address, " Start address of the mapping of 16 kB " 13MODULE_PARM_DESC(mmio_address, " Start address of the mapping of 16 kB "
@@ -30,7 +31,7 @@ static unsigned v32(unsigned i)
30static void do_write_test(void __iomem *p) 31static void do_write_test(void __iomem *p)
31{ 32{
32 unsigned int i; 33 unsigned int i;
33 pr_info(MODULE_NAME ": write test.\n"); 34 pr_info("write test.\n");
34 mmiotrace_printk("Write test.\n"); 35 mmiotrace_printk("Write test.\n");
35 36
36 for (i = 0; i < 256; i++) 37 for (i = 0; i < 256; i++)
@@ -47,7 +48,7 @@ static void do_read_test(void __iomem *p)
47{ 48{
48 unsigned int i; 49 unsigned int i;
49 unsigned errs[3] = { 0 }; 50 unsigned errs[3] = { 0 };
50 pr_info(MODULE_NAME ": read test.\n"); 51 pr_info("read test.\n");
51 mmiotrace_printk("Read test.\n"); 52 mmiotrace_printk("Read test.\n");
52 53
53 for (i = 0; i < 256; i++) 54 for (i = 0; i < 256; i++)
@@ -68,7 +69,7 @@ static void do_read_test(void __iomem *p)
68 69
69static void do_read_far_test(void __iomem *p) 70static void do_read_far_test(void __iomem *p)
70{ 71{
71 pr_info(MODULE_NAME ": read far test.\n"); 72 pr_info("read far test.\n");
72 mmiotrace_printk("Read far test.\n"); 73 mmiotrace_printk("Read far test.\n");
73 74
74 ioread32(p + read_far); 75 ioread32(p + read_far);
@@ -78,7 +79,7 @@ static void do_test(unsigned long size)
78{ 79{
79 void __iomem *p = ioremap_nocache(mmio_address, size); 80 void __iomem *p = ioremap_nocache(mmio_address, size);
80 if (!p) { 81 if (!p) {
81 pr_err(MODULE_NAME ": could not ioremap, aborting.\n"); 82 pr_err("could not ioremap, aborting.\n");
82 return; 83 return;
83 } 84 }
84 mmiotrace_printk("ioremap returned %p.\n", p); 85 mmiotrace_printk("ioremap returned %p.\n", p);
@@ -94,24 +95,22 @@ static int __init init(void)
94 unsigned long size = (read_far) ? (8 << 20) : (16 << 10); 95 unsigned long size = (read_far) ? (8 << 20) : (16 << 10);
95 96
96 if (mmio_address == 0) { 97 if (mmio_address == 0) {
97 pr_err(MODULE_NAME ": you have to use the module argument " 98 pr_err("you have to use the module argument mmio_address.\n");
98 "mmio_address.\n"); 99 pr_err("DO NOT LOAD THIS MODULE UNLESS YOU REALLY KNOW WHAT YOU ARE DOING!\n");
99 pr_err(MODULE_NAME ": DO NOT LOAD THIS MODULE UNLESS"
100 " YOU REALLY KNOW WHAT YOU ARE DOING!\n");
101 return -ENXIO; 100 return -ENXIO;
102 } 101 }
103 102
104 pr_warning(MODULE_NAME ": WARNING: mapping %lu kB @ 0x%08lx in PCI " 103 pr_warning("WARNING: mapping %lu kB @ 0x%08lx in PCI address space, "
105 "address space, and writing 16 kB of rubbish in there.\n", 104 "and writing 16 kB of rubbish in there.\n",
106 size >> 10, mmio_address); 105 size >> 10, mmio_address);
107 do_test(size); 106 do_test(size);
108 pr_info(MODULE_NAME ": All done.\n"); 107 pr_info("All done.\n");
109 return 0; 108 return 0;
110} 109}
111 110
112static void __exit cleanup(void) 111static void __exit cleanup(void)
113{ 112{
114 pr_debug(MODULE_NAME ": unloaded.\n"); 113 pr_debug("unloaded.\n");
115} 114}
116 115
117module_init(init); 116module_init(init);
diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c
index 36fe08eeb5c3..65b58e4b0b8b 100644
--- a/arch/x86/mm/tlb.c
+++ b/arch/x86/mm/tlb.c
@@ -8,6 +8,7 @@
8 8
9#include <asm/tlbflush.h> 9#include <asm/tlbflush.h>
10#include <asm/mmu_context.h> 10#include <asm/mmu_context.h>
11#include <asm/cache.h>
11#include <asm/apic.h> 12#include <asm/apic.h>
12#include <asm/uv/uv.h> 13#include <asm/uv/uv.h>
13 14
@@ -43,7 +44,7 @@ union smp_flush_state {
43 spinlock_t tlbstate_lock; 44 spinlock_t tlbstate_lock;
44 DECLARE_BITMAP(flush_cpumask, NR_CPUS); 45 DECLARE_BITMAP(flush_cpumask, NR_CPUS);
45 }; 46 };
46 char pad[CONFIG_X86_INTERNODE_CACHE_BYTES]; 47 char pad[INTERNODE_CACHE_BYTES];
47} ____cacheline_internodealigned_in_smp; 48} ____cacheline_internodealigned_in_smp;
48 49
49/* State is put into the per CPU data section, but padded 50/* State is put into the per CPU data section, but padded
diff --git a/arch/x86/power/cpu.c b/arch/x86/power/cpu.c
index 8aa85f17667e..0a979f3e5b8a 100644
--- a/arch/x86/power/cpu.c
+++ b/arch/x86/power/cpu.c
@@ -18,6 +18,7 @@
18#include <asm/mce.h> 18#include <asm/mce.h>
19#include <asm/xcr.h> 19#include <asm/xcr.h>
20#include <asm/suspend.h> 20#include <asm/suspend.h>
21#include <asm/debugreg.h>
21 22
22#ifdef CONFIG_X86_32 23#ifdef CONFIG_X86_32
23static struct saved_context saved_context; 24static struct saved_context saved_context;
@@ -142,31 +143,6 @@ static void fix_processor_context(void)
142#endif 143#endif
143 load_TR_desc(); /* This does ltr */ 144 load_TR_desc(); /* This does ltr */
144 load_LDT(&current->active_mm->context); /* This does lldt */ 145 load_LDT(&current->active_mm->context); /* This does lldt */
145
146 /*
147 * Now maybe reload the debug registers
148 */
149 if (current->thread.debugreg7) {
150#ifdef CONFIG_X86_32
151 set_debugreg(current->thread.debugreg0, 0);
152 set_debugreg(current->thread.debugreg1, 1);
153 set_debugreg(current->thread.debugreg2, 2);
154 set_debugreg(current->thread.debugreg3, 3);
155 /* no 4 and 5 */
156 set_debugreg(current->thread.debugreg6, 6);
157 set_debugreg(current->thread.debugreg7, 7);
158#else
159 /* CONFIG_X86_64 */
160 loaddebug(&current->thread, 0);
161 loaddebug(&current->thread, 1);
162 loaddebug(&current->thread, 2);
163 loaddebug(&current->thread, 3);
164 /* no 4 and 5 */
165 loaddebug(&current->thread, 6);
166 loaddebug(&current->thread, 7);
167#endif
168 }
169
170} 146}
171 147
172/** 148/**
diff --git a/arch/x86/tools/Makefile b/arch/x86/tools/Makefile
new file mode 100644
index 000000000000..f82082677337
--- /dev/null
+++ b/arch/x86/tools/Makefile
@@ -0,0 +1,31 @@
1PHONY += posttest
2
3ifeq ($(KBUILD_VERBOSE),1)
4 posttest_verbose = -v
5else
6 posttest_verbose =
7endif
8
9ifeq ($(CONFIG_64BIT),y)
10 posttest_64bit = -y
11else
12 posttest_64bit = -n
13endif
14
15distill_awk = $(srctree)/arch/x86/tools/distill.awk
16chkobjdump = $(srctree)/arch/x86/tools/chkobjdump.awk
17
18quiet_cmd_posttest = TEST $@
19 cmd_posttest = ($(OBJDUMP) -v | $(AWK) -f $(chkobjdump)) || $(OBJDUMP) -d -j .text $(objtree)/vmlinux | $(AWK) -f $(distill_awk) | $(obj)/test_get_len $(posttest_64bit) $(posttest_verbose)
20
21posttest: $(obj)/test_get_len vmlinux
22 $(call cmd,posttest)
23
24hostprogs-y := test_get_len
25
26# -I needed for generated C source and C source which in the kernel tree.
27HOSTCFLAGS_test_get_len.o := -Wall -I$(objtree)/arch/x86/lib/ -I$(srctree)/arch/x86/include/ -I$(srctree)/arch/x86/lib/ -I$(srctree)/include/
28
29# Dependencies are also needed.
30$(obj)/test_get_len.o: $(srctree)/arch/x86/lib/insn.c $(srctree)/arch/x86/lib/inat.c $(srctree)/arch/x86/include/asm/inat_types.h $(srctree)/arch/x86/include/asm/inat.h $(srctree)/arch/x86/include/asm/insn.h $(objtree)/arch/x86/lib/inat-tables.c
31
diff --git a/arch/x86/tools/chkobjdump.awk b/arch/x86/tools/chkobjdump.awk
new file mode 100644
index 000000000000..0d13cd9fdcff
--- /dev/null
+++ b/arch/x86/tools/chkobjdump.awk
@@ -0,0 +1,23 @@
1# GNU objdump version checker
2#
3# Usage:
4# objdump -v | awk -f chkobjdump.awk
5BEGIN {
6 # objdump version 2.19 or later is OK for the test.
7 od_ver = 2;
8 od_sver = 19;
9}
10
11/^GNU/ {
12 split($4, ver, ".");
13 if (ver[1] > od_ver ||
14 (ver[1] == od_ver && ver[2] >= od_sver)) {
15 exit 1;
16 } else {
17 printf("Warning: objdump version %s is older than %d.%d\n",
18 $4, od_ver, od_sver);
19 print("Warning: Skipping posttest.");
20 # Logic is inverted, because we just skip test without error.
21 exit 0;
22 }
23}
diff --git a/arch/x86/tools/distill.awk b/arch/x86/tools/distill.awk
new file mode 100644
index 000000000000..c13c0ee48ab4
--- /dev/null
+++ b/arch/x86/tools/distill.awk
@@ -0,0 +1,47 @@
1#!/bin/awk -f
2# Usage: objdump -d a.out | awk -f distill.awk | ./test_get_len
3# Distills the disassembly as follows:
4# - Removes all lines except the disassembled instructions.
5# - For instructions that exceed 1 line (7 bytes), crams all the hex bytes
6# into a single line.
7# - Remove bad(or prefix only) instructions
8
9BEGIN {
10 prev_addr = ""
11 prev_hex = ""
12 prev_mnemonic = ""
13 bad_expr = "(\\(bad\\)|^rex|^.byte|^rep(z|nz)$|^lock$|^es$|^cs$|^ss$|^ds$|^fs$|^gs$|^data(16|32)$|^addr(16|32|64))"
14 fwait_expr = "^9b "
15 fwait_str="9b\tfwait"
16}
17
18/^ *[0-9a-f]+ <[^>]*>:/ {
19 # Symbol entry
20 printf("%s%s\n", $2, $1)
21}
22
23/^ *[0-9a-f]+:/ {
24 if (split($0, field, "\t") < 3) {
25 # This is a continuation of the same insn.
26 prev_hex = prev_hex field[2]
27 } else {
28 # Skip bad instructions
29 if (match(prev_mnemonic, bad_expr))
30 prev_addr = ""
31 # Split fwait from other f* instructions
32 if (match(prev_hex, fwait_expr) && prev_mnemonic != "fwait") {
33 printf "%s\t%s\n", prev_addr, fwait_str
34 sub(fwait_expr, "", prev_hex)
35 }
36 if (prev_addr != "")
37 printf "%s\t%s\t%s\n", prev_addr, prev_hex, prev_mnemonic
38 prev_addr = field[1]
39 prev_hex = field[2]
40 prev_mnemonic = field[3]
41 }
42}
43
44END {
45 if (prev_addr != "")
46 printf "%s\t%s\t%s\n", prev_addr, prev_hex, prev_mnemonic
47}
diff --git a/arch/x86/tools/gen-insn-attr-x86.awk b/arch/x86/tools/gen-insn-attr-x86.awk
new file mode 100644
index 000000000000..e34e92a28eb6
--- /dev/null
+++ b/arch/x86/tools/gen-insn-attr-x86.awk
@@ -0,0 +1,380 @@
1#!/bin/awk -f
2# gen-insn-attr-x86.awk: Instruction attribute table generator
3# Written by Masami Hiramatsu <mhiramat@redhat.com>
4#
5# Usage: awk -f gen-insn-attr-x86.awk x86-opcode-map.txt > inat-tables.c
6
7# Awk implementation sanity check
8function check_awk_implement() {
9 if (!match("abc", "[[:lower:]]+"))
10 return "Your awk doesn't support charactor-class."
11 if (sprintf("%x", 0) != "0")
12 return "Your awk has a printf-format problem."
13 return ""
14}
15
16# Clear working vars
17function clear_vars() {
18 delete table
19 delete lptable2
20 delete lptable1
21 delete lptable3
22 eid = -1 # escape id
23 gid = -1 # group id
24 aid = -1 # AVX id
25 tname = ""
26}
27
28BEGIN {
29 # Implementation error checking
30 awkchecked = check_awk_implement()
31 if (awkchecked != "") {
32 print "Error: " awkchecked > "/dev/stderr"
33 print "Please try to use gawk." > "/dev/stderr"
34 exit 1
35 }
36
37 # Setup generating tables
38 print "/* x86 opcode map generated from x86-opcode-map.txt */"
39 print "/* Do not change this code. */\n"
40 ggid = 1
41 geid = 1
42 gaid = 0
43 delete etable
44 delete gtable
45 delete atable
46
47 opnd_expr = "^[[:alpha:]/]"
48 ext_expr = "^\\("
49 sep_expr = "^\\|$"
50 group_expr = "^Grp[[:alnum:]]+"
51
52 imm_expr = "^[IJAO][[:lower:]]"
53 imm_flag["Ib"] = "INAT_MAKE_IMM(INAT_IMM_BYTE)"
54 imm_flag["Jb"] = "INAT_MAKE_IMM(INAT_IMM_BYTE)"
55 imm_flag["Iw"] = "INAT_MAKE_IMM(INAT_IMM_WORD)"
56 imm_flag["Id"] = "INAT_MAKE_IMM(INAT_IMM_DWORD)"
57 imm_flag["Iq"] = "INAT_MAKE_IMM(INAT_IMM_QWORD)"
58 imm_flag["Ap"] = "INAT_MAKE_IMM(INAT_IMM_PTR)"
59 imm_flag["Iz"] = "INAT_MAKE_IMM(INAT_IMM_VWORD32)"
60 imm_flag["Jz"] = "INAT_MAKE_IMM(INAT_IMM_VWORD32)"
61 imm_flag["Iv"] = "INAT_MAKE_IMM(INAT_IMM_VWORD)"
62 imm_flag["Ob"] = "INAT_MOFFSET"
63 imm_flag["Ov"] = "INAT_MOFFSET"
64
65 modrm_expr = "^([CDEGMNPQRSUVW/][[:lower:]]+|NTA|T[012])"
66 force64_expr = "\\([df]64\\)"
67 rex_expr = "^REX(\\.[XRWB]+)*"
68 fpu_expr = "^ESC" # TODO
69
70 lprefix1_expr = "\\(66\\)"
71 lprefix2_expr = "\\(F3\\)"
72 lprefix3_expr = "\\(F2\\)"
73 max_lprefix = 4
74
75 vexok_expr = "\\(VEX\\)"
76 vexonly_expr = "\\(oVEX\\)"
77
78 prefix_expr = "\\(Prefix\\)"
79 prefix_num["Operand-Size"] = "INAT_PFX_OPNDSZ"
80 prefix_num["REPNE"] = "INAT_PFX_REPNE"
81 prefix_num["REP/REPE"] = "INAT_PFX_REPE"
82 prefix_num["LOCK"] = "INAT_PFX_LOCK"
83 prefix_num["SEG=CS"] = "INAT_PFX_CS"
84 prefix_num["SEG=DS"] = "INAT_PFX_DS"
85 prefix_num["SEG=ES"] = "INAT_PFX_ES"
86 prefix_num["SEG=FS"] = "INAT_PFX_FS"
87 prefix_num["SEG=GS"] = "INAT_PFX_GS"
88 prefix_num["SEG=SS"] = "INAT_PFX_SS"
89 prefix_num["Address-Size"] = "INAT_PFX_ADDRSZ"
90 prefix_num["2bytes-VEX"] = "INAT_PFX_VEX2"
91 prefix_num["3bytes-VEX"] = "INAT_PFX_VEX3"
92
93 clear_vars()
94}
95
96function semantic_error(msg) {
97 print "Semantic error at " NR ": " msg > "/dev/stderr"
98 exit 1
99}
100
101function debug(msg) {
102 print "DEBUG: " msg
103}
104
105function array_size(arr, i,c) {
106 c = 0
107 for (i in arr)
108 c++
109 return c
110}
111
112/^Table:/ {
113 print "/* " $0 " */"
114 if (tname != "")
115 semantic_error("Hit Table: before EndTable:.");
116}
117
118/^Referrer:/ {
119 if (NF != 1) {
120 # escape opcode table
121 ref = ""
122 for (i = 2; i <= NF; i++)
123 ref = ref $i
124 eid = escape[ref]
125 tname = sprintf("inat_escape_table_%d", eid)
126 }
127}
128
129/^AVXcode:/ {
130 if (NF != 1) {
131 # AVX/escape opcode table
132 aid = $2
133 if (gaid <= aid)
134 gaid = aid + 1
135 if (tname == "") # AVX only opcode table
136 tname = sprintf("inat_avx_table_%d", $2)
137 }
138 if (aid == -1 && eid == -1) # primary opcode table
139 tname = "inat_primary_table"
140}
141
142/^GrpTable:/ {
143 print "/* " $0 " */"
144 if (!($2 in group))
145 semantic_error("No group: " $2 )
146 gid = group[$2]
147 tname = "inat_group_table_" gid
148}
149
150function print_table(tbl,name,fmt,n)
151{
152 print "const insn_attr_t " name " = {"
153 for (i = 0; i < n; i++) {
154 id = sprintf(fmt, i)
155 if (tbl[id])
156 print " [" id "] = " tbl[id] ","
157 }
158 print "};"
159}
160
161/^EndTable/ {
162 if (gid != -1) {
163 # print group tables
164 if (array_size(table) != 0) {
165 print_table(table, tname "[INAT_GROUP_TABLE_SIZE]",
166 "0x%x", 8)
167 gtable[gid,0] = tname
168 }
169 if (array_size(lptable1) != 0) {
170 print_table(lptable1, tname "_1[INAT_GROUP_TABLE_SIZE]",
171 "0x%x", 8)
172 gtable[gid,1] = tname "_1"
173 }
174 if (array_size(lptable2) != 0) {
175 print_table(lptable2, tname "_2[INAT_GROUP_TABLE_SIZE]",
176 "0x%x", 8)
177 gtable[gid,2] = tname "_2"
178 }
179 if (array_size(lptable3) != 0) {
180 print_table(lptable3, tname "_3[INAT_GROUP_TABLE_SIZE]",
181 "0x%x", 8)
182 gtable[gid,3] = tname "_3"
183 }
184 } else {
185 # print primary/escaped tables
186 if (array_size(table) != 0) {
187 print_table(table, tname "[INAT_OPCODE_TABLE_SIZE]",
188 "0x%02x", 256)
189 etable[eid,0] = tname
190 if (aid >= 0)
191 atable[aid,0] = tname
192 }
193 if (array_size(lptable1) != 0) {
194 print_table(lptable1,tname "_1[INAT_OPCODE_TABLE_SIZE]",
195 "0x%02x", 256)
196 etable[eid,1] = tname "_1"
197 if (aid >= 0)
198 atable[aid,1] = tname "_1"
199 }
200 if (array_size(lptable2) != 0) {
201 print_table(lptable2,tname "_2[INAT_OPCODE_TABLE_SIZE]",
202 "0x%02x", 256)
203 etable[eid,2] = tname "_2"
204 if (aid >= 0)
205 atable[aid,2] = tname "_2"
206 }
207 if (array_size(lptable3) != 0) {
208 print_table(lptable3,tname "_3[INAT_OPCODE_TABLE_SIZE]",
209 "0x%02x", 256)
210 etable[eid,3] = tname "_3"
211 if (aid >= 0)
212 atable[aid,3] = tname "_3"
213 }
214 }
215 print ""
216 clear_vars()
217}
218
219function add_flags(old,new) {
220 if (old && new)
221 return old " | " new
222 else if (old)
223 return old
224 else
225 return new
226}
227
228# convert operands to flags.
229function convert_operands(opnd, i,imm,mod)
230{
231 imm = null
232 mod = null
233 for (i in opnd) {
234 i = opnd[i]
235 if (match(i, imm_expr) == 1) {
236 if (!imm_flag[i])
237 semantic_error("Unknown imm opnd: " i)
238 if (imm) {
239 if (i != "Ib")
240 semantic_error("Second IMM error")
241 imm = add_flags(imm, "INAT_SCNDIMM")
242 } else
243 imm = imm_flag[i]
244 } else if (match(i, modrm_expr))
245 mod = "INAT_MODRM"
246 }
247 return add_flags(imm, mod)
248}
249
250/^[0-9a-f]+\:/ {
251 if (NR == 1)
252 next
253 # get index
254 idx = "0x" substr($1, 1, index($1,":") - 1)
255 if (idx in table)
256 semantic_error("Redefine " idx " in " tname)
257
258 # check if escaped opcode
259 if ("escape" == $2) {
260 if ($3 != "#")
261 semantic_error("No escaped name")
262 ref = ""
263 for (i = 4; i <= NF; i++)
264 ref = ref $i
265 if (ref in escape)
266 semantic_error("Redefine escape (" ref ")")
267 escape[ref] = geid
268 geid++
269 table[idx] = "INAT_MAKE_ESCAPE(" escape[ref] ")"
270 next
271 }
272
273 variant = null
274 # converts
275 i = 2
276 while (i <= NF) {
277 opcode = $(i++)
278 delete opnds
279 ext = null
280 flags = null
281 opnd = null
282 # parse one opcode
283 if (match($i, opnd_expr)) {
284 opnd = $i
285 split($(i++), opnds, ",")
286 flags = convert_operands(opnds)
287 }
288 if (match($i, ext_expr))
289 ext = $(i++)
290 if (match($i, sep_expr))
291 i++
292 else if (i < NF)
293 semantic_error($i " is not a separator")
294
295 # check if group opcode
296 if (match(opcode, group_expr)) {
297 if (!(opcode in group)) {
298 group[opcode] = ggid
299 ggid++
300 }
301 flags = add_flags(flags, "INAT_MAKE_GROUP(" group[opcode] ")")
302 }
303 # check force(or default) 64bit
304 if (match(ext, force64_expr))
305 flags = add_flags(flags, "INAT_FORCE64")
306
307 # check REX prefix
308 if (match(opcode, rex_expr))
309 flags = add_flags(flags, "INAT_MAKE_PREFIX(INAT_PFX_REX)")
310
311 # check coprocessor escape : TODO
312 if (match(opcode, fpu_expr))
313 flags = add_flags(flags, "INAT_MODRM")
314
315 # check VEX only code
316 if (match(ext, vexonly_expr))
317 flags = add_flags(flags, "INAT_VEXOK | INAT_VEXONLY")
318
319 # check VEX only code
320 if (match(ext, vexok_expr))
321 flags = add_flags(flags, "INAT_VEXOK")
322
323 # check prefixes
324 if (match(ext, prefix_expr)) {
325 if (!prefix_num[opcode])
326 semantic_error("Unknown prefix: " opcode)
327 flags = add_flags(flags, "INAT_MAKE_PREFIX(" prefix_num[opcode] ")")
328 }
329 if (length(flags) == 0)
330 continue
331 # check if last prefix
332 if (match(ext, lprefix1_expr)) {
333 lptable1[idx] = add_flags(lptable1[idx],flags)
334 variant = "INAT_VARIANT"
335 } else if (match(ext, lprefix2_expr)) {
336 lptable2[idx] = add_flags(lptable2[idx],flags)
337 variant = "INAT_VARIANT"
338 } else if (match(ext, lprefix3_expr)) {
339 lptable3[idx] = add_flags(lptable3[idx],flags)
340 variant = "INAT_VARIANT"
341 } else {
342 table[idx] = add_flags(table[idx],flags)
343 }
344 }
345 if (variant)
346 table[idx] = add_flags(table[idx],variant)
347}
348
349END {
350 if (awkchecked != "")
351 exit 1
352 # print escape opcode map's array
353 print "/* Escape opcode map array */"
354 print "const insn_attr_t const *inat_escape_tables[INAT_ESC_MAX + 1]" \
355 "[INAT_LSTPFX_MAX + 1] = {"
356 for (i = 0; i < geid; i++)
357 for (j = 0; j < max_lprefix; j++)
358 if (etable[i,j])
359 print " ["i"]["j"] = "etable[i,j]","
360 print "};\n"
361 # print group opcode map's array
362 print "/* Group opcode map array */"
363 print "const insn_attr_t const *inat_group_tables[INAT_GRP_MAX + 1]"\
364 "[INAT_LSTPFX_MAX + 1] = {"
365 for (i = 0; i < ggid; i++)
366 for (j = 0; j < max_lprefix; j++)
367 if (gtable[i,j])
368 print " ["i"]["j"] = "gtable[i,j]","
369 print "};\n"
370 # print AVX opcode map's array
371 print "/* AVX opcode map array */"
372 print "const insn_attr_t const *inat_avx_tables[X86_VEX_M_MAX + 1]"\
373 "[INAT_LSTPFX_MAX + 1] = {"
374 for (i = 0; i < gaid; i++)
375 for (j = 0; j < max_lprefix; j++)
376 if (atable[i,j])
377 print " ["i"]["j"] = "atable[i,j]","
378 print "};"
379}
380
diff --git a/arch/x86/tools/test_get_len.c b/arch/x86/tools/test_get_len.c
new file mode 100644
index 000000000000..d8214dc03fa7
--- /dev/null
+++ b/arch/x86/tools/test_get_len.c
@@ -0,0 +1,173 @@
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
15 *
16 * Copyright (C) IBM Corporation, 2009
17 */
18
19#include <stdlib.h>
20#include <stdio.h>
21#include <string.h>
22#include <assert.h>
23#include <unistd.h>
24
25#define unlikely(cond) (cond)
26
27#include <asm/insn.h>
28#include <inat.c>
29#include <insn.c>
30
31/*
32 * Test of instruction analysis in general and insn_get_length() in
33 * particular. See if insn_get_length() and the disassembler agree
34 * on the length of each instruction in an elf disassembly.
35 *
36 * Usage: objdump -d a.out | awk -f distill.awk | ./test_get_len
37 */
38
39const char *prog;
40static int verbose;
41static int x86_64;
42
43static void usage(void)
44{
45 fprintf(stderr, "Usage: objdump -d a.out | awk -f distill.awk |"
46 " %s [-y|-n] [-v] \n", prog);
47 fprintf(stderr, "\t-y 64bit mode\n");
48 fprintf(stderr, "\t-n 32bit mode\n");
49 fprintf(stderr, "\t-v verbose mode\n");
50 exit(1);
51}
52
53static void malformed_line(const char *line, int line_nr)
54{
55 fprintf(stderr, "%s: malformed line %d:\n%s", prog, line_nr, line);
56 exit(3);
57}
58
59static void dump_field(FILE *fp, const char *name, const char *indent,
60 struct insn_field *field)
61{
62 fprintf(fp, "%s.%s = {\n", indent, name);
63 fprintf(fp, "%s\t.value = %d, bytes[] = {%x, %x, %x, %x},\n",
64 indent, field->value, field->bytes[0], field->bytes[1],
65 field->bytes[2], field->bytes[3]);
66 fprintf(fp, "%s\t.got = %d, .nbytes = %d},\n", indent,
67 field->got, field->nbytes);
68}
69
70static void dump_insn(FILE *fp, struct insn *insn)
71{
72 fprintf(fp, "Instruction = { \n");
73 dump_field(fp, "prefixes", "\t", &insn->prefixes);
74 dump_field(fp, "rex_prefix", "\t", &insn->rex_prefix);
75 dump_field(fp, "vex_prefix", "\t", &insn->vex_prefix);
76 dump_field(fp, "opcode", "\t", &insn->opcode);
77 dump_field(fp, "modrm", "\t", &insn->modrm);
78 dump_field(fp, "sib", "\t", &insn->sib);
79 dump_field(fp, "displacement", "\t", &insn->displacement);
80 dump_field(fp, "immediate1", "\t", &insn->immediate1);
81 dump_field(fp, "immediate2", "\t", &insn->immediate2);
82 fprintf(fp, "\t.attr = %x, .opnd_bytes = %d, .addr_bytes = %d,\n",
83 insn->attr, insn->opnd_bytes, insn->addr_bytes);
84 fprintf(fp, "\t.length = %d, .x86_64 = %d, .kaddr = %p}\n",
85 insn->length, insn->x86_64, insn->kaddr);
86}
87
88static void parse_args(int argc, char **argv)
89{
90 int c;
91 prog = argv[0];
92 while ((c = getopt(argc, argv, "ynv")) != -1) {
93 switch (c) {
94 case 'y':
95 x86_64 = 1;
96 break;
97 case 'n':
98 x86_64 = 0;
99 break;
100 case 'v':
101 verbose = 1;
102 break;
103 default:
104 usage();
105 }
106 }
107}
108
109#define BUFSIZE 256
110
111int main(int argc, char **argv)
112{
113 char line[BUFSIZE], sym[BUFSIZE] = "<unknown>";
114 unsigned char insn_buf[16];
115 struct insn insn;
116 int insns = 0, c;
117 int warnings = 0;
118
119 parse_args(argc, argv);
120
121 while (fgets(line, BUFSIZE, stdin)) {
122 char copy[BUFSIZE], *s, *tab1, *tab2;
123 int nb = 0;
124 unsigned int b;
125
126 if (line[0] == '<') {
127 /* Symbol line */
128 strcpy(sym, line);
129 continue;
130 }
131
132 insns++;
133 memset(insn_buf, 0, 16);
134 strcpy(copy, line);
135 tab1 = strchr(copy, '\t');
136 if (!tab1)
137 malformed_line(line, insns);
138 s = tab1 + 1;
139 s += strspn(s, " ");
140 tab2 = strchr(s, '\t');
141 if (!tab2)
142 malformed_line(line, insns);
143 *tab2 = '\0'; /* Characters beyond tab2 aren't examined */
144 while (s < tab2) {
145 if (sscanf(s, "%x", &b) == 1) {
146 insn_buf[nb++] = (unsigned char) b;
147 s += 3;
148 } else
149 break;
150 }
151 /* Decode an instruction */
152 insn_init(&insn, insn_buf, x86_64);
153 insn_get_length(&insn);
154 if (insn.length != nb) {
155 warnings++;
156 fprintf(stderr, "Warning: %s found difference at %s\n",
157 prog, sym);
158 fprintf(stderr, "Warning: %s", line);
159 fprintf(stderr, "Warning: objdump says %d bytes, but "
160 "insn_get_length() says %d\n", nb,
161 insn.length);
162 if (verbose)
163 dump_insn(stderr, &insn);
164 }
165 }
166 if (warnings)
167 fprintf(stderr, "Warning: decoded and checked %d"
168 " instructions with %d warnings\n", insns, warnings);
169 else
170 fprintf(stderr, "Succeed: decoded and checked %d"
171 " instructions\n", insns);
172 return 0;
173}
diff --git a/arch/x86/vdso/vdso32-setup.c b/arch/x86/vdso/vdso32-setup.c
index 58bc00f68b12..02b442e92007 100644
--- a/arch/x86/vdso/vdso32-setup.c
+++ b/arch/x86/vdso/vdso32-setup.c
@@ -393,7 +393,6 @@ static ctl_table abi_table2[] = {
393 393
394static ctl_table abi_root_table2[] = { 394static ctl_table abi_root_table2[] = {
395 { 395 {
396 .ctl_name = CTL_ABI,
397 .procname = "abi", 396 .procname = "abi",
398 .mode = 0555, 397 .mode = 0555,
399 .child = abi_table2 398 .child = abi_table2
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index dfbf70e65860..c462cea8ef09 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -1093,10 +1093,8 @@ asmlinkage void __init xen_start_kernel(void)
1093 1093
1094 __supported_pte_mask |= _PAGE_IOMAP; 1094 __supported_pte_mask |= _PAGE_IOMAP;
1095 1095
1096#ifdef CONFIG_X86_64
1097 /* Work out if we support NX */ 1096 /* Work out if we support NX */
1098 check_efer(); 1097 x86_configure_nx();
1099#endif
1100 1098
1101 xen_setup_features(); 1099 xen_setup_features();
1102 1100
diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c
index fe03eeed7b48..738da0cb0d8b 100644
--- a/arch/x86/xen/smp.c
+++ b/arch/x86/xen/smp.c
@@ -73,7 +73,7 @@ static __cpuinit void cpu_bringup(void)
73 73
74 xen_setup_cpu_clockevents(); 74 xen_setup_cpu_clockevents();
75 75
76 cpu_set(cpu, cpu_online_map); 76 set_cpu_online(cpu, true);
77 percpu_write(cpu_state, CPU_ONLINE); 77 percpu_write(cpu_state, CPU_ONLINE);
78 wmb(); 78 wmb();
79 79
diff --git a/arch/xtensa/include/asm/cacheflush.h b/arch/xtensa/include/asm/cacheflush.h
index b7b8fbe47c77..a508f2f73bd7 100644
--- a/arch/xtensa/include/asm/cacheflush.h
+++ b/arch/xtensa/include/asm/cacheflush.h
@@ -101,6 +101,7 @@ static inline void __invalidate_icache_page_alias(unsigned long virt,
101#define flush_cache_vmap(start,end) flush_cache_all() 101#define flush_cache_vmap(start,end) flush_cache_all()
102#define flush_cache_vunmap(start,end) flush_cache_all() 102#define flush_cache_vunmap(start,end) flush_cache_all()
103 103
104#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1
104extern void flush_dcache_page(struct page*); 105extern void flush_dcache_page(struct page*);
105extern void flush_cache_range(struct vm_area_struct*, ulong, ulong); 106extern void flush_cache_range(struct vm_area_struct*, ulong, ulong);
106extern void flush_cache_page(struct vm_area_struct*, unsigned long, unsigned long); 107extern void flush_cache_page(struct vm_area_struct*, unsigned long, unsigned long);
diff --git a/arch/xtensa/include/asm/socket.h b/arch/xtensa/include/asm/socket.h
index beb3a6bdb61d..cbdf2ffaacff 100644
--- a/arch/xtensa/include/asm/socket.h
+++ b/arch/xtensa/include/asm/socket.h
@@ -71,4 +71,6 @@
71#define SO_PROTOCOL 38 71#define SO_PROTOCOL 38
72#define SO_DOMAIN 39 72#define SO_DOMAIN 39
73 73
74#define SO_RXQ_OVFL 40
75
74#endif /* _XTENSA_SOCKET_H */ 76#endif /* _XTENSA_SOCKET_H */
diff --git a/arch/xtensa/include/asm/unistd.h b/arch/xtensa/include/asm/unistd.h
index c092c8fbb2cf..4e55dc763021 100644
--- a/arch/xtensa/include/asm/unistd.h
+++ b/arch/xtensa/include/asm/unistd.h
@@ -681,8 +681,10 @@ __SYSCALL(304, sys_signalfd, 3)
681__SYSCALL(305, sys_ni_syscall, 0) 681__SYSCALL(305, sys_ni_syscall, 0)
682#define __NR_eventfd 306 682#define __NR_eventfd 306
683__SYSCALL(306, sys_eventfd, 1) 683__SYSCALL(306, sys_eventfd, 1)
684#define __NR_recvmmsg 307
685__SYSCALL(307, sys_recvmmsg, 5)
684 686
685#define __NR_syscall_count 307 687#define __NR_syscall_count 308
686 688
687/* 689/*
688 * sysxtensa syscall handler 690 * sysxtensa syscall handler